From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F3279A0A0E for ; Mon, 10 May 2021 18:17:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E462341108; Mon, 10 May 2021 18:17:53 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2073.outbound.protection.outlook.com [40.107.244.73]) by mails.dpdk.org (Postfix) with ESMTP id 8115841108 for ; Mon, 10 May 2021 18:17:52 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EoBfSbni+D59oLRdIziEXBveBhuvxOYX/8AQ1EZRE6MTFmMdqy/AvEE3UpVTvWKGLEmdAIV0+1N161KZjHoj1EJ9n+x0z/lIgC5CfLsOMH1AIa6A81I9GIvcyWswFs8j9ZJybLBZXsFJ5RV8BIK65WEzZ1oFuOG38ZEJCWFw5aGl9YXHRV2unpVZxRUb1ffIvk49xMHXq8Bgkfmf8mF51eLVztWoGtGg/CCDvIWo44CpjXJdoQ2VDf16Gx13n6tL9PyAklnB79SZDJXypK2mQapXQMmzT2jOZShCkWq2sxsdm/r5PNZI85KAg7aSOrvHlS7vYb83ADahHqC5SD5MXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Y/vRfSDgMY2Xe3xkPtet9vtSuS1uNAP+3GK9iyrxasg=; b=aBo6h0T6foUDA5BmFGacpwZI9slDFhpLERmfDoB1PfeYdxPPQbK71C6ldVGfYHlEGZCoA9yI9wRRIurR1xJK4wpHJT7E1yNFYf0xNQ6WxF+WsuoCDuZdzXCBp8174XPsS96qcE9/QWGUXU3EvKC0yTN+RAsqk+IsiXRNE3HCvRs1mYT18bI7MhczjWHdiLxUVW2UeYTlop+TYjz/T5rUpREhfsrKDnmfj+1x0KL26nm+h0qbl7odpGQodwrzwdAn6pqpylsjJnZtRWsIsMjxCroBvQm+ga2SQvOS131AAyCcIYXCUF57/PD9vmCV6er7G0nhRO8Lc7sg+6O4IOP7KA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Y/vRfSDgMY2Xe3xkPtet9vtSuS1uNAP+3GK9iyrxasg=; b=SfD7/80zDB8XdnnHU4ZN9Z1yAr5b3ecbN7GTIU8Q4cBFlJt9PXkQ0JLo22xXQ4gcbEenXDSNrucwDjxZBBDImXLCkI4hqFUWELkfLNRj0m8OPcDc2NAZIerzoUcuAZJemYQTS6Y7QegcgfX+IiqS5PrzM5nXNthIQ39PWSxf271/sjcnI2Y79/Xt3mFLIdDBQ6p+XTXv9M3txmO9mi2fipLN6y1YeADZyU2E0Y0QJBLiU4RjE7WM09GkNK/BF3iIJ/qHFs8U+mEaebHsd5JvoY1MR4vI1d3OT8GTpwtNkpEnal+kDI610JkRrZ55S4pn1TW+3VDzujKb6BL2P4JHMQ== Received: from DS7PR03CA0048.namprd03.prod.outlook.com (2603:10b6:5:3b5::23) by MWHPR12MB1183.namprd12.prod.outlook.com (2603:10b6:300:d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.26; Mon, 10 May 2021 16:17:50 +0000 Received: from DM6NAM11FT009.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b5:cafe::1f) by DS7PR03CA0048.outlook.office365.com (2603:10b6:5:3b5::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:17:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT009.mail.protection.outlook.com (10.13.173.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:17:50 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 10 May 2021 16:17:48 +0000 From: Xueming Li To: Viacheslav Ovsiienko CC: Luca Boccassi , Matan Azrad , "dpdk stable" Date: Tue, 11 May 2021 00:01:35 +0800 Message-ID: <20210510160258.30982-146-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210510160258.30982-1-xuemingl@nvidia.com> References: <20210510160258.30982-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5d1e2372-db1e-4bbf-d8f5-08d913cf2869 X-MS-TrafficTypeDiagnostic: MWHPR12MB1183: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: THZxTjCMCv5TLaFEoAsDPOjzrT0B8XINTyPh2k//EC9RTUjTz3wPE1ugEXvkC8H/d/5kZj096JnIOnN+soDVko6aZ7tfcKFSrroAv3KbSddh9n87RqTxPIccRk1p5MQUx4jWIR+ZVXrycLmKHGboP3nUVunhpGt7UOaTKibJ5NC4OCqagd/fzYY/lCKzNdC0VINtfL+IOVvTi4Wh0//M3eWnAQ/U9o6pVE9LXcO8/215orLIzyYt7gcZ7uee6XTn4Vs+CtPJV5y9aFlKm/sanQ4pbOpR8PHbOO8UQFlqxu/4VL3SQTtau+sJxUaJZwPbMB5RdzXMBQ1OgqopOFnIk0o1mFh38RuY3cXchsmcp9uubZpGJVlYKPlq5RMAxSyqRBtF0Rzfi0F/0nVvUdJCGP7V847msqJFYs7otPKdUcKHZPzC5ARE0dBgRppMl4cfK825beBH/YyLBnHXxUA+hFHmVhVfZhnZFeKg36e8yHUuePWMJBwY19DUdmqZsYfScf38MiAbWLpwP0vaVfBnZ/kxMVqiPnfQaJeHmhjRi5mXDPReukXQqhE3RAYGlmQ06ippDa0gebFXN/0oCC+RqT0PvEcXjsfUqTJqexmC/6hc+u8UAqxwESCnE+aa3Qz1jUtHSRKB0utrGLHLxPCZNtcOXPg6lUV3OAaFpiwhVBn9mHKiXTyho8/v7IwNT634D9uGYOpheOA13RempXHLku7h6ozz6fgZTtOUzAxLfItK7IwsJr8hx0ZZVK8ZfnNtFsNSkCHSby5mHajyS3e94Q== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(966005)(498600001)(186003)(53546011)(16526019)(26005)(7636003)(82310400003)(83380400001)(336012)(2906002)(426003)(2616005)(86362001)(36906005)(356005)(47076005)(8676002)(6666004)(55016002)(7696005)(6636002)(6862004)(4326008)(5660300002)(1076003)(6286002)(37006003)(54906003)(70206006)(70586007)(8936002)(36756003)(36860700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 16:17:50.4720 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5d1e2372-db1e-4bbf-d8f5-08d913cf2869 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT009.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1183 Subject: [dpdk-stable] patch 'net/mlx5: fix drop action for Direct Rules/Verbs' has been queued to stable release 20.11.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/12/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/f30dc57e7857c39d34d1255a589f11ee499b9d17 Thanks. Xueming Li --- >From f30dc57e7857c39d34d1255a589f11ee499b9d17 Mon Sep 17 00:00:00 2001 From: Viacheslav Ovsiienko Date: Mon, 5 Apr 2021 09:59:01 +0000 Subject: [PATCH] net/mlx5: fix drop action for Direct Rules/Verbs Cc: Luca Boccassi [ upstream commit da845ae9d7c1499cbf76e766604cc981ddd9eb17 ] There are multiple branches in rdma-core library backing the rte flows: - Verbs - Direct Verbs (DV) - Direct Rules (DR) The Verbs API always requires the specifying the queue even if there is the drop action in the flow, though the kernel optimizes out the actual queue usage for the flows containing the drop action. The PMD handles the dedicated Rx queue to provide Verbs API compatibility. The DV/DR API does not require explicit specifying the queue at the flow creation, but PMD still specified the dedicated drop queue as action. It performed the packet forwarding to the dummy queue (that was not polled at all) causing the steering pipeline resources usage and degrading the overall packet processing rate. For example, with inserted flow to drop all the ingress packets the statistics reported only 15Mpps of 64B packets were received over 100Gbps line. Since the Direct Rule API for E-Switch was introduced the rdma-core supports the dedicated drop action, that is recognized both for DV and DR and can be used for the entire device in unified fashion, regardless of steering domain. The similar drop action was introduced for E-Switch, the usage of this one can be extended for other steering domains, not for E-Switch's one only. This patch: - renames esw_drop_action to dr_drop_action to emphasize the global nature of the variable (not only E-Switch domain) - specifies this global drop action instead of dedicated drop queue for the DR/DV flows Fixes: 34fa7c0268e7 ("net/mlx5: add drop action to Direct Verbs E-Switch") Fixes: 65b3cd0dc39b ("net/mlx5: create global drop action") Signed-off-by: Viacheslav Ovsiienko Acked-by: Matan Azrad --- drivers/net/mlx5/linux/mlx5_os.c | 24 +++++++++++++++++------- drivers/net/mlx5/mlx5.h | 2 +- drivers/net/mlx5/mlx5_flow_dv.c | 13 +++++++++++-- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index 91001473b0..fb385460e5 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -319,7 +319,17 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv) goto error; } sh->fdb_domain = domain; - sh->esw_drop_action = mlx5_glue->dr_create_flow_action_drop(); + } + /* + * The drop action is just some dummy placeholder in rdma-core. It + * does not belong to domains and has no any attributes, and, can be + * shared by the entire device. + */ + sh->dr_drop_action = mlx5_glue->dr_create_flow_action_drop(); + if (!sh->dr_drop_action) { + DRV_LOG(ERR, "FDB mlx5dv_dr_create_flow_action_drop"); + err = errno; + goto error; } #endif if (!sh->tunnel_hub) @@ -355,9 +365,9 @@ error: mlx5_glue->dr_destroy_domain(sh->fdb_domain); sh->fdb_domain = NULL; } - if (sh->esw_drop_action) { - mlx5_glue->destroy_flow_action(sh->esw_drop_action); - sh->esw_drop_action = NULL; + if (sh->dr_drop_action) { + mlx5_glue->destroy_flow_action(sh->dr_drop_action); + sh->dr_drop_action = NULL; } if (sh->pop_vlan_action) { mlx5_glue->destroy_flow_action(sh->pop_vlan_action); @@ -412,9 +422,9 @@ mlx5_os_free_shared_dr(struct mlx5_priv *priv) mlx5_glue->dr_destroy_domain(sh->fdb_domain); sh->fdb_domain = NULL; } - if (sh->esw_drop_action) { - mlx5_glue->destroy_flow_action(sh->esw_drop_action); - sh->esw_drop_action = NULL; + if (sh->dr_drop_action) { + mlx5_glue->destroy_flow_action(sh->dr_drop_action); + sh->dr_drop_action = NULL; } #endif if (sh->pop_vlan_action) { diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 9bf1bf3146..97f8a016b4 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -719,7 +719,7 @@ struct mlx5_dev_ctx_shared { struct mlx5_hlist *flow_tbls; struct mlx5_flow_tunnel_hub *tunnel_hub; /* Direct Rules tables for FDB, NIC TX+RX */ - void *esw_drop_action; /* Pointer to DR E-Switch drop action. */ + void *dr_drop_action; /* Pointer to DR drop action, any domain. */ void *pop_vlan_action; /* Pointer to DR pop VLAN action. */ struct mlx5_hlist *encaps_decaps; /* Encap/decap action hash list. */ struct mlx5_hlist *modify_cmds; diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 94550e5a73..b1c8a95e8a 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -10839,11 +10839,19 @@ flow_dv_apply(struct rte_eth_dev *dev, struct rte_flow *flow, n = dv->actions_n; if (dh->fate_action == MLX5_FLOW_FATE_DROP) { if (dv->transfer) { - dv->actions[n++] = priv->sh->esw_drop_action; + MLX5_ASSERT(priv->sh->dr_drop_action); + dv->actions[n++] = priv->sh->dr_drop_action; } else { +#ifdef HAVE_MLX5DV_DR + /* DR supports drop action placeholder. */ + MLX5_ASSERT(priv->sh->dr_drop_action); + dv->actions[n++] = priv->sh->dr_drop_action; +#else + /* For DV we use the explicit drop queue. */ MLX5_ASSERT(priv->drop_queue.hrxq); dv->actions[n++] = priv->drop_queue.hrxq->action; +#endif } } else if ((dh->fate_action == MLX5_FLOW_FATE_QUEUE && !dv_h->rix_sample && !dv_h->rix_dest_array)) { @@ -12610,7 +12618,8 @@ mlx5_flow_dv_discover_counter_offset_support(struct rte_eth_dev *dev) &actions[0]); if (ret) goto err; - actions[1] = priv->drop_queue.hrxq->action; + actions[1] = sh->dr_drop_action ? sh->dr_drop_action : + priv->drop_queue.hrxq->action; dv_attr.match_criteria_enable = flow_dv_matcher_enable(mask.buf); ret = mlx5_flow_os_create_flow_matcher(sh->ctx, &dv_attr, tbl->obj, &matcher); -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-10 23:59:30.377593400 +0800 +++ 0147-net-mlx5-fix-drop-action-for-Direct-Rules-Verbs.patch 2021-05-10 23:59:26.570000000 +0800 @@ -1 +1 @@ -From da845ae9d7c1499cbf76e766604cc981ddd9eb17 Mon Sep 17 00:00:00 2001 +From f30dc57e7857c39d34d1255a589f11ee499b9d17 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Luca Boccassi + +[ upstream commit da845ae9d7c1499cbf76e766604cc981ddd9eb17 ] @@ -42 +44,0 @@ -Cc: stable@dpdk.org @@ -53 +55 @@ -index 2d5bcab4cf..6ac334263e 100644 +index 91001473b0..fb385460e5 100644 @@ -56 +58 @@ -@@ -325,7 +325,17 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv) +@@ -319,7 +319,17 @@ mlx5_alloc_shared_dr(struct mlx5_priv *priv) @@ -75 +77 @@ -@@ -361,9 +371,9 @@ error: +@@ -355,9 +365,9 @@ error: @@ -88 +90 @@ -@@ -418,9 +428,9 @@ mlx5_os_free_shared_dr(struct mlx5_priv *priv) +@@ -412,9 +422,9 @@ mlx5_os_free_shared_dr(struct mlx5_priv *priv) @@ -102 +104 @@ -index 6faba4fbb1..0f69f9d125 100644 +index 9bf1bf3146..97f8a016b4 100644 @@ -105 +107 @@ -@@ -729,7 +729,7 @@ struct mlx5_dev_ctx_shared { +@@ -719,7 +719,7 @@ struct mlx5_dev_ctx_shared { @@ -115 +117 @@ -index 533dadf07b..691595942f 100644 +index 94550e5a73..b1c8a95e8a 100644 @@ -118 +120 @@ -@@ -12059,11 +12059,19 @@ flow_dv_apply(struct rte_eth_dev *dev, struct rte_flow *flow, +@@ -10839,11 +10839,19 @@ flow_dv_apply(struct rte_eth_dev *dev, struct rte_flow *flow, @@ -139 +141 @@ -@@ -13849,7 +13857,8 @@ mlx5_flow_dv_discover_counter_offset_support(struct rte_eth_dev *dev) +@@ -12610,7 +12618,8 @@ mlx5_flow_dv_discover_counter_offset_support(struct rte_eth_dev *dev)