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 35476A2EEB for ; Thu, 12 Sep 2019 18:43:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 049F31ED8F; Thu, 12 Sep 2019 18:43:27 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id DBC0B1ED25; Thu, 12 Sep 2019 18:43:25 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (webmail.solarflare.com [12.187.104.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us5.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id AAFF34C0051; Thu, 12 Sep 2019 16:43:23 +0000 (UTC) Received: from ocex03.SolarFlarecom.com (10.20.40.36) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 12 Sep 2019 09:43:19 -0700 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Thu, 12 Sep 2019 09:43:19 -0700 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id x8CGhIM9023655; Thu, 12 Sep 2019 17:43:18 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id 083BC1613D2; Thu, 12 Sep 2019 17:43:18 +0100 (BST) From: Andrew Rybchenko To: Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , Marko Kovacevic , Ori Kam , Bruce Richardson , Pablo de Lara , Radu Nicolau , Akhil Goyal , Tomasz Kantecki , Ferruh Yigit CC: , Date: Thu, 12 Sep 2019 17:42:12 +0100 Message-ID: <1568306586-27831-2-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1568306586-27831-1-git-send-email-arybchenko@solarflare.com> References: <1566915962-5472-1-git-send-email-arybchenko@solarflare.com> <1568306586-27831-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24906.005 X-TM-AS-Result: No-6.462000-4.000000-10 X-TMASE-MatchedRID: 9IHfsdJx31dx4999K+y9YIph1hAtvKZNJih/yo+OvlVwkdIrVt8X1eKY 9D+ixKR4M22M43riQ2qQKl4RwWngiiwrJd4fYI9TPwKTD1v8YV5MkOX0UoduuVfLpI8fOvDujjV iLDq9lCAdoHUo6v4sGlD5kTz4snaBLkCtrbHoRZpYe2qRI33Kw8GYhGCkJq+Y0SxMhOhuA0SpTt npKpQyOpRzFTXjDdS8Q7LCfGHmH/jPg+gH+TiXk0+zv2ByYSDQ3YSaHlnZL810FoS1aixTNV1o7 wPE6VhYK1u7ApwT/7yAMuqetGVetnyef22ep6XYsjvNV98mpPNIoSPn+tR9o46wIfyMGbJVC9cK HvJxLHPB0pTJwVv3z2oIEQFB53E8ftwZ3X11IV0= X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--6.462000-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24906.005 X-MDID: 1568306604-eIZlyB_WC3p6 Subject: [dpdk-dev] [PATCH v4 01/54] ethdev: remove redundunt device info cleanup before get X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" 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 --- 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 b6bc34b4d..e4dda93a4 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, 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)) @@ -2852,7 +2851,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 " @@ -2972,7 +2970,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) { @@ -11091,7 +11088,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 1a5a5c13c..523b3d376 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -478,7 +478,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); @@ -1623,7 +1622,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 571c4e5aa..fd1692daa 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) 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) 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 4710d7176..17f695ea9 100644 --- a/examples/kni/main.c +++ b/examples/kni/main.c @@ -898,7 +898,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 */ -- 2.17.1