net/tap: remove minimum packet size in Rx
authorPascal Mazon <pascal.mazon@6wind.com>
Thu, 30 Mar 2017 08:52:48 +0000 (10:52 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 4 Apr 2017 17:03:02 +0000 (19:03 +0200)
With support for segmented packets, it is now possible to easily receive
packets of many sizes, given an adequate number of descriptors.

Remove limitation on the minimum size of mbuf: on reception, if a packet
won't fit in the queue's mbufs, it will be detected in the packet info
and the packet will be discarded.

Fixes: 0781f5762cfe ("net/tap: support segmented mbufs")

Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
drivers/net/tap/rte_eth_tap.c

index 6567bba..d8322e8 100644 (file)
@@ -860,7 +860,6 @@ tap_rx_queue_setup(struct rte_eth_dev *dev,
        struct rte_mbuf **tmp = &rxq->pool;
        struct iovec (*iovecs)[nb_rx_desc + 1];
        int data_off = RTE_PKTMBUF_HEADROOM;
-       uint16_t buf_size;
        int ret = 0;
        int fd;
        int i;
@@ -886,18 +885,6 @@ tap_rx_queue_setup(struct rte_eth_dev *dev,
        }
        rxq->iovecs = iovecs;
 
-       /* Now get the space available for data in the mbuf */
-       buf_size = (uint16_t)(rte_pktmbuf_data_room_size(mp) -
-                               RTE_PKTMBUF_HEADROOM);
-
-       if (buf_size < ETH_FRAME_LEN) {
-               RTE_LOG(WARNING, PMD,
-                       "%s: %d bytes will not fit in mbuf (%d bytes)\n",
-                       dev->data->name, ETH_FRAME_LEN, buf_size);
-               ret = -ENOMEM;
-               goto error;
-       }
-
        fd = rx_setup_queue(dev, internals, rx_queue_id);
        if (fd == -1) {
                ret = fd;