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 C2CAEA04F0; Wed, 18 Dec 2019 07:28:33 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A36EE2C17; Wed, 18 Dec 2019 07:28:33 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 2F1512BE5 for ; Wed, 18 Dec 2019 07:28:31 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Dec 2019 22:28:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,328,1571727600"; d="scan'208";a="212812799" Received: from pgsmsx113.gar.corp.intel.com ([10.108.55.202]) by fmsmga008.fm.intel.com with ESMTP; 17 Dec 2019 22:28:28 -0800 Received: from pgsmsx103.gar.corp.intel.com ([169.254.2.49]) by pgsmsx113.gar.corp.intel.com ([169.254.6.32]) with mapi id 14.03.0439.000; Wed, 18 Dec 2019 14:28:28 +0800 From: "Zhao1, Wei" To: "Jiang, JunyuX" , "dev@dpdk.org" CC: "Lu, Wenzhuo" , "Yang, Qiming" , "Jiang, JunyuX" Thread-Topic: [dpdk-dev] [PATCH] net/ixgbe: enable jumbo frame for VF Thread-Index: AQHVqYE8J2NrD9jnzEe3aV1nrhjaXae/hDog Date: Wed, 18 Dec 2019 06:28:27 +0000 Message-ID: References: <20191202200327.38509-1-junyux.jiang@intel.com> In-Reply-To: <20191202200327.38509-1-junyux.jiang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiM2RjN2NmYTQtOGQ4Yi00ZjFhLTk3NjUtMjgxMzliN2ExMGEzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiT05yaHZuWjhnVHgxbjBWV1pBVWtad2pLcGNJR0l1WHZHdXYxZmNDZXhEVFJNT2UyVGtcL21FeGYrVitrXC96cWlzIn0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [172.30.20.205] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: enable jumbo frame for VF 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" Acked-by: Wei Zhao > -----Original Message----- > From: dev On Behalf Of Junyu Jiang > Sent: Tuesday, December 3, 2019 4:03 AM > To: dev@dpdk.org > Cc: Lu, Wenzhuo ; Yang, Qiming > ; Jiang, JunyuX > Subject: [dpdk-dev] [PATCH] net/ixgbe: enable jumbo frame for VF >=20 > Enable jumbo frame for VF by configuring DPDK PF. >=20 > Signed-off-by: Junyu Jiang > --- > drivers/net/ixgbe/ixgbe_pf.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) >=20 > diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c = index > d0d85e138..66b856e11 100644 > --- a/drivers/net/ixgbe/ixgbe_pf.c > +++ b/drivers/net/ixgbe/ixgbe_pf.c > @@ -544,6 +544,7 @@ ixgbe_set_vf_lpe(struct rte_eth_dev *dev, > __rte_unused uint32_t vf, uint32_t *ms > struct ixgbe_hw *hw =3D > IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); > uint32_t new_mtu =3D msgbuf[1]; > uint32_t max_frs; > + uint32_t hlreg0; > int max_frame =3D new_mtu + RTE_ETHER_HDR_LEN + > RTE_ETHER_CRC_LEN; >=20 > /* X540 and X550 support jumbo frames in IOV mode */ @@ -560,6 > +561,18 @@ ixgbe_set_vf_lpe(struct rte_eth_dev *dev, __rte_unused > uint32_t vf, uint32_t *ms > max_frs =3D (IXGBE_READ_REG(hw, IXGBE_MAXFRS) & > IXGBE_MHADD_MFS_MASK) >> IXGBE_MHADD_MFS_SHIFT; > if (max_frs < new_mtu) { > + hlreg0 =3D IXGBE_READ_REG(hw, IXGBE_HLREG0); > + if (new_mtu > RTE_ETHER_MAX_LEN) { > + dev->data->dev_conf.rxmode.offloads |=3D > + DEV_RX_OFFLOAD_JUMBO_FRAME; > + hlreg0 |=3D IXGBE_HLREG0_JUMBOEN; > + } else { > + dev->data->dev_conf.rxmode.offloads &=3D > + ~DEV_RX_OFFLOAD_JUMBO_FRAME; > + hlreg0 &=3D ~IXGBE_HLREG0_JUMBOEN; > + } > + IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0); > + > max_frs =3D new_mtu << IXGBE_MHADD_MFS_SHIFT; > IXGBE_WRITE_REG(hw, IXGBE_MAXFRS, max_frs); > } > -- > 2.17.1