Signed-off-by: Nicolas Morey-Chaisemartin <[email protected]>
---
example/generator/odp_generator.c | 1 -
example/ipsec/odp_ipsec.c | 1 -
example/packet/odp_pktio.c | 1 -
.../linux-generic/include/odp_packet_io_internal.h | 1 -
platform/linux-generic/pktio/io_ops.c | 1 -
platform/linux-generic/pktio/socket.c | 135 ---------------------
platform/linux-generic/test/pktio/pktio_run | 4 +-
test/performance/odp_l2fwd.c | 1 -
8 files changed, 2 insertions(+), 143 deletions(-)
diff --git a/example/generator/odp_generator.c
b/example/generator/odp_generator.c
index d35f4aa..42cc877 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -1037,7 +1037,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 134245c..6c48272 100644
--- a/example/ipsec/odp_ipsec.c
+++ b/example/ipsec/odp_ipsec.c
@@ -1583,7 +1583,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 040571b..8dab0e6 100644
--- a/example/packet/odp_pktio.c
+++ b/example/packet/odp_pktio.c
@@ -680,7 +680,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 f230936..225bbf3 100644
--- a/platform/linux-generic/include/odp_packet_io_internal.h
+++ b/platform/linux-generic/include/odp_packet_io_internal.h
@@ -102,7 +102,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/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 9bd4e8f..4a9cd97 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_pkt(pktio_entry_t *pktio_entry)
@@ -174,7 +170,6 @@ static int sock_close_pkt(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,
@@ -254,18 +249,6 @@ error:
}
/*
- * ODP_PACKET_SOCKET_BASIC:
- */
-static int sock_basic_init(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_init(odp_pktio_t id ODP_UNUSED,
@@ -278,109 +261,6 @@ static int sock_mmsg_init(odp_pktio_t id ODP_UNUSED,
}
/*
- * ODP_PACKET_SOCKET_BASIC:
- */
-static int sock_basic_recv_pkt(pktio_entry_t *pktio_entry,
- odp_packet_t pkt_table[], unsigned len)
-{
- 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;
- }
-
- 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_pkt(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;
-}
-
-/*
* ODP_PACKET_SOCKET_MMSG:
*/
static int sock_mmsg_recv_pkt(pktio_entry_t *pktio_entry,
@@ -491,7 +371,6 @@ static int sock_mmsg_send_pkt(pktio_entry_t *pktio_entry,
}
/*
- * ODP_PACKET_SOCKET_BASIC:
* ODP_PACKET_SOCKET_MMSG:
*/
static int sock_mtu_get(pktio_entry_t *pktio_entry)
@@ -500,7 +379,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,
@@ -511,7 +389,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,
@@ -522,7 +399,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)
@@ -531,17 +407,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 = {
- .open = sock_basic_init,
- .close = sock_close_pkt,
- .recv = sock_basic_recv_pkt,
- .send = sock_basic_send_pkt,
- .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 = {
.open = sock_mmsg_init,
.close = sock_close_pkt,
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 a408c7d..17ea004 100644
--- a/test/performance/odp_l2fwd.c
+++ b/test/performance/odp_l2fwd.c
@@ -691,7 +691,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)
);
--
2.5.0.rc2.3.g9ad628c
_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp