[PATCH net-next 02/12] ibmvnic: Introduce indirect subordinate Command Response Queue buffer
Jakub Kicinski
kuba at kernel.org
Sun Nov 15 10:35:01 AEDT 2020
On Thu, 12 Nov 2020 13:09:57 -0600 Thomas Falcon wrote:
> This patch introduces the infrastructure to send batched subordinate
> Command Response Queue descriptors, which are used by the ibmvnic
> driver to send TX frame and RX buffer descriptors.
>
> Signed-off-by: Thomas Falcon <tlfalcon at linux.ibm.com>
> @@ -2957,6 +2963,19 @@ static struct ibmvnic_sub_crq_queue *init_sub_crq_queue(struct ibmvnic_adapter
>
> scrq->adapter = adapter;
> scrq->size = 4 * PAGE_SIZE / sizeof(*scrq->msgs);
> + scrq->ind_buf.index = 0;
> +
> + scrq->ind_buf.indir_arr =
> + dma_alloc_coherent(dev,
> + IBMVNIC_IND_ARR_SZ,
> + &scrq->ind_buf.indir_dma,
> + GFP_KERNEL);
> +
> + if (!scrq->ind_buf.indir_arr) {
> + dev_err(dev, "Couldn't allocate indirect scrq buffer\n");
This warning/error is not necessary, memory allocation will trigger an
OOM message already.
> + goto reg_failed;
Don't you have to do something like
rc = plpar_hcall_norets(H_FREE_SUB_CRQ,
adapter->vdev->unit_address,
scrq->crq_num);
?
> + }
> +
> spin_lock_init(&scrq->lock);
>
More information about the Linuxppc-dev
mailing list