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 9E7FEA0C61; Fri, 5 Nov 2021 09:59:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2757E40DDA; Fri, 5 Nov 2021 09:59:35 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2061.outbound.protection.outlook.com [40.107.94.61]) by mails.dpdk.org (Postfix) with ESMTP id 99E1540689; Fri, 5 Nov 2021 09:59:33 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dan69EFz/tWMdrMpRazVpmpMXkitN/9vJoqxtlNbWsPlEcDNrj+qABkn9XgSXuaK557ozm1/X3JiSTVV08LuCsR7Hbi4OXcp1JJKNmorIeK+FgwAtlyNKd85vy2Xa4B8vuVdEND0JYv8+G9UcRxA2vcBEkWXa4o29LzdRS4NOPk7w9s6C3VTE0RKCIkif+fTe7gQnqYo+2+zkQtjZL0B/jYGmVbaF/RZogw2fl9B+377y5tRh0iKU6iPujo0Ep/9rs30EF3F+pe5HpqgOb1TcmthUepzLILCltNETcKLeIMDCQB7i6gMoujCIJtf9f4BYhNNBrvIjEUw462yT348bQ== 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=zt6xiMeOY//d97SMtBeqSi09WrBSF2g3xPS87DGoEzA=; b=OwQk6lBOmi7JRaYBwwwgU6SPf2bt+8O7d0WICodUT8zcC0Il3tlI6W9HwQC/T/Gkz878dd3DqqeVhZfzCWIIQCKmyKPNGiV+STOJTVwiwxO7Vr7roASTchNoAmHwf2nf5ooYGOemD07Xco5rymfJO5lvuhDuGQJzET44Ep3Pdaf3hLDPjIUry1NU0BmhlHJl3UEsmlM8otUiGf9GhRxiKvkUpJ3MmY9415lMpHQTY3ufBOPHVo8vbD5wvsbYJbtzDnPQytnsfHMP6uL9SRt5D9SBpaBCjkKdEJGdfbzjIbdMgGt73hnvt+XcHxzidwqqSKhUNPIdByj3F7nfK8Xuvw== 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=zt6xiMeOY//d97SMtBeqSi09WrBSF2g3xPS87DGoEzA=; b=NKiJ9h/3x45uYqr/WM+XjosJQKb1+oW+C0SiDDDU6uVy5JtcA7/IxjN1ZmvKXg/vPFezKZxMlb2vL+uPKSDCiT1LbCB8kSwtR5gfNI+mQxwhi+LMynp3oZQyQvVE6OyACFqZ09uWOf2rhinZgnA/k2O+x9ZIyng2z4GtQ5Jbostwg5XQ/eVZ6j1OhRcvlU1SQ/hRyKe80aogvZ10h/38PbhejKldO3rRIJKq5nBxYbhaQ+FYZ1oyhQjOnD2hTlc7VT2hkbmR1ngj9hVOJhkF0n8Z4FpjebKrtcOLfez+OqJw21vPAW0XddnyPFfI3zYJEMhF+qC5p/oTe6lXnKziIA== Received: from MW4PR04CA0038.namprd04.prod.outlook.com (2603:10b6:303:6a::13) by DM6PR12MB3018.namprd12.prod.outlook.com (2603:10b6:5:118::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.18; Fri, 5 Nov 2021 08:59:31 +0000 Received: from CO1NAM11FT006.eop-nam11.prod.protection.outlook.com (2603:10b6:303:6a:cafe::ca) by MW4PR04CA0038.outlook.office365.com (2603:10b6:303:6a::13) 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:59:31 +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 CO1NAM11FT006.mail.protection.outlook.com (10.13.174.246) 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:59:31 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 5 Nov 2021 08:59:28 +0000 From: Jiawei Wang To: , , , Ori Kam , Yongseok Koh CC: , , Date: Fri, 5 Nov 2021 10:59:10 +0200 Message-ID: <20211105085910.40212-1-jiaweiw@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20211105084051.20159-1-jiaweiw@nvidia.com> References: <20211105084051.20159-1-jiaweiw@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0d6bf5c6-8b2d-4892-a787-08d9a03a94c0 X-MS-TrafficTypeDiagnostic: DM6PR12MB3018: 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: CyUE9HOeNA3EYOLvOH30Z7mk4VOkqh+BgpbR8p1SVD4jkdZil9HU9wsp8sh5XF5gZUAhWVqoW8ymJAW5uE4tIkXtWpXmT6lzVq2qfrTz452bo7B3+rZLw3QopTJHTxGTtC4xzHqp7V4oauWW5WExwAp1aHggJiX+IS7xkTYaGI0AGknEDeIvIjEH7YAbtSBWIrKCQJB6N2VNOc478k/BullYjgAedFzRbmgWeF3G+ipYXfQSwzLJaXdjaw6I7wzF+jgB6W5bNM+i5d73RitrukEPVM8EIpQ5G0VqGocKG63Eg17RN9wF11Zstm4jQtH005YTfvzLi2GhKzqvspaSRkBjw55tkFvzFiGxD6Pvrkfth8zphGzGqIHcKHP0mDucnik1+ogyAsBMgHCR1+6/5I9aqvHCdhPA+ZK16SkYzVLsHf/B9PDULP1YBiQhhw/pUcWqsLqWUyVbrlND9BB03iNjXTRyn9WU6Pw6RE5ATF52QedaNLKgPflD2dgRCGm/KvmhqbglIuBsMJyBjiIWj5kNkiB8tTz2CC1Glrco1W1WKim6SSr6BSoC4yxgmIQ2CPeh7tO4InqYEAz9kD2EqL5o7A5Flm/ZfDBBeojVg2CZxRzmpYLpGrc+aVeYKMdMHl0mpv93R8euJVxNQK1Hmmw8awmDH+bk15j7h8frRalld9g8uHJkPPecSFzRXiEU9bHmGveVVRbLUEzIKAeNVg== 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)(7636003)(83380400001)(356005)(36860700001)(86362001)(82310400003)(6286002)(55016002)(36756003)(47076005)(1076003)(6666004)(2906002)(426003)(54906003)(186003)(2616005)(70206006)(7696005)(8676002)(8936002)(110136005)(450100002)(36906005)(70586007)(508600001)(336012)(316002)(26005)(4326008)(16526019)(5660300002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2021 08:59:31.2677 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0d6bf5c6-8b2d-4892-a787-08d9a03a94c0 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: CO1NAM11FT006.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3018 Subject: [dpdk-dev] [PATCH v2] net/mlx5: fix the NIC egress flow mismatch in switchdev mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When E-Switch mode was 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 source vport as matcher for NIC egress flow. Also adding the validation that rejects the NIC egress flows on the representor 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 --- v2: fix one typo --- 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