Skip to contentSkip to conversation

net/ice: set max frame size

PATCH Superseded Min JiaqiX 3 participants 19 messages Oct 24, 2019 – Nov 5, 2019 Network drivers

lore
Share & tools
lore

Min JiaqiX

author
#0 lore raw

PATCH 1/1 net/ice: set max frame size

Max frame size is not set to HW, so packets above the MTU do not get dropped by HW. The patch fixed the issue.

---
 drivers/net/ice/ice_ethdev.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/ice/ice_ethdev.c +4 -0
index 022b58c01..403305cfb 100644
@@ -2506,6 +2506,10 @@ ice_dev_start(struct rte_eth_dev *dev)
 
 	pf->adapter_stopped = false;
 
+	/* Set the max frame size */
+	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 */
Signature · 1 line
2.17.1
#1 lore raw

Hi,

Could you provide the Fixes tag and cc stable?

Thanks,
Xiaolong

Quoted 26 lines · Min JiaqiX

Max frame size is not set to HW, so packets above the MTU do not get dropped by HW. The patch fixed the issue.

---
drivers/net/ice/ice_ethdev.c | 4 ++++

1 file changed, 4 insertions(+)
drivers/net/ice/ice_ethdev.c +4 -0
index 022b58c01..403305cfb 100644
@@ -2506,6 +2506,10 @@ ice_dev_start(struct rte_eth_dev *dev)
 
 	pf->adapter_stopped = false;
 
+	/* Set the max frame size */
+	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 */
Signature · 1 line
2.17.1
#2 lore raw

Hi Xiaolong,

Quoted 8 lines

-----Original Message-----
From: Ye, Xiaolong
Sent: Friday, October 25, 2019 11:06 AM
To: Min, JiaqiX <[email protected]>
Cc: [email protected]; Lu, Wenzhuo <[email protected]>; Yang, Qiming <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] net/ice: set max frame size

Quoted 4 lines

Hi,

Could you provide the Fixes tag and cc stable?

It's a persistent issue, maybe it is an implementation miss. So Fixes tag can't be provided. Like this, need cc stable?

Quoted 30 lines

Thanks,

Quoted 26 lines · Min JiaqiX

Max frame size is not set to HW, so packets above the MTU do not get dropped by HW. The patch fixed the issue.

---
drivers/net/ice/ice_ethdev.c | 4 ++++

1 file changed, 4 insertions(+)
(quoted diff) +0 -0

b/drivers/net/ice/ice_ethdev.c index 022b58c01..403305cfb 100644

drivers/net/ice/ice_ethdev.c +4 -1
@@ -2506,6 +2506,10 @@ ice_dev_start(struct rte_eth_dev *dev)
 
 	pf->adapter_stopped = false;
 
+	/* Set the max frame size */
+	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 */
--

2.17.1

#3 lore raw
Quoted 10 lines · JiaqiX

Hi Xiaolong,

Quoted 8 lines

-----Original Message-----
From: Ye, Xiaolong
Sent: Friday, October 25, 2019 11:06 AM
To: Min, JiaqiX <[email protected]>
Cc: [email protected]; Lu, Wenzhuo <[email protected]>; Yang, Qiming <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] net/ice: set max frame size

Quoted 8 lines
Quoted 4 lines

Hi,

Could you provide the Fixes tag and cc stable?

It's a persistent issue, maybe it is an implementation miss. So Fixes tag can't be provided. Like this, need cc stable?

If it is an implementation miss since the driver was written then please set the Fixes tag to the commit where the driver was introduced.

Quoted 30 lines
Quoted 30 lines

Thanks,

Quoted 26 lines · Min JiaqiX

Max frame size is not set to HW, so packets above the MTU do not get dropped by HW. The patch fixed the issue.

---
drivers/net/ice/ice_ethdev.c | 4 ++++

1 file changed, 4 insertions(+)
(quoted diff) +0 -0

b/drivers/net/ice/ice_ethdev.c index 022b58c01..403305cfb 100644

drivers/net/ice/ice_ethdev.c +4 -1
@@ -2506,6 +2506,10 @@ ice_dev_start(struct rte_eth_dev *dev)
 
 	pf->adapter_stopped = false;
 
+	/* Set the max frame size */
+	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 */
--

2.17.1

#4 lore raw
In reply to Min, JiaqiX

