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 3D5B1A0A02; Fri, 15 Jan 2021 09:15:31 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B07E3140DD4; Fri, 15 Jan 2021 09:15:30 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 03A92140DCD; Fri, 15 Jan 2021 09:15:28 +0100 (CET) IronPort-SDR: cR0gZPZDrOb12QNbzQ7lGZBKEwWX5t9Nzd65DTWoEkR1gBk5H/bb2tPPHUCoe8W/fjK18ADTs1 5TvNQw6nCubA== X-IronPort-AV: E=McAfee;i="6000,8403,9864"; a="263309724" X-IronPort-AV: E=Sophos;i="5.79,348,1602572400"; d="scan'208";a="263309724" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jan 2021 00:15:16 -0800 IronPort-SDR: RuWx5kP6Afava6wbqk2FYsaWKUi61Gb78MEcQ2RIk1N2QYRKHIsewTT9uETpUYBzLGwZt5fSLg +EJSmzodN37A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,348,1602572400"; d="scan'208";a="390047956" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by orsmga007.jf.intel.com with ESMTP; 15 Jan 2021 00:15:16 -0800 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) 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.1713.5; Fri, 15 Jan 2021 00:15:15 -0800 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX606.ccr.corp.intel.com (10.109.6.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 15 Jan 2021 16:15:13 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.1713.004; Fri, 15 Jan 2021 16:15:13 +0800 From: "Guo, Jia" To: "Zhang, AlvinX" , "Wang, Haiyue" , "Xie, WeiX" CC: "dev@dpdk.org" , "Zhang, AlvinX" , "stable@dpdk.org" Thread-Topic: [PATCH v3] net/ixgbe: fix configuration of max frame size Thread-Index: AQHW6wwhIVqmYPRYrk2+ihPHlfxjhqooUDQg Date: Fri, 15 Jan 2021 08:15:13 +0000 Message-ID: <6a633c4729aa49e6a9473d5e78edff60@intel.com> References: <20210115023126.26248-1-alvinx.zhang@intel.com> <20210115070029.2768-1-alvinx.zhang@intel.com> In-Reply-To: <20210115070029.2768-1-alvinx.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3] net/ixgbe: fix configuration of max frame size 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, Alvin > -----Original Message----- > From: Zhang,Alvin > Sent: Friday, January 15, 2021 3:00 PM > To: Guo, Jia ; Wang, Haiyue ; > Xie, WeiX > Cc: dev@dpdk.org; Zhang, AlvinX ; > stable@dpdk.org > Subject: [PATCH v3] net/ixgbe: fix configuration of max frame size >=20 > From: Alvin Zhang >=20 > For 82599 NIC, jumbo frame feature is not supported in IOV mode, but if a= VF > requests to configure the frame size to that not bigger than > RTE_ETHER_MAX_LEN, the PMD should not return -1. > This patch keeps ixgbe PMD's handling mode consistent with kernel driver = in > above situation. >=20 Why it should not return -1 and what is the kernel driver behaviors related= with this patch? > In addition, the value set by the command IXGBE_VF_SET_LPE represents > the max frame size, not the mtu. >=20 > Fixes: 1b9ea09c067b ("ixgbe: support X550") > Fixes: 95a27b3ba5f5 ("net/ixgbe: enable jumbo frame for VF") > Cc: stable@dpdk.org >=20 > Signed-off-by: Alvin Zhang > --- >=20 > V3: Restore variable name from cur_frame_size to max_frs. > --- > drivers/net/ixgbe/ixgbe_pf.c | 17 ++++++++++------- > 1 file changed, 10 insertions(+), 7 deletions(-) >=20 > diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c > index 833863a..1ffde56 100644 > --- a/drivers/net/ixgbe/ixgbe_pf.c > +++ b/drivers/net/ixgbe/ixgbe_pf.c > @@ -555,17 +555,20 @@ int ixgbe_pf_host_configure(struct rte_eth_dev > *eth_dev) ixgbe_set_vf_lpe(struct rte_eth_dev *dev, __rte_unused > uint32_t vf, uint32_t *msgbuf) { > struct ixgbe_hw *hw =3D IXGBE_DEV_PRIVATE_TO_HW(dev->data- > >dev_private); > - uint32_t new_mtu =3D msgbuf[1]; > + uint32_t max_frame =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 */ > if (hw->mac.type !=3D ixgbe_mac_X540 && > hw->mac.type !=3D ixgbe_mac_X550 && > hw->mac.type !=3D ixgbe_mac_X550EM_x && > - hw->mac.type !=3D ixgbe_mac_X550EM_a) > - return -1; > + hw->mac.type !=3D ixgbe_mac_X550EM_a) { > + if (max_frame > dev->data- > >dev_conf.rxmode.max_rx_pkt_len) This condition is only for X540/X550? > + return -1; > + > + return 0; > + } >=20 Assume that return 0 means success to set vf lpe, return -1 means failed to= set vf lpe. If it is not support in VF, why return 0? > if (max_frame < RTE_ETHER_MIN_LEN || > max_frame > > RTE_ETHER_MAX_JUMBO_FRAME_LEN) @@ -573,9 +576,9 @@ int > ixgbe_pf_host_configure(struct rte_eth_dev *eth_dev) >=20 > max_frs =3D (IXGBE_READ_REG(hw, IXGBE_MAXFRS) & > IXGBE_MHADD_MFS_MASK) >> > IXGBE_MHADD_MFS_SHIFT; > - if (max_frs < new_mtu) { > + if (max_frs < max_frame) { > hlreg0 =3D IXGBE_READ_REG(hw, IXGBE_HLREG0); > - if (new_mtu > RTE_ETHER_MAX_LEN) { > + if (max_frame > RTE_ETHER_MAX_LEN) { > dev->data->dev_conf.rxmode.offloads |=3D > DEV_RX_OFFLOAD_JUMBO_FRAME; > hlreg0 |=3D IXGBE_HLREG0_JUMBOEN; > @@ -586,7 +589,7 @@ int ixgbe_pf_host_configure(struct rte_eth_dev > *eth_dev) > } > IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0); >=20 > - max_frs =3D new_mtu << IXGBE_MHADD_MFS_SHIFT; > + max_frs =3D max_frame << IXGBE_MHADD_MFS_SHIFT; > IXGBE_WRITE_REG(hw, IXGBE_MAXFRS, max_frs); > } >=20 > -- > 1.8.3.1