[dpdk-dev] [PATCH v2 10/22] net/ipn3ke: fix the jumbo frame flag condition for mtu set

Xu, Rosen rosen.xu at intel.com
Sat Dec 19 01:54:56 CET 2020


Hi,

> -----Original Message-----
> From: Steve Yang <stevex.yang at intel.com>
> Sent: Thursday, December 17, 2020 17:23
> To: dev at dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu at intel.com>; Xing, Beilei
> <beilei.xing at intel.com>; Iremonger, Bernard
> <bernard.iremonger at intel.com>; asomalap at amd.com;
> rahul.lakkireddy at chelsio.com; hemant.agrawal at nxp.com;
> sachin.saxena at oss.nxp.com; Guo, Jia <jia.guo at intel.com>; Wang, Haiyue
> <haiyue.wang at intel.com>; g.singh at nxp.com; xuanziyang2 at huawei.com;
> cloud.wangxiaoyun at huawei.com; zhouguoyang at huawei.com;
> xavier.huwei at huawei.com; humin29 at huawei.com;
> yisen.zhuang at huawei.com; oulijun at huawei.com; Wu, Jingjing
> <jingjing.wu at intel.com>; Yang, Qiming <qiming.yang at intel.com>; Zhang, Qi
> Z <qi.z.zhang at intel.com>; Xu, Rosen <rosen.xu at intel.com>;
> sthotton at marvell.com; srinivasan at marvell.com;
> heinrich.kuhn at netronome.com; hkalra at marvell.com; jerinj at marvell.com;
> ndabilpuram at marvell.com; kirankumark at marvell.com;
> rmody at marvell.com; shshaikh at marvell.com;
> andrew.rybchenko at oktetlabs.ru; mczekaj at marvell.com;
> thomas at monjalon.net; Yigit, Ferruh <ferruh.yigit at intel.com>;
> ivan.boule at 6wind.com; Ananyev, Konstantin
> <konstantin.ananyev at intel.com>; samuel.gauthier at 6wind.com;
> david.marchand at 6wind.com; shahafs at mellanox.com;
> stephen at networkplumber.org; maxime.coquelin at redhat.com;
> olivier.matz at 6wind.com; lihuisong at huawei.com; shreyansh.jain at nxp.com;
> wei.dai at intel.com; fengchunsong at huawei.com; chenhao164 at huawei.com;
> tangchengchang at hisilicon.com; Zhang, Helin <helin.zhang at intel.com>;
> yanglong.wu at intel.com; xiaolong.ye at intel.com; Xu, Ting
> <ting.xu at intel.com>; Li, Xiaoyun <xiaoyun.li at intel.com>; Wei, Dan
> <dan.wei at intel.com>; Pei, Andy <andy.pei at intel.com>;
> vattunuru at marvell.com; skori at marvell.com; sony.chacko at qlogic.com;
> Richardson, Bruce <bruce.richardson at intel.com>; ivan.malov at oktetlabs.ru;
> rad at semihalf.com; slawomir.rosek at semihalf.com;
> kamil.rytarowski at caviumnetworks.com; Zhao1, Wei <wei.zhao1 at intel.com>;
> Jiang, JunyuX <junyux.jiang at intel.com>; kumaras at chelsio.com;
> girish.nandibasappa at amd.com; rolf.neugebauer at netronome.com;
> alejandro.lucero at netronome.com; Yang, SteveX <stevex.yang at intel.com>
> Subject: [PATCH v2 10/22] net/ipn3ke: fix the jumbo frame flag condition for
> mtu set
> 
> The jumbo frame uses the 'RTE_ETHER_MAX_LEN' as boundary condition,
> but the Ether overhead is larger than 18 when it supports dual VLAN tags.
> That will cause the jumbo flag rx offload is wrong when MTU size is
> 'RTE_ETHER_MTU'.
> 
> This fix will change the boundary condition with 'RTE_ETHER_MTU' and
> overhead.
> 
> Fixes: 70d6b7f550f4 ("net/ipn3ke: add representor")
> 
> Signed-off-by: Steve Yang <stevex.yang at intel.com>
> ---
>  drivers/net/ipn3ke/ipn3ke_ethdev.h      | 1 +
>  drivers/net/ipn3ke/ipn3ke_representor.c | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ipn3ke/ipn3ke_ethdev.h
> b/drivers/net/ipn3ke/ipn3ke_ethdev.h
> index 9b0cf309c8..a6815a9cca 100644
> --- a/drivers/net/ipn3ke/ipn3ke_ethdev.h
> +++ b/drivers/net/ipn3ke/ipn3ke_ethdev.h
> @@ -640,6 +640,7 @@ ipn3ke_tm_ops_get(struct rte_eth_dev *ethdev,
>   */
>  #define IPN3KE_ETH_OVERHEAD \
>  	(RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN +
> IPN3KE_VLAN_TAG_SIZE * 2)
> +#define IPN3KE_ETH_MAX_LEN (RTE_ETHER_MTU +
> IPN3KE_ETH_OVERHEAD)
> 
>  #define IPN3KE_MAC_FRAME_SIZE_MAX    9728
>  #define IPN3KE_MAC_RX_FRAME_MAXLENGTH    0x00AE
> diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c
> b/drivers/net/ipn3ke/ipn3ke_representor.c
> index 8a53602576..9e15cce34f 100644
> --- a/drivers/net/ipn3ke/ipn3ke_representor.c
> +++ b/drivers/net/ipn3ke/ipn3ke_representor.c
> @@ -2801,7 +2801,7 @@ ipn3ke_rpst_mtu_set(struct rte_eth_dev *ethdev,
> uint16_t mtu)
>  		return -EBUSY;
>  	}
> 
> -	if (frame_size > RTE_ETHER_MAX_LEN)
> +	if (frame_size > IPN3KE_ETH_MAX_LEN)
>  		dev_data->dev_conf.rxmode.offloads |=
>  			(uint64_t)(DEV_RX_OFFLOAD_JUMBO_FRAME);
>  	else
> --
> 2.17.1

Reviewed-by: Rosen Xu <rosen.xu at intel.com>


More information about the dev mailing list