diff options
author | Alexander Lobakin <alexandr.lobakin@intel.com> | 2022-03-21 11:59:52 +0100 |
---|---|---|
committer | Tony Nguyen <anthony.l.nguyen@intel.com> | 2022-04-07 08:20:10 -0700 |
commit | 1b699f81dba78c724f6f94b02f01e216b64bf88b (patch) | |
tree | 341b963df41a2c6e8052acb0b7f7d98a12d69359 /tools/testing/selftests/bpf/prog_tests | |
parent | 27ffa273a0405b546b4562b1c65e616d41a1f30e (diff) |
ice: switch: use a struct to pass packet template params
ice_find_dummy_packet() contains a lot of boilerplate code and a
nice room for copy-paste mistakes.
Instead of passing 3 separate pointers back and forth to get packet
template (dummy) params, directly return a structure containing
them. Then, use a macro to compose compound literals and avoid code
duplication on return path.
Now, dummy packet type/name is needed only once to return a full
correct triple pkt-pkt_len-offsets, and those are all one-liners.
dummy_ipv4_gtpu_ipv4_packet_offsets is just moved around and renamed
(as well as dummy_ipv6_gtp_packet_offsets) with no function changes.
Signed-off-by: Alexander Lobakin <alexandr.lobakin@intel.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Tested-by: Marcin Szycik <marcin.szycik@linux.intel.com>
Tested-by: Sandeep Penigalapati <sandeep.penigalapati@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests')
0 files changed, 0 insertions, 0 deletions