bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tushar Vyavahare <tushar.vyavahare@intel.com>
To: bpf@vger.kernel.org
Cc: netdev@vger.kernel.org, bjorn@kernel.org,
	magnus.karlsson@intel.com, maciej.fijalkowski@intel.com,
	jonathan.lemon@gmail.com, davem@davemloft.net, kuba@kernel.org,
	pabeni@redhat.com, ast@kernel.org, daniel@iogearbox.net,
	tirthendu.sarkar@intel.com, tushar.vyavahare@intel.com
Subject: [PATCH bpf-next v3 0/7] Selftests/xsk: Test with maximum and minimum HW ring size configurations
Date: Tue,  2 Apr 2024 11:45:22 +0000	[thread overview]
Message-ID: <20240402114529.545475-1-tushar.vyavahare@intel.com> (raw)

Please find enclosed a patch set that introduces enhancements and new test
cases to the selftests/xsk framework. These test the robustness and
reliability of AF_XDP across both minimal and maximal ring size
configurations.

While running these tests, a bug [1] was identified when the batch size is
roughly the same as the NIC ring size. This has now been addressed by
Maciej's fix.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=913eda2b08cc49d31f382579e2be34c2709eb789

Patch Summary:

1. This commit syncs the ethtool.h header file between the kernel source
   tree and the tools directory to maintain consistency.

2: Modifies the BATCH_SIZE from a constant to a variable, batch_size, to
   support dynamic modification at runtime for testing different hardware
   ring sizes.

3: Implements a function, get_hw_ring_size, to retrieve the current
   maximum interface size and store this information in the
   ethtool_ringparam structure.

4: Implements a new function, set_hw_ring_size, which allows for the
   dynamic configuration of the ring size within an interface.

5: Introduce a new function, set_ring_size(), to manage asynchronous AF_XDP
   socket closure. Make sure to retry the set_hw_ring_size function
   multiple times, up to SOCK_RECONF_CTR, if it fails due to an active
   AF_XDP socket. Immediately return an error for non-EBUSY errors.

6: Adds a new test case that puts the AF_XDP driver under stress by
   configuring minimal hardware and software ring sizes, verifying its
   functionality under constrained conditions.

7: Add a new test case that evaluates the maximum ring sizes for AF_XDP,
   ensuring its reliability under maximum ring utilization.

Testing Strategy:

Check the system in extreme scenarios, such as maximum and minimum
configurations. This helps identify and fix any bugs that may occur.

Signed-off-by: Tushar Vyavahare <tushar.vyavahare@intel.com>
Acked-by: Magnus Karlsson <magnus.karlsson@intel.com>

Tushar Vyavahare (7):
  tools/include/uapi/linux/ethtool.h
  selftests/xsk: make batch size variable
  selftests/bpf: implement get_hw_ring_size function to retrieve current
    and max interface size
  selftests/bpf: implement set_hw_ring_size function to configure
    interface ring size
  selftests/xsk: introduce set_ring_size function with a retry mechanism
    for handling AF_XDP socket closures
  selftests/xsk: test AF_XDP functionality under minimal ring
    configurations
  selftests/xsk: add new test case for AF_XDP under max ring sizes

---
Changelog:
v1->v2
- copy ethtool.h to tools directory [Stanislav]
- Use ethtool_ringparam directly for get_hw_ring_size() [Stanislav]
- get_hw_ring_size() and get_hw_ring_size() moved to network_helpers.c [Stanislav]
- return -errno to match the other cases where errors are < 0. [Stanislav]
- Cleaned up set_ring_size() function by removing unused variables and
  refactoring logic for clarity. [Alexei]
- Implement a retry mechanism for the set_ring_size function to handle
  the asynchronous nature of AF_XDP socket closure. [Magnus]

v2->v3
- Remove unused linux/if.h include from flow_dissector BPF test to address
  CI pipeline failure.
---
 tools/include/uapi/linux/ethtool.h            | 2229 ++++++++++++++++-
 tools/testing/selftests/bpf/Makefile          |    2 +-
 tools/testing/selftests/bpf/network_helpers.c |   48 +
 tools/testing/selftests/bpf/network_helpers.h |    5 +
 .../selftests/bpf/prog_tests/flow_dissector.c |    1 -
 tools/testing/selftests/bpf/xdp_hw_metadata.c |   14 -
 tools/testing/selftests/bpf/xskxceiver.c      |  123 +-
 tools/testing/selftests/bpf/xskxceiver.h      |   12 +-
 8 files changed, 2376 insertions(+), 58 deletions(-)

-- 
2.34.1


             reply	other threads:[~2024-04-02 12:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-02 11:45 Tushar Vyavahare [this message]
2024-04-02 11:45 ` [PATCH bpf-next v3 1/7] tools/include/uapi/linux/ethtool.h Tushar Vyavahare
2024-04-02 11:45 ` [PATCH bpf-next v3 2/7] selftests/xsk: make batch size variable Tushar Vyavahare
2024-04-02 11:45 ` [PATCH bpf-next v3 3/7] selftests/bpf: implement get_hw_ring_size function to retrieve current and max interface size Tushar Vyavahare
2024-04-02 11:45 ` [PATCH bpf-next v3 4/7] selftests/bpf: implement set_hw_ring_size function to configure interface ring size Tushar Vyavahare
2024-04-02 11:45 ` [PATCH bpf-next v3 5/7] selftests/xsk: introduce set_ring_size function with a retry mechanism for handling AF_XDP socket closures Tushar Vyavahare
2024-04-02 11:45 ` [PATCH bpf-next v3 6/7] selftests/xsk: test AF_XDP functionality under minimal ring configurations Tushar Vyavahare
2024-04-02 11:45 ` [PATCH bpf-next v3 7/7] selftests/xsk: add new test case for AF_XDP under max ring sizes Tushar Vyavahare
2024-04-03 14:20 ` [PATCH bpf-next v3 0/7] Selftests/xsk: Test with maximum and minimum HW ring size configurations patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240402114529.545475-1-tushar.vyavahare@intel.com \
    --to=tushar.vyavahare@intel.com \
    --cc=ast@kernel.org \
    --cc=bjorn@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=jonathan.lemon@gmail.com \
    --cc=kuba@kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=tirthendu.sarkar@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).