Skip to content

Commit ae6b6a1

Browse files
Björn TöpelAlexei Starovoitov
authored andcommitted
selftests: xsk: Remove unused defines
Remove two unused defines. Signed-off-by: Björn Töpel <bjorn.topel@intel.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20210329224316.17793-18-maciej.fijalkowski@intel.com
1 parent 96539f1 commit ae6b6a1

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

tools/testing/selftests/bpf/xdpxceiver.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ static void complete_tx_only(struct xsk_socket_info *xsk, int batch_size)
456456
if (!xsk->outstanding_tx)
457457
return;
458458

459-
if (!NEED_WAKEUP || xsk_ring_prod__needs_wakeup(&xsk->tx))
459+
if (xsk_ring_prod__needs_wakeup(&xsk->tx))
460460
kick_tx(xsk);
461461

462462
rcvd = xsk_ring_cons__peek(&xsk->umem->cq, batch_size, &idx);
@@ -544,9 +544,8 @@ static void tx_only(struct xsk_socket_info *xsk, u32 *frameptr, int batch_size)
544544
xsk_ring_prod__submit(&xsk->tx, batch_size);
545545
if (!tx_invalid_test) {
546546
xsk->outstanding_tx += batch_size;
547-
} else {
548-
if (!NEED_WAKEUP || xsk_ring_prod__needs_wakeup(&xsk->tx))
549-
kick_tx(xsk);
547+
} else if (xsk_ring_prod__needs_wakeup(&xsk->tx)) {
548+
kick_tx(xsk);
550549
}
551550
*frameptr += batch_size;
552551
*frameptr %= num_frames;

tools/testing/selftests/bpf/xdpxceiver.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,11 @@
3434
#define IP_PKT_TOS 0x9
3535
#define UDP_PKT_SIZE (IP_PKT_SIZE - sizeof(struct iphdr))
3636
#define UDP_PKT_DATA_SIZE (UDP_PKT_SIZE - sizeof(struct udphdr))
37-
#define TMOUT_SEC (3)
3837
#define EOT (-1)
3938
#define USLEEP_MAX 200000
4039
#define SOCK_RECONF_CTR 10
4140
#define BATCH_SIZE 64
4241
#define POLL_TMOUT 1000
43-
#define NEED_WAKEUP true
4442
#define DEFAULT_PKT_CNT 10000
4543
#define RX_FULL_RXQSIZE 32
4644

0 commit comments

Comments
 (0)