ixgbe: support dual vlan
authorIntel <intel.com>
Mon, 3 Jun 2013 00:00:00 +0000 (00:00 +0000)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 17 Sep 2013 12:16:08 +0000 (14:16 +0200)
Signed-off-by: Intel
lib/librte_pmd_ixgbe/ixgbe_ethdev.h
lib/librte_pmd_ixgbe/ixgbe_rxtx.c

index 2af2fcb..aa1afdf 100644 (file)
@@ -54,7 +54,7 @@
 #define IXGBE_NB_STAT_MAPPING_REGS  32
 #define IXGBE_EXTENDED_VLAN      (uint32_t)(1 << 26) /* EXTENDED VLAN ENABLE */
 #define IXGBE_VFTA_SIZE 128
-#define IXGBE_RX_BUF_THRESHOLD 4
+#define IXGBE_VLAN_TAG_SIZE 4
 #define IXGBE_MAX_RX_QUEUE_NUM 128
 #ifndef NBBY
 #define NBBY   8       /* number of bits in a byte */
index 9b7ba2c..e7cb269 100644 (file)
@@ -3175,8 +3175,10 @@ ixgbe_dev_rx_init(struct rte_eth_dev *dev)
 
                buf_size = (uint16_t) ((srrctl & IXGBE_SRRCTL_BSIZEPKT_MASK) <<
                                       IXGBE_SRRCTL_BSIZEPKT_SHIFT);
-               if (dev->data->dev_conf.rxmode.max_rx_pkt_len +
-                               IXGBE_RX_BUF_THRESHOLD > buf_size){
+
+               /* It adds dual VLAN length for supporting dual VLAN */
+               if ((dev->data->dev_conf.rxmode.max_rx_pkt_len +
+                               2 * IXGBE_VLAN_TAG_SIZE) > buf_size){
                        dev->data->scattered_rx = 1;
                        dev->rx_pkt_burst = ixgbe_recv_scattered_pkts;
                }
@@ -3474,7 +3476,10 @@ ixgbevf_dev_rx_init(struct rte_eth_dev *dev)
 
                buf_size = (uint16_t) ((srrctl & IXGBE_SRRCTL_BSIZEPKT_MASK) <<
                                       IXGBE_SRRCTL_BSIZEPKT_SHIFT);
-               if (dev->data->dev_conf.rxmode.max_rx_pkt_len > buf_size){
+
+               /* It adds dual VLAN length for supporting dual VLAN */
+               if ((dev->data->dev_conf.rxmode.max_rx_pkt_len +
+                               2 * IXGBE_VLAN_TAG_SIZE) > buf_size) {
                        dev->data->scattered_rx = 1;
                        dev->rx_pkt_burst = ixgbe_recv_scattered_pkts;
                }