From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1E536A327F for ; Mon, 21 Oct 2019 22:15:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 99CAD4C8E; Mon, 21 Oct 2019 22:15:22 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id 63C622BC7 for ; Mon, 21 Oct 2019 22:15:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571688919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MDta5rYd1ILk3rifUfy1HXYnD0ZVoCHI3fb768bDnAM=; b=Yi14xfhXVop8r3zDyiCdw54XyWhVqyKAy2luOp63jErQ+BPyrNVvxYhbpOvHRQgi9zq13a ZbGZpW91IiaaNllVqbaq6TmSMci25gzRGJwQMo8hi4xhhGYDbbuFdZ3hgP515YDHL1N0ro Y8E5ydMJxnnJr/LGQHxDzHCuQjht5Kg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-139-s_bAD7DSPM6k5ACNfBcsoQ-1; Mon, 21 Oct 2019 16:15:14 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4956E80183E; Mon, 21 Oct 2019 20:15:13 +0000 (UTC) Received: from [10.36.118.52] (unknown [10.36.118.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E93A5DA5B; Mon, 21 Oct 2019 20:15:11 +0000 (UTC) To: Xiao Zhang , dev@dpdk.org Cc: ian.stokes@intel.com, beilei.xing@intel.com, qi.z.zhang@intel.com, stable@dpdk.org References: <1571039632-5524-1-git-send-email-xiao.zhang@intel.com> <1571625891-8986-1-git-send-email-xiao.zhang@intel.com> From: Kevin Traynor Message-ID: <55932be4-62a0-64d2-f0b9-0c036f9c659b@redhat.com> Date: Mon, 21 Oct 2019 21:15:10 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <1571625891-8986-1-git-send-email-xiao.zhang@intel.com> Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: s_bAD7DSPM6k5ACNfBcsoQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [v2] net/i40e: fix vlan packets drop X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 issu= e > by correcting the maximum frame size during checking. >=20 > Fixes: 43e5488c0ac6 ("net/i40e: support MTU configuration") > Cc: stable@dpdk.org >=20 > Signed-off-by: Xiao Zhang > --- > 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(-) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.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) > =09=09return -EBUSY; > =09} > =20 > -=09if (frame_size > RTE_ETHER_MAX_LEN) > +=09if (frame_size > RTE_ETHER_MAX_LEN + I40E_VLAN_TAG_SIZE * 2) > =09=09dev_data->dev_conf.rxmode.offloads |=3D > =09=09=09DEV_RX_OFFLOAD_JUMBO_FRAME; > =09else > diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_et= hdev_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 i= 40e_rx_queue *rxq) > =09=09} Size check in jumbo on case needs to be updated also > =09} else { > =09=09if (rxq->max_pkt_len < RTE_ETHER_MIN_LEN || > -=09=09 rxq->max_pkt_len > RTE_ETHER_MAX_LEN) { > +=09=09 rxq->max_pkt_len > RTE_ETHER_MAX_LEN + > +=09=09=09=09I40E_VLAN_TAG_SIZE * 2) { > =09=09=09PMD_DRV_LOG(ERR, "maximum packet length must be " > =09=09=09=09"larger than %u and smaller than %u, as jumbo " > =09=09=09=09"frame is disabled", > =09=09=09=09(uint32_t)RTE_ETHER_MIN_LEN, > -=09=09=09=09(uint32_t)RTE_ETHER_MAX_LEN); > +=09=09=09=09(uint32_t)RTE_ETHER_MAX_LEN + > +=09=09=09=09=09I40E_VLAN_TAG_SIZE * 2); > =09=09=09return I40E_ERR_CONFIG; > =09=09} > =09} > @@ -2747,7 +2749,7 @@ i40evf_dev_mtu_set(struct rte_eth_dev *dev, uint16_= t mtu) > =09=09return -EBUSY; > =09} > =20 > -=09if (frame_size > RTE_ETHER_MAX_LEN) > +=09if (frame_size > RTE_ETHER_MAX_LEN + I40E_VLAN_TAG_SIZE * 2) > =09=09dev_data->dev_conf.rxmode.offloads |=3D > =09=09=09DEV_RX_OFFLOAD_JUMBO_FRAME; > =09else > 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) > =09=09} Size check in jumbo on case needs to be updated also > =09} else { > =09=09if (rxq->max_pkt_len < RTE_ETHER_MIN_LEN || > -=09=09=09rxq->max_pkt_len > RTE_ETHER_MAX_LEN) { > +=09=09=09rxq->max_pkt_len > RTE_ETHER_MAX_LEN + > +=09=09=09=09I40E_VLAN_TAG_SIZE * 2) { > =09=09=09PMD_DRV_LOG(ERR, "maximum packet length must be " > =09=09=09=09 "larger than %u and smaller than %u, " > =09=09=09=09 "as jumbo frame is disabled", > =09=09=09=09 (uint32_t)RTE_ETHER_MIN_LEN, > -=09=09=09=09 (uint32_t)RTE_ETHER_MAX_LEN); > +=09=09=09=09 (uint32_t)RTE_ETHER_MAX_LEN + > +=09=09=09=09=09=09I40E_VLAN_TAG_SIZE * 2); > =09=09=09return I40E_ERR_CONFIG; > =09=09} > =09} >=20 Doing quick search for RTE_ETHER_MAX_LEN, - in i40e_fdir_rx_queue_init(), is 'rx_ctx.rxmax =3D 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.