From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0D767A04F3 for ; Thu, 19 Dec 2019 15:36:04 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 040E7330; Thu, 19 Dec 2019 15:36:04 +0100 (CET) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by dpdk.org (Postfix) with ESMTP id E1C681BF75 for ; Thu, 19 Dec 2019 15:36:02 +0100 (CET) Received: by mail-wr1-f53.google.com with SMTP id q6so6188281wro.9 for ; Thu, 19 Dec 2019 06:36:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qXY66t5XKoDZc9LY2FL+QpEkaieNZ1M1owoold6O7uo=; b=G9kI2W3dYXrpDBA7QiXF6Xmm/xzpz72EKF47c1qgHX5QlmPq++q+qWNTky9nyxEZeX DuC+aeImgDEW2893pM+vK6haGun0chzcpvZQ/W66lqkNrlEnbOPPjPon5uuDMM9TrNtN iwxcMD2KEvpkwb331UCJ1SctP6HJSVDUblFnX5UR5jdnfXJb43QoEl8Il6ja7qiYpqQS ehoLaAF/p/CpnI4CRcYJDx4Ope4KFRmK2B38EBBmSbdcaM/8Irb56tVcRhl+KYwkZbX/ i1/ZSO2elGGn0qzfA/tSi9sb0m9H2xbLu6ccOtBh79zu+i4pqZpjRK/S0qWOoNwKVRmP QewQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qXY66t5XKoDZc9LY2FL+QpEkaieNZ1M1owoold6O7uo=; b=XE38wAlqkUI4lFEZREi09mK+09stDETi3ltF/bjYKNKBYLUVuc3JXGK7hL0XpHoDU+ 7VXEndGTMOonbRlEPPqlz5Rrw8RAlBS7H0yZ18dBL1yWjEaB7L0qK5BmqRnOBvc/FCky e/qsL8la4Pm/LuWQXgNE9SpCXWcpIHDSJ+bQoLIkf3Zb4/GVzomB7N8C/dOczM3qI3Zu oB1xn3Y4LJAkm6/kzBVuqpmejfUSCdgrbH9aOkSvjB+7lJ10MBPl18tgMTpyMWPDdPfv rzrRBaRH+aN4uPHpUowWtgiSRMhzyjZjPc1XybfLOY8bhQaY6nezGSnNIL6WJq20hdWg 3+ZA== X-Gm-Message-State: APjAAAXibHpM8gZp35BraIJF83NZb3GhkmtGeQi+WgVt9XksOfOTMfMi tZvqTmVYo7I0ZvJcO3CY1iiu+OMaG24= X-Google-Smtp-Source: APXvYqwrmDe3ChzMK+AvcLPw73T8qxExbRbaGp912aXMDQSVrOPq60PhbZka1sj65Bs5vosn2vOV+w== X-Received: by 2002:a5d:4b4e:: with SMTP id w14mr9636774wrs.187.1576766162592; Thu, 19 Dec 2019 06:36:02 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id m7sm5829019wma.39.2019.12.19.06.36.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 06:36:02 -0800 (PST) From: luca.boccassi@gmail.com To: Andrew Rybchenko Cc: Ferruh Yigit , dpdk stable Date: Thu, 19 Dec 2019 14:32:53 +0000 Message-Id: <20191219143447.21506-26-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219143447.21506-1-luca.boccassi@gmail.com> References: <20191219143447.21506-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'ethdev: remove redundant device info cleanup before get' has been queued to LTS release 17.11.10 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 LTS release 17.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/21/19. 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. Thanks. Luca Boccassi --- >From 47b76c914ec37e8951a09baa1bdc1463c0edf714 Mon Sep 17 00:00:00 2001 From: Andrew Rybchenko Date: Thu, 12 Sep 2019 17:42:12 +0100 Subject: [PATCH] ethdev: remove redundant device info cleanup before get [ upstream commit 78402e16ec08db79a2e380466ff41dd939541265 ] rte_eth_dev_info_get() always fills in device information memory with zeros on entry. Fixes: b6719879855d ("ethdev: avoid getting uninitialized info for bad port") Signed-off-by: Andrew Rybchenko Reviewed-by: Ferruh Yigit --- app/test-pmd/cmdline.c | 4 ---- app/test-pmd/config.c | 2 -- examples/ethtool/lib/rte_ethtool.c | 2 -- examples/kni/main.c | 1 - 4 files changed, 9 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 7a3a818723..6d641a24e3 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -1974,7 +1974,6 @@ cmd_config_rss_hash_key_parsed(void *parsed_result, uint8_t hash_key_size; uint32_t key_len; - memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get(res->port_id, &dev_info); if (dev_info.hash_key_size > 0 && dev_info.hash_key_size <= sizeof(hash_key)) @@ -2214,7 +2213,6 @@ cmd_set_rss_reta_parsed(void *parsed_result, struct rte_eth_rss_reta_entry64 reta_conf[8]; struct cmd_config_rss_reta *res = parsed_result; - memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get(res->port_id, &dev_info); if (dev_info.reta_size == 0) { printf("Redirection table size is 0 which is " @@ -2334,7 +2332,6 @@ cmd_showport_reta_parsed(void *parsed_result, struct rte_eth_dev_info dev_info; uint16_t max_reta_size; - memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get(res->port_id, &dev_info); max_reta_size = RTE_MIN(dev_info.reta_size, ETH_RSS_RETA_SIZE_512); if (res->size == 0 || res->size > max_reta_size) { @@ -10046,7 +10043,6 @@ cmd_flow_director_filter_parsed(void *parsed_result, else if (!strncmp(res->pf_vf, "vf", 2)) { struct rte_eth_dev_info dev_info; - memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get(res->port_id, &dev_info); errno = 0; vf_id = strtoul(res->pf_vf + 2, &end, 10); diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 61608d18fb..18126a0f4a 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -429,7 +429,6 @@ port_infos_display(portid_t port_id) } port = &ports[port_id]; rte_eth_link_get_nowait(port_id, &link); - memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get(port_id, &dev_info); printf("\n%s Infos for port %-2d %s\n", info_border, port_id, info_border); @@ -1558,7 +1557,6 @@ ring_rx_descriptor_display(const struct rte_memzone *ring_mz, #ifndef RTE_LIBRTE_I40E_16BYTE_RX_DESC struct rte_eth_dev_info dev_info; - memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get(port_id, &dev_info); if (strstr(dev_info.driver_name, "i40e") != NULL) { /* 32 bytes RX descriptor, i40e only */ diff --git a/examples/ethtool/lib/rte_ethtool.c b/examples/ethtool/lib/rte_ethtool.c index c70c54786a..ebdaed4ad6 100644 --- a/examples/ethtool/lib/rte_ethtool.c +++ b/examples/ethtool/lib/rte_ethtool.c @@ -67,7 +67,6 @@ rte_ethtool_get_drvinfo(uint16_t port_id, struct ethtool_drvinfo *drvinfo) printf("Insufficient fw version buffer size, " "the minimum size should be %d\n", ret); - memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get(port_id, &dev_info); snprintf(drvinfo->driver, sizeof(drvinfo->driver), "%s", @@ -367,7 +366,6 @@ rte_ethtool_net_set_rx_mode(uint16_t port_id) struct rte_eth_dev_info dev_info; uint16_t vf; - memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get(port_id, &dev_info); num_vfs = dev_info.max_vfs; diff --git a/examples/kni/main.c b/examples/kni/main.c index 3f17385442..e272e84bba 100644 --- a/examples/kni/main.c +++ b/examples/kni/main.c @@ -802,7 +802,6 @@ kni_alloc(uint16_t port_id) struct rte_kni_ops ops; struct rte_eth_dev_info dev_info; - memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get(port_id, &dev_info); if (dev_info.pci_dev) { -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-12-19 14:32:27.347998148 +0000 +++ 0026-ethdev-remove-redundant-device-info-cleanup-before-g.patch 2019-12-19 14:32:25.661289021 +0000 @@ -1,13 +1,14 @@ -From 78402e16ec08db79a2e380466ff41dd939541265 Mon Sep 17 00:00:00 2001 +From 47b76c914ec37e8951a09baa1bdc1463c0edf714 Mon Sep 17 00:00:00 2001 From: Andrew Rybchenko Date: Thu, 12 Sep 2019 17:42:12 +0100 Subject: [PATCH] ethdev: remove redundant device info cleanup before get +[ upstream commit 78402e16ec08db79a2e380466ff41dd939541265 ] + rte_eth_dev_info_get() always fills in device information memory with zeros on entry. Fixes: b6719879855d ("ethdev: avoid getting uninitialized info for bad port") -Cc: stable@dpdk.org Signed-off-by: Andrew Rybchenko Reviewed-by: Ferruh Yigit @@ -19,10 +20,10 @@ 4 files changed, 9 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c -index b6bc34b4d2..e4dda93a49 100644 +index 7a3a818723..6d641a24e3 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c -@@ -2319,7 +2319,6 @@ cmd_config_rss_hash_key_parsed(void *parsed_result, +@@ -1974,7 +1974,6 @@ cmd_config_rss_hash_key_parsed(void *parsed_result, uint8_t hash_key_size; uint32_t key_len; @@ -30,7 +31,7 @@ rte_eth_dev_info_get(res->port_id, &dev_info); if (dev_info.hash_key_size > 0 && dev_info.hash_key_size <= sizeof(hash_key)) -@@ -2852,7 +2851,6 @@ cmd_set_rss_reta_parsed(void *parsed_result, +@@ -2214,7 +2213,6 @@ cmd_set_rss_reta_parsed(void *parsed_result, struct rte_eth_rss_reta_entry64 reta_conf[8]; struct cmd_config_rss_reta *res = parsed_result; @@ -38,7 +39,7 @@ rte_eth_dev_info_get(res->port_id, &dev_info); if (dev_info.reta_size == 0) { printf("Redirection table size is 0 which is " -@@ -2972,7 +2970,6 @@ cmd_showport_reta_parsed(void *parsed_result, +@@ -2334,7 +2332,6 @@ cmd_showport_reta_parsed(void *parsed_result, struct rte_eth_dev_info dev_info; uint16_t max_reta_size; @@ -46,7 +47,7 @@ rte_eth_dev_info_get(res->port_id, &dev_info); max_reta_size = RTE_MIN(dev_info.reta_size, ETH_RSS_RETA_SIZE_512); if (res->size == 0 || res->size > max_reta_size) { -@@ -11091,7 +11088,6 @@ cmd_flow_director_filter_parsed(void *parsed_result, +@@ -10046,7 +10043,6 @@ cmd_flow_director_filter_parsed(void *parsed_result, else if (!strncmp(res->pf_vf, "vf", 2)) { struct rte_eth_dev_info dev_info; @@ -55,10 +56,10 @@ errno = 0; vf_id = strtoul(res->pf_vf + 2, &end, 10); diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c -index 1a5a5c13c0..523b3d3761 100644 +index 61608d18fb..18126a0f4a 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c -@@ -478,7 +478,6 @@ port_infos_display(portid_t port_id) +@@ -429,7 +429,6 @@ port_infos_display(portid_t port_id) } port = &ports[port_id]; rte_eth_link_get_nowait(port_id, &link); @@ -66,7 +67,7 @@ rte_eth_dev_info_get(port_id, &dev_info); printf("\n%s Infos for port %-2d %s\n", info_border, port_id, info_border); -@@ -1623,7 +1622,6 @@ ring_rx_descriptor_display(const struct rte_memzone *ring_mz, +@@ -1558,7 +1557,6 @@ ring_rx_descriptor_display(const struct rte_memzone *ring_mz, #ifndef RTE_LIBRTE_I40E_16BYTE_RX_DESC struct rte_eth_dev_info dev_info; @@ -75,18 +76,18 @@ if (strstr(dev_info.driver_name, "i40e") != NULL) { /* 32 bytes RX descriptor, i40e only */ diff --git a/examples/ethtool/lib/rte_ethtool.c b/examples/ethtool/lib/rte_ethtool.c -index 571c4e5aa5..fd1692daae 100644 +index c70c54786a..ebdaed4ad6 100644 --- a/examples/ethtool/lib/rte_ethtool.c +++ b/examples/ethtool/lib/rte_ethtool.c -@@ -41,7 +41,6 @@ rte_ethtool_get_drvinfo(uint16_t port_id, struct ethtool_drvinfo *drvinfo) +@@ -67,7 +67,6 @@ rte_ethtool_get_drvinfo(uint16_t port_id, struct ethtool_drvinfo *drvinfo) printf("Insufficient fw version buffer size, " "the minimum size should be %d\n", ret); - memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get(port_id, &dev_info); - strlcpy(drvinfo->driver, dev_info.driver_name, -@@ -372,7 +371,6 @@ rte_ethtool_net_set_rx_mode(uint16_t port_id) + snprintf(drvinfo->driver, sizeof(drvinfo->driver), "%s", +@@ -367,7 +366,6 @@ rte_ethtool_net_set_rx_mode(uint16_t port_id) struct rte_eth_dev_info dev_info; uint16_t vf; @@ -95,17 +96,17 @@ num_vfs = dev_info.max_vfs; diff --git a/examples/kni/main.c b/examples/kni/main.c -index 4710d71769..17f695ea99 100644 +index 3f17385442..e272e84bba 100644 --- a/examples/kni/main.c +++ b/examples/kni/main.c -@@ -898,7 +898,6 @@ kni_alloc(uint16_t port_id) +@@ -802,7 +802,6 @@ kni_alloc(uint16_t port_id) struct rte_kni_ops ops; struct rte_eth_dev_info dev_info; - memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get(port_id, &dev_info); - /* Get the interface default mac address */ + if (dev_info.pci_dev) { -- 2.20.1