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 B65BBA034F; Mon, 19 Jul 2021 16:38:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 65A524014E; Mon, 19 Jul 2021 16:38:58 +0200 (CEST) Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by mails.dpdk.org (Postfix) with ESMTP id 7F1254003E for ; Mon, 19 Jul 2021 16:38:57 +0200 (CEST) Received: by mail-ed1-f54.google.com with SMTP id l1so24221876edr.11 for ; Mon, 19 Jul 2021 07:38:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7Ny07ECE8CVDGvAc61VAnL2bQ7RpLI3Ku20FFLIWEsY=; b=TK4ok2j3OF9Y+rMyBZXLnnhUn/Zqg2wGDG0xECXi04yKsnKXU8/8N8iSfcBnF68LE3 Hvr0vlwRoivQE9i5u0Z2Prtt8OZ5P0weFg6fYLmVBTrbnldqxltEUNsLLVP8SqVhzxWN jtwpVB90T30WCMTFTPsO4h0Xq5GZ/+9CfECV4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7Ny07ECE8CVDGvAc61VAnL2bQ7RpLI3Ku20FFLIWEsY=; b=e0FlIDjbuGTItMsflosaGFbg5uypfeXPaLswjfnNnriFf4Ui3Zsljhet3AjOdWcq7f CxQk7e69Vt8ox5XZL4AsQPKrJzIFpIMpRpNrfuwSGs00uCGV158P3iKbpWgAMOqn44zB 5/PI/kjQlyNKY1ZPr17jjLaFLV+DLFaot5CFSWS2oNdmvq6CErQWh7Me3L4qOsKlnCXe vIHS8qrqewEJrf/7Zqch7yAwFgQn8/WNTIZxDQdP5klpTAmC45MGok7ZdeeGAljrc5mv pNGJaELyMgrRKsxVGacldozFr/4N3wrQOOoSFuL7bDYS86l6dNFYdQo9X6geQmkTG0jl Rz+w== X-Gm-Message-State: AOAM533z22lqSnHt8ACtfSm54Z+1QBGTOljpmzu0BtnHRcWOR2T1D0uq Kqp5Ag0eq5PTE35wpKizK+6Wf7vdNFMA5fYblFe7lg== X-Google-Smtp-Source: ABdhPJxPZNhC4aru0d0KlKEly8vAMxCV4V41mUSxgY/Hw5f73jkelFiy7AyYA86u/adY7wqAiRoFZTkbIk8K7n0kvUU= X-Received: by 2002:aa7:d353:: with SMTP id m19mr35917138edr.162.1626705536856; Mon, 19 Jul 2021 07:38:56 -0700 (PDT) MIME-Version: 1.0 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> From: Ajit Khaparde Date: Mon, 19 Jul 2021 07:38:40 -0700 Message-ID: To: Ferruh Yigit Cc: Somalapuram Amaranath , Somnath Kotur , Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , Rahul Lakkireddy , Hemant Agrawal , Sachin Saxena , Haiyue Wang , Gagandeep Singh , Ziyang Xuan , Xiaoyun Wang , Guoyang Zhou , "Min Hu (Connor)" , Yisen Zhuang , Lijun Ou , Beilei Xing , Jingjing Wu , Qiming Yang , Qi Zhang , Rosen Xu , 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 , dpdk-dev Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="000000000000b5414905c77ae56b" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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" --000000000000b5414905c77ae56b Content-Type: text/plain; charset="UTF-8" On Fri, Jul 9, 2021 at 10:30 AM Ferruh Yigit wrote: > Setting MTU bigger than RTE_ETHER_MTU requires the jumbo frame support, > and application should enable the jumbo frame offload support for it. > > 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. > > Enabling jumbo frame offload implicitly is selected by many drivers > since setting a big MTU value already implies it, and this increases > usability. > > This patch moves this logic from drivers to the library, both to reduce > the duplicated code in the drivers and to make behaviour more visible. > > 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(-) > > 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 |= > - DEV_RX_OFFLOAD_JUMBO_FRAME; > + if (mtu > RTE_ETHER_MTU) > val = 1; > - } else { > - dev->data->dev_conf.rxmode.offloads &= > - ~DEV_RX_OFFLOAD_JUMBO_FRAME; > + else > val = 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; > } > > - if (new_mtu > RTE_ETHER_MTU) { > + if (new_mtu > RTE_ETHER_MTU) > bp->flags |= BNXT_FLAG_JUMBO; > - bp->eth_dev->data->dev_conf.rxmode.offloads |= > - DEV_RX_OFFLOAD_JUMBO_FRAME; > - } else { > - bp->eth_dev->data->dev_conf.rxmode.offloads &= > - ~DEV_RX_OFFLOAD_JUMBO_FRAME; > + else > bp->flags &= ~BNXT_FLAG_JUMBO; > - } > Acked-by: Ajit Khaparde > > --000000000000b5414905c77ae56b--