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

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

Checks

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

Commit Message

Min, JiaqiX Nov. 4, 2019, 3:33 p.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>

---
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(+)
  

Comments

Xiaolong Ye Nov. 5, 2019, 2:22 a.m. UTC | #1
On 11/04, 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>
>
>---
>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(+)
>
>diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
>index d74675842..741a067f9 100644
>--- a/drivers/net/ice/ice_ethdev.c
>+++ b/drivers/net/ice/ice_ethdev.c
>@@ -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 */
>-- 
>2.17.1
>

Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>

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

Patch

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index d74675842..741a067f9 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -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 */