netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] ethtool: fix incorrect tx-checksumming settings reporting
@ 2020-03-24 11:57 Vladyslav Tarasiuk
  2020-03-24 13:34 ` Michal Kubecek
  2020-03-24 23:25 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Vladyslav Tarasiuk @ 2020-03-24 11:57 UTC (permalink / raw)
  To: davem, netdev; +Cc: maximmi, mkubecek, moshe, Vladyslav Tarasiuk

Currently, ethtool feature mask for checksum command is ORed with
NETIF_F_FCOE_CRC_BIT, which is bit's position number, instead of the
actual feature bit - NETIF_F_FCOE_CRC.

The invalid bitmask here might affect unrelated features when toggling
TX checksumming. For example, TX checksumming is always mistakenly
reported as enabled on the netdevs tested (mlx5, virtio_net).

Fixes: f70bb06563ed ("ethtool: update mapping of features to legacy ioctl requests")
Signed-off-by: Vladyslav Tarasiuk <vladyslavt@mellanox.com>
---
 net/ethtool/ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
index 3852a58d7f95..10d929abdf6a 100644
--- a/net/ethtool/ioctl.c
+++ b/net/ethtool/ioctl.c
@@ -196,7 +196,7 @@ static netdev_features_t ethtool_get_feature_mask(u32 eth_cmd)
 	switch (eth_cmd) {
 	case ETHTOOL_GTXCSUM:
 	case ETHTOOL_STXCSUM:
-		return NETIF_F_CSUM_MASK | NETIF_F_FCOE_CRC_BIT |
+		return NETIF_F_CSUM_MASK | NETIF_F_FCOE_CRC |
 		       NETIF_F_SCTP_CRC;
 	case ETHTOOL_GRXCSUM:
 	case ETHTOOL_SRXCSUM:
-- 
2.17.1


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

* Re: [PATCH net-next] ethtool: fix incorrect tx-checksumming settings reporting
  2020-03-24 11:57 [PATCH net-next] ethtool: fix incorrect tx-checksumming settings reporting Vladyslav Tarasiuk
@ 2020-03-24 13:34 ` Michal Kubecek
  2020-03-24 23:25 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Kubecek @ 2020-03-24 13:34 UTC (permalink / raw)
  To: netdev; +Cc: Vladyslav Tarasiuk, davem, maximmi, moshe

On Tue, Mar 24, 2020 at 01:57:08PM +0200, Vladyslav Tarasiuk wrote:
> Currently, ethtool feature mask for checksum command is ORed with
> NETIF_F_FCOE_CRC_BIT, which is bit's position number, instead of the
> actual feature bit - NETIF_F_FCOE_CRC.
> 
> The invalid bitmask here might affect unrelated features when toggling
> TX checksumming. For example, TX checksumming is always mistakenly
> reported as enabled on the netdevs tested (mlx5, virtio_net).
> 
> Fixes: f70bb06563ed ("ethtool: update mapping of features to legacy ioctl requests")
> Signed-off-by: Vladyslav Tarasiuk <vladyslavt@mellanox.com>
> ---

Stupid mistake... sorry for that. I even realized now how I managed to
miss it when I tested the patch: out of habit, I ran patched ethtool
which used netlink so that it did not call this function at all and
showed expected results. :-(

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

>  net/ethtool/ioctl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
> index 3852a58d7f95..10d929abdf6a 100644
> --- a/net/ethtool/ioctl.c
> +++ b/net/ethtool/ioctl.c
> @@ -196,7 +196,7 @@ static netdev_features_t ethtool_get_feature_mask(u32 eth_cmd)
>  	switch (eth_cmd) {
>  	case ETHTOOL_GTXCSUM:
>  	case ETHTOOL_STXCSUM:
> -		return NETIF_F_CSUM_MASK | NETIF_F_FCOE_CRC_BIT |
> +		return NETIF_F_CSUM_MASK | NETIF_F_FCOE_CRC |
>  		       NETIF_F_SCTP_CRC;
>  	case ETHTOOL_GRXCSUM:
>  	case ETHTOOL_SRXCSUM:
> -- 
> 2.17.1
> 

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

* Re: [PATCH net-next] ethtool: fix incorrect tx-checksumming settings reporting
  2020-03-24 11:57 [PATCH net-next] ethtool: fix incorrect tx-checksumming settings reporting Vladyslav Tarasiuk
  2020-03-24 13:34 ` Michal Kubecek
@ 2020-03-24 23:25 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2020-03-24 23:25 UTC (permalink / raw)
  To: vladyslavt; +Cc: netdev, maximmi, mkubecek, moshe

From: Vladyslav Tarasiuk <vladyslavt@mellanox.com>
Date: Tue, 24 Mar 2020 13:57:08 +0200

> Currently, ethtool feature mask for checksum command is ORed with
> NETIF_F_FCOE_CRC_BIT, which is bit's position number, instead of the
> actual feature bit - NETIF_F_FCOE_CRC.
> 
> The invalid bitmask here might affect unrelated features when toggling
> TX checksumming. For example, TX checksumming is always mistakenly
> reported as enabled on the netdevs tested (mlx5, virtio_net).
> 
> Fixes: f70bb06563ed ("ethtool: update mapping of features to legacy ioctl requests")
> Signed-off-by: Vladyslav Tarasiuk <vladyslavt@mellanox.com>

Applied, thanks.

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

end of thread, other threads:[~2020-03-24 23:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-24 11:57 [PATCH net-next] ethtool: fix incorrect tx-checksumming settings reporting Vladyslav Tarasiuk
2020-03-24 13:34 ` Michal Kubecek
2020-03-24 23:25 ` David Miller

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 NNTP newsgroup(s).