Hi, Jiaqi

Quoted 10 lines · JiaqiX

Hi Xiaolong,

Quoted 8 lines

-----Original Message-----
From: Ye, Xiaolong
Sent: Friday, October 25, 2019 11:06 AM
To: Min, JiaqiX <[email protected]>
Cc: [email protected]; Lu, Wenzhuo <[email protected]>; Yang, Qiming <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] net/ice: set max frame size

Quoted 7 lines
Quoted 4 lines

Hi,

Could you provide the Fixes tag and cc stable?

It's a persistent issue, maybe it is an implementation miss. So Fixes tag can't be provided. Like this, need cc stable?

I think in this case, the fix tag could be the first commit that introduced icd driver.

Thanks,
Xiaolong

Quoted 31 lines
Quoted 31 lines

Thanks,

Quoted 26 lines · Min JiaqiX

Max frame size is not set to HW, so packets above the MTU do not get dropped by HW. The patch fixed the issue.

---
drivers/net/ice/ice_ethdev.c | 4 ++++

1 file changed, 4 insertions(+)
(quoted diff) +0 -0

b/drivers/net/ice/ice_ethdev.c index 022b58c01..403305cfb 100644

drivers/net/ice/ice_ethdev.c +4 -1
@@ -2506,6 +2506,10 @@ ice_dev_start(struct rte_eth_dev *dev)
 
 	pf->adapter_stopped = false;
 
+	/* Set the max frame size */
+	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 */
--

2.17.1

author
#5 lore raw

PATCH v2 1/1 net/ice: fix setting max frame size

In reply to Min JiaqiX

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 ae2bdd0219cb ("net/ice: support MTU setting")

---
v2:
* Changed commit message.

---
 drivers/net/ice/ice_ethdev.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/ice/ice_ethdev.c +4 -0
index 022b58c01..403305cfb 100644
@@ -2506,6 +2506,10 @@ ice_dev_start(struct rte_eth_dev *dev)
 
 	pf->adapter_stopped = false;
 
+	/* Set the max frame size */
+	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 */
Signature · 1 line
2.17.1
Reviewed-by on v2 1/1 Applied
#6 lore raw

Re: [dpdk-dev] [PATCH v2] net/ice: fix setting max frame size

Quoted 4 lines · Min JiaqiX

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 ae2bdd0219cb ("net/ice: support MTU setting")

We should set max frame size to HW in the beginning when the driver was introduced, so the fix commit should be 50370662b727 ("net/ice: support device and queue ops")

Fix this while merging.

Quoted 15 lines

---
v2:
* Changed commit message.
---
drivers/net/ice/ice_ethdev.c | 4 ++++

1 file changed, 4 insertions(+)
drivers/net/ice/ice_ethdev.c +0 -0
index 022b58c01..403305cfb 100644

drivers/net/ice/ice_ethdev.c ice_dev_start(struct rte_eth_dev *dev) · line 2512

Quoted 7 lines
drivers/net/ice/ice_ethdev.c +4 -0
@@ -2506,6 +2506,10 @@ ice_dev_start(struct rte_eth_dev *dev)
 
 	pf->adapter_stopped = false;
 
+	/* Set the max frame size */
+	ice_aq_set_mac_cfg(hw,
+		pf->dev_data->dev_conf.rxmode.max_rx_pkt_len, NULL);
+

Why set the max frame size to HW in start ops, not in init stage like in i40e? and what if max_rx_pkt_len hasn't been set?

Thanks,
Xiaolong

Quoted 6 lines
drivers/net/ice/ice_ethdev.c +0 -0
 	return 0;
 
 	/* stop the started queues if failed to start all queues */
Signature · 1 line
2.17.1

Applied to dpdk-next-net-intel. Thanks.

#7 lore raw

Re: [dpdk-dev] [PATCH v2] net/ice: fix setting max frame size

Quoted 3 lines · Ye Xiaolong

Applied to dpdk-next-net-intel. Thanks.

Sorry for the above misleading message, this patch is still under discussion, not merged yet.

Thanks,
Xiaolong

#8 lore raw

Re: [dpdk-dev] [PATCH v2] net/ice: fix setting max frame size

In reply to Ye Xiaolong

Hi Xiaolong,

Quoted 8 lines

-----Original Message-----
From: Ye, Xiaolong
Sent: Monday, October 28, 2019 4:46 PM
To: Min, JiaqiX <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH v2] net/ice: fix setting max frame size

On 10/28, Min JiaqiX wrote:

Quoted 8 lines
Quoted 4 lines

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 ae2bdd0219cb ("net/ice: support MTU setting")

We should set max frame size to HW in the beginning when the driver was introduced, so the fix commit should be 50370662b727 ("net/ice: support device and queue ops")

Modify commit message in patch v3.

Quoted 21 lines

Fix this while merging.

Quoted 18 lines

---
v2:
* Changed commit message.
---
drivers/net/ice/ice_ethdev.c | 4 ++++

1 file changed, 4 insertions(+)
(quoted diff) +0 -0

b/drivers/net/ice/ice_ethdev.c index 022b58c01..403305cfb 100644

drivers/net/ice/ice_ethdev.c +0 -0
@@ -2506,6 +2506,10 @@ ice_dev_start(struct rte_eth_dev *dev)
 
 	pf->adapter_stopped = false;
 
Quoted 8 lines

drivers/net/ice/ice_ethdev.c ice_dev_start(struct rte_eth_dev *dev) · line 2512

Quoted 4 lines
drivers/net/ice/ice_ethdev.c +4 -0
+	/* Set the max frame size */
+	ice_aq_set_mac_cfg(hw,
+		pf->dev_data->dev_conf.rxmode.max_rx_pkt_len, NULL);
+

Why set the max frame size to HW in start ops, not in init stage like in i40e? and what if max_rx_pkt_len hasn't been set?

max_rx_pkt_len need to be set to HW when set mtu , init stage won't be called when open port again.

Appendix:
Steps for using Example/ethtool to set mtu:
EthApp>stop 0
EthApp>mtu 0 200
EthApp>open 0

Quoted 15 lines

Thanks,
Xiaolong

Quoted 6 lines
drivers/net/ice/ice_ethdev.c +0 -1
 	return 0;
 
 	/* stop the started queues if failed to start all queues */
--

2.17.1

Applied to dpdk-next-net-intel. Thanks.

#9 lore raw

Re: [dpdk-dev] [PATCH v2] net/ice: fix setting max frame size

Quoted 48 lines · JiaqiX

Hi Xiaolong,

Quoted 8 lines

-----Original Message-----
From: Ye, Xiaolong
Sent: Monday, October 28, 2019 4:46 PM
To: Min, JiaqiX <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH v2] net/ice: fix setting max frame size

On 10/28, Min JiaqiX wrote:

Quoted 8 lines
Quoted 4 lines

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 ae2bdd0219cb ("net/ice: support MTU setting")

We should set max frame size to HW in the beginning when the driver was introduced, so the fix commit should be 50370662b727 ("net/ice: support device and queue ops")

Modify commit message in patch v3.

Quoted 21 lines

Fix this while merging.

Quoted 18 lines

---
v2:
* Changed commit message.
---
drivers/net/ice/ice_ethdev.c | 4 ++++

1 file changed, 4 insertions(+)
(quoted diff) +0 -0

b/drivers/net/ice/ice_ethdev.c index 022b58c01..403305cfb 100644

drivers/net/ice/ice_ethdev.c +0 -0
@@ -2506,6 +2506,10 @@ ice_dev_start(struct rte_eth_dev *dev)
 
 	pf->adapter_stopped = false;
 
Quoted 8 lines

drivers/net/ice/ice_ethdev.c ice_dev_start(struct rte_eth_dev *dev) · line 2512

Quoted 4 lines
drivers/net/ice/ice_ethdev.c +4 -0
+	/* Set the max frame size */
+	ice_aq_set_mac_cfg(hw,
+		pf->dev_data->dev_conf.rxmode.max_rx_pkt_len, NULL);
+

Why set the max frame size to HW in start ops, not in init stage like in i40e? and what if max_rx_pkt_len hasn't been set?

Quoted 1 line

max_rx_pkt_len need to be set to HW when set mtu , init stage won't be called when open port again.

Agree, I think it makes sense to set max frame size to hw in start ops, but what if user doesn't set mtu, then the max_rx_pkt_len would be 0, do we need a default max frame value in this case?

And since i40e doesn't update max frame size to HW in start ops, do you think it needs a fix?

