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 7940CA0A0E for ; Thu, 13 May 2021 10:05:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 68BE2410FD; Thu, 13 May 2021 10:05:35 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2045.outbound.protection.outlook.com [40.107.236.45]) by mails.dpdk.org (Postfix) with ESMTP id E65F44003F; Thu, 13 May 2021 10:05:33 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dPAAVHguF31K8iw6a9Rsj12iytT4K7Rc6CBg6QjUA1glxPz75FpGTSarI6hBBVDqLFbhBCanzyX8Zy20ZEopli1xk2jT15eCzrsBJZYgwLSur6qpitDBBVfEnAlSAl+v4C4Osq8M10fKLZsb+jNYVGwqG0jUfHYCZBLsDfbdufDdXNq0UuJ4gUS77QO8COCDsNeqRUYH1JZT1MrY/PJJqXUdVP7g6eAtLPDmOUynwZswFVLqUIXKG5Lmw4LiJ9EqTj+4faLE+GPAtWXkHRSuat3Bu/nB5tKAxkWzdKrfP+G2KopeR0jkvKHcQPVhkxakaRbY8Cq9rjiqsYN4y3odrA== 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=R9Fkh0vpK4btUd1CaQCi7h9HHlL9zjxvBjaxwo3BcYs=; b=W/v0YhR+fBn3sai86qfXdxEyiXl5FYJIGgf+wj7cxgK/5dJ2DrMnyYczyrhqT8+00QYwLjfxznWDK0imhT30aabRYXFbi7UWuIRpLwEERgDsJFb9G7eJXa7F64oqwEYIVPuRAaCh3YDCcqCxDeN6bdIoAZKGG17RI9Ea46xigSOI+y7c3zFf3I1RmtigF//DjQVGau6qAA4e3BGadAvE0QE5o7uKgiRTEw7ZQ8BoHQXtMr57T9jgYf5bYdILTS/Pfvt4cNkljykbME/HZaMqZFVm6+cKC4ZSc14cD1A95/FtS4Yhe0oXrSI1CVmsY8bI4chhBd5RIdSdkIPkTBwxjQ== 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=R9Fkh0vpK4btUd1CaQCi7h9HHlL9zjxvBjaxwo3BcYs=; b=CD6g5Aps1s4a4PYT9TD5rIsBb3hBad/HbxReDClVS04cq5lrEDuOIfEGbKLECWfZqHerR2rVJxkidwr0hja0Hjj03Z5ynNsVktwGHVEjBCwPMHNnGWQiUtiKOf01or4f8xtwI3x/VxC+EnSRe+AWZhKmiIoW0Pfie/LTNWq0ThHVKCnLE9QIU0PUUrPWkzKx+wuMNLVfRTOGpb1nC6dTgjpHfYe12RTlrOL7ZOkiLodmFqp4dwf04XLB7dC4ec5R7wMXnR6LFZtVWs2sogRAE8lxfmuYRrfDpUHyME/+Fh/xOLZYtVRjYP8iuH9JercHPNcoX7ecpSBmMNQDOw5TzA== Received: from DM3PR14CA0144.namprd14.prod.outlook.com (2603:10b6:0:53::28) by MWHPR12MB1247.namprd12.prod.outlook.com (2603:10b6:300:10::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Thu, 13 May 2021 08:05:32 +0000 Received: from DM6NAM11FT045.eop-nam11.prod.protection.outlook.com (2603:10b6:0:53:cafe::7c) by DM3PR14CA0144.outlook.office365.com (2603:10b6:0:53::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.24 via Frontend Transport; Thu, 13 May 2021 08:05:32 +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 DM6NAM11FT045.mail.protection.outlook.com (10.13.173.123) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4129.25 via Frontend Transport; Thu, 13 May 2021 08:05:32 +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; Thu, 13 May 2021 08:05:30 +0000 From: Suanming Mou To: , CC: , , Date: Thu, 13 May 2021 11:05:15 +0300 Message-ID: <20210513080515.10644-1-suanmingm@nvidia.com> X-Mailer: git-send-email 2.27.0 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: a93e8a97-23c6-4643-92eb-08d915e5e188 X-MS-TrafficTypeDiagnostic: MWHPR12MB1247: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ckwMLMKLw8e+nNxvlyGC3K3irzNPhqSuIb87BSNQNMYaEPpN89V4fn9skKEFuorJK3NX+0587UFCJGujCXRYFi6FIg4Z31bC2/xErbq46n72p7ttcbKQ+uU5dzUsoeEDw19XYDMwKc6UpA06eSuju7xdI6wXFVjqN2/YkX2VLDJ7jej3UK4N7g85xrA6xiiy4VR/5fdRu00pW30ilf3XlrCWUUoZvdjLK3OKM4Kg83aGdStyRrfwEUqbRiSNynovzF1UqKPMiVEP1e2wLHLKvpnasEJxHz5E6epxkraUwTnTT6iz7U7Ds65jnmFxHYo6kLR9diPBoapQescjDeAe3MDZaUjN3E+IPTH1hO6k9tYtpGwGzph5qxF0PWGVkMYA9vKhxVcjMu9unwLCpAAWX0xbyrKWblUupEJ4hUY4R7uMHWNEbkkvW5sLqgvDmi9Y09P9wZJE2jwwJTHDp8LawXuxrxttdHcFE4NXxspai0Zida2uJPQaLu0QnLzxDJ3+SFB/YoN7MrdtiwxDZyjBTn0jXa/TpTmVmdFrTRu191y2vXD4px2tfPlz4Ge/Q/6ABJ6nSdFP33pB49qiq3m4xHfBYbmrRJivYlo9xdWboLFUEeKuEeQtnqjWBjEoea0fBirJxwDTt/CfVar6igX3Yw== 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)(136003)(346002)(39860400002)(396003)(376002)(36840700001)(46966006)(6666004)(47076005)(86362001)(54906003)(26005)(4326008)(186003)(356005)(6636002)(8676002)(70206006)(70586007)(16526019)(82310400003)(2906002)(5660300002)(7696005)(36906005)(2616005)(426003)(36756003)(450100002)(8936002)(1076003)(36860700001)(336012)(110136005)(55016002)(478600001)(83380400001)(7636003)(82740400003)(6286002)(316002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 May 2021 08:05:32.1346 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a93e8a97-23c6-4643-92eb-08d915e5e188 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: DM6NAM11FT045.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1247 Subject: [dpdk-stable] [PATCH] net/mlx5: fix counter offset detection 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" Currently, the counter offset support is discovered by creating the rule with invalid offset counter and drop action in root table. If the rule creation fails with EINVAL errno, that mean counter offset is not supported in root table. However, drop action may not be supported in some rdma-core version in root table. In this case, the discover code will not work properly. This commits changes flow attribute to egress. That removes all the extra fate actions in the flow to avoid any unsupported fate actions make the discover code fail time to time. Fixes: 994829e695c0 ("net/mlx5: remove single counter container") Cc: stable@dpdk.org Signed-off-by: Suanming Mou --- drivers/net/mlx5/mlx5_flow_dv.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 7fc7efbc5c..71d9f88a95 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -16081,7 +16081,7 @@ mlx5_flow_dv_discover_counter_offset_support(struct rte_eth_dev *dev) .size = sizeof(value.buf), }; struct mlx5dv_flow_matcher_attr dv_attr = { - .type = IBV_FLOW_ATTR_NORMAL, + .type = IBV_FLOW_ATTR_NORMAL | IBV_FLOW_ATTR_FLAGS_EGRESS, .priority = 0, .match_criteria_enable = 0, .match_mask = (void *)&mask, @@ -16093,7 +16093,7 @@ mlx5_flow_dv_discover_counter_offset_support(struct rte_eth_dev *dev) void *flow = NULL; int ret = -1; - tbl = flow_dv_tbl_resource_get(dev, 0, 0, 0, false, NULL, + tbl = flow_dv_tbl_resource_get(dev, 0, 1, 0, false, NULL, 0, 0, 0, NULL); if (!tbl) goto err; @@ -16104,14 +16104,12 @@ mlx5_flow_dv_discover_counter_offset_support(struct rte_eth_dev *dev) &actions[0]); if (ret) goto err; - 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); if (ret) goto err; - ret = mlx5_flow_os_create_flow(matcher, (void *)&value, 2, + ret = mlx5_flow_os_create_flow(matcher, (void *)&value, 1, actions, &flow); err: /* -- 2.25.1