diff options
author | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-08-18 19:05:43 +0300 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-08-18 19:05:43 +0300 |
commit | 6d8b8abf3b3b4ab25f05612e495f25e6945cb617 (patch) | |
tree | 3fac4090b86093ac3146207f5d7c1507e15e328a | |
parent | 13297ddfc96397e9c177a8e6bfa2a001bfb767cd (diff) | |
parent | 8658005fb7ab3ae4e2bf6e7619a003a403565b34 (diff) |
Merge branch 'master' into api-next
-rw-r--r-- | example/generator/odp_generator.c | 1 | ||||
-rw-r--r-- | example/ipsec/odp_ipsec.c | 1 | ||||
-rw-r--r-- | example/packet/odp_pktio.c | 1 | ||||
-rw-r--r-- | platform/linux-generic/include/odp_packet_io_internal.h | 1 | ||||
-rw-r--r-- | platform/linux-generic/include/odp_packet_socket.h | 3 | ||||
-rw-r--r-- | platform/linux-generic/pktio/io_ops.c | 1 | ||||
-rw-r--r-- | platform/linux-generic/pktio/socket.c | 212 | ||||
-rwxr-xr-x | platform/linux-generic/test/pktio/pktio_run | 4 | ||||
-rw-r--r-- | test/performance/odp_l2fwd.c | 1 | ||||
-rw-r--r-- | test/validation/pktio/pktio.c | 73 | ||||
-rw-r--r-- | test/validation/pktio/pktio.h | 3 |
11 files changed, 118 insertions, 183 deletions
diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 35a6fa8..c1974dc 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -1051,7 +1051,6 @@ static void usage(char *progname) " -h, --help Display help and exit.\n" " environment variables: ODP_PKTIO_DISABLE_SOCKET_MMAP\n" " ODP_PKTIO_DISABLE_SOCKET_MMSG\n" - " ODP_PKTIO_DISABLE_SOCKET_BASIC\n" " can be used to advanced pkt I/O selection for linux-generic\n" "\n", NO_PATH(progname), NO_PATH(progname) ); diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index d392925..85dbc00 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -1590,7 +1590,6 @@ static void usage(char *progname) " -h, --help Display help and exit.\n" " environment variables: ODP_PKTIO_DISABLE_SOCKET_MMAP\n" " ODP_PKTIO_DISABLE_SOCKET_MMSG\n" - " ODP_PKTIO_DISABLE_SOCKET_BASIC\n" " can be used to advanced pkt I/O selection for linux-generic\n" " ODP_IPSEC_USE_POLL_QUEUES\n" " to enable use of poll queues instead of scheduled (default)\n" diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c index f4574a2..835fb96 100644 --- a/example/packet/odp_pktio.c +++ b/example/packet/odp_pktio.c @@ -695,7 +695,6 @@ static void usage(char *progname) " -h, --help Display help and exit.\n" " environment variables: ODP_PKTIO_DISABLE_SOCKET_MMAP\n" " ODP_PKTIO_DISABLE_SOCKET_MMSG\n" - " ODP_PKTIO_DISABLE_SOCKET_BASIC\n" " can be used to advanced pkt I/O selection for linux-generic\n" "\n", NO_PATH(progname), NO_PATH(progname) ); diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index 5ae3718..6ad3308 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -105,7 +105,6 @@ static inline pktio_entry_t *get_pktio_entry(odp_pktio_t pktio) int pktin_poll(pktio_entry_t *entry); -extern const pktio_if_ops_t sock_basic_pktio_ops; extern const pktio_if_ops_t sock_mmsg_pktio_ops; extern const pktio_if_ops_t sock_mmap_pktio_ops; extern const pktio_if_ops_t loopback_pktio_ops; diff --git a/platform/linux-generic/include/odp_packet_socket.h b/platform/linux-generic/include/odp_packet_socket.h index 5a3fd48..d5427d9 100644 --- a/platform/linux-generic/include/odp_packet_socket.h +++ b/platform/linux-generic/include/odp_packet_socket.h @@ -43,9 +43,6 @@ typedef struct { int sockfd; /**< socket descriptor */ odp_pool_t pool; /**< pool to alloc packets from */ - size_t buf_size; /**< size of buffer payload in 'pool' */ - size_t max_frame_len; /**< max frame len = buf_size - sizeof(pkt_hdr) */ - size_t frame_offset; /**< frame start offset from start of pkt buf */ unsigned char if_mac[ETH_ALEN]; /**< IF eth mac addr */ } pkt_sock_t; diff --git a/platform/linux-generic/pktio/io_ops.c b/platform/linux-generic/pktio/io_ops.c index 6cd3d00..1d47e74 100644 --- a/platform/linux-generic/pktio/io_ops.c +++ b/platform/linux-generic/pktio/io_ops.c @@ -14,6 +14,5 @@ const pktio_if_ops_t * const pktio_if_ops[] = { &loopback_pktio_ops, &sock_mmap_pktio_ops, &sock_mmsg_pktio_ops, - &sock_basic_pktio_ops, NULL }; diff --git a/platform/linux-generic/pktio/socket.c b/platform/linux-generic/pktio/socket.c index 55c3594..45040fd 100644 --- a/platform/linux-generic/pktio/socket.c +++ b/platform/linux-generic/pktio/socket.c @@ -89,7 +89,6 @@ int sendmmsg(int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags) sizeof(uint32_t)) + ETHBUF_OFFSET) /* - * ODP_PACKET_SOCKET_BASIC: * ODP_PACKET_SOCKET_MMSG: * ODP_PACKET_SOCKET_MMAP: */ @@ -108,7 +107,6 @@ int mtu_get_fd(int fd, const char *name) } /* - * ODP_PACKET_SOCKET_BASIC: * ODP_PACKET_SOCKET_MMSG: * ODP_PACKET_SOCKET_MMAP: */ @@ -138,7 +136,6 @@ int promisc_mode_set_fd(int fd, const char *name, int enable) } /* - * ODP_PACKET_SOCKET_BASIC: * ODP_PACKET_SOCKET_MMSG: * ODP_PACKET_SOCKET_MMAP: */ @@ -158,7 +155,6 @@ int promisc_mode_get_fd(int fd, const char *name) } /* - * ODP_PACKET_SOCKET_BASIC: * ODP_PACKET_SOCKET_MMSG: */ static int sock_close(pktio_entry_t *pktio_entry) @@ -174,7 +170,6 @@ static int sock_close(pktio_entry_t *pktio_entry) } /* - * ODP_PACKET_SOCKET_BASIC: * ODP_PACKET_SOCKET_MMSG: */ static int sock_setup_pkt(pktio_entry_t *pktio_entry, const char *netdev, @@ -196,15 +191,6 @@ static int sock_setup_pkt(pktio_entry_t *pktio_entry, const char *netdev, return -1; pkt_sock->pool = pool; - /* Store eth buffer offset for pkt buffers from this pool */ - pkt_sock->frame_offset = 0; - /* pkt buffer size */ - pkt_sock->buf_size = odp_buffer_pool_segment_size(pool); - /* max frame len taking into account the l2-offset */ - pkt_sock->max_frame_len = pkt_sock->buf_size - - odp_buffer_pool_headroom(pool) - - odp_buffer_pool_tailroom(pool); - sockfd = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); if (sockfd == -1) { __odp_errno = errno; @@ -257,18 +243,6 @@ error: } /* - * ODP_PACKET_SOCKET_BASIC: - */ -static int sock_basic_open(odp_pktio_t id ODP_UNUSED, - pktio_entry_t *pktio_entry, - const char *devname, odp_pool_t pool) -{ - if (getenv("ODP_PKTIO_DISABLE_SOCKET_BASIC")) - return -1; - return sock_setup_pkt(pktio_entry, devname, pool); -} - -/* * ODP_PACKET_SOCKET_MMSG: */ static int sock_mmsg_open(odp_pktio_t id ODP_UNUSED, @@ -280,107 +254,31 @@ static int sock_mmsg_open(odp_pktio_t id ODP_UNUSED, return sock_setup_pkt(pktio_entry, devname, pool); } -/* - * ODP_PACKET_SOCKET_BASIC: - */ -static int sock_basic_recv(pktio_entry_t *pktio_entry, - odp_packet_t pkt_table[], unsigned len) +static uint32_t _rx_pkt_to_iovec(odp_packet_t pkt, + struct iovec iovecs[ODP_BUFFER_MAX_SEG]) { - pkt_sock_t *pkt_sock = &pktio_entry->s.pkt_sock; - ssize_t recv_bytes; - unsigned i; - struct sockaddr_ll sll; - socklen_t addrlen = sizeof(sll); - int const sockfd = pkt_sock->sockfd; - odp_packet_t pkt = ODP_PACKET_INVALID; - uint8_t *pkt_buf; - int nb_rx = 0; - - /* recvfrom: - * If the address argument is not a null pointer - * and the protocol does not provide the source address of - * messages, the the value stored in the object pointed to - * by address is unspecified. - */ - memset(&sll, 0, sizeof(sll)); - - for (i = 0; i < len; i++) { - if (odp_likely(pkt == ODP_PACKET_INVALID)) { - pkt = odp_packet_alloc(pkt_sock->pool, - pkt_sock->max_frame_len); - if (odp_unlikely(pkt == ODP_PACKET_INVALID)) - break; + odp_packet_seg_t seg = odp_packet_first_seg(pkt); + uint32_t seg_count = odp_packet_num_segs(pkt); + uint32_t seg_id = 0; + uint32_t iov_count = 0; + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + uint8_t *ptr; + uint32_t seglen; + + for (seg_id = 0; seg_id < seg_count; ++seg_id) { + ptr = segment_map(&pkt_hdr->buf_hdr, (odp_buffer_seg_t)seg, + &seglen, pkt_hdr->frame_len, + pkt_hdr->headroom); + + if (ptr) { + iovecs[iov_count].iov_base = ptr; + iovecs[iov_count].iov_len = seglen; + iov_count++; } + seg = odp_packet_next_seg(pkt, seg); + } - pkt_buf = odp_packet_data(pkt); - - recv_bytes = recvfrom(sockfd, pkt_buf, - pkt_sock->max_frame_len, MSG_DONTWAIT, - (struct sockaddr *)&sll, &addrlen); - /* no data or error: free recv buf and break out of loop */ - if (odp_unlikely(recv_bytes < 1)) - break; - /* frame not explicitly for us, reuse pkt buf for next frame */ - if (odp_unlikely(sll.sll_pkttype == PACKET_OUTGOING)) - continue; - - /* Parse and set packet header data */ - odp_packet_pull_tail(pkt, pkt_sock->max_frame_len - recv_bytes); - _odp_packet_reset_parse(pkt); - - pkt_table[nb_rx] = pkt; - pkt = ODP_PACKET_INVALID; - nb_rx++; - } /* end for() */ - - if (odp_unlikely(pkt != ODP_PACKET_INVALID)) - odp_packet_free(pkt); - - return nb_rx; -} - -/* - * ODP_PACKET_SOCKET_BASIC: - */ -static int sock_basic_send(pktio_entry_t *pktio_entry, - odp_packet_t pkt_table[], unsigned len) -{ - pkt_sock_t *pkt_sock = &pktio_entry->s.pkt_sock; - odp_packet_t pkt; - uint8_t *frame; - uint32_t frame_len; - unsigned i; - unsigned flags; - int sockfd; - unsigned nb_tx; - int ret; - - sockfd = pkt_sock->sockfd; - flags = MSG_DONTWAIT; - i = 0; - while (i < len) { - pkt = pkt_table[i]; - - frame = odp_packet_l2_ptr(pkt, &frame_len); - - ret = send(sockfd, frame, frame_len, flags); - if (odp_unlikely(ret == -1)) { - if (odp_likely(errno == EAGAIN)) { - flags = 0; /* blocking for next rounds */ - continue; /* resend buffer */ - } else { - break; - } - } - - i++; - } /* end while */ - nb_tx = i; - - for (i = 0; i < nb_tx; i++) - odp_packet_free(pkt_table[i]); - - return nb_tx; + return iov_count; } /* @@ -393,9 +291,7 @@ static int sock_mmsg_recv(pktio_entry_t *pktio_entry, const int sockfd = pkt_sock->sockfd; int msgvec_len; struct mmsghdr msgvec[ODP_PACKET_SOCKET_MAX_BURST_RX]; - struct iovec iovecs[ODP_PACKET_SOCKET_MAX_BURST_RX]; - uint8_t *pkt_buf; - uint8_t *l2_hdr; + struct iovec iovecs[ODP_PACKET_SOCKET_MAX_BURST_RX][ODP_BUFFER_MAX_SEG]; int nb_rx = 0; int recv_msgs; int i; @@ -406,17 +302,14 @@ static int sock_mmsg_recv(pktio_entry_t *pktio_entry, memset(msgvec, 0, sizeof(msgvec)); for (i = 0; i < (int)len; i++) { - pkt_table[i] = odp_packet_alloc(pkt_sock->pool, - pkt_sock->max_frame_len); + pkt_table[i] = _odp_packet_alloc(pkt_sock->pool); if (odp_unlikely(pkt_table[i] == ODP_PACKET_INVALID)) break; - pkt_buf = odp_packet_data(pkt_table[i]); - l2_hdr = pkt_buf + pkt_sock->frame_offset; - iovecs[i].iov_base = l2_hdr; - iovecs[i].iov_len = pkt_sock->max_frame_len; - msgvec[i].msg_hdr.msg_iov = &iovecs[i]; - msgvec[i].msg_hdr.msg_iovlen = 1; + msgvec[i].msg_hdr.msg_iovlen = + _rx_pkt_to_iovec(pkt_table[i], iovecs[i]); + + msgvec[i].msg_hdr.msg_iov = iovecs[i]; } msgvec_len = i; /* number of successfully allocated pkt buffers */ @@ -435,7 +328,7 @@ static int sock_mmsg_recv(pktio_entry_t *pktio_entry, /* Parse and set packet header data */ odp_packet_pull_tail(pkt_table[i], - pkt_sock->max_frame_len - + odp_packet_len(pkt_table[i]) - msgvec[i].msg_len); _odp_packet_reset_parse(pkt_table[i]); @@ -450,6 +343,25 @@ static int sock_mmsg_recv(pktio_entry_t *pktio_entry, return nb_rx; } +static uint32_t _tx_pkt_to_iovec(odp_packet_t pkt, + struct iovec iovecs[ODP_BUFFER_MAX_SEG]) +{ + uint32_t pkt_len = odp_packet_len(pkt); + uint32_t offset = odp_packet_l2_offset(pkt); + uint32_t iov_count = 0; + + while (offset < pkt_len) { + uint32_t seglen; + + iovecs[iov_count].iov_base = odp_packet_offset(pkt, offset, + &seglen, NULL); + iovecs[iov_count].iov_len = seglen; + iov_count++; + offset += seglen; + } + return iov_count; +} + /* * ODP_PACKET_SOCKET_MMSG: */ @@ -458,7 +370,7 @@ static int sock_mmsg_send(pktio_entry_t *pktio_entry, { pkt_sock_t *pkt_sock = &pktio_entry->s.pkt_sock; struct mmsghdr msgvec[ODP_PACKET_SOCKET_MAX_BURST_TX]; - struct iovec iovecs[ODP_PACKET_SOCKET_MAX_BURST_TX]; + struct iovec iovecs[ODP_PACKET_SOCKET_MAX_BURST_TX][ODP_BUFFER_MAX_SEG]; int ret; int sockfd; unsigned i; @@ -472,12 +384,9 @@ static int sock_mmsg_send(pktio_entry_t *pktio_entry, memset(msgvec, 0, sizeof(msgvec)); for (i = 0; i < len; i++) { - uint32_t seglen; - - iovecs[i].iov_base = odp_packet_l2_ptr(pkt_table[i], &seglen); - iovecs[i].iov_len = seglen; - msgvec[i].msg_hdr.msg_iov = &iovecs[i]; - msgvec[i].msg_hdr.msg_iovlen = 1; + msgvec[i].msg_hdr.msg_iov = iovecs[i]; + msgvec[i].msg_hdr.msg_iovlen = _tx_pkt_to_iovec(pkt_table[i], + iovecs[i]); } flags = MSG_DONTWAIT; @@ -494,7 +403,6 @@ static int sock_mmsg_send(pktio_entry_t *pktio_entry, } /* - * ODP_PACKET_SOCKET_BASIC: * ODP_PACKET_SOCKET_MMSG: */ static int sock_mtu_get(pktio_entry_t *pktio_entry) @@ -503,7 +411,6 @@ static int sock_mtu_get(pktio_entry_t *pktio_entry) } /* - * ODP_PACKET_SOCKET_BASIC: * ODP_PACKET_SOCKET_MMSG: */ static int sock_mac_addr_get(pktio_entry_t *pktio_entry, @@ -514,7 +421,6 @@ static int sock_mac_addr_get(pktio_entry_t *pktio_entry, } /* - * ODP_PACKET_SOCKET_BASIC: * ODP_PACKET_SOCKET_MMSG: */ static int sock_promisc_mode_set(pktio_entry_t *pktio_entry, @@ -525,7 +431,6 @@ static int sock_promisc_mode_set(pktio_entry_t *pktio_entry, } /* - * ODP_PACKET_SOCKET_BASIC: * ODP_PACKET_SOCKET_MMSG: */ static int sock_promisc_mode_get(pktio_entry_t *pktio_entry) @@ -534,19 +439,6 @@ static int sock_promisc_mode_get(pktio_entry_t *pktio_entry) pktio_entry->s.name); } -const pktio_if_ops_t sock_basic_pktio_ops = { - .init = NULL, - .term = NULL, - .open = sock_basic_open, - .close = sock_close, - .recv = sock_basic_recv, - .send = sock_basic_send, - .mtu_get = sock_mtu_get, - .promisc_mode_set = sock_promisc_mode_set, - .promisc_mode_get = sock_promisc_mode_get, - .mac_get = sock_mac_addr_get -}; - const pktio_if_ops_t sock_mmsg_pktio_ops = { .init = NULL, .term = NULL, diff --git a/platform/linux-generic/test/pktio/pktio_run b/platform/linux-generic/test/pktio/pktio_run index 9a70ac4..76a8419 100755 --- a/platform/linux-generic/test/pktio/pktio_run +++ b/platform/linux-generic/test/pktio/pktio_run @@ -49,11 +49,11 @@ run_test() # the linux-generic implementation uses environment variables to # control which socket method is used, so try each combination to # ensure decent coverage. - for distype in MMAP MMSG BASIC; do + for distype in MMAP MMSG; do unset ODP_PKTIO_DISABLE_SOCKET_${distype} done - for distype in SKIP MMAP MMSG; do + for distype in SKIP MMAP; do if [ "$disabletype" != "SKIP" ]; then export ODP_PKTIO_DISABLE_SOCKET_${distype}=y fi diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c index 366bb15..db26a58 100644 --- a/test/performance/odp_l2fwd.c +++ b/test/performance/odp_l2fwd.c @@ -706,7 +706,6 @@ static void usage(char *progname) " -h, --help Display help and exit.\n\n" " environment variables: ODP_PKTIO_DISABLE_SOCKET_MMAP\n" " ODP_PKTIO_DISABLE_SOCKET_MMSG\n" - " ODP_PKTIO_DISABLE_SOCKET_BASIC\n" " can be used to advanced pkt I/O selection for linux-generic\n" "\n", NO_PATH(progname), NO_PATH(progname) ); diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c index ebe34fa..33a672a 100644 --- a/test/validation/pktio/pktio.c +++ b/test/validation/pktio/pktio.c @@ -47,6 +47,12 @@ typedef struct ODP_PACKED { uint32be_t magic; } pkt_tail_t; +/** Run mode */ +typedef enum { + PKT_POOL_UNSEGMENTED, + PKT_POOL_SEGMENTED, +} pkt_segmented_e +; /** size of transmitted packets */ static uint32_t packet_len = PKT_LEN_NORMAL; @@ -56,8 +62,27 @@ odp_pool_t default_pkt_pool = ODP_POOL_INVALID; /** sequence number of IP packets */ odp_atomic_u32_t ip_seq; +/** Type of pool segmentation */ +pkt_segmented_e pool_segmentation = PKT_POOL_UNSEGMENTED; + odp_pool_t pool[MAX_NUM_IFACES] = {ODP_POOL_INVALID, ODP_POOL_INVALID}; +static void set_pool_len(odp_pool_param_t *params) +{ + switch (pool_segmentation) { + case PKT_POOL_SEGMENTED: + /* Force segment to minimum size */ + params->pkt.seg_len = 0; + params->pkt.len = PKT_BUF_SIZE; + break; + case PKT_POOL_UNSEGMENTED: + default: + params->pkt.seg_len = PKT_BUF_SIZE; + params->pkt.len = PKT_BUF_SIZE; + break; + } +} + static void pktio_pkt_set_macs(odp_packet_t pkt, pktio_info_t *src, pktio_info_t *dst) { @@ -203,17 +228,19 @@ static int pktio_fixup_checksums(odp_packet_t pkt) static int default_pool_create(void) { odp_pool_param_t params; + char pool_name[ODP_POOL_NAME_LEN]; if (default_pkt_pool != ODP_POOL_INVALID) return -1; memset(¶ms, 0, sizeof(params)); - params.pkt.seg_len = PKT_BUF_SIZE; - params.pkt.len = PKT_BUF_SIZE; + set_pool_len(¶ms); params.pkt.num = PKT_BUF_NUM; params.type = ODP_POOL_PACKET; - default_pkt_pool = odp_pool_create("pkt_pool_default", ¶ms); + snprintf(pool_name, sizeof(pool_name), + "pkt_pool_default_%d", pool_segmentation); + default_pkt_pool = odp_pool_create(pool_name, ¶ms); if (default_pkt_pool == ODP_POOL_INVALID) return -1; @@ -632,12 +659,12 @@ static int create_pool(const char *iface, int num) odp_pool_param_t params; memset(¶ms, 0, sizeof(params)); - params.pkt.seg_len = PKT_BUF_SIZE; - params.pkt.len = PKT_BUF_SIZE; + set_pool_len(¶ms); params.pkt.num = PKT_BUF_NUM; params.type = ODP_POOL_PACKET; - snprintf(pool_name, sizeof(pool_name), "pkt_pool_%s", iface); + snprintf(pool_name, sizeof(pool_name), "pkt_pool_%s_%d", + iface, pool_segmentation); pool[num] = odp_pool_create(pool_name, ¶ms); if (ODP_POOL_INVALID == pool[num]) { @@ -648,7 +675,7 @@ static int create_pool(const char *iface, int num) return 0; } -int pktio_suite_init(void) +static int pktio_suite_init(void) { odp_atomic_init_u32(&ip_seq, 0); iface_name[0] = getenv("ODP_PKTIO_IF0"); @@ -680,6 +707,18 @@ int pktio_suite_init(void) return 0; } +int pktio_suite_init_unsegmented(void) +{ + pool_segmentation = PKT_POOL_UNSEGMENTED; + return pktio_suite_init(); +} + +int pktio_suite_init_segmented(void) +{ + pool_segmentation = PKT_POOL_SEGMENTED; + return pktio_suite_init(); +} + int pktio_suite_term(void) { char pool_name[ODP_POOL_NAME_LEN]; @@ -689,7 +728,7 @@ int pktio_suite_term(void) for (i = 0; i < num_ifaces; ++i) { snprintf(pool_name, sizeof(pool_name), - "pkt_pool_%s", iface_name[i]); + "pkt_pool_%s_%d", iface_name[i], pool_segmentation); pool = odp_pool_lookup(pool_name); if (pool == ODP_POOL_INVALID) continue; @@ -705,11 +744,12 @@ int pktio_suite_term(void) fprintf(stderr, "error: failed to destroy default pool\n"); ret = -1; } + default_pkt_pool = ODP_POOL_INVALID; return ret; } -CU_TestInfo pktio_suite[] = { +CU_TestInfo pktio_suite_unsegmented[] = { {"pktio open", pktio_test_open}, {"pktio lookup", pktio_test_lookup}, {"pktio inq", pktio_test_inq}, @@ -725,9 +765,20 @@ CU_TestInfo pktio_suite[] = { CU_TEST_INFO_NULL }; +CU_TestInfo pktio_suite_segmented[] = { + {"pktio poll queues", pktio_test_poll_queue}, + {"pktio poll multi", pktio_test_poll_multi}, + {"pktio sched queues", pktio_test_sched_queue}, + {"pktio sched multi", pktio_test_sched_multi}, + {"pktio jumbo frames", pktio_test_jumbo}, + CU_TEST_INFO_NULL +}; + CU_SuiteInfo pktio_suites[] = { - {"Packet I/O", - pktio_suite_init, pktio_suite_term, NULL, NULL, pktio_suite}, + {"Packet I/O Unsegmented", pktio_suite_init_unsegmented, + pktio_suite_term, NULL, NULL, pktio_suite_unsegmented}, + {"Packet I/O Segmented", pktio_suite_init_segmented, + pktio_suite_term, NULL, NULL, pktio_suite_segmented}, CU_SUITE_INFO_NULL }; diff --git a/test/validation/pktio/pktio.h b/test/validation/pktio/pktio.h index 1749d5d..feaf7fb 100644 --- a/test/validation/pktio/pktio.h +++ b/test/validation/pktio/pktio.h @@ -28,7 +28,8 @@ extern CU_TestInfo pktio_suite[]; /* test array init/term functions: */ int pktio_suite_term(void); -int pktio_suite_init(void); +int pktio_suite_init_segmented(void); +int pktio_suite_init_unsegmented(void); /* test registry: */ extern CU_SuiteInfo pktio_suites[]; |