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 DFC3EA0C50; Wed, 7 Jul 2021 15:56:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 79A24413B6; Wed, 7 Jul 2021 15:56:47 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 663CE413A8 for ; Wed, 7 Jul 2021 15:56:46 +0200 (CEST) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 0C8C77F53D; Wed, 7 Jul 2021 16:56:46 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 0C8C77F53D DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1625666206; bh=9eY6elRIAHG+iVunwI95Eh+fk74OIf2Wfg571p24bzA=; h=Subject:To:References:From:Date:In-Reply-To; b=PZMv2gYvdciFkhdG5eJ9yuX+ZOsl4FBPC2XE4RpqHhWwOGOOgGBCNY8zrCFZS0edn COfWFFMbDGokNfD52NVH9qUVLuoGB9pFu46YaPUNJ3puVH2Nf+jLxZCjDt+YMwmbBm gu1733/q4kXuJbjwvTQZTNoQsnwJSrPaaXYOI8rM= To: Jiawen Wu , dev@dpdk.org References: <20210706095545.10776-1-jiawenwu@trustnetic.com> <20210706095545.10776-13-jiawenwu@trustnetic.com> From: Andrew Rybchenko Organization: OKTET Labs Message-ID: <4cf1350e-7f3e-f39d-a7d5-17439c1ef7be@oktetlabs.ru> Date: Wed, 7 Jul 2021 16:56:45 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210706095545.10776-13-jiawenwu@trustnetic.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v7 12/19] net/ngbe: add Rx queue setup and release 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" On 7/6/21 12:55 PM, Jiawen Wu wrote: > Setup device Rx queue and release Rx queue. > > Signed-off-by: Jiawen Wu I thikn format string should be on the next its own line to address below warnings: ### net/ngbe: add Rx queue setup and release WARNING:LONG_LINE: line length of 86 exceeds 80 columns #433: FILE: drivers/net/ngbe/ngbe_rxtx.c:280: + PMD_INIT_LOG(DEBUG, "sw_ring=%p sw_sc_ring=%p hw_ring=%p dma_addr=0x%" PRIx64, CHECK:CAMELCASE: Avoid CamelCase: #433: FILE: drivers/net/ngbe/ngbe_rxtx.c:280: + PMD_INIT_LOG(DEBUG, "sw_ring=%p sw_sc_ring=%p hw_ring=%p dma_addr=0x%" PRIx64, total: 0 errors, 1 warnings, 1 checks, 502 lines checked [snip] > +/** > + * Structure associated with each Rx queue. > + */ > +struct ngbe_rx_queue { > + struct rte_mempool *mb_pool; /**< mbuf pool to populate Rx ring. */ > + volatile struct ngbe_rx_desc *rx_ring; /**< Rx ring virtual address. */ > + uint64_t rx_ring_phys_addr; /**< Rx ring DMA address. */ > + volatile uint32_t *rdt_reg_addr; /**< RDT register address. */ > + volatile uint32_t *rdh_reg_addr; /**< RDH register address. */ > + struct ngbe_rx_entry *sw_ring; /**< address of Rx software ring. */ > + /**< address of scattered Rx software ring. */ Should start from /** > + struct ngbe_scattered_rx_entry *sw_sc_ring; > + struct rte_mbuf *pkt_first_seg; /**< First segment of current packet. */ > + struct rte_mbuf *pkt_last_seg; /**< Last segment of current packet. */ > + uint16_t nb_rx_desc; /**< number of Rx descriptors. */ > + uint16_t rx_tail; /**< current value of RDT register. */ > + uint16_t nb_rx_hold; /**< number of held free Rx desc. */ > + uint16_t rx_nb_avail; /**< nr of staged pkts ready to ret to app */ > + uint16_t rx_next_avail; /**< idx of next staged pkt to ret to app */ > + uint16_t rx_free_trigger; /**< triggers rx buffer allocation */ > + uint16_t rx_free_thresh; /**< max free Rx desc to hold. */ > + uint16_t queue_id; /**< RX queue index. */ > + uint16_t reg_idx; /**< RX queue register index. */ > + /**< Packet type mask for different NICs. */ I don't understand above comment. Where is packet type mask? > + uint16_t port_id; /**< Device port identifier. */ > + uint8_t drop_en; /**< If not 0, set SRRCTL.Drop_En. */ > + uint8_t rx_deferred_start; /**< not in global dev start. */ > + /** need to alloc dummy mbuf, for wraparound when scanning hw ring */ > + struct rte_mbuf fake_mbuf; > + /** hold packets to return to application */ > + struct rte_mbuf *rx_stage[RTE_PMD_NGBE_RX_MAX_BURST * 2]; > +}; Above is very hard to read. Please, align more consistently. If alignment different in different lines, please, add empty line to make it readable.