mirror of https://gitee.com/openkylin/linux.git
Merge branch 'ethtool-netlink-interface-preliminary-part'
Michal Kubecek says: ==================== ethtool netlink interface, preliminary part As Jakub Kicinski suggested in ethtool netlink v7 discussion, this submission consists only of preliminary patches which raised no objections; first four patches already have Acked-by or Reviewed-by. - patch 1 exposes permanent hardware address (as shown by "ethtool -P") via rtnetlink - patch 2 is renames existing netlink helper to a better name - patch 3 and 4 reorganize existing ethtool code (no functional change) - patch 5 makes the table of link mode names available as an ethtool string set (will be needed for the netlink interface) Once we get these out of the way, v8 of the first part of the ethtool netlink interface will follow. Changes from v2 to v3: fix SPDX licence identifiers (patch 3 and 5). Changes from v1 to v2: restore build time check that all link modes have assigned a name (patch 5). ==================== Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
aabf23d183
|
@ -1735,7 +1735,7 @@ static inline void nla_nest_cancel(struct sk_buff *skb, struct nlattr *start)
|
|||
}
|
||||
|
||||
/**
|
||||
* nla_validate_nested - Validate a stream of nested attributes
|
||||
* __nla_validate_nested - Validate a stream of nested attributes
|
||||
* @start: container attribute
|
||||
* @maxtype: maximum attribute type to be expected
|
||||
* @policy: validation policy
|
||||
|
@ -1758,9 +1758,9 @@ static inline int __nla_validate_nested(const struct nlattr *start, int maxtype,
|
|||
}
|
||||
|
||||
static inline int
|
||||
nl80211_validate_nested(const struct nlattr *start, int maxtype,
|
||||
const struct nla_policy *policy,
|
||||
struct netlink_ext_ack *extack)
|
||||
nla_validate_nested(const struct nlattr *start, int maxtype,
|
||||
const struct nla_policy *policy,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
return __nla_validate_nested(start, maxtype, policy,
|
||||
NL_VALIDATE_STRICT, extack);
|
||||
|
|
|
@ -593,6 +593,7 @@ struct ethtool_pauseparam {
|
|||
* @ETH_SS_RSS_HASH_FUNCS: RSS hush function names
|
||||
* @ETH_SS_PHY_STATS: Statistic names, for use with %ETHTOOL_GPHYSTATS
|
||||
* @ETH_SS_PHY_TUNABLES: PHY tunable names
|
||||
* @ETH_SS_LINK_MODES: link mode names
|
||||
*/
|
||||
enum ethtool_stringset {
|
||||
ETH_SS_TEST = 0,
|
||||
|
@ -604,6 +605,7 @@ enum ethtool_stringset {
|
|||
ETH_SS_TUNABLES,
|
||||
ETH_SS_PHY_STATS,
|
||||
ETH_SS_PHY_TUNABLES,
|
||||
ETH_SS_LINK_MODES,
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -169,6 +169,7 @@ enum {
|
|||
IFLA_MAX_MTU,
|
||||
IFLA_PROP_LIST,
|
||||
IFLA_ALT_IFNAME, /* Alternative ifname */
|
||||
IFLA_PERM_ADDRESS,
|
||||
__IFLA_MAX
|
||||
};
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ obj-$(CONFIG_NET) += $(tmp-y)
|
|||
|
||||
# LLC has to be linked before the files in net/802/
|
||||
obj-$(CONFIG_LLC) += llc/
|
||||
obj-$(CONFIG_NET) += ethernet/ 802/ sched/ netlink/ bpf/
|
||||
obj-$(CONFIG_NET) += ethernet/ 802/ sched/ netlink/ bpf/ ethtool/
|
||||
obj-$(CONFIG_NETFILTER) += netfilter/
|
||||
obj-$(CONFIG_INET) += ipv4/
|
||||
obj-$(CONFIG_TLS) += tls/
|
||||
|
|
|
@ -8,7 +8,7 @@ obj-y := sock.o request_sock.o skbuff.o datagram.o stream.o scm.o \
|
|||
|
||||
obj-$(CONFIG_SYSCTL) += sysctl_net_core.o
|
||||
|
||||
obj-y += dev.o ethtool.o dev_addr_lists.o dst.o netevent.o \
|
||||
obj-y += dev.o dev_addr_lists.o dst.o netevent.o \
|
||||
neighbour.o rtnetlink.o utils.o link_watch.o filter.o \
|
||||
sock_diag.o dev_ioctl.o tso.o sock_reuseport.o \
|
||||
fib_notifier.o xdp.o flow_offload.o
|
||||
|
|
|
@ -1041,6 +1041,7 @@ static noinline size_t if_nlmsg_size(const struct net_device *dev,
|
|||
+ nla_total_size(4) /* IFLA_MIN_MTU */
|
||||
+ nla_total_size(4) /* IFLA_MAX_MTU */
|
||||
+ rtnl_prop_list_size(dev)
|
||||
+ nla_total_size(MAX_ADDR_LEN) /* IFLA_PERM_ADDRESS */
|
||||
+ 0;
|
||||
}
|
||||
|
||||
|
@ -1757,6 +1758,9 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb,
|
|||
nla_put_s32(skb, IFLA_NEW_IFINDEX, new_ifindex) < 0)
|
||||
goto nla_put_failure;
|
||||
|
||||
if (memchr_inv(dev->perm_addr, '\0', dev->addr_len) &&
|
||||
nla_put(skb, IFLA_PERM_ADDRESS, dev->addr_len, dev->perm_addr))
|
||||
goto nla_put_failure;
|
||||
|
||||
rcu_read_lock();
|
||||
if (rtnl_fill_link_af(skb, dev, ext_filter_mask))
|
||||
|
@ -1822,6 +1826,7 @@ static const struct nla_policy ifla_policy[IFLA_MAX+1] = {
|
|||
[IFLA_PROP_LIST] = { .type = NLA_NESTED },
|
||||
[IFLA_ALT_IFNAME] = { .type = NLA_STRING,
|
||||
.len = ALTIFNAMSIZ - 1 },
|
||||
[IFLA_PERM_ADDRESS] = { .type = NLA_REJECT },
|
||||
};
|
||||
|
||||
static const struct nla_policy ifla_info_policy[IFLA_INFO_MAX+1] = {
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
obj-y += ioctl.o common.o
|
|
@ -0,0 +1,171 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
#include "common.h"
|
||||
|
||||
const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN] = {
|
||||
[NETIF_F_SG_BIT] = "tx-scatter-gather",
|
||||
[NETIF_F_IP_CSUM_BIT] = "tx-checksum-ipv4",
|
||||
[NETIF_F_HW_CSUM_BIT] = "tx-checksum-ip-generic",
|
||||
[NETIF_F_IPV6_CSUM_BIT] = "tx-checksum-ipv6",
|
||||
[NETIF_F_HIGHDMA_BIT] = "highdma",
|
||||
[NETIF_F_FRAGLIST_BIT] = "tx-scatter-gather-fraglist",
|
||||
[NETIF_F_HW_VLAN_CTAG_TX_BIT] = "tx-vlan-hw-insert",
|
||||
|
||||
[NETIF_F_HW_VLAN_CTAG_RX_BIT] = "rx-vlan-hw-parse",
|
||||
[NETIF_F_HW_VLAN_CTAG_FILTER_BIT] = "rx-vlan-filter",
|
||||
[NETIF_F_HW_VLAN_STAG_TX_BIT] = "tx-vlan-stag-hw-insert",
|
||||
[NETIF_F_HW_VLAN_STAG_RX_BIT] = "rx-vlan-stag-hw-parse",
|
||||
[NETIF_F_HW_VLAN_STAG_FILTER_BIT] = "rx-vlan-stag-filter",
|
||||
[NETIF_F_VLAN_CHALLENGED_BIT] = "vlan-challenged",
|
||||
[NETIF_F_GSO_BIT] = "tx-generic-segmentation",
|
||||
[NETIF_F_LLTX_BIT] = "tx-lockless",
|
||||
[NETIF_F_NETNS_LOCAL_BIT] = "netns-local",
|
||||
[NETIF_F_GRO_BIT] = "rx-gro",
|
||||
[NETIF_F_GRO_HW_BIT] = "rx-gro-hw",
|
||||
[NETIF_F_LRO_BIT] = "rx-lro",
|
||||
|
||||
[NETIF_F_TSO_BIT] = "tx-tcp-segmentation",
|
||||
[NETIF_F_GSO_ROBUST_BIT] = "tx-gso-robust",
|
||||
[NETIF_F_TSO_ECN_BIT] = "tx-tcp-ecn-segmentation",
|
||||
[NETIF_F_TSO_MANGLEID_BIT] = "tx-tcp-mangleid-segmentation",
|
||||
[NETIF_F_TSO6_BIT] = "tx-tcp6-segmentation",
|
||||
[NETIF_F_FSO_BIT] = "tx-fcoe-segmentation",
|
||||
[NETIF_F_GSO_GRE_BIT] = "tx-gre-segmentation",
|
||||
[NETIF_F_GSO_GRE_CSUM_BIT] = "tx-gre-csum-segmentation",
|
||||
[NETIF_F_GSO_IPXIP4_BIT] = "tx-ipxip4-segmentation",
|
||||
[NETIF_F_GSO_IPXIP6_BIT] = "tx-ipxip6-segmentation",
|
||||
[NETIF_F_GSO_UDP_TUNNEL_BIT] = "tx-udp_tnl-segmentation",
|
||||
[NETIF_F_GSO_UDP_TUNNEL_CSUM_BIT] = "tx-udp_tnl-csum-segmentation",
|
||||
[NETIF_F_GSO_PARTIAL_BIT] = "tx-gso-partial",
|
||||
[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_FCOE_CRC_BIT] = "tx-checksum-fcoe-crc",
|
||||
[NETIF_F_SCTP_CRC_BIT] = "tx-checksum-sctp",
|
||||
[NETIF_F_FCOE_MTU_BIT] = "fcoe-mtu",
|
||||
[NETIF_F_NTUPLE_BIT] = "rx-ntuple-filter",
|
||||
[NETIF_F_RXHASH_BIT] = "rx-hashing",
|
||||
[NETIF_F_RXCSUM_BIT] = "rx-checksum",
|
||||
[NETIF_F_NOCACHE_COPY_BIT] = "tx-nocache-copy",
|
||||
[NETIF_F_LOOPBACK_BIT] = "loopback",
|
||||
[NETIF_F_RXFCS_BIT] = "rx-fcs",
|
||||
[NETIF_F_RXALL_BIT] = "rx-all",
|
||||
[NETIF_F_HW_L2FW_DOFFLOAD_BIT] = "l2-fwd-offload",
|
||||
[NETIF_F_HW_TC_BIT] = "hw-tc-offload",
|
||||
[NETIF_F_HW_ESP_BIT] = "esp-hw-offload",
|
||||
[NETIF_F_HW_ESP_TX_CSUM_BIT] = "esp-tx-csum-hw-offload",
|
||||
[NETIF_F_RX_UDP_TUNNEL_PORT_BIT] = "rx-udp_tunnel-port-offload",
|
||||
[NETIF_F_HW_TLS_RECORD_BIT] = "tls-hw-record",
|
||||
[NETIF_F_HW_TLS_TX_BIT] = "tls-hw-tx-offload",
|
||||
[NETIF_F_HW_TLS_RX_BIT] = "tls-hw-rx-offload",
|
||||
};
|
||||
|
||||
const char
|
||||
rss_hash_func_strings[ETH_RSS_HASH_FUNCS_COUNT][ETH_GSTRING_LEN] = {
|
||||
[ETH_RSS_HASH_TOP_BIT] = "toeplitz",
|
||||
[ETH_RSS_HASH_XOR_BIT] = "xor",
|
||||
[ETH_RSS_HASH_CRC32_BIT] = "crc32",
|
||||
};
|
||||
|
||||
const char
|
||||
tunable_strings[__ETHTOOL_TUNABLE_COUNT][ETH_GSTRING_LEN] = {
|
||||
[ETHTOOL_ID_UNSPEC] = "Unspec",
|
||||
[ETHTOOL_RX_COPYBREAK] = "rx-copybreak",
|
||||
[ETHTOOL_TX_COPYBREAK] = "tx-copybreak",
|
||||
[ETHTOOL_PFC_PREVENTION_TOUT] = "pfc-prevention-tout",
|
||||
};
|
||||
|
||||
const char
|
||||
phy_tunable_strings[__ETHTOOL_PHY_TUNABLE_COUNT][ETH_GSTRING_LEN] = {
|
||||
[ETHTOOL_ID_UNSPEC] = "Unspec",
|
||||
[ETHTOOL_PHY_DOWNSHIFT] = "phy-downshift",
|
||||
[ETHTOOL_PHY_FAST_LINK_DOWN] = "phy-fast-link-down",
|
||||
[ETHTOOL_PHY_EDPD] = "phy-energy-detect-power-down",
|
||||
};
|
||||
|
||||
#define __LINK_MODE_NAME(speed, type, duplex) \
|
||||
#speed "base" #type "/" #duplex
|
||||
#define __DEFINE_LINK_MODE_NAME(speed, type, duplex) \
|
||||
[ETHTOOL_LINK_MODE(speed, type, duplex)] = \
|
||||
__LINK_MODE_NAME(speed, type, duplex)
|
||||
#define __DEFINE_SPECIAL_MODE_NAME(_mode, _name) \
|
||||
[ETHTOOL_LINK_MODE_ ## _mode ## _BIT] = _name
|
||||
|
||||
const char link_mode_names[][ETH_GSTRING_LEN] = {
|
||||
__DEFINE_LINK_MODE_NAME(10, T, Half),
|
||||
__DEFINE_LINK_MODE_NAME(10, T, Full),
|
||||
__DEFINE_LINK_MODE_NAME(100, T, Half),
|
||||
__DEFINE_LINK_MODE_NAME(100, T, Full),
|
||||
__DEFINE_LINK_MODE_NAME(1000, T, Half),
|
||||
__DEFINE_LINK_MODE_NAME(1000, T, Full),
|
||||
__DEFINE_SPECIAL_MODE_NAME(Autoneg, "Autoneg"),
|
||||
__DEFINE_SPECIAL_MODE_NAME(TP, "TP"),
|
||||
__DEFINE_SPECIAL_MODE_NAME(AUI, "AUI"),
|
||||
__DEFINE_SPECIAL_MODE_NAME(MII, "MII"),
|
||||
__DEFINE_SPECIAL_MODE_NAME(FIBRE, "FIBRE"),
|
||||
__DEFINE_SPECIAL_MODE_NAME(BNC, "BNC"),
|
||||
__DEFINE_LINK_MODE_NAME(10000, T, Full),
|
||||
__DEFINE_SPECIAL_MODE_NAME(Pause, "Pause"),
|
||||
__DEFINE_SPECIAL_MODE_NAME(Asym_Pause, "Asym_Pause"),
|
||||
__DEFINE_LINK_MODE_NAME(2500, X, Full),
|
||||
__DEFINE_SPECIAL_MODE_NAME(Backplane, "Backplane"),
|
||||
__DEFINE_LINK_MODE_NAME(1000, KX, Full),
|
||||
__DEFINE_LINK_MODE_NAME(10000, KX4, Full),
|
||||
__DEFINE_LINK_MODE_NAME(10000, KR, Full),
|
||||
__DEFINE_SPECIAL_MODE_NAME(10000baseR_FEC, "10000baseR_FEC"),
|
||||
__DEFINE_LINK_MODE_NAME(20000, MLD2, Full),
|
||||
__DEFINE_LINK_MODE_NAME(20000, KR2, Full),
|
||||
__DEFINE_LINK_MODE_NAME(40000, KR4, Full),
|
||||
__DEFINE_LINK_MODE_NAME(40000, CR4, Full),
|
||||
__DEFINE_LINK_MODE_NAME(40000, SR4, Full),
|
||||
__DEFINE_LINK_MODE_NAME(40000, LR4, Full),
|
||||
__DEFINE_LINK_MODE_NAME(56000, KR4, Full),
|
||||
__DEFINE_LINK_MODE_NAME(56000, CR4, Full),
|
||||
__DEFINE_LINK_MODE_NAME(56000, SR4, Full),
|
||||
__DEFINE_LINK_MODE_NAME(56000, LR4, Full),
|
||||
__DEFINE_LINK_MODE_NAME(25000, CR, Full),
|
||||
__DEFINE_LINK_MODE_NAME(25000, KR, Full),
|
||||
__DEFINE_LINK_MODE_NAME(25000, SR, Full),
|
||||
__DEFINE_LINK_MODE_NAME(50000, CR2, Full),
|
||||
__DEFINE_LINK_MODE_NAME(50000, KR2, Full),
|
||||
__DEFINE_LINK_MODE_NAME(100000, KR4, Full),
|
||||
__DEFINE_LINK_MODE_NAME(100000, SR4, Full),
|
||||
__DEFINE_LINK_MODE_NAME(100000, CR4, Full),
|
||||
__DEFINE_LINK_MODE_NAME(100000, LR4_ER4, Full),
|
||||
__DEFINE_LINK_MODE_NAME(50000, SR2, Full),
|
||||
__DEFINE_LINK_MODE_NAME(1000, X, Full),
|
||||
__DEFINE_LINK_MODE_NAME(10000, CR, Full),
|
||||
__DEFINE_LINK_MODE_NAME(10000, SR, Full),
|
||||
__DEFINE_LINK_MODE_NAME(10000, LR, Full),
|
||||
__DEFINE_LINK_MODE_NAME(10000, LRM, Full),
|
||||
__DEFINE_LINK_MODE_NAME(10000, ER, Full),
|
||||
__DEFINE_LINK_MODE_NAME(2500, T, Full),
|
||||
__DEFINE_LINK_MODE_NAME(5000, T, Full),
|
||||
__DEFINE_SPECIAL_MODE_NAME(FEC_NONE, "None"),
|
||||
__DEFINE_SPECIAL_MODE_NAME(FEC_RS, "RS"),
|
||||
__DEFINE_SPECIAL_MODE_NAME(FEC_BASER, "BASER"),
|
||||
__DEFINE_LINK_MODE_NAME(50000, KR, Full),
|
||||
__DEFINE_LINK_MODE_NAME(50000, SR, Full),
|
||||
__DEFINE_LINK_MODE_NAME(50000, CR, Full),
|
||||
__DEFINE_LINK_MODE_NAME(50000, LR_ER_FR, Full),
|
||||
__DEFINE_LINK_MODE_NAME(50000, DR, Full),
|
||||
__DEFINE_LINK_MODE_NAME(100000, KR2, Full),
|
||||
__DEFINE_LINK_MODE_NAME(100000, SR2, Full),
|
||||
__DEFINE_LINK_MODE_NAME(100000, CR2, Full),
|
||||
__DEFINE_LINK_MODE_NAME(100000, LR2_ER2_FR2, Full),
|
||||
__DEFINE_LINK_MODE_NAME(100000, DR2, Full),
|
||||
__DEFINE_LINK_MODE_NAME(200000, KR4, Full),
|
||||
__DEFINE_LINK_MODE_NAME(200000, SR4, Full),
|
||||
__DEFINE_LINK_MODE_NAME(200000, LR4_ER4_FR4, Full),
|
||||
__DEFINE_LINK_MODE_NAME(200000, DR4, Full),
|
||||
__DEFINE_LINK_MODE_NAME(200000, CR4, Full),
|
||||
__DEFINE_LINK_MODE_NAME(100, T1, Full),
|
||||
__DEFINE_LINK_MODE_NAME(1000, T1, Full),
|
||||
__DEFINE_LINK_MODE_NAME(400000, KR8, Full),
|
||||
__DEFINE_LINK_MODE_NAME(400000, SR8, Full),
|
||||
__DEFINE_LINK_MODE_NAME(400000, LR8_ER8_FR8, Full),
|
||||
__DEFINE_LINK_MODE_NAME(400000, DR8, Full),
|
||||
__DEFINE_LINK_MODE_NAME(400000, CR8, Full),
|
||||
};
|
||||
static_assert(ARRAY_SIZE(link_mode_names) == __ETHTOOL_LINK_MODE_MASK_NBITS);
|
|
@ -0,0 +1,22 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#ifndef _ETHTOOL_COMMON_H
|
||||
#define _ETHTOOL_COMMON_H
|
||||
|
||||
#include <linux/ethtool.h>
|
||||
|
||||
/* compose link mode index from speed, type and duplex */
|
||||
#define ETHTOOL_LINK_MODE(speed, type, duplex) \
|
||||
ETHTOOL_LINK_MODE_ ## speed ## base ## type ## _ ## duplex ## _BIT
|
||||
|
||||
extern const char
|
||||
netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN];
|
||||
extern const char
|
||||
rss_hash_func_strings[ETH_RSS_HASH_FUNCS_COUNT][ETH_GSTRING_LEN];
|
||||
extern const char
|
||||
tunable_strings[__ETHTOOL_TUNABLE_COUNT][ETH_GSTRING_LEN];
|
||||
extern const char
|
||||
phy_tunable_strings[__ETHTOOL_PHY_TUNABLE_COUNT][ETH_GSTRING_LEN];
|
||||
extern const char link_mode_names[][ETH_GSTRING_LEN];
|
||||
|
||||
#endif /* _ETHTOOL_COMMON_H */
|
|
@ -27,6 +27,8 @@
|
|||
#include <net/xdp_sock.h>
|
||||
#include <net/flow_offload.h>
|
||||
|
||||
#include "common.h"
|
||||
|
||||
/*
|
||||
* Some useful ethtool_ops methods that're device independent.
|
||||
* If we find that all drivers want to do the same thing here,
|
||||
|
@ -54,88 +56,6 @@ EXPORT_SYMBOL(ethtool_op_get_ts_info);
|
|||
|
||||
#define ETHTOOL_DEV_FEATURE_WORDS ((NETDEV_FEATURE_COUNT + 31) / 32)
|
||||
|
||||
static const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN] = {
|
||||
[NETIF_F_SG_BIT] = "tx-scatter-gather",
|
||||
[NETIF_F_IP_CSUM_BIT] = "tx-checksum-ipv4",
|
||||
[NETIF_F_HW_CSUM_BIT] = "tx-checksum-ip-generic",
|
||||
[NETIF_F_IPV6_CSUM_BIT] = "tx-checksum-ipv6",
|
||||
[NETIF_F_HIGHDMA_BIT] = "highdma",
|
||||
[NETIF_F_FRAGLIST_BIT] = "tx-scatter-gather-fraglist",
|
||||
[NETIF_F_HW_VLAN_CTAG_TX_BIT] = "tx-vlan-hw-insert",
|
||||
|
||||
[NETIF_F_HW_VLAN_CTAG_RX_BIT] = "rx-vlan-hw-parse",
|
||||
[NETIF_F_HW_VLAN_CTAG_FILTER_BIT] = "rx-vlan-filter",
|
||||
[NETIF_F_HW_VLAN_STAG_TX_BIT] = "tx-vlan-stag-hw-insert",
|
||||
[NETIF_F_HW_VLAN_STAG_RX_BIT] = "rx-vlan-stag-hw-parse",
|
||||
[NETIF_F_HW_VLAN_STAG_FILTER_BIT] = "rx-vlan-stag-filter",
|
||||
[NETIF_F_VLAN_CHALLENGED_BIT] = "vlan-challenged",
|
||||
[NETIF_F_GSO_BIT] = "tx-generic-segmentation",
|
||||
[NETIF_F_LLTX_BIT] = "tx-lockless",
|
||||
[NETIF_F_NETNS_LOCAL_BIT] = "netns-local",
|
||||
[NETIF_F_GRO_BIT] = "rx-gro",
|
||||
[NETIF_F_GRO_HW_BIT] = "rx-gro-hw",
|
||||
[NETIF_F_LRO_BIT] = "rx-lro",
|
||||
|
||||
[NETIF_F_TSO_BIT] = "tx-tcp-segmentation",
|
||||
[NETIF_F_GSO_ROBUST_BIT] = "tx-gso-robust",
|
||||
[NETIF_F_TSO_ECN_BIT] = "tx-tcp-ecn-segmentation",
|
||||
[NETIF_F_TSO_MANGLEID_BIT] = "tx-tcp-mangleid-segmentation",
|
||||
[NETIF_F_TSO6_BIT] = "tx-tcp6-segmentation",
|
||||
[NETIF_F_FSO_BIT] = "tx-fcoe-segmentation",
|
||||
[NETIF_F_GSO_GRE_BIT] = "tx-gre-segmentation",
|
||||
[NETIF_F_GSO_GRE_CSUM_BIT] = "tx-gre-csum-segmentation",
|
||||
[NETIF_F_GSO_IPXIP4_BIT] = "tx-ipxip4-segmentation",
|
||||
[NETIF_F_GSO_IPXIP6_BIT] = "tx-ipxip6-segmentation",
|
||||
[NETIF_F_GSO_UDP_TUNNEL_BIT] = "tx-udp_tnl-segmentation",
|
||||
[NETIF_F_GSO_UDP_TUNNEL_CSUM_BIT] = "tx-udp_tnl-csum-segmentation",
|
||||
[NETIF_F_GSO_PARTIAL_BIT] = "tx-gso-partial",
|
||||
[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_FCOE_CRC_BIT] = "tx-checksum-fcoe-crc",
|
||||
[NETIF_F_SCTP_CRC_BIT] = "tx-checksum-sctp",
|
||||
[NETIF_F_FCOE_MTU_BIT] = "fcoe-mtu",
|
||||
[NETIF_F_NTUPLE_BIT] = "rx-ntuple-filter",
|
||||
[NETIF_F_RXHASH_BIT] = "rx-hashing",
|
||||
[NETIF_F_RXCSUM_BIT] = "rx-checksum",
|
||||
[NETIF_F_NOCACHE_COPY_BIT] = "tx-nocache-copy",
|
||||
[NETIF_F_LOOPBACK_BIT] = "loopback",
|
||||
[NETIF_F_RXFCS_BIT] = "rx-fcs",
|
||||
[NETIF_F_RXALL_BIT] = "rx-all",
|
||||
[NETIF_F_HW_L2FW_DOFFLOAD_BIT] = "l2-fwd-offload",
|
||||
[NETIF_F_HW_TC_BIT] = "hw-tc-offload",
|
||||
[NETIF_F_HW_ESP_BIT] = "esp-hw-offload",
|
||||
[NETIF_F_HW_ESP_TX_CSUM_BIT] = "esp-tx-csum-hw-offload",
|
||||
[NETIF_F_RX_UDP_TUNNEL_PORT_BIT] = "rx-udp_tunnel-port-offload",
|
||||
[NETIF_F_HW_TLS_RECORD_BIT] = "tls-hw-record",
|
||||
[NETIF_F_HW_TLS_TX_BIT] = "tls-hw-tx-offload",
|
||||
[NETIF_F_HW_TLS_RX_BIT] = "tls-hw-rx-offload",
|
||||
};
|
||||
|
||||
static const char
|
||||
rss_hash_func_strings[ETH_RSS_HASH_FUNCS_COUNT][ETH_GSTRING_LEN] = {
|
||||
[ETH_RSS_HASH_TOP_BIT] = "toeplitz",
|
||||
[ETH_RSS_HASH_XOR_BIT] = "xor",
|
||||
[ETH_RSS_HASH_CRC32_BIT] = "crc32",
|
||||
};
|
||||
|
||||
static const char
|
||||
tunable_strings[__ETHTOOL_TUNABLE_COUNT][ETH_GSTRING_LEN] = {
|
||||
[ETHTOOL_ID_UNSPEC] = "Unspec",
|
||||
[ETHTOOL_RX_COPYBREAK] = "rx-copybreak",
|
||||
[ETHTOOL_TX_COPYBREAK] = "tx-copybreak",
|
||||
[ETHTOOL_PFC_PREVENTION_TOUT] = "pfc-prevention-tout",
|
||||
};
|
||||
|
||||
static const char
|
||||
phy_tunable_strings[__ETHTOOL_PHY_TUNABLE_COUNT][ETH_GSTRING_LEN] = {
|
||||
[ETHTOOL_ID_UNSPEC] = "Unspec",
|
||||
[ETHTOOL_PHY_DOWNSHIFT] = "phy-downshift",
|
||||
[ETHTOOL_PHY_FAST_LINK_DOWN] = "phy-fast-link-down",
|
||||
[ETHTOOL_PHY_EDPD] = "phy-energy-detect-power-down",
|
||||
};
|
||||
|
||||
static int ethtool_get_features(struct net_device *dev, void __user *useraddr)
|
||||
{
|
||||
struct ethtool_gfeatures cmd = {
|
||||
|
@ -234,6 +154,9 @@ static int __ethtool_get_sset_count(struct net_device *dev, int sset)
|
|||
!ops->get_ethtool_phy_stats)
|
||||
return phy_ethtool_get_sset_count(dev->phydev);
|
||||
|
||||
if (sset == ETH_SS_LINK_MODES)
|
||||
return __ETHTOOL_LINK_MODE_MASK_NBITS;
|
||||
|
||||
if (ops->get_sset_count && ops->get_strings)
|
||||
return ops->get_sset_count(dev, sset);
|
||||
else
|
||||
|
@ -258,6 +181,9 @@ static void __ethtool_get_strings(struct net_device *dev,
|
|||
else if (stringset == ETH_SS_PHY_STATS && dev->phydev &&
|
||||
!ops->get_ethtool_phy_stats)
|
||||
phy_ethtool_get_strings(dev->phydev, data);
|
||||
else if (stringset == ETH_SS_LINK_MODES)
|
||||
memcpy(data, link_mode_names,
|
||||
__ETHTOOL_LINK_MODE_MASK_NBITS * ETH_GSTRING_LEN);
|
||||
else
|
||||
/* ops->get_strings is valid because checked earlier */
|
||||
ops->get_strings(dev, stringset, data);
|
|
@ -12900,8 +12900,7 @@ static int nl80211_vendor_check_policy(const struct wiphy_vendor_command *vcmd,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
return nl80211_validate_nested(attr, vcmd->maxattr, vcmd->policy,
|
||||
extack);
|
||||
return nla_validate_nested(attr, vcmd->maxattr, vcmd->policy, extack);
|
||||
}
|
||||
|
||||
static int nl80211_vendor_cmd(struct sk_buff *skb, struct genl_info *info)
|
||||
|
|
Loading…
Reference in New Issue