| ce0d4765 | 12-Oct-2026 |
Daniel Zahka <daniel.zahka@gmail.com> |
eth: mpnic: count Rx allocation failures
Count both skb allocation failures and page pool allocation failures per queue, and report them through the queue stats API. The bdq allocation failures are
eth: mpnic: count Rx allocation failures
Count both skb allocation failures and page pool allocation failures per queue, and report them through the queue stats API. The bdq allocation failures are added to the skb allocation failures when reporting to core and folded into base stats during aggregation, because the qstats API doesn't support reporting them separately.
Page pool allocation failures are also counted when the BDQs are first filled in ndo_open, which runs in process context. mpnic_fill() disables BH around the fill, so the u64_stats update happens with preemption disabled.
Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com> Link: https://patch.msgid.link/20261012-mpnic-counters3-v2-4-8afba81c2d5a@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
show more ...
|
| 3b28e126 | 12-Oct-2026 |
Daniel Zahka <daniel.zahka@gmail.com> |
eth: mpnic: count Tx queue stops and wakes
Count how often a Tx queue is stopped for lack of descriptors and woken again by completions, and report the counts through the queue stats API.
Stops are
eth: mpnic: count Tx queue stops and wakes
Count how often a Tx queue is stopped for lack of descriptors and woken again by completions, and report the counts through the queue stats API.
Stops are counted on the TWQ from the xmit path and wakes on the TCQ from mpnic_poll(), keeping a single writer context for each.
Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com> Link: https://patch.msgid.link/20261012-mpnic-counters3-v2-3-8afba81c2d5a@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
show more ...
|
| 5cc79ff4 | 12-Oct-2026 |
Daniel Zahka <daniel.zahka@gmail.com> |
eth: mpnic: report per-queue stats
Expose the per-ring packet and byte counters through the queue stats API. Counters for deactivated rings are reported through the base stats.
Signed-off-by: Danie
eth: mpnic: report per-queue stats
Expose the per-ring packet and byte counters through the queue stats API. Counters for deactivated rings are reported through the base stats.
Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com> Acked-by: Jakub Kicinski <kuba@kernel.org> Link: https://patch.msgid.link/20261012-mpnic-counters3-v2-2-8afba81c2d5a@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
show more ...
|
| 56f2178f | 01-Oct-2026 |
Daniel Zahka <daniel.zahka@gmail.com> |
eth: mpnic: add a NAPI depletion check
The Rx path can wedge if page pool allocations fail in __mpnic_fill_bdq(). The problematic sequence is: page pool allocations fail, bdq rings are empty, device
eth: mpnic: add a NAPI depletion check
The Rx path can wedge if page pool allocations fail in __mpnic_fill_bdq(). The problematic sequence is: page pool allocations fail, bdq rings are empty, device receives packet from the network, but drops it for lack of buffer space and does not raise interrupt, mpnic_poll() does not run, so page pool allocations are not retried.
To break out of this cycle, we can add a depletion check to our service task. The depletion check checks if posted buffers are under a low watermark, and raises a completion queue interrupt, so that mpnic_poll will run on the corresponding napi vector.
A note about the lock free reads: We don't bother synchronizing the ring head and tail reads with mpnic_poll(), because a false positive signal would simply raise a spurious interrupt scheduling mpnic_poll(), and a false negative signal will result in a retry, where if mpnic_poll() has truly not been running, should then report accurately whether or not posted Rx buffers are low.
Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com> Reviewed-by: Harshitha Ramamurthy <hramamurthy@google.com> Link: https://patch.msgid.link/20261001-linux-mpnic-v1-4-6422ee74233a@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 9e072eda | 01-Oct-2026 |
Daniel Zahka <daniel.zahka@gmail.com> |
eth: mpnic: set Rx buffer minimums using page size and mtu
Set buffer based drop thresholds in the Rx path based on page size and the max MTU supported. The device will drop packets if it does not h
eth: mpnic: set Rx buffer minimums using page size and mtu
Set buffer based drop thresholds in the Rx path based on page size and the max MTU supported. The device will drop packets if it does not have at least the minimum number of completely unused buffer descriptors available.
These thresholds are currently set to 17 BDs for both HPQ and PPQ. These are overly conservative. With our current max MTU of 9742B, the settings we should target are:
4KiB page size: 1 HPQ, 3 PPQ 64KiB page size: 1 HPQ, 1 PPQ
The HPQ and PPQ rings are always given PAGE_SIZE sized buffers.
The RDE_CTL register encodes the thresholds as one less than the number of BDs needed.
Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com> Reviewed-by: Harshitha Ramamurthy <hramamurthy@google.com> Link: https://patch.msgid.link/20261001-linux-mpnic-v1-3-6422ee74233a@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| d990f86c | 01-Oct-2026 |
Daniel Zahka <daniel.zahka@gmail.com> |
eth: mpnic: add a service task
Add a service task that runs while the netdevice is running. For now, the service task does nothing besides conditionally reschedule itself.
Signed-off-by: Daniel Zah
eth: mpnic: add a service task
Add a service task that runs while the netdevice is running. For now, the service task does nothing besides conditionally reschedule itself.
Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com> Reviewed-by: Harshitha Ramamurthy <hramamurthy@google.com> Link: https://patch.msgid.link/20261001-linux-mpnic-v1-2-6422ee74233a@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| a9a9bb54 | 25-Sep-2026 |
Daniel Zahka <daniel.zahka@gmail.com> |
eth: mpnic: add basic Rx handling
A frame arrives as a run of completion descriptors: one header address/length descriptor, one address/length descriptor per payload page, and a metadata descriptor
eth: mpnic: add basic Rx handling
A frame arrives as a run of completion descriptors: one header address/length descriptor, one address/length descriptor per payload page, and a metadata descriptor that closes the frame. The frame is assembled in an xdp_buff as the descriptors come in and handed to the stack when the metadata descriptor arrives.
A page holds several frames, so rather than taking a reference per frame the driver takes a batch of references when it starts handing the page out and returns whatever is left over once the device moves on to the next one. Payload fragments that turn out to be contiguous within one page are merged so that a frame spread over a page does not eat one skb fragment slot per descriptor.
Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com> Acked-by: Jakub Kicinski <kuba@kernel.org> Link: https://patch.msgid.link/20260924-linux-mpnic-v2-8-4badc9b58b9e@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
show more ...
|
| 4b26e9cd | 25-Sep-2026 |
Daniel Zahka <daniel.zahka@gmail.com> |
eth: mpnic: implement Rx queue allocation and cleanup
The Rx side of a queue triad is a header queue, a payload queue and a completion queue. With HDS not active yet, frames are split between the tw
eth: mpnic: implement Rx queue allocation and cleanup
The Rx side of a queue triad is a header queue, a payload queue and a completion queue. With HDS not active yet, frames are split between the two buffer queues at a fixed header boundary: everything up to 1536 bytes lands in the header page, the rest goes to the payload page. Small frames therefore never touch the payload queue, and several of them share one header page.
The device is set to leave headroom and tailroom for XDP and skb_shared_info respectively.
Both queues draw from one page pool per triad and post buffer descriptors to the device in batches.
Even though we do not support XDP yet, use the XDP APIs for tracking pre-skb buffers. The XDP buffer handling helpers save us from reimplementing the same logic in the driver.
Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com> Link: https://patch.msgid.link/20260924-linux-mpnic-v2-7-4badc9b58b9e@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
show more ...
|
| 1b8d005b | 25-Sep-2026 |
Daniel Zahka <daniel.zahka@gmail.com> |
eth: mpnic: add a netdevice and basic Tx handling
Register the network interface and let it transmit skbs.
The typical TWQ descriptor sequence for an skb is: 1 primary metadata, followed by 0 or mo
eth: mpnic: add a netdevice and basic Tx handling
Register the network interface and let it transmit skbs.
The typical TWQ descriptor sequence for an skb is: 1 primary metadata, followed by 0 or more non-last address + length (A/L) descriptors, terminated by an always present last A/L descriptor.
The device does not write a Tx completion unless it is requested in the primary metadata desc. The xmit path sets this bit when the stack does not report netdev_xmit_more(). This can create a problem if the last packet in a burst is dropped by the driver. To deal with that case, the driver latches the last metadata for which a completion was not requested, and uses this to request a completion and flush queued packets when one is dropped.
There is no link state yet, so carrier follows the administrative state.
Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com> Link: https://patch.msgid.link/20260924-linux-mpnic-v2-6-4badc9b58b9e@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
show more ...
|
| bd7ce2b2 | 25-Sep-2026 |
Daniel Zahka <daniel.zahka@gmail.com> |
eth: mpnic: start and stop the Tx HW queues
Point the hardware at the descriptor rings and provide functions for turning the Tx queues on and off.
Teardown has to wait for the DMA engines to go idl
eth: mpnic: start and stop the Tx HW queues
Point the hardware at the descriptor rings and provide functions for turning the Tx queues on and off.
Teardown has to wait for the DMA engines to go idle before the ring memory can be freed: disabling a queue only stops the device picking up new work, it does not tell us that the work already fetched has been retired. Each block exposes an idle bitmap per queue, and every one of the four blocks a packet passes through on its way out has to report idle before the descriptors are safe to free.
Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com> Link: https://patch.msgid.link/20260924-linux-mpnic-v2-5-4badc9b58b9e@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
show more ...
|
| 3d4e4ad4 | 25-Sep-2026 |
Daniel Zahka <daniel.zahka@gmail.com> |
eth: mpnic: implement Tx queue allocation and cleanup
Queues come in triads of two work queues and one completion queue. The Tx triad only uses the first work queue for now, the second one will be u
eth: mpnic: implement Tx queue allocation and cleanup
Queues come in triads of two work queues and one completion queue. The Tx triad only uses the first work queue for now, the second one will be used for the XDP ring later.
Add the ring structures, the per NAPI vector allocation of triads, descriptor memory and interrupts, and the completion processing. The completion queue does not report one entry per packet, it reports a work queue head, so a single completion can release many packets.
Nothing enables the queues in hardware or submits anything to them yet, that comes with the next two changes.
Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com> Link: https://patch.msgid.link/20260924-linux-mpnic-v2-4-4badc9b58b9e@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
show more ...
|
| 2cf67a26 | 25-Sep-2026 |
Daniel Zahka <daniel.zahka@gmail.com> |
eth: mpnic: allocate MSI-X vectors
Request one vector for FW generated interrupts and then one vector per CPU to use for the completion queues. Nothing requests a handler yet, that comes with the NA
eth: mpnic: allocate MSI-X vectors
Request one vector for FW generated interrupts and then one vector per CPU to use for the completion queues. Nothing requests a handler yet, that comes with the NAPI vectors.
Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com> Link: https://patch.msgid.link/20260924-linux-mpnic-v2-3-4badc9b58b9e@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
show more ...
|
| cda700bc | 25-Sep-2026 |
Mohsin Bashir <mohsin.bashr@gmail.com> |
eth: mpnic: add register init for the device
Perform one time register initialization during mpnic_probe(). These CSR settings are either static configs that only need to be set once, or pulses for
eth: mpnic: add register init for the device
Perform one time register initialization during mpnic_probe(). These CSR settings are either static configs that only need to be set once, or pulses for zeroizing on chip SRAMs, which also only need to be done once.
This initialization is idempotent and does not require any matching deinitialization in the remove path. We can unbind and re-bind the driver and perform the same initialization without problems.
Signed-off-by: Mohsin Bashir <mohsin.bashr@gmail.com> Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com> Link: https://patch.msgid.link/20260924-linux-mpnic-v2-2-4badc9b58b9e@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
show more ...
|