net/i40e: fix scattered Rx enabling
authorQi Zhang <qi.z.zhang@intel.com>
Wed, 27 Mar 2019 11:00:05 +0000 (19:00 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 12 Apr 2019 09:02:02 +0000 (11:02 +0200)
No need to add additional vlan tag size for max packet size, since
for i40e, the queue's Rx Max Frame Size (rxq->max_pkt_len) already
includes the vlan header size.

Fixes: a3c83a2527e1 ("net/i40e: enable runtime queue setup")
Fixes: 4861cde46116 ("i40e: new poll mode driver")
Fixes: c1715402df8f ("i40evf: fix jumbo frame support")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/i40e/i40e_ethdev_vf.c
drivers/net/i40e/i40e_rxtx.c

index add7b22..87c45f2 100644 (file)
@@ -1785,9 +1785,8 @@ i40evf_rxq_init(struct rte_eth_dev *dev, struct i40e_rx_queue *rxq)
        }
 
        if ((dev_data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_SCATTER) ||
-           (rxq->max_pkt_len + 2 * I40E_VLAN_TAG_SIZE) > buf_size) {
+           rxq->max_pkt_len > buf_size)
                dev_data->scattered_rx = 1;
-       }
 
        return 0;
 }
index 8f727fa..58ed814 100644 (file)
@@ -1718,7 +1718,7 @@ i40e_dev_rx_queue_setup_runtime(struct rte_eth_dev *dev,
                (uint16_t)(rte_pktmbuf_data_room_size(rxq->mp) -
                           RTE_PKTMBUF_HEADROOM);
        int use_scattered_rx =
-               ((rxq->max_pkt_len + 2 * I40E_VLAN_TAG_SIZE) > buf_size);
+               (rxq->max_pkt_len > buf_size);
 
        if (i40e_rx_queue_init(rxq) != I40E_SUCCESS) {
                PMD_DRV_LOG(ERR,
@@ -2708,9 +2708,8 @@ i40e_rx_queue_init(struct i40e_rx_queue *rxq)
                RTE_PKTMBUF_HEADROOM);
 
        /* Check if scattered RX needs to be used. */
-       if ((rxq->max_pkt_len + 2 * I40E_VLAN_TAG_SIZE) > buf_size) {
+       if (rxq->max_pkt_len > buf_size)
                dev_data->scattered_rx = 1;
-       }
 
        /* Init the RX tail regieter. */
        I40E_PCI_REG_WRITE(rxq->qrx_tail, rxq->nb_rx_desc - 1);