Netdev List
 help / color / mirror / Atom feed
From: Joe Damato <jdamato@fastly.com>
To: David Wei <dw@davidwei.uk>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Shuah Khan <shuah@kernel.org>,
	"open list:KERNEL SELFTEST FRAMEWORK"
	<linux-kselftest@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net] selftests: drv-net: Check if combined-count exists
Date: Tue, 25 Feb 2025 18:55:06 -0500	[thread overview]
Message-ID: <Z75YWvDcvzsMlVHK@LQ3V64L9R2> (raw)
In-Reply-To: <1c263479-43a4-40ec-94ae-987c7da7d43d@davidwei.uk>

On Tue, Feb 25, 2025 at 03:11:24PM -0800, David Wei wrote:
> On 2025-02-25 10:14, Joe Damato wrote:
[...]
> > diff --git a/tools/testing/selftests/drivers/net/queues.py b/tools/testing/selftests/drivers/net/queues.py
> > index 38303da957ee..baa8845d9f64 100755
> > --- a/tools/testing/selftests/drivers/net/queues.py
> > +++ b/tools/testing/selftests/drivers/net/queues.py
> > @@ -45,10 +45,13 @@ def addremove_queues(cfg, nl) -> None:
> >  
> >      netnl = EthtoolFamily()
> >      channels = netnl.channels_get({'header': {'dev-index': cfg.ifindex}})
> > -    if channels['combined-count'] == 0:
> > -        rx_type = 'rx'
> > +    if 'combined-count' in channels:
> > +        if channels['combined-count'] == 0:
> > +            rx_type = 'rx'
> > +        else:
> > +            rx_type = 'combined'
> >      else:
> > -        rx_type = 'combined'
> > +        rx_type = 'rx'
> 
> Logic is good but minor nit in reducing nestiness:
> 
> rx_type = 'rx'
> if channels.get('combined-count', 0) > 0:
> 	rx_type = 'combined'

Thanks; will fix in the v2.

---
pw-bot: cr

      reply	other threads:[~2025-02-25 23:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-25 18:14 [PATCH net] selftests: drv-net: Check if combined-count exists Joe Damato
2025-02-25 19:24 ` Gerhard Engleder
2025-02-25 23:11 ` David Wei
2025-02-25 23:55   ` Joe Damato [this message]

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=Z75YWvDcvzsMlVHK@LQ3V64L9R2 \
    --to=jdamato@fastly.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dw@davidwei.uk \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox