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 934A2A0C4D; Mon, 6 Sep 2021 03:49:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7EE44410EA; Mon, 6 Sep 2021 03:49:35 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 7EDE940E5A for ; Mon, 6 Sep 2021 03:49:33 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10098"; a="217992520" X-IronPort-AV: E=Sophos;i="5.85,271,1624345200"; d="scan'208";a="217992520" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Sep 2021 18:49:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,271,1624345200"; d="scan'208";a="430402776" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga003.jf.intel.com with ESMTP; 05 Sep 2021 18:49:29 -0700 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Sun, 5 Sep 2021 18:49:28 -0700 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX601.ccr.corp.intel.com (10.109.6.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 6 Sep 2021 09:49:26 +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.2242.012; Mon, 6 Sep 2021 09:49:26 +0800 From: "Zhang, Qi Z" To: Qiming Chen , "dev@dpdk.org" CC: "Xing, Beilei" Thread-Topic: [dpdk-dev] [PATCH] net/i40e: solve vf rxq buf size alignment Thread-Index: AQHXl9UMgdrCzakvEkaPDC38YDmUYauWUx5g Date: Mon, 6 Sep 2021 01:49:26 +0000 Message-ID: <0197c28a92604b3ea3e23d604ea782dd@intel.com> References: <20210823041105.8006-1-chenqiming_huawei@163.com> In-Reply-To: <20210823041105.8006-1-chenqiming_huawei@163.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows 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] net/i40e: solve vf rxq buf size alignment 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" > -----Original Message----- > From: dev On Behalf Of Qiming Chen > Sent: Monday, August 23, 2021 12:11 PM > To: dev@dpdk.org > Cc: Xing, Beilei ; Qiming Chen > > Subject: [dpdk-dev] [PATCH] net/i40e: solve vf rxq buf size alignment >=20 > The RTE_ALIGN macro is aligned upwards. If the buf_size variable is not a= ligned > with 1 << I40E_RXQ_CTX_DBUFF_SHIFT, the rx_buf_len is larger than the > actual mbuf memory after the operation. When receiving the packet, if the > packet is larger than the configured buf_size, it will cause a memory ste= pping > event. >=20 > The patch uses the RTE_ALIGN_FLOOR down alignment macro to correct the > problem. >=20 > Signed-off-by: Qiming Chen > --- > drivers/net/i40e/i40e_ethdev_vf.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev_vf.c > b/drivers/net/i40e/i40e_ethdev_vf.c > index 924da8dfb4..5b1c8e76ab 100644 > --- a/drivers/net/i40e/i40e_ethdev_vf.c > +++ b/drivers/net/i40e/i40e_ethdev_vf.c > @@ -1927,7 +1927,7 @@ i40evf_rxq_init(struct rte_eth_dev *dev, struct > i40e_rx_queue *rxq) > RTE_PKTMBUF_HEADROOM); > rxq->hs_mode =3D i40e_header_split_none; > rxq->rx_hdr_len =3D 0; > - rxq->rx_buf_len =3D RTE_ALIGN(buf_size, (1 << > I40E_RXQ_CTX_DBUFF_SHIFT)); > + rxq->rx_buf_len =3D RTE_ALIGN_FLOOR(buf_size, (1 << > +I40E_RXQ_CTX_DBUFF_SHIFT)); > len =3D rxq->rx_buf_len * I40E_MAX_CHAINED_RX_BUFFERS; > rxq->max_pkt_len =3D RTE_MIN(len, > dev_data->dev_conf.rxmode.max_rx_pkt_len); > -- > 2.30.1.windows.1 The patch is not applied for main repo as i40evf will be removed, you can s= ubmit a fix to dpdk-stable directly.