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 65A05A0547; Thu, 21 Oct 2021 11:51:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7ABA941210; Thu, 21 Oct 2021 11:50:53 +0200 (CEST) Received: from smtpbg501.qq.com (smtpbg501.qq.com [203.205.250.101]) by mails.dpdk.org (Postfix) with ESMTP id F09F3411E0 for ; Thu, 21 Oct 2021 11:50:45 +0200 (CEST) X-QQ-mid: bizesmtp38t1634809841tbaqgh0q Received: from jiawenwu.trustnetic.com (unknown [183.129.236.74]) by esmtp6.qq.com (ESMTP) with id ; Thu, 21 Oct 2021 17:50:40 +0800 (CST) X-QQ-SSF: 01400000000000E0I000000A0000000 X-QQ-FEAT: TskX/GkkryDDBSUdWVyr9pgn9s2J0D9ip4gmBEpgYYzNZ4iZNxnIN8wtBxJm0 aPEcHOPP1OhVSWFb1MMY8g+h4lyARNT2QTW26X/ygtJJ16FyH8EUMfMJy3ai6NISMxROxzx DoZCg+QciNdbGXLStRtwEeC+1DEXXsN80Y2cctuZpiPi83bAu2ypSNPYRQP5SwN7Ra2MJrd kUF6Qdc2Cjv75DXxSRAFMpgOGybSzHxPSXbP8OAd+IFn05mwCqDksFToTxh10tuXNaN87OR 9Zmaj247hMcTeOOIskAH0Qso3Y978oQONaftjoJkWTEE4woD4H/FdWh3Iwak0HvIjYi8jDV DZ+2igfIyawkE8+iY3Rv6Sv1f/zXS9vOcl6zIwh X-QQ-GoodBg: 2 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu Date: Thu, 21 Oct 2021 17:50:04 +0800 Message-Id: <20211021095023.18288-8-jiawenwu@trustnetic.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20211021095023.18288-1-jiawenwu@trustnetic.com> References: <20211021095023.18288-1-jiawenwu@trustnetic.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:trustnetic.com:qybgforeign:qybgforeign6 X-QQ-Bgrelay: 1 Subject: [dpdk-dev] [PATCH v2 07/26] net/ngbe: support jumbo frame 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" Add to support Rx jumbo frames. Signed-off-by: Jiawen Wu --- doc/guides/nics/features/ngbe.ini | 1 + doc/guides/nics/ngbe.rst | 1 + drivers/net/ngbe/ngbe_ethdev.h | 3 +++ drivers/net/ngbe/ngbe_rxtx.c | 5 ++++- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/guides/nics/features/ngbe.ini b/doc/guides/nics/features/ngbe.ini index 053dff3a2f..9785820ea0 100644 --- a/doc/guides/nics/features/ngbe.ini +++ b/doc/guides/nics/features/ngbe.ini @@ -9,6 +9,7 @@ Link status = Y Link status event = Y Queue start/stop = Y Burst mode info = Y +Jumbo frame = Y Scattered Rx = Y TSO = Y CRC offload = Y diff --git a/doc/guides/nics/ngbe.rst b/doc/guides/nics/ngbe.rst index 6a6ae39243..702a455041 100644 --- a/doc/guides/nics/ngbe.rst +++ b/doc/guides/nics/ngbe.rst @@ -14,6 +14,7 @@ Features - Packet type information - Checksum offload - TSO offload +- Jumbo frames - Link state information - Scattered and gather for TX and RX diff --git a/drivers/net/ngbe/ngbe_ethdev.h b/drivers/net/ngbe/ngbe_ethdev.h index 286cb893d6..b270343a3e 100644 --- a/drivers/net/ngbe/ngbe_ethdev.h +++ b/drivers/net/ngbe/ngbe_ethdev.h @@ -17,6 +17,9 @@ #define NGBE_QUEUE_ITR_INTERVAL_DEFAULT 500 /* 500us */ +/* The overhead from MTU to max frame size. */ +#define NGBE_ETH_OVERHEAD (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN) + #define NGBE_MISC_VEC_ID RTE_INTR_VEC_ZERO_OFFSET #define NGBE_RX_VEC_START RTE_INTR_VEC_RXTX_OFFSET diff --git a/drivers/net/ngbe/ngbe_rxtx.c b/drivers/net/ngbe/ngbe_rxtx.c index df265bd447..b49303094e 100644 --- a/drivers/net/ngbe/ngbe_rxtx.c +++ b/drivers/net/ngbe/ngbe_rxtx.c @@ -2364,8 +2364,11 @@ ngbe_dev_rx_init(struct rte_eth_dev *dev) hlreg0 &= ~NGBE_SECRXCTL_XDSA; wr32(hw, NGBE_SECRXCTL, hlreg0); + /* + * Configure jumbo frame support, if any. + */ wr32m(hw, NGBE_FRMSZ, NGBE_FRMSZ_MAX_MASK, - NGBE_FRMSZ_MAX(NGBE_FRAME_SIZE_DFT)); + NGBE_FRMSZ_MAX(dev->data->mtu + NGBE_ETH_OVERHEAD)); /* Setup Rx queues */ for (i = 0; i < dev->data->nb_rx_queues; i++) { -- 2.21.0.windows.1