DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Li, Xiaoyun" <xiaoyun.li@intel.com>
To: "Ye, Xiaolong" <xiaolong.ye@intel.com>
Cc: "Kovacevic, Marko" <marko.kovacevic@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] examples/tep_term: fix return value check
Date: Mon, 10 Feb 2020 05:04:43 +0000
Message-ID: <c96aa3ffa0e8436f9f77a4f402711c1b@intel.com> (raw)
In-Reply-To: <20200210033637.GA79789@intel.com>

Hi

> -----Original Message-----
> From: Ye, Xiaolong
> Sent: Monday, February 10, 2020 11:37
> To: Li, Xiaoyun <xiaoyun.li@intel.com>
> Cc: Kovacevic, Marko <marko.kovacevic@intel.com>; dev@dpdk.org;
> stable@dpdk.org
> Subject: Re: [PATCH] examples/tep_term: fix return value check
> 
> On 02/10, Xiaoyun Li wrote:
> >Added return value check for 'rte_eth_dev_info_get()'.
> >
> >Coverity issue: 349922
> >Fixes: 2bb43bd4350a ("examples/tep_term: add TSO offload configuration")
> >Cc: stable@dpdk.org
> >
> >Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
> >---
> > examples/tep_termination/vxlan_setup.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> >diff --git a/examples/tep_termination/vxlan_setup.c
> b/examples/tep_termination/vxlan_setup.c
> >index eca119a72..bd469f5f4 100644
> >--- a/examples/tep_termination/vxlan_setup.c
> >+++ b/examples/tep_termination/vxlan_setup.c
> >@@ -195,7 +195,9 @@ vxlan_port_init(uint16_t port, struct rte_mempool
> *mbuf_pool)
> >
> > 	if (tso_segsz != 0) {
> > 		struct rte_eth_dev_info dev_info;
> >-		rte_eth_dev_info_get(port, &dev_info);
> >+		retval = rte_eth_dev_info_get(port, &dev_info);
> >+		if (retval != 0)
> >+			return -retval;
> 
> why return -retval not retval?

The description of return value of rte_eth_dev_info_get() is like the following:
@return
 *   - (0) if successful.
 *   - (-ENOTSUP) if support for dev_infos_get() does not exist for the device.
 *   - (-ENODEV) if *port_id* invalid.
So -retval is the real err code.
But the check of this function (vxlan_port_init) is (overlay_options.port_configure(portid, mbuf_pool) != 0)
So return -retval or retval are both OK.
> 
> Thanks,
> Xiaolong
> 
> > 		if ((dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_TSO)
> == 0)
> > 			RTE_LOG(WARNING, PORT,
> > 				"hardware TSO offload is not supported\n");
> >--
> >2.17.1
> >

  reply	other threads:[~2020-02-10  5:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-10  3:07 Xiaoyun Li
2020-02-10  3:36 ` Ye Xiaolong
2020-02-10  5:04   ` Li, Xiaoyun [this message]
2020-02-10  6:51     ` Ye Xiaolong
2020-02-10  7:04 ` [dpdk-dev] [PATCH v2] " Xiaoyun Li
2020-02-10  7:04   ` Ye Xiaolong
2020-02-13 14:57   ` David Marchand
2020-02-17  1:49     ` Li, Xiaoyun
2020-02-17  1:41 ` [dpdk-dev] [PATCH v3] examples/tep_term: remove redundant info get Xiaoyun Li
2020-02-20 15:53   ` David Marchand
2020-02-21  1:19     ` Ye Xiaolong
2020-02-21 10:13   ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c96aa3ffa0e8436f9f77a4f402711c1b@intel.com \
    --to=xiaoyun.li@intel.com \
    --cc=dev@dpdk.org \
    --cc=marko.kovacevic@intel.com \
    --cc=stable@dpdk.org \
    --cc=xiaolong.ye@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://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/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


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