fm10k: fix jumbo frame issue
authorChen Jing D(Mark) <jing.d.chen@intel.com>
Fri, 29 May 2015 08:10:40 +0000 (16:10 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 22 Jun 2015 15:27:58 +0000 (17:27 +0200)
fm10k can't receive frame greater than 1536 and Scatter RX
function can't work correctly. The root cause is
SRRCTL.FM10K_SRRCTL_BUFFER_CHAINING_EN bit is not enabled.

Test report: http://dpdk.org/ml/archives/dev/2015-June/019242.html

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
Acked-by: Shaopeng He <shaopeng.he@intel.com>
Tested-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
drivers/net/fm10k/fm10k_ethdev.c

index c87c6f9..926ac06 100644 (file)
@@ -444,9 +444,14 @@ fm10k_dev_rx_init(struct rte_eth_dev *dev)
 
                /* It adds dual VLAN length for supporting dual VLAN */
                if ((dev->data->dev_conf.rxmode.max_rx_pkt_len +
-                               2 * FM10K_VLAN_TAG_SIZE) > buf_size){
+                               2 * FM10K_VLAN_TAG_SIZE) > buf_size ||
+                       dev->data->dev_conf.rxmode.enable_scatter) {
+                       uint32_t reg;
                        dev->data->scattered_rx = 1;
                        dev->rx_pkt_burst = fm10k_recv_scattered_pkts;
+                       reg = FM10K_READ_REG(hw, FM10K_SRRCTL(i));
+                       reg |= FM10K_SRRCTL_BUFFER_CHAINING_EN;
+                       FM10K_WRITE_REG(hw, FM10K_SRRCTL(i), reg);
                }
 
                /* Enable drop on empty, it's RO for VF */
@@ -457,11 +462,6 @@ fm10k_dev_rx_init(struct rte_eth_dev *dev)
                FM10K_WRITE_FLUSH(hw);
        }
 
-       if (dev->data->dev_conf.rxmode.enable_scatter) {
-               dev->rx_pkt_burst = fm10k_recv_scattered_pkts;
-               dev->data->scattered_rx = 1;
-       }
-
        /* Configure RSS if applicable */
        fm10k_dev_mq_rx_configure(dev);
        return 0;