mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
selftests: drv-net: remove duplicate functions in hds.py
There were duplicate definitions of the enabled_set_xdp and set_xdp
test methods. The two enabled_set_xdp copies were identical apart from
a comment and whitespace.
The set_xdp copies differed by a reset of the hds configuration.
commit ee3ae27721 ("selftests: drv-net: hds: restore hds settings")
introduced the config reset, but this was shadowed by the copy.
Signed-off-by: Dimitri Daskalakis <daskald@meta.com>
Link: https://patch.msgid.link/20260911224255.3675903-1-dimitri.daskalakis1@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
47dbcfdf94
commit
3661253d22
|
|
@ -240,35 +240,6 @@ def enabled_set_xdp(cfg, netnl) -> None:
|
|||
_xdp_onoff(cfg)
|
||||
|
||||
|
||||
def set_xdp(cfg, netnl) -> None:
|
||||
"""
|
||||
Enable single-buffer XDP on the device.
|
||||
When HDS is in "auto" / UNKNOWN mode, XDP installation should work.
|
||||
"""
|
||||
mode = _get_hds_mode(cfg, netnl)
|
||||
if mode == 'enabled':
|
||||
netnl.rings_set({'header': {'dev-index': cfg.ifindex},
|
||||
'tcp-data-split': 'unknown'})
|
||||
|
||||
_xdp_onoff(cfg)
|
||||
|
||||
|
||||
def enabled_set_xdp(cfg, netnl) -> None:
|
||||
"""
|
||||
Enable single-buffer XDP on the device.
|
||||
When HDS is in "enabled" mode, XDP installation should not work.
|
||||
"""
|
||||
_get_hds_mode(cfg, netnl) # Trigger skip if not supported
|
||||
|
||||
netnl.rings_set({'header': {'dev-index': cfg.ifindex},
|
||||
'tcp-data-split': 'enabled'})
|
||||
defer(netnl.rings_set, {'header': {'dev-index': cfg.ifindex},
|
||||
'tcp-data-split': 'unknown'})
|
||||
|
||||
with ksft_raises(CmdExitFailure) as e:
|
||||
_xdp_onoff(cfg)
|
||||
|
||||
|
||||
def ioctl(cfg, netnl) -> None:
|
||||
mode1 = _get_hds_mode(cfg, netnl)
|
||||
_ioctl_ringparam_modify(cfg, netnl)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user