Message ID | 20170506160734.47084-4-dsahern@gmail.com |
---|---|
State | RFC, archived |
Delegated to: | David Miller |
Headers | show |
> +static inline bool netif_is_lwd(struct net_device *dev) > +{ > + return !!(dev->priv_flags & IFF_LWT_NETDEV); > +} Am I the only one who thinks that this "LWT_NETDEV" vs "LWD" is a bit confusing? Is "netif_is_lwt_netdev()" really too long? johannes
From: Johannes Berg <johannes@sipsolutions.net> Date: Mon, 08 May 2017 10:55:12 +0200 > >> +static inline bool netif_is_lwd(struct net_device *dev) >> +{ >> + return !!(dev->priv_flags & IFF_LWT_NETDEV); >> +} > > Am I the only one who thinks that this "LWT_NETDEV" vs "LWD" is a bit > confusing? Agreed, my old eyes can't discern them at a distance :-)
On Mon, May 8, 2017 at 1:11 PM, David Miller <davem@davemloft.net> wrote: > From: Johannes Berg <johannes@sipsolutions.net> > Date: Mon, 08 May 2017 10:55:12 +0200 > >> >>> +static inline bool netif_is_lwd(struct net_device *dev) >>> +{ >>> + return !!(dev->priv_flags & IFF_LWT_NETDEV); >>> +} >> >> Am I the only one who thinks that this "LWT_NETDEV" vs "LWD" is a bit >> confusing? > > Agreed, my old eyes can't discern them at a distance :-) agree. mix of LWT_NETDEV and LWD can get confusing. LWT already stands for Light Weight Tunnel..., this can only be LWD or LWN ;)....if people don't confuse it with some weekly news device :)
On 5/8/17 1:11 PM, David Miller wrote: > From: Johannes Berg <johannes@sipsolutions.net> > Date: Mon, 08 May 2017 10:55:12 +0200 > >> >>> +static inline bool netif_is_lwd(struct net_device *dev) >>> +{ >>> + return !!(dev->priv_flags & IFF_LWT_NETDEV); >>> +} >> >> Am I the only one who thinks that this "LWT_NETDEV" vs "LWD" is a bit >> confusing? > > Agreed, my old eyes can't discern them at a distance :-) > perhaps it is the tiny font your old eyes are having trouble with :-) I am fine with Johannes' suggestion -- just spell it out: netif_is_lwt_netdev where lwt = LightWeighT
On Mon, May 8, 2017 at 5:57 PM, David Ahern <dsahern@gmail.com> wrote: > On 5/8/17 1:11 PM, David Miller wrote: >> From: Johannes Berg <johannes@sipsolutions.net> >> Date: Mon, 08 May 2017 10:55:12 +0200 >> >>> >>>> +static inline bool netif_is_lwd(struct net_device *dev) >>>> +{ >>>> + return !!(dev->priv_flags & IFF_LWT_NETDEV); >>>> +} >>> >>> Am I the only one who thinks that this "LWT_NETDEV" vs "LWD" is a bit >>> confusing? >> >> Agreed, my old eyes can't discern them at a distance :-) >> > > perhaps it is the tiny font your old eyes are having trouble with :-) > > I am fine with Johannes' suggestion -- just spell it out: > netif_is_lwt_netdev > > where lwt = LightWeighT makes sense...but this does sound like a 'light weight tunnel netdevice' though.....just cause 'LWT' already expands to 'light weight tunnel'
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index f47c8712398a..08151fd34973 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -1401,6 +1401,7 @@ enum netdev_priv_flags { IFF_RXFH_CONFIGURED = 1<<25, IFF_PHONY_HEADROOM = 1<<26, IFF_MACSEC = 1<<27, + IFF_LWT_NETDEV = 1<<28, }; #define IFF_802_1Q_VLAN IFF_802_1Q_VLAN @@ -1430,6 +1431,7 @@ enum netdev_priv_flags { #define IFF_TEAM IFF_TEAM #define IFF_RXFH_CONFIGURED IFF_RXFH_CONFIGURED #define IFF_MACSEC IFF_MACSEC +#define IFF_LWT_NETDEV IFF_LWT_NETDEV /** * struct net_device - The DEVICE structure. @@ -4137,6 +4139,11 @@ static inline void skb_gso_error_unwind(struct sk_buff *skb, __be16 protocol, skb->mac_len = mac_len; } +static inline bool netif_is_lwd(struct net_device *dev) +{ + return !!(dev->priv_flags & IFF_LWT_NETDEV); +} + static inline bool netif_is_macsec(const struct net_device *dev) { return dev->priv_flags & IFF_MACSEC;
Add new flag to denote lightweight netdevices. Add helper to identify such devices. Signed-off-by: David Ahern <dsahern@gmail.com> --- include/linux/netdevice.h | 7 +++++++ 1 file changed, 7 insertions(+)