All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dany Madden <drt@linux.ibm.com>
To: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
Cc: netdev@vger.kernel.org, Brian King <brking@linux.ibm.com>,
	cforno12@linux.ibm.com, Rick Lindsley <ricklind@linux.ibm.com>
Subject: Re: [PATCH net-next 1/9] ibmvnic: Consolidate code in replenish_rx_pool()
Date: Tue, 31 Aug 2021 18:26:54 -0700	[thread overview]
Message-ID: <81e15c4739a2ba9ddcc61d973c597433@imap.linux.ibm.com> (raw)
In-Reply-To: <20210901000812.120968-2-sukadev@linux.ibm.com>

On 2021-08-31 17:08, Sukadev Bhattiprolu wrote:
> For better readability, consolidate related code in replenish_rx_pool()
> and add some comments.
> 
> Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
Reviewed-by: Dany Madden <drt@linux.ibm.com>

> ---
>  drivers/net/ethernet/ibm/ibmvnic.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/ibm/ibmvnic.c
> b/drivers/net/ethernet/ibm/ibmvnic.c
> index a775c69e4fd7..e8b1231be485 100644
> --- a/drivers/net/ethernet/ibm/ibmvnic.c
> +++ b/drivers/net/ethernet/ibm/ibmvnic.c
> @@ -371,6 +371,8 @@ static void replenish_rx_pool(struct
> ibmvnic_adapter *adapter,
>  		}
> 
>  		index = pool->free_map[pool->next_free];
> +		pool->free_map[pool->next_free] = IBMVNIC_INVALID_MAP;
> +		pool->next_free = (pool->next_free + 1) % pool->size;
> 
>  		if (pool->rx_buff[index].skb)
>  			dev_err(dev, "Inconsistent free_map!\n");
> @@ -380,14 +382,15 @@ static void replenish_rx_pool(struct
> ibmvnic_adapter *adapter,
>  		dst = pool->long_term_buff.buff + offset;
>  		memset(dst, 0, pool->buff_size);
>  		dma_addr = pool->long_term_buff.addr + offset;
> -		pool->rx_buff[index].data = dst;
> 
> -		pool->free_map[pool->next_free] = IBMVNIC_INVALID_MAP;
> +		/* add the skb to an rx_buff in the pool */
> +		pool->rx_buff[index].data = dst;
>  		pool->rx_buff[index].dma = dma_addr;
>  		pool->rx_buff[index].skb = skb;
>  		pool->rx_buff[index].pool_index = pool->index;
>  		pool->rx_buff[index].size = pool->buff_size;
> 
> +		/* queue the rx_buff for the next send_subcrq_indirect */
>  		sub_crq = &ind_bufp->indir_arr[ind_bufp->index++];
>  		memset(sub_crq, 0, sizeof(*sub_crq));
>  		sub_crq->rx_add.first = IBMVNIC_CRQ_CMD;
> @@ -405,7 +408,8 @@ static void replenish_rx_pool(struct
> ibmvnic_adapter *adapter,
>  		shift = 8;
>  #endif
>  		sub_crq->rx_add.len = cpu_to_be32(pool->buff_size << shift);
> -		pool->next_free = (pool->next_free + 1) % pool->size;
> +
> +		/* if send_subcrq_indirect queue is full, flush to VIOS */
>  		if (ind_bufp->index == IBMVNIC_MAX_IND_DESCS ||
>  		    i == count - 1) {
>  			lpar_rc =

  reply	other threads:[~2021-09-01  1:27 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-01  0:08 [PATCH net-next 0/9] ibmvnic: Reuse ltb, rx, tx pools Sukadev Bhattiprolu
2021-09-01  0:08 ` [PATCH net-next 1/9] ibmvnic: Consolidate code in replenish_rx_pool() Sukadev Bhattiprolu
2021-09-01  1:26   ` Dany Madden [this message]
2021-09-01  0:08 ` [PATCH net-next 2/9] ibmvnic: Fix up some comments and messages Sukadev Bhattiprolu
2021-09-01  1:28   ` Dany Madden
2021-09-01  8:58   ` kernel test robot
2021-09-01  8:58     ` kernel test robot
2021-09-01  0:08 ` [PATCH net-next 3/9] ibmvnic: Use/rename local vars in init_rx_pools Sukadev Bhattiprolu
2021-09-01  1:28   ` Dany Madden
2021-09-01  0:08 ` [PATCH net-next 4/9] ibmvnic: Use/rename local vars in init_tx_pools Sukadev Bhattiprolu
2021-09-01  1:30   ` Dany Madden
2021-09-01  0:08 ` [PATCH net-next 5/9] ibmvnic: init_tx_pools move loop-invariant code out Sukadev Bhattiprolu
2021-09-01  1:32   ` Dany Madden
2021-09-01  0:08 ` [PATCH net-next 6/9] ibmvnic: Use bitmap for LTB map_ids Sukadev Bhattiprolu
2021-09-01  1:33   ` Dany Madden
2021-09-01  0:08 ` [PATCH net-next 7/9] ibmvnic: Reuse LTB when possible Sukadev Bhattiprolu
2021-09-01  1:34   ` Dany Madden
2021-09-01  0:08 ` [PATCH net-next 8/9] ibmvnic: Reuse rx pools " Sukadev Bhattiprolu
2021-09-01  1:35   ` Dany Madden
2021-09-01  0:08 ` [PATCH net-next 9/9] ibmvnic: Reuse tx " Sukadev Bhattiprolu
2021-09-01  1:36   ` Dany Madden
2021-09-01  1:21 ` [PATCH net-next 0/9] ibmvnic: Reuse ltb, rx, tx pools Rick Lindsley
2021-09-01  2:35 ` Jakub Kicinski
2021-09-01 18:07   ` Sukadev Bhattiprolu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=81e15c4739a2ba9ddcc61d973c597433@imap.linux.ibm.com \
    --to=drt@linux.ibm.com \
    --cc=brking@linux.ibm.com \
    --cc=cforno12@linux.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=ricklind@linux.ibm.com \
    --cc=sukadev@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.