* [PATCH ethtool-next v2 0/2] Add support to get/set tx push by ethtool -G/g @ 2022-04-21 8:46 Guangbin Huang 2022-04-21 8:46 ` [PATCH ethtool-next v2 1/2] update UAPI header copies Guangbin Huang 2022-04-21 8:46 ` [PATCH ethtool-next v2 2/2] ethtool: add support to get/set tx push by ethtool -G/g Guangbin Huang 0 siblings, 2 replies; 7+ messages in thread From: Guangbin Huang @ 2022-04-21 8:46 UTC (permalink / raw) To: mkubecek, davem, kuba; +Cc: netdev, lipeng321, huangguangbin2 From: Jie Wang <wangjie125@huawei.com> These two patches first update uapi headers by using the import shell, then add support to get/set tx push by ethtool -G/g. ChangeLog: v1->v2 1.Update uapi headers by using the import shell scripts. link:https://lore.kernel.org/netdev/20220419125030.3230-1-huangguangbin2@huawei.com/ Jie Wang (2): update UAPI header copies ethtool: add support to get/set tx push by ethtool -G/g ethtool.8.in | 4 ++ ethtool.c | 1 + netlink/rings.c | 7 +++ uapi/linux/ethtool_netlink.h | 9 ++++ uapi/linux/if_link.h | 97 ++++++++++++++++++++++++++++++++++++ uapi/linux/net_tstamp.h | 17 ++++++- uapi/linux/netlink.h | 1 + uapi/linux/rtnetlink.h | 16 ++++++ 8 files changed, 151 insertions(+), 1 deletion(-) -- 2.33.0 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH ethtool-next v2 1/2] update UAPI header copies 2022-04-21 8:46 [PATCH ethtool-next v2 0/2] Add support to get/set tx push by ethtool -G/g Guangbin Huang @ 2022-04-21 8:46 ` Guangbin Huang 2022-04-21 8:46 ` [PATCH ethtool-next v2 2/2] ethtool: add support to get/set tx push by ethtool -G/g Guangbin Huang 1 sibling, 0 replies; 7+ messages in thread From: Guangbin Huang @ 2022-04-21 8:46 UTC (permalink / raw) To: mkubecek, davem, kuba; +Cc: netdev, lipeng321, huangguangbin2 From: Jie Wang <wangjie125@huawei.com> Update to kernel commit cc4bdef26ecd. Signed-off-by: Jie Wang <wangjie125@huawei.com> --- uapi/linux/ethtool_netlink.h | 9 ++++ uapi/linux/if_link.h | 97 ++++++++++++++++++++++++++++++++++++ uapi/linux/net_tstamp.h | 17 ++++++- uapi/linux/netlink.h | 1 + uapi/linux/rtnetlink.h | 16 ++++++ 5 files changed, 139 insertions(+), 1 deletion(-) diff --git a/uapi/linux/ethtool_netlink.h b/uapi/linux/ethtool_netlink.h index d8b19cf..378ad7d 100644 --- a/uapi/linux/ethtool_netlink.h +++ b/uapi/linux/ethtool_netlink.h @@ -318,6 +318,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_* */ @@ -330,6 +336,9 @@ enum { 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 9ed264d..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) @@ -857,6 +931,7 @@ enum { IFLA_BOND_PEER_NOTIF_DELAY, IFLA_BOND_AD_LACP_ACTIVE, IFLA_BOND_MISSED_MAX, + IFLA_BOND_NS_IP6_TARGET, __IFLA_BOND_MAX, }; @@ -1153,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] @@ -1170,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 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH ethtool-next v2 2/2] ethtool: add support to get/set tx push by ethtool -G/g 2022-04-21 8:46 [PATCH ethtool-next v2 0/2] Add support to get/set tx push by ethtool -G/g Guangbin Huang 2022-04-21 8:46 ` [PATCH ethtool-next v2 1/2] update UAPI header copies Guangbin Huang @ 2022-04-21 8:46 ` Guangbin Huang 2022-04-27 13:46 ` sundeep subbaraya 1 sibling, 1 reply; 7+ messages in thread From: Guangbin Huang @ 2022-04-21 8:46 UTC (permalink / raw) To: mkubecek, davem, kuba; +Cc: netdev, lipeng321, huangguangbin2 From: Jie Wang <wangjie125@huawei.com> 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. Signed-off-by: Jie Wang <wangjie125@huawei.com> --- ethtool.8.in | 4 ++++ ethtool.c | 1 + netlink/rings.c | 7 +++++++ 3 files changed, 12 insertions(+) diff --git a/ethtool.8.in b/ethtool.8.in index 12940e1..a87f31f 100644 --- a/ethtool.8.in +++ b/ethtool.8.in @@ -199,6 +199,7 @@ ethtool \- query or control network driver and hardware settings .BN rx\-jumbo .BN tx .BN rx\-buf\-len +.BN tx\-push .HP .B ethtool \-i|\-\-driver .I devname @@ -573,6 +574,9 @@ 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 4f5c234..4d2a475 100644 --- a/ethtool.c +++ b/ethtool.c @@ -5733,6 +5733,7 @@ static const struct option args[] = { " [ rx-jumbo N ]\n" " [ tx 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..a53eed5 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 = 0, + }, {} }; -- 2.33.0 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH ethtool-next v2 2/2] ethtool: add support to get/set tx push by ethtool -G/g 2022-04-21 8:46 ` [PATCH ethtool-next v2 2/2] ethtool: add support to get/set tx push by ethtool -G/g Guangbin Huang @ 2022-04-27 13:46 ` sundeep subbaraya 2022-04-28 11:54 ` wangjie (L) 2022-04-28 11:56 ` wangjie (L) 0 siblings, 2 replies; 7+ messages in thread From: sundeep subbaraya @ 2022-04-27 13:46 UTC (permalink / raw) To: Guangbin Huang Cc: mkubecek, David Miller, Jakub Kicinski, netdev, lipeng321, Subbaraya Sundeep Hi Guangbin, On Thu, Apr 21, 2022 at 3:47 PM Guangbin Huang <huangguangbin2@huawei.com> wrote: > > From: Jie Wang <wangjie125@huawei.com> > > 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. > > Signed-off-by: Jie Wang <wangjie125@huawei.com> > --- > ethtool.8.in | 4 ++++ > ethtool.c | 1 + > netlink/rings.c | 7 +++++++ > 3 files changed, 12 insertions(+) > > diff --git a/ethtool.8.in b/ethtool.8.in > index 12940e1..a87f31f 100644 > --- a/ethtool.8.in > +++ b/ethtool.8.in > @@ -199,6 +199,7 @@ ethtool \- query or control network driver and hardware settings > .BN rx\-jumbo > .BN tx > .BN rx\-buf\-len > +.BN tx\-push > .HP > .B ethtool \-i|\-\-driver > .I devname > @@ -573,6 +574,9 @@ 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 4f5c234..4d2a475 100644 > --- a/ethtool.c > +++ b/ethtool.c > @@ -5733,6 +5733,7 @@ static const struct option args[] = { > " [ rx-jumbo N ]\n" > " [ tx 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..a53eed5 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 = 0, Why min_argc is 0 ? Thanks for syncing kernel headers. I have patch for adding cqe-size command and will send after these are merged. Sundeep > + }, > {} > }; > > -- > 2.33.0 > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH ethtool-next v2 2/2] ethtool: add support to get/set tx push by ethtool -G/g 2022-04-27 13:46 ` sundeep subbaraya @ 2022-04-28 11:54 ` wangjie (L) 2022-04-28 11:56 ` wangjie (L) 1 sibling, 0 replies; 7+ messages in thread From: wangjie (L) @ 2022-04-28 11:54 UTC (permalink / raw) To: sundeep subbaraya, Guangbin Huang Cc: mkubecek, David Miller, Jakub Kicinski, netdev, lipeng321, Subbaraya Sundeep On 2022/4/27 21:46, sundeep subbaraya wrote: > Hi Guangbin, > > On Thu, Apr 21, 2022 at 3:47 PM Guangbin Huang > <huangguangbin2@huawei.com> wrote: >> >> From: Jie Wang <wangjie125@huawei.com> >> >> 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. >> >> Signed-off-by: Jie Wang <wangjie125@huawei.com> >> --- >> ethtool.8.in | 4 ++++ >> ethtool.c | 1 + >> netlink/rings.c | 7 +++++++ >> 3 files changed, 12 insertions(+) >> >> diff --git a/ethtool.8.in b/ethtool.8.in >> index 12940e1..a87f31f 100644 >> --- a/ethtool.8.in >> +++ b/ethtool.8.in >> @@ -199,6 +199,7 @@ ethtool \- query or control network driver and hardware settings >> .BN rx\-jumbo >> .BN tx >> .BN rx\-buf\-len >> +.BN tx\-push >> .HP >> .B ethtool \-i|\-\-driver >> .I devname >> @@ -573,6 +574,9 @@ 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 4f5c234..4d2a475 100644 >> --- a/ethtool.c >> +++ b/ethtool.c >> @@ -5733,6 +5733,7 @@ static const struct option args[] = { >> " [ rx-jumbo N ]\n" >> " [ tx 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..a53eed5 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 = 0, > > Why min_argc is 0 ? Thanks for syncing kernel headers. I have patch for adding > cqe-size command and will send after these are merged. > > Sundeep Good catch. I checked this parameter,it should be 1. I misunderstood the meaning of this parameter. >> + }, >> {} >> }; >> >> -- >> 2.33.0 >> > > . > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH ethtool-next v2 2/2] ethtool: add support to get/set tx push by ethtool -G/g 2022-04-27 13:46 ` sundeep subbaraya 2022-04-28 11:54 ` wangjie (L) @ 2022-04-28 11:56 ` wangjie (L) 1 sibling, 0 replies; 7+ messages in thread From: wangjie (L) @ 2022-04-28 11:56 UTC (permalink / raw) To: sundeep subbaraya, Guangbin Huang Cc: mkubecek, David Miller, Jakub Kicinski, netdev, lipeng321, Subbaraya Sundeep On 2022/4/27 21:46, sundeep subbaraya wrote: > Hi Guangbin, > > On Thu, Apr 21, 2022 at 3:47 PM Guangbin Huang > <huangguangbin2@huawei.com> wrote: >> >> From: Jie Wang <wangjie125@huawei.com> >> >> 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. >> >> Signed-off-by: Jie Wang <wangjie125@huawei.com> >> --- >> ethtool.8.in | 4 ++++ >> ethtool.c | 1 + >> netlink/rings.c | 7 +++++++ >> 3 files changed, 12 insertions(+) >> >> diff --git a/ethtool.8.in b/ethtool.8.in >> index 12940e1..a87f31f 100644 >> --- a/ethtool.8.in >> +++ b/ethtool.8.in >> @@ -199,6 +199,7 @@ ethtool \- query or control network driver and hardware settings >> .BN rx\-jumbo >> .BN tx >> .BN rx\-buf\-len >> +.BN tx\-push >> .HP >> .B ethtool \-i|\-\-driver >> .I devname >> @@ -573,6 +574,9 @@ 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 4f5c234..4d2a475 100644 >> --- a/ethtool.c >> +++ b/ethtool.c >> @@ -5733,6 +5733,7 @@ static const struct option args[] = { >> " [ rx-jumbo N ]\n" >> " [ tx 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..a53eed5 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 = 0, > > Why min_argc is 0 ? Thanks for syncing kernel headers. I have patch for adding > cqe-size command and will send after these are merged. > > Sundeep I will revise it in v2. >> + }, >> {} >> }; >> >> -- >> 2.33.0 >> > > . > ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH ethtool-next v2 0/2] Userspace code for ethtool HW TS statistics @ 2024-04-17 20:38 Rahul Rameshbabu 2024-04-17 20:38 ` [PATCH ethtool-next v2 1/2] update UAPI header copies Rahul Rameshbabu 0 siblings, 1 reply; 7+ messages in thread From: Rahul Rameshbabu @ 2024-04-17 20:38 UTC (permalink / raw) To: netdev Cc: Vadim Fedorenko, Jacob Keller, Paolo Abeni, Jakub Kicinski, David S. Miller, Eric Dumazet, Gal Pressman, Tariq Toukan, Saeed Mahameed, Carolina Jubran, Cosmin Ratiu, Michal Kubecek, Alexandra Winter, Rahul Rameshbabu Adds support for querying statistics related to tsinfo if the kernel supports such statistics. Changes: v1->v2: - Updated UAPI header copy to be based on a valid commit in the net-next tree. Thanks Alexandra Winter <wintera@linux.ibm.com> for the catch. - Refactored logic based on a suggestion from Jakub Kicinski <kuba@kernel.org>. Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com> Link: https://lore.kernel.org/netdev/20240403212931.128541-1-rrameshbabu@nvidia.com/ Link: https://lore.kernel.org/netdev/20240416203723.104062-1-rrameshbabu@nvidia.com/ --- Rahul Rameshbabu (2): update UAPI header copies netlink: tsinfo: add statistics support netlink/tsinfo.c | 65 +++++++++++++++++++++++++++++++++++- uapi/linux/ethtool.h | 64 +++++++++++++++++++++++++++++++++++ uapi/linux/ethtool_netlink.h | 30 +++++++++++++---- uapi/linux/if_link.h | 1 + 4 files changed, 153 insertions(+), 7 deletions(-) -- 2.42.0 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH ethtool-next v2 1/2] update UAPI header copies 2024-04-17 20:38 [PATCH ethtool-next v2 0/2] Userspace code for ethtool HW TS statistics Rahul Rameshbabu @ 2024-04-17 20:38 ` Rahul Rameshbabu 0 siblings, 0 replies; 7+ messages in thread From: Rahul Rameshbabu @ 2024-04-17 20:38 UTC (permalink / raw) To: netdev Cc: Vadim Fedorenko, Jacob Keller, Paolo Abeni, Jakub Kicinski, David S. Miller, Eric Dumazet, Gal Pressman, Tariq Toukan, Saeed Mahameed, Carolina Jubran, Cosmin Ratiu, Michal Kubecek, Alexandra Winter, Rahul Rameshbabu Update to kernel commit 2bd99aef1b19. Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com> Reviewed-by: Carolina Jubran <cjubran@nvidia.com> Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com> --- Notes: Changes: v1->v2: - Updated UAPI header copy to be based on a valid commit in the net-next tree. Thanks Alexandra Winter <wintera@linux.ibm.com> for the catch. uapi/linux/ethtool.h | 64 ++++++++++++++++++++++++++++++++++++ uapi/linux/ethtool_netlink.h | 30 +++++++++++++---- uapi/linux/if_link.h | 1 + 3 files changed, 89 insertions(+), 6 deletions(-) diff --git a/uapi/linux/ethtool.h b/uapi/linux/ethtool.h index 70f2b90..4d1738a 100644 --- a/uapi/linux/ethtool.h +++ b/uapi/linux/ethtool.h @@ -2021,6 +2021,53 @@ static __inline__ int ethtool_validate_duplex(__u8 duplex) #define IPV4_FLOW 0x10 /* hash only */ #define IPV6_FLOW 0x11 /* hash only */ #define ETHER_FLOW 0x12 /* spec only (ether_spec) */ + +/* Used for GTP-U IPv4 and IPv6. + * The format of GTP packets only includes + * elements such as TEID and GTP version. + * It is primarily intended for data communication of the UE. + */ +#define GTPU_V4_FLOW 0x13 /* hash only */ +#define GTPU_V6_FLOW 0x14 /* hash only */ + +/* Use for GTP-C IPv4 and v6. + * The format of these GTP packets does not include TEID. + * Primarily expected to be used for communication + * to create sessions for UE data communication, + * commonly referred to as CSR (Create Session Request). + */ +#define GTPC_V4_FLOW 0x15 /* hash only */ +#define GTPC_V6_FLOW 0x16 /* hash only */ + +/* Use for GTP-C IPv4 and v6. + * Unlike GTPC_V4_FLOW, the format of these GTP packets includes TEID. + * After session creation, it becomes this packet. + * This is mainly used for requests to realize UE handover. + */ +#define GTPC_TEID_V4_FLOW 0x17 /* hash only */ +#define GTPC_TEID_V6_FLOW 0x18 /* hash only */ + +/* Use for GTP-U and extended headers for the PSC (PDU Session Container). + * The format of these GTP packets includes TEID and QFI. + * In 5G communication using UPF (User Plane Function), + * data communication with this extended header is performed. + */ +#define GTPU_EH_V4_FLOW 0x19 /* hash only */ +#define GTPU_EH_V6_FLOW 0x1a /* hash only */ + +/* Use for GTP-U IPv4 and v6 PSC (PDU Session Container) extended headers. + * This differs from GTPU_EH_V(4|6)_FLOW in that it is distinguished by + * UL/DL included in the PSC. + * There are differences in the data included based on Downlink/Uplink, + * and can be used to distinguish packets. + * The functions described so far are useful when you want to + * handle communication from the mobile network in UPF, PGW, etc. + */ +#define GTPU_UL_V4_FLOW 0x1b /* hash only */ +#define GTPU_UL_V6_FLOW 0x1c /* hash only */ +#define GTPU_DL_V4_FLOW 0x1d /* hash only */ +#define GTPU_DL_V6_FLOW 0x1e /* hash only */ + /* Flag to enable additional fields in struct ethtool_rx_flow_spec */ #define FLOW_EXT 0x80000000 #define FLOW_MAC_EXT 0x40000000 @@ -2035,6 +2082,7 @@ static __inline__ int ethtool_validate_duplex(__u8 duplex) #define RXH_IP_DST (1 << 5) #define RXH_L4_B_0_1 (1 << 6) /* src port in case of TCP/UDP/SCTP */ #define RXH_L4_B_2_3 (1 << 7) /* dst port in case of TCP/UDP/SCTP */ +#define RXH_GTP_TEID (1 << 8) /* teid in case of GTP */ #define RXH_DISCARD (1 << 31) #define RX_CLS_FLOW_DISC 0xffffffffffffffffULL @@ -2218,4 +2266,20 @@ struct ethtool_link_settings { * __u32 map_lp_advertising[link_mode_masks_nwords]; */ }; + +/** + * enum phy_upstream - Represents the upstream component a given PHY device + * is connected to, as in what is on the other end of the MII bus. Most PHYs + * will be attached to an Ethernet MAC controller, but in some cases, there's + * an intermediate PHY used as a media-converter, which will driver another + * MII interface as its output. + * @PHY_UPSTREAM_MAC: Upstream component is a MAC (a switch port, + * or ethernet controller) + * @PHY_UPSTREAM_PHY: Upstream component is a PHY (likely a media converter) + */ +enum phy_upstream { + PHY_UPSTREAM_MAC, + PHY_UPSTREAM_PHY, +}; + #endif /* _LINUX_ETHTOOL_H */ diff --git a/uapi/linux/ethtool_netlink.h b/uapi/linux/ethtool_netlink.h index 447d922..2503b26 100644 --- a/uapi/linux/ethtool_netlink.h +++ b/uapi/linux/ethtool_netlink.h @@ -117,12 +117,11 @@ enum { /* request header */ -/* use compact bitsets in reply */ -#define ETHTOOL_FLAG_COMPACT_BITSETS (1 << 0) -/* provide optional reply for SET or ACT requests */ -#define ETHTOOL_FLAG_OMIT_REPLY (1 << 1) -/* request statistics, if supported by the driver */ -#define ETHTOOL_FLAG_STATS (1 << 2) +enum ethtool_header_flags { + ETHTOOL_FLAG_COMPACT_BITSETS = 1 << 0, /* use compact bitsets in reply */ + ETHTOOL_FLAG_OMIT_REPLY = 1 << 1, /* provide optional reply for SET or ACT requests */ + ETHTOOL_FLAG_STATS = 1 << 2, /* request statistics, if supported by the driver */ +}; #define ETHTOOL_FLAG_ALL (ETHTOOL_FLAG_COMPACT_BITSETS | \ ETHTOOL_FLAG_OMIT_REPLY | \ @@ -133,6 +132,7 @@ enum { ETHTOOL_A_HEADER_DEV_INDEX, /* u32 */ ETHTOOL_A_HEADER_DEV_NAME, /* string */ ETHTOOL_A_HEADER_FLAGS, /* u32 - ETHTOOL_FLAG_* */ + ETHTOOL_A_HEADER_PHY_INDEX, /* u32 */ /* add new constants above here */ __ETHTOOL_A_HEADER_CNT, @@ -478,12 +478,26 @@ enum { ETHTOOL_A_TSINFO_TX_TYPES, /* bitset */ ETHTOOL_A_TSINFO_RX_FILTERS, /* bitset */ ETHTOOL_A_TSINFO_PHC_INDEX, /* u32 */ + ETHTOOL_A_TSINFO_STATS, /* nest - _A_TSINFO_STAT */ /* add new constants above here */ __ETHTOOL_A_TSINFO_CNT, ETHTOOL_A_TSINFO_MAX = (__ETHTOOL_A_TSINFO_CNT - 1) }; +enum { + ETHTOOL_A_TS_STAT_UNSPEC, + + ETHTOOL_A_TS_STAT_TX_PKTS, /* uint */ + ETHTOOL_A_TS_STAT_TX_LOST, /* uint */ + ETHTOOL_A_TS_STAT_TX_ERR, /* uint */ + + /* add new constants above here */ + __ETHTOOL_A_TS_STAT_CNT, + ETHTOOL_A_TS_STAT_MAX = (__ETHTOOL_A_TS_STAT_CNT - 1) + +}; + /* PHC VCLOCKS */ enum { @@ -515,6 +529,10 @@ enum { ETHTOOL_A_CABLE_RESULT_CODE_OPEN, ETHTOOL_A_CABLE_RESULT_CODE_SAME_SHORT, ETHTOOL_A_CABLE_RESULT_CODE_CROSS_SHORT, + /* detected reflection caused by the impedance discontinuity between + * a regular 100 Ohm cable and a part with the abnormal impedance value + */ + ETHTOOL_A_CABLE_RESULT_CODE_IMPEDANCE_MISMATCH, }; enum { diff --git a/uapi/linux/if_link.h b/uapi/linux/if_link.h index d17271f..ff4ceea 100644 --- a/uapi/linux/if_link.h +++ b/uapi/linux/if_link.h @@ -1503,6 +1503,7 @@ enum { IFLA_BOND_AD_LACP_ACTIVE, IFLA_BOND_MISSED_MAX, IFLA_BOND_NS_IP6_TARGET, + IFLA_BOND_COUPLED_CONTROL, __IFLA_BOND_MAX, }; -- 2.42.0 ^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-04-17 20:39 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-04-21 8:46 [PATCH ethtool-next v2 0/2] Add support to get/set tx push by ethtool -G/g Guangbin Huang 2022-04-21 8:46 ` [PATCH ethtool-next v2 1/2] update UAPI header copies Guangbin Huang 2022-04-21 8:46 ` [PATCH ethtool-next v2 2/2] ethtool: add support to get/set tx push by ethtool -G/g Guangbin Huang 2022-04-27 13:46 ` sundeep subbaraya 2022-04-28 11:54 ` wangjie (L) 2022-04-28 11:56 ` wangjie (L) 2024-04-17 20:38 [PATCH ethtool-next v2 0/2] Userspace code for ethtool HW TS statistics Rahul Rameshbabu 2024-04-17 20:38 ` [PATCH ethtool-next v2 1/2] update UAPI header copies Rahul Rameshbabu
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.