@@ -28,7 +28,7 @@
#include <arpa/inet.h>
#include <unistd.h>
-#define DATA_LEN 100
+#define DATA_LEN 5000
#define DATA_CHAR 'a'
#define PORT_BASE 8000
@@ -40,14 +40,7 @@
static __maybe_unused void pair_udp_setfilter(int fd)
{
struct sock_filter bpf_filter[] = {
- { 0x80, 0, 0, 0x00000000 }, /* LD pktlen */
- { 0x35, 0, 5, DATA_LEN }, /* JGE DATA_LEN [f goto nomatch]*/
- { 0x30, 0, 0, 0x00000050 }, /* LD ip[80] */
- { 0x15, 0, 3, DATA_CHAR }, /* JEQ DATA_CHAR [f goto nomatch]*/
- { 0x30, 0, 0, 0x00000051 }, /* LD ip[81] */
- { 0x15, 0, 1, DATA_CHAR }, /* JEQ DATA_CHAR [f goto nomatch]*/
- { 0x06, 0, 0, 0x00000060 }, /* RET match */
- { 0x06, 0, 0, 0x00000000 }, /* RET no match */
+ { 0x06, 0, 0, 0x0000ffff }, /* RET match */
};
struct sock_fprog bpf_prog;
@@ -354,7 +354,7 @@ static void walk_v1_v2_tx(int sock, struct ring *ring)
int rcv_sock, ret;
size_t packet_len;
union frame_map ppd;
- char packet[1024];
+ char packet[65536];
unsigned int frame_num = 0, got = 0;
struct sockaddr_ll ll = {
.sll_family = PF_PACKET,
@@ -608,7 +608,7 @@ static void __v3_fill(struct ring *ring, unsigned int blocks)
ring->req3.tp_sizeof_priv = 0;
ring->req3.tp_feature_req_word = TP_FT_REQ_FILL_RXHASH;
- ring->req3.tp_block_size = getpagesize() << 2;
+ ring->req3.tp_block_size = getpagesize();
ring->req3.tp_frame_size = TPACKET_ALIGNMENT << 7;
ring->req3.tp_block_nr = blocks;
@@ -789,12 +789,6 @@ int main(void)
{
int ret = 0;
- ret |= test_tpacket(TPACKET_V1, PACKET_RX_RING);
- ret |= test_tpacket(TPACKET_V1, PACKET_TX_RING);
-
- ret |= test_tpacket(TPACKET_V2, PACKET_RX_RING);
- ret |= test_tpacket(TPACKET_V2, PACKET_TX_RING);
-
ret |= test_tpacket(TPACKET_V3, PACKET_RX_RING);
if (ret)