b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Sabrina Dubroca <sd@queasysnail.net>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: netdev@vger.kernel.org,
	Nicolas Dichtel <nicolas.dichtel@6wind.com>,
	Marek Lindner <mareklindner@neomailbox.ch>,
	Simon Wunderlich <sw@simonwunderlich.de>,
	Antonio Quartulli <a@unstable.cc>,
	Sven Eckelmann <sven@narfation.org>,
	b.a.t.m.a.n@lists.open-mesh.org, Roopa Prabhu <roopa@nvidia.com>,
	Nikolay Aleksandrov <nikolay@nvidia.com>
Subject: Re: [PATCH net 00/12] net: iflink and link-netnsid fixes
Date: Fri, 2 Oct 2020 11:07:03 +0200	[thread overview]
Message-ID: <20201002090703.GD3565727@bistromath.localdomain> (raw)
In-Reply-To: <20201001142538.03f28397@hermes.local>

2020-10-01, 14:25:38 -0700, Stephen Hemminger wrote:
> On Thu,  1 Oct 2020 09:59:24 +0200
> Sabrina Dubroca <sd@queasysnail.net> wrote:
> 
> > In a lot of places, we use this kind of comparison to detect if a
> > device has a lower link:
> > 
> >   dev->ifindex != dev_get_iflink(dev)
> 
> 
> Since this is a common operation, it would be good to add a new
> helper function in netdevice.h
> 
> In your patch set, you are copying the same code snippet which
> seems to indicate that it should be a helper.
> 
> Something like:
> 
> static inline bool netdev_has_link(const struct net_device *dev)
> {
> 	const struct net_device_ops *ops = dev->netdev_ops;
> 
> 	return ops && ops->ndo_get_iflink;
> }

Good idea, I'll add that in v2.

-- 
Sabrina


      reply	other threads:[~2020-10-02  9:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-01  7:59 [PATCH net 00/12] net: iflink and link-netnsid fixes Sabrina Dubroca
2020-10-01  7:59 ` [PATCH net 11/12] batman-adv: fix iflink detection in batadv_is_on_batman_iface Sabrina Dubroca
2022-05-14 10:21   ` Sven Eckelmann
2020-10-01  7:59 ` [PATCH net 12/12] batman-adv: fix detection of lower link in batadv_get_real_netdevice Sabrina Dubroca
2020-10-01 21:25 ` [PATCH net 00/12] net: iflink and link-netnsid fixes Stephen Hemminger
2020-10-02  9:07   ` Sabrina Dubroca [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=20201002090703.GD3565727@bistromath.localdomain \
    --to=sd@queasysnail.net \
    --cc=a@unstable.cc \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=mareklindner@neomailbox.ch \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=nikolay@nvidia.com \
    --cc=roopa@nvidia.com \
    --cc=stephen@networkplumber.org \
    --cc=sven@narfation.org \
    --cc=sw@simonwunderlich.de \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).