xskxceiver.h (17f1034dd76d7465d4c0948c5280c6fc64ee0542) xskxceiver.h (f540d44e05cf2f324697ba375235da2d7c92743c)
1/* SPDX-License-Identifier: GPL-2.0
2 * Copyright(c) 2020 Intel Corporation.
3 */
4
5#ifndef XSKXCEIVER_H_
6#define XSKXCEIVER_H_
7
8#include "xsk_xdp_progs.skel.h"

--- 24 unchanged lines hidden (view full) ---

33#define TEST_SKIP 2
34#define MAX_INTERFACES 2
35#define MAX_INTERFACE_NAME_CHARS 16
36#define MAX_SOCKETS 2
37#define MAX_TEST_NAME_SIZE 32
38#define MAX_TEARDOWN_ITER 10
39#define PKT_HDR_SIZE (sizeof(struct ethhdr) + 2) /* Just to align the data in the packet */
40#define MIN_PKT_SIZE 64
1/* SPDX-License-Identifier: GPL-2.0
2 * Copyright(c) 2020 Intel Corporation.
3 */
4
5#ifndef XSKXCEIVER_H_
6#define XSKXCEIVER_H_
7
8#include "xsk_xdp_progs.skel.h"

--- 24 unchanged lines hidden (view full) ---

33#define TEST_SKIP 2
34#define MAX_INTERFACES 2
35#define MAX_INTERFACE_NAME_CHARS 16
36#define MAX_SOCKETS 2
37#define MAX_TEST_NAME_SIZE 32
38#define MAX_TEARDOWN_ITER 10
39#define PKT_HDR_SIZE (sizeof(struct ethhdr) + 2) /* Just to align the data in the packet */
40#define MIN_PKT_SIZE 64
41#define MAX_ETH_PKT_SIZE 1518
41#define MAX_ETH_JUMBO_SIZE 9000
42#define USLEEP_MAX 10000
43#define SOCK_RECONF_CTR 10
44#define BATCH_SIZE 64
45#define POLL_TMOUT 1000
46#define THREAD_TMOUT 3
47#define DEFAULT_PKT_CNT (4 * 1024)
48#define DEFAULT_UMEM_BUFFERS (DEFAULT_PKT_CNT / 4)

--- 30 unchanged lines hidden (view full) ---

79 TEST_TYPE_BIDI,
80 TEST_TYPE_STATS_RX_DROPPED,
81 TEST_TYPE_STATS_TX_INVALID_DESCS,
82 TEST_TYPE_STATS_RX_FULL,
83 TEST_TYPE_STATS_FILL_EMPTY,
84 TEST_TYPE_BPF_RES,
85 TEST_TYPE_XDP_DROP_HALF,
86 TEST_TYPE_XDP_METADATA_COUNT,
42#define MAX_ETH_JUMBO_SIZE 9000
43#define USLEEP_MAX 10000
44#define SOCK_RECONF_CTR 10
45#define BATCH_SIZE 64
46#define POLL_TMOUT 1000
47#define THREAD_TMOUT 3
48#define DEFAULT_PKT_CNT (4 * 1024)
49#define DEFAULT_UMEM_BUFFERS (DEFAULT_PKT_CNT / 4)

--- 30 unchanged lines hidden (view full) ---

80 TEST_TYPE_BIDI,
81 TEST_TYPE_STATS_RX_DROPPED,
82 TEST_TYPE_STATS_TX_INVALID_DESCS,
83 TEST_TYPE_STATS_RX_FULL,
84 TEST_TYPE_STATS_FILL_EMPTY,
85 TEST_TYPE_BPF_RES,
86 TEST_TYPE_XDP_DROP_HALF,
87 TEST_TYPE_XDP_METADATA_COUNT,
88 TEST_TYPE_RUN_TO_COMPLETION_MB,
87 TEST_TYPE_MAX
88};
89
90static bool opt_verbose;
91
92struct xsk_umem_info {
93 struct xsk_ring_prod fq;
94 struct xsk_ring_cons cq;

--- 42 unchanged lines hidden (view full) ---

137 thread_func_t func_ptr;
138 validation_func_t validation_func;
139 struct pkt_stream *pkt_stream;
140 struct xsk_xdp_progs *xdp_progs;
141 struct bpf_map *xskmap;
142 struct bpf_program *xdp_prog;
143 enum test_mode mode;
144 int ifindex;
89 TEST_TYPE_MAX
90};
91
92static bool opt_verbose;
93
94struct xsk_umem_info {
95 struct xsk_ring_prod fq;
96 struct xsk_ring_cons cq;

--- 42 unchanged lines hidden (view full) ---

139 thread_func_t func_ptr;
140 validation_func_t validation_func;
141 struct pkt_stream *pkt_stream;
142 struct xsk_xdp_progs *xdp_progs;
143 struct bpf_map *xskmap;
144 struct bpf_program *xdp_prog;
145 enum test_mode mode;
146 int ifindex;
147 int mtu;
145 u32 bind_flags;
146 bool tx_on;
147 bool rx_on;
148 bool use_poll;
149 bool busy_poll;
150 bool use_fill_ring;
151 bool release_rx;
152 bool shared_umem;
153 bool use_metadata;
154 bool unaligned_supp;
148 u32 bind_flags;
149 bool tx_on;
150 bool rx_on;
151 bool use_poll;
152 bool busy_poll;
153 bool use_fill_ring;
154 bool release_rx;
155 bool shared_umem;
156 bool use_metadata;
157 bool unaligned_supp;
158 bool multi_buff_supp;
159 bool multi_buff_zc_supp;
155 u8 dst_mac[ETH_ALEN];
156 u8 src_mac[ETH_ALEN];
157};
158
159struct test_spec {
160 struct ifobject *ifobj_tx;
161 struct ifobject *ifobj_rx;
162 struct pkt_stream *tx_pkt_stream_default;
163 struct pkt_stream *rx_pkt_stream_default;
164 struct bpf_program *xdp_prog_rx;
165 struct bpf_program *xdp_prog_tx;
166 struct bpf_map *xskmap_rx;
167 struct bpf_map *xskmap_tx;
160 u8 dst_mac[ETH_ALEN];
161 u8 src_mac[ETH_ALEN];
162};
163
164struct test_spec {
165 struct ifobject *ifobj_tx;
166 struct ifobject *ifobj_rx;
167 struct pkt_stream *tx_pkt_stream_default;
168 struct pkt_stream *rx_pkt_stream_default;
169 struct bpf_program *xdp_prog_rx;
170 struct bpf_program *xdp_prog_tx;
171 struct bpf_map *xskmap_rx;
172 struct bpf_map *xskmap_tx;
173 int mtu;
168 u16 total_steps;
169 u16 current_step;
170 u16 nb_sockets;
171 bool fail;
172 enum test_mode mode;
173 char name[MAX_TEST_NAME_SIZE];
174};
175
176pthread_barrier_t barr;
177pthread_mutex_t pacing_mutex = PTHREAD_MUTEX_INITIALIZER;
178
179int pkts_in_flight;
180
181#endif /* XSKXCEIVER_H_ */
174 u16 total_steps;
175 u16 current_step;
176 u16 nb_sockets;
177 bool fail;
178 enum test_mode mode;
179 char name[MAX_TEST_NAME_SIZE];
180};
181
182pthread_barrier_t barr;
183pthread_mutex_t pacing_mutex = PTHREAD_MUTEX_INITIALIZER;
184
185int pkts_in_flight;
186
187#endif /* XSKXCEIVER_H_ */