From patchwork Fri Apr 14 05:47:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenjun Wu X-Patchwork-Id: 126071 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F1BFD4293B; Fri, 14 Apr 2023 07:48:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 106BC42D46; Fri, 14 Apr 2023 07:48:13 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id F2B6F42D63; Fri, 14 Apr 2023 07:48:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681451290; x=1712987290; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UaxuG/FWmt1NJZZLb3P1e+166VwJSRISFD01OkjbpFg=; b=Xp1iOEG0QbjEul3FNzyu4odhYWmc56yU5nDqHPCIB5A9VnzlaW31wvEK aILG1ioo208/LFCzonOqdfOMSjF3XWQIwM9NUFsfsOMgAMj7dd5jU//ol amwh6NInRA/cKFZvCXwLAcodEo4s7Uenv0M8GptQotXqiMMJJU+yXAcV3 Ur5a+N3G09qC5mZcPl9ZHXfdIRgsZjEZ9RxqRAmVeLCmwkmKDh70Dmfz0 rrx5DJMSHek0t6glia+TJ4o6i8Mk3Gsab67OoyYp1IHZTd9mSSTZHmaQ9 2OWBwcHgmAlEVUzA/ttCAvXY/ebCvDN+/w5In1DVBYoU7UdLF90Mm72JR Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10679"; a="343150159" X-IronPort-AV: E=Sophos;i="5.99,195,1677571200"; d="scan'208";a="343150159" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2023 22:48:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10679"; a="779060383" X-IronPort-AV: E=Sophos;i="5.99,195,1677571200"; d="scan'208";a="779060383" Received: from dpdk-wuwenjun-icelake-ii.sh.intel.com ([10.67.110.157]) by FMSMGA003.fm.intel.com with ESMTP; 13 Apr 2023 22:48:08 -0700 From: Wenjun Wu To: dev@dpdk.org, Yuying.Zhang@intel.com, beilei.xing@intel.com, jingjing.wu@intel.com, qiming.yang@intel.com, qi.z.zhang@intel.com Cc: Wenjun Wu , stable@dpdk.org Subject: [PATCH v2 5/5] net/cpfl: fix Rx data buffer size Date: Fri, 14 Apr 2023 13:47:44 +0800 Message-Id: <20230414054744.1399735-6-wenjun1.wu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230414054744.1399735-1-wenjun1.wu@intel.com> References: <20230414035151.1377726-1-wenjun1.wu@intel.com> <20230414054744.1399735-1-wenjun1.wu@intel.com> MIME-Version: 1.0 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 This patch does two fixes. 1. No matter what the mbuf size is, the data buffer size should not be greater than 16K - 128. 2. Align data buffer size to 128. Fixes: 119834846e93 ("net/cpfl: support Rx queue setup") Cc: stable@dpdk.org Signed-off-by: Wenjun Wu --- drivers/net/cpfl/cpfl_rxtx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/cpfl/cpfl_rxtx.c b/drivers/net/cpfl/cpfl_rxtx.c index de59b31b3d..75021c3c54 100644 --- a/drivers/net/cpfl/cpfl_rxtx.c +++ b/drivers/net/cpfl/cpfl_rxtx.c @@ -155,7 +155,8 @@ cpfl_rx_split_bufq_setup(struct rte_eth_dev *dev, struct idpf_rx_queue *rxq, bufq->adapter = base; len = rte_pktmbuf_data_room_size(bufq->mp) - RTE_PKTMBUF_HEADROOM; - bufq->rx_buf_len = len; + bufq->rx_buf_len = RTE_ALIGN_FLOOR(len, (1 << IDPF_RLAN_CTX_DBUF_S)); + bufq->rx_buf_len = RTE_MIN(bufq->rx_buf_len, IDPF_RX_MAX_DATA_BUF_SIZE); /* Allocate a little more to support bulk allocate. */ len = nb_desc + IDPF_RX_MAX_BURST;