Thanks,
Xiaolong

Quoted 22 lines

Appendix:
Steps for using Example/ethtool to set mtu:
EthApp>stop 0
EthApp>mtu 0 200
EthApp>open 0

Quoted 15 lines

Thanks,
Xiaolong

Quoted 6 lines
drivers/net/ice/ice_ethdev.c +0 -1
 	return 0;
 
 	/* stop the started queues if failed to start all queues */
--

2.17.1

Applied to dpdk-next-net-intel. Thanks.

#10 lore raw

Re: [dpdk-dev] [PATCH v2] net/ice: fix setting max frame size

Hi, Xiaolong

Quoted 57 lines

-----Original Message-----
From: Ye, Xiaolong
Sent: Tuesday, October 29, 2019 1:07 PM
To: Min, JiaqiX <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v2] net/ice: fix setting max frame size

Quoted 49 lines · JiaqiX

Hi Xiaolong,

Quoted 9 lines

-----Original Message-----
From: Ye, Xiaolong
Sent: Monday, October 28, 2019 4:46 PM
To: Min, JiaqiX <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH v2] net/ice: fix setting max frame size

On 10/28, Min JiaqiX wrote:

Quoted 8 lines
Quoted 4 lines

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 ae2bdd0219cb ("net/ice: support MTU setting")

We should set max frame size to HW in the beginning when the driver was introduced, so the fix commit should be 50370662b727 ("net/ice:
support device and queue ops")

Modify commit message in patch v3.

Quoted 29 lines

Fix this while merging.

Quoted 15 lines

---
v2:
* Changed commit message.
---
drivers/net/ice/ice_ethdev.c | 4 ++++

1 file changed, 4 insertions(+)
(quoted diff) +0 -0

b/drivers/net/ice/ice_ethdev.c index 022b58c01..403305cfb 100644

drivers/net/ice/ice_ethdev.c ice_dev_start(struct rte_eth_dev *dev) · line 2512

Quoted 7 lines
drivers/net/ice/ice_ethdev.c +4 -0
@@ -2506,6 +2506,10 @@ ice_dev_start(struct rte_eth_dev *dev)
 
 	pf->adapter_stopped = false;
 
+	/* Set the max frame size */
+	ice_aq_set_mac_cfg(hw,
+		pf->dev_data->dev_conf.rxmode.max_rx_pkt_len, NULL);
+

Why set the max frame size to HW in start ops, not in init stage like in i40e? and what if max_rx_pkt_len hasn't been set?

Quoted 6 lines
Quoted 1 line

max_rx_pkt_len need to be set to HW when set mtu , init stage won't be

called when open port again.

Agree, I think it makes sense to set max frame size to hw in start ops, but what if user doesn't set mtu, then the max_rx_pkt_len would be 0, do we need a default max frame value in this case?

Agree, we should set a default max frame size value to HW.

Quoted 3 lines

And since i40e doesn't update max frame size to HW in start ops, do you think it needs a fix?

It can't fix the issue to set max frame size to HW in start ops in i40e, I don't know the cause. It is ok to set max frame size to HW in link_update ops in i40e,
however when user opens port, link_update ops will be called three times,
so I don't think it makes sense to set max frame size to hw in link_update ops too. Where to set the maximum frame size to HW in i40e is a problem.

Quoted 27 lines

Thanks,
Xiaolong

Quoted 22 lines

Appendix:
Steps for using Example/ethtool to set mtu:
EthApp>stop 0
EthApp>mtu 0 200
EthApp>open 0

Quoted 15 lines

Thanks,
Xiaolong

Quoted 6 lines
drivers/net/ice/ice_ethdev.c +0 -1
 	return 0;
 
 	/* stop the started queues if failed to start all queues */
--

2.17.1

Applied to dpdk-next-net-intel. Thanks.

author
#11 lore raw

PATCH v3 1/1 net/ice: fix setting max frame size

In reply to Min JiaqiX

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")

---
v3:
* Changed Fixes line.
v2:
* Changed commit message.

---
 drivers/net/ice/ice_ethdev.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/ice/ice_ethdev.c +4 -0
index 022b58c01..403305cfb 100644
@@ -2506,6 +2506,10 @@ ice_dev_start(struct rte_eth_dev *dev)
 
 	pf->adapter_stopped = false;
 
+	/* Set the max frame size */
+	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 */
Signature · 1 line
2.17.1
#12 lore raw

Re: [dpdk-dev] [PATCH v3] net/ice: fix setting max frame size

Hi, Jiaqi

Quoted 8 lines · Min JiaqiX

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")

Sorry, the Reviewed-by was given by accident in V1.

Quoted 14 lines

---
v3:
* Changed Fixes line.
v2:
* Changed commit message.
---
drivers/net/ice/ice_ethdev.c | 4 ++++

1 file changed, 4 insertions(+)
drivers/net/ice/ice_ethdev.c +0 -0
index 022b58c01..403305cfb 100644

drivers/net/ice/ice_ethdev.c ice_dev_start(struct rte_eth_dev *dev) · line 2512

Quoted 7 lines
drivers/net/ice/ice_ethdev.c +4 -0
@@ -2506,6 +2506,10 @@ ice_dev_start(struct rte_eth_dev *dev)
 
 	pf->adapter_stopped = false;
 
+	/* Set the max frame size */
+	ice_aq_set_mac_cfg(hw,
+		pf->dev_data->dev_conf.rxmode.max_rx_pkt_len, NULL);
+

As I commented in V2, what if user doesn't set mtu, then the max_rx_pkt_len would be 0, do we need a default max frame value in this case?

Thanks,
Xiaolong

Quoted 6 lines
drivers/net/ice/ice_ethdev.c +0 -0
 	return 0;
 
 	/* stop the started queues if failed to start all queues */
Signature · 1 line
2.17.1
#13 lore raw

Re: [dpdk-dev] [PATCH v3] net/ice: fix setting max frame size

Hi, Xiaolong

Quoted 13 lines

-----Original Message-----
From: Ye, Xiaolong
Sent: Wednesday, October 30, 2019 1:22 PM
To: Min, JiaqiX <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH v3] net/ice: fix setting max frame size

