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 41350A04F0; Thu, 19 Dec 2019 09:22:28 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 31C041BDFD; Thu, 19 Dec 2019 09:22:27 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 5D28E1252 for ; Thu, 19 Dec 2019 09:22:25 +0100 (CET) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Dec 2019 00:22:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,330,1571727600"; d="scan'208";a="390447992" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.117.17]) by orsmga005.jf.intel.com with ESMTP; 19 Dec 2019 00:22:22 -0800 Date: Thu, 19 Dec 2019 16:17:32 +0800 From: Ye Xiaolong To: Junyu Jiang Cc: dev@dpdk.org, Wenzhuo Lu , Qiming Yang Message-ID: <20191219081732.GA14498@intel.com> References: <20191202200327.38509-1-junyux.jiang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191202200327.38509-1-junyux.jiang@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) 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" On 12/02, Junyu Jiang wrote: >Enable jumbo frame for VF by configuring DPDK PF. > >Signed-off-by: Junyu Jiang >--- > drivers/net/ixgbe/ixgbe_pf.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > >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 = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); > uint32_t new_mtu = msgbuf[1]; > uint32_t max_frs; >+ uint32_t hlreg0; > int max_frame = new_mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN; > > /* 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 = (IXGBE_READ_REG(hw, IXGBE_MAXFRS) & > IXGBE_MHADD_MFS_MASK) >> IXGBE_MHADD_MFS_SHIFT; > if (max_frs < new_mtu) { >+ hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0); >+ if (new_mtu > RTE_ETHER_MAX_LEN) { >+ dev->data->dev_conf.rxmode.offloads |= >+ DEV_RX_OFFLOAD_JUMBO_FRAME; >+ hlreg0 |= IXGBE_HLREG0_JUMBOEN; >+ } else { >+ dev->data->dev_conf.rxmode.offloads &= >+ ~DEV_RX_OFFLOAD_JUMBO_FRAME; >+ hlreg0 &= ~IXGBE_HLREG0_JUMBOEN; >+ } >+ IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0); >+ > max_frs = new_mtu << IXGBE_MHADD_MFS_SHIFT; > IXGBE_WRITE_REG(hw, IXGBE_MAXFRS, max_frs); > } >-- >2.17.1 > Applied to dpdk-next-net-intel with wei's ack, Thanks.