add support to set or get rx buf len and add support to set or get tx push by ethtool -G
Signed-off-by: Jiantao Xiao <xiaojiantao1@h-partners.com>
This commit is contained in:
parent
dd4ea92107
commit
f2c66b07c9
58
0001-rings-add-support-to-set-get-rx-buf-len.patch
Normal file
58
0001-rings-add-support-to-set-get-rx-buf-len.patch
Normal file
@ -0,0 +1,58 @@
|
||||
From 327b1f6ced24f63f16472c666b48e0af9e7b0039 Mon Sep 17 00:00:00 2001
|
||||
From: Hao Chen <chenhao288@hisilicon.com>
|
||||
Date: Mon, 20 Dec 2021 16:31:54 +0800
|
||||
Subject: rings: add support to set/get rx buf len
|
||||
|
||||
Add support for "ethtool -G <dev> rx-buf-len xxx" and "ethtool -g <dev>"
|
||||
to set/get rx-buf-len.
|
||||
|
||||
commit: a081c2a
|
||||
Reference: https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/commit/?h=v5.19&id=a081c2a5216a
|
||||
|
||||
Signed-off-by: Hao Chen <chenhao288@hisilicon.com>
|
||||
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
|
||||
---
|
||||
ethtool.c | 1 +
|
||||
netlink/rings.c | 7 +++++++
|
||||
2 files changed, 8 insertions(+)
|
||||
|
||||
diff --git a/ethtool.c b/ethtool.c
|
||||
index 46887c7..43f266e 100644
|
||||
--- a/ethtool.c
|
||||
+++ b/ethtool.c
|
||||
@@ -5724,6 +5724,7 @@ static const struct option args[] = {
|
||||
" [ rx-mini N ]\n"
|
||||
" [ rx-jumbo N ]\n"
|
||||
" [ tx N ]\n"
|
||||
+ " [ rx-buf-len N]\n"
|
||||
},
|
||||
{
|
||||
.opts = "-k|--show-features|--show-offload",
|
||||
diff --git a/netlink/rings.c b/netlink/rings.c
|
||||
index b8c458f..119178e 100644
|
||||
--- a/netlink/rings.c
|
||||
+++ b/netlink/rings.c
|
||||
@@ -46,6 +46,7 @@ int rings_reply_cb(const struct nlmsghdr *nlhdr, void *data)
|
||||
show_u32(tb[ETHTOOL_A_RINGS_RX_MINI], "RX Mini:\t");
|
||||
show_u32(tb[ETHTOOL_A_RINGS_RX_JUMBO], "RX Jumbo:\t");
|
||||
show_u32(tb[ETHTOOL_A_RINGS_TX], "TX:\t\t");
|
||||
+ show_u32(tb[ETHTOOL_A_RINGS_RX_BUF_LEN], "RX Buf Len:\t\t");
|
||||
|
||||
return MNL_CB_OK;
|
||||
}
|
||||
@@ -98,6 +99,12 @@ static const struct param_parser sring_params[] = {
|
||||
.handler = nl_parse_direct_u32,
|
||||
.min_argc = 1,
|
||||
},
|
||||
+ {
|
||||
+ .arg = "rx-buf-len",
|
||||
+ .type = ETHTOOL_A_RINGS_RX_BUF_LEN,
|
||||
+ .handler = nl_parse_direct_u32,
|
||||
+ .min_argc = 1,
|
||||
+ },
|
||||
{}
|
||||
};
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
From 53375183f19f8a6e6b6a3fc5776013aaf1bed23a Mon Sep 17 00:00:00 2001
|
||||
From: Hao Chen <chenhao288@hisilicon.com>
|
||||
Date: Mon, 20 Dec 2021 16:31:55 +0800
|
||||
Subject: tunables: add support to get/set tx copybreak buf size
|
||||
|
||||
Add support for "ethtool --set-tunable <dev> tx-buf-size xxx"
|
||||
and "ethtool --get-tunable <dev> tx-buf-size" to set/get
|
||||
tx copybreak buf size.
|
||||
|
||||
commit: 51a9312
|
||||
Reference: https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/commit/?id=51a9312cc250
|
||||
|
||||
Signed-off-by: Hao Chen <chenhao288@hisilicon.com>
|
||||
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
|
||||
---
|
||||
ethtool.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/ethtool.c b/ethtool.c
|
||||
index 43f266e..040e911 100644
|
||||
--- a/ethtool.c
|
||||
+++ b/ethtool.c
|
||||
@@ -5009,6 +5009,7 @@ tunable_strings[__ETHTOOL_TUNABLE_COUNT][ETH_GSTRING_LEN] = {
|
||||
[ETHTOOL_ID_UNSPEC] = "Unspec",
|
||||
[ETHTOOL_RX_COPYBREAK] = "rx-copybreak",
|
||||
[ETHTOOL_TX_COPYBREAK] = "tx-copybreak",
|
||||
+ [ETHTOOL_TX_COPYBREAK_BUF_SIZE] = "tx-buf-size",
|
||||
[ETHTOOL_PFC_PREVENTION_TOUT] = "pfc-prevention-tout",
|
||||
};
|
||||
|
||||
@@ -5048,6 +5049,11 @@ static struct ethtool_tunable_info tunables_info[] = {
|
||||
.size = sizeof(u16),
|
||||
.type = CMDL_U16,
|
||||
},
|
||||
+ { .t_id = ETHTOOL_TX_COPYBREAK_BUF_SIZE,
|
||||
+ .t_type_id = ETHTOOL_TUNABLE_U32,
|
||||
+ .size = sizeof(u32),
|
||||
+ .type = CMDL_U32,
|
||||
+ },
|
||||
};
|
||||
#define TUNABLES_INFO_SIZE ARRAY_SIZE(tunables_info)
|
||||
|
||||
@@ -5961,6 +5967,7 @@ static const struct option args[] = {
|
||||
.help = "Get tunable",
|
||||
.xhelp = " [ rx-copybreak ]\n"
|
||||
" [ tx-copybreak ]\n"
|
||||
+ " [ tx-buf-size ]\n"
|
||||
" [ pfc-precention-tout ]\n"
|
||||
},
|
||||
{
|
||||
@@ -5969,6 +5976,7 @@ static const struct option args[] = {
|
||||
.help = "Set tunable",
|
||||
.xhelp = " [ rx-copybreak N]\n"
|
||||
" [ tx-copybreak N]\n"
|
||||
+ " [ tx-buf-size N]\n"
|
||||
" [ pfc-precention-tout N]\n"
|
||||
},
|
||||
{
|
||||
--
|
||||
2.33.0
|
||||
|
||||
345
0003-update-UAPI-header-copies.patch
Normal file
345
0003-update-UAPI-header-copies.patch
Normal file
@ -0,0 +1,345 @@
|
||||
From 6428870f54e7107c2f37202f14818ebab0112e5f Mon Sep 17 00:00:00 2001
|
||||
From: Jie Wang <wangjie125@huawei.com>
|
||||
Date: Fri, 29 Apr 2022 17:17:03 +0800
|
||||
Subject: update UAPI header copies
|
||||
|
||||
Update to kernel commit cc4bdef26ecd.
|
||||
|
||||
commit: bd138ee
|
||||
Reference: https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/commit/?id=bd138ee083c4
|
||||
change log: Some macros for rx buf len in other patch. To avoid add
|
||||
unnecrssary content, add like "ETHTOOL_TX_COPYBREAK_BUF_SIZE"
|
||||
"ETHTOOL_A_RINGS_RX_BUF_LEN" "IFLA_BOND_MISSED_MAX" in this patch
|
||||
|
||||
Signed-off-by: Jie Wang <wangjie125@huawei.com>
|
||||
---
|
||||
uapi/linux/ethtool.h | 1 +
|
||||
uapi/linux/ethtool_netlink.h | 10 ++++
|
||||
uapi/linux/if_link.h | 98 ++++++++++++++++++++++++++++++++++++
|
||||
uapi/linux/net_tstamp.h | 17 ++++++-
|
||||
uapi/linux/netlink.h | 1 +
|
||||
uapi/linux/rtnetlink.h | 16 ++++++
|
||||
6 files changed, 142 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/uapi/linux/ethtool.h b/uapi/linux/ethtool.h
|
||||
index a7f549a..4a36287 100644
|
||||
--- a/uapi/linux/ethtool.h
|
||||
+++ b/uapi/linux/ethtool.h
|
||||
@@ -229,6 +229,7 @@ enum tunable_id {
|
||||
ETHTOOL_RX_COPYBREAK,
|
||||
ETHTOOL_TX_COPYBREAK,
|
||||
ETHTOOL_PFC_PREVENTION_TOUT, /* timeout in msecs */
|
||||
+ ETHTOOL_TX_COPYBREAK_BUF_SIZE,
|
||||
/*
|
||||
* Add your fresh new tunable attribute above and remember to update
|
||||
* tunable_strings[] in net/ethtool/common.c
|
||||
diff --git a/uapi/linux/ethtool_netlink.h b/uapi/linux/ethtool_netlink.h
|
||||
index 5665d64..aaadce7 100644
|
||||
--- a/uapi/linux/ethtool_netlink.h
|
||||
+++ b/uapi/linux/ethtool_netlink.h
|
||||
@@ -314,6 +314,12 @@ enum {
|
||||
|
||||
/* RINGS */
|
||||
|
||||
+enum {
|
||||
+ ETHTOOL_TCP_DATA_SPLIT_UNKNOWN = 0,
|
||||
+ ETHTOOL_TCP_DATA_SPLIT_DISABLED,
|
||||
+ ETHTOOL_TCP_DATA_SPLIT_ENABLED,
|
||||
+};
|
||||
+
|
||||
enum {
|
||||
ETHTOOL_A_RINGS_UNSPEC,
|
||||
ETHTOOL_A_RINGS_HEADER, /* nest - _A_HEADER_* */
|
||||
@@ -325,6 +331,10 @@ enum {
|
||||
ETHTOOL_A_RINGS_RX_MINI, /* u32 */
|
||||
ETHTOOL_A_RINGS_RX_JUMBO, /* u32 */
|
||||
ETHTOOL_A_RINGS_TX, /* u32 */
|
||||
+ ETHTOOL_A_RINGS_RX_BUF_LEN, /* u32 */
|
||||
+ ETHTOOL_A_RINGS_TCP_DATA_SPLIT, /* u8 */
|
||||
+ ETHTOOL_A_RINGS_CQE_SIZE, /* u32 */
|
||||
+ ETHTOOL_A_RINGS_TX_PUSH, /* u8 */
|
||||
|
||||
/* add new constants above here */
|
||||
__ETHTOOL_A_RINGS_CNT,
|
||||
diff --git a/uapi/linux/if_link.h b/uapi/linux/if_link.h
|
||||
index 1d4ed60..34002e7 100644
|
||||
--- a/uapi/linux/if_link.h
|
||||
+++ b/uapi/linux/if_link.h
|
||||
@@ -211,6 +211,9 @@ struct rtnl_link_stats {
|
||||
* @rx_nohandler: Number of packets received on the interface
|
||||
* but dropped by the networking stack because the device is
|
||||
* not designated to receive packets (e.g. backup link in a bond).
|
||||
+ *
|
||||
+ * @rx_otherhost_dropped: Number of packets dropped due to mismatch
|
||||
+ * in destination MAC address.
|
||||
*/
|
||||
struct rtnl_link_stats64 {
|
||||
__u64 rx_packets;
|
||||
@@ -243,6 +246,23 @@ struct rtnl_link_stats64 {
|
||||
__u64 rx_compressed;
|
||||
__u64 tx_compressed;
|
||||
__u64 rx_nohandler;
|
||||
+
|
||||
+ __u64 rx_otherhost_dropped;
|
||||
+};
|
||||
+
|
||||
+/* Subset of link stats useful for in-HW collection. Meaning of the fields is as
|
||||
+ * for struct rtnl_link_stats64.
|
||||
+ */
|
||||
+struct rtnl_hw_stats64 {
|
||||
+ __u64 rx_packets;
|
||||
+ __u64 tx_packets;
|
||||
+ __u64 rx_bytes;
|
||||
+ __u64 tx_bytes;
|
||||
+ __u64 rx_errors;
|
||||
+ __u64 tx_errors;
|
||||
+ __u64 rx_dropped;
|
||||
+ __u64 tx_dropped;
|
||||
+ __u64 multicast;
|
||||
};
|
||||
|
||||
/* The struct should be in sync with struct ifmap */
|
||||
@@ -347,6 +367,7 @@ enum {
|
||||
*/
|
||||
IFLA_PARENT_DEV_NAME,
|
||||
IFLA_PARENT_DEV_BUS_NAME,
|
||||
+ IFLA_GRO_MAX_SIZE,
|
||||
|
||||
__IFLA_MAX
|
||||
};
|
||||
@@ -534,6 +555,7 @@ enum {
|
||||
IFLA_BRPORT_MRP_IN_OPEN,
|
||||
IFLA_BRPORT_MCAST_EHT_HOSTS_LIMIT,
|
||||
IFLA_BRPORT_MCAST_EHT_HOSTS_CNT,
|
||||
+ IFLA_BRPORT_LOCKED,
|
||||
__IFLA_BRPORT_MAX
|
||||
};
|
||||
#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
|
||||
@@ -709,7 +731,55 @@ enum ipvlan_mode {
|
||||
#define IPVLAN_F_PRIVATE 0x01
|
||||
#define IPVLAN_F_VEPA 0x02
|
||||
|
||||
+/* Tunnel RTM header */
|
||||
+struct tunnel_msg {
|
||||
+ __u8 family;
|
||||
+ __u8 flags;
|
||||
+ __u16 reserved2;
|
||||
+ __u32 ifindex;
|
||||
+};
|
||||
+
|
||||
/* VXLAN section */
|
||||
+
|
||||
+/* include statistics in the dump */
|
||||
+#define TUNNEL_MSG_FLAG_STATS 0x01
|
||||
+
|
||||
+#define TUNNEL_MSG_VALID_USER_FLAGS TUNNEL_MSG_FLAG_STATS
|
||||
+
|
||||
+/* Embedded inside VXLAN_VNIFILTER_ENTRY_STATS */
|
||||
+enum {
|
||||
+ VNIFILTER_ENTRY_STATS_UNSPEC,
|
||||
+ VNIFILTER_ENTRY_STATS_RX_BYTES,
|
||||
+ VNIFILTER_ENTRY_STATS_RX_PKTS,
|
||||
+ VNIFILTER_ENTRY_STATS_RX_DROPS,
|
||||
+ VNIFILTER_ENTRY_STATS_RX_ERRORS,
|
||||
+ VNIFILTER_ENTRY_STATS_TX_BYTES,
|
||||
+ VNIFILTER_ENTRY_STATS_TX_PKTS,
|
||||
+ VNIFILTER_ENTRY_STATS_TX_DROPS,
|
||||
+ VNIFILTER_ENTRY_STATS_TX_ERRORS,
|
||||
+ VNIFILTER_ENTRY_STATS_PAD,
|
||||
+ __VNIFILTER_ENTRY_STATS_MAX
|
||||
+};
|
||||
+#define VNIFILTER_ENTRY_STATS_MAX (__VNIFILTER_ENTRY_STATS_MAX - 1)
|
||||
+
|
||||
+enum {
|
||||
+ VXLAN_VNIFILTER_ENTRY_UNSPEC,
|
||||
+ VXLAN_VNIFILTER_ENTRY_START,
|
||||
+ VXLAN_VNIFILTER_ENTRY_END,
|
||||
+ VXLAN_VNIFILTER_ENTRY_GROUP,
|
||||
+ VXLAN_VNIFILTER_ENTRY_GROUP6,
|
||||
+ VXLAN_VNIFILTER_ENTRY_STATS,
|
||||
+ __VXLAN_VNIFILTER_ENTRY_MAX
|
||||
+};
|
||||
+#define VXLAN_VNIFILTER_ENTRY_MAX (__VXLAN_VNIFILTER_ENTRY_MAX - 1)
|
||||
+
|
||||
+enum {
|
||||
+ VXLAN_VNIFILTER_UNSPEC,
|
||||
+ VXLAN_VNIFILTER_ENTRY,
|
||||
+ __VXLAN_VNIFILTER_MAX
|
||||
+};
|
||||
+#define VXLAN_VNIFILTER_MAX (__VXLAN_VNIFILTER_MAX - 1)
|
||||
+
|
||||
enum {
|
||||
IFLA_VXLAN_UNSPEC,
|
||||
IFLA_VXLAN_ID,
|
||||
@@ -741,6 +811,7 @@ enum {
|
||||
IFLA_VXLAN_GPE,
|
||||
IFLA_VXLAN_TTL_INHERIT,
|
||||
IFLA_VXLAN_DF,
|
||||
+ IFLA_VXLAN_VNIFILTER, /* only applicable with COLLECT_METADATA mode */
|
||||
__IFLA_VXLAN_MAX
|
||||
};
|
||||
#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
|
||||
@@ -774,6 +845,7 @@ enum {
|
||||
IFLA_GENEVE_LABEL,
|
||||
IFLA_GENEVE_TTL_INHERIT,
|
||||
IFLA_GENEVE_DF,
|
||||
+ IFLA_GENEVE_INNER_PROTO_INHERIT,
|
||||
__IFLA_GENEVE_MAX
|
||||
};
|
||||
#define IFLA_GENEVE_MAX (__IFLA_GENEVE_MAX - 1)
|
||||
@@ -819,6 +891,8 @@ enum {
|
||||
IFLA_GTP_FD1,
|
||||
IFLA_GTP_PDP_HASHSIZE,
|
||||
IFLA_GTP_ROLE,
|
||||
+ IFLA_GTP_CREATE_SOCKETS,
|
||||
+ IFLA_GTP_RESTART_COUNT,
|
||||
__IFLA_GTP_MAX,
|
||||
};
|
||||
#define IFLA_GTP_MAX (__IFLA_GTP_MAX - 1)
|
||||
@@ -856,6 +930,8 @@ enum {
|
||||
IFLA_BOND_TLB_DYNAMIC_LB,
|
||||
IFLA_BOND_PEER_NOTIF_DELAY,
|
||||
IFLA_BOND_AD_LACP_ACTIVE,
|
||||
+ IFLA_BOND_MISSED_MAX,
|
||||
+ IFLA_BOND_NS_IP6_TARGET,
|
||||
__IFLA_BOND_MAX,
|
||||
};
|
||||
|
||||
@@ -1152,6 +1228,17 @@ enum {
|
||||
|
||||
#define IFLA_STATS_FILTER_BIT(ATTR) (1 << (ATTR - 1))
|
||||
|
||||
+enum {
|
||||
+ IFLA_STATS_GETSET_UNSPEC,
|
||||
+ IFLA_STATS_GET_FILTERS, /* Nest of IFLA_STATS_LINK_xxx, each a u32 with
|
||||
+ * a filter mask for the corresponding group.
|
||||
+ */
|
||||
+ IFLA_STATS_SET_OFFLOAD_XSTATS_L3_STATS, /* 0 or 1 as u8 */
|
||||
+ __IFLA_STATS_GETSET_MAX,
|
||||
+};
|
||||
+
|
||||
+#define IFLA_STATS_GETSET_MAX (__IFLA_STATS_GETSET_MAX - 1)
|
||||
+
|
||||
/* These are embedded into IFLA_STATS_LINK_XSTATS:
|
||||
* [IFLA_STATS_LINK_XSTATS]
|
||||
* -> [LINK_XSTATS_TYPE_xxx]
|
||||
@@ -1169,10 +1256,21 @@ enum {
|
||||
enum {
|
||||
IFLA_OFFLOAD_XSTATS_UNSPEC,
|
||||
IFLA_OFFLOAD_XSTATS_CPU_HIT, /* struct rtnl_link_stats64 */
|
||||
+ IFLA_OFFLOAD_XSTATS_HW_S_INFO, /* HW stats info. A nest */
|
||||
+ IFLA_OFFLOAD_XSTATS_L3_STATS, /* struct rtnl_hw_stats64 */
|
||||
__IFLA_OFFLOAD_XSTATS_MAX
|
||||
};
|
||||
#define IFLA_OFFLOAD_XSTATS_MAX (__IFLA_OFFLOAD_XSTATS_MAX - 1)
|
||||
|
||||
+enum {
|
||||
+ IFLA_OFFLOAD_XSTATS_HW_S_INFO_UNSPEC,
|
||||
+ IFLA_OFFLOAD_XSTATS_HW_S_INFO_REQUEST, /* u8 */
|
||||
+ IFLA_OFFLOAD_XSTATS_HW_S_INFO_USED, /* u8 */
|
||||
+ __IFLA_OFFLOAD_XSTATS_HW_S_INFO_MAX,
|
||||
+};
|
||||
+#define IFLA_OFFLOAD_XSTATS_HW_S_INFO_MAX \
|
||||
+ (__IFLA_OFFLOAD_XSTATS_HW_S_INFO_MAX - 1)
|
||||
+
|
||||
/* XDP section */
|
||||
|
||||
#define XDP_FLAGS_UPDATE_IF_NOEXIST (1U << 0)
|
||||
diff --git a/uapi/linux/net_tstamp.h b/uapi/linux/net_tstamp.h
|
||||
index fcc61c7..55501e5 100644
|
||||
--- a/uapi/linux/net_tstamp.h
|
||||
+++ b/uapi/linux/net_tstamp.h
|
||||
@@ -62,7 +62,7 @@ struct so_timestamping {
|
||||
/**
|
||||
* struct hwtstamp_config - %SIOCGHWTSTAMP and %SIOCSHWTSTAMP parameter
|
||||
*
|
||||
- * @flags: no flags defined right now, must be zero for %SIOCSHWTSTAMP
|
||||
+ * @flags: one of HWTSTAMP_FLAG_*
|
||||
* @tx_type: one of HWTSTAMP_TX_*
|
||||
* @rx_filter: one of HWTSTAMP_FILTER_*
|
||||
*
|
||||
@@ -78,6 +78,21 @@ struct hwtstamp_config {
|
||||
int rx_filter;
|
||||
};
|
||||
|
||||
+/* possible values for hwtstamp_config->flags */
|
||||
+enum hwtstamp_flags {
|
||||
+ /*
|
||||
+ * With this flag, the user could get bond active interface's
|
||||
+ * PHC index. Note this PHC index is not stable as when there
|
||||
+ * is a failover, the bond active interface will be changed, so
|
||||
+ * will be the PHC index.
|
||||
+ */
|
||||
+ HWTSTAMP_FLAG_BONDED_PHC_INDEX = (1<<0),
|
||||
+#define HWTSTAMP_FLAG_BONDED_PHC_INDEX HWTSTAMP_FLAG_BONDED_PHC_INDEX
|
||||
+
|
||||
+ HWTSTAMP_FLAG_LAST = HWTSTAMP_FLAG_BONDED_PHC_INDEX,
|
||||
+ HWTSTAMP_FLAG_MASK = (HWTSTAMP_FLAG_LAST - 1) | HWTSTAMP_FLAG_LAST
|
||||
+};
|
||||
+
|
||||
/* possible values for hwtstamp_config->tx_type */
|
||||
enum hwtstamp_tx_types {
|
||||
/*
|
||||
diff --git a/uapi/linux/netlink.h b/uapi/linux/netlink.h
|
||||
index e83e2e3..105b79f 100644
|
||||
--- a/uapi/linux/netlink.h
|
||||
+++ b/uapi/linux/netlink.h
|
||||
@@ -72,6 +72,7 @@ struct nlmsghdr {
|
||||
|
||||
/* Modifiers to DELETE request */
|
||||
#define NLM_F_NONREC 0x100 /* Do not delete recursively */
|
||||
+#define NLM_F_BULK 0x200 /* Delete multiple objects */
|
||||
|
||||
/* Flags for ACK message */
|
||||
#define NLM_F_CAPPED 0x100 /* request was capped */
|
||||
diff --git a/uapi/linux/rtnetlink.h b/uapi/linux/rtnetlink.h
|
||||
index e01efa2..8f874be 100644
|
||||
--- a/uapi/linux/rtnetlink.h
|
||||
+++ b/uapi/linux/rtnetlink.h
|
||||
@@ -146,6 +146,8 @@ enum {
|
||||
#define RTM_NEWSTATS RTM_NEWSTATS
|
||||
RTM_GETSTATS = 94,
|
||||
#define RTM_GETSTATS RTM_GETSTATS
|
||||
+ RTM_SETSTATS,
|
||||
+#define RTM_SETSTATS RTM_SETSTATS
|
||||
|
||||
RTM_NEWCACHEREPORT = 96,
|
||||
#define RTM_NEWCACHEREPORT RTM_NEWCACHEREPORT
|
||||
@@ -185,6 +187,13 @@ enum {
|
||||
RTM_GETNEXTHOPBUCKET,
|
||||
#define RTM_GETNEXTHOPBUCKET RTM_GETNEXTHOPBUCKET
|
||||
|
||||
+ RTM_NEWTUNNEL = 120,
|
||||
+#define RTM_NEWTUNNEL RTM_NEWTUNNEL
|
||||
+ RTM_DELTUNNEL,
|
||||
+#define RTM_DELTUNNEL RTM_DELTUNNEL
|
||||
+ RTM_GETTUNNEL,
|
||||
+#define RTM_GETTUNNEL RTM_GETTUNNEL
|
||||
+
|
||||
__RTM_MAX,
|
||||
#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
|
||||
};
|
||||
@@ -752,6 +761,12 @@ enum rtnetlink_groups {
|
||||
#define RTNLGRP_NEXTHOP RTNLGRP_NEXTHOP
|
||||
RTNLGRP_BRVLAN,
|
||||
#define RTNLGRP_BRVLAN RTNLGRP_BRVLAN
|
||||
+ RTNLGRP_MCTP_IFADDR,
|
||||
+#define RTNLGRP_MCTP_IFADDR RTNLGRP_MCTP_IFADDR
|
||||
+ RTNLGRP_TUNNEL,
|
||||
+#define RTNLGRP_TUNNEL RTNLGRP_TUNNEL
|
||||
+ RTNLGRP_STATS,
|
||||
+#define RTNLGRP_STATS RTNLGRP_STATS
|
||||
__RTNLGRP_MAX
|
||||
};
|
||||
#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
|
||||
@@ -800,6 +815,7 @@ enum {
|
||||
#define RTEXT_FILTER_MRP (1 << 4)
|
||||
#define RTEXT_FILTER_CFM_CONFIG (1 << 5)
|
||||
#define RTEXT_FILTER_CFM_STATUS (1 << 6)
|
||||
+#define RTEXT_FILTER_MST (1 << 7)
|
||||
|
||||
/* End of information exported to user level */
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -0,0 +1,92 @@
|
||||
From 0a0460a0e7c3d862a577fd048375f2ab0a024a97 Mon Sep 17 00:00:00 2001
|
||||
From: Jie Wang <wangjie125@huawei.com>
|
||||
Date: Fri, 29 Apr 2022 17:17:04 +0800
|
||||
Subject: ethtool: add support to get/set tx push by ethtool -G/g
|
||||
|
||||
Currently tx push is a standard feature for NICs such as Mellanox, HNS3.
|
||||
But there is no command to set or get this feature.
|
||||
|
||||
So this patch adds support for "ethtool -G <dev> tx-push on|off" and
|
||||
"ethtool -g <dev>" to set/get tx push mode.
|
||||
|
||||
commit: d772518
|
||||
Reference: https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/commit/?id=d77251806eaa
|
||||
change log: use tab instead of space before [rx-buf-len]; To avoid
|
||||
add other content, add missing content for rx buf len, like ".BN
|
||||
rx\-buf\len"
|
||||
|
||||
Signed-off-by: Jie Wang <wangjie125@huawei.com>
|
||||
---
|
||||
ethtool.8.in | 8 ++++++++
|
||||
ethtool.c | 3 ++-
|
||||
netlink/rings.c | 7 +++++++
|
||||
3 files changed, 17 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/ethtool.8.in b/ethtool.8.in
|
||||
index d2c7e5c..af1c5bc 100644
|
||||
--- a/ethtool.8.in
|
||||
+++ b/ethtool.8.in
|
||||
@@ -198,6 +198,8 @@ ethtool \- query or control network driver and hardware settings
|
||||
.BN rx\-mini
|
||||
.BN rx\-jumbo
|
||||
.BN tx
|
||||
+.BN rx\-buf\-len
|
||||
+.BN tx\-push
|
||||
.HP
|
||||
.B ethtool \-i|\-\-driver
|
||||
.I devname
|
||||
@@ -559,6 +561,12 @@ Changes the number of ring entries for the Rx Jumbo ring.
|
||||
.TP
|
||||
.BI tx \ N
|
||||
Changes the number of ring entries for the Tx ring.
|
||||
+.TP
|
||||
+.BI rx\-buf\-len \ N
|
||||
+Changes the size of a buffer in the Rx ring.
|
||||
+.TP
|
||||
+.BI tx\-push \ on|off
|
||||
+Specifies whether TX push should be enabled.
|
||||
.RE
|
||||
.TP
|
||||
.B \-i \-\-driver
|
||||
diff --git a/ethtool.c b/ethtool.c
|
||||
index 040e911..46250eb 100644
|
||||
--- a/ethtool.c
|
||||
+++ b/ethtool.c
|
||||
@@ -5730,7 +5730,8 @@ static const struct option args[] = {
|
||||
" [ rx-mini N ]\n"
|
||||
" [ rx-jumbo N ]\n"
|
||||
" [ tx N ]\n"
|
||||
- " [ rx-buf-len N]\n"
|
||||
+ " [ rx-buf-len N]\n"
|
||||
+ " [ tx-push on|off]\n"
|
||||
},
|
||||
{
|
||||
.opts = "-k|--show-features|--show-offload",
|
||||
diff --git a/netlink/rings.c b/netlink/rings.c
|
||||
index 119178e..3718c10 100644
|
||||
--- a/netlink/rings.c
|
||||
+++ b/netlink/rings.c
|
||||
@@ -47,6 +47,7 @@ int rings_reply_cb(const struct nlmsghdr *nlhdr, void *data)
|
||||
show_u32(tb[ETHTOOL_A_RINGS_RX_JUMBO], "RX Jumbo:\t");
|
||||
show_u32(tb[ETHTOOL_A_RINGS_TX], "TX:\t\t");
|
||||
show_u32(tb[ETHTOOL_A_RINGS_RX_BUF_LEN], "RX Buf Len:\t\t");
|
||||
+ show_bool("tx-push", "TX Push:\t%s\n", tb[ETHTOOL_A_RINGS_TX_PUSH]);
|
||||
|
||||
return MNL_CB_OK;
|
||||
}
|
||||
@@ -105,6 +106,12 @@ static const struct param_parser sring_params[] = {
|
||||
.handler = nl_parse_direct_u32,
|
||||
.min_argc = 1,
|
||||
},
|
||||
+ {
|
||||
+ .arg = "tx-push",
|
||||
+ .type = ETHTOOL_A_RINGS_TX_PUSH,
|
||||
+ .handler = nl_parse_u8bool,
|
||||
+ .min_argc = 1,
|
||||
+ },
|
||||
{}
|
||||
};
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
||||
12
ethtool.spec
12
ethtool.spec
@ -1,13 +1,17 @@
|
||||
Name: ethtool
|
||||
Epoch: 2
|
||||
Version: 5.15
|
||||
Release: 2
|
||||
Release: 3
|
||||
Summary: Settings tool for Ethernet NICs
|
||||
License: GPLv2
|
||||
URL: https://www.kernel.org/pub/software/network/ethtool
|
||||
Source0: https://www.kernel.org/pub/software/network/%{name}/%{name}-%{version}.tar.xz
|
||||
|
||||
Patch0: backport-ioctl-add-the-memory-free-operation-after-send_ioctl.patch
|
||||
Patch1: 0001-rings-add-support-to-set-get-rx-buf-len.patch
|
||||
Patch2: 0002-tunables-add-support-to-get-set-tx-copybreak-buf-siz.patch
|
||||
Patch3: 0003-update-UAPI-header-copies.patch
|
||||
Patch4: 0004-ethtool-add-support-to-get-set-tx-push-by-ethtool-G-.patch
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: libmnl-devel
|
||||
@ -55,6 +59,12 @@ make check
|
||||
%{_mandir}/man8/%{name}.8*
|
||||
|
||||
%changelog
|
||||
* Tue Sep 20 2022 xiaojiantao <xiaojiantao1@h-partners.com> - 2:5.15-3
|
||||
- Type:requirement
|
||||
- Id:NA
|
||||
- SUG:NA
|
||||
- DESC:add support to set or get rx buf len and tx push by ethtool
|
||||
|
||||
* Fri Sep 02 2022 gaihuiying <eaglgai@163.com> - 2:5.15-2
|
||||
- Type:bugfix
|
||||
- Id:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user