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 B3CBBA0C62 for ; Fri, 5 Nov 2021 09:41:13 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A5E374114D; Fri, 5 Nov 2021 09:41:13 +0100 (CET) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08on2048.outbound.protection.outlook.com [40.107.102.48]) by mails.dpdk.org (Postfix) with ESMTP id 8C99740DDA; Fri, 5 Nov 2021 09:41:11 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GVJ8M/a3yOdhNz77AaR6e0gOtqfLhJ2rM3SQXABPI9QQmzdXORkjzpnQ2rSl/sCvlZvy0iiNiCaO/+r2EFwGXWghBTUSe066CwV7HUNABeJA4XxzD5vn/VoPruEway29WUhCmDbqjnSuB3fgxZfGIPNJPqZ9LZm2LiAmH9FGU/KQ/h/2oqsWXkosxl2XyL8YvE4/fEXivwtFPnkeBOdm89YfNXnnBa8ZM/XTIA7c0mKonRbIL0aoJj5GB+Rswo0N5OQ5x5+h0pL8wu8WZdcBRW0zfehLxvguRhUi/prAG3F3OWKc1t+miMML8uctvmVMr4tSNLv3sCn8zav14GgGIg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=u7XQ5G+qmvZpBk0ZjjNoigkDioCKuXuINgIQOGN3xhQ=; b=bRlnmmVMIebWylSWyZHhi64+lsvB2PEdETqS+FTIR3PEOuEzIFjDmyolfh4BnwW+DRgpkFeYobwawXmvUkbgohFhccEsnLFhobUFlJjia16zdTPZYHnYefjrkoS7WZXblC7GirdyFI+hfjkzPaEojVrd0eKWmLZbCSoQzkKG7Smt0bSsybQQsZjTVX5bTpNcFrbESZrgzGS/CbPfBH+KosOsHT5t8b82sSWmoIGEIe33B/fFaA3v5vdTnGwsLpVtVSc2cLpUSUfZN80WjcRrukSh3hzWajK8uJU0zivLQDoBTJtKbM54kFA7OoqmihSvgfmSfNsKg9g142/3QECdhQ== 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=quarantine sp=quarantine 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=u7XQ5G+qmvZpBk0ZjjNoigkDioCKuXuINgIQOGN3xhQ=; b=tmWyQlD9nHA7A9xSM/4pcqHDg8ELIpeMiRwlfl44Eo5Fuy/F5iqhLHRywB++i1YmYseX89cUojX86IuIOfzYHGtDs3tLVhvzs8c3FcfU8W4+uQ699krwZtsE2nn1uHS3yYjtW3THRYmQV/PPdu0VFk1KPDmXS6yVYi8LeFU6a0+EGZBdZBEDHXx/mj54+ZzBL+pwR1lIpYjUZs6Vqem+mOfN2FK+ce21wMr519//7+HVZatpndyl0To6EkjplTZWBP7MHtfo7pgQ5EkauoB2n6cEzS2bF3QyWu78TXZOHwmYW5LfEgHnvgIfEJ92rl+mCiICCwzmOOTjeqICquF9eQ== Received: from BN8PR16CA0001.namprd16.prod.outlook.com (2603:10b6:408:4c::14) by DM6PR12MB4747.namprd12.prod.outlook.com (2603:10b6:5:30::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.17; Fri, 5 Nov 2021 08:41:09 +0000 Received: from BN8NAM11FT011.eop-nam11.prod.protection.outlook.com (2603:10b6:408:4c:cafe::91) by BN8PR16CA0001.outlook.office365.com (2603:10b6:408:4c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10 via Frontend Transport; Fri, 5 Nov 2021 08:41:09 +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 BN8NAM11FT011.mail.protection.outlook.com (10.13.176.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4669.10 via Frontend Transport; Fri, 5 Nov 2021 08:41:09 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 5 Nov 2021 08:41:06 +0000 From: Jiawei Wang To: , , , "Yongseok Koh" , Ori Kam CC: , , Date: Fri, 5 Nov 2021 10:40:50 +0200 Message-ID: <20211105084051.20159-1-jiaweiw@nvidia.com> X-Mailer: git-send-email 2.18.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.187.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: f5f53361-e5e1-4f96-c666-08d9a03803e4 X-MS-TrafficTypeDiagnostic: DM6PR12MB4747: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1850; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qoeP/qKD91jIa8WGhpV4X5R/ISzyySbdPDwnrASOvVDnzefgY49G46dtO+fd4mN4G6V1Sp0LJuoK6xenUB3DSN4I95lkn9D9HcFVXerz2qOmn++9vy/TnXj8eNbasv4I1OqtFUwlHlhGH2nb12r6fJadU6aPDs9yfiHpjNSvm4uxWOH7AdoHzQ+xIDXfR85bWHdK8+Sf443U+dVv7oZORixb0iYsYrLt4bgam3cjjxlb6ft63VEHwkL7+NpDyd1LEZEEp3zlHdmuqIk0vcoGbjduR7s8Gh7hw3EQJu31cEgXqSZ/pvXwptcAnpjT1LOGx9HGY4zhCLhUZL80c05LIxKLAsVoUx6AOmkrw/UggoXcLUZMKKkmgW+uJIvIXnHX0JJgG8k1ghHkKi+EirahXSUwRMtVPyQXOpg5RUDTxG8nY5/+033Q5mhftcje12W5nnM6/n9hlqFonXi2PHk4CGyPHUV50Zu63u5asti+r0uvsu4ETD1bwQTCPl+Usp6jlmP8kRc1Am/FfoP7quDBSm+miRFCitwf1WBuJzhen9kUT19pQ0tLp9E5EQr0Kh1mzQ2UuMdziCn8oIh5OdFye/J938uGhdXlald8Mx7bmbhRXa5c2sfOlsW2vraBXc0DK3CjUs57s3RgFXbqpwgdxEMRU3WZAPNAx2vJ7+UlOUwNmVnJGMsmyS0TkQlZNms2TNaubn6cpnPeXBL6CGO2ig== 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)(36840700001)(46966006)(36756003)(2616005)(86362001)(26005)(8936002)(83380400001)(54906003)(356005)(36906005)(70586007)(6666004)(7636003)(316002)(7696005)(2906002)(55016002)(5660300002)(16526019)(426003)(6286002)(8676002)(186003)(70206006)(82310400003)(508600001)(336012)(47076005)(110136005)(1076003)(450100002)(36860700001)(4326008); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2021 08:41:09.1284 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f5f53361-e5e1-4f96-c666-08d9a03803e4 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: BN8NAM11FT011.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4747 Subject: [dpdk-stable] [PATCH] net/mlx5: fix the NIC egress flow mismatch in switchdev mode 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" When E-Switch mode is enabled, the NIC egress flows always added the source vport in the matcher item, then cause the flows cannot be hit. This commit fixes the issue that removes the souce port as matcher for NIC egress flow. Also adding the validation that rejects the NIC egress flows on the representors ports. Fixes: ce777b147bf8 ("net/mlx5: fix E-Switch flow without port item") Cc: stable@dpdk.org Signed-off-by: Jiawei Wang Acked-by: Viacheslav Ovsiienko --- doc/guides/nics/mlx5.rst | 2 ++ drivers/net/mlx5/mlx5_flow_dv.c | 14 +++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst index 006896375f..0099128c98 100644 --- a/doc/guides/nics/mlx5.rst +++ b/doc/guides/nics/mlx5.rst @@ -479,6 +479,8 @@ Limitations - Needs OFED 5.4+. +- The NIC Egress flow on representor port is not supported. + Statistics ---------- diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 842ada2ea9..58eb39d45f 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -7992,6 +7992,12 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, NULL, "sample before modify action is not supported"); + if ((!attr->transfer && attr->egress) && priv->representor) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, + NULL, + "NIC egress rules on representors" + " is not supported"); return 0; } @@ -13556,11 +13562,13 @@ flow_dv_translate(struct rte_eth_dev *dev, /* * When E-Switch mode is enabled, we have two cases where we need to * set the source port manually. - * The first one, is in case of Nic steering rule, and the second is - * E-Switch rule where no port_id item was found. In both cases - * the source port is set according the current port in use. + * The first one, is in case of NIC ingress steering rule, and the + * second is E-Switch rule where no port_id item was found. + * In both cases the source port is set according the current port + * in use. */ if (!(item_flags & MLX5_FLOW_ITEM_PORT_ID) && + !(attr->egress && !attr->transfer) && (priv->representor || priv->master)) { if (flow_dv_translate_item_port_id(dev, match_mask, match_value, NULL, attr)) -- 2.18.1