Message ID | 20240611033203.54845-1-kerneljasonxing@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next,v2] net: dqs: introduce IFF_NO_BQL private flag for non-BQL drivers | expand |
On Tue, 11 Jun 2024 11:32:03 +0800 Jason Xing wrote: > +++ b/include/linux/netdevice.h > @@ -1649,6 +1649,9 @@ struct net_device_ops { > * @IFF_SEE_ALL_HWTSTAMP_REQUESTS: device wants to see calls to > * ndo_hwtstamp_set() for all timestamp requests regardless of source, > * even if those aren't HWTSTAMP_SOURCE_NETDEV. > + * @IFF_NO_BQL: driver doesn't use BQL for flow control for now. It's used > + * to check if we should create byte_queue_limits directory in dqs > + * (see netdev_uses_bql()) Sorry for nit but since it's netdevice.h.. can we rephrase the comment a bit? How about just: + * @IFF_NO_BQL: driver doesn't support BQL, don't create "byte_queue_limits" + * directories in sysfs.
On Thu, Jun 13, 2024 at 5:40 AM Jakub Kicinski <kuba@kernel.org> wrote: > > On Tue, 11 Jun 2024 11:32:03 +0800 Jason Xing wrote: > > +++ b/include/linux/netdevice.h > > @@ -1649,6 +1649,9 @@ struct net_device_ops { > > * @IFF_SEE_ALL_HWTSTAMP_REQUESTS: device wants to see calls to > > * ndo_hwtstamp_set() for all timestamp requests regardless of source, > > * even if those aren't HWTSTAMP_SOURCE_NETDEV. > > + * @IFF_NO_BQL: driver doesn't use BQL for flow control for now. It's used > > + * to check if we should create byte_queue_limits directory in dqs > > + * (see netdev_uses_bql()) > > Sorry for nit but since it's netdevice.h.. can we rephrase the comment > a bit? How about just: > > + * @IFF_NO_BQL: driver doesn't support BQL, don't create "byte_queue_limits" > + * directories in sysfs. No problem. I will revise it as you said. Thanks.
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 61a57d134544..728f4b9844cc 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -5631,7 +5631,7 @@ static int virtnet_probe(struct virtio_device *vdev) /* Set up network device as normal. */ dev->priv_flags |= IFF_UNICAST_FLT | IFF_LIVE_ADDR_CHANGE | - IFF_TX_SKB_NO_LINEAR; + IFF_TX_SKB_NO_LINEAR | IFF_NO_BQL; dev->netdev_ops = &virtnet_netdev; dev->stat_ops = &virtnet_stat_ops; dev->features = NETIF_F_HIGHDMA; diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index d20c6c99eb88..6d379858d11f 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -1649,6 +1649,9 @@ struct net_device_ops { * @IFF_SEE_ALL_HWTSTAMP_REQUESTS: device wants to see calls to * ndo_hwtstamp_set() for all timestamp requests regardless of source, * even if those aren't HWTSTAMP_SOURCE_NETDEV. + * @IFF_NO_BQL: driver doesn't use BQL for flow control for now. It's used + * to check if we should create byte_queue_limits directory in dqs + * (see netdev_uses_bql()) */ enum netdev_priv_flags { IFF_802_1Q_VLAN = 1<<0, @@ -1685,6 +1688,7 @@ enum netdev_priv_flags { IFF_TX_SKB_NO_LINEAR = BIT_ULL(31), IFF_CHANGE_PROTO_DOWN = BIT_ULL(32), IFF_SEE_ALL_HWTSTAMP_REQUESTS = BIT_ULL(33), + IFF_NO_BQL = BIT_ULL(34), }; #define IFF_802_1Q_VLAN IFF_802_1Q_VLAN diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 4c27a360c294..7d99fbbad6af 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c @@ -1765,7 +1765,7 @@ static const struct kobj_type netdev_queue_ktype = { static bool netdev_uses_bql(const struct net_device *dev) { if (dev->features & NETIF_F_LLTX || - dev->priv_flags & IFF_NO_QUEUE) + dev->priv_flags & (IFF_NO_QUEUE | IFF_NO_BQL)) return false; return IS_ENABLED(CONFIG_BQL);