@@ -586,7 +586,7 @@ static inline unsigned pkt_mmap_v2_tx(int sock, struct ring *ring,
static void mmap_fill_ring(struct ring *ring, unsigned blocks)
{
ring->req.tp_block_size = getpagesize() << 2;
- ring->req.tp_frame_size = TPACKET_ALIGNMENT << 7;
+ ring->req.tp_frame_size = 9216 + TPACKET_HDRLEN;
ring->req.tp_block_nr = blocks;
ring->req.tp_frame_nr = ring->req.tp_block_size /
@@ -14,7 +14,7 @@
#include <stdlib.h>
#define PKT_BUF_NUM 32
-#define PKT_BUF_SIZE 1856
+#define PKT_BUF_SIZE 9216
#define MAX_NUM_IFACES 2
#define TEST_SEQ_INVALID ((uint32_t)~0)
#define TEST_SEQ_MAGIC 0x92749451
@@ -34,9 +34,11 @@ typedef struct {
} pktio_info_t;
/** structure of test packet UDP payload */
-typedef struct {
+typedef struct __attribute__((__packed__)) {
uint32be_t magic;
uint32be_t seq;
+ char data[9162]; /* total size of eth packet 9216 */
+ uint32be_t magic2;
} pkt_test_data_t;
/** default packet pool */
@@ -66,6 +68,7 @@ static int pktio_pkt_set_seq(odp_packet_t pkt)
pkt_test_data_t data;
data.magic = TEST_SEQ_MAGIC;
+ data.magic2 = TEST_SEQ_MAGIC;
data.seq = tstseq;
l4_off = odp_packet_l4_offset(pkt);
@@ -92,7 +95,8 @@ static uint32_t pktio_pkt_seq(odp_packet_t pkt)
odp_packet_copydata_out(pkt, l4_off+ODPH_UDPHDR_LEN,
sizeof(data), &data);
- if (data.magic == TEST_SEQ_MAGIC)
+ if (data.magic == TEST_SEQ_MAGIC &&
+ data.magic2 == TEST_SEQ_MAGIC)
return data.seq;
}
@@ -56,8 +56,8 @@ setup_env1()
echo "pktio: error: unable to create veth pair"
exit $TEST_SKIPPED
fi
- ip link set $IF0 up
- ip link set $IF1 up
+ ip link set $IF0 mtu 9216 up
+ ip link set $IF1 mtu 9216 up
# network needs a little time to come up
sleep 1
Support for jumbo frames for linux-generic with unsegmented buffers. Test for pkio is also adjusted to work with 9*1024=9216 bytes packets. https://bugs.linaro.org/show_bug.cgi?id=509 Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> --- platform/linux-generic/odp_packet_socket.c | 2 +- test/validation/odp_pktio.c | 10 +++++++--- test/validation/odp_pktio_run | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-)