From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C605AA034F; Fri, 8 Oct 2021 10:50:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B177940685; Fri, 8 Oct 2021 10:50:13 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 925FE4067B for ; Fri, 8 Oct 2021 10:50:11 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="207274632" X-IronPort-AV: E=Sophos;i="5.85,357,1624345200"; d="scan'208";a="207274632" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2021 01:39:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,357,1624345200"; d="scan'208";a="489375543" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by orsmga008.jf.intel.com with ESMTP; 08 Oct 2021 01:39:49 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Fri, 8 Oct 2021 01:39:48 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Fri, 8 Oct 2021 01:39:48 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.171) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Fri, 8 Oct 2021 01:39:47 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cJVe8P22Lp9AGO7rlVIgIJD7MjwJEYdCXWAq9x4HWuOEce+R+2QxEnl6IBjSuy65Vwju5fgnIS8wuDQyJIIiUuVxZaMhbgIHRoH9c0vAA+Bt3WiYdkyVQ2vFYZ97ZVNDmS9Qa11mjFRJJOlrnlEvfqfdWEovgSOe93ypx5mV0hxrtSAA500UgNnR3+xJ7Dxnuh/RNID8fn7eeJBUfwnUunlNx+60500YfXCniQ3R9H9Fc4eFUi9XIee7AkJDezLASpgo9r7IhVkRhiSmU5Eseg/WnDWM0+nX9PaCq9Y8HuWaOdEHkxXXQJDxCgrt+M6/d9TFlJziN3ZeOGln3cpY4w== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dsZRLBEwaN3VP9JcWPeqc+0u2KrjgR9hazCTnqB6awI=; b=OBNV/YpgVfG0VgqZDXBtJdnHbHMKkk2kkwKBY4/s2tOzIXsqjgY+anfSn8HUhqGJsRF05oL8Y5eEPdgtJXiPmawZivOSPeMNdjdQJf07mx9hXP/bwsPKNhYpUo3N/heONUUi+LcVMqMa2dvIXIPuqqBn2TGyCNSOkYGUMj538pa61C1CQw1ixaUWyhenFjaDKVUnsnElGYtb2UKnpitEohmNwtzPUMNhRN5VWLPHeUmgXpyxY1DQekaNF1ttyXCWYcwt+tovoE+rruqUcMayypovtx0ivs91yxyhNcM4eXsuQZbIEYBE0uiWueUL/Gq+dX5xr3mnUrK07U9z+IL2Ig== 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=dsZRLBEwaN3VP9JcWPeqc+0u2KrjgR9hazCTnqB6awI=; b=ITnsSHV/sqxm3ZeoHcDzUcvbtBtsJodxjf40XNEIwRnf9PlnBC55d8i86NlcSwr0Jkr0gZsWv3fYa5psa4nBJpx1la0woB9J2FZa/IRa7XLm+ZMgPNlO6ULkLxPZM7X15F/vChv0APNKbW9c10LxmRWMj+XotAeEMIKfw6DCNyQ= Received: from BYAPR11MB2901.namprd11.prod.outlook.com (2603:10b6:a03:91::23) by SJ0PR11MB4928.namprd11.prod.outlook.com (2603:10b6:a03:2d2::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.19; Fri, 8 Oct 2021 08:39:40 +0000 Received: from BYAPR11MB2901.namprd11.prod.outlook.com ([fe80::954c:3fe0:a7af:7c96]) by BYAPR11MB2901.namprd11.prod.outlook.com ([fe80::954c:3fe0:a7af:7c96%3]) with mapi id 15.20.4566.022; Fri, 8 Oct 2021 08:39:40 +0000 From: "Xu, Rosen" To: "Yigit, Ferruh" , Somalapuram Amaranath , Ajit Khaparde , Somnath Kotur , Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , Rahul Lakkireddy , Hemant Agrawal , Sachin Saxena , "Wang, Haiyue" , Gagandeep Singh , Ziyang Xuan , Xiaoyun Wang , Guoyang Zhou , "Min Hu (Connor)" , Yisen Zhuang , Lijun Ou , "Xing, Beilei" , "Wu, Jingjing" , "Yang, Qiming" , "Zhang, Qi Z" , Shijith Thotton , Srisivasubramanian Srinivasan , Heinrich Kuhn , Harman Kalra , Jerin Jacob , Rasesh Mody , Devendra Singh Rawat , Andrew Rybchenko , Maciej Czekaj , Jiawen Wu , Jian Wang , Thomas Monjalon CC: "dev@dpdk.org" Thread-Topic: [PATCH v4 2/6] ethdev: move jumbo frame offload check to library Thread-Index: AQHXugzjEtl87m6zREaU6ecCyqcXc6vIy+IQ Date: Fri, 8 Oct 2021 08:39:40 +0000 Message-ID: References: <20211001143624.3744505-1-ferruh.yigit@intel.com> <20211005171653.3700067-1-ferruh.yigit@intel.com> <20211005171653.3700067-2-ferruh.yigit@intel.com> In-Reply-To: <20211005171653.3700067-2-ferruh.yigit@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzA4MjAxMTItMzRkYi00ZDQ4LWI0MWQtMmY4NGFlOGJiZGE3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUUkzTndZRHhlQVNlQTJHV0FHUjFyTUZ2cWhFYjZyakQ1SHhMQTU5UFkwb1FWaGFCXC85ekU3cGZpbGNzanFIalAifQ== x-ctpclassification: CTP_NT authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6e285d29-d232-459f-2055-08d98a372b70 x-ms-traffictypediagnostic: SJ0PR11MB4928: 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:8882; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: /7+w23StlYTjAnjQSO2OV9WJogdZ4L5z+lsDjoRHCNkmOse6X/6XPfY2Vi56O3U80bRwdsX1BuxU5KxDNl3lHv1sFPVJEikZZM+BWTPmS3L+44yl0hzIdo4maE7X1aRMIn5bZI8ZBOxmV392Rzo68wKsJatASQTo6UPc8hN4E/8CDqvpp/12Q9ogKBoNFlt30t8kCIbSoMNcTlErcfzAUsWcaot21/FkdvBClGXFoeI8nxsql7XbxUo2H6938Y3WyIi0tKeCCp9uJq56suBl9C2wFavbQ4X0sEGBZFuw+k+uWlImDMDKapGveuF94C4UngcB/DWej+aP3+4IAhXCXLw0h4RDFGjw0cBLRIWXfsnm4/dPdmiWaYZi/D44VLkaTIu39sPFhNQNo3QL+4Of4eZJ6ZuvxS41W6NZDE33w1LLsyVXE7CQ5++8UJeVxo76Ptk1qbwr5DRfIc6qZ2rEvk1OboRBmQB9+vWmmRbatgrgeFz1P6yCKSnAzwV16a2X6QkHtLpI7WEg/ueMFJGzcsXKCqLIHP5WN5kbzd3DsfEymU0O3TzIkDP3lX17rkh97OLLY19lhtvsNaKdnlIr9vj7cb9HKHT/ArZJ/KQNsA9KOgQhmIhOZTLGY013gEPvC21n5C6k/lV2A4FD3MXdra2ysmMacUUUuGVTHMLqpOwcfnPfs1jX68UWtqkRM+wV0SrIav/RDabPO55WKmLnZWkcWR0oxFpT7zyhz72WU6o= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB2901.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(55016002)(9686003)(53546011)(2906002)(83380400001)(6506007)(26005)(33656002)(186003)(64756008)(66556008)(66446008)(66476007)(30864003)(66946007)(86362001)(52536014)(921005)(5660300002)(8676002)(76116006)(316002)(4326008)(8936002)(122000001)(110136005)(7696005)(38070700005)(7416002)(508600001)(71200400001)(38100700002)(7406005)(559001)(579004); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?tAwbMYx+8yeJoHAEXObzoibpPFZG0HXQIjV6awWcnBbVusHF1lBZsxJqpqJj?= =?us-ascii?Q?GHkfVXHyeUlUZFeW54c0Sv8s4pxhfdjf0r66eHJwxmNrSfdgBIR6gTAfYaeR?= =?us-ascii?Q?U1HC03n61QQhKCedjwUaUAXKs2+p7I+sJXD/Xu2u0s1FMCPBpEL0rW/Z8a9K?= =?us-ascii?Q?yJdaONY3mcXYrumYEU2XnOsPIpJXA/gvSrF/jKjvYWx+BPBbn0jrVDRgTEpY?= =?us-ascii?Q?58N/nNKeAQovURXIgBug8ofoGG4jtB9cTheT2mJ0dzzOWXIm+SAPdZEWnCKp?= =?us-ascii?Q?xY/E6ntlhOVN/0iE42i8n57r96WStmn9pCPCV46tQoI+gF7SGF+vcQEmBOmn?= =?us-ascii?Q?hW/tOM2gI/3wr67is5/3H2posb5essKuhrDdQG4ngdnlJjaLUPlmbN7D4jBZ?= =?us-ascii?Q?ij06zO90GGkqAi4kn6Aixxeigm1KfTFfWu7zSVfcKhmtYDhOgMVFbT46crap?= =?us-ascii?Q?GKrgZ4Tz4AQWqb/W2Q2VS8X7oWlxyKbpxifLaBVo1H5bnk0NPcW++2Y7z0dV?= =?us-ascii?Q?b1EBIWxSTpe5oZ4QnsHgOFGeW8Qq8Uutu9N5RW0aTlxoKe+sxs1OqFQuZ4Mx?= =?us-ascii?Q?Wt0NuQVYi897Mbc7pypiMfBBmMYzZK9NK4mG6dqrnGfX/KlsVNmObBOboBTM?= =?us-ascii?Q?C8ZiR2P1nrF+qqeD4OFFGN52hEkTgUy8+tZDKJT/5F/ikDBhWs/oCnx6jxKL?= =?us-ascii?Q?xEl7e8PcMce2IDZsG3XbCkE9Hku/2CNMNunsRVybcdF+oe2luGdASLor78Ca?= =?us-ascii?Q?uCq+pNqu5fZA17Zup5spx0hEnLTgQxWPo4sHyrzQxyAfY/oqXvxVjTzG7KVN?= =?us-ascii?Q?aTR2FYdt86nuPQf/9FUV0VpX8DL7kgQpglzq4O5Ctl1hQf8Mhws4KeEgmNRo?= =?us-ascii?Q?YkCV/ivDvMce0booBk5dB/sB0/UlI/ZcyQcBr5zTVmVc0slVHdhqaRgOyQOw?= =?us-ascii?Q?iyu2yeZ3FKXmr3TGhSRDxU+R7i0JT8ojdO9Zm+w/FTrH2hgkmlvXuAjfJdOV?= =?us-ascii?Q?Sa9TlE7i6ZBmfDoEFpBJj3oPSEVPyU8vkz7D4Qb5KRUxcaEsS479kF6w20ls?= =?us-ascii?Q?P2dB6jQs7R9kyoUVQEOo+VsfPjJ1VNShFmZyaOC8xhpVFi8pOYJkTVnMhZ2e?= =?us-ascii?Q?MGDbUU3736AcFaQRigaDgCn0HNLjLLV3DdYdWx/WVXOWt25AxjGVI5y4utjx?= =?us-ascii?Q?edRFv1gdynTb+8TM0Zf4M/swqlsOLk1dEk5Lxce89On8UCtEIjt5Gbahp0Bg?= =?us-ascii?Q?lLAzOf2VLHkfpXkHHDw0NkPspzmOdhTnv8EBp5DWq/nkfum2lklpZ0hC0aKH?= =?us-ascii?Q?Lsnf9mZW/Sv7/7zJ2h/u7AE+?= 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: BYAPR11MB2901.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6e285d29-d232-459f-2055-08d98a372b70 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Oct 2021 08:39:40.3730 (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: DSiG1LO+ITUR6lNzI1gMO0q1eDdm2fbvWxVtCASjKMSX6Y2iZzh6iUwRGhPENbUEa03/DqxIyUEP1IN3n664yA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4928 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v4 2/6] ethdev: move jumbo frame offload check to library X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" Reviewed-by: Rosen Xu > -----Original Message----- > From: Yigit, Ferruh > Sent: Wednesday, October 06, 2021 1:17 > To: Somalapuram Amaranath ; Ajit Khaparde > ; Somnath Kotur > ; Nithin Dabilpuram > ; Kiran Kumar K ; > Sunil Kumar Kori ; Satha Rao > ; Rahul Lakkireddy > ; Hemant Agrawal > ; Sachin Saxena ; > Wang, Haiyue ; Gagandeep Singh > ; Ziyang Xuan ; Xiaoyun > Wang ; Guoyang Zhou > ; Min Hu (Connor) ; > Yisen Zhuang ; Lijun Ou > ; Xing, Beilei ; Wu, Jingjing > ; Yang, Qiming ; Zhang, Qi > Z ; Xu, Rosen ; Shijith Thotton > ; Srisivasubramanian Srinivasan > ; Heinrich Kuhn ; > Harman Kalra ; Jerin Jacob ; > Rasesh Mody ; Devendra Singh Rawat > ; Andrew Rybchenko > ; Maciej Czekaj ; > Jiawen Wu ; Jian Wang > ; Thomas Monjalon > Cc: Yigit, Ferruh ; dev@dpdk.org > Subject: [PATCH v4 2/6] ethdev: move jumbo frame offload check to library >=20 > Setting MTU bigger than RTE_ETHER_MTU requires the jumbo frame support, > and application should enable the jumbo frame offload support for it. >=20 > When jumbo frame offload is not enabled by application, but MTU bigger > than RTE_ETHER_MTU is requested there are two options, either fail or > enable jumbo frame offload implicitly. >=20 > Enabling jumbo frame offload implicitly is selected by many drivers since > setting a big MTU value already implies it, and this increases usability. >=20 > This patch moves this logic from drivers to the library, both to reduce t= he > duplicated code in the drivers and to make behaviour more visible. >=20 > Signed-off-by: Ferruh Yigit > Reviewed-by: Andrew Rybchenko > Reviewed-by: Rosen Xu > Acked-by: Ajit Khaparde > Acked-by: Somnath Kotur > --- > drivers/net/axgbe/axgbe_ethdev.c | 9 ++------- > drivers/net/bnxt/bnxt_ethdev.c | 9 ++------- > drivers/net/cnxk/cnxk_ethdev_ops.c | 5 ----- > drivers/net/cxgbe/cxgbe_ethdev.c | 8 -------- > drivers/net/dpaa/dpaa_ethdev.c | 7 ------- > drivers/net/dpaa2/dpaa2_ethdev.c | 7 ------- > drivers/net/e1000/em_ethdev.c | 9 ++------- > drivers/net/e1000/igb_ethdev.c | 9 ++------- > drivers/net/enetc/enetc_ethdev.c | 7 ------- > drivers/net/hinic/hinic_pmd_ethdev.c | 7 ------- > drivers/net/hns3/hns3_ethdev.c | 8 -------- > drivers/net/hns3/hns3_ethdev_vf.c | 6 ------ > drivers/net/i40e/i40e_ethdev.c | 5 ----- > drivers/net/iavf/iavf_ethdev.c | 7 ------- > drivers/net/ice/ice_ethdev.c | 5 ----- > drivers/net/igc/igc_ethdev.c | 9 ++------- > drivers/net/ipn3ke/ipn3ke_representor.c | 5 ----- > drivers/net/ixgbe/ixgbe_ethdev.c | 7 ++----- > drivers/net/liquidio/lio_ethdev.c | 7 ------- > drivers/net/nfp/nfp_common.c | 6 ------ > drivers/net/octeontx/octeontx_ethdev.c | 5 ----- > drivers/net/octeontx2/otx2_ethdev_ops.c | 5 ----- > drivers/net/qede/qede_ethdev.c | 4 ---- > drivers/net/sfc/sfc_ethdev.c | 9 --------- > drivers/net/thunderx/nicvf_ethdev.c | 6 ------ > drivers/net/txgbe/txgbe_ethdev.c | 6 ------ > lib/ethdev/rte_ethdev.c | 18 +++++++++++++++++- > 27 files changed, 29 insertions(+), 166 deletions(-) >=20 > diff --git a/drivers/net/axgbe/axgbe_ethdev.c > b/drivers/net/axgbe/axgbe_ethdev.c > index 76aeec077f2b..2960834b4539 100644 > --- a/drivers/net/axgbe/axgbe_ethdev.c > +++ b/drivers/net/axgbe/axgbe_ethdev.c > @@ -1492,15 +1492,10 @@ static int axgb_mtu_set(struct rte_eth_dev *dev, > uint16_t mtu) > dev->data->port_id); > return -EBUSY; > } > - if (mtu > RTE_ETHER_MTU) { > - dev->data->dev_conf.rxmode.offloads |=3D > - DEV_RX_OFFLOAD_JUMBO_FRAME; > + if (mtu > RTE_ETHER_MTU) > val =3D 1; > - } else { > - dev->data->dev_conf.rxmode.offloads &=3D > - ~DEV_RX_OFFLOAD_JUMBO_FRAME; > + else > val =3D 0; > - } > AXGMAC_IOWRITE_BITS(pdata, MAC_RCR, JE, val); > return 0; > } > diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethde= v.c > index 8c6f20b75aed..07ee19938930 100644 > --- a/drivers/net/bnxt/bnxt_ethdev.c > +++ b/drivers/net/bnxt/bnxt_ethdev.c > @@ -3052,15 +3052,10 @@ int bnxt_mtu_set_op(struct rte_eth_dev > *eth_dev, uint16_t new_mtu) > return -EINVAL; > } >=20 > - if (new_mtu > RTE_ETHER_MTU) { > + if (new_mtu > RTE_ETHER_MTU) > bp->flags |=3D BNXT_FLAG_JUMBO; > - bp->eth_dev->data->dev_conf.rxmode.offloads |=3D > - DEV_RX_OFFLOAD_JUMBO_FRAME; > - } else { > - bp->eth_dev->data->dev_conf.rxmode.offloads &=3D > - ~DEV_RX_OFFLOAD_JUMBO_FRAME; > + else > bp->flags &=3D ~BNXT_FLAG_JUMBO; > - } >=20 > /* Is there a change in mtu setting? */ > if (eth_dev->data->mtu =3D=3D new_mtu) > diff --git a/drivers/net/cnxk/cnxk_ethdev_ops.c > b/drivers/net/cnxk/cnxk_ethdev_ops.c > index 695d0d6fd3e2..349896f6a1bf 100644 > --- a/drivers/net/cnxk/cnxk_ethdev_ops.c > +++ b/drivers/net/cnxk/cnxk_ethdev_ops.c > @@ -439,11 +439,6 @@ cnxk_nix_mtu_set(struct rte_eth_dev *eth_dev, > uint16_t mtu) > plt_err("Failed to max Rx frame length, rc=3D%d", rc); > goto exit; > } > - > - if (mtu > RTE_ETHER_MTU) > - dev->rx_offloads |=3D DEV_RX_OFFLOAD_JUMBO_FRAME; > - else > - dev->rx_offloads &=3D ~DEV_RX_OFFLOAD_JUMBO_FRAME; > exit: > return rc; > } > diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c > b/drivers/net/cxgbe/cxgbe_ethdev.c > index 8cf61f12a8d6..0c9cc2f5bb3f 100644 > --- a/drivers/net/cxgbe/cxgbe_ethdev.c > +++ b/drivers/net/cxgbe/cxgbe_ethdev.c > @@ -313,14 +313,6 @@ int cxgbe_dev_mtu_set(struct rte_eth_dev *eth_dev, > uint16_t mtu) > if (mtu < RTE_ETHER_MIN_MTU || new_mtu > > dev_info.max_rx_pktlen) > return -EINVAL; >=20 > - /* set to jumbo mode if needed */ > - if (mtu > RTE_ETHER_MTU) > - eth_dev->data->dev_conf.rxmode.offloads |=3D > - DEV_RX_OFFLOAD_JUMBO_FRAME; > - else > - eth_dev->data->dev_conf.rxmode.offloads &=3D > - ~DEV_RX_OFFLOAD_JUMBO_FRAME; > - > err =3D t4_set_rxmode(adapter, adapter->mbox, pi->viid, new_mtu, -1, > -1, > -1, -1, true); > return err; > diff --git a/drivers/net/dpaa/dpaa_ethdev.c > b/drivers/net/dpaa/dpaa_ethdev.c index adbdb87baab9..57b09f16ba44 > 100644 > --- a/drivers/net/dpaa/dpaa_ethdev.c > +++ b/drivers/net/dpaa/dpaa_ethdev.c > @@ -187,13 +187,6 @@ dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t > mtu) > return -EINVAL; > } >=20 > - if (mtu > RTE_ETHER_MTU) > - dev->data->dev_conf.rxmode.offloads |=3D > - > DEV_RX_OFFLOAD_JUMBO_FRAME; > - else > - dev->data->dev_conf.rxmode.offloads &=3D > - > ~DEV_RX_OFFLOAD_JUMBO_FRAME; > - > fman_if_set_maxfrm(dev->process_private, frame_size); >=20 > return 0; > diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c > b/drivers/net/dpaa2/dpaa2_ethdev.c > index 758a14e0ad2d..df44bb204f65 100644 > --- a/drivers/net/dpaa2/dpaa2_ethdev.c > +++ b/drivers/net/dpaa2/dpaa2_ethdev.c > @@ -1470,13 +1470,6 @@ dpaa2_dev_mtu_set(struct rte_eth_dev *dev, > uint16_t mtu) > if (mtu < RTE_ETHER_MIN_MTU || frame_size > > DPAA2_MAX_RX_PKT_LEN) > return -EINVAL; >=20 > - if (mtu > RTE_ETHER_MTU) > - dev->data->dev_conf.rxmode.offloads |=3D > - > DEV_RX_OFFLOAD_JUMBO_FRAME; > - else > - dev->data->dev_conf.rxmode.offloads &=3D > - > ~DEV_RX_OFFLOAD_JUMBO_FRAME; > - > /* Set the Max Rx frame length as 'mtu' + > * Maximum Ethernet header length > */ > diff --git a/drivers/net/e1000/em_ethdev.c > b/drivers/net/e1000/em_ethdev.c index 6f418a36aa04..1b41dd04df5a > 100644 > --- a/drivers/net/e1000/em_ethdev.c > +++ b/drivers/net/e1000/em_ethdev.c > @@ -1818,15 +1818,10 @@ eth_em_mtu_set(struct rte_eth_dev *dev, > uint16_t mtu) > rctl =3D E1000_READ_REG(hw, E1000_RCTL); >=20 > /* switch to jumbo mode if needed */ > - if (mtu > RTE_ETHER_MTU) { > - dev->data->dev_conf.rxmode.offloads |=3D > - DEV_RX_OFFLOAD_JUMBO_FRAME; > + if (mtu > RTE_ETHER_MTU) > rctl |=3D E1000_RCTL_LPE; > - } else { > - dev->data->dev_conf.rxmode.offloads &=3D > - ~DEV_RX_OFFLOAD_JUMBO_FRAME; > + else > rctl &=3D ~E1000_RCTL_LPE; > - } > E1000_WRITE_REG(hw, E1000_RCTL, rctl); >=20 > return 0; > diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethde= v.c > index 4c114bf90fc7..a061d0529dd1 100644 > --- a/drivers/net/e1000/igb_ethdev.c > +++ b/drivers/net/e1000/igb_ethdev.c > @@ -4396,15 +4396,10 @@ eth_igb_mtu_set(struct rte_eth_dev *dev, > uint16_t mtu) > rctl =3D E1000_READ_REG(hw, E1000_RCTL); >=20 > /* switch to jumbo mode if needed */ > - if (mtu > RTE_ETHER_MTU) { > - dev->data->dev_conf.rxmode.offloads |=3D > - DEV_RX_OFFLOAD_JUMBO_FRAME; > + if (mtu > RTE_ETHER_MTU) > rctl |=3D E1000_RCTL_LPE; > - } else { > - dev->data->dev_conf.rxmode.offloads &=3D > - ~DEV_RX_OFFLOAD_JUMBO_FRAME; > + else > rctl &=3D ~E1000_RCTL_LPE; > - } > E1000_WRITE_REG(hw, E1000_RCTL, rctl); >=20 > E1000_WRITE_REG(hw, E1000_RLPML, frame_size); diff --git > a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_ethdev.c > index cdb9783b5372..fbcbbb6c0533 100644 > --- a/drivers/net/enetc/enetc_ethdev.c > +++ b/drivers/net/enetc/enetc_ethdev.c > @@ -677,13 +677,6 @@ enetc_mtu_set(struct rte_eth_dev *dev, uint16_t > mtu) > return -EINVAL; > } >=20 > - if (mtu > RTE_ETHER_MTU) > - dev->data->dev_conf.rxmode.offloads &=3D > - > DEV_RX_OFFLOAD_JUMBO_FRAME; > - else > - dev->data->dev_conf.rxmode.offloads &=3D > - > ~DEV_RX_OFFLOAD_JUMBO_FRAME; > - > enetc_port_wr(enetc_hw, ENETC_PTCMSDUR(0), > ENETC_MAC_MAXFRM_SIZE); > enetc_port_wr(enetc_hw, ENETC_PTXMBAR, 2 * > ENETC_MAC_MAXFRM_SIZE); >=20 > diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c > b/drivers/net/hinic/hinic_pmd_ethdev.c > index 2d8271cb6095..4b30dfa222a8 100644 > --- a/drivers/net/hinic/hinic_pmd_ethdev.c > +++ b/drivers/net/hinic/hinic_pmd_ethdev.c > @@ -1547,13 +1547,6 @@ static int hinic_dev_set_mtu(struct rte_eth_dev > *dev, uint16_t mtu) > return ret; > } >=20 > - if (mtu > RTE_ETHER_MTU) > - dev->data->dev_conf.rxmode.offloads |=3D > - DEV_RX_OFFLOAD_JUMBO_FRAME; > - else > - dev->data->dev_conf.rxmode.offloads &=3D > - ~DEV_RX_OFFLOAD_JUMBO_FRAME; > - > nic_dev->mtu_size =3D mtu; >=20 > return ret; > diff --git a/drivers/net/hns3/hns3_ethdev.c > b/drivers/net/hns3/hns3_ethdev.c index 4ead227f9122..e1d465de8234 > 100644 > --- a/drivers/net/hns3/hns3_ethdev.c > +++ b/drivers/net/hns3/hns3_ethdev.c > @@ -2571,7 +2571,6 @@ hns3_dev_mtu_set(struct rte_eth_dev *dev, > uint16_t mtu) > struct hns3_adapter *hns =3D dev->data->dev_private; > uint32_t frame_size =3D mtu + HNS3_ETH_OVERHEAD; > struct hns3_hw *hw =3D &hns->hw; > - bool is_jumbo_frame; > int ret; >=20 > if (dev->data->dev_started) { > @@ -2581,7 +2580,6 @@ hns3_dev_mtu_set(struct rte_eth_dev *dev, > uint16_t mtu) > } >=20 > rte_spinlock_lock(&hw->lock); > - is_jumbo_frame =3D mtu > RTE_ETHER_MTU ? true : false; > frame_size =3D RTE_MAX(frame_size, HNS3_DEFAULT_FRAME_LEN); >=20 > /* > @@ -2596,12 +2594,6 @@ hns3_dev_mtu_set(struct rte_eth_dev *dev, > uint16_t mtu) > return ret; > } >=20 > - if (is_jumbo_frame) > - dev->data->dev_conf.rxmode.offloads |=3D > - > DEV_RX_OFFLOAD_JUMBO_FRAME; > - else > - dev->data->dev_conf.rxmode.offloads &=3D > - > ~DEV_RX_OFFLOAD_JUMBO_FRAME; > rte_spinlock_unlock(&hw->lock); >=20 > return 0; > diff --git a/drivers/net/hns3/hns3_ethdev_vf.c > b/drivers/net/hns3/hns3_ethdev_vf.c > index 0b5db486f8d6..3438b3650de6 100644 > --- a/drivers/net/hns3/hns3_ethdev_vf.c > +++ b/drivers/net/hns3/hns3_ethdev_vf.c > @@ -908,12 +908,6 @@ hns3vf_dev_mtu_set(struct rte_eth_dev *dev, > uint16_t mtu) > rte_spinlock_unlock(&hw->lock); > return ret; > } > - if (mtu > RTE_ETHER_MTU) > - dev->data->dev_conf.rxmode.offloads |=3D > - > DEV_RX_OFFLOAD_JUMBO_FRAME; > - else > - dev->data->dev_conf.rxmode.offloads &=3D > - > ~DEV_RX_OFFLOAD_JUMBO_FRAME; > rte_spinlock_unlock(&hw->lock); >=20 > return 0; > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.c > index ab571a921f9e..9283adb19304 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -11775,11 +11775,6 @@ i40e_dev_mtu_set(struct rte_eth_dev *dev, > uint16_t mtu) > return -EBUSY; > } >=20 > - if (mtu > RTE_ETHER_MTU) > - dev_data->dev_conf.rxmode.offloads |=3D > DEV_RX_OFFLOAD_JUMBO_FRAME; > - else > - dev_data->dev_conf.rxmode.offloads &=3D > ~DEV_RX_OFFLOAD_JUMBO_FRAME; > - > return ret; > } >=20 > diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethde= v.c > index 0eabce275d92..844d26d87ba6 100644 > --- a/drivers/net/iavf/iavf_ethdev.c > +++ b/drivers/net/iavf/iavf_ethdev.c > @@ -1473,13 +1473,6 @@ iavf_dev_mtu_set(struct rte_eth_dev *dev, > uint16_t mtu) > return -EBUSY; > } >=20 > - if (mtu > RTE_ETHER_MTU) > - dev->data->dev_conf.rxmode.offloads |=3D > - DEV_RX_OFFLOAD_JUMBO_FRAME; > - else > - dev->data->dev_conf.rxmode.offloads &=3D > - ~DEV_RX_OFFLOAD_JUMBO_FRAME; > - > return ret; > } >=20 > diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c = index > 8ee1335ac6cf..3038a9714517 100644 > --- a/drivers/net/ice/ice_ethdev.c > +++ b/drivers/net/ice/ice_ethdev.c > @@ -3992,11 +3992,6 @@ ice_mtu_set(struct rte_eth_dev *dev, uint16_t > mtu) > return -EBUSY; > } >=20 > - if (mtu > RTE_ETHER_MTU) > - dev_data->dev_conf.rxmode.offloads |=3D > DEV_RX_OFFLOAD_JUMBO_FRAME; > - else > - dev_data->dev_conf.rxmode.offloads &=3D > ~DEV_RX_OFFLOAD_JUMBO_FRAME; > - > return 0; > } >=20 > diff --git a/drivers/net/igc/igc_ethdev.c b/drivers/net/igc/igc_ethdev.c = index > b26723064b07..dcbc26b8186e 100644 > --- a/drivers/net/igc/igc_ethdev.c > +++ b/drivers/net/igc/igc_ethdev.c > @@ -1592,15 +1592,10 @@ eth_igc_mtu_set(struct rte_eth_dev *dev, > uint16_t mtu) > } >=20 > rctl =3D IGC_READ_REG(hw, IGC_RCTL); > - > - /* switch to jumbo mode if needed */ > - if (mtu > RTE_ETHER_MTU) { > - dev->data->dev_conf.rxmode.offloads |=3D > DEV_RX_OFFLOAD_JUMBO_FRAME; > + if (mtu > RTE_ETHER_MTU) > rctl |=3D IGC_RCTL_LPE; > - } else { > - dev->data->dev_conf.rxmode.offloads &=3D > ~DEV_RX_OFFLOAD_JUMBO_FRAME; > + else > rctl &=3D ~IGC_RCTL_LPE; > - } > IGC_WRITE_REG(hw, IGC_RCTL, rctl); >=20 > IGC_WRITE_REG(hw, IGC_RLPML, frame_size); diff --git > a/drivers/net/ipn3ke/ipn3ke_representor.c > b/drivers/net/ipn3ke/ipn3ke_representor.c > index 3634c0c8c5f0..e8a33f04bd69 100644 > --- a/drivers/net/ipn3ke/ipn3ke_representor.c > +++ b/drivers/net/ipn3ke/ipn3ke_representor.c > @@ -2801,11 +2801,6 @@ ipn3ke_rpst_mtu_set(struct rte_eth_dev *ethdev, > uint16_t mtu) > return -EBUSY; > } >=20 > - if (mtu > RTE_ETHER_MTU) > - dev_data->dev_conf.rxmode.offloads |=3D > DEV_RX_OFFLOAD_JUMBO_FRAME; > - else > - dev_data->dev_conf.rxmode.offloads &=3D > ~DEV_RX_OFFLOAD_JUMBO_FRAME; > - > if (rpst->i40e_pf_eth) { > ret =3D rpst->i40e_pf_eth->dev_ops->mtu_set(rpst- > >i40e_pf_eth, > mtu); > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c > b/drivers/net/ixgbe/ixgbe_ethdev.c > index 31e67d86e77b..574a7bffc9cb 100644 > --- a/drivers/net/ixgbe/ixgbe_ethdev.c > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c > @@ -5198,13 +5198,10 @@ ixgbe_dev_mtu_set(struct rte_eth_dev *dev, > uint16_t mtu) > hlreg0 =3D IXGBE_READ_REG(hw, IXGBE_HLREG0); >=20 > /* switch to jumbo mode if needed */ > - if (mtu > RTE_ETHER_MTU) { > - dev->data->dev_conf.rxmode.offloads |=3D > DEV_RX_OFFLOAD_JUMBO_FRAME; > + if (mtu > RTE_ETHER_MTU) > hlreg0 |=3D IXGBE_HLREG0_JUMBOEN; > - } else { > - dev->data->dev_conf.rxmode.offloads &=3D > ~DEV_RX_OFFLOAD_JUMBO_FRAME; > + else > hlreg0 &=3D ~IXGBE_HLREG0_JUMBOEN; > - } > IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0); >=20 > maxfrs =3D IXGBE_READ_REG(hw, IXGBE_MAXFRS); diff --git > a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c > index 976916f870a5..3a516c52d199 100644 > --- a/drivers/net/liquidio/lio_ethdev.c > +++ b/drivers/net/liquidio/lio_ethdev.c > @@ -480,13 +480,6 @@ lio_dev_mtu_set(struct rte_eth_dev *eth_dev, > uint16_t mtu) > return -1; > } >=20 > - if (mtu > RTE_ETHER_MTU) > - eth_dev->data->dev_conf.rxmode.offloads |=3D > - DEV_RX_OFFLOAD_JUMBO_FRAME; > - else > - eth_dev->data->dev_conf.rxmode.offloads &=3D > - ~DEV_RX_OFFLOAD_JUMBO_FRAME; > - > return 0; > } >=20 > diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c > index a2031a7a82cc..850ec7655f82 100644 > --- a/drivers/net/nfp/nfp_common.c > +++ b/drivers/net/nfp/nfp_common.c > @@ -962,12 +962,6 @@ nfp_net_dev_mtu_set(struct rte_eth_dev *dev, > uint16_t mtu) > return -EBUSY; > } >=20 > - /* switch to jumbo mode if needed */ > - if (mtu > RTE_ETHER_MTU) > - dev->data->dev_conf.rxmode.offloads |=3D > DEV_RX_OFFLOAD_JUMBO_FRAME; > - else > - dev->data->dev_conf.rxmode.offloads &=3D > ~DEV_RX_OFFLOAD_JUMBO_FRAME; > - > /* writing to configuration space */ > nn_cfg_writel(hw, NFP_NET_CFG_MTU, mtu); >=20 > diff --git a/drivers/net/octeontx/octeontx_ethdev.c > b/drivers/net/octeontx/octeontx_ethdev.c > index 69c3bda12df8..fb65be2c2dc3 100644 > --- a/drivers/net/octeontx/octeontx_ethdev.c > +++ b/drivers/net/octeontx/octeontx_ethdev.c > @@ -552,11 +552,6 @@ octeontx_dev_mtu_set(struct rte_eth_dev *eth_dev, > uint16_t mtu) > if (rc) > return rc; >=20 > - if (mtu > RTE_ETHER_MTU) > - nic->rx_offloads |=3D DEV_RX_OFFLOAD_JUMBO_FRAME; > - else > - nic->rx_offloads &=3D ~DEV_RX_OFFLOAD_JUMBO_FRAME; > - > octeontx_log_info("Received pkt beyond maxlen %d will be > dropped", > frame_size); >=20 > diff --git a/drivers/net/octeontx2/otx2_ethdev_ops.c > b/drivers/net/octeontx2/otx2_ethdev_ops.c > index cf7804157198..293306c7be2a 100644 > --- a/drivers/net/octeontx2/otx2_ethdev_ops.c > +++ b/drivers/net/octeontx2/otx2_ethdev_ops.c > @@ -59,11 +59,6 @@ otx2_nix_mtu_set(struct rte_eth_dev *eth_dev, > uint16_t mtu) > if (rc) > return rc; >=20 > - if (mtu > RTE_ETHER_MTU) > - dev->rx_offloads |=3D DEV_RX_OFFLOAD_JUMBO_FRAME; > - else > - dev->rx_offloads &=3D ~DEV_RX_OFFLOAD_JUMBO_FRAME; > - > return rc; > } >=20 > diff --git a/drivers/net/qede/qede_ethdev.c > b/drivers/net/qede/qede_ethdev.c index 4b971fd1fe3c..6886a4e5efb4 > 100644 > --- a/drivers/net/qede/qede_ethdev.c > +++ b/drivers/net/qede/qede_ethdev.c > @@ -2361,10 +2361,6 @@ static int qede_set_mtu(struct rte_eth_dev *dev, > uint16_t mtu) > fp->rxq->rx_buf_size =3D rc; > } > } > - if (mtu > RTE_ETHER_MTU) > - dev->data->dev_conf.rxmode.offloads |=3D > DEV_RX_OFFLOAD_JUMBO_FRAME; > - else > - dev->data->dev_conf.rxmode.offloads &=3D > ~DEV_RX_OFFLOAD_JUMBO_FRAME; >=20 > if (!dev->data->dev_started && restart) { > qede_dev_start(dev); > diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c = index > 1f55c90b419d..2ee80e2dc41f 100644 > --- a/drivers/net/sfc/sfc_ethdev.c > +++ b/drivers/net/sfc/sfc_ethdev.c > @@ -1064,15 +1064,6 @@ sfc_dev_set_mtu(struct rte_eth_dev *dev, > uint16_t mtu) > } > } >=20 > - /* > - * The driver does not use it, but other PMDs update jumbo frame > - * flag when MTU is set. > - */ > - if (mtu > RTE_ETHER_MTU) { > - struct rte_eth_rxmode *rxmode =3D &dev->data- > >dev_conf.rxmode; > - rxmode->offloads |=3D DEV_RX_OFFLOAD_JUMBO_FRAME; > - } > - > sfc_adapter_unlock(sa); >=20 > sfc_log_init(sa, "done"); > diff --git a/drivers/net/thunderx/nicvf_ethdev.c > b/drivers/net/thunderx/nicvf_ethdev.c > index c8ae95a61306..b501fee5332c 100644 > --- a/drivers/net/thunderx/nicvf_ethdev.c > +++ b/drivers/net/thunderx/nicvf_ethdev.c > @@ -151,7 +151,6 @@ nicvf_dev_set_mtu(struct rte_eth_dev *dev, uint16_t > mtu) > struct nicvf *nic =3D nicvf_pmd_priv(dev); > uint32_t buffsz, frame_size =3D mtu + NIC_HW_L2_OVERHEAD; > size_t i; > - struct rte_eth_rxmode *rxmode =3D &dev->data->dev_conf.rxmode; >=20 > PMD_INIT_FUNC_TRACE(); >=20 > @@ -176,11 +175,6 @@ nicvf_dev_set_mtu(struct rte_eth_dev *dev, > uint16_t mtu) > (frame_size + 2 * VLAN_TAG_SIZE > buffsz * > NIC_HW_MAX_SEGS)) > return -EINVAL; >=20 > - if (mtu > RTE_ETHER_MTU) > - rxmode->offloads |=3D DEV_RX_OFFLOAD_JUMBO_FRAME; > - else > - rxmode->offloads &=3D ~DEV_RX_OFFLOAD_JUMBO_FRAME; > - > if (nicvf_mbox_update_hw_max_frs(nic, mtu)) > return -EINVAL; >=20 > diff --git a/drivers/net/txgbe/txgbe_ethdev.c > b/drivers/net/txgbe/txgbe_ethdev.c > index 269de9f848dd..35b98097c3a4 100644 > --- a/drivers/net/txgbe/txgbe_ethdev.c > +++ b/drivers/net/txgbe/txgbe_ethdev.c > @@ -3486,12 +3486,6 @@ txgbe_dev_mtu_set(struct rte_eth_dev *dev, > uint16_t mtu) > return -EINVAL; > } >=20 > - /* switch to jumbo mode if needed */ > - if (mtu > RTE_ETHER_MTU) > - dev->data->dev_conf.rxmode.offloads |=3D > DEV_RX_OFFLOAD_JUMBO_FRAME; > - else > - dev->data->dev_conf.rxmode.offloads &=3D > ~DEV_RX_OFFLOAD_JUMBO_FRAME; > - > if (hw->mode) > wr32m(hw, TXGBE_FRMSZ, TXGBE_FRMSZ_MAX_MASK, > TXGBE_FRAME_SIZE_MAX); > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index > 4d0584af52e3..1740bab98a83 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -3639,6 +3639,7 @@ rte_eth_dev_set_mtu(uint16_t port_id, uint16_t > mtu) > int ret; > struct rte_eth_dev_info dev_info; > struct rte_eth_dev *dev; > + int is_jumbo_frame_capable =3D 0; >=20 > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev =3D &rte_eth_devices[port_id]; > @@ -3657,12 +3658,27 @@ rte_eth_dev_set_mtu(uint16_t port_id, uint16_t > mtu) >=20 > if (mtu < dev_info.min_mtu || mtu > dev_info.max_mtu) > return -EINVAL; > + > + if ((dev_info.rx_offload_capa & > DEV_RX_OFFLOAD_JUMBO_FRAME) !=3D 0) > + is_jumbo_frame_capable =3D 1; > } >=20 > + if (mtu > RTE_ETHER_MTU && is_jumbo_frame_capable =3D=3D 0) > + return -EINVAL; > + > ret =3D (*dev->dev_ops->mtu_set)(dev, mtu); > - if (!ret) > + if (ret =3D=3D 0) { > dev->data->mtu =3D mtu; >=20 > + /* switch to jumbo mode if needed */ > + if (mtu > RTE_ETHER_MTU) > + dev->data->dev_conf.rxmode.offloads |=3D > + DEV_RX_OFFLOAD_JUMBO_FRAME; > + else > + dev->data->dev_conf.rxmode.offloads &=3D > + ~DEV_RX_OFFLOAD_JUMBO_FRAME; > + } > + > return eth_err(port_id, ret); > } >=20 > -- > 2.31.1