[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aMu3E-wTfK-B18id@stanley.mountain>
Date: Thu, 18 Sep 2025 10:38:59 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Fan Gong <gongfan1@...wei.com>
Cc: Zhu Yikai <zhuyikai1@...artners.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>,
Andrew Lunn <andrew+netdev@...n.ch>, linux-doc@...r.kernel.org,
Jonathan Corbet <corbet@....net>,
Bjorn Helgaas <helgaas@...nel.org>, luosifu <luosifu@...wei.com>,
Xin Guo <guoxin09@...wei.com>,
Shen Chenyang <shenchenyang1@...ilicon.com>,
Zhou Shuai <zhoushuai28@...wei.com>, Wu Like <wulike1@...wei.com>,
Shi Jing <shijing34@...wei.com>,
Luo Yang <luoyang82@...artners.com>,
Meny Yossefi <meny.yossefi@...wei.com>,
Gur Stavi <gur.stavi@...wei.com>, Lee Trager <lee@...ger.us>,
Michael Ellerman <mpe@...erman.id.au>,
Vadim Fedorenko <vadim.fedorenko@...ux.dev>,
Suman Ghosh <sumang@...vell.com>,
Przemek Kitszel <przemyslaw.kitszel@...el.com>,
Joe Damato <jdamato@...tly.com>,
Christophe JAILLET <christophe.jaillet@...adoo.fr>
Subject: Re: [PATCH net-next v06 08/14] hinic3: Queue pair resource
initialization
On Fri, Sep 12, 2025 at 02:28:25PM +0800, Fan Gong wrote:
> @@ -102,6 +127,41 @@ static u32 hinic3_rx_fill_buffers(struct hinic3_rxq *rxq)
> return i;
> }
>
> +static u32 hinic3_alloc_rx_buffers(struct hinic3_dyna_rxq_res *rqres,
> + u32 rq_depth, u16 buf_len)
> +{
> + u32 free_wqebbs = rq_depth - 1;
Why is there this "- 1" here. Why do we not allocate the last page so
it's 1 page for each rq_depth?
regards,
dan carpenter
> + u32 idx;
> + int err;
> +
> + for (idx = 0; idx < free_wqebbs; idx++) {
> + err = rx_alloc_mapped_page(rqres->page_pool,
> + &rqres->rx_info[idx], buf_len);
> + if (err)
> + break;
> + }
> +
> + return idx;
> +}
> +
> +static void hinic3_free_rx_buffers(struct hinic3_dyna_rxq_res *rqres,
> + u32 q_depth)
> +{
> + struct hinic3_rx_info *rx_info;
> + u32 i;
> +
> + /* Free all the Rx ring sk_buffs */
> + for (i = 0; i < q_depth; i++) {
> + rx_info = &rqres->rx_info[i];
> +
> + if (rx_info->page) {
> + page_pool_put_full_page(rqres->page_pool,
> + rx_info->page, false);
> + rx_info->page = NULL;
> + }
> + }
> +}
> +
Powered by blists - more mailing lists