diff mbox

[dpdk-dev,2/6] fm10k: Fix jumbo frame issue

Message ID 1432887044-24777-3-git-send-email-jing.d.chen@intel.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Chen, Jing D May 29, 2015, 8:10 a.m. UTC
From: "Chen Jing D(Mark)" <jing.d.chen@intel.com>

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.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
---
 drivers/net/fm10k/fm10k_ethdev.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

Comments

Michael Qiu June 12, 2015, 1:15 a.m. UTC | #1
Tested-by: Michael Qiu <michael.qiu@intel.com>

- OS: Fedora20  3.11.10-301
- GCC: gcc version 4.8.3 2014911
- CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
- NIC: Ethernet controller: Intel Corporation Device 15a4 (rev 01)
- Default x86_64-native-linuxapp-gcc configuration
- Total 5 cases, 5 passed, 0 failed

- Case: Normal frames with no jumbo frame support
- Case: Jumbo frames with no jumbo frame support
- Case: Normal frames with jumbo frame support
- Case: Jumbo frames with jumbo frame support
- Case: Frames bigger than jumbo frames, wwith jumbo frame support


On 5/29/2015 4:11 PM, Chen, Jing D wrote:
> From: "Chen Jing D(Mark)" <jing.d.chen@intel.com>
>
> 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.
>
> Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
> ---
>  drivers/net/fm10k/fm10k_ethdev.c |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
> index a5e09a0..19e718b 100644
> --- a/drivers/net/fm10k/fm10k_ethdev.c
> +++ b/drivers/net/fm10k/fm10k_ethdev.c
> @@ -439,9 +439,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 */
> @@ -452,11 +457,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;
diff mbox

Patch

diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index a5e09a0..19e718b 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -439,9 +439,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 */
@@ -452,11 +457,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;