All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH resend net] net: ethtool: add missing NETIF_F_GSO_FRAGLIST feature string
@ 2020-06-17 20:42 Alexander Lobakin
  2020-06-17 21:18 ` Michal Kubecek
  2020-06-19  3:37 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Alexander Lobakin @ 2020-06-17 20:42 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski
  Cc: Michal Kubecek, Andrew Lunn, Florian Fainelli, Richard Cochran,
	Alexander Lobakin, Antoine Tenart, Aya Levin, Steffen Klassert,
	Willem de Bruijn, netdev, linux-kernel

Commit 3b33583265ed ("net: Add fraglist GRO/GSO feature flags") missed
an entry for NETIF_F_GSO_FRAGLIST in netdev_features_strings array. As
a result, fraglist GSO feature is not shown in 'ethtool -k' output and
can't be toggled on/off.
The fix is trivial.

Fixes: 3b33583265ed ("net: Add fraglist GRO/GSO feature flags")
Signed-off-by: Alexander Lobakin <alobakin@pm.me>
---
 net/ethtool/common.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ethtool/common.c b/net/ethtool/common.c
index 423e640e3876..47f63526818e 100644
--- a/net/ethtool/common.c
+++ b/net/ethtool/common.c
@@ -43,6 +43,7 @@ const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN] = {
 	[NETIF_F_GSO_SCTP_BIT] =	 "tx-sctp-segmentation",
 	[NETIF_F_GSO_ESP_BIT] =		 "tx-esp-segmentation",
 	[NETIF_F_GSO_UDP_L4_BIT] =	 "tx-udp-segmentation",
+	[NETIF_F_GSO_FRAGLIST_BIT] =	 "tx-gso-list",
 
 	[NETIF_F_FCOE_CRC_BIT] =         "tx-checksum-fcoe-crc",
 	[NETIF_F_SCTP_CRC_BIT] =        "tx-checksum-sctp",
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH resend net] net: ethtool: add missing NETIF_F_GSO_FRAGLIST feature string
  2020-06-17 20:42 [PATCH resend net] net: ethtool: add missing NETIF_F_GSO_FRAGLIST feature string Alexander Lobakin
@ 2020-06-17 21:18 ` Michal Kubecek
  2020-06-17 21:38   ` Alexander Lobakin
  2020-06-19  3:37 ` David Miller
  1 sibling, 1 reply; 5+ messages in thread
From: Michal Kubecek @ 2020-06-17 21:18 UTC (permalink / raw)
  To: Alexander Lobakin
  Cc: David S. Miller, Jakub Kicinski, Andrew Lunn, Florian Fainelli,
	Richard Cochran, Antoine Tenart, Aya Levin, Steffen Klassert,
	Willem de Bruijn, netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1358 bytes --]

