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 DA122A034F for ; Wed, 10 Nov 2021 07:38:10 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CD79640142; Wed, 10 Nov 2021 07:38:10 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2072.outbound.protection.outlook.com [40.107.92.72]) by mails.dpdk.org (Postfix) with ESMTP id 2405E40142 for ; Wed, 10 Nov 2021 07:38:10 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n5yssIPTlApioLf+Ff+Spq2DaTvPAOum5DWP1loWlt/+k1nRsy+JKLsi4Hngflo7ehsaRwMGQMFVyJr33jCmGfIJq1WH4tGCVGaMnnCPrIMH7Ojh+gmvNyAN6CoasBE72MjwMDn6ylBVPD6jzlIjAxoCmUkcGrEuAtNzqi+K9IEdjRIlAq+xJkcy5BWDdGPhv9xYKAsGxb/FS+xAt2jHUodnA1mWvn988azm7mOo5+kRFWLOjTpm6LpOcX+yk1ubXhXFJwnOn9RWj6imCvZDVanR3ir8Dgx2DJZDcBss4Ugca4+Dmju90pULtWQhV7dPp08lnz03BkT3ky02TS6hhw== 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=Zf2WvBh5ovXhGkJjW78gIHNg0Wn30nEWpU9rtrT8h24=; b=K1qcqaJjnnN6pRd9tUWkisWde/xaEnswCHivTRqYiePaPM9ElfIIuljTFqyYPvFzRSuiOzE6Lry0XrCrfXmLkJn/T+E3fWsFDT6cAy+nznXDfU/bTNZdBFIZsY7NQqT/ihrfW20n6VMc4Y7LU8XknBoj4/jqKBJ1/Bxjw0h/1NutfwzGDIFLbQkpgIlLURkjUXK2J2V3Yj5SmhcXyH8xcCPqTaGPm50clrk9HMvrisCzNrgHE8CU4pSvMrelUy3nEpC1YaTMI8lCHLz5eyLvpG0X72Gm1kr6uXu4V7+beTusc12uwSRLGglvk5b1yVw48+6PL0ElA9qu5qNXK6Ww4Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=redhat.com 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=Zf2WvBh5ovXhGkJjW78gIHNg0Wn30nEWpU9rtrT8h24=; b=aeEPv1jiG70KOT639zyOiCdPySAezEO6OKJpaXSAJEpPUG1EhDWGCW8OYkSYqXWCSUNywRznULQJ/+8NjiUx++Hbiub1L1iILV2qe4K0ilWSc7rw+cdu8AZtZxe+IXbP6U2UXofoGizqLlTLzvh0S6eiYOAiK9fpVPfwqegpxpMeg78OEZyM1r47R2zYlofrwcW0FpyJAoS5EsgASmaktYRbKxhOQXmjCEVwKwe1nk6PyNaOgOUj5iQ81UvvXt8gT3LYb7ffeaNbRBDNS5kc43d42AMBFkdvM7kGMkGy/P82WDaDaQchDaFd3YZWVxXRQdZyssI0gfFaXkRdRcas+g== Received: from DS7PR03CA0282.namprd03.prod.outlook.com (2603:10b6:5:3ad::17) by BN9PR12MB5113.namprd12.prod.outlook.com (2603:10b6:408:136::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.16; Wed, 10 Nov 2021 06:38:08 +0000 Received: from DM6NAM11FT059.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3ad:cafe::44) by DS7PR03CA0282.outlook.office365.com (2603:10b6:5:3ad::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.16 via Frontend Transport; Wed, 10 Nov 2021 06:38:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.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 DM6NAM11FT059.mail.protection.outlook.com (10.13.172.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:38:08 +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; Wed, 10 Nov 2021 06:38:03 +0000 From: Xueming Li To: Ivan Ilchenko CC: Luca Boccassi , Andrew Rybchenko , Maxime Coquelin , dpdk stable Date: Wed, 10 Nov 2021 14:28:54 +0800 Message-ID: <20211110063216.2744012-51-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: aad22513-5044-4f61-bfd2-08d9a414a86c X-MS-TrafficTypeDiagnostic: BN9PR12MB5113: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0ru7kDa9O9LkxwgAIAusz6rbPwYSIQI9B037bwNq26gKfgcoNGP7i5UicquC3+xD4RMNv43LFhVrsBKTXF5Cbvw4gUNnD/rbNlsWpdoK6WZ/TZYOswxXsr9gUGKK1W98vVbAdP9+mU/lYpTC/k2oSXya3ivXdI92IaNO4dl5hrniP/AAuxQSNv3zQhuzVKsLYtmYZr47OGbe2hQbdNgREmGwFDtvqUsjzpSeQxJeM7GRvT9k+XSZujiI4Ccsxdbk2Mlj3k4a8d+nBU8zMfi9K/mJEXSAeSQI4GuK7LnxXTjuwsC//WEbMqH4S5ADDktj/nBoOuLcL7WpT2VUs3FxNecCMSwl1bgizVPSM6DMjtMGYSDUzOmYZdbo9WFYUZRFSFc53czJ/9OB0heLbEiPHtJDdvuT/6uPD8kL1Q5lXlLSRs0/26EXscH+opTvx4f2d+45Zhfg8svbl64Iu4fJsOD5PRZIMstc2CyETwjepuIPx8eYm13+xnJUkhQs6gOa9b644kMeDTqlZYibdBomm8Ub0qPsTRCyCAX8XcCLfPyBCtIbsQikFKFa0gDmCGDy6CCmo5MQTdZPGD8sst3JBz1j/g1N3nUWrDAunKFQnFh+viIatbe6fHOuHkvQmcFDHXfYOBHwSqCoepWl0/+qrr7xD5/ZNPp1PJ/+1UbDBUw9IbANYIioBMIVVY1/kJcOJbwC6Z4GueoSOKvbbPCx3h95LfNjRNSuMsUeici5J7ZtHnf+sH489qcBGC+Jq3PFBQPwD/wStWwmx/ESbGcuohvj2EVLhf/HE1d0MS/0RZ1OSU6AwtpDauyrpGfMtrDf5gwsQqSSMWtZb0qqjAy1bA== 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)(46966006)(36840700001)(966005)(5660300002)(16526019)(2906002)(4326008)(508600001)(186003)(86362001)(316002)(36906005)(53546011)(336012)(6916009)(8676002)(83380400001)(7696005)(8936002)(356005)(26005)(47076005)(70586007)(55016002)(4001150100001)(426003)(70206006)(2616005)(54906003)(7636003)(6666004)(36860700001)(6286002)(36756003)(82310400003)(1076003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:38:08.0596 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aad22513-5044-4f61-bfd2-08d9a414a86c 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: DM6NAM11FT059.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5113 Subject: [dpdk-stable] patch 'net/virtio: fix split queue vectorized Rx' has been queued to stable release 20.11.4 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" Hi, FYI, your patch has been queued to stable release 20.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/12/21. 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://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/b95404765490eb484a534e7d01aea2c95d046fb9 Thanks. Xueming Li --- >From b95404765490eb484a534e7d01aea2c95d046fb9 Mon Sep 17 00:00:00 2001 From: Ivan Ilchenko Date: Fri, 20 Aug 2021 15:47:52 +0300 Subject: [PATCH] net/virtio: fix split queue vectorized Rx Cc: Xueming Li [ upstream commit c97e73779c3eb2f7c214a7300673e54b886223b6 ] Descriptors number may be set less than queue size for split queue vectorized Rx path. Pointers to mbufs for received packets are obtained from SW ring, that is initially filled with them in the end of queue setup in virtio_dev_rx_queue_setup_finish(). The begin of the SW ring filled up to the size of descriptors number. At queue size offset from the begin of the SW ring pointers to some fake mbuf are also set for wrapping purpose. So the ring may contains the hole of invalid pointers from descriptors number offset to queue size offset, and split vectorized Rx routines could write to the invalid addresses since they use the ring up to the queue size. Fix this by setting descriptors number to queue size on Rx queue setup. Fixes: fc3d66212fed ("virtio: add vector Rx") Signed-off-by: Ivan Ilchenko Signed-off-by: Andrew Rybchenko Reviewed-by: Maxime Coquelin --- drivers/net/virtio/virtio_rxtx.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index b5b99d19f8..7fb41f12af 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c @@ -711,8 +711,14 @@ virtio_dev_rx_queue_setup(struct rte_eth_dev *dev, } vq->vq_free_thresh = rx_free_thresh; - if (nb_desc == 0 || nb_desc > vq->vq_nentries) + /* + * For split ring vectorized path descriptors number must be + * equal to the ring size. + */ + if (nb_desc > vq->vq_nentries || + (!vtpci_packed_queue(hw) && hw->use_vec_rx)) { nb_desc = vq->vq_nentries; + } vq->vq_free_cnt = RTE_MIN(vq->vq_free_cnt, nb_desc); rxvq = &vq->rxq; -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:04.333221337 +0800 +++ 0050-net-virtio-fix-split-queue-vectorized-Rx.patch 2021-11-10 14:17:01.804079970 +0800 @@ -1 +1 @@ -From c97e73779c3eb2f7c214a7300673e54b886223b6 Mon Sep 17 00:00:00 2001 +From b95404765490eb484a534e7d01aea2c95d046fb9 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit c97e73779c3eb2f7c214a7300673e54b886223b6 ] @@ -19 +21,0 @@ -Cc: stable@dpdk.org @@ -29 +31 @@ -index 18f03c9fc9..97ed69596a 100644 +index b5b99d19f8..7fb41f12af 100644 @@ -32 +34 @@ -@@ -706,8 +706,14 @@ virtio_dev_rx_queue_setup(struct rte_eth_dev *dev, +@@ -711,8 +711,14 @@ virtio_dev_rx_queue_setup(struct rte_eth_dev *dev, @@ -36 +38 @@ -- if (nb_desc > vq->vq_nentries) +- if (nb_desc == 0 || nb_desc > vq->vq_nentries) @@ -42 +44 @@ -+ (!virtio_with_packed_queue(hw) && hw->use_vec_rx)) { ++ (!vtpci_packed_queue(hw) && hw->use_vec_rx)) {