From: Sashiko-Bot <[email protected]>
Date: Thu, 19 Nov 2026 15:02:28 +0000

> Thank you for your contribution! Sashiko AI review found 2 potential
> issues to consider:
> - [High] idpf: unchecked cpu_to_mem() for i >= nr_cpu_ids in
>   idpf_xdpsqs_get()
> - [Medium] idpf: premature CQE poll exit on out-of-order CQEs in
>   idpf_xdpsq_poll_fb()
> --
> 
> commit 6119bbbc742528036710b0619a594398135c70b2
> Author: Alexander Lobakin <[email protected]>
> 
> idpf: add flow-based XDP fallback for FWs without Tx FIFO support
> 
> This commit introduces a flow-based Tx scheduling fallback for XDP and
> AF_XDP on firmware that lacks queue-based (FIFO) Tx scheduling support,
> using a per-queue bitmap to serialize out-of-order per-packet completion
> tags into contiguous descriptor ranges.
> 
>> diff --git a/drivers/net/ethernet/intel/idpf/xdp.c 
>> b/drivers/net/ethernet/intel/idpf/xdp.c
>> index 48320ea004dfb..0b4ead7fbcaf6 100644
>> --- a/drivers/net/ethernet/intel/idpf/xdp.c
>> +++ b/drivers/net/ethernet/intel/idpf/xdp.c
> 
> [ ... ]
> 
>> @@ -169,13 +173,42 @@ int idpf_xdpsqs_get(const struct idpf_vport *vport)
>>                      for (int j = i - 1; j >= 0; j--)
>>                              kfree(timers[j]);
>>  
>> -                    return -ENOMEM;
>> +                    goto err_timers;
>>              }
>>      }
>>  
>>      dev = vport->netdev;
>>      sqs = vport->dflt_qv_rsrc.xdp_txq_offset;
>>  
>> +    fb = !idpf_is_cap_ena(vport->adapter, IDPF_OTHER_CAPS,
>> +                          VIRTCHNL2_CAP_SPLITQ_QSCHED);
>> +    if (!fb)
>> +            goto setup;
>> +
>> +    masks = kvzalloc_objs(*masks, vport->num_xdp_txq);
>> +    if (!masks)
>> +            goto err_masks;
>> +
>> +    for (u32 i = 0; i < vport->num_xdp_txq; i++) {
>> +            masks[i] = bitmap_zalloc_node(vport->txqs[sqs + i]->desc_count,
>> +                                          GFP_KERNEL, cpu_to_mem(i));
> 
> [Severity: High]
> Can cpu_to_mem(i) index past nr_cpu_ids when vport->num_xdp_txq exceeds
> the number of CPUs?

Oops, correct. I mean it's possible in theory since usually the maximum
number of RQs is usually pretty low (like 16), but it's possible.

I'll fix this in v4.

[...]
> [Severity: Medium]
> Can idpf_xdpsq_poll_fb() return 0 after consuming out-of-order CQEs if
> the descriptor at xdpsq->next_to_clean has not completed yet?

That's the point that we linearize completions and report only
contiguous chunks starting from next_to_clean.

Thanks,
Olek

Reply via email to