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 397BD42D46 for ; Sun, 25 Jun 2023 08:38:37 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2F8B642BDA; Sun, 25 Jun 2023 08:38:37 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2081.outbound.protection.outlook.com [40.107.93.81]) by mails.dpdk.org (Postfix) with ESMTP id 3EC4642BDA for ; Sun, 25 Jun 2023 08:38:35 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d+yVFzE1GiZBrjfU/5eFnvRHmWvWFwKn3KmcmeuJE78n004v987NZHk//nDNmemZLJ42jmRCfVrI4I/amDyaeP/6b+b32qzLgbTRcnoWvsUKlMc55sHXrpvauqj09ZZLa4bk34WoPc3ANfHHO1xSjDP4SVBnQKtkZMlnsGeBUciVSdYHOE4BDPgVsn65XNMrptyOPxQbOKBICcqpQnhlzTkS4CSAZQAJCpqlNQgtbAhj7rOPj90hbw1JG+dBz3YyPzkENnuq1y2I0QOU6LpcH18Xcd0Dokr5sU5sE35H1L59H04hha4trKgPV0Q62961nprFb5VyDoZcYs5nJuUK2A== 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=oh7xH3iADs9rbC+P4jGrK61GIRte0V+Z7ZjaMFvmInc=; b=ChPDe8yWBIq7Z/p4LJ1ZRLm8aX6BknEBpeZwjY6YwaVHRaKJYGcuwXqnM70hYKlODidQyK/8T/X/gMOa/6wcZwJ0vjYYiRrwM7U9lzeAJK1g77vSzuM/cuHaqilla/N52XjTUasdDl+RjoZ1CeZg4TSkY+YNmyHDX7UHIpr9IW0RhJ6WudXiniufraerTxAz52hAbOlo0eKXDr2wD04W3zcpALTn/EoImBScZ4Z+qzOzEY8U51DyaJQ6PI97EtWFX3LvHmR6/mlw8U3TmYNddqQXUSLySSeRq9+MtK//qmpLr4fvBqMJDPxdBdpWa4T+qflNkYwgDX34ivfAVfhUeQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=arknetworks.am smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject 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=oh7xH3iADs9rbC+P4jGrK61GIRte0V+Z7ZjaMFvmInc=; b=cmoFh7aX51FFZaGE1VhV3ca68Xjj4eaYl/61VJ95SQkCVWlJSqh9K7xsA86R1UJe+NqYlY+YHh/d5bUTwWN6xwbIXAgT8iTkySJe1bAShgx+Tkc8IbWb8XRFLLmALTaTphCiqfBbxog1NbL3bnIaZOya7zLI9Pg22GgkbAAGoZBlJueHF1Z7EcdhmY/uPHdJLTv+eY5PUvTWs88kq1MFF0pcXDNLzk2kJ1ayD+lGkiMOzwUVHEH+r2b2RT14MQbYBPvKNBIOAgr0blVCiCCyMggof+QwBKJYRw0GM0KnaB7YkwFWVVTtGXyLvPjXyOCVJ1kizflUFJPZ7uCymXDV1Q== Received: from BN9P222CA0012.NAMP222.PROD.OUTLOOK.COM (2603:10b6:408:10c::17) by BN9PR12MB5211.namprd12.prod.outlook.com (2603:10b6:408:11c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Sun, 25 Jun 2023 06:38:33 +0000 Received: from BN8NAM11FT095.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10c:cafe::de) by BN9P222CA0012.outlook.office365.com (2603:10b6:408:10c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.33 via Frontend Transport; Sun, 25 Jun 2023 06:38:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN8NAM11FT095.mail.protection.outlook.com (10.13.176.206) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.47 via Frontend Transport; Sun, 25 Jun 2023 06:38:32 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Sat, 24 Jun 2023 23:38:20 -0700 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Sat, 24 Jun 2023 23:38:18 -0700 From: Xueming Li To: Ivan Malov CC: Andy Moreton , Andrew Rybchenko , dpdk stable Subject: patch 'net/sfc: stop misuse of Rx ingress m-port metadata on EF100' has been queued to stable release 22.11.3 Date: Sun, 25 Jun 2023 14:34:05 +0800 Message-ID: <20230625063544.11183-28-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230625063544.11183-1-xuemingl@nvidia.com> References: <20230625063544.11183-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT095:EE_|BN9PR12MB5211:EE_ X-MS-Office365-Filtering-Correlation-Id: 6286d207-0f78-4800-2dab-08db7546cb9a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YVOzh577Hh4HPSSSczXCsbpCvSquvQ2iJgh0X4c0pFXECrnlW2FYyFcaEOCrGf/lVUPFDsfr599KVWi1GtyEf1b4Ue87ftH04Ho2knUgAgUUADFWxBEibhtg9oR6t8ONSQw0bNAtXYx9z97JPRwL6nd9nlekUizJf3XCun5ZnOqAlvlJ6da35rJMWIZJejUVS7PS9Ycsn+b7jdDSyyXr1rC3/+6RAGpPzEQVweqfquxPKlLDkkljqYYHevInMqi9FwtK3R2k0Nu0vc78MuchoNizsBiyxi0YKEUssfg6mv32Var+7y4PPjvWqSX9erse/t8zOmoljtRfeWI+2F86KMQfoBceNVof0Nm7hX0bdbFVyROsetvITD54WBcNe42GwMow0oN+24WECytxF0ZSCovoUElMe/Cj2F4NBTOWtS0cts/dzge5i3tgAEWKmiOZzYYYCrjMH/5sMvf8WuZxLX8/qdzgeYQMIv7uOKH2qLf4PGFadxovjMTHyA6I2sKBUOakG0lwTW9YDarHvNahsNgv+VlIccXOof2ccwsy/U9Q1Nq64ZCf4MXratYd9ekIj8Cmw+VixuS81U7ClvppFLF13aEWCIxhUm7Ws63+EXmXwYcKOPhFuVyBBrnomR5Bf5pi2NnvE87URKgapUBft3FdBPh93c2+bPziNOFulXYG4Up6k4sLzk4+UcrYXhLBXag3VMeT53JQIxwGl2JHvneXORXew3zIZHfvBXjD/X6VhQhKCxqwoFMMGbyqCc/HJgE9JexmI9lNSfkRZIu+Ag== X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(136003)(346002)(396003)(39860400002)(376002)(451199021)(40470700004)(36840700001)(46966006)(36860700001)(82310400005)(47076005)(966005)(478600001)(7696005)(6666004)(2616005)(54906003)(426003)(83380400001)(336012)(26005)(53546011)(1076003)(186003)(16526019)(6286002)(2906002)(5660300002)(40460700003)(36756003)(70206006)(356005)(4326008)(7636003)(70586007)(82740400003)(55016003)(40480700001)(316002)(86362001)(8936002)(8676002)(41300700001)(6916009); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jun 2023 06:38:32.5065 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6286d207-0f78-4800-2dab-08db7546cb9a X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT095.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5211 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 Hi, FYI, your patch has been queued to stable release 22.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/27/23. 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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=bd14912ab474e7dfb2b98f02a6f51ad4f58069cd Thanks. Xueming Li --- >From bd14912ab474e7dfb2b98f02a6f51ad4f58069cd Mon Sep 17 00:00:00 2001 From: Ivan Malov Date: Wed, 12 Apr 2023 17:57:57 +0400 Subject: [PATCH] net/sfc: stop misuse of Rx ingress m-port metadata on EF100 Cc: Xueming Li [ upstream commit 462c4f083c464e2d10391c78e7f67f178dbefb27 ] The driver supports representor functionality. In it, packets coming from VFs to the dedicated back-end Rx queue get demultiplexed into front-end Rx queues of representor ethdevs as per the per-packet metadata indicating logical HW ingress ports. On transmit, packets are provided with symmetrical metadata by front-end Tx queues, and the back-end queue transforms the data into so-called Tx override descriptors. These let the packets bypass flow lookup and go directly to the represented VFs. However, in the Rx part, the driver extracts the said metadata on every HW Rx queue, that is, not just on the one used by representors. Doing so leads to a buggy behaviour. It is revealed by operating testpmd as follows: dpdk-testpmd -a 0000:c6:00.0 -a 0000:c6:00.1 -- -i testpmd> flow create 0 transfer pattern port_representor \ port_id is 0 / end actions port_representor port_id 1 / end Flow rule #0 created testpmd> set fwd io testpmd> start tx_first testpmd> flow destroy 0 rule 0 Flow rule #0 destroyed testpmd> stop ---------------------- Forward statistics for port 0 ----------------- RX-packets: 19196498 RX-dropped: 0 RX-total: 19196498 TX-packets: 19196535 TX-dropped: 0 TX-total: 19196535 ----------------------------------------------------------------------- ---------------------- Forward statistics for port 1 ----------------- RX-packets: 19196503 RX-dropped: 0 RX-total: 19196503 TX-packets: 19196530 TX-dropped: 0 TX-total: 19196530 ----------------------------------------------------------------------- In this scenario, two physical functions of the adapter do not have any corresponding "back-to-back" forwarder on peer host. Packets transmitted from port 0 can only be forwarded to port 1 by means of a special flow rule. The flow rule indeed works, but destroying it does not stop forwarding. Port statistics carry on incrementing. Also, it is apparent that forwarding in the opposite direction must not have worked in this case as the flow is meant to target only one of the directions. Because of the bug, the first 32 mbufs received as a result of the flow rule operation have the said metadata present. In io mode, testpmd does not tamper with mbufs and passes them directly to transmit path, so this data remains in them instructing the PMD to override destinations of the packets via Tx option descriptors. Expected behaviour is as follows: ---------------------- Forward statistics for port 0 ----------------- RX-packets: 0 RX-dropped: 0 RX-total: 0 TX-packets: 15787496 TX-dropped: 0 TX-total: 15787496 ----------------------------------------------------------------------- ---------------------- Forward statistics for port 1 ----------------- RX-packets: 15787464 RX-dropped: 0 RX-total: 15787464 TX-packets: 32 TX-dropped: 0 TX-total: 32 ----------------------------------------------------------------------- These figures show the rule work only for one direction. Also, removing the flow shall cause forwarding to cease. Provided patch fixes the bug accordingly. Fixes: d0f981a3efd8 ("net/sfc: handle ingress mport in EF100 Rx prefix") Signed-off-by: Ivan Malov Reviewed-by: Andy Moreton Acked-by: Andrew Rybchenko --- drivers/net/sfc/sfc_dp_rx.h | 1 + drivers/net/sfc/sfc_ef100_rx.c | 18 ++++++++++++++---- drivers/net/sfc/sfc_rx.c | 3 +++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/drivers/net/sfc/sfc_dp_rx.h b/drivers/net/sfc/sfc_dp_rx.h index 246adbd87c..8a504bdcf1 100644 --- a/drivers/net/sfc/sfc_dp_rx.h +++ b/drivers/net/sfc/sfc_dp_rx.h @@ -69,6 +69,7 @@ struct sfc_dp_rx_qcreate_info { /** Receive queue flags initializer */ unsigned int flags; #define SFC_RXQ_FLAG_RSS_HASH 0x1 +#define SFC_RXQ_FLAG_INGRESS_MPORT 0x2 /** Rx queue size */ unsigned int rxq_entries; diff --git a/drivers/net/sfc/sfc_ef100_rx.c b/drivers/net/sfc/sfc_ef100_rx.c index 16cd8524d3..37b754fa33 100644 --- a/drivers/net/sfc/sfc_ef100_rx.c +++ b/drivers/net/sfc/sfc_ef100_rx.c @@ -810,6 +810,9 @@ sfc_ef100_rx_qcreate(uint16_t port_id, uint16_t queue_id, if (rxq->nic_dma_info->nb_regions > 0) rxq->flags |= SFC_EF100_RXQ_NIC_DMA_MAP; + if (info->flags & SFC_RXQ_FLAG_INGRESS_MPORT) + rxq->flags |= SFC_EF100_RXQ_INGRESS_MPORT; + sfc_ef100_rx_debug(rxq, "RxQ doorbell is %p", rxq->doorbell); *dp_rxqp = &rxq->dp; @@ -876,11 +879,18 @@ sfc_ef100_rx_qstart(struct sfc_dp_rxq *dp_rxq, unsigned int evq_read_ptr, else rxq->flags &= ~SFC_EF100_RXQ_USER_MARK; + + /* + * At the moment, this feature is used only + * by the representor proxy Rx queue and is + * essential for representor support, so if + * it has been requested but is unsupported, + * point this inconsistency out to the user. + */ if ((unsup_rx_prefix_fields & - (1U << EFX_RX_PREFIX_FIELD_INGRESS_MPORT)) == 0) - rxq->flags |= SFC_EF100_RXQ_INGRESS_MPORT; - else - rxq->flags &= ~SFC_EF100_RXQ_INGRESS_MPORT; + (1U << EFX_RX_PREFIX_FIELD_INGRESS_MPORT)) && + (rxq->flags & SFC_EF100_RXQ_INGRESS_MPORT)) + return ENOTSUP; rxq->prefix_size = pinfo->erpl_length; rxq->rearm_data = sfc_ef100_mk_mbuf_rearm_data(rxq->dp.dpq.port_id, diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index 5ea98187c3..edd0f0c038 100644 --- a/drivers/net/sfc/sfc_rx.c +++ b/drivers/net/sfc/sfc_rx.c @@ -1225,6 +1225,9 @@ sfc_rx_qinit(struct sfc_adapter *sa, sfc_sw_index_t sw_index, else rxq_info->rxq_flags = 0; + if (rxq_info->type_flags & EFX_RXQ_FLAG_INGRESS_MPORT) + rxq_info->rxq_flags |= SFC_RXQ_FLAG_INGRESS_MPORT; + rxq->buf_size = buf_size; rc = sfc_dma_alloc(sa, "rxq", sw_index, EFX_NIC_DMA_ADDR_RX_RING, -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-06-25 14:31:59.254805500 +0800 +++ 0027-net-sfc-stop-misuse-of-Rx-ingress-m-port-metadata-on.patch 2023-06-25 14:31:58.305773900 +0800 @@ -1 +1 @@ -From 462c4f083c464e2d10391c78e7f67f178dbefb27 Mon Sep 17 00:00:00 2001 +From bd14912ab474e7dfb2b98f02a6f51ad4f58069cd Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 462c4f083c464e2d10391c78e7f67f178dbefb27 ] @@ -85 +87,0 @@ -Cc: stable@dpdk.org