On Wed, Jun 17, 2020 at 08:42:47PM +0000, Alexander Lobakin wrote:
> Commit 3b33583265ed ("net: Add fraglist GRO/GSO feature flags") missed
> an entry for NETIF_F_GSO_FRAGLIST in netdev_features_strings array. As
> a result, fraglist GSO feature is not shown in 'ethtool -k' output and
> can't be toggled on/off.
> The fix is trivial.
> 
> Fixes: 3b33583265ed ("net: Add fraglist GRO/GSO feature flags")
> Signed-off-by: Alexander Lobakin <alobakin@pm.me>
> ---
>  net/ethtool/common.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/net/ethtool/common.c b/net/ethtool/common.c
> index 423e640e3876..47f63526818e 100644
> --- a/net/ethtool/common.c
> +++ b/net/ethtool/common.c
> @@ -43,6 +43,7 @@ const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN] = {
>  	[NETIF_F_GSO_SCTP_BIT] =	 "tx-sctp-segmentation",
>  	[NETIF_F_GSO_ESP_BIT] =		 "tx-esp-segmentation",
>  	[NETIF_F_GSO_UDP_L4_BIT] =	 "tx-udp-segmentation",
> +	[NETIF_F_GSO_FRAGLIST_BIT] =	 "tx-gso-list",
>  
>  	[NETIF_F_FCOE_CRC_BIT] =         "tx-checksum-fcoe-crc",
>  	[NETIF_F_SCTP_CRC_BIT] =        "tx-checksum-sctp",

Reviewed-by: Michal Kubecek <mkubecek@suse.cz>

AFAICS the name for NETIF_F_GSO_TUNNEL_REMCSUM_BIT is also missing but
IMHO it will be better to fix that by a separate patch with its own
Fixes tag.

Michal

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH resend net] net: ethtool: add missing NETIF_F_GSO_FRAGLIST feature string
  2020-06-17 21:18 ` Michal Kubecek
@ 2020-06-17 21:38   ` Alexander Lobakin
  2020-06-17 21:54     ` Michal Kubecek
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Lobakin @ 2020-06-17 21:38 UTC (permalink / raw)
  To: Michal Kubecek
  Cc: David S. Miller, Jakub Kicinski, Andrew Lunn, Florian Fainelli,
	Richard Cochran, Antoine Tenart, Aya Levin, Steffen Klassert,
	Willem de Bruijn, netdev, linux-kernel

Hi Michal,

On Thursday, 18 June 2020, 0:18, Michal Kubecek <mkubecek@suse.cz> wrote:

> On Wed, Jun 17, 2020 at 08:42:47PM +0000, Alexander Lobakin wrote:
>
> > Commit 3b33583265ed ("net: Add fraglist GRO/GSO feature flags") missed
> > an entry for NETIF_F_GSO_FRAGLIST in netdev_features_strings array. As
> > a result, fraglist GSO feature is not shown in 'ethtool -k' output and
> > can't be toggled on/off.
> > The fix is trivial.
> >
> > Fixes: 3b33583265ed ("net: Add fraglist GRO/GSO feature flags")
> > Signed-off-by: Alexander Lobakin alobakin@pm.me
> >
> > ----------------------------------------------------------------------------------------------------------------
> >
> > net/ethtool/common.c | 1 +
> > 1 file changed, 1 insertion(+)
> > diff --git a/net/ethtool/common.c b/net/ethtool/common.c
> > index 423e640e3876..47f63526818e 100644
> > --- a/net/ethtool/common.c
> > +++ b/net/ethtool/common.c
> > @@ -43,6 +43,7 @@ const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN] = {
> > [NETIF_F_GSO_SCTP_BIT] = "tx-sctp-segmentation",
> > [NETIF_F_GSO_ESP_BIT] = "tx-esp-segmentation",
> > [NETIF_F_GSO_UDP_L4_BIT] = "tx-udp-segmentation",
> >
> > -   [NETIF_F_GSO_FRAGLIST_BIT] = "tx-gso-list",
> >     [NETIF_F_FCOE_CRC_BIT] = "tx-checksum-fcoe-crc",
> >     [NETIF_F_SCTP_CRC_BIT] = "tx-checksum-sctp",
> >
>
> Reviewed-by: Michal Kubecekmkubecek@suse.cz

Thanks!

> AFAICS the name for NETIF_F_GSO_TUNNEL_REMCSUM_BIT is also missing but
> IMHO it will be better to fix that by a separate patch with its own
> Fixes tag.

Oh, nice catch! I'll make a separate for this one.
I also wanted to add any sort of static_assert() / BUILD_BUG_ON() to
prevent such misses, but don't see any easy pattern to check for now,
as netdev_features_strings[] is always NETDEV_FEATURE_COUNT-sized.

> Michal

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH resend net] net: ethtool: add missing NETIF_F_GSO_FRAGLIST feature string
  2020-06-17 21:38   ` Alexander Lobakin
