DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] i40e: fix oversize packet counter not incrementing for large packets
@ 2016-11-25 18:21 Michael Bieniek
  2016-11-28  2:19 ` Wu, Jingjing
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Bieniek @ 2016-11-25 18:21 UTC (permalink / raw)
  To: helin.zhang, jingjing.wu; +Cc: dev, Michael Bieniek

The XL710 requires that the Set MAC Config command be used to define the
maximum frame size in order for the Receive Oversize Count register
(GLPRT_ROC) to be incremented for packets received that are greater than
the MTU. Without this change, the XL710 will drop the oversized packets
without incrementing the corresponding counter.

Signed-off-by: Michael Bieniek <michaelbieniekdpdk@gmail.com>
---
 drivers/net/i40e/i40e_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 67778ba..c11c80b 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -9709,6 +9709,7 @@ static int
 i40e_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
 {
 	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
+	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct rte_eth_dev_data *dev_data = pf->dev_data;
 	uint32_t frame_size = mtu + ETHER_HDR_LEN
 			      + ETHER_CRC_LEN + I40E_VLAN_TAG_SIZE;
@@ -9732,6 +9733,7 @@ i40e_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
 		dev_data->dev_conf.rxmode.jumbo_frame = 0;
 
 	dev_data->dev_conf.rxmode.max_rx_pkt_len = frame_size;
+	i40e_aq_set_mac_config(hw, frame_size, TRUE, 0, NULL);
 
 	return ret;
 }
-- 
2.4.11

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] i40e: fix oversize packet counter not incrementing for large packets
  2016-11-25 18:21 [dpdk-dev] [PATCH] i40e: fix oversize packet counter not incrementing for large packets Michael Bieniek
@ 2016-11-28  2:19 ` Wu, Jingjing
  2017-02-08  5:13   ` Wu, Jingjing
  0 siblings, 1 reply; 3+ messages in thread
From: Wu, Jingjing @ 2016-11-28  2:19 UTC (permalink / raw)
  To: Michael Bieniek, Zhang, Helin; +Cc: dev



> -----Original Message-----
> From: Michael Bieniek [mailto:michaelbieniekdpdk@gmail.com]
> Sent: Saturday, November 26, 2016 2:21 AM
> To: Zhang, Helin <helin.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>
> Cc: dev@dpdk.org; Michael Bieniek <michaelbieniekdpdk@gmail.com>
> Subject: [PATCH] i40e: fix oversize packet counter not incrementing for large
> packets
> 
> The XL710 requires that the Set MAC Config command be used to define the
> maximum frame size in order for the Receive Oversize Count register
> (GLPRT_ROC) to be incremented for packets received that are greater than the
> MTU. Without this change, the XL710 will drop the oversized packets without
> incrementing the corresponding counter.
> 
> Signed-off-by: Michael Bieniek <michaelbieniekdpdk@gmail.com>
> ---
>  drivers/net/i40e/i40e_ethdev.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index 67778ba..c11c80b 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -9709,6 +9709,7 @@ static int
>  i40e_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)  {
>  	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data-
> >dev_private);
> +	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
>  	struct rte_eth_dev_data *dev_data = pf->dev_data;
>  	uint32_t frame_size = mtu + ETHER_HDR_LEN
>  			      + ETHER_CRC_LEN + I40E_VLAN_TAG_SIZE; @@ -
> 9732,6 +9733,7 @@ i40e_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
>  		dev_data->dev_conf.rxmode.jumbo_frame = 0;
> 
>  	dev_data->dev_conf.rxmode.max_rx_pkt_len = frame_size;
> +	i40e_aq_set_mac_config(hw, frame_size, TRUE, 0, NULL);
> 
>  	return ret;
>  }

If you look into the eth_i40e_dev_init, you will find the mac's maximum frame size
Has been set to I40E_FRAME_SIZE_MAX (0x2600). Then the changing of maximum
frame size is by the setting in queues.

If change the frame size on mac, the maximum frame size will not only works on
PF but also VF. 

Thanks
Jingjing

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] i40e: fix oversize packet counter not incrementing for large packets
  2016-11-28  2:19 ` Wu, Jingjing
@ 2017-02-08  5:13   ` Wu, Jingjing
  0 siblings, 0 replies; 3+ messages in thread
From: Wu, Jingjing @ 2017-02-08  5:13 UTC (permalink / raw)
  To: Wu, Jingjing, Michael Bieniek, Zhang, Helin; +Cc: dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wu, Jingjing
> Sent: Monday, November 28, 2016 10:20 AM
> To: Michael Bieniek <michaelbieniekdpdk@gmail.com>; Zhang, Helin
> <helin.zhang@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] i40e: fix oversize packet counter not
> incrementing for large packets
> 
> 
> 
> > -----Original Message-----
> > From: Michael Bieniek [mailto:michaelbieniekdpdk@gmail.com]
> > Sent: Saturday, November 26, 2016 2:21 AM
> > To: Zhang, Helin <helin.zhang@intel.com>; Wu, Jingjing
> > <jingjing.wu@intel.com>
> > Cc: dev@dpdk.org; Michael Bieniek <michaelbieniekdpdk@gmail.com>
> > Subject: [PATCH] i40e: fix oversize packet counter not incrementing
> > for large packets
> >
> > The XL710 requires that the Set MAC Config command be used to define
> > the maximum frame size in order for the Receive Oversize Count
> > register
> > (GLPRT_ROC) to be incremented for packets received that are greater
> > than the MTU. Without this change, the XL710 will drop the oversized
> > packets without incrementing the corresponding counter.
> >
> > Signed-off-by: Michael Bieniek <michaelbieniekdpdk@gmail.com>
> > ---
> >  drivers/net/i40e/i40e_ethdev.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/net/i40e/i40e_ethdev.c
> > b/drivers/net/i40e/i40e_ethdev.c index 67778ba..c11c80b 100644
> > --- a/drivers/net/i40e/i40e_ethdev.c
> > +++ b/drivers/net/i40e/i40e_ethdev.c
> > @@ -9709,6 +9709,7 @@ static int
> >  i40e_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)  {
> >  	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data-
> > >dev_private);
> > +	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data-
> > >dev_private);
> >  	struct rte_eth_dev_data *dev_data = pf->dev_data;
> >  	uint32_t frame_size = mtu + ETHER_HDR_LEN
> >  			      + ETHER_CRC_LEN + I40E_VLAN_TAG_SIZE; @@ -
> > 9732,6 +9733,7 @@ i40e_dev_mtu_set(struct rte_eth_dev *dev, uint16_t
> mtu)
> >  		dev_data->dev_conf.rxmode.jumbo_frame = 0;
> >
> >  	dev_data->dev_conf.rxmode.max_rx_pkt_len = frame_size;
> > +	i40e_aq_set_mac_config(hw, frame_size, TRUE, 0, NULL);
> >
> >  	return ret;
> >  }
> 
> If you look into the eth_i40e_dev_init, you will find the mac's maximum
> frame size Has been set to I40E_FRAME_SIZE_MAX (0x2600). Then the
> changing of maximum frame size is by the setting in queues.
> 
> If change the frame size on mac, the maximum frame size will not only works
> on PF but also VF.
> 

NACK to this patch.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-08  5:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-25 18:21 [dpdk-dev] [PATCH] i40e: fix oversize packet counter not incrementing for large packets Michael Bieniek
2016-11-28  2:19 ` Wu, Jingjing
2017-02-08  5:13   ` Wu, Jingjing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).