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 279EE42D46 for ; Sun, 25 Jun 2023 08:43:31 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2328540ED8; Sun, 25 Jun 2023 08:43:31 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2063.outbound.protection.outlook.com [40.107.92.63]) by mails.dpdk.org (Postfix) with ESMTP id B52A740A7F for ; Sun, 25 Jun 2023 08:43:29 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kiwAjAg7pG4i/HzC/GkSd2UIXvzqRdrKI0tHlJYSnRbesv7EBWfDpPIIHndwI1dPYdG10LufhFkSA3uUDFkgZM//ZHnpDsBP5DIowMWluowXJqCbx6DZpuuaKLRrgeTlPQ/JEYoFaP5PN5a0BZKpXGZp6yAqnLF4GbJbrUhx/W7wbzddPjHJ2hW2bMHvNCi75bI5QN3ElCQQDQAJJZpPLMrIgZAuBSWyZRmPv+WHfa4JYtZvqE78fExf8H/gMGKnbY8uayW8wx6+CqB604P7SAYlD7hDAB1GntXIfKL0yhCSxBIwJsWOMl37gVFqK7RXhw/+AdcHuvzL7S5iVs69oQ== 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=F8EAJ92Qo959UFEtL8PK3zxfCx5YNb0b6IpCy+kTpWY=; b=jXlE206aU4UDnzxgA3OIMOHPwiGhcE/DYTJuyNI5bKpSARKLo3ahBYp+NhP1IH9g8VZd1LY2ytur9lHTwX7xl+9170hMmCFFAF4e2LaQWEl6Tmv9kfInYAvQ5gF8nub1wcy60SYIi1y/7wpNgxdQO7W94GHqOw2IgPBa6s6RZ+4dUKFdPNtVj3O+SLtKCs/ej3nXebgV1UNZvDEq+eNDZSk/vXlCIS4BQJnYbXT9bbwlPbiW//Sc0fSZUoa0vxnE1d3PiqO4olCPgKSwjX1Z5Pe7bkdqpsNPRAzp4bLi33YgNmNcoEDl5laLoneMkM5taldi4xgQjUBvivqPYCWm8w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=oktetlabs.ru 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=F8EAJ92Qo959UFEtL8PK3zxfCx5YNb0b6IpCy+kTpWY=; b=GJbakK+5fu4PS9QQp3z50zYI3xJxkAC9t3AjXVkCiuPD0Oa2/BMM94rOu1PKg9tm05WhyHIstV7bqw3jkBqwMK/okpzclnhf0r75YDlwGdc0dWsAozm18XIKO9HwpxIMAZX5a+3UO4/2j+nVcBcY8fR7iVbhPqvKU2akWfPEcJYSusr46XM9tkpyWJ9HqdxBc85qZTZ7+rlvnCSJDqnpVOeCBCEekfOFE8NT/QNY/nS/fB1+trKYsSuz58IN53BR/tJMyYCOl2wfeZDmNeqv8ISt7mohtJNFAyOssZwg7RyajUAOQlPubIiHVLBwU8UdTP0V72C6Cl2NjpjvLngulg== Received: from MW4PR02CA0005.namprd02.prod.outlook.com (2603:10b6:303:16d::14) by SA0PR12MB4461.namprd12.prod.outlook.com (2603:10b6:806:9c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.26; Sun, 25 Jun 2023 06:43:28 +0000 Received: from CO1NAM11FT013.eop-nam11.prod.protection.outlook.com (2603:10b6:303:16d:cafe::3f) by MW4PR02CA0005.outlook.office365.com (2603:10b6:303:16d::14) 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:43:27 +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 CO1NAM11FT013.mail.protection.outlook.com (10.13.174.227) 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:43:26 +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:43:22 -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:43:21 -0700 From: Xueming Li To: Boleslav Stankevich CC: Andrew Rybchenko , Chenbo Xia , dpdk stable Subject: patch 'net/virtio: fix initialization to return negative errno' has been queued to stable release 22.11.3 Date: Sun, 25 Jun 2023 14:35:03 +0800 Message-ID: <20230625063544.11183-86-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: CO1NAM11FT013:EE_|SA0PR12MB4461:EE_ X-MS-Office365-Filtering-Correlation-Id: 6d9a4701-ac47-4503-7dc7-08db75477ab3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kEJi1tHaeGGTqCrk9kp0BY9zs4ROD+tHA90ri8gm7pH5JOk4ql41bHw3JcwVTwqm8zJMEPGMSO37//1gbskhs48HmXBYO/uQEEhzYipmCecTqEoBRZq69qeIX37wEnfCwQtWY5Ity7z/v2DQWOj6buP+72J37TN20hD27th37PooY/MMV3fX2hzN7LN3B5Hbtq3Pz7UDVuPvqyeRHrRVqxe1yE8jpeTnbMqspWGA5zbpZDGMrQeiszyH5PLogEoGVucr04JnU3EwMbANL5jBB2RffYKM2olFtijml6gfAc2/FuIQRjbIcrhOPFDVSShDQ2gI85H244eQpIepeys7yhNqAD8Mu6ZDKSXFFu4CMoZLoc4vOMut4Eg5gFeEd63wFkyzNUdPBFAxOzZdFxIdugR4uOBNcF4hT3zjyPi5+Bsr1lr7YtbcfvEAUKSuUvztqMKDciPI87D3UgTzp39s9ud0UsBIJhfApuhOMGbzaDiwfhEz98LjKwk19FrVqHuMlqicEoEVO4K38shqOZ8u5UjvG5eKgphSLHWtXoXlCwTn7h/umVu+8KAfr2rmRdClW2ilnBfX8r/VxfAy2FoFSDfJWCONydVKkFbit6PvhurOf4dE26+TnLnYzkJlcG5No8jGamOvo++ubnuqpumM8gD9DjOsrV0SefQ0nDhej75S7P24Sw8AuU1IO1ladlkK84S3bzs/zURS4FdTjDRQiMbEVMm2hgYMjF+T0ef8pWQs5pGeiXTF5Hr0iTX/Bn7fWVKjD8RSWO9iAg5erCltXw== 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)(39860400002)(376002)(346002)(396003)(136003)(451199021)(40470700004)(46966006)(36840700001)(40460700003)(2906002)(7696005)(82310400005)(82740400003)(6666004)(356005)(7636003)(2616005)(83380400001)(47076005)(336012)(426003)(1076003)(26005)(186003)(6286002)(16526019)(53546011)(966005)(36860700001)(55016003)(41300700001)(40480700001)(86362001)(54906003)(478600001)(316002)(70586007)(70206006)(40140700001)(36756003)(6916009)(4326008)(8936002)(8676002)(5660300002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jun 2023 06:43:26.3674 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6d9a4701-ac47-4503-7dc7-08db75477ab3 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: CO1NAM11FT013.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4461 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=d228fa562b1d875d492be083abf4258ced0ee409 Thanks. Xueming Li --- >From d228fa562b1d875d492be083abf4258ced0ee409 Mon Sep 17 00:00:00 2001 From: Boleslav Stankevich Date: Wed, 22 Mar 2023 13:23:25 +0300 Subject: [PATCH] net/virtio: fix initialization to return negative errno Cc: Xueming Li [ upstream commit 55e19d06f8a8a865297532071453c10544a07a24 ] virtio_init_device() and called helper functions sometimes return -1 when return code should be negative errno. Fix all such cases to return correct negative errno instead. Fixes: 26b683b4f7d0 ("net/virtio: setup Rx queue interrupts") Fixes: 0c9d66207054 ("net/virtio: support RSS") Fixes: 6ba1f63b5ab0 ("virtio: support specification 1.0") Fixes: 49d26d9e3f47 ("net/virtio: support MTU feature") Signed-off-by: Boleslav Stankevich Signed-off-by: Andrew Rybchenko Reviewed-by: Chenbo Xia --- drivers/net/virtio/virtio_ethdev.c | 33 +++++++++++++++++------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 0c0c7c78f9..c4f6fa55b3 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1804,9 +1804,10 @@ virtio_configure_intr(struct rte_eth_dev *dev) return -ENOTSUP; } - if (rte_intr_efd_enable(dev->intr_handle, dev->data->nb_rx_queues)) { + ret = rte_intr_efd_enable(dev->intr_handle, dev->data->nb_rx_queues); + if (ret < 0) { PMD_INIT_LOG(ERR, "Fail to create eventfd"); - return -1; + return ret; } ret = rte_intr_vec_list_alloc(dev->intr_handle, "intr_vec", @@ -1835,12 +1836,13 @@ virtio_configure_intr(struct rte_eth_dev *dev) */ if (virtio_intr_enable(dev) < 0) { PMD_DRV_LOG(ERR, "interrupt enable failed"); - return -1; + return -EINVAL; } - if (virtio_queues_bind_intr(dev) < 0) { + ret = virtio_queues_bind_intr(dev); + if (ret < 0) { PMD_INIT_LOG(ERR, "Failed to bind queue/interrupt"); - return -1; + return ret; } return 0; @@ -2163,7 +2165,7 @@ virtio_dev_rss_init(struct rte_eth_dev *eth_dev) eth_dev->device->numa_node); if (!hw->rss_key) { PMD_INIT_LOG(ERR, "Failed to allocate RSS key"); - return -1; + return -ENOMEM; } } @@ -2185,7 +2187,7 @@ virtio_dev_rss_init(struct rte_eth_dev *eth_dev) eth_dev->device->numa_node); if (!hw->rss_reta) { PMD_INIT_LOG(ERR, "Failed to allocate RSS reta"); - return -1; + return -ENOMEM; } hw->rss_rx_queues = 0; @@ -2225,7 +2227,7 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features) /* Tell the host we've known how to drive the device. */ virtio_set_status(hw, VIRTIO_CONFIG_STATUS_DRIVER); if (virtio_ethdev_negotiate_features(hw, req_features) < 0) - return -1; + return -EINVAL; hw->weak_barriers = !virtio_with_feature(hw, VIRTIO_F_ORDER_PLATFORM); @@ -2307,7 +2309,7 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features) if (config->mtu < RTE_ETHER_MIN_MTU) { PMD_INIT_LOG(ERR, "invalid max MTU value (%u)", config->mtu); - return -1; + return -EINVAL; } hw->max_mtu = config->mtu; @@ -2320,9 +2322,11 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features) } hw->rss_hash_types = 0; - if (virtio_with_feature(hw, VIRTIO_NET_F_RSS)) - if (virtio_dev_rss_init(eth_dev)) - return -1; + if (virtio_with_feature(hw, VIRTIO_NET_F_RSS)) { + ret = virtio_dev_rss_init(eth_dev); + if (ret < 0) + return ret; + } PMD_INIT_LOG(DEBUG, "config->max_virtqueue_pairs=%d", config->max_virtqueue_pairs); @@ -2344,10 +2348,11 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features) return ret; if (eth_dev->data->dev_conf.intr_conf.rxq) { - if (virtio_configure_intr(eth_dev) < 0) { + ret = virtio_configure_intr(eth_dev); + if (ret < 0) { PMD_INIT_LOG(ERR, "failed to configure interrupt"); virtio_free_queues(hw); - return -1; + return ret; } } -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-06-25 14:32:00.769978100 +0800 +++ 0085-net-virtio-fix-initialization-to-return-negative-err.patch 2023-06-25 14:31:58.455773900 +0800 @@ -1 +1 @@ -From 55e19d06f8a8a865297532071453c10544a07a24 Mon Sep 17 00:00:00 2001 +From d228fa562b1d875d492be083abf4258ced0ee409 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 55e19d06f8a8a865297532071453c10544a07a24 ] @@ -14 +16,0 @@ -Cc: stable@dpdk.org @@ -24 +26 @@ -index a81110e70a..2c23f1c00e 100644 +index 0c0c7c78f9..c4f6fa55b3 100644 @@ -27 +29 @@ -@@ -1360,9 +1360,10 @@ virtio_configure_intr(struct rte_eth_dev *dev) +@@ -1804,9 +1804,10 @@ virtio_configure_intr(struct rte_eth_dev *dev) @@ -40 +42 @@ -@@ -1391,12 +1392,13 @@ virtio_configure_intr(struct rte_eth_dev *dev) +@@ -1835,12 +1836,13 @@ virtio_configure_intr(struct rte_eth_dev *dev) @@ -57 +59 @@ -@@ -1719,7 +1721,7 @@ virtio_dev_rss_init(struct rte_eth_dev *eth_dev) +@@ -2163,7 +2165,7 @@ virtio_dev_rss_init(struct rte_eth_dev *eth_dev) @@ -66 +68 @@ -@@ -1741,7 +1743,7 @@ virtio_dev_rss_init(struct rte_eth_dev *eth_dev) +@@ -2185,7 +2187,7 @@ virtio_dev_rss_init(struct rte_eth_dev *eth_dev) @@ -75 +77 @@ -@@ -1781,7 +1783,7 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features) +@@ -2225,7 +2227,7 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features) @@ -84 +86 @@ -@@ -1863,7 +1865,7 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features) +@@ -2307,7 +2309,7 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features) @@ -93 +95 @@ -@@ -1876,9 +1878,11 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features) +@@ -2320,9 +2322,11 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features) @@ -108 +110 @@ -@@ -1900,10 +1904,11 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features) +@@ -2344,10 +2348,11 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)