Signed-off-by: Nicolas Morey-Chaisemartin <nmo...@kalray.eu>
---
 example/generator/odp_generator.c                  |   1 -
 example/packet/odp_pktio.c                         |   1 -
 .../linux-generic/include/odp_packet_io_internal.h |   3 +-
 platform/linux-generic/odp_packet_io.c             |  18 ----
 platform/linux-generic/odp_packet_socket.c         | 103 ---------------------
 platform/linux-generic/test/pktio/pktio_run        |   2 +-
 test/performance/odp_l2fwd.c                       |   1 -
 7 files changed, 2 insertions(+), 127 deletions(-)

diff --git a/example/generator/odp_generator.c 
b/example/generator/odp_generator.c
index 0ff264c..d932a08 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -1034,7 +1034,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/packet/odp_pktio.c b/example/packet/odp_pktio.c
index f08d9f4..f9b2622 100644
--- a/example/packet/odp_pktio.c
+++ b/example/packet/odp_pktio.c
@@ -667,7 +667,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 18b59ef..a78a847 100644
--- a/platform/linux-generic/include/odp_packet_io_internal.h
+++ b/platform/linux-generic/include/odp_packet_io_internal.h
@@ -32,8 +32,7 @@ extern "C" {
  * Packet IO types
  */
 typedef enum {
-       ODP_PKTIO_TYPE_SOCKET_BASIC = 0x1,
-       ODP_PKTIO_TYPE_SOCKET_MMSG,
+       ODP_PKTIO_TYPE_SOCKET_MMSG = 0x1,
        ODP_PKTIO_TYPE_SOCKET_MMAP,
        ODP_PKTIO_TYPE_LOOPBACK,
 } odp_pktio_type_t;
diff --git a/platform/linux-generic/odp_packet_io.c 
b/platform/linux-generic/odp_packet_io.c
index 5ae24b9..f153bb9 100644
--- a/platform/linux-generic/odp_packet_io.c
+++ b/platform/linux-generic/odp_packet_io.c
@@ -210,13 +210,6 @@ static int init_socket(pktio_entry_t *entry, const char 
*dev,
                        close_pkt_sock(&entry->s.pkt_sock);
        }
 
-       if (fd == -1 && getenv("ODP_PKTIO_DISABLE_SOCKET_BASIC") == NULL) {
-               entry->s.type = ODP_PKTIO_TYPE_SOCKET_BASIC;
-               fd = setup_pkt_sock(&entry->s.pkt_sock, dev, pool);
-               if (fd == -1)
-                       close_pkt_sock(&entry->s.pkt_sock);
-       }
-
        if (fd == -1)
                return -1;
 
@@ -313,7 +306,6 @@ int odp_pktio_close(odp_pktio_t id)
        lock_entry(entry);
        if (!is_free(entry)) {
                switch (entry->s.type) {
-               case ODP_PKTIO_TYPE_SOCKET_BASIC:
                case ODP_PKTIO_TYPE_SOCKET_MMSG:
                        res  = close_pkt_sock(&entry->s.pkt_sock);
                        break;
@@ -395,10 +387,6 @@ int odp_pktio_recv(odp_pktio_t id, odp_packet_t 
pkt_table[], int len)
 
        lock_entry(pktio_entry);
        switch (pktio_entry->s.type) {
-       case ODP_PKTIO_TYPE_SOCKET_BASIC:
-               pkts = recv_pkt_sock_basic(&pktio_entry->s.pkt_sock,
-                               pkt_table, len);
-               break;
        case ODP_PKTIO_TYPE_SOCKET_MMSG:
                pkts = recv_pkt_sock_mmsg(&pktio_entry->s.pkt_sock,
                                pkt_table, len);
@@ -449,10 +437,6 @@ int odp_pktio_send(odp_pktio_t id, odp_packet_t 
pkt_table[], int len)
 
        lock_entry(pktio_entry);
        switch (pktio_entry->s.type) {
-       case ODP_PKTIO_TYPE_SOCKET_BASIC:
-               pkts = send_pkt_sock_basic(&pktio_entry->s.pkt_sock,
-                               pkt_table, len);
-               break;
        case ODP_PKTIO_TYPE_SOCKET_MMSG:
                pkts = send_pkt_sock_mmsg(&pktio_entry->s.pkt_sock,
                                pkt_table, len);
@@ -725,7 +709,6 @@ int pktin_poll(pktio_entry_t *entry)
 static int sockfd_from_pktio_entry(pktio_entry_t *entry)
 {
        switch (entry->s.type) {
-       case ODP_PKTIO_TYPE_SOCKET_BASIC:
        case ODP_PKTIO_TYPE_SOCKET_MMSG:
                return entry->s.pkt_sock.sockfd;
        case ODP_PKTIO_TYPE_SOCKET_MMAP:
@@ -897,7 +880,6 @@ int odp_pktio_mac_addr(odp_pktio_t id, void *mac_addr, int 
addr_size)
        }
 
        switch (entry->s.type) {
-       case ODP_PKTIO_TYPE_SOCKET_BASIC:
        case ODP_PKTIO_TYPE_SOCKET_MMSG:
                memcpy(mac_addr, entry->s.pkt_sock.if_mac,
                       ETH_ALEN);
diff --git a/platform/linux-generic/odp_packet_socket.c 
b/platform/linux-generic/odp_packet_socket.c
index 9272146..c0f7a55 100644
--- a/platform/linux-generic/odp_packet_socket.c
+++ b/platform/linux-generic/odp_packet_socket.c
@@ -119,7 +119,6 @@ static int set_pkt_sock_fanout_mmap(pkt_sock_mmap_t *const 
pkt_sock,
 }
 
 /*
- * ODP_PACKET_SOCKET_BASIC:
  * ODP_PACKET_SOCKET_MMSG:
  */
 int setup_pkt_sock(pkt_sock_t *const pkt_sock, const char *netdev,
@@ -192,7 +191,6 @@ error:
 }
 
 /*
- * ODP_PACKET_SOCKET_BASIC:
  * ODP_PACKET_SOCKET_MMSG:
  */
 int close_pkt_sock(pkt_sock_t *const pkt_sock)
@@ -207,107 +205,6 @@ int close_pkt_sock(pkt_sock_t *const pkt_sock)
 }
 
 /*
- * ODP_PACKET_SOCKET_BASIC:
- */
-int recv_pkt_sock_basic(pkt_sock_t *const pkt_sock,
-                       odp_packet_t pkt_table[], unsigned len)
-{
-       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:
- */
-int send_pkt_sock_basic(pkt_sock_t *const pkt_sock,
-                       odp_packet_t pkt_table[], unsigned len)
-{
-       odp_packet_t pkt;
-       uint8_t *frame;
-       uint32_t frame_len;
-       unsigned i;
-       unsigned flags;
-       int sockfd;
-       int 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 < len; i++)
-               odp_packet_free(pkt_table[i]);
-
-       return nb_tx;
-}
-
-/*
  * ODP_PACKET_SOCKET_MMSG:
  */
 int recv_pkt_sock_mmsg(pkt_sock_t *const pkt_sock,
diff --git a/platform/linux-generic/test/pktio/pktio_run 
b/platform/linux-generic/test/pktio/pktio_run
index 6c6a503..722b85d 100755
--- a/platform/linux-generic/test/pktio/pktio_run
+++ b/platform/linux-generic/test/pktio/pktio_run
@@ -53,7 +53,7 @@ run_test()
                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 5d4b833..f20c023 100644
--- a/test/performance/odp_l2fwd.c
+++ b/test/performance/odp_l2fwd.c
@@ -678,7 +678,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)
            );
_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to