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 E1FE5A0C47; Sun, 18 Jul 2021 09:49:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9CE9740683; Sun, 18 Jul 2021 09:49:29 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 5460D4067B for ; Sun, 18 Jul 2021 09:49:27 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10048"; a="232695163" X-IronPort-AV: E=Sophos;i="5.84,249,1620716400"; d="scan'208";a="232695163" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jul 2021 00:49:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,249,1620716400"; d="scan'208";a="467599082" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga008.fm.intel.com with ESMTP; 18 Jul 2021 00:49:26 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Sun, 18 Jul 2021 00:49:25 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Sun, 18 Jul 2021 00:49:25 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.177) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Sun, 18 Jul 2021 00:49:25 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JjVUCgpijxNrMYqdVinHfY2rsCVnwdGQYAAjUUaSt6X0YmgYAEBAggwqHm4AGdvoJc8CA6/jJCAzIfvPqqnzmEvqKD5mN8huO/xMsDWZyRfYcqO3dJqp30M6shA+QZCmEMVvPtCqi878SaopKp7jBJbCQE4nI47MPcgaflPJV1RMQhfyeP1yMn2ldjno4cjLm9r6S9DOZzstS7/bVSDX7RARkSYnWwbulLA1QDBKzg9IdYan5xoaZHHFVZVXXrLoIl2Na5i5oSVkg1pYGUdLRKjjRXSTb0mAQrDuAjbZCFUfslbOlKWMGoN6X7cq+vi/qZklbRLTt/AhXoSsrjDNEQ== 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=AvXBHndx7vO7GSFarh6WQHPhEnzKSD4uoVzXDao9rhk=; b=AvByh9eVL9nMEak4jBh5H7Fm/ED3tDee7k0jB9DQMhJd37grG6jEt44b5NmaggdVRcLbM6IwVfPrPus9Pw/XPjofXAknXvVYOmYrH6vRt9U4uAznDEVZZcPPHIJayRzZhjZLzhB0W5jL/D3d3CuOY6dX0/6rNa/wPElIQ3xuRYdKMTfKcx3ufabezn4iRMfxWZlx9mt8qYn8pAkLLXZh23PFGqRdTXBjBEGVYfiZ6kEsGdNwxrrk1y30nVw2mUXBH6tgOsLTZjO6Z9jYEVrpykM6nIRvxVSPNT0UGbs89QEtoWpd9DrxfrMxZJVsRxjWwQudRZ1kq+pgYbGWzi2P5w== 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=AvXBHndx7vO7GSFarh6WQHPhEnzKSD4uoVzXDao9rhk=; b=lV/uvQrOIWmprRIA+dJpsCvnv4BB2FZP0lrHltgD6vN46cCQI4zO8qJe1drv2nhaWeSS9AghAb1cTK1OHOsPKvkDAKOlvj20c4qGsWt3FL0gO74lMWhEhgZlvCo9DSCye82uGQ33p7JWXaAMhD8vXYkvZfYv2JF+80+6bjvsdF4= Received: from BYAPR11MB2901.namprd11.prod.outlook.com (2603:10b6:a03:91::23) by BYAPR11MB2677.namprd11.prod.outlook.com (2603:10b6:a02:cd::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.31; Sun, 18 Jul 2021 07:49:21 +0000 Received: from BYAPR11MB2901.namprd11.prod.outlook.com ([fe80::ed38:9f6c:5670:83fe]) by BYAPR11MB2901.namprd11.prod.outlook.com ([fe80::ed38:9f6c:5670:83fe%7]) with mapi id 15.20.4331.031; Sun, 18 Jul 2021 07:49:21 +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 , Igor Russkikh , "Andrew Rybchenko" , Maciej Czekaj , Jiawen Wu , Jian Wang , Thomas Monjalon CC: "dev@dpdk.org" Thread-Topic: [PATCH 2/4] ethdev: move jumbo frame offload check to library Thread-Index: AQHXdOghcUHzQG1fdEqnD34mKYE2p6tIZ+7w Date: Sun, 18 Jul 2021 07:49:21 +0000 Message-ID: References: <20210709172923.3369846-1-ferruh.yigit@intel.com> <20210709172923.3369846-2-ferruh.yigit@intel.com> In-Reply-To: <20210709172923.3369846-2-ferruh.yigit@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.5.1.3 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTQxOWIxYzAtOWFhZS00ZTJlLWFiN2EtNGFlNjU2ZmVlMjU5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUzloQlcyXC91XC9INDVwS2tzNFhKeWE1d2crVFczRGZkWFRRTEY5Tkdub1k2U01qaHlpM1BSRE9VY2l4NHpHK1JYIn0= 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: 24cc2187-971e-403e-1984-08d949c08de0 x-ms-traffictypediagnostic: BYAPR11MB2677: 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: N87pnN51BHJr7L80MsVfW9T446rF8qNLWQhQUZ/63VVNZ7pK0auJMDOXJfOeoTThxjhUhjHp3YBIygmA5tsO+ybgFSUZCSth3j7wNbACca0eDyEkGT0vF7z9nWVyo2oWC/cNlkeQQqvYkdmVTFXS7R+B9sQb4W3mdqoSuBZDSOrwNQmJ/zeuDGCP1DCISWney3k3ilszGH+ZGqggVOVqimpVo57uFR9KTcMxR4sQfEhAQ9cup3hwfa2Rm6ENGG8N8PaFKZEzs+Y5OwTeUw1XsZ16STBJO+ydpgGOmvBc7W+punSb2MFWXLjWZGt24iMySPtN1nworryt+cwhvkl7G05xYoVdhpZD7M/j076hnF9aQHpX0xSFSlZhZluoglgI3HDX4Ris6ljn6FZTuoHn1HbxWbpo9aLXJfd8bOtUtoqom/qQN30kXEn5R8FIVXP53wfqNcHuCfICo/ZVKqgV7ginfks6yB4gKNOHBohoOomkGlaCKvs8RICim/TslAhHS/s9ZauLu8Zbn/uP9MxHxmRFS33kCFHDtzoXk2PXVE9/ec/qM26JuRiBndZkBq8rXNrrnZTpFI/FD20XAzA5j+P4UlWoSiAiCDfTP42cF/Q2y9n5VJ3PXdrB5WtTYeslPeYLLF4+Je5NC0N5D2qKXoqn4jJlUdXRGRsjahcI2uTKxATZVUtRVJPnMDnTK2qKG62f1+HelupxcF67PmpGzlOI1dxlVyD7XfjitfzLc3s= 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)(921005)(7696005)(83380400001)(53546011)(6506007)(186003)(26005)(76116006)(66476007)(64756008)(33656002)(66946007)(66556008)(66446008)(4326008)(7416002)(86362001)(5660300002)(7406005)(38100700002)(122000001)(30864003)(52536014)(2906002)(71200400001)(316002)(8676002)(9686003)(508600001)(8936002)(110136005)(55016002)(38070700004); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?wq6WxzHzYuJhck2aG0oUw22Fdn9RLaZtaySZAESgaaNb6x8SbckgJp914/kh?= =?us-ascii?Q?02x0894IaSb8kPGBoZmp+f6JxkXjSZB6CixmBWxI51S2lHd2y5Uu/G6sUT0U?= =?us-ascii?Q?vnmlVGmwm8xuILyw1PJKfmjUzI/wugO28uOuE/OT58nVPy9C9/mhNTHRgazZ?= =?us-ascii?Q?Kv4jQCEIhflbRKtVlDM1dR6sheyVw0cc9MaQ/0KdCcherth1rliSE5FPyHFc?= =?us-ascii?Q?1ckXDat1v1zOpz900VGNjbXkHvrTJhWrRNiafIypQCFQ+gLjhvHpBeyVpa9D?= =?us-ascii?Q?7UuqqlUT0WuGrd5ykdxNb+sIYJqA8ZviFLgy91dwIEfnND+IYcXhMVEtTLXo?= =?us-ascii?Q?yzPyz8rTYIwoX13z+gikIIIBfQlAH3lFyYMd+0MnUtheaB6jZfO7nChVRbhu?= =?us-ascii?Q?qoFbCoUnZX7claqnsa0EONWBTXacFxhWLQo/Uu6N0vOE+vvUn0NW/JyP1dch?= =?us-ascii?Q?XseiY0Jj0wAG9BY8+t9DVz6/WLGUpY1+hEs51FXoNCoJ6EnWlLdY739WzPYm?= =?us-ascii?Q?aJulyfqHbHrqj4q0vPzC1f+4MzwhEyOo4smKsloU3CAt+smJFI/WIaAXpG9s?= =?us-ascii?Q?RruQptVA2CXVAixxcoIlluad9bulhVa9epkUyBpskJ97cFuk0SAaq984UMRF?= =?us-ascii?Q?JC1m8z0Bew/9h+SuO7rjiBPj+0cRJVIr+Aoyhkb4ojGsA0HZrzVbi7p/yl59?= =?us-ascii?Q?ZgZbF1Vo5XcNAd1kVCXC2un94aeHaKVwEaEfvs2YAufh8uMEB9ErIZSF2M8D?= =?us-ascii?Q?5GXFqY4GN0HmpMPZn8aKJqPNAlrOav2UCG3VoYckHw529f4sQeLZT5qIatyu?= =?us-ascii?Q?beSUR/DlEK25Jo1lfuE0Syq+yeKxRqWnc6C08OG/rI3R2JG88CTIO9Qf9w/9?= =?us-ascii?Q?V+dsFZNnLGWGCkqD5MUoIPXrFYgbwaIHzm3hW7AINK5MOX/cmQqyMlK+MRsd?= =?us-ascii?Q?JwUWfCtn1I14YIgHVMEcuRDLXuswvMoI7e0dcC4BKeJe8AliBg5bi6y5udrH?= =?us-ascii?Q?n4EsEu730+0ZfHNPdscor4zlO0PhSfgmEwYhMfylleuwDN5xO7RODmB/uPNn?= =?us-ascii?Q?SjCD2NS8dh0dh3lEFl0nrga24KtY21oYY8lonMeiWyfoRlpEC35X+onToVzi?= =?us-ascii?Q?blrd/NmlWjh82WZFJQ5kdTaJiEYfUD/Zv1mvnSHrzBbFzeapUSeVyBYv1UR6?= =?us-ascii?Q?j8G1k+EcI9YcIdsvQ/SItlUqEk8jhamL+m4aRpgzezm0nd1zV5UTZnRJWjsh?= =?us-ascii?Q?TZn6ZJFvd4PpIQUOLf718ye0arxFZEhdfIglD2B5AIAR/oG2yu9kKgO2B16D?= =?us-ascii?Q?GczUQ6JE+/XK/6+w22sRYybC?= 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: 24cc2187-971e-403e-1984-08d949c08de0 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Jul 2021 07:49:21.0699 (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: qDvKjmfaeIQ59vRyKmDDlrL+DDhKGn50W5k5bvDUGKbhT5e+k73fb8BeSwpksll/z94qDpj/hc9NSZdlpQblvQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2677 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH 2/4] 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" Hi, > -----Original Message----- > From: Yigit, Ferruh > Sent: Saturday, July 10, 2021 1:29 > 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 ; Igor Russkikh > ; Andrew Rybchenko > ; Maciej Czekaj ; > Jiawen Wu ; Jian Wang > ; Thomas Monjalon > Cc: Yigit, Ferruh ; dev@dpdk.org > Subject: [PATCH 2/4] 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 > --- > 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/i40e/i40e_ethdev_vf.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_net.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 +++++++++++++++++- > 28 files changed, 29 insertions(+), 171 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_ethdev.c index 335505a106d5..4344a012f06e > 100644 > --- a/drivers/net/bnxt/bnxt_ethdev.c > +++ b/drivers/net/bnxt/bnxt_ethdev.c > @@ -3018,15 +3018,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 56703e3a39e8..a444f749bb96 > 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 6213bcbf3a43..be2858b3adac 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_ethdev.c index 35b517891d67..f15774eae20d > 100644 > --- a/drivers/net/e1000/igb_ethdev.c > +++ b/drivers/net/e1000/igb_ethdev.c > @@ -4401,15 +4401,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 c737ef8d06d8..c1cde811a252 100644 > --- a/drivers/net/hinic/hinic_pmd_ethdev.c > +++ b/drivers/net/hinic/hinic_pmd_ethdev.c > @@ -1556,13 +1556,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 8bccdeddb2f7..868d381a4772 > 100644 > --- a/drivers/net/hns3/hns3_ethdev.c > +++ b/drivers/net/hns3/hns3_ethdev.c > @@ -2597,7 +2597,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) { > @@ -2607,7 +2606,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 > /* > @@ -2622,12 +2620,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 ca839fa55fa0..ff28cad53a03 100644 > --- a/drivers/net/hns3/hns3_ethdev_vf.c > +++ b/drivers/net/hns3/hns3_ethdev_vf.c > @@ -920,12 +920,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 1161f301b9ae..c5058f26dff2 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -11772,11 +11772,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/i40e/i40e_ethdev_vf.c > b/drivers/net/i40e/i40e_ethdev_vf.c > index 086a167ca672..2015a86ba5ca 100644 > --- a/drivers/net/i40e/i40e_ethdev_vf.c > +++ b/drivers/net/i40e/i40e_ethdev_vf.c > @@ -2884,11 +2884,6 @@ i40evf_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 13c2329d85a7..ba5be45e8c5e 100644 > --- a/drivers/net/iavf/iavf_ethdev.c > +++ b/drivers/net/iavf/iavf_ethdev.c > @@ -1446,13 +1446,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 bdda6fee3f8e..502e410b5641 100644 > --- a/drivers/net/ice/ice_ethdev.c > +++ b/drivers/net/ice/ice_ethdev.c > @@ -3806,11 +3806,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); Reviewed-by: Rosen Xu