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 2E2B4A0548 for ; Wed, 19 May 2021 19:08:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 20E6C4003F; Wed, 19 May 2021 19:08:33 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2047.outbound.protection.outlook.com [40.107.236.47]) by mails.dpdk.org (Postfix) with ESMTP id E560E4003F for ; Wed, 19 May 2021 19:08:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LG6hoC5r9XvD7IMWZPxCLnugRbTKAnqOzaPpVONyTRktBbAyuDkDw9/Lrg3QWH+LjWqTKBpeuknjO69xblPNk2sRwcy35BM004hWqyvs4r2I1UaymHUgXAS6NBy2EDHnUIgXbKaSLxJNgv9GeUDJbbqYgn0LpbxqcswR5LY5yqcdsb1GAhCp0SmmioJNELnxTTCJ5u1JfHpruOkzNJys2DQJ35ejCpdSnsQmUhwYlUNGdzlsjVrkpfRYGjqmtFCA9eqAOtlQ9g3MBEmNPZHT55L0Voa1XNG9/L3PDUk5P0TbmlBstd0J6SzFn/bbyBUhkHP1o+MDhRaIpcfJV41g7Q== 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=DYh9jULxIUGYJ7/7IllPQwXFuzBnz0IYKN5U9wd65W0=; b=cqeTmtK8ailwKmvRQToipFZgy58h4kCxSxmcbaPeCJZAR+zx5tPxlQedLY8wn9gsvMasV5vhztTQWfYPwC3fFZVTGWyXDw73DVsh5Ia3EKVxL1KVTQk8szyU7WLNJdJ6dP+ac3JkWatNwIWP4Q02hb4FNDPtDH96Qsl1anPMKaWgYfmc806uc/+fWKB6+p/nftxLIvxn/hLp07JhxCmDYhqkgXLpgVudniabqeVP6btg6KxBIVwshRt5v3czTAZrlBdM2QEsbVGBAQJ0zafwBMtImxXt8NtrGzh3+QmQp2RlPuzw/CDq5OYkCfNao3edlKEawfqtqxLDJhIaJVSx+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=canonical.com 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=DYh9jULxIUGYJ7/7IllPQwXFuzBnz0IYKN5U9wd65W0=; b=B+75Ut1LGhSfU6uagA+KX0/ySxu706LDrmxiCAPqKxgVwk8kg3tiUTMDFw4KFGKBPVv5T6vWqx8jndLlGpbGxku+8YTrZmVHSA/e4vabwXQHetdCPQhw360PRZqckXJd0zuGwUE75V7I6Va59pHPmWo/b7KX6NKpMn6yJZl7zgMrjQQAOXTRHTR/KqhT8j8s1Hb9WRemGTzK6AF/OmcRmGQlVhKbYxlJ4hOvNGs+R0zh9VQGvkMlM4vMvH/gv+8x5nprhGu8dQ3fPp2FqT+9+UXnAmjGsDaz+h+Cl6BFARCapoVtqKIg4tOIO4jzNScyNBKv+09mwSpS/ExDGJ3ILQ== Received: from BN9PR03CA0455.namprd03.prod.outlook.com (2603:10b6:408:139::10) by DM6PR12MB3996.namprd12.prod.outlook.com (2603:10b6:5:1c1::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Wed, 19 May 2021 17:08:30 +0000 Received: from BN8NAM11FT010.eop-nam11.prod.protection.outlook.com (2603:10b6:408:139:cafe::c3) by BN9PR03CA0455.outlook.office365.com (2603:10b6:408:139::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25 via Frontend Transport; Wed, 19 May 2021 17:08:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; canonical.com; dkim=none (message not signed) header.d=none;canonical.com; 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 BN8NAM11FT010.mail.protection.outlook.com (10.13.177.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4129.25 via Frontend Transport; Wed, 19 May 2021 17:08:30 +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; Wed, 19 May 2021 17:08:28 +0000 From: Viacheslav Ovsiienko To: CC: , Date: Wed, 19 May 2021 20:08:11 +0300 Message-ID: <20210519170811.29769-1-viacheslavo@nvidia.com> X-Mailer: git-send-email 2.18.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d05d07e8-f239-4138-af27-08d91ae8b9fd X-MS-TrafficTypeDiagnostic: DM6PR12MB3996: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 22ljNJyCQfZJBNkcgx0NLCSVD/H3xJvZsHloGE23YAtshHeljzba9IRoMVyl6UXezRMPma9mfFu9Dc7BIsS+aUHyf7hyIaqKxLSRs0EtNpqXISLFVCAmIg0cbodfKw4d+Hz7Rl9cgL6DD4UHHMiEzYCS7jqhSBs2pHlooTjEKU6bienQoRyu4WxssqGqjzbATCiwMFkzWG6E4R/4NsE0C5QP6WXc0z+RmZj0OtLgL3HOMozM4kuLYj+puGbXL1B9cGAzyI2d80nzp5hLVBbAr7+ZWyOcrVq/EEwX/KEks9DpRcWsZcLMYFVJ9rEkKzXwfCYNQMQmcSpkzct0iqRN6NsFkQANXUSZRat/yCGOHt7bZ0WNeEwp9P8PppqjqZ6gH9pBGxIaVI2lCdc42fhMjXennLoCuY4bGq6ENBeIOId1bi/OtbPCkxxtB6yZlm5rnOYa/hBJ9niJVScg+8j2xxwSiSFA+fu99YPLrNZC4gK4R6+owKnbo2H90uKa9cGMXcj/k6yrVKl2C9Wr6IMl23w4dXzIsqLQDOynFhdCLNO3EVast/wSdfJk4UOGzKvN94Nydy6JOfJQfvh1oXGD80lucBeVCK6fkE08Smsu2UGQdrAlxpm+X3LCujSwfQHCkz3XWpbIHLbLVNopnj/DDSrPDyBf00GldYZSLrOiF6M= 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)(39860400002)(376002)(136003)(346002)(396003)(36840700001)(46966006)(54906003)(7696005)(316002)(70206006)(70586007)(356005)(36906005)(8676002)(7636003)(8936002)(478600001)(82310400003)(86362001)(47076005)(4326008)(336012)(26005)(107886003)(6286002)(2616005)(426003)(186003)(16526019)(55016002)(36756003)(36860700001)(6666004)(1076003)(6916009)(2906002)(5660300002)(82740400003)(83380400001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2021 17:08:30.3072 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d05d07e8-f239-4138-af27-08d91ae8b9fd 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: BN8NAM11FT010.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3996 Subject: [dpdk-stable] [PATCH 19.11] net/mlx5: fix drop action for Direct Rules/Verbs 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" [ 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") Cc: stable@dpdk.org Signed-off-by: Viacheslav Ovsiienko Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5.c | 24 +++++++++++++++++------- drivers/net/mlx5/mlx5.h | 2 +- drivers/net/mlx5/mlx5_flow_dv.c | 10 +++++++++- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 8c5e27042..e0ba60086 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -998,7 +998,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 sh->pop_vlan_action = mlx5_glue->dr_create_flow_action_pop_vlan(); @@ -1018,9 +1028,9 @@ mlx5_alloc_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; } if (sh->pop_vlan_action) { mlx5_glue->destroy_flow_action(sh->pop_vlan_action); @@ -1063,9 +1073,9 @@ mlx5_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 f3b6ece19..70509959f 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -679,7 +679,7 @@ struct mlx5_ibv_shared { #endif struct mlx5_hlist *flow_tbls; /* 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. */ LIST_HEAD(encap_decap, mlx5_flow_dv_encap_decap_resource) encaps_decaps; LIST_HEAD(modify_cmd, mlx5_flow_dv_modify_hdr_resource) modify_cmds; diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 6dc4e680e..cea45a6d9 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -7918,8 +7918,15 @@ __flow_dv_apply(struct rte_eth_dev *dev, struct rte_flow *flow, n = dv->actions_n; if (dev_flow->actions & MLX5_FLOW_ACTION_DROP) { if (dev_flow->transfer) { - dv->actions[n++] = priv->sh->esw_drop_action; + assert(priv->sh->dr_drop_action); + dv->actions[n++] = priv->sh->dr_drop_action; } else { +#ifdef HAVE_MLX5DV_DR + /* DR supports drop action placeholder. */ + assert(priv->sh->dr_drop_action); + dv->actions[n++] = priv->sh->dr_drop_action; +#else + /* For DV we use the explicit drop queue. */ dv->hrxq = mlx5_hrxq_drop_new(dev); if (!dv->hrxq) { rte_flow_error_set @@ -7930,6 +7937,7 @@ __flow_dv_apply(struct rte_eth_dev *dev, struct rte_flow *flow, goto error; } dv->actions[n++] = dv->hrxq->action; +#endif } } else if (dev_flow->actions & (MLX5_FLOW_ACTION_QUEUE | MLX5_FLOW_ACTION_RSS)) { -- 2.18.1