@ 2020-06-17 21:54     ` Michal Kubecek
  0 siblings, 0 replies; 5+ messages in thread
From: Michal Kubecek @ 2020-06-17 21:54 UTC (permalink / raw)
  To: Alexander Lobakin
  Cc: David S. Miller, Jakub Kicinski, Andrew Lunn, Florian Fainelli,
	Richard Cochran, Antoine Tenart, Aya Levin, Steffen Klassert,
	Willem de Bruijn, netdev, linux-kernel

On Wed, Jun 17, 2020 at 09:38:47PM +0000, Alexander Lobakin wrote:
> Hi Michal,
> 
> On Thursday, 18 June 2020, 0:18, Michal Kubecek <mkubecek@suse.cz> wrote:
> 
> > On Wed, Jun 17, 2020 at 08:42:47PM +0000, Alexander Lobakin wrote:
> >
> > > Commit 3b33583265ed ("net: Add fraglist GRO/GSO feature flags") missed
> > > an entry for NETIF_F_GSO_FRAGLIST in netdev_features_strings array. As
> > > a result, fraglist GSO feature is not shown in 'ethtool -k' output and
> > > can't be toggled on/off.
> > > The fix is trivial.
> > >
> > > Fixes: 3b33583265ed ("net: Add fraglist GRO/GSO feature flags")
> > > Signed-off-by: Alexander Lobakin alobakin@pm.me
> > >
> > > ----------------------------------------------------------------------------------------------------------------
> > >
> > > net/ethtool/common.c | 1 +
> > > 1 file changed, 1 insertion(+)
> > > diff --git a/net/ethtool/common.c b/net/ethtool/common.c
> > > index 423e640e3876..47f63526818e 100644
> > > --- a/net/ethtool/common.c
> > > +++ b/net/ethtool/common.c
> > > @@ -43,6 +43,7 @@ const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN] = {
> > > [NETIF_F_GSO_SCTP_BIT] = "tx-sctp-segmentation",
> > > [NETIF_F_GSO_ESP_BIT] = "tx-esp-segmentation",
> > > [NETIF_F_GSO_UDP_L4_BIT] = "tx-udp-segmentation",
> > >
> > > -   [NETIF_F_GSO_FRAGLIST_BIT] = "tx-gso-list",
> > >     [NETIF_F_FCOE_CRC_BIT] = "tx-checksum-fcoe-crc",
> > >     [NETIF_F_SCTP_CRC_BIT] = "tx-checksum-sctp",
> > >
> >
> > Reviewed-by: Michal Kubecekmkubecek@suse.cz
> 
> Thanks!
> 
> > AFAICS the name for NETIF_F_GSO_TUNNEL_REMCSUM_BIT is also missing but
> > IMHO it will be better to fix that by a separate patch with its own
> > Fixes tag.
> 
> Oh, nice catch! I'll make a separate for this one.
> I also wanted to add any sort of static_assert() / BUILD_BUG_ON() to
> prevent such misses, but don't see any easy pattern to check for now,
> as netdev_features_strings[] is always NETDEV_FEATURE_COUNT-sized.

The key problem is that unlike e.g. link modes, new netdev features are
not always added at the end. So even if we changed
netdev_features_strings[] array to have size determined automatically
from initializers, adding new netdev feature somewhere in the middle
(e.g. GSO one) without updating netdev_features_strings[] would not be
caught as simple array size check would not notice the hole (actually,
there are also two intended holes in the array).

Michal

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH resend net] net: ethtool: add missing NETIF_F_GSO_FRAGLIST feature string
  2020-06-17 20:42 [PATCH resend net] net: ethtool: add missing NETIF_F_GSO_FRAGLIST feature string Alexander Lobakin
  2020-06-17 21:18 ` Michal Kubecek
@ 2020-06-19  3:37 ` David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2020-06-19  3:37 UTC (permalink / raw)
  To: alobakin
  Cc: kuba, mkubecek, andrew, f.fainelli, richardcochran,
	antoine.tenart, ayal, steffen.klassert, willemb, netdev,
	linux-kernel

From: Alexander Lobakin <alobakin@pm.me>
Date: Wed, 17 Jun 2020 20:42:47 +0000

> Commit 3b33583265ed ("net: Add fraglist GRO/GSO feature flags") missed
> an entry for NETIF_F_GSO_FRAGLIST in netdev_features_strings array. As
> a result, fraglist GSO feature is not shown in 'ethtool -k' output and
> can't be toggled on/off.
> The fix is trivial.
> 
> Fixes: 3b33583265ed ("net: Add fraglist GRO/GSO feature flags")
> Signed-off-by: Alexander Lobakin <alobakin@pm.me>

Applied and queued up for v5.6 -stable, thank you.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-06-19  3:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-17 20:42 [PATCH resend net] net: ethtool: add missing NETIF_F_GSO_FRAGLIST feature string Alexander Lobakin
2020-06-17 21:18 ` Michal Kubecek
2020-06-17 21:38   ` Alexander Lobakin
2020-06-17 21:54     ` Michal Kubecek
2020-06-19  3:37 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.