patches for DPDK stable branches
 help / color / Atom feed
* [dpdk-stable] [PATCH v2 01/54] ethdev: remove redundunt device info cleanup before get
       [not found] ` <1567519051-28189-1-git-send-email-arybchenko@solarflare.com>
@ 2019-09-03 13:56   ` Andrew Rybchenko
  2019-09-04  8:32     ` Ferruh Yigit
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Rybchenko @ 2019-09-03 13:56 UTC (permalink / raw)
  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: dev, stable

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 <arybchenko@solarflare.com>
---
 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 b6bc34b..e4dda93 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2319,7 +2319,6 @@ struct cmd_config_rss_hash_key {
 	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 @@ struct cmd_config_rss_reta {
 	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 @@ struct cmd_showport_reta {
 	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 @@ struct cmd_flow_director_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 1a5a5c1..523b3d3 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -478,7 +478,6 @@ static int bus_match_all(const struct rte_bus *bus, const void *data)
 	}
 	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 @@ struct igb_ring_desc_16_bytes {
 #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 571c4e5..fd1692d 100644
--- a/examples/ethtool/lib/rte_ethtool.c
+++ b/examples/ethtool/lib/rte_ethtool.c
@@ -41,7 +41,6 @@
 		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 @@
 	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 4710d71..17f695e 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -898,7 +898,6 @@ struct kni_interface_stats {
 			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 */
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-stable] [PATCH v2 01/54] ethdev: remove redundunt device info cleanup before get
  2019-09-03 13:56   ` [dpdk-stable] [PATCH v2 01/54] ethdev: remove redundunt device info cleanup before get Andrew Rybchenko
@ 2019-09-04  8:32     ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2019-09-04  8:32 UTC (permalink / raw)
  To: Andrew Rybchenko, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger,
	Marko Kovacevic, Ori Kam, Bruce Richardson, Pablo de Lara,
	Radu Nicolau, Akhil Goyal, Tomasz Kantecki
  Cc: dev, stable

On 9/3/2019 2:56 PM, Andrew Rybchenko wrote:
> 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 <arybchenko@solarflare.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-stable] [PATCH v3 01/54] ethdev: remove redundunt device info cleanup before get
       [not found] ` <1567755066-31389-1-git-send-email-arybchenko@solarflare.com>
@ 2019-09-06  7:30   ` " Andrew Rybchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Rybchenko @ 2019-09-06  7:30 UTC (permalink / raw)
  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: dev, stable

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 <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 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 b6bc34b4d2..e4dda93a49 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 1a5a5c13c0..523b3d3761 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 571c4e5aa5..fd1692daae 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 4710d71769..17f695ea99 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-stable] [PATCH v4 01/54] ethdev: remove redundunt device info cleanup before get
       [not found] ` <1568306586-27831-1-git-send-email-arybchenko@solarflare.com>
@ 2019-09-12 16:42   ` " Andrew Rybchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Rybchenko @ 2019-09-12 16:42 UTC (permalink / raw)
  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: dev, stable

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 <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1566915962-5472-1-git-send-email-arybchenko@solarflare.com>
     [not found] ` <1567519051-28189-1-git-send-email-arybchenko@solarflare.com>
2019-09-03 13:56   ` [dpdk-stable] [PATCH v2 01/54] ethdev: remove redundunt device info cleanup before get Andrew Rybchenko
2019-09-04  8:32     ` Ferruh Yigit
     [not found] ` <1567755066-31389-1-git-send-email-arybchenko@solarflare.com>
2019-09-06  7:30   ` [dpdk-stable] [PATCH v3 " Andrew Rybchenko
     [not found] ` <1568306586-27831-1-git-send-email-arybchenko@solarflare.com>
2019-09-12 16:42   ` [dpdk-stable] [PATCH v4 " Andrew Rybchenko

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox