bnxt_en: implement tcp-data-split and thresh option
Subsystems (9)
v9 cover bnxt_en: implement tcp-data-split and thresh option
This series implements hds-thresh ethtool command.
This series also implements backend of tcp-data-split and hds-thresh ethtool command for bnxt_en driver.
These ethtool commands are mandatory options for device memory TCP.
NICs that use the bnxt_en driver support tcp-data-split feature named HDS(header-data-split).
But there is no implementation for the HDS to enable by ethtool. Only getting the current HDS status is implemented and the HDS is just automatically enabled only when either LRO, HW-GRO, or JUMBO is enabled. The hds_threshold follows the rx-copybreak value but it wasn't changeable.
Currently, bnxt_en driver enables tcp-data-split by default but not always work.
There is hds_threshold value, which indicates that a packet size is larger than this value, a packet will be split into header and data. hds_threshold value has been 256, which is a default value of rx-copybreak value too.
The rx-copybreak value hasn't been allowed to change so the hds_threshold too.
This patchset decouples hds_threshold and rx-copybreak first. and make tcp-data-split, rx-copybreak, and hds-thresh configurable independently.
But the default configuration is the same. The default value of rx-copybreak is 256 and default hds-thresh is also 256.
The behavior of rx-copybreak will probably be changed in almost all drivers. If HDS is not enabled, rx-copybreak copies both header and payload from a page.
But if HDS is enabled, rx-copybreak copies only header from the first page.
Due to this change, it may need to disable(set to 0) rx-copybreak when the HDS is required.
There are several related options.TPA(HW-GRO, LRO), JUMBO, jumbo_thresh(firmware command), and Aggregation Ring.
The aggregation ring is fundamental to these all features. When gro/lro/jumbo packets are received, NIC receives the first packet from the normal ring.
follow packets come from the aggregation ring.
These features are working regardless of HDS.
If HDS is enabled, the first packet contains the header only, and the following packets contain only payload.
So, HW-GRO/LRO is working regardless of HDS.
There is another threshold value, which is jumbo_thresh.
This is very similar to hds_thresh, but jumbo thresh doesn't split header and data.
It just split the first and following data based on length. When NIC receives 1500 sized packet, and jumbo_thresh is 256(default, but follows rx-copybreak),
the first data is 256 and the following packet size is 1500-256.
Before this patch, at least if one of GRO, LRO, and JUMBO flags is enabled, the Aggregation ring will be enabled.
If the Aggregation ring is enabled, both hds_threshold and jumbo_thresh are set to the default value of rx-copybreak.
So, GRO, LRO, JUMBO frames, they larger than 256 bytes, they will be split into header and data if the protocol is TCP or UDP. for the other protocol, jumbo_thresh works instead of hds_thresh.
This means that tcp-data-split relies on the GRO, LRO, and JUMBO flags. But by this patch, tcp-data-split no longer relies on these flags. If the tcp-data-split is enabled, the Aggregation ring will be enabled.
Also, hds_threshold no longer follows rx-copybreak value, it will be set to the hds-thresh value by user-space, but the default value is still 256.
If the protocol is TCP or UDP and the HDS is disabled and Aggregation ring is enabled, a packet will be split into several pieces due to jumbo_thresh.
When single buffer XDP is attached, tcp-data-split is automatically disabled.
LRO, GRO, and JUMBO are tested with BCM57414, BCM57504 and the firmware version is 230.0.157.0.
I couldn't find any specification about minimum and maximum value of hds_threshold, but from my test result, it was about 0 ~ 1023. It means, over 1023 sized packets will be split into header and data if tcp-data-split is enabled regardless of hds_treshold value. When hds_threshold is 1500 and received packet size is 1400, HDS should not be activated, but it is activated.
The maximum value of hds-thresh value is 256 because it
has been working. It was decided very conservatively.
I checked out the tcp-data-split(HDS) works independently of GRO, LRO, JUMBO.
Also, I checked out tcp-data-split should be disabled automatically when XDP is attached and disallowed to enable it again while XDP is attached. I tested ranged values from min to max for hds-thresh and rx-copybreak, and it works.
hds-thresh from 0 to 256, and rx-copybreak 0 to 256.
When testing this patchset, I checked skb->data, skb->data_len, and nr_frags values.
By this patchset, bnxt_en driver supports a force enable tcp-data-split, but it doesn't support for disable tcp-data-split.
When tcp-data-split is explicitly enabled, HDS works always. When tcp-data-split is unknown, it depends on the current configuration of LRO/GRO/JUMBO.
1/10 patch adds a new hds_config member in the ethtool_netdev_state. It indicates that what tcp-data-split value is really updated from userspace.
So the driver can distinguish a passed tcp-data-split value is came from user or driver itself.
2/10 patch adds hds-thresh command in the ethtool.
This threshold value indicates if a received packet size is larger than this threshold, the packet's header and payload will be split. Example:
# ethtool -G <interface name> hds-thresh <value> This option can not be used when tcp-data-split is disabled or not supported. # ethtool -G enp14s0f0np0 tcp-data-split on hds-thresh 256 # ethtool -g enp14s0f0np0 Ring parameters for enp14s0f0np0: Pre-set maximums: ... Current hardware settings: ... TCP data split: on HDS thresh: 256
3/10, 4/10 add condition checks for devmem and ethtool.
If tcp-data-split is disabled or threshold value is not zero, setup of devmem will be failed.
Also, tcp-data-split and hds-thresh will not be changed while devmem is running.
5/10 add condition checks for netdev core.
It disallows setup single buffer XDP program when tcp-data-split is enabled.
6/10 patch implements .{set, get}_tunable() in the bnxt_en. The bnxt_en driver has been supporting the rx-copybreak feature but is not configurable, Only the default rx-copybreak value has been working. So, it changes the bnxt_en driver to be able to configure the rx-copybreak value.
7/10 patch adds an implementation of tcp-data-split ethtool command.
The HDS relies on the Aggregation ring, which is automatically enabled when either LRO, GRO, or large mtu is configured.
So, if the Aggregation ring is enabled, HDS is automatically enabled by it.
8/10 patch adds the implementation of hds-thresh logic in the bnxt_en driver.
The default value is 256, which used to be the default rx-copybreak value.
9/10 add HDS feature implementation for netdevsim.
HDS feature is not common so far. Only a few NICs support this feature. There is no way to test HDS core-API unless we have proper hw NIC. In order to test HDS core-API without hw NIC, netdevsim can be used. It implements HDS control and data plane for netdevsim.
10/10 add selftest for HDS(tcp-data-split and HDS-thresh). The tcp-data-split tests are the same withethtool -G tcp-data-split <on | auto>
HDS-thresh tests are same with ethtool -G eth0 hds-thresh <0 - MAX>
This series is tested with BCM57504 and netdevsim.
v9:
- Rebase on the top of net-next.
v8:
- Make the handling of hds_thresh similar to hds_config. 2/10
- Update comments of hds_thresh and hds_thresh_max. 2/10
- Remove unnecessary setting hds value in the drivers. 8,9/10
- Use ksft_raises. 10/10
- Add Review and Ack tags from Jakub.
v7:
- Reorder patches.
- Add review tag from Jakub. 1/10
- Do not export dev_xdp_sb_prog_count(). 1/10
- Use dev->ethtool->hds members instead of calling ->get_ring_param(). 2/10
- Do not check XDP_SETUP_PROG_HW. 5/10
- return -EBUSY when interface is not running. 6/10.
- Use dev->ethtool->hds_thresh instead of bp->hds_thresh 8/10
- Add datapath implementation. 9/10
- Remove kernel_ethtool_ringparam in the struct nsim_ethtool. 9/10
- Add selftest patch 10/10
v6:
- use hds_config instead of tcp_data_split_mod.
- Disallow to attach XDP when HDS is in use.
- Update ethtool_netlink_generated.h
- Use "HDS" instead of "HEADER_DATA_SPLIT"
- HDS_MAX is changed to 1023.
- Implement netdevsim HDS feature.
- Add Test tags from Andy.
v5:
- Remove netdev_devmem_enabled() and use dev_get_min_mp_channel_count() instead.
- change extack messages
- Drop implementation of device memory TCP for bnxt_en.
- Add Review tags from Mina.
v4:
- Remove min rx-copybreak value.
- Do not support a disable of tcp-data-split by bnxt_en driver.
- Rename from tcp-data-split-thresh to hds-thresh.
- Add ETHTOOL_RING_USE_HDS_THRS flag.
- Add dev_xdp_sb_prog_count() helper.
- Reduce hole in struct bnxt.
- Use ETHTOOL_RING_USE_HDS_THRS in bnxt_en driver.
- Improve condition check.
- Add netdev_devmem_enabled() helper.
- Add netmem_is_pfmemalloc() helper.
- Do not select NET_DEVMEM in Kconfig for bnxt_en driver.
- Pass PP_FLAG_ALLOW_UNREADABLE_NETMEM flag unconditionally.
- Use gfp flag in __bnxt_alloc_rx_netmem() in the last patch.
- Do not add *offset in the __bnxt_alloc_rx_netmem() in the last patch.
- Do not pass queue_idx to bnxt_alloc_rx_page_pool() in the last patch.
- Add Test tag from Stanislav.
- Add Review tag from Brett.
- Add page_pool_recycle_direct_netmem() helper
v3:
- Change headline
- Add condition checks for ethtool and devmem
- Fix documentation
- Move validation of tcp-data-split and thresh from dirver to core API
- Add implementation of device memory TCP for bnxt_en driver
v2:
- Add tcp-data-split-thresh ethtool command
- Implement tcp-data-split-threh in the bnxt_en driver
- Define min/max rx-copybreak value
- Update commit message
Taehee Yoo (10):
net: ethtool: add hds_config member in ethtool_netdev_state
net: ethtool: add support for configuring hds-thresh
net: devmem: add ring parameter filtering
net: ethtool: add ring parameter filtering
net: disallow setup single buffer XDP when tcp-data-split is enabled.
bnxt_en: add support for rx-copybreak ethtool command
bnxt_en: add support for tcp-data-split ethtool command
bnxt_en: add support for hds-thresh ethtool command
netdevsim: add HDS feature
selftest: net-drv: hds: add test for HDS feature
Documentation/netlink/specs/ethtool.yaml | 8 ++ Documentation/networking/ethtool-netlink.rst | 10 ++ drivers/net/ethernet/broadcom/bnxt/bnxt.c | 32 +++-- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 12 +- .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 68 +++++++++- drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 4 + drivers/net/netdevsim/ethtool.c | 12 +- drivers/net/netdevsim/netdev.c | 9 ++ drivers/net/netdevsim/netdevsim.h | 3 + include/linux/ethtool.h | 11 ++ include/linux/netdevice.h | 1 + .../uapi/linux/ethtool_netlink_generated.h | 2 + net/core/dev.c | 27 ++++ net/core/devmem.c | 11 ++ net/ethtool/netlink.h | 2 +- net/ethtool/rings.c | 51 +++++++- tools/testing/selftests/drivers/net/Makefile | 1 + tools/testing/selftests/drivers/net/hds.py | 120 ++++++++++++++++++ 18 files changed, 363 insertions(+), 21 deletions(-) create mode 100755 tools/testing/selftests/drivers/net/hds.py
Signature · 1 line
2.34.1
PATCH v9 1/10 net: ethtool: add hds_config member in ethtool_netdev_state
When tcp-data-split is UNKNOWN mode, drivers arbitrarily handle it. For example, bnxt_en driver automatically enables if at least one of LRO/GRO/JUMBO is enabled.
If tcp-data-split is UNKNOWN and LRO is enabled, a driver returns ENABLES of tcp-data-split, not UNKNOWN.
So, ethtool -g eth0 shows tcp-data-split is enabled.
The problem is in the setting situation.
In the ethnl_set_rings(), it first calls get_ringparam() to get the current driver's config.
At that moment, if driver's tcp-data-split config is UNKNOWN, it returns ENABLE if LRO/GRO/JUMBO is enabled.
Then, it sets values from the user and driver's current config to kernel_ethtool_ringparam.
Last it calls .set_ringparam().
The driver, especially bnxt_en driver receives ETHTOOL_TCP_DATA_SPLIT_ENABLED.
But it can't distinguish whether it is set by the user or just the current config.
When user updates ring parameter, the new hds_config value is updated and current hds_config value is stored to old_hdsconfig. Driver's .set_ringparam() callback can distinguish a passed tcp-data-split value is came from user explicitly.
If .set_ringparam() is failed, hds_config is rollbacked immediately.
---
v9:
- No changes.
v8:
- No changes.
v7:
- Add review tag from Jakub.
- Add dev_xdp_sb_prog_count().
v6:
- use hds_config instead of using tcp_data_split_mod.
v5:
- Patch added.
include/linux/ethtool.h | 2 ++ include/linux/netdevice.h | 1 + net/core/dev.c | 12 ++++++++++++ net/ethtool/rings.c | 12 ++++++++++++ 4 files changed, 27 insertions(+)
include/linux/ethtool.h +2 -0
@@ -1157,12 +1157,14 @@ int ethtool_virtdev_set_link_ksettings(struct net_device *dev,* @rss_ctx: XArray of custom RSS contexts * @rss_lock: Protects entries in @rss_ctx. May be taken from * within RTNL. +* @hds_config: HDS value from userspace. * @wol_enabled: Wake-on-LAN is enabled * @module_fw_flash_in_progress: Module firmware flashing is in progress. */ struct ethtool_netdev_state {struct xarray rss_ctx;struct mutex rss_lock; +u8 hds_config;unsigned wol_enabled:1 ;unsigned module_fw_flash_in_progress:1 ; };
include/linux/netdevice.h +1 -0
@@ -4082,6 +4082,7 @@ struct sk_buff *dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,int bpf_xdp_link_attach (const union bpf_attr *attr,struct bpf_prog *prog);u8 dev_xdp_prog_count (struct net_device *dev);int dev_xdp_propagate (struct net_device *dev,struct netdev_bpf *bpf); +u8 dev_xdp_sb_prog_count (struct net_device *dev);u32 dev_xdp_prog_id (struct net_device *dev,enum bpf_xdp_mode mode);u32 dev_get_min_mp_channel_count (const struct net_device *dev);
net/core/dev.c +12 -0
@@ -9550,6 +9550,18 @@ u8 dev_xdp_prog_count(struct net_device *dev) }EXPORT_SYMBOL_GPL (dev_xdp_prog_count); +u8 dev_xdp_sb_prog_count (struct net_device *dev) +{ +u8 count =0 ; +int i; + +for (i =0 ; i < __MAX_XDP_MODE; i++) +if (dev->xdp_state[i].prog && + !dev->xdp_state[i].prog->aux->xdp_has_frags) + count++; +return count; +} +int dev_xdp_propagate (struct net_device *dev,struct netdev_bpf *bpf) {if (!dev->netdev_ops->ndo_bpf)
net/ethtool/rings.c +12 -0
@@ -203,6 +203,7 @@ ethnl_set_rings(struct ethnl_req_info *req_info, struct genl_info *info) dev->ethtool_ops->get_ringparam (dev, &ringparam, &kernel_ringparam, info->extack); + kernel_ringparam.tcp_data_split = dev->ethtool->hds_config;ethnl_update_u32 (&ringparam.rx_pending, tb[ETHTOOL_A_RINGS_RX ], &mod); ethnl_update_u32(&ringparam.rx_mini_pending,
@@ -225,6 +226,14 @@ ethnl_set_rings(struct ethnl_req_info *req_info, struct genl_info *info)if (!mod)return 0 ; +if (kernel_ringparam.tcp_data_split ==ETHTOOL_TCP_DATA_SPLIT_ENABLED && +dev_xdp_sb_prog_count (dev)) { +NL_SET_ERR_MSG_ATTR (info->extack, + tb[ETHTOOL_A_RINGS_TCP_DATA_SPLIT ], +"tcp-data-split can not be enabled with single buffer XDP" ); +return -EINVAL ; + } +/* ensure new ring parameters are within limits */ if (ringparam.rx_pending > ringparam.rx_max_pending) err_attr = tb[ETHTOOL_A_RINGS_RX ];
@@ -252,6 +261,9 @@ ethnl_set_rings(struct ethnl_req_info *req_info, struct genl_info *info) ret = dev->ethtool_ops->set_ringparam (dev, &ringparam, &kernel_ringparam, info->extack); +if (!ret) + dev->ethtool->hds_config = kernel_ringparam.tcp_data_split; +return ret <0 ? ret :1 ; }
Signature · 1 line
2.34.1
PATCH v9 2/10 net: ethtool: add support for configuring hds-thresh
In reply to Taehee YooThe hds-thresh option configures the threshold value of
the header-data-split.
If a received packet size is larger than this threshold value, a packet will be split into header and payload.
The header indicates TCP and UDP header, but it depends on driver spec. The bnxt_en driver supports HDS(Header-Data-Split) configuration at FW level, affecting TCP and UDP too.
So, If hds-thresh is set, it affects UDP and TCP packets.
Example:
# ethtool -G <interface name> hds-thresh <value>
# ethtool -G enp14s0f0np0 tcp-data-split on hds-thresh 256 # ethtool -g enp14s0f0np0 Ring parameters for enp14s0f0np0: Pre-set maximums: ... HDS thresh: 1023 Current hardware settings: ... TCP data split: on HDS thresh: 256
The default/min/max values are not defined in the ethtool so the drivers should define themself.
The 0 value means that all TCP/UDP packets' header and payload will be split.
---
v9:
- No changes.
v8:
- Make the handling of hds_thresh similar to hds_config.
- Update comments of hds_thresh and hds_thresh_max.
v7:
- Do not export dev_xdp_sb_prog_count().
- Remove dev_xdp_sb_prog_count().
- Use NL_SET_ERR_MSG_ATTR() instead of NL_SET_ERR_MSG().
- Change location of hds-thresh size check logic.
v6:
- Update ethtool_netlink_generated.h
- Use "HDS" instead of "HEADER_DATA_SPLIT"
- Add Test tag from Andy.
v5:
- No changes.
v4:
- Fix 80 charactor wrap.
- Rename from tcp-data-split-thresh to header-data-split-thresh
- Add description about overhead of HDS.
- Add ETHTOOL_RING_USE_HDS_THRS flag.
- Add dev_xdp_sb_prog_count() helper.
- Add Test tag from Stanislav.
v3:
- Fix documentation and ynl
- Update error messages
- Validate configuration of tcp-data-split and tcp-data-split-thresh
v2:
- Patch added.
Documentation/netlink/specs/ethtool.yaml | 8 ++++++ Documentation/networking/ethtool-netlink.rst | 10 +++++++ include/linux/ethtool.h | 9 ++++++ .../uapi/linux/ethtool_netlink_generated.h | 2 ++ net/ethtool/netlink.h | 2 +- net/ethtool/rings.c | 28 +++++++++++++++++-- 6 files changed, 55 insertions(+), 4 deletions(-)
Documentation/netlink/specs/ethtool.yaml +8 -0
@@ -332,6 +332,12 @@ attribute-sets: - name: tx-push-buf-len-max type: u32 + - + name: hds-thresh + type: u32 + - + name: hds-thresh-max + type: u32 - name: mm-stat
@@ -1777,6 +1783,8 @@ operations: - rx-push - tx-push-buf-len - tx-push-buf-len-max + - hds-thresh + - hds-thresh-max dump: *ring-get-op - name: rings-set
Documentation/networking/ethtool-netlink.rst +10 -0
@@ -899,6 +899,10 @@ Kernel response contents: ``ETHTOOL_A_RINGS_RX_PUSH`` u8 flag of RX Push mode ``ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN`` u32 size of TX push buffer ``ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN_MAX`` u32 max size of TX push buffer + ``ETHTOOL_A_RINGS_HDS_THRESH`` u32 threshold of + header / data split + ``ETHTOOL_A_RINGS_HDS_THRESH_MAX`` u32 max threshold of + header / data split ======================================= ====== =========================== ``ETHTOOL_A_RINGS_TCP_DATA_SPLIT`` indicates whether the device is usable with
@@ -941,10 +945,12 @@ Request contents: ``ETHTOOL_A_RINGS_RX_JUMBO`` u32 size of RX jumbo ring ``ETHTOOL_A_RINGS_TX`` u32 size of TX ring ``ETHTOOL_A_RINGS_RX_BUF_LEN`` u32 size of buffers on the ring + ``ETHTOOL_A_RINGS_TCP_DATA_SPLIT`` u8 TCP header / data split ``ETHTOOL_A_RINGS_CQE_SIZE`` u32 Size of TX/RX CQE ``ETHTOOL_A_RINGS_TX_PUSH`` u8 flag of TX Push mode ``ETHTOOL_A_RINGS_RX_PUSH`` u8 flag of RX Push mode ``ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN`` u32 size of TX push buffer + ``ETHTOOL_A_RINGS_HDS_THRESH`` u32 threshold of header / data split ==================================== ====== =========================== Kernel checks that requested ring sizes do not exceed limits reported by
@@ -961,6 +967,10 @@ A bigger CQE can have more receive buffer pointers, and in turn the NIC can transfer a bigger frame from wire. Based on the NIC hardware, the overall completion queue size can be adjusted in the driver if CQE size is modified. +``ETHTOOL_A_RINGS_HDS_THRESH`` specifies the threshold value of +header / data split feature. If a received packet size is larger than this +threshold value, header and data will be split. + CHANNELS_GET ============
include/linux/ethtool.h +9 -0
@@ -78,6 +78,9 @@ enum {* @cqe_size: Size of TX/RX completion queue event * @tx_push_buf_len: Size of TX push buffer * @tx_push_buf_max_len: Maximum allowed size of TX push buffer +* @hds_thresh: Packet size threshold for header data split (HDS) +* @hds_thresh_max: Maximum supported setting for @hds_threshold +* */ struct kernel_ethtool_ringparam {u32 rx_buf_len;
@@ -87,6 +90,8 @@ struct kernel_ethtool_ringparam {u32 cqe_size;u32 tx_push_buf_len;u32 tx_push_buf_max_len; +u32 hds_thresh; +u32 hds_thresh_max; };/**
@@ -97,6 +102,7 @@ struct kernel_ethtool_ringparam {* @ETHTOOL_RING_USE_RX_PUSH: capture for setting rx_push * @ETHTOOL_RING_USE_TX_PUSH_BUF_LEN: capture for setting tx_push_buf_len * @ETHTOOL_RING_USE_TCP_DATA_SPLIT: capture for setting tcp_data_split +* @ETHTOOL_RING_USE_HDS_THRS: capture for setting header-data-split-thresh */ enum ethtool_supported_ring_param {ETHTOOL_RING_USE_RX_BUF_LEN =BIT (0 ),
@@ -105,6 +111,7 @@ enum ethtool_supported_ring_param {ETHTOOL_RING_USE_RX_PUSH =BIT (3 ),ETHTOOL_RING_USE_TX_PUSH_BUF_LEN =BIT (4 ),ETHTOOL_RING_USE_TCP_DATA_SPLIT =BIT (5 ), + ETHTOOL_RING_USE_HDS_THRS = BIT(6), };#define __ETH_RSS_HASH_BIT (bit) ((u32)1 << (bit))
@@ -1157,6 +1164,7 @@ int ethtool_virtdev_set_link_ksettings(struct net_device *dev,* @rss_ctx: XArray of custom RSS contexts * @rss_lock: Protects entries in @rss_ctx. May be taken from * within RTNL. +* @hds_thresh: HDS Threshold value. * @hds_config: HDS value from userspace. * @wol_enabled: Wake-on-LAN is enabled * @module_fw_flash_in_progress: Module firmware flashing is in progress.
@@ -1164,6 +1172,7 @@ int ethtool_virtdev_set_link_ksettings(struct net_device *dev,struct ethtool_netdev_state {struct xarray rss_ctx;struct mutex rss_lock; +u32 hds_thresh;u8 hds_config;unsigned wol_enabled:1 ;unsigned module_fw_flash_in_progress:1 ;
include/uapi/linux/ethtool_netlink_generated.h +2 -0
@@ -155,6 +155,8 @@ enum {ETHTOOL_A_RINGS_RX_PUSH ,ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN ,ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN_MAX , +ETHTOOL_A_RINGS_HDS_THRESH , +ETHTOOL_A_RINGS_HDS_THRESH_MAX , __ETHTOOL_A_RINGS_CNT,ETHTOOL_A_RINGS_MAX = (__ETHTOOL_A_RINGS_CNT -1 )
net/ethtool/netlink.h +1 -1
@@ -456,7 +456,7 @@ extern const struct nla_policy ethnl_features_set_policy[ETHTOOL_A_FEATURES_WANTextern const struct nla_policy ethnl_privflags_get_policy[ETHTOOL_A_PRIVFLAGS_HEADER +1 ];extern const struct nla_policy ethnl_privflags_set_policy[ETHTOOL_A_PRIVFLAGS_FLAGS +1 ];extern const struct nla_policy ethnl_rings_get_policy[ETHTOOL_A_RINGS_HEADER +1 ]; -extern const struct nla_policy ethnl_rings_set_policy[ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN_MAX +1 ]; +extern const struct nla_policy ethnl_rings_set_policy[ETHTOOL_A_RINGS_HDS_THRESH_MAX +1 ];extern const struct nla_policy ethnl_channels_get_policy[ETHTOOL_A_CHANNELS_HEADER +1 ];extern const struct nla_policy ethnl_channels_set_policy[ETHTOOL_A_CHANNELS_COMBINED_COUNT +1 ];extern const struct nla_policy ethnl_coalesce_get_policy[ETHTOOL_A_COALESCE_HEADER +1 ];
net/ethtool/rings.c +25 -3
@@ -61,7 +61,9 @@ static int rings_reply_size(const struct ethnl_req_info *req_base,nla_total_size (sizeof (u8)) +/* _RINGS_TX_PUSH */ nla_total_size(sizeof(u8))) + /* _RINGS_RX_PUSH */nla_total_size (sizeof (u32)) +/* _RINGS_TX_PUSH_BUF_LEN */ -nla_total_size (sizeof (u32));/* _RINGS_TX_PUSH_BUF_LEN_MAX */ +nla_total_size (sizeof (u32)) +/* _RINGS_TX_PUSH_BUF_LEN_MAX */ +nla_total_size (sizeof (u32)) +/* _RINGS_HDS_THRESH */ +nla_total_size (sizeof (u32));/* _RINGS_HDS_THRESH_MAX*/ } static int rings_fill_reply(struct sk_buff *skb,
@@ -108,7 +110,12 @@ static int rings_fill_reply(struct sk_buff *skb, (nla_put_u32 (skb,ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN_MAX , kr->tx_push_buf_max_len) ||nla_put_u32 (skb,ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN , - kr->tx_push_buf_len)))) + kr->tx_push_buf_len))) || + ((supported_ring_params ÐTOOL_RING_USE_HDS_THRS ) && + (nla_put_u32 (skb,ETHTOOL_A_RINGS_HDS_THRESH , + kr->hds_thresh) || +nla_put_u32 (skb,ETHTOOL_A_RINGS_HDS_THRESH_MAX , + kr->hds_thresh_max)))) return -EMSGSIZE;return 0 ;
@@ -130,6 +137,7 @@ const struct nla_policy ethnl_rings_set_policy[] = { [ETHTOOL_A_RINGS_TX_PUSH] = NLA_POLICY_MAX(NLA_U8, 1), [ETHTOOL_A_RINGS_RX_PUSH] = NLA_POLICY_MAX(NLA_U8, 1), [ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN] = { .type = NLA_U32 }, + [ETHTOOL_A_RINGS_HDS_THRESH] = { .type = NLA_U32 }, }; static int
@@ -155,6 +163,14 @@ ethnl_set_rings_validate(struct ethnl_req_info *req_info,return -EOPNOTSUPP ; } +if (tb[ETHTOOL_A_RINGS_HDS_THRESH ] && + !(ops->supported_ring_params ÐTOOL_RING_USE_HDS_THRS )) { +NL_SET_ERR_MSG_ATTR (info->extack, + tb[ETHTOOL_A_RINGS_HDS_THRESH ], +"setting hds-thresh is not supported" ); +return -EOPNOTSUPP ; + } +if (tb[ETHTOOL_A_RINGS_CQE_SIZE ] && !(ops->supported_ring_params ÐTOOL_RING_USE_CQE_SIZE )) { NL_SET_ERR_MSG_ATTR(info->extack,
@@ -223,6 +239,8 @@ ethnl_set_rings(struct ethnl_req_info *req_info, struct genl_info *info) tb[ETHTOOL_A_RINGS_RX_PUSH], &mod);ethnl_update_u32 (&kernel_ringparam.tx_push_buf_len, tb[ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN ], &mod); +ethnl_update_u32 (&kernel_ringparam.hds_thresh, + tb[ETHTOOL_A_RINGS_HDS_THRESH ], &mod);if (!mod)return 0 ;
@@ -243,6 +261,8 @@ ethnl_set_rings(struct ethnl_req_info *req_info, struct genl_info *info) err_attr = tb[ETHTOOL_A_RINGS_RX_JUMBO ]; else if (ringparam.tx_pending > ringparam.tx_max_pending) err_attr = tb[ETHTOOL_A_RINGS_TX ]; + else if (kernel_ringparam.hds_thresh > kernel_ringparam.hds_thresh_max) + err_attr = tb[ETHTOOL_A_RINGS_HDS_THRESH ]; else err_attr =NULL ;if (err_attr) {
@@ -261,8 +281,10 @@ ethnl_set_rings(struct ethnl_req_info *req_info, struct genl_info *info) ret = dev->ethtool_ops->set_ringparam (dev, &ringparam, &kernel_ringparam, info->extack); -if (!ret) +if (!ret) { dev->ethtool->hds_config = kernel_ringparam.tcp_data_split; + dev->ethtool->hds_thresh = kernel_ringparam.hds_thresh; + }return ret <0 ? ret :1 ; }
Signature · 1 line
2.34.1
PATCH v9 3/10 net: devmem: add ring parameter filtering
In reply to Taehee YooIf driver doesn't support ring parameter or tcp-data-split configuration is not sufficient, the devmem should not be set up.
Before setup the devmem, tcp-data-split should be ON and hds-thresh value should be 0.
---
v9:
- No changes.
v8:
- No changes.
v7:
- Use dev->ethtool->hds members instead of calling ->get_ring_param().
v6:
- No changes.
v5:
- Add Review tag from Mina.
v4:
- Check condition before __netif_get_rx_queue().
- Separate condition check.
- Add Test tag from Stanislav.
v3:
- Patch added.
net/core/devmem.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
net/core/devmem.c +11 -0
@@ -8,6 +8,7 @@*/ #include <linux/dma-buf.h> +#include <linux/ethtool_netlink.h> #include <linux/genalloc.h> #include <linux/mm.h> #include <linux/netdevice.h>
@@ -140,6 +141,16 @@ int net_devmem_bind_dmabuf_to_queue(struct net_device *dev, u32 rxq_idx,return -ERANGE ; } +if (dev->ethtool->hds_config !=ETHTOOL_TCP_DATA_SPLIT_ENABLED ) { +NL_SET_ERR_MSG (extack,"tcp-data-split is disabled" ); +return -EINVAL ; + } + +if (dev->ethtool->hds_thresh) { +NL_SET_ERR_MSG (extack,"hds-thresh is not zero" ); +return -EINVAL ; + } + rxq =__netif_get_rx_queue (dev, rxq_idx);if (rxq->mp_params.mp_priv) {NL_SET_ERR_MSG (extack,"designated queue already memory provider bound" );
Signature · 1 line
2.34.1
PATCH v9 4/10 net: ethtool: add ring parameter filtering
In reply to Taehee YooWhile the devmem is running, the tcp-data-split and hds-thresh configuration should not be changed.
If user tries to change tcp-data-split and threshold value while the devmem is running, it fails and shows extack message.
---
v9:
- No changes.
v8:
- Add Review tag from Jakub.
v7:
- Use dev->ethtool->hds members instead of calling ->get_ring_param().
v6:
- No changes.
v5:
- Add Review tag from Mina.
v4:
- Check condition before __netif_get_rx_queue().
- Separate condition check.
- Add Test tag from Stanislav.
v3:
- Patch added.
net/ethtool/rings.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
net/ethtool/rings.c +13 -0
@@ -252,6 +252,19 @@ ethnl_set_rings(struct ethnl_req_info *req_info, struct genl_info *info)return -EINVAL ; } +if (dev_get_min_mp_channel_count (dev)) { +if (kernel_ringparam.tcp_data_split != +ETHTOOL_TCP_DATA_SPLIT_ENABLED ) { +NL_SET_ERR_MSG (info->extack, +"can't disable tcp-data-split while device has memory provider enabled" ); +return -EINVAL ; + }else if (kernel_ringparam.hds_thresh) { +NL_SET_ERR_MSG (info->extack, +"can't set non-zero hds_thresh while device is memory provider enabled" ); +return -EINVAL ; + } + } +/* ensure new ring parameters are within limits */ if (ringparam.rx_pending > ringparam.rx_max_pending) err_attr = tb[ETHTOOL_A_RINGS_RX ];
Signature · 1 line
2.34.1
PATCH v9 5/10 net: disallow setup single buffer XDP when tcp-data-split is enabled.
In reply to Taehee YooWhen a single buffer XDP is attached, NIC should guarantee only single page packets will be received.
tcp-data-split feature splits packets into header and payload. single buffer XDP can't handle it properly.
So attaching single buffer XDP should be disallowed when tcp-data-split is enabled.
---
v9:
- No changes.
v8:
- Add Ack tag from Jakub.
v7:
- Do not check XDP_SETUP_PROG_HW.
v6:
- Patch added.
net/core/dev.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
net/core/dev.c +15 -0
@@ -92,6 +92,7 @@#include <linux/netdevice.h> #include <linux/etherdevice.h> #include <linux/ethtool.h> +#include <linux/ethtool_netlink.h> #include <linux/skbuff.h> #include <linux/kthread.h> #include <linux/bpf.h>
@@ -9567,6 +9568,14 @@ int dev_xdp_propagate(struct net_device *dev, struct netdev_bpf *bpf)if (!dev->netdev_ops->ndo_bpf)return -EOPNOTSUPP ; +if (dev->ethtool->hds_config ==ETHTOOL_TCP_DATA_SPLIT_ENABLED && + bpf->command ==XDP_SETUP_PROG && + bpf->prog && !bpf->prog->aux->xdp_has_frags) { +NL_SET_ERR_MSG (bpf->extack, +"unable to propagate XDP to device using tcp-data-split" ); +return -EBUSY ; + } +if (dev_get_min_mp_channel_count (dev)) {NL_SET_ERR_MSG (bpf->extack,"unable to propagate XDP to device using memory provider" );return -EBUSY ;
@@ -9604,6 +9613,12 @@ static int dev_xdp_install(struct net_device *dev, enum bpf_xdp_mode mode,struct netdev_bpf xdp;int err; +if (dev->ethtool->hds_config ==ETHTOOL_TCP_DATA_SPLIT_ENABLED && + prog && !prog->aux->xdp_has_frags) { +NL_SET_ERR_MSG (extack,"unable to install XDP to device using tcp-data-split" ); +return -EBUSY ; + } +if (dev_get_min_mp_channel_count (dev)) {NL_SET_ERR_MSG (extack,"unable to install XDP to device using memory provider" );return -EBUSY ;
Signature · 1 line
2.34.1
PATCH v9 6/10 bnxt_en: add support for rx-copybreak ethtool command
In reply to Taehee YooThe bnxt_en driver supports rx-copybreak, but it couldn't be set by userspace. Only the default value(256) has worked.
This patch makes the bnxt_en driver support following command. ethtool --set-tunable <devname> rx-copybreak <value> and ethtool --get-tunable <devname> rx-copybreak.
By this patch, hds_threshol is set to the rx-copybreak value. But it will be set by ethtool -G eth0 hds-thresh N in the next patch.
---
v9:
- No changes.
v8:
- Add Review tag from Jakub.
v7:
- return -EBUSY when interface is not running.
v6:
- No changes.
v5:
- Do not set HDS if XDP is attached.
- rx_size and pkt_size are always bigger than 256.
v4:
- Remove min rx-copybreak value.
- Add Review tag from Brett.
- Add Test tag from Stanislav.
v3:
- Update copybreak value after closing nic and before opening nic when the device is running.
v2:
- Define max/vim rx_copybreak value.
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 28 +++++++----- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 5 ++- .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 44 ++++++++++++++++++- 3 files changed, 63 insertions(+), 14 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +16 -12
@@ -81,7 +81,6 @@ MODULE_DESCRIPTION("Broadcom NetXtreme network driver");#define BNXT_RX_OFFSET (NET_SKB_PAD + NET_IP_ALIGN)#define BNXT_RX_DMA_OFFSET NET_SKB_PAD -#define BNXT_RX_COPY_THRESH 256#define BNXT_TX_PUSH_THRESH 164
@@ -1343,13 +1342,13 @@ static struct sk_buff *bnxt_copy_data(struct bnxt_napi *bnapi, u8 *data,if (!skb)return NULL ; -dma_sync_single_for_cpu (&pdev->dev, mapping, bp->rx_copy_thresh, +dma_sync_single_for_cpu (&pdev->dev, mapping, bp->rx_copybreak, bp->rx_dir);memcpy (skb->data -NET_IP_ALIGN , data -NET_IP_ALIGN , len +NET_IP_ALIGN ); -dma_sync_single_for_device (&pdev->dev, mapping, bp->rx_copy_thresh, +dma_sync_single_for_device (&pdev->dev, mapping, bp->rx_copybreak, bp->rx_dir);skb_put (skb, len);
@@ -1842,7 +1841,7 @@ static inline struct sk_buff *bnxt_tpa_end(struct bnxt *bp,return NULL ; } -if (len <= bp->rx_copy_thresh) { +if (len <= bp->rx_copybreak) { skb =bnxt_copy_skb (bnapi, data_ptr, len, mapping);if (!skb) {bnxt_abort_tpa (cpr, idx, agg_bufs);
@@ -2176,7 +2175,7 @@ static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr, } } -if (len <= bp->rx_copy_thresh) { +if (len <= bp->rx_copybreak) {if (!xdp_active) skb =bnxt_copy_skb (bnapi, data_ptr, len, dma_addr);else
@@ -4608,6 +4607,11 @@ void bnxt_set_tpa_flags(struct bnxt *bp) bp->flags |=BNXT_FLAG_GRO ; } +static void bnxt_init_ring_params (struct bnxt *bp) +{ + bp->rx_copybreak =BNXT_DEFAULT_RX_COPYBREAK ; +} +/* bp->rx_ring_size, bp->tx_ring_size, dev->mtu, BNXT_FLAG_{G|L}RO flags must * be set on entry. */
@@ -4622,7 +4626,6 @@ void bnxt_set_ring_params(struct bnxt *bp) rx_space = rx_size +ALIGN (max (NET_SKB_PAD ,XDP_PACKET_HEADROOM ),8 ) +SKB_DATA_ALIGN (sizeof (struct skb_shared_info )); - bp->rx_copy_thresh =BNXT_RX_COPY_THRESH ; ring_size = bp->rx_ring_size; bp->rx_agg_ring_size =0 ; bp->rx_agg_nr_pages =0 ;
@@ -4667,7 +4670,9 @@ void bnxt_set_ring_params(struct bnxt *bp)ALIGN (max (NET_SKB_PAD ,XDP_PACKET_HEADROOM ),8 ) -SKB_DATA_ALIGN (sizeof (struct skb_shared_info )); }else { - rx_size =SKB_DATA_ALIGN (BNXT_RX_COPY_THRESH +NET_IP_ALIGN ); + rx_size =SKB_DATA_ALIGN (max (BNXT_DEFAULT_RX_COPYBREAK , + bp->rx_copybreak) + +NET_IP_ALIGN ); rx_space = rx_size +NET_SKB_PAD +SKB_DATA_ALIGN (sizeof (struct skb_shared_info )); }
@@ -6573,16 +6578,14 @@ static int bnxt_hwrm_vnic_set_hds(struct bnxt *bp, struct bnxt_vnic_info *vnic) req->flags =cpu_to_le32 (VNIC_PLCMODES_CFG_REQ_FLAGS_JUMBO_PLACEMENT ); req->enables =cpu_to_le32 (VNIC_PLCMODES_CFG_REQ_ENABLES_JUMBO_THRESH_VALID ); + req->jumbo_thresh =cpu_to_le16 (bp->rx_buf_use_size); -if (BNXT_RX_PAGE_MODE (bp)) { - req->jumbo_thresh =cpu_to_le16 (bp->rx_buf_use_size); - }else { +if (!BNXT_RX_PAGE_MODE (bp) && (bp->flags &BNXT_FLAG_AGG_RINGS )) { req->flags |=cpu_to_le32 (VNIC_PLCMODES_CFG_REQ_FLAGS_HDS_IPV4 |VNIC_PLCMODES_CFG_REQ_FLAGS_HDS_IPV6 ); req->enables |=cpu_to_le32 (VNIC_PLCMODES_CFG_REQ_ENABLES_HDS_THRESHOLD_VALID ); - req->jumbo_thresh =cpu_to_le16 (bp->rx_copy_thresh); - req->hds_threshold =cpu_to_le16 (bp->rx_copy_thresh); + req->hds_threshold =cpu_to_le16 (bp->rx_copybreak); } req->vnic_id =cpu_to_le32 (vnic->fw_vnic_id);return hwrm_req_send (bp, req);
@@ -16261,6 +16264,7 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)bnxt_init_l2_fltr_tbl (bp);bnxt_set_rx_skb_mode (bp, false);bnxt_set_tpa_flags (bp); +bnxt_init_ring_params (bp);bnxt_set_ring_params (bp);bnxt_rdma_aux_device_init (bp); rc =bnxt_set_dflt_rings (bp, true);
drivers/net/ethernet/broadcom/bnxt/bnxt.h +4 -1
@@ -34,6 +34,9 @@#include <linux/firmware/broadcom/tee_bnxt_fw.h> #endif +#define BNXT_DEFAULT_RX_COPYBREAK 256 +#define BNXT_MAX_RX_COPYBREAK 1024 +extern struct list_head bnxt_block_cb_list;struct page_pool ;
@@ -2347,7 +2350,7 @@ struct bnxt {enum dma_data_direction rx_dir;u32 rx_ring_size;u32 rx_agg_ring_size; -u32 rx_copy_thresh; +u32 rx_copybreak;u32 rx_ring_mask;u32 rx_agg_ring_mask;int rx_nr_pages;
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +43 -1
62 lines not on this page · raw message
Signature · 1 line
2.34.1
Re: [PATCH net-next v9 06/10] bnxt_en: add support for rx-copybreak ethtool command
Quoted 11 lines · Taehee Yoo
The
bnxt_endriver supports rx-copybreak, but it couldn't be set by userspace. Only the default value(256) has worked.
This patch makes thebnxt_endriver support following command.ethtool --set-tunable <devname> rx-copybreak <value>andethtool --get-tunable <devname> rx-copybreak.By this patch,
hds_thresholis set to the rx-copybreak value. But it will be set byethtool -G eth0 hds-thresh Nin the next patch.
Quoted 5 lines
Reviewed-by Jakub Kicinski <[email protected]>Reviewed-by Brett Creeley <[email protected]>Tested-by Stanislav Fomichev <[email protected]>Tested-by Andy Gospodarek <[email protected]>Signed-off-by Taehee Yoo <[email protected]>
Thanks.
PATCH v9 7/10 bnxt_en: add support for tcp-data-split ethtool command
In reply to Taehee YooNICs that uses bnxt_en driver supports tcp-data-split feature by the name of HDS(header-data-split).
But there is no implementation for the HDS to enable by ethtool. Only getting the current HDS status is implemented and The HDS is just automatically enabled only when either LRO, HW-GRO, or JUMBO is enabled. The hds_threshold follows rx-copybreak value. and it was unchangeable.
This implements ethtool -G <interface name> tcp-data-split <value> command option.
The value can be <on> and <auto>.
The value is <auto> and one of LRO/GRO/JUMBO is enabled, HDS is automatically enabled and all LRO/GRO/JUMBO are disabled, HDS is automatically disabled.
HDS feature relies on the aggregation ring.
So, if HDS is enabled, the bnxt_en driver initializes the aggregation ring. This is the reason why BNXT_FLAG_AGG_RINGS contains HDS condition.
---
v9:
- No changes.
v8:
- No changes.
v7:
- Remove hds unrelated changes.
- Return -EINVAL instead of -EOPNOTSUPP;
v6:
- Disallow to attach XDP when HDS is in use.
- Add Test tag from Andy.
v5:
- Do not set HDS if XDP is attached.
- Enable tcp-data-split only when tcp_data_split_mod is true.
v4:
- Do not support disable tcp-data-split.
- Add Test tag from Stanislav.
v3:
- No changes.
v2:
- Do not set hds_threshold to 0.
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 5 +++-- .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 20 +++++++++++++++++++ drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 4 ++++ 4 files changed, 28 insertions(+), 3 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +1 -1
@@ -4630,7 +4630,7 @@ void bnxt_set_ring_params(struct bnxt *bp) bp->rx_agg_ring_size =0 ; bp->rx_agg_nr_pages =0 ; -if (bp->flags &BNXT_FLAG_TPA ) +if (bp->flags &BNXT_FLAG_TPA || bp->flags &BNXT_FLAG_HDS ) agg_factor =min_t (u32,4 ,65536 /BNXT_RX_PAGE_SIZE ); bp->flags &= ~BNXT_FLAG_JUMBO ;
drivers/net/ethernet/broadcom/bnxt/bnxt.h +3 -2
@@ -2244,8 +2244,6 @@ struct bnxt {#define BNXT_FLAG_TPA (BNXT_FLAG_LRO | BNXT_FLAG_GRO)#define BNXT_FLAG_JUMBO 0x10#define BNXT_FLAG_STRIP_VLAN 0x20 -#define BNXT_FLAG_AGG_RINGS (BNXT_FLAG_JUMBO | BNXT_FLAG_GRO | \ - BNXT_FLAG_LRO)#define BNXT_FLAG_RFS 0x100#define BNXT_FLAG_SHARED_RINGS 0x200#define BNXT_FLAG_PORT_STATS 0x400
@@ -2266,6 +2264,9 @@ struct bnxt {#define BNXT_FLAG_ROCE_MIRROR_CAP 0x4000000#define BNXT_FLAG_TX_COAL_CMPL 0x8000000#define BNXT_FLAG_PORT_STATS_EXT 0x10000000 +#define BNXT_FLAG_HDS 0x20000000 +#define BNXT_FLAG_AGG_RINGS (BNXT_FLAG_JUMBO | BNXT_FLAG_GRO | \ + BNXT_FLAG_LRO | BNXT_FLAG_HDS)#define BNXT_FLAG_ALL_CONFIG_FEATS (BNXT_FLAG_TPA | \ BNXT_FLAG_RFS | \
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +20 -0
@@ -840,16 +840,35 @@ static int bnxt_set_ringparam(struct net_device *dev,struct kernel_ethtool_ringparam *kernel_ering, struct netlink_ext_ack *extack) { + u8 tcp_data_split = kernel_ering->tcp_data_split;struct bnxt *bp =netdev_priv (dev); +u8 hds_config_mod;if ((ering->rx_pending >BNXT_MAX_RX_DESC_CNT ) || (ering->tx_pending >BNXT_MAX_TX_DESC_CNT ) || (ering->tx_pending <BNXT_MIN_TX_DESC_CNT ))return -EINVAL ; + hds_config_mod = tcp_data_split != dev->ethtool->hds_config; +if (tcp_data_split ==ETHTOOL_TCP_DATA_SPLIT_DISABLED && hds_config_mod) +return -EINVAL ; + +if (tcp_data_split ==ETHTOOL_TCP_DATA_SPLIT_ENABLED && + hds_config_mod &&BNXT_RX_PAGE_MODE (bp)) { +NL_SET_ERR_MSG_MOD (extack,"tcp-data-split is disallowed when XDP is attached" ); +return -EINVAL ; + } +if (netif_running (dev))bnxt_close_nic (bp, false, false); +if (hds_config_mod) { +if (tcp_data_split ==ETHTOOL_TCP_DATA_SPLIT_ENABLED ) + bp->flags |=BNXT_FLAG_HDS ; +else if (tcp_data_split ==ETHTOOL_TCP_DATA_SPLIT_UNKNOWN ) + bp->flags &= ~BNXT_FLAG_HDS ; + } + bp->rx_ring_size = ering->rx_pending; bp->tx_ring_size = ering->tx_pending;bnxt_set_ring_params (bp);
@@ -5371,6 +5390,7 @@ const struct ethtool_ops bnxt_ethtool_ops = {ETHTOOL_COALESCE_STATS_BLOCK_USECS |ETHTOOL_COALESCE_USE_ADAPTIVE_RX | ETHTOOL_COALESCE_USE_CQE, + .supported_ring_params = ETHTOOL_RING_USE_TCP_DATA_SPLIT, .get_link_ksettings = bnxt_get_link_ksettings, .set_link_ksettings = bnxt_set_link_ksettings, .get_fec_stats = bnxt_get_fec_stats,
drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c +4 -0
@@ -395,6 +395,10 @@ static int bnxt_xdp_set(struct bnxt *bp, struct bpf_prog *prog) bp->dev->mtu, BNXT_MAX_PAGE_MODE_MTU);return -EOPNOTSUPP ; } +if (prog && bp->flags &BNXT_FLAG_HDS ) { +netdev_warn (dev,"XDP is disallowed when HDS is enabled.\n" ); +return -EOPNOTSUPP ; + }if (!(bp->flags &BNXT_FLAG_SHARED_RINGS )) {netdev_warn (dev,"ethtool rx/tx channels must be combined to support XDP.\n" );return -EOPNOTSUPP ;
Signature · 1 line
2.34.1
Re: [PATCH net-next v9 07/10] bnxt_en: add support for tcp-data-split ethtool command
Quoted 15 lines · Taehee Yoo
NICs that uses
bnxt_endriver supports tcp-data-split feature by the name of HDS(header-data-split).
But there is no implementation for the HDS to enable by ethtool. Only getting the current HDS status is implemented and The HDS is just automatically enabled only when either LRO, HW-GRO, or JUMBO is enabled. Thehds_thresholdfollows rx-copybreak value. and it was unchangeable.This implements
ethtool -G <interface name> tcp-data-split <value>command option.
The value can be <on> and <auto>.
The value is <auto> and one of LRO/GRO/JUMBO is enabled, HDS is automatically enabled and all LRO/GRO/JUMBO are disabled, HDS is automatically disabled.
Quoted 8 lines
HDS feature relies on the aggregation ring.
So, if HDS is enabled, thebnxt_endriver initializes the aggregation ring. This is the reason whyBNXT_FLAG_AGG_RINGScontains HDS condition.Acked-by Jakub Kicinski <[email protected]>Tested-by Stanislav Fomichev <[email protected]>Tested-by Andy Gospodarek <[email protected]>Signed-off-by Taehee Yoo <[email protected]>
Thanks.
Re: [PATCH net-next v9 07/10] bnxt_en: add support for tcp-data-split ethtool command
In reply to Taehee YooHi Taehee,
Quoted 147 lines · Taehee Yoo
NICs that uses
bnxt_endriver supports tcp-data-split feature by the name of HDS(header-data-split).
But there is no implementation for the HDS to enable by ethtool. Only getting the current HDS status is implemented and The HDS is just automatically enabled only when either LRO, HW-GRO, or JUMBO is enabled. Thehds_thresholdfollows rx-copybreak value. and it was unchangeable.This implements
ethtool -G <interface name> tcp-data-split <value>command option.
The value can be <on> and <auto>.
The value is <auto> and one of LRO/GRO/JUMBO is enabled, HDS is automatically enabled and all LRO/GRO/JUMBO are disabled, HDS is automatically disabled.HDS feature relies on the aggregation ring.
So, if HDS is enabled, thebnxt_endriver initializes the aggregation ring. This is the reason whyBNXT_FLAG_AGG_RINGScontains HDS condition.Acked-by Jakub Kicinski <[email protected]>Tested-by Stanislav Fomichev <[email protected]>Tested-by Andy Gospodarek <[email protected]>Signed-off-by Taehee Yoo <[email protected]>---
v9:
- No changes.v8:
- No changes.v7:
- Remove hds unrelated changes.
- Return-EINVALinstead of-EOPNOTSUPP;v6:
- Disallow to attach XDP when HDS is in use.
- Add Test tag from Andy.v5:
- Do not set HDS if XDP is attached.
- Enable tcp-data-split only whentcp_data_split_modis true.v4:
- Do not support disable tcp-data-split.
- Add Test tag from Stanislav.v3:
- No changes.v2:
- Do not sethds_thresholdto 0.drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 5 +++-- .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 20 +++++++++++++++++++ drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 4 ++++ 4 files changed, 28 insertions(+), 3 deletions(-)drivers/net/ethernet/broadcom/bnxt/bnxt.c +1
-1@@ -4630,7 +4630,7 @@ void bnxt_set_ring_params(struct bnxt *bp) bp->rx_agg_ring_size =0 ; bp->rx_agg_nr_pages =0 ; -if (bp->flags &BNXT_FLAG_TPA ) +if (bp->flags &BNXT_FLAG_TPA || bp->flags &BNXT_FLAG_HDS ) agg_factor =min_t (u32,4 ,65536 /BNXT_RX_PAGE_SIZE ); bp->flags &= ~BNXT_FLAG_JUMBO ;drivers/net/ethernet/broadcom/bnxt/bnxt.h +3
-2@@ -2244,8 +2244,6 @@ struct bnxt {#define BNXT_FLAG_TPA (BNXT_FLAG_LRO | BNXT_FLAG_GRO)#define BNXT_FLAG_JUMBO 0x10#define BNXT_FLAG_STRIP_VLAN 0x20 -#define BNXT_FLAG_AGG_RINGS (BNXT_FLAG_JUMBO | BNXT_FLAG_GRO | \ - BNXT_FLAG_LRO)#define BNXT_FLAG_RFS 0x100#define BNXT_FLAG_SHARED_RINGS 0x200#define BNXT_FLAG_PORT_STATS 0x400@@ -2266,6 +2264,9 @@ struct bnxt {#define BNXT_FLAG_ROCE_MIRROR_CAP 0x4000000#define BNXT_FLAG_TX_COAL_CMPL 0x8000000#define BNXT_FLAG_PORT_STATS_EXT 0x10000000 +#define BNXT_FLAG_HDS 0x20000000 +#define BNXT_FLAG_AGG_RINGS (BNXT_FLAG_JUMBO | BNXT_FLAG_GRO | \ + BNXT_FLAG_LRO | BNXT_FLAG_HDS)#define BNXT_FLAG_ALL_CONFIG_FEATS (BNXT_FLAG_TPA | \ BNXT_FLAG_RFS | \drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +20
-0@@ -840,16 +840,35 @@ static int bnxt_set_ringparam(struct net_device *dev,struct kernel_ethtool_ringparam *kernel_ering, struct netlink_ext_ack *extack) { + u8 tcp_data_split = kernel_ering->tcp_data_split;struct bnxt *bp =netdev_priv (dev); +u8 hds_config_mod;if ((ering->rx_pending >BNXT_MAX_RX_DESC_CNT ) || (ering->tx_pending >BNXT_MAX_TX_DESC_CNT ) || (ering->tx_pending <BNXT_MIN_TX_DESC_CNT ))return -EINVAL ; + hds_config_mod = tcp_data_split != dev->ethtool->hds_config; +if (tcp_data_split ==ETHTOOL_TCP_DATA_SPLIT_DISABLED && hds_config_mod) +return -EINVAL ; + +if (tcp_data_split ==ETHTOOL_TCP_DATA_SPLIT_ENABLED && + hds_config_mod &&BNXT_RX_PAGE_MODE (bp)) { +NL_SET_ERR_MSG_MOD (extack,"tcp-data-split is disallowed when XDP is attached" ); +return -EINVAL ; + } +if (netif_running (dev))bnxt_close_nic (bp, false, false); +if (hds_config_mod) { +if (tcp_data_split ==ETHTOOL_TCP_DATA_SPLIT_ENABLED ) + bp->flags |=BNXT_FLAG_HDS ; +else if (tcp_data_split ==ETHTOOL_TCP_DATA_SPLIT_UNKNOWN ) + bp->flags &= ~BNXT_FLAG_HDS ; + } + bp->rx_ring_size = ering->rx_pending; bp->tx_ring_size = ering->tx_pending;bnxt_set_ring_params (bp);@@ -5371,6 +5390,7 @@ const struct ethtool_ops bnxt_ethtool_ops = {ETHTOOL_COALESCE_STATS_BLOCK_USECS |ETHTOOL_COALESCE_USE_ADAPTIVE_RX | ETHTOOL_COALESCE_USE_CQE, + .supported_ring_params = ETHTOOL_RING_USE_TCP_DATA_SPLIT, .get_link_ksettings = bnxt_get_link_ksettings, .set_link_ksettings = bnxt_set_link_ksettings, .get_fec_stats = bnxt_get_fec_stats,drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c +0
-0
drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c static int bnxt_xdp_set(struct bnxt *bp, struct bpf_prog *prog) · line 401
Quoted 7 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c +4
-0@@ -395,6 +395,10 @@ static int bnxt_xdp_set(struct bnxt *bp, struct bpf_prog *prog) bp->dev->mtu, BNXT_MAX_PAGE_MODE_MTU);return -EOPNOTSUPP ; } +if (prog && bp->flags &BNXT_FLAG_HDS ) { +netdev_warn (dev,"XDP is disallowed when HDS is enabled.\n" ); +return -EOPNOTSUPP ; + }
I think there might be a bug here. On my 6.13 (ish) kernel when I try to install an XDP driver mode program, I get:
[Tue Feb 18 17:02:14 2025] bnxt_en 0000:01:00.0 eth0: XDP is disallowed when HDS is enabled.
Setting HDS to auto (seems like off isn't supported?) doesn't seem to help either:
# ethtool -g eth0
Ring parameters for eth0:
Pre-set maximums:
RX: 2047
RX Mini: n/a
RX Jumbo: 8191
TX: 2047
TX push buff len: n/a
Current hardware settings:
RX: 2047
RX Mini: n/a
RX Jumbo: 8188
TX: 2047
RX Buf Len: n/a
CQE Size: n/a
TX Push: off
RX Push: off
TX push buff len: n/a
TCP data split: on # ethtool -G eth0 tcp-data-split auto
# ethtool -g eth0 | grep "TCP data split"
TCP data split: on[..]
Thanks,
Daniel
Jakub Kicinski
maintainerRe: [PATCH net-next v9 07/10] bnxt_en: add support for tcp-data-split ethtool command
Quoted 16 lines · On Wed, 19 Feb 2025 10:11:01 -0700 Daniel Xu wrote:
drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c static int bnxt_xdp_set(struct bnxt *bp, struct bpf_prog *prog) · line 401
Quoted 12 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c +4
-0@@ -395,6 +395,10 @@ static int bnxt_xdp_set(struct bnxt *bp, struct bpf_prog *prog) bp->dev->mtu, BNXT_MAX_PAGE_MODE_MTU);return -EOPNOTSUPP ; } +if (prog && bp->flags &BNXT_FLAG_HDS ) { +netdev_warn (dev,"XDP is disallowed when HDS is enabled.\n" ); +return -EOPNOTSUPP ; + }I think there might be a bug here. On my 6.13 (ish) kernel when I try to install an XDP driver mode program, I get:
Quoted 4 lines
[Tue Feb 18 17:02:14 2025] bnxt_en 0000:01:00.0 eth0: XDP is disallowed when HDS is enabled.Setting HDS to auto (seems like off isn't supported?) doesn't seem to help either:
This should fix it, I think:
PATCH v9 8/10 bnxt_en: add support for hds-thresh ethtool command
In reply to Taehee YooThe bnxt_en driver has configured the hds_threshold value automatically when TPA is enabled based on the rx-copybreak default value. Now the hds-thresh ethtool command is added, so it adds an implementation of hds-thresh option.
Configuration of the hds-thresh is applied only when the tcp-data-split is enabled. The default value of hds-thresh is 256, which is the default value of rx-copybreak, which used to be the hds_thresh value.
The maximum hds-thresh is 1023.
# Example:
# ethtool -G enp14s0f0np0 tcp-data-split on hds-thresh 256 # ethtool -g enp14s0f0np0 Ring parameters for enp14s0f0np0: Pre-set maximums: ... HDS thresh: 1023 Current hardware settings: ... TCP data split: on HDS thresh: 256
---
v9:
- No changes.
v8:
- Do not set hds_thresh in the bnxt_set_ringparam.
v7:
- Use dev->ethtool->hds_thresh instead of bp->hds_thresh
v6:
- HDS_MAX is changed to 1023.
- Add Test tag from Andy.
v5:
- No changes.
v4:
- Reduce hole in struct bnxt.
- Add ETHTOOL_RING_USE_HDS_THRS to indicate bnxt_en driver support header-data-split-thresh option.
- Add Test tag from Stanislav.
v3:
- Drop validation logic tcp-data-split and tcp-data-split-thresh.
v2:
- Patch added.
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 +++- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 2 ++ drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 6 +++++- 3 files changed, 10 insertions(+), 2 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +3 -1
@@ -4610,6 +4610,7 @@ void bnxt_set_tpa_flags(struct bnxt *bp)static void bnxt_init_ring_params (struct bnxt *bp) { bp->rx_copybreak =BNXT_DEFAULT_RX_COPYBREAK ; + bp->dev->ethtool->hds_thresh =BNXT_DEFAULT_RX_COPYBREAK ; }/* bp->rx_ring_size, bp->tx_ring_size, dev->mtu, BNXT_FLAG_{G|L}RO flags must
@@ -6569,6 +6570,7 @@ static void bnxt_hwrm_update_rss_hash_cfg(struct bnxt *bp)static int bnxt_hwrm_vnic_set_hds (struct bnxt *bp,struct bnxt_vnic_info *vnic) { +u16 hds_thresh = (u16 )bp->dev->ethtool->hds_thresh;struct hwrm_vnic_plcmodes_cfg_input *req;int rc;
@@ -6585,7 +6587,7 @@ static int bnxt_hwrm_vnic_set_hds(struct bnxt *bp, struct bnxt_vnic_info *vnic) VNIC_PLCMODES_CFG_REQ_FLAGS_HDS_IPV6); req->enables |=cpu_to_le32 (VNIC_PLCMODES_CFG_REQ_ENABLES_HDS_THRESHOLD_VALID ); - req->hds_threshold =cpu_to_le16 (bp->rx_copybreak); + req->hds_threshold =cpu_to_le16 (hds_thresh); } req->vnic_id =cpu_to_le32 (vnic->fw_vnic_id);return hwrm_req_send (bp, req);
drivers/net/ethernet/broadcom/bnxt/bnxt.h +2 -0
@@ -2779,6 +2779,8 @@ struct bnxt {#define SFF_MODULE_ID_QSFP28 0x11#define BNXT_MAX_PHY_I2C_RESP_SIZE 64 +#define BNXT_HDS_THRESHOLD_MAX 1023 +static inline u32 bnxt_tx_avail (struct bnxt *bp,const struct bnxt_tx_ring_info *txr) {
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +5 -1
@@ -833,6 +833,9 @@ static void bnxt_get_ringparam(struct net_device *dev, ering->rx_pending = bp->rx_ring_size; ering->rx_jumbo_pending = bp->rx_agg_ring_size; ering->tx_pending = bp->tx_ring_size; + + kernel_ering->hds_thresh = dev->ethtool->hds_thresh; + kernel_ering->hds_thresh_max =BNXT_HDS_THRESHOLD_MAX ; } static int bnxt_set_ringparam(struct net_device *dev,
@@ -5390,7 +5393,8 @@ const struct ethtool_ops bnxt_ethtool_ops = {ETHTOOL_COALESCE_STATS_BLOCK_USECS |ETHTOOL_COALESCE_USE_ADAPTIVE_RX | ETHTOOL_COALESCE_USE_CQE, - .supported_ring_params = ETHTOOL_RING_USE_TCP_DATA_SPLIT, + .supported_ring_params =ETHTOOL_RING_USE_TCP_DATA_SPLIT | + ETHTOOL_RING_USE_HDS_THRS, .get_link_ksettings = bnxt_get_link_ksettings, .set_link_ksettings = bnxt_set_link_ksettings, .get_fec_stats = bnxt_get_fec_stats,
Signature · 1 line
2.34.1
Re: [PATCH net-next v9 08/10] bnxt_en: add support for hds-thresh ethtool command
Quoted 25 lines · Taehee Yoo
The
bnxt_endriver has configured thehds_thresholdvalue automatically when TPA is enabled based on the rx-copybreak default value. Now the hds-thresh ethtool command is added, so it adds an implementation of hds-thresh option.Configuration of the hds-thresh is applied only when the tcp-data-split is enabled. The default value of hds-thresh is 256, which is the default value of rx-copybreak, which used to be the
hds_threshvalue.The maximum hds-thresh is 1023.
# Example:
# ethtool -G enp14s0f0np0 tcp-data-split on hds-thresh 256 # ethtool -g enp14s0f0np0 Ring parameters for enp14s0f0np0: Pre-set maximums: ... HDS thresh: 1023 Current hardware settings: ... TCP data split: on HDS thresh: 256
Quoted 3 lines
Tested-by Stanislav Fomichev <[email protected]>Tested-by Andy Gospodarek <[email protected]>Signed-off-by Taehee Yoo <[email protected]>
Thanks.
PATCH v9 9/10 netdevsim: add HDS feature
In reply to Taehee YooHDS options(tcp-data-split, hds-thresh) have dependencies between other features like XDP. Basic dependencies are checked in the core API. netdevsim is very useful to check basic dependencies.
The default tcp-data-split mode is UNKNOWN but netdevsim driver returns ENABLED when ethtool dumps tcp-data-split mode.
The default value of HDS threshold is 0 and the maximum value is 1024.
ethtool shows like this.
ethtool -g eni1np1
Ring parameters for eni1np1:
Pre-set maximums:
...
HDS thresh: 1024
Current hardware settings:
...
TCP data split: on HDS thresh: 0
ethtool -G eni1np1 tcp-data-split on hds-thresh 1024 ethtool -g eni1np1
Ring parameters for eni1np1:
Pre-set maximums:
...
HDS thresh: 1024
Current hardware settings:
...
TCP data split: on HDS thresh: 1024
---
v9:
- Rebase on the top of net-next.
v8:
- Do not set hds_config and hds_thresh in the nsim_set_ringparam.
v7:
- Add datapath implementation.
- Remove kernel_ethtool_ringparam in the struct nsim_ethtool.
v6:
- Patch added.
drivers/net/netdevsim/ethtool.c | 12 +++++++++++- drivers/net/netdevsim/netdev.c | 9 +++++++++ drivers/net/netdevsim/netdevsim.h | 3 +++ 3 files changed, 23 insertions(+), 1 deletion(-)
drivers/net/netdevsim/ethtool.c +11 -1
@@ -2,7 +2,6 @@// Copyright (c) 2020 Facebook #include <linux/debugfs.h> -#include <linux/ethtool.h> #include <linux/random.h> #include "netdevsim.h"
@@ -72,6 +71,12 @@ static void nsim_get_ringparam(struct net_device *dev,struct netdevsim *ns =netdev_priv (dev);memcpy (ring, &ns->ethtool.ring,sizeof (ns->ethtool.ring)); + kernel_ring->tcp_data_split = dev->ethtool->hds_config; + kernel_ring->hds_thresh = dev->ethtool->hds_thresh; + kernel_ring->hds_thresh_max =NSIM_HDS_THRESHOLD_MAX ; + +if (kernel_ring->tcp_data_split ==ETHTOOL_TCP_DATA_SPLIT_UNKNOWN ) + kernel_ring->tcp_data_split =ETHTOOL_TCP_DATA_SPLIT_ENABLED ; } static int nsim_set_ringparam(struct net_device *dev,
@@ -161,6 +166,8 @@ static int nsim_get_ts_info(struct net_device *dev,static const struct ethtool_ops nsim_ethtool_ops = { .supported_coalesce_params =ETHTOOL_COALESCE_ALL_PARAMS , + .supported_ring_params =ETHTOOL_RING_USE_TCP_DATA_SPLIT | +ETHTOOL_RING_USE_HDS_THRS , .get_pause_stats = nsim_get_pause_stats, .get_pauseparam = nsim_get_pauseparam, .set_pauseparam = nsim_set_pauseparam,
@@ -182,6 +189,9 @@ static void nsim_ethtool_ring_init(struct netdevsim *ns) ns->ethtool.ring.rx_jumbo_max_pending =4096 ; ns->ethtool.ring.rx_mini_max_pending =4096 ; ns->ethtool.ring.tx_max_pending =4096 ; + + ns->netdev->ethtool->hds_config =ETHTOOL_TCP_DATA_SPLIT_UNKNOWN ; + ns->netdev->ethtool->hds_thresh =0 ; }void nsim_ethtool_init (struct netdevsim *ns)
drivers/net/netdevsim/netdev.c +9 -0
@@ -15,6 +15,7 @@#include <linux/debugfs.h> #include <linux/etherdevice.h> +#include <linux/ethtool_netlink.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/netdevice.h>
@@ -54,6 +55,7 @@ static int nsim_forward_skb(struct net_device *dev, struct sk_buff *skb,static netdev_tx_t nsim_start_xmit (struct sk_buff *skb,struct net_device *dev) {struct netdevsim *ns =netdev_priv (dev); +struct ethtool_netdev_state *ethtool;struct net_device *peer_dev;unsigned int len = skb->len;struct netdevsim *peer_ns;
@@ -74,6 +76,13 @@ static netdev_tx_t nsim_start_xmit(struct sk_buff *skb, struct net_device *dev) rxq = rxq % peer_dev->num_rx_queues; rq = peer_ns->rq[rxq]; + ethtool = peer_dev->ethtool; +if (skb_is_nonlinear (skb) && + (ethtool->hds_config !=ETHTOOL_TCP_DATA_SPLIT_ENABLED || + (ethtool->hds_config ==ETHTOOL_TCP_DATA_SPLIT_ENABLED && + ethtool->hds_thresh > len))) +skb_linearize (skb); +skb_tx_timestamp (skb);if (unlikely (nsim_forward_skb (peer_dev, skb, rq) ==NET_RX_DROP )) goto out_drop_cnt;
drivers/net/netdevsim/netdevsim.h +3 -0
@@ -16,6 +16,7 @@#include <linux/debugfs.h> #include <linux/device.h> #include <linux/ethtool.h> +#include <linux/ethtool_netlink.h> #include <linux/kernel.h> #include <linux/list.h> #include <linux/netdevice.h>
@@ -36,6 +37,8 @@#define NSIM_IPSEC_VALID BIT(31)#define NSIM_UDP_TUNNEL_N_PORTS 4 +#define NSIM_HDS_THRESHOLD_MAX 1024 +struct nsim_sa {struct xfrm_state *xs;__be32 ipaddr[4 ];
Signature · 1 line
2.34.1
PATCH v9 10/10 selftest: net-drv: hds: add test for HDS feature
In reply to Taehee YooHDS/HDS-thresh features were updated/implemented. so add some tests for these features.
HDS tests are the same with ethtool -G eth0 tcp-data-split <on | off | auto > but auto depends on driver specification.
So, it doesn't include auto case.
HDS-thresh tests are same with ethtool -G eth0 hds-thresh <0 - MAX> It includes both 0 and MAX cases. It also includes exceed case, MAX + 1.
---
v9:
- No changes.
v8:
- Use ksft_raises.
v7:
- Patch added.
tools/testing/selftests/drivers/net/Makefile | 1 + tools/testing/selftests/drivers/net/hds.py | 120 +++++++++++++++++++ 2 files changed, 121 insertions(+) create mode 100755 tools/testing/selftests/drivers/net/hds.py
tools/testing/selftests/drivers/net/Makefile +1 -0
@@ -12,6 +12,7 @@ TEST_PROGS := \ queues.py \ stats.py \ shaper.py \ + hds.py \ # end of TEST_PROGS include ../../lib.mk
tools/testing/selftests/drivers/net/hds.py new file +120 -0
120 lines not on this page · raw message
Signature · 1 line
2.34.1
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 13 lines · On Tue, 14 Jan 2025 14:28:42 +0000 you wrote:
This series implements hds-thresh ethtool command.
This series also implements backend of tcp-data-split and hds-thresh ethtool command forbnxt_endriver.
These ethtool commands are mandatory options for device memory TCP.NICs that use the
bnxt_endriver support tcp-data-split feature named HDS(header-data-split).
But there is no implementation for the HDS to enable by ethtool. Only getting the current HDS status is implemented and the HDS is just automatically enabled only when either LRO, HW-GRO, or JUMBO is enabled. Thehds_thresholdfollows the rx-copybreak value but it wasn't changeable.
Quoted 1 line
[...]
Here is the summary with links:
- [net-next,v9,01/10] net: ethtool: add hds_config member in ethtool_netdev_state
https://git.kernel.org/netdev/net-next/c/197258f0ef68 - [net-next,v9,02/10] net: ethtool: add support for configuring hds-thresh https://git.kernel.org/netdev/net-next/c/eec8359f0797 - [net-next,v9,03/10] net: devmem: add ring parameter filtering https://git.kernel.org/netdev/net-next/c/a08a5c948401 - [net-next,v9,04/10] net: ethtool: add ring parameter filtering https://git.kernel.org/netdev/net-next/c/e61779015c4a - [net-next,v9,05/10] net: disallow setup single buffer XDP when tcp-data-split is enabled. https://git.kernel.org/netdev/net-next/c/2d46e481a9af - [net-next,v9,06/10] bnxt_en: add support for rx-copybreak ethtool command https://git.kernel.org/netdev/net-next/c/152f4da05aee - [net-next,v9,07/10] bnxt_en: add support for tcp-data-split ethtool command https://git.kernel.org/netdev/net-next/c/87c8f8496a05 - [net-next,v9,08/10] bnxt_en: add support for hds-thresh ethtool command https://git.kernel.org/netdev/net-next/c/6b43673a25c3 - [net-next,v9,09/10] netdevsim: add HDS feature https://git.kernel.org/netdev/net-next/c/f394d07b192b - [net-next,v9,10/10] selftest: net-drv: hds: add test for HDS feature https://git.kernel.org/netdev/net-next/c/cfd70e3eba2b
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html