DPDK patches and discussions
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Xiao Zhang <xiao.zhang@intel.com>, dev@dpdk.org
Cc: ian.stokes@intel.com, beilei.xing@intel.com,
	qi.z.zhang@intel.com, stable@dpdk.org
Subject: Re: [dpdk-dev] [v2] net/i40e: fix vlan packets drop
Date: Mon, 21 Oct 2019 21:15:10 +0100	[thread overview]
Message-ID: <55932be4-62a0-64d2-f0b9-0c036f9c659b@redhat.com> (raw)
In-Reply-To: <1571625891-8986-1-git-send-email-xiao.zhang@intel.com>

On 21/10/2019 03:44, Xiao Zhang wrote:
> Vlan packets with ip length bigger then 1496 will not be received by
> i40e/i40evf due to wrong packets size checking. This patch fixes the issue
> by correcting the maximum frame size during checking.
> 
> Fixes: 43e5488c0ac6 ("net/i40e: support MTU configuration")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
> ---
> v2
> add fix for i40evf and correct the checking when using the max_pkt_len.
> ---
>  drivers/net/i40e/i40e_ethdev.c    | 2 +-
>  drivers/net/i40e/i40e_ethdev_vf.c | 8 +++++---
>  drivers/net/i40e/i40e_rxtx.c      | 6 ++++--
>  3 files changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index 2ca14da..156d67b 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -12103,7 +12103,7 @@ i40e_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
>  		return -EBUSY;
>  	}
>  
> -	if (frame_size > RTE_ETHER_MAX_LEN)
> +	if (frame_size > RTE_ETHER_MAX_LEN + I40E_VLAN_TAG_SIZE * 2)
>  		dev_data->dev_conf.rxmode.offloads |=
>  			DEV_RX_OFFLOAD_JUMBO_FRAME;
>  	else
> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
> index 5dba092..bc825e2 100644
> --- a/drivers/net/i40e/i40e_ethdev_vf.c
> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> @@ -1782,12 +1782,14 @@ i40evf_rxq_init(struct rte_eth_dev *dev, struct i40e_rx_queue *rxq)
>  		}

Size check in jumbo on case needs to be updated also

>  	} else {
>  		if (rxq->max_pkt_len < RTE_ETHER_MIN_LEN ||
> -		    rxq->max_pkt_len > RTE_ETHER_MAX_LEN) {
> +		    rxq->max_pkt_len > RTE_ETHER_MAX_LEN +
> +				I40E_VLAN_TAG_SIZE * 2) {
>  			PMD_DRV_LOG(ERR, "maximum packet length must be "
>  				"larger than %u and smaller than %u, as jumbo "
>  				"frame is disabled",
>  				(uint32_t)RTE_ETHER_MIN_LEN,
> -				(uint32_t)RTE_ETHER_MAX_LEN);
> +				(uint32_t)RTE_ETHER_MAX_LEN +
> +					I40E_VLAN_TAG_SIZE * 2);
>  			return I40E_ERR_CONFIG;
>  		}
>  	}
> @@ -2747,7 +2749,7 @@ i40evf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
>  		return -EBUSY;
>  	}
>  
> -	if (frame_size > RTE_ETHER_MAX_LEN)
> +	if (frame_size > RTE_ETHER_MAX_LEN + I40E_VLAN_TAG_SIZE * 2)
>  		dev_data->dev_conf.rxmode.offloads |=
>  			DEV_RX_OFFLOAD_JUMBO_FRAME;
>  	else
> diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
> index ff6eb4a..0c178e3 100644
> --- a/drivers/net/i40e/i40e_rxtx.c
> +++ b/drivers/net/i40e/i40e_rxtx.c
> @@ -2634,12 +2634,14 @@ i40e_rx_queue_config(struct i40e_rx_queue *rxq)
>  		}

Size check in jumbo on case needs to be updated also

>  	} else {
>  		if (rxq->max_pkt_len < RTE_ETHER_MIN_LEN ||
> -			rxq->max_pkt_len > RTE_ETHER_MAX_LEN) {
> +			rxq->max_pkt_len > RTE_ETHER_MAX_LEN +
> +				I40E_VLAN_TAG_SIZE * 2) {
>  			PMD_DRV_LOG(ERR, "maximum packet length must be "
>  				    "larger than %u and smaller than %u, "
>  				    "as jumbo frame is disabled",
>  				    (uint32_t)RTE_ETHER_MIN_LEN,
> -				    (uint32_t)RTE_ETHER_MAX_LEN);
> +				    (uint32_t)RTE_ETHER_MAX_LEN +
> +						I40E_VLAN_TAG_SIZE * 2);
>  			return I40E_ERR_CONFIG;
>  		}
>  	}
> 

Doing quick search for RTE_ETHER_MAX_LEN,

- in i40e_fdir_rx_queue_init(), is 'rx_ctx.rxmax = RTE_ETHER_MAX_LEN;'
still correct now?

- Looking at rte_eth_dev_configure()
https://git.dpdk.org/dpdk/tree/lib/librte_ethdev/rte_ethdev.c#n1242
Does it mean an MTU not allowed without jumbo frames during
configuration is allowed later with mtu_set?

Request is to review related code and see if there are any impacts with
this change.

@Beilei Xing @Qi Zhang, this patch needs careful review by i40e maintainer.

thanks,
Kevin.


  reply	other threads:[~2019-10-21 20:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-14  7:53 [dpdk-dev] " Xiao Zhang
2019-10-14 17:41 ` Kevin Traynor
2019-10-15  1:41   ` Zhang, Xiao
2019-10-21  2:44 ` [dpdk-dev] [v2] " Xiao Zhang
2019-10-21 20:15   ` Kevin Traynor [this message]
2019-10-29  5:12 ` [dpdk-dev] [v3] " Xiao Zhang
2019-11-08 19:28   ` Kevin Traynor
2019-11-08 19:49     ` Thomas Monjalon
2019-11-09  3:01       ` Zhang, Qi Z
2020-02-10 13:48         ` Mattias Rönnblom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55932be4-62a0-64d2-f0b9-0c036f9c659b@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=ian.stokes@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=stable@dpdk.org \
    --cc=xiao.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).