Hi, Jiaqi

Quoted 3 lines · Min JiaqiX

Max frame size is not set to HW, so packets above the MTU do not get dropped by HW. The patch fixed the issue.

Quoted 7 lines
Quoted 5 lines
Fixes 50370662b727 ("net/ice: support device and queue ops")

Sorry, the Reviewed-by was given by accident in V1.

Reviewed-by in next patch will be removed.

Quoted 18 lines
Quoted 18 lines

---
v3:
* Changed Fixes line.
v2:
* Changed commit message.
---
drivers/net/ice/ice_ethdev.c | 4 ++++

1 file changed, 4 insertions(+)
(quoted diff) +0 -0

b/drivers/net/ice/ice_ethdev.c index 022b58c01..403305cfb 100644

drivers/net/ice/ice_ethdev.c +0 -0
@@ -2506,6 +2506,10 @@ ice_dev_start(struct rte_eth_dev *dev)
 
 	pf->adapter_stopped = false;
 
Quoted 8 lines

drivers/net/ice/ice_ethdev.c ice_dev_start(struct rte_eth_dev *dev) · line 2512

Quoted 4 lines
drivers/net/ice/ice_ethdev.c +4 -0
+	/* Set the max frame size */
+	ice_aq_set_mac_cfg(hw,
+		pf->dev_data->dev_conf.rxmode.max_rx_pkt_len, NULL);
+

As I commented in V2, what if user doesn't set mtu, then the max_rx_pkt_len would be 0, do we need a default max frame value in this case?

Agree. Add check if 0 and default max frame value in this case to next patch.

Quoted 10 lines

Thanks,
Xiaolong

Quoted 6 lines
drivers/net/ice/ice_ethdev.c +0 -1
 	return 0;
 
 	/* stop the started queues if failed to start all queues */
--

2.17.1

author
#14 lore raw

PATCH v4 1/1 net/ice: fix setting max frame size

In reply to Min JiaqiX

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")

---
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(+)
drivers/net/ice/ice_ethdev.c +10 -0
index d74675842..d8aa68f07 100644
@@ -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 */
Signature · 1 line
2.17.1
#15 lore raw

Re: [dpdk-dev] [PATCH v4] net/ice: fix setting max frame size

Quoted 25 lines · Min JiaqiX

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")

---
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(+)
drivers/net/ice/ice_ethdev.c +0 -0
index d74675842..d8aa68f07 100644

