RE: [PATCH bpf-next 0/2] Clarify and Enhance XDP Rx Metadata Handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday, July 8, 2025 4:55 AM, Jakub Kicinski <kuba@xxxxxxxxxx> wrote:
>On Tue,  1 Jul 2025 12:29:38 +0800 Song Yoong Siang wrote:
>>                         |<---sizeof(xdp_meta)--|
>>                         |                      |
>>                  struct xdp_meta               rx_desc->address
>>                         ^                      ^
>>                         |                      |
>> +----------+----------------------+------------+------+
>> | headroom |    custom metadata   |  reserved  | data |
>> +----------+----------------------+------------+------+
>>            ^                      ^            ^
>>            |                      |            |
>>     struct xdp_meta     xdp_buff->data_meta    xdp_buff->data
>>            |                      |
>>            |<---sizeof(xdp_meta)--|
>
>Huh. Did AF_XDP maintainers explicitly sign off on this or it's just how
>IGC implementation works and nobody noticed?
>
Previously,  IGC do copy out the Rx hwts from metadata area,
so no problem when implementing XDP Rx metadata.

After that, net_device_ops.ndo_get_tstamp() is added into IGC to
support timestamping from both free-running clock and adjustable clock.
The 2 timers are stored in the metadata area, thus causing the issue.

>For normal XDP my understanding is that its the driver's responsibility
>to move the "reserved" stuff out of place before presenting the frame to
>program.

Is it means that driver needs to move out the "reserved" stuff before XDP program
and then move back the stuff after XDP program for certain situation, like XDP_PASS?

IMHO, if driver is allowed to use some portion of the metadata area, then
the packet processing will be more efficiency and also align with the "zero-copy" idea.

Any thoughts?
  





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux