DPDK patches and discussions
 help / color / Atom feed
* [dpdk-dev] [PATCH v1] examples/ioat: resolve unchecked return value
@ 2019-11-28 10:03 Praveen Shetty
  2019-11-28 10:03 ` [dpdk-dev] [PATCH] " Praveen Shetty
  2019-11-28 11:27 ` [dpdk-dev] [PATCH v2] " Praveen Shetty
  0 siblings, 2 replies; 5+ messages in thread
From: Praveen Shetty @ 2019-11-28 10:03 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson

patch checks the return value of function rte_eth_dev_info_get,
if return value is negative error message printed on the console.

Coverity issue: 350361

Signed-off-by: Praveen Shetty <praveen.shetty@intel.com>
---
 examples/ioat/ioatfwd.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c
index e9117718f..b39a098ec 100644
--- a/examples/ioat/ioatfwd.c
+++ b/examples/ioat/ioatfwd.c
@@ -824,7 +824,11 @@ port_init(uint16_t portid, struct rte_mempool *mbuf_pool, uint16_t nb_queues)
 	/* Init port */
 	printf("Initializing port %u... ", portid);
 	fflush(stdout);
-	rte_eth_dev_info_get(portid, &dev_info);
+	ret = rte_eth_dev_info_get(portid, &dev_info);
+	if (ret < 0)
+		rte_exit(EXIT_FAILURE, "Cannot get device info: %s, port=%u\n",
+			rte_strerror(-ret), portid);
+
 	local_port_conf.rx_adv_conf.rss_conf.rss_hf &=
 		dev_info.flow_type_rss_offloads;
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
-- 
2.17.1


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

* [dpdk-dev] [PATCH] examples/ioat: resolve unchecked return value
  2019-11-28 10:03 [dpdk-dev] [PATCH v1] examples/ioat: resolve unchecked return value Praveen Shetty
@ 2019-11-28 10:03 ` " Praveen Shetty
  2019-11-28 11:27 ` [dpdk-dev] [PATCH v2] " Praveen Shetty
  1 sibling, 0 replies; 5+ messages in thread
From: Praveen Shetty @ 2019-11-28 10:03 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson

patch checks the return value of function rte_eth_dev_info_get,
if return value is negative error message printed on the console.

Coverity issue: 350361

Signed-off-by: Praveen Shetty <praveen.shetty@intel.com>
---
 examples/ioat/ioatfwd.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c
index e9117718f..b39a098ec 100644
--- a/examples/ioat/ioatfwd.c
+++ b/examples/ioat/ioatfwd.c
@@ -824,7 +824,11 @@ port_init(uint16_t portid, struct rte_mempool *mbuf_pool, uint16_t nb_queues)
 	/* Init port */
 	printf("Initializing port %u... ", portid);
 	fflush(stdout);
-	rte_eth_dev_info_get(portid, &dev_info);
+	ret = rte_eth_dev_info_get(portid, &dev_info);
+	if (ret < 0)
+		rte_exit(EXIT_FAILURE, "Cannot get device info: %s, port=%u\n",
+			rte_strerror(-ret), portid);
+
 	local_port_conf.rx_adv_conf.rss_conf.rss_hf &=
 		dev_info.flow_type_rss_offloads;
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
-- 
2.17.1


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

* [dpdk-dev] [PATCH v2] examples/ioat: resolve unchecked return value
  2019-11-28 10:03 [dpdk-dev] [PATCH v1] examples/ioat: resolve unchecked return value Praveen Shetty
  2019-11-28 10:03 ` [dpdk-dev] [PATCH] " Praveen Shetty
@ 2019-11-28 11:27 ` " Praveen Shetty
  2019-11-28 11:32   ` Bruce Richardson
  1 sibling, 1 reply; 5+ messages in thread
From: Praveen Shetty @ 2019-11-28 11:27 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, pawelx.modrak

patch checks the return value of function rte_eth_dev_info_get,
if return value is negative error message printed on the console.

Coverity issue: 350361
Fixes: c8e6ceecebc1 ("examples/ioat: add new sample app for ioat driver")
Cc: pawelx.modrak@intel.com

Signed-off-by: Praveen Shetty <praveen.shetty@intel.com>
---
 examples/ioat/ioatfwd.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c
index e9117718f..b39a098ec 100644
--- a/examples/ioat/ioatfwd.c
+++ b/examples/ioat/ioatfwd.c
@@ -824,7 +824,11 @@ port_init(uint16_t portid, struct rte_mempool *mbuf_pool, uint16_t nb_queues)
 	/* Init port */
 	printf("Initializing port %u... ", portid);
 	fflush(stdout);
-	rte_eth_dev_info_get(portid, &dev_info);
+	ret = rte_eth_dev_info_get(portid, &dev_info);
+	if (ret < 0)
+		rte_exit(EXIT_FAILURE, "Cannot get device info: %s, port=%u\n",
+			rte_strerror(-ret), portid);
+
 	local_port_conf.rx_adv_conf.rss_conf.rss_hf &=
 		dev_info.flow_type_rss_offloads;
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH v2] examples/ioat: resolve unchecked return value
  2019-11-28 11:27 ` [dpdk-dev] [PATCH v2] " Praveen Shetty
@ 2019-11-28 11:32   ` Bruce Richardson
  2020-02-13 14:00     ` David Marchand
  0 siblings, 1 reply; 5+ messages in thread
From: Bruce Richardson @ 2019-11-28 11:32 UTC (permalink / raw)
  To: Praveen Shetty; +Cc: dev, pawelx.modrak

On Thu, Nov 28, 2019 at 11:27:14AM +0000, Praveen Shetty wrote:
> patch checks the return value of function rte_eth_dev_info_get,
> if return value is negative error message printed on the console.
> 
> Coverity issue: 350361
> Fixes: c8e6ceecebc1 ("examples/ioat: add new sample app for ioat driver")
> Cc: pawelx.modrak@intel.com
> 
> Signed-off-by: Praveen Shetty <praveen.shetty@intel.com>
> ---
>  examples/ioat/ioatfwd.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Thanks for the fix.
This is non-critical so merge can be deferred to 20.02

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

* Re: [dpdk-dev] [PATCH v2] examples/ioat: resolve unchecked return value
  2019-11-28 11:32   ` Bruce Richardson
@ 2020-02-13 14:00     ` David Marchand
  0 siblings, 0 replies; 5+ messages in thread
From: David Marchand @ 2020-02-13 14:00 UTC (permalink / raw)
  To: Praveen Shetty; +Cc: dev, Pawel Modrak, Bruce Richardson

On Thu, Nov 28, 2019 at 12:32 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> On Thu, Nov 28, 2019 at 11:27:14AM +0000, Praveen Shetty wrote:
> > patch checks the return value of function rte_eth_dev_info_get,
> > if return value is negative error message printed on the console.
> >
> > Coverity issue: 350361
> > Fixes: c8e6ceecebc1 ("examples/ioat: add new sample app for ioat driver")

Cc: stable@dpdk.org

> >
> > Signed-off-by: Praveen Shetty <praveen.shetty@intel.com>
> > ---
> >  examples/ioat/ioatfwd.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks.


-- 
David Marchand


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

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-28 10:03 [dpdk-dev] [PATCH v1] examples/ioat: resolve unchecked return value Praveen Shetty
2019-11-28 10:03 ` [dpdk-dev] [PATCH] " Praveen Shetty
2019-11-28 11:27 ` [dpdk-dev] [PATCH v2] " Praveen Shetty
2019-11-28 11:32   ` Bruce Richardson
2020-02-13 14:00     ` David Marchand

DPDK patches and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dev/0 dev/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 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev


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


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