[PATCH net-next 02/12] ibmvnic: Introduce indirect subordinate Command Response Queue buffer
Thomas Falcon
tlfalcon at linux.ibm.com
Tue Nov 17 05:18:41 AEDT 2020
On 11/14/20 5:35 PM, Jakub Kicinski wrote:
> 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.
Thanks, I can fix that in a v2.
>
>> + 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);
>
> ?
Yes, you're right, I will include that in a v2 also.
>> + }
>> +
>> spin_lock_init(&scrq->lock);
>>
More information about the Linuxppc-dev
mailing list