[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAF=yD-L3J6_9fEQv_icyvK6veZkWGXiAf2W6Fi+MODWWW5O_xw@mail.gmail.com>
Date: Thu, 13 Sep 2018 11:00:38 -0400
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: me@...in.cc
Cc: Network Development <netdev@...r.kernel.org>,
Jason Wang <jasowang@...hat.com>,
"Michael S. Tsirkin" <mst@...hat.com>, f.fainelli@...il.com,
Willem de Bruijn <willemb@...gle.com>
Subject: Re: [PATCH net-next RFC] virtio_net: ethtool tx napi configuration
> > +static u32 virtnet_get_priv_flags(struct net_device *dev)
> > +{
> > + struct virtnet_info *vi = netdev_priv(dev);
> > + int priv_flags = 0;
> > +
> > + if (vi->sq[0].napi.weight)
> > + priv_flags |= 0x1;
> > +
> > + return priv_flags;
> > +}
>
> Why the use of priv_flags here? Is there some reason that we don't want
> to use the more simple
>
> static u32 virtnet_get_priv_flags(struct net_device *dev)
> {
> struct virtnet_info *vi = netdev_priv(dev);
>
> if (vi->sq[0].napi.weight)
> return 1;
>
> return 0;
> }
Sure, that's fine, too.
I just wanted to make it explicit that this is one of possibly many
private flags,
and only acts on bit 0. If another private flag is added, the existing
code needs
little change, just add a branch on another bit. But either way works.
Powered by blists - more mailing lists