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 DF00EA0543; Fri, 7 Oct 2022 21:43:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C1673400D5; Fri, 7 Oct 2022 21:43:21 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id CD12E40042 for ; Fri, 7 Oct 2022 21:43:20 +0200 (CEST) Received: from [192.168.1.126] (unknown [188.242.181.57]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 123B67B; Fri, 7 Oct 2022 22:43:20 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 123B67B DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1665171800; bh=zTccpanj2/UVA0VU6p0TZiNgHZa6AqDbZPc35Gg7yzo=; h=Date:Subject:To:References:Cc:From:In-Reply-To:From; b=ARaiPHOj16Cv4i6IJUrTgCt5y5z7mqZhYvzUSvziz9F+ILLaSNIvauYige0nb4AKk Hz0gIm2r919UXShJf8UsCKdFvdLYEUqQB9xw1NNZxo0aqEtuFL0bdugVoZnPobLkzu 8roZZDH66LI4bzutPiDtkfefLa3DT/BDKMs3Hd/Y= Message-ID: <37a514bd-c2f3-d012-d99f-e673e29cbb9a@oktetlabs.ru> Date: Fri, 7 Oct 2022 22:43:19 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: [EXT] [PATCH v8 4/4] app/testpmd: support mulitiple mbuf pools per Rx queue Content-Language: en-US To: Hanumanth Reddy Pothula References: <20221006170126.1322852-1-hpothula@marvell.com> <20221007172921.3325250-1-andrew.rybchenko@oktetlabs.ru> <20221007172921.3325250-5-andrew.rybchenko@oktetlabs.ru> Cc: "dev@dpdk.org" , Thomas Monjalon , Ferruh Yigit From: Andrew Rybchenko In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 On 10/7/22 21:16, Hanumanth Reddy Pothula wrote: > Thanks Andrew for helping me in merging the changes. > > In below if condition, rx_conf->offloads & RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT will be always true as are not setting RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT. > I think we need to do && operation. > > if (rx_pkt_nb_segs <= 1 || > (rx_conf->offloads & RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT) == 0) { > rx_conf->rx_seg = NULL; > rx_conf->rx_nseg = 0; > ret = rte_eth_rx_queue_setup(port_id, rx_queue_id, > nb_rx_desc, socket_id, > rx_conf, mp); > return ret; > } That's exactly what I'm talking about in the cover letter. I'm not sure in testpmd patch at all. So, I vote for postponing testpmd part to rc2 stage. > > Applied changes locally with && operation in above if condition and confirmed its working fine. > > Regards, > Hanumanth > >> -----Original Message----- >> From: Andrew Rybchenko >> Sent: Friday, October 7, 2022 10:59 PM >> To: Aman Singh ; Yuying Zhang >> >> Cc: dev@dpdk.org; Hanumanth Reddy Pothula >> Subject: [EXT] [PATCH v8 4/4] app/testpmd: support mulitiple mbuf pools per Rx >> queue >> >> External Email >> >> ---------------------------------------------------------------------- >> From: Hanumanth Pothula >> >> Some of the HW has support for choosing memory pools based on the packet's >> size. The pool sort capability allows PMD/NIC to choose a memory pool based >> on the packet's length. >> >> On multiple mempool support enabled, populate mempool array and also print >> pool name on which packet is received. >> >> Signed-off-by: Hanumanth Pothula >> --- >> app/test-pmd/testpmd.c | 34 ++++++++++++++++++++++++---------- >> app/test-pmd/testpmd.h | 3 +++ >> app/test-pmd/util.c | 4 ++-- >> 3 files changed, 29 insertions(+), 12 deletions(-) >> >> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index >> de6ad00138..2ce9953c76 100644 >> --- a/app/test-pmd/testpmd.c >> +++ b/app/test-pmd/testpmd.c >> @@ -2624,6 +2624,7 @@ rx_queue_setup(uint16_t port_id, uint16_t >> rx_queue_id, >> struct rte_eth_rxconf *rx_conf, struct rte_mempool *mp) { >> union rte_eth_rxseg rx_useg[MAX_SEGS_BUFFER_SPLIT] = {}; >> + struct rte_mempool *rx_mempool[MAX_MEMPOOL] = {}; >> unsigned int i, mp_n; >> int ret; >> >> @@ -2645,16 +2646,29 @@ rx_queue_setup(uint16_t port_id, uint16_t >> rx_queue_id, >> */ >> mp_n = (i >= mbuf_data_size_n) ? mbuf_data_size_n - 1 : i; >> mpx = mbuf_pool_find(socket_id, mp_n); >> - /* Handle zero as mbuf data buffer size. */ >> - rx_seg->length = rx_pkt_seg_lengths[i] ? >> - rx_pkt_seg_lengths[i] : >> - mbuf_data_size[mp_n]; >> - rx_seg->offset = i < rx_pkt_nb_offs ? >> - rx_pkt_seg_offsets[i] : 0; >> - rx_seg->mp = mpx ? mpx : mp; >> - } >> - rx_conf->rx_nseg = rx_pkt_nb_segs; >> - rx_conf->rx_seg = rx_useg; >> + if (rx_conf->offloads & RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT) >> { >> + /** >> + * On Segment length zero, update length as, >> + * buffer size - headroom size >> + * to make sure enough space is accomidate for header. >> + */ >> + rx_seg->length = rx_pkt_seg_lengths[i] ? >> + rx_pkt_seg_lengths[i] : >> + mbuf_data_size[mp_n] - >> RTE_PKTMBUF_HEADROOM; >> + rx_seg->offset = i < rx_pkt_nb_offs ? >> + rx_pkt_seg_offsets[i] : 0; >> + rx_seg->mp = mpx ? mpx : mp; >> + } else { >> + rx_mempool[i] = mpx ? mpx : mp; >> + } >> + } >> + if (rx_conf->offloads & RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT) { >> + rx_conf->rx_nseg = rx_pkt_nb_segs; >> + rx_conf->rx_seg = rx_useg; >> + } else { >> + rx_conf->rx_mempools = rx_mempool; >> + rx_conf->rx_nmempool = rx_pkt_nb_segs; >> + } >> ret = rte_eth_rx_queue_setup(port_id, rx_queue_id, nb_rx_desc, >> socket_id, rx_conf, NULL); >> rx_conf->rx_seg = NULL; >> diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index >> cbbc7cc350..2f50a10d1f 100644 >> --- a/app/test-pmd/testpmd.h >> +++ b/app/test-pmd/testpmd.h >> @@ -80,6 +80,9 @@ extern uint8_t cl_quit; >> >> #define MIN_TOTAL_NUM_MBUFS 1024 >> >> +/* Maximum number of pools supported per Rx queue */ #define >> +MAX_MEMPOOL 8 >> + >> typedef uint8_t lcoreid_t; >> typedef uint16_t portid_t; >> typedef uint16_t queueid_t; >> diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c index >> fd98e8b51d..f9df5f69ef 100644 >> --- a/app/test-pmd/util.c >> +++ b/app/test-pmd/util.c >> @@ -150,8 +150,8 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, >> struct rte_mbuf *pkts[], >> print_ether_addr(" - dst=", ð_hdr->dst_addr, >> print_buf, buf_size, &cur_len); >> MKDUMPSTR(print_buf, buf_size, cur_len, >> - " - type=0x%04x - length=%u - nb_segs=%d", >> - eth_type, (unsigned int) mb->pkt_len, >> + " - pool=%s - type=0x%04x - length=%u - >> nb_segs=%d", >> + mb->pool->name, eth_type, (unsigned int) mb- >>> pkt_len, >> (int)mb->nb_segs); >> ol_flags = mb->ol_flags; >> if (ol_flags & RTE_MBUF_F_RX_RSS_HASH) { >> -- >> 2.30.2 >