drivers/net/ice/ice_ethdev.c ice_dev_start(struct rte_eth_dev *dev) · line 2730

Quoted 7 lines
drivers/net/ice/ice_ethdev.c +4 -0
@@ -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.

drivers/net/ice/ice_ethdev.c ice_dev_start(struct rte_eth_dev *dev) · line 2735

Quoted 5 lines
drivers/net/ice/ice_ethdev.c +5 -0
+	}
+
+	/* 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

Quoted 7 lines
drivers/net/ice/ice_ethdev.c +1 -0
+
 	return 0;
 
 	/* stop the started queues if failed to start all queues */
Signature · 1 line
2.17.1
#16 lore raw

Re: [dpdk-dev] [PATCH v4] net/ice: fix setting max frame size

Hi, Xiaolong

Quoted 34 lines

-----Original Message-----
From: Ye, Xiaolong
Sent: Monday, November 4, 2019 10:57 AM
To: Min, JiaqiX <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH v4] net/ice: fix setting max frame size

Quoted 26 lines · Min JiaqiX

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")

---
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(+)
(quoted diff) +0 -0

b/drivers/net/ice/ice_ethdev.c index d74675842..d8aa68f07 100644

drivers/net/ice/ice_ethdev.c +0 -0
@@ -2724,6 +2724,16 @@ ice_dev_start(struct rte_eth_dev *dev)
 
Quoted 8 lines

drivers/net/ice/ice_ethdev.c ice_dev_start(struct rte_eth_dev *dev) · line 2730

Quoted 6 lines
drivers/net/ice/ice_ethdev.c +4 -0
 	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.

Quoted 9 lines

drivers/net/ice/ice_ethdev.c ice_dev_start(struct rte_eth_dev *dev) · line 2735

Quoted 6 lines
drivers/net/ice/ice_ethdev.c +5 -0
+	}
+
+	/* 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

Quoted 4 lines
	max_frame_size = pf->dev_data-
Quoted 1 line

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.

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

Thanks,
Xiaolong

Quoted 7 lines

+

	return 0;

	/* stop the started queues if failed to start all queues */

--
2.17.1

author
#17 lore raw

PATCH v5 1/1 net/ice: fix setting max frame size

In reply to Min JiaqiX

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")

---
v5:
* Set ICE_FRAME_SIZE_MAX to to default value. 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(+)
drivers/net/ice/ice_ethdev.c +10 -0
index d74675842..741a067f9 100644
@@ -2657,6 +2657,7 @@ ice_dev_start(struct rte_eth_dev *dev)
 	struct ice_vsi *vsi = pf->main_vsi;
 	uint16_t nb_rxq = 0;
 	uint16_t nb_txq, i;
+	uint16_t max_frame_size;
 	int mask, ret;
 
 	/* program Tx queues' context in hardware */
@@ -2724,6 +2725,15 @@ ice_dev_start(struct rte_eth_dev *dev)
 
 	pf->adapter_stopped = false;
 
+	/* Set the max frame size to default value*/
+	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);
+
 	return 0;
 
 	/* stop the started queues if failed to start all queues */
Signature · 1 line
2.17.1
Reviewed-by on v5 1/1 Applied
#18 lore raw

Re: [dpdk-dev] [PATCH v5] net/ice: fix setting max frame size

Quoted 53 lines · Min JiaqiX

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")

---
v5:
* Set ICE_FRAME_SIZE_MAX to to default value. 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(+)
drivers/net/ice/ice_ethdev.c +10 -0
index d74675842..741a067f9 100644
@@ -2657,6 +2657,7 @@ ice_dev_start(struct rte_eth_dev *dev)
 	struct ice_vsi *vsi = pf->main_vsi;
 	uint16_t nb_rxq = 0;
 	uint16_t nb_txq, i;
+	uint16_t max_frame_size;
 	int mask, ret;
 
 	/* program Tx queues' context in hardware */
@@ -2724,6 +2725,15 @@ ice_dev_start(struct rte_eth_dev *dev)
 
 	pf->adapter_stopped = false;
 
+	/* Set the max frame size to default value*/
+	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);
+
 	return 0;
 
 	/* stop the started queues if failed to start all queues */
Signature · 1 line
2.17.1

Applied to dpdk-next-net-intel. Thanks.