Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ethtool: update mapping of features to legacy ioctl requests

Legacy ioctl request like ETHTOOL_GTXCSUM are still used by ethtool utility
to get values of legacy flags (which rather work as feature groups). These
are calculated from values of actual features and request to set them is
implemented as an attempt to set all features mapping to them but there are
two inconsistencies:

- tx-checksum-fcoe-crc is shown under tx-checksumming but NETIF_F_FCOE_CRC
is not included in ETHTOOL_GTXCSUM/ETHTOOL_STXCSUM
- tx-scatter-gather-fraglist is shown under scatter-gather but
NETIF_F_FRAGLIST is not included in ETHTOOL_GSG/ETHTOOL_SSG

As the mapping in ethtool output is more correct from logical point of
view, fix ethtool_get_feature_mask() to match it.

Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Michal Kubecek and committed by
David S. Miller
f70bb065 98130546

+3 -2
+3 -2
net/ethtool/ioctl.c
··· 198 198 switch (eth_cmd) { 199 199 case ETHTOOL_GTXCSUM: 200 200 case ETHTOOL_STXCSUM: 201 - return NETIF_F_CSUM_MASK | NETIF_F_SCTP_CRC; 201 + return NETIF_F_CSUM_MASK | NETIF_F_FCOE_CRC_BIT | 202 + NETIF_F_SCTP_CRC; 202 203 case ETHTOOL_GRXCSUM: 203 204 case ETHTOOL_SRXCSUM: 204 205 return NETIF_F_RXCSUM; 205 206 case ETHTOOL_GSG: 206 207 case ETHTOOL_SSG: 207 - return NETIF_F_SG; 208 + return NETIF_F_SG | NETIF_F_FRAGLIST; 208 209 case ETHTOOL_GTSO: 209 210 case ETHTOOL_STSO: 210 211 return NETIF_F_ALL_TSO;