DPDK patches and discussions
 help / color / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Július Milan <jmilan.dev@gmail.com>,
	dev@dpdk.org, xiaolong.ye@intel.com, qi.z.zhang@intel.com,
	david.marchand@redhat.com
Subject: Re: [dpdk-dev] [PATCH] net/af_xdp: fix xdp_get_channels_info return value
Date: Fri, 12 Jul 2019 17:07:43 +0100
Message-ID: <e154c294-bb04-77e4-bbaa-4c088b4e22a1@intel.com> (raw)
In-Reply-To: <20190712084848.2ccaff67@hermes.lan>

On 7/12/2019 4:48 PM, Stephen Hemminger wrote:
> On Fri, 12 Jul 2019 16:35:55 +0100
> Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> 
>> On 7/12/2019 4:10 PM, Stephen Hemminger wrote:
>>> On Fri, 12 Jul 2019 09:55:46 +0200
>>> Július Milan <jmilan.dev@gmail.com> wrote:
>>>   
>>>> Procedure xdp_get_channels_info was returning error code -1 in case of
>>>> ioctl command SIOCETHTOOL was not supported. This patch sets return
>>>> value back to 0 as it is valid case.
>>>>
>>>> Fixes: 339b88c6a9 ("net/af_xdp: support multi-queue")
>>>>
>>>> Signed-off-by: Július Milan <jmilan.dev@gmail.com>
>>>> ---
>>>>  drivers/net/af_xdp/rte_eth_af_xdp.c | 10 +++++++---
>>>>  1 file changed, 7 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
>>>> index ff8e90589..33352e10a 100644
>>>> --- a/drivers/net/af_xdp/rte_eth_af_xdp.c
>>>> +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
>>>> @@ -852,9 +852,13 @@ xdp_get_channels_info(const char *if_name, int *max_queues,
>>>>  	ifr.ifr_data = (void *)&channels;
>>>>  	strncpy(ifr.ifr_name, if_name, IFNAMSIZ);
>>>>  	ret = ioctl(fd, SIOCETHTOOL, &ifr);
>>>> -	if (ret && errno != EOPNOTSUPP) {
>>>> -		ret = -errno;
>>>> -		goto out;
>>>> +	if (ret) {
>>>> +		if (errno == EOPNOTSUPP) {
>>>> +			ret = 0;
>>>> +		} else {
>>>> +			ret = -errno;
>>>> +			goto out;
>>>> +		}
>>>>  	}
>>>>  
>>>>  	if (channels.max_combined == 0 || errno == EOPNOTSUPP) {  
>>>
>>> Still wrong, it doesn't set max_queues/combined_queues if errno == EOPNOTSUPP
>>>   
>>
>> Looks like code only fixes the return value, which was 'ret' before, now  '0',
>> the remaining logic should be same.
>>
>> as far as I can see, if errno == EOPNOTSUPP, it sets
>>   *max_queues = 1;
>>   *combined_queues = channels.combined_count;
> 
> OK, it does return correctly, just the hard way to do it.
> Keep it for now, I will do a cleanup pass over AF_XDP later.
> Lots  of things could be done simpler
> 

ok

  reply index

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-12  7:55 Július Milan
2019-07-12 15:10 ` Stephen Hemminger
2019-07-12 15:35   ` Ferruh Yigit
2019-07-12 15:48     ` Stephen Hemminger
2019-07-12 16:07       ` Ferruh Yigit [this message]
2019-07-12 15:43 ` Ye Xiaolong
2019-07-12 15:01   ` Ferruh Yigit
2019-07-12 15:21     ` Stephen Hemminger
  -- strict thread matches above, loose matches on Subject: below --
2019-07-12  7:40 Július Milan
2019-07-12 15:09 ` Stephen Hemminger

Reply instructions:

You may reply publically 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=e154c294-bb04-77e4-bbaa-4c088b4e22a1@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jmilan.dev@gmail.com \
    --cc=qi.z.zhang@intel.com \
    --cc=stephen@networkplumber.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

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