[v4] net/ice: fix setting max frame size

Message ID 20191030100400.3120-1-jiaqix.min@intel.com (mailing list archive)
State Superseded, archived
Delegated to: xiaolong ye
Headers
Series [v4] net/ice: fix setting max frame size |

Checks

Context Check Description
ci/Intel-compilation fail Compilation issues
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-compilation success Compile Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/checkpatch success coding style OK

Commit Message

Min, JiaqiX Oct. 30, 2019, 10:04 a.m. UTC
Max frame size is not set to HW, so packets above the MTU
do not get dropped by HW. The patch fixed the issue.

Fixes: 50370662b727 ("net/ice: support device and queue ops")
Cc: stable@dpdk.org

Signed-off-by: Min JiaqiX <jiaqix.min@intel.com>

---
v4:
* Removed Reviewed-by
* Checked and set defaut max frame size to HW in start ops.
v3:
* Changed Fixes line.
v2:
* Changed commit message.
---
 drivers/net/ice/ice_ethdev.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
  

Comments

Xiaolong Ye Nov. 4, 2019, 2:56 a.m. UTC | #1
On 10/30, Min JiaqiX wrote:
>Max frame size is not set to HW, so packets above the MTU
>do not get dropped by HW. The patch fixed the issue.
>
>Fixes: 50370662b727 ("net/ice: support device and queue ops")
>Cc: stable@dpdk.org
>
>Signed-off-by: Min JiaqiX <jiaqix.min@intel.com>
>
>---
>v4:
>* Removed Reviewed-by
>* Checked and set defaut max frame size to HW in start ops.
>v3:
>* Changed Fixes line.
>v2:
>* Changed commit message.
>---
> drivers/net/ice/ice_ethdev.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
>diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
>index d74675842..d8aa68f07 100644
>--- a/drivers/net/ice/ice_ethdev.c
>+++ b/drivers/net/ice/ice_ethdev.c
>@@ -2724,6 +2724,16 @@ ice_dev_start(struct rte_eth_dev *dev)
> 
> 	pf->adapter_stopped = false;
> 
>+	/* Set the max frame size to default value*/
>+	if (pf->dev_data->dev_conf.rxmode.max_rx_pkt_len == 0) {
>+		pf->dev_data->dev_conf.rxmode.max_rx_pkt_len =
>+			RTE_ETHER_MAX_LEN;

I think ICE_FRAME_SIZE_MAX is more suitable here.

>+	}
>+
>+	/* Set the max frame size to HW*/
>+	ice_aq_set_mac_cfg(hw,
>+		pf->dev_data->dev_conf.rxmode.max_rx_pkt_len, NULL);

What about

	max_frame_size = pf->dev_data->dev_conf.rxmode.max_rx_pkt_len ?
		pf->dev_data->dev_conf.rxmode.max_rx_pkt_len : ICE_FRAME_SIZE_MAX;

	/* Set the max frame size to HW*/
	ice_aq_set_mac_cfg(hw, max_frame_size, NULL);


Thanks,
Xiaolong
>+
> 	return 0;
> 
> 	/* stop the started queues if failed to start all queues */
>-- 
>2.17.1
>
  
Min, JiaqiX Nov. 4, 2019, 7:05 a.m. UTC | #2
Hi, Xiaolong

> -----Original Message-----
> From: Ye, Xiaolong
> Sent: Monday, November 4, 2019 10:57 AM
> To: Min, JiaqiX <jiaqix.min@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v4] net/ice: fix setting max frame size
> 
> On 10/30, Min JiaqiX wrote:
> >Max frame size is not set to HW, so packets above the MTU do not get
> >dropped by HW. The patch fixed the issue.
> >
> >Fixes: 50370662b727 ("net/ice: support device and queue ops")
> >Cc: stable@dpdk.org
> >
> >Signed-off-by: Min JiaqiX <jiaqix.min@intel.com>
> >
> >---
> >v4:
> >* Removed Reviewed-by
> >* Checked and set defaut max frame size to HW in start ops.
> >v3:
> >* Changed Fixes line.
> >v2:
> >* Changed commit message.
> >---
> > drivers/net/ice/ice_ethdev.c | 10 ++++++++++
> > 1 file changed, 10 insertions(+)
> >
> >diff --git a/drivers/net/ice/ice_ethdev.c
> >b/drivers/net/ice/ice_ethdev.c index d74675842..d8aa68f07 100644
> >--- a/drivers/net/ice/ice_ethdev.c
> >+++ b/drivers/net/ice/ice_ethdev.c
> >@@ -2724,6 +2724,16 @@ ice_dev_start(struct rte_eth_dev *dev)
> >
> > 	pf->adapter_stopped = false;
> >
> >+	/* Set the max frame size to default value*/
> >+	if (pf->dev_data->dev_conf.rxmode.max_rx_pkt_len == 0) {
> >+		pf->dev_data->dev_conf.rxmode.max_rx_pkt_len =
> >+			RTE_ETHER_MAX_LEN;
> 
> I think ICE_FRAME_SIZE_MAX is more suitable here.
Agree. Will be modified in Patch v5.
> 
> >+	}
> >+
> >+	/* Set the max frame size to HW*/
> >+	ice_aq_set_mac_cfg(hw,
> >+		pf->dev_data->dev_conf.rxmode.max_rx_pkt_len, NULL);
> 
> What about
> 
> 	max_frame_size = pf->dev_data-
> >dev_conf.rxmode.max_rx_pkt_len ?
> 		pf->dev_data->dev_conf.rxmode.max_rx_pkt_len :
> ICE_FRAME_SIZE_MAX;
Agree. Will be modified in Patch v5.
> 
> 	/* Set the max frame size to HW*/
> 	ice_aq_set_mac_cfg(hw, max_frame_size, NULL);
> 
> 
> Thanks,
> Xiaolong
> >+
> > 	return 0;
> >
> > 	/* stop the started queues if failed to start all queues */
> >--
> >2.17.1
> >
  

Patch

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index d74675842..d8aa68f07 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2724,6 +2724,16 @@  ice_dev_start(struct rte_eth_dev *dev)
 
 	pf->adapter_stopped = false;
 
+	/* Set the max frame size to default value*/
+	if (pf->dev_data->dev_conf.rxmode.max_rx_pkt_len == 0) {
+		pf->dev_data->dev_conf.rxmode.max_rx_pkt_len =
+			RTE_ETHER_MAX_LEN;
+	}
+
+	/* Set the max frame size to HW*/
+	ice_aq_set_mac_cfg(hw,
+		pf->dev_data->dev_conf.rxmode.max_rx_pkt_len, NULL);
+
 	return 0;
 
 	/* stop the started queues if failed to start all queues */