From patchwork Mon Apr 29 18:14:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 1092766 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="VKY3fF7Y"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 44tCVB4tB8z9s5c for ; Tue, 30 Apr 2019 04:14:26 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729057AbfD2SOZ (ORCPT ); Mon, 29 Apr 2019 14:14:25 -0400 Received: from mail-eopbgr60042.outbound.protection.outlook.com ([40.107.6.42]:53125 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728928AbfD2SOY (ORCPT ); Mon, 29 Apr 2019 14:14:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ifr7E60v34KuQgW/ajhJjR97FCgZb6ysoYEVKz4hUwA=; b=VKY3fF7Y3SCZErld7WNKBSLB5go2kDuj7/zUxzFFMfa3Sp9huuWvgEQR3u0Hsir8f4hwa6KkxUfuHz2jBzgjpmE99UGcW/mk90SnCpXRVoUWSj0aFTUqYjXkGKV6NBKrajdlhDx9f7f072pS3Cso37u5Ff902o1jwDLyPqbLBf0= Received: from DB8PR05MB5898.eurprd05.prod.outlook.com (20.179.9.32) by DB8PR05MB6026.eurprd05.prod.outlook.com (20.179.10.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.16; Mon, 29 Apr 2019 18:14:14 +0000 Received: from DB8PR05MB5898.eurprd05.prod.outlook.com ([fe80::ed24:8317:76e4:1a07]) by DB8PR05MB5898.eurprd05.prod.outlook.com ([fe80::ed24:8317:76e4:1a07%4]) with mapi id 15.20.1835.018; Mon, 29 Apr 2019 18:14:14 +0000 From: Saeed Mahameed To: Saeed Mahameed , Leon Romanovsky CC: Jason Gunthorpe , "netdev@vger.kernel.org" , "linux-rdma@vger.kernel.org" , Maor Gottlieb , Mark Bloch Subject: [PATCH V2 mlx5-next 08/11] net/mlx5: Add new miss flow table action Thread-Topic: [PATCH V2 mlx5-next 08/11] net/mlx5: Add new miss flow table action Thread-Index: AQHU/rdaWuNAVKpRDEGXa3haM04kfQ== Date: Mon, 29 Apr 2019 18:14:14 +0000 Message-ID: <20190429181326.6262-9-saeedm@mellanox.com> References: <20190429181326.6262-1-saeedm@mellanox.com> In-Reply-To: <20190429181326.6262-1-saeedm@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.20.1 x-originating-ip: [209.116.155.178] x-clientproxiedby: BYAPR04CA0033.namprd04.prod.outlook.com (2603:10b6:a03:40::46) To DB8PR05MB5898.eurprd05.prod.outlook.com (2603:10a6:10:a4::32) authentication-results: spf=none (sender IP is ) smtp.mailfrom=saeedm@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d09e5def-6565-4a38-545e-08d6ccce7c8e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:DB8PR05MB6026; x-ms-traffictypediagnostic: DB8PR05MB6026: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1468; x-forefront-prvs: 0022134A87 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(136003)(366004)(39860400002)(396003)(189003)(199004)(25786009)(3846002)(66476007)(64756008)(66446008)(66556008)(107886003)(305945005)(76176011)(256004)(14444005)(52116002)(450100002)(4326008)(66066001)(386003)(6506007)(6116002)(14454004)(478600001)(73956011)(6512007)(66946007)(53936002)(8936002)(36756003)(11346002)(2616005)(2906002)(71190400001)(71200400001)(5660300002)(110136005)(186003)(316002)(26005)(486006)(6636002)(54906003)(446003)(6436002)(68736007)(99286004)(7736002)(50226002)(85306007)(102836004)(81166006)(81156014)(8676002)(86362001)(6486002)(97736004)(1076003)(476003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB8PR05MB6026; H:DB8PR05MB5898.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 7QrGbJo1StZkQTa+fAUmJEnOnzO0a4U2b1Uu0z5dlUpk1SDOna1l3OCxLZef+O1tb6M+g2O2GhcUrX0cFKEtO5hbTXX9i4uOiR1UuG8Eokx0Df2K5qtYz1iUQuExZarnSgphWvGk83eMMgzc4fQlkOarQvxcIKdn1Ux9ltr7TYYN3K+xk9tZNsEbxd/sf0ntz0O7KBq55qjLAqthN8oIUTg8LVHwMheNbgT+zChnJdc2js/GwDc7gO1ol1xxobfM1QqoArcfi282tcxUXcZJvM8bE+M5yS1thXRusbDCN+F9RSS1dWKqpopT38Fik83uIXHD8P09UUemd9sveWc4b8iH6K6G4vwxIqXHB2UNvsnU2tjhA+YkF/7B2uGRgRs5SicENJ+uSLMLg7BND5cn3mKxPsfxtGRe2q15YJvNDJc= MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: d09e5def-6565-4a38-545e-08d6ccce7c8e X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Apr 2019 18:14:14.7437 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR05MB6026 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Maor Gottlieb Flow table supports three types of miss action: 1. Default miss action - go to default miss table according to table. 2. Go to specific table. 3. Switch domain - go to the root table of an alternative steering table domain. New table miss action was added - switch_domain. The next domain for RDMA_RX namespace is the NIC RX domain. Signed-off-by: Maor Gottlieb Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c | 13 ++++++++++--- drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 6 +++++- drivers/net/ethernet/mellanox/mlx5/core/fs_core.h | 1 + include/linux/mlx5/mlx5_ifc.h | 10 +++++++++- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c index 629c5ab1c0d1..013b1ca4a791 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c @@ -172,9 +172,14 @@ static int mlx5_cmd_create_flow_table(struct mlx5_flow_root_namespace *ns, case FS_FT_OP_MOD_NORMAL: if (next_ft) { MLX5_SET(create_flow_table_in, in, - flow_table_context.table_miss_action, 1); + flow_table_context.table_miss_action, + MLX5_FLOW_TABLE_MISS_ACTION_FWD); MLX5_SET(create_flow_table_in, in, flow_table_context.table_miss_id, next_ft->id); + } else { + MLX5_SET(create_flow_table_in, in, + flow_table_context.table_miss_action, + ns->def_miss_action); } break; @@ -246,13 +251,15 @@ static int mlx5_cmd_modify_flow_table(struct mlx5_flow_root_namespace *ns, MLX5_MODIFY_FLOW_TABLE_MISS_TABLE_ID); if (next_ft) { MLX5_SET(modify_flow_table_in, in, - flow_table_context.table_miss_action, 1); + flow_table_context.table_miss_action, + MLX5_FLOW_TABLE_MISS_ACTION_FWD); MLX5_SET(modify_flow_table_in, in, flow_table_context.table_miss_id, next_ft->id); } else { MLX5_SET(modify_flow_table_in, in, - flow_table_context.table_miss_action, 0); + flow_table_context.table_miss_action, + ns->def_miss_action); } } diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c index 3c2302a2b9d4..fb5b61727ee7 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c @@ -2504,6 +2504,9 @@ static int init_rdma_rx_root_ns(struct mlx5_flow_steering *steering) if (!steering->rdma_rx_root_ns) return -ENOMEM; + steering->rdma_rx_root_ns->def_miss_action = + MLX5_FLOW_TABLE_MISS_ACTION_SWITCH_DOMAIN; + /* Create single prio */ prio = fs_create_prio(&steering->rdma_rx_root_ns->ns, 0, 1); if (IS_ERR(prio)) { @@ -2748,7 +2751,8 @@ int mlx5_init_fs(struct mlx5_core_dev *dev) goto err; } - if (MLX5_CAP_FLOWTABLE_RDMA_RX(dev, ft_support)) { + if (MLX5_CAP_FLOWTABLE_RDMA_RX(dev, ft_support) && + MLX5_CAP_FLOWTABLE_RDMA_RX(dev, table_miss_action_domain)) { err = init_rdma_rx_root_ns(steering); if (err) goto err; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h index e43c6f6d46a7..0c6c5fef4548 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h @@ -218,6 +218,7 @@ struct mlx5_flow_root_namespace { struct mutex chain_lock; struct list_head underlay_qpns; const struct mlx5_flow_cmds *cmds; + enum mlx5_flow_table_miss_action def_miss_action; }; int mlx5_init_fc_stats(struct mlx5_core_dev *dev); diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index 89e7194b3d97..7d9264b282d1 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h @@ -370,7 +370,9 @@ struct mlx5_ifc_flow_table_prop_layout_bits { u8 reformat_l3_tunnel_to_l2[0x1]; u8 reformat_l2_to_l3_tunnel[0x1]; u8 reformat_and_modify_action[0x1]; - u8 reserved_at_15[0xb]; + u8 reserved_at_15[0x2]; + u8 table_miss_action_domain[0x1]; + u8 reserved_at_18[0x8]; u8 reserved_at_20[0x2]; u8 log_max_ft_size[0x6]; u8 log_max_modify_header_context[0x8]; @@ -1284,6 +1286,12 @@ enum mlx5_flow_destination_type { MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE_NUM = 0x101, }; +enum mlx5_flow_table_miss_action { + MLX5_FLOW_TABLE_MISS_ACTION_DEF, + MLX5_FLOW_TABLE_MISS_ACTION_FWD, + MLX5_FLOW_TABLE_MISS_ACTION_SWITCH_DOMAIN, +}; + struct mlx5_ifc_dest_format_struct_bits { u8 destination_type[0x8]; u8 destination_id[0x18];