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 9113DA04B7; Wed, 14 Oct 2020 12:30:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 452A31D991; Wed, 14 Oct 2020 12:30:49 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 304681BFD6 for ; Wed, 14 Oct 2020 12:30:47 +0200 (CEST) IronPort-SDR: Tp5UTLcJWQ8kKBWrZp+Zvzh4uVlhp2lKaC4l+47FV1zUuwXdq0ZeQg3r7uMpoy0SdB48pPg5Q5 nVaqIW5F56yw== X-IronPort-AV: E=McAfee;i="6000,8403,9773"; a="145940653" X-IronPort-AV: E=Sophos;i="5.77,374,1596524400"; d="scan'208";a="145940653" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2020 03:30:44 -0700 IronPort-SDR: G1aII+XgzTI/j9ZHNxq60OP0S6+L9asX5vU99YrAPk+6chem2mu37VB1I9Ry8pthATF5fs8kZ2 8Qv9BqSaI2rw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,374,1596524400"; d="scan'208";a="351446453" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga002.fm.intel.com with ESMTP; 14 Oct 2020 03:30:44 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 14 Oct 2020 03:30:44 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Wed, 14 Oct 2020 03:30:44 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.107) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Wed, 14 Oct 2020 03:30:40 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bZMiVXLUGd0o0t+ebkvHYvAtYEghHfPGtBJf9cwDrmTZhWygjUa1zlXqqdOQBzfXd9GwZcxpiE/XqthGoVG12vtfQRXwFV7jHa94eTm3g1xk4nacbURJAYqVd8f+665fHAVn4ETGOx76E24gzUTgHlTVLrRVOMm8MnvZMm0ZYoUNMOZyghUdzadrLZwQieo6WKclLmAzrEixaSgiOkakBHOCWVjvtmu+yxqzss4ibkOi36U2RcIfYTwdEqPAILvJJHiBEbneYMb6Dkpz+k4RjHz4QNVJivParaHDU3UEbylDZbUsOg4ERsVpPcmGO1/KmUtQgKJBw6doH91ydhOS2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=f5TXHFBWWGrHwvghrjdP/v76PxGb48kSDVTax3mBtfM=; b=AW3ZiZ9lyba0aqz451BoFWj9PupNUGjJgOjJieNIXaejB+xa7dXe9FwIc21Hy7n1tSK3OpX4TPUEVzGPdssm2Hz+Q4wZl1bB/PIihLeX48EL5GWZsRRKRRPMpUHvNgTu8nl2TOuQ0Q6bm8O04B5q90NUzym458O1SOruonSXsJTUS5GljPYVD5oYWScDhsrpcm7k0hd2L68x6Y3g/v0y7zMrHHINnNckbbA/qceKDjzG+HKiyulTaln+O2RCyBbyprrckMJrbCvL4XKN8rrJgo1XvAMkBHz3tY8o3dr6u9mQ1pqL353VAxdM1v8XP1jEiFjLRmh4VV/+LWemOcI0UQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=f5TXHFBWWGrHwvghrjdP/v76PxGb48kSDVTax3mBtfM=; b=swN3tFB7uAYuP8iDE8xNS8t4fWlMjXknYHx7Nqsl+g/iGRDbGq4z3nYhzrbaf/ow3d+69P9+zLrzLhrkcKPGgEYc+CVShDXfFhbjMYCS9OGzEZmQNvgZkaxNRQx+To228Aa2LtAixzANgtOp6APKD8zfk+jkAhRmWSD+aTjnU9c= Received: from SN6PR11MB3310.namprd11.prod.outlook.com (2603:10b6:805:b9::13) by SN6PR11MB3455.namprd11.prod.outlook.com (2603:10b6:805:bb::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21; Wed, 14 Oct 2020 10:30:33 +0000 Received: from SN6PR11MB3310.namprd11.prod.outlook.com ([fe80::ed1d:ff6d:e1e2:6d07]) by SN6PR11MB3310.namprd11.prod.outlook.com ([fe80::ed1d:ff6d:e1e2:6d07%2]) with mapi id 15.20.3455.030; Wed, 14 Oct 2020 10:30:33 +0000 From: "Ananyev, Konstantin" To: "Yang, SteveX" , "dev@dpdk.org" CC: "Guo, Jia" , "Yang, Qiming" , "Zhang, Qi Z" , "Wu, Jingjing" , "Xing, Beilei" , "Yang, SteveX" Thread-Topic: [PATCH v5 4/5] net/i40e: fix max mtu size packets with vlan tag cannot be received by default Thread-Index: AQHWogtuhc6720tS2UeYAxjfbJ4R4KmW5bcQ Date: Wed, 14 Oct 2020 10:30:32 +0000 Message-ID: References: <20200928065541.7520-1-stevex.yang@intel.com> <20201014091945.1934-1-stevex.yang@intel.com> <20201014091945.1934-5-stevex.yang@intel.com> In-Reply-To: <20201014091945.1934-5-stevex.yang@intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [46.7.39.127] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c3c27198-596c-4319-0655-08d8702c2e47 x-ms-traffictypediagnostic: SN6PR11MB3455: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: mC9bGlWDwGBoeNVxdBZpc5NWzoKf3CoQbYoB6vEU14hXPBFPPpDhOi4RFtIAmP4mKc8SpAvjRm0YH996qJKyySURjdpTEWSxV0CPBrNaCNoSEeFPWOVVRrfTaV/LCIu7Myuct1akvOMlbeX3mbqwFyEhZfVox+cmrx1fhhJt/1ifeHTzS7i/pKFT3oYdB6Mg2EXXve0u2q053Z/4cnQD5stfphbHdJJ/ASZQ59QN7W7fC6og5j0ucwXajkkL6G2gCpDRfgw0EQU8hhpUmBRw2+4mGJUQOU/L6xbPlGM9VkretQ/C9/IcYODUaWMhsHuAbH4MnVfw6RbGwovuemn2sA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3310.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(346002)(396003)(376002)(136003)(39860400002)(6506007)(2906002)(4326008)(107886003)(76116006)(5660300002)(7696005)(52536014)(83380400001)(86362001)(316002)(55016002)(66476007)(64756008)(66446008)(71200400001)(110136005)(26005)(66556008)(54906003)(33656002)(8936002)(8676002)(9686003)(478600001)(66946007)(186003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: 7QzH62666QLLtPnFPk5WHQbrBz881NHoOLDQDnGGW+dN7x8595beoQEEibwEBtps/q7ufyxY/SQBd2rsZJzovahWQntiNouXw+M39fP/PyyrS9VIQM/srgHipaAgttRhWbGufVaRFNeWllQcpGeQVim8Y00OicF8LeCH0GGPGh1LGllq9ZqhXUrtoFShyNf3XiBlqjV0SxMnfoFe7a22xzbLDT72dU3VGtrfCOikb4tvK+9ueW58TFP7SAfIj7azU/wxoxJIBsDxP0Z0vlaS5iHVvwihNvw6PGHyZR1FlJ31ppqUODB9DdUZoCAN3N8Ge3Ajp11aOnTaTEWBBL6+4/tBuD3mT1OBzb//atqywbFhiJTs48GRaKwBEVrQEaSwaFwETxDxLNtUzKHHxpr9OXUb/IWj1nxr0PwcAFC97tySJLKzTqNERd5fDvQiLjyphjfO3M0170v2+09MXjyhc2NcR8xs5o4E/BgwbuiuQWubNVb3hZVKOL89MOXYPw8RE6u8Vqmyl8lJVjh1nPCgeec4IUOmbHKYS7urovMxNEml1wk5LwUlNxSM1cq+guvLURzfuE8n/s6WzdYkkUApJKIHL9AY2WSSrxDCCCxv+iMutWUCcuNqIYlWTDI2gL8R+4yIEX7N+Kvioj9YhX95rA== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB3310.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c3c27198-596c-4319-0655-08d8702c2e47 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Oct 2020 10:30:32.8014 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: gtq/tyeh7U1NDIoxHc1vqe4bbkNQoQfwyjcwgq8QDSRc4erYu76cm3BvCuOzaP31jM/q0nQWscW0EL2E+24BC8OShDRGFF9ymXSZOH+GbdY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3455 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v5 4/5] net/i40e: fix max mtu size packets with vlan tag cannot be received by default 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" >=20 > when application presets the max rx packet length and expected mtu at > the same time, driver need identify if the preset max frame size can > hold mtu data and Ether overhead completely. >=20 > if not, adjust the max frame size via mtu_set ops within dev_configure. >=20 > Fixes: ff8282f4bbcd ("net/i40e: consider QinQ when setting MTU") >=20 > Signed-off-by: SteveX Yang > --- > drivers/net/i40e/i40e_ethdev.c | 11 +++++++++++ > drivers/net/i40e/i40e_ethdev_vf.c | 13 ++++++++++++- > 2 files changed, 23 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.c > index 943cfe71d..272cfc7ca 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -1911,6 +1911,7 @@ i40e_dev_configure(struct rte_eth_dev *dev) > struct i40e_pf *pf =3D I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); > struct i40e_hw *hw =3D I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); > enum rte_eth_rx_mq_mode mq_mode =3D dev->data->dev_conf.rxmode.mq_mode; > + uint32_t frame_size =3D dev->data->mtu + I40E_ETH_OVERHEAD; > int i, ret; >=20 > ret =3D i40e_dev_sync_phy_type(hw); > @@ -1925,6 +1926,16 @@ i40e_dev_configure(struct rte_eth_dev *dev) > ad->tx_simple_allowed =3D true; > ad->tx_vec_allowed =3D true; >=20 > + /** > + * Reset the max frame size via mtu_set ops if preset max frame Typo, should be 'present', I think. Acked-by: Konstantin Ananyev > + * cannot hold MTU data and Ether overhead. > + */ > + if (frame_size > dev->data->dev_conf.rxmode.max_rx_pkt_len) { > + ret =3D i40e_dev_mtu_set(dev, dev->data->mtu); > + if (ret !=3D 0) > + return ret; > + } > + > if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) > dev->data->dev_conf.rxmode.offloads |=3D DEV_RX_OFFLOAD_RSS_HASH; >=20 > diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_et= hdev_vf.c > index 4d6510d1f..686f3c627 100644 > --- a/drivers/net/i40e/i40e_ethdev_vf.c > +++ b/drivers/net/i40e/i40e_ethdev_vf.c > @@ -1664,6 +1664,8 @@ i40evf_dev_configure(struct rte_eth_dev *dev) > I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); > uint16_t num_queue_pairs =3D RTE_MAX(dev->data->nb_rx_queues, > dev->data->nb_tx_queues); > + uint32_t frame_size =3D dev->data->mtu + I40E_ETH_OVERHEAD; > + int ret; >=20 > /* Initialize to TRUE. If any of Rx queues doesn't meet the bulk > * allocation or vector Rx preconditions we will reset it. > @@ -1676,9 +1678,18 @@ i40evf_dev_configure(struct rte_eth_dev *dev) > dev->data->dev_conf.intr_conf.lsc =3D > !!(dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC); >=20 > + /** > + * Reset the max frame size via mtu_set ops if preset max frame > + * cannot hold MTU data and Ether overhead. > + */ > + if (frame_size > dev->data->dev_conf.rxmode.max_rx_pkt_len) { > + ret =3D i40evf_dev_mtu_set(dev, dev->data->mtu); > + if (ret !=3D 0) > + return ret; > + } > + > if (num_queue_pairs > vf->vsi_res->num_queue_pairs) { > struct i40e_hw *hw; > - int ret; >=20 > if (rte_eal_process_type() !=3D RTE_PROC_PRIMARY) { > PMD_DRV_LOG(ERR, > -- > 2.17.1