| 88dbfe0d | 24-Jul-2026 |
Jeremy Kerr <jk@codeconstruct.com.au> |
net: mctp: usb: Allow multiple urbs in flight
Currently, we stop tx queues when we have one urb submitted. This means we will immediately hit dev_hard_start_xmit's tx-queues-off -> NETDEV_TX_BUSY ca
net: mctp: usb: Allow multiple urbs in flight
Currently, we stop tx queues when we have one urb submitted. This means we will immediately hit dev_hard_start_xmit's tx-queues-off -> NETDEV_TX_BUSY case, and revert to the requeue -> gso_skb single-dequeue path, and no longer be able to pack skbs without an xmit_more indication.
Instead, allow a few urbs to be in-flight, with a limit of 16kB of data outstanding (after which we will disable queues). With this, the tx path will cause fewer requeues (and therefore non-packed transfers) under normal loads.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Link: https://patch.msgid.link/20260724-dev-mctp-usb-1-1-v5-12-e66bbba0dbdc@codeconstruct.com.au Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| b4a27a47 | 24-Jul-2026 |
Jeremy Kerr <jk@codeconstruct.com.au> |
net: mctp: usb: enable v1.1 packet spanning
Now that mctp-usblib supports DSP0283 v1.1 packet spanning, enable it in our host-side transport driver.
Add a match for the new device subclass (0x02),
net: mctp: usb: enable v1.1 packet spanning
Now that mctp-usblib supports DSP0283 v1.1 packet spanning, enable it in our host-side transport driver.
Add a match for the new device subclass (0x02), and indicating spanning mode to the usblib rx/tx implementation.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Link: https://patch.msgid.link/20260724-dev-mctp-usb-1-1-v5-11-e66bbba0dbdc@codeconstruct.com.au Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| e84c0edb | 24-Jul-2026 |
Jeremy Kerr <jk@codeconstruct.com.au> |
net: mctp: usblib: Add initial kunit tests
Add some initial tests for the usblib receive path, where we're extracting MCTP packets from incoming USB transfer data.
Signed-off-by: Jeremy Kerr <jk@co
net: mctp: usblib: Add initial kunit tests
Add some initial tests for the usblib receive path, where we're extracting MCTP packets from incoming USB transfer data.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Link: https://patch.msgid.link/20260724-dev-mctp-usb-1-1-v5-10-e66bbba0dbdc@codeconstruct.com.au Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 081ac93c | 24-Jul-2026 |
Jeremy Kerr <jk@codeconstruct.com.au> |
net: mctp: usblib: Implement transmit-side packet spanning
Add support for packet spanning as defined in DSP0283 v1.1.
With the existing v1.0 implementation of multi-packet transfers, all we need h
net: mctp: usblib: Implement transmit-side packet spanning
Add support for packet spanning as defined in DSP0283 v1.1.
With the existing v1.0 implementation of multi-packet transfers, all we need here is to adjust the buffer sizes to suit v1.1.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Link: https://patch.msgid.link/20260724-dev-mctp-usb-1-1-v5-9-e66bbba0dbdc@codeconstruct.com.au Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| d52fc7f0 | 24-Jul-2026 |
Jeremy Kerr <jk@codeconstruct.com.au> |
net: mctp: usblib: Implement receive-side packet spanning
Using the existing prepare/complete API, we can persist the rx skb across receives to implement v1.1 packet spanning.
Alter the packet-extr
net: mctp: usblib: Implement receive-side packet spanning
Using the existing prepare/complete API, we can persist the rx skb across receives to implement v1.1 packet spanning.
Alter the packet-extraction loop to allow truncated packets, returning early with the skb persisted for the next IN urb completion. When we see we have a complete packet, netif_rx() that. If the packet boundary aligns with the urb completion, we can netif_rx() the whole thing.
Those intermediate packets are cloned from the original (large-transfer-data) skb. Unlike existing behaviour, if the clone fails, we drop just that clone, instead of the existing transfer skb. This allows us to process the rest of the skb data, and any continuation of the span into the next transfer.
One subtle change: the mctp_usblib_rx() helper now handles skbs with the full transport header, so we shift the skb_pull() for the header data to the helper, before doing the rx_bytes stats update.
We still need to handle non-spanning mode, so error out on truncated-packet cases there.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Link: https://patch.msgid.link/20260724-dev-mctp-usb-1-1-v5-8-e66bbba0dbdc@codeconstruct.com.au Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| f5bf226f | 24-Jul-2026 |
Jeremy Kerr <jk@codeconstruct.com.au> |
net: mctp: usb: Accommodate DSP0283 v1.1 header format
In the v1.1 update to DSP0283, we have a larger header field, of 13 bits rather than 8.
In order to accommodate this, in preparation for prope
net: mctp: usb: Accommodate DSP0283 v1.1 header format
In the v1.1 update to DSP0283, we have a larger header field, of 13 bits rather than 8.
In order to accommodate this, in preparation for proper v1.1 support, expand our struct mctp_usb_hdr's len field to a u16, and endian-convert when necessary. Because we don't yet support spanning mode, we will never receive or transmit with the top 5 bits set, so we always mask out anyway.
This allows for a future change where we allow spanning mode with >512-byte transfers.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Link: https://patch.msgid.link/20260724-dev-mctp-usb-1-1-v5-7-e66bbba0dbdc@codeconstruct.com.au Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 76a58ffd | 24-Jul-2026 |
Jeremy Kerr <jk@codeconstruct.com.au> |
net: mctp: usblib: Add support for multi-packet transmit
The MCTP over USB spec allows us to pack multiple packets in one transfer. Given the packet max length is 255, and the transfer max length is
net: mctp: usblib: Add support for multi-packet transmit
The MCTP over USB spec allows us to pack multiple packets in one transfer. Given the packet max length is 255, and the transfer max length is 512, we can typically include two full-size packets per urb submission.
To do this, we allow a struct mctp_usb_tx to persist a tx_ctx, representing the ongoing context for a transmit. If possible, a TX skb will be queued to the context and the send deferred until the context is full, or the device queue reports no more packets.
This typically requires a linear buffer for the 512-byte TX, which we allocate along with the TX context.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Link: https://patch.msgid.link/20260724-dev-mctp-usb-1-1-v5-6-e66bbba0dbdc@codeconstruct.com.au Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| aadf5ed0 | 24-Jul-2026 |
Jeremy Kerr <jk@codeconstruct.com.au> |
net: mctp: usblib: Move TX transfer processing to mctp-usblib
With the RX processing in mctp-usblib, add TX processing alongside.
To accommodate packed transfers in DSP0283, where a transfer may co
net: mctp: usblib: Move TX transfer processing to mctp-usblib
With the RX processing in mctp-usblib, add TX processing alongside.
To accommodate packed transfers in DSP0283, where a transfer may contain multiple MCTP packets, we move to a split process for the transmit API:
* push: create a new transmit context, and add a skb to it.
* send: callback to the driver implementation to send the (possibly multi-packet) USB transfer
* complete: update skb accounting and release the tx context
The actual multi-packet transfer implementation will be added in the next change; no tx context persists beyond the single send at present. However, we use an anchor in the host driver implementation to track the submitted TX urb when necessary.
While we're here, fix an inconsistency between tx and rx stats: both should not include the transport header.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Link: https://patch.msgid.link/20260724-dev-mctp-usb-1-1-v5-5-e66bbba0dbdc@codeconstruct.com.au Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 9f66be01 | 24-Jul-2026 |
Jeremy Kerr <jk@codeconstruct.com.au> |
net: mctp: usb: Improve IN endpoint status handling
Currently, we give-up on all non-zero status values on our IN/rx urb, and do not re-queue the urb. This will stall the driver, and prevent any fur
net: mctp: usb: Improve IN endpoint status handling
Currently, we give-up on all non-zero status values on our IN/rx urb, and do not re-queue the urb. This will stall the driver, and prevent any further receive.
Instead, attempt a re-queue on transient errors, with a max of ten successive failures. Handle EPIPE specially, by scheduling a usb_clear_halt() in non-atomic context.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Link: https://patch.msgid.link/20260724-dev-mctp-usb-1-1-v5-4-e66bbba0dbdc@codeconstruct.com.au Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| b8564b19 | 24-Jul-2026 |
Jeremy Kerr <jk@codeconstruct.com.au> |
net: mctp: usblib: Move RX transfer processing to a new mctp-usblib
The processing of USB receive transfers is common to both sides of a MCTP over USB transport. In order to support a future gadget
net: mctp: usblib: Move RX transfer processing to a new mctp-usblib
The processing of USB receive transfers is common to both sides of a MCTP over USB transport. In order to support a future gadget driver, move the current host-side driver into a new common file, mctp-usblib.
This currently handles the submit-complete-packetise process of the receive path of the USB transport. We'll add transmit handling in an upcoming change.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Link: https://patch.msgid.link/20260724-dev-mctp-usb-1-1-v5-3-e66bbba0dbdc@codeconstruct.com.au Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 05b1a3a5 | 24-Jul-2026 |
Jeremy Kerr <jk@codeconstruct.com.au> |
net: mctp: usb: Use packet-length max for maximum packet-size check
The max packet size is smaller than the max transfer size, as we only have a u8 length field in the transport header.
Add a defin
net: mctp: usb: Use packet-length max for maximum packet-size check
The max packet size is smaller than the max transfer size, as we only have a u8 length field in the transport header.
Add a define for the maximum representable length, and use that for our check. Use this for the MTU maximum calculation too.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Link: https://patch.msgid.link/20260724-dev-mctp-usb-1-1-v5-2-e66bbba0dbdc@codeconstruct.com.au Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 881a3113 | 08-Jun-2026 |
Jeremy Kerr <jk@codeconstruct.com.au> |
net: mctp: usb: don't fail mctp_usb_rx_queue on a deferred submission
In the ndo_open path, a deferred queue open will report a failure, and so the netdev will not be ndo_stop()ed, leaving us with t
net: mctp: usb: don't fail mctp_usb_rx_queue on a deferred submission
In the ndo_open path, a deferred queue open will report a failure, and so the netdev will not be ndo_stop()ed, leaving us with the rx_retry work potentially pending.
Don't report a deferred queue as an error, as we are still operational. This means we use the ndo_stop() path for future cleanup, which handles rx_retry_work cancellation.
Fixes: 0791c0327a6e ("net: mctp: Add MCTP USB transport driver") Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Link: https://patch.msgid.link/20260608-dev-mctp-usb-rx-requeue-v2-2-29a3aa507609@codeconstruct.com.au Signed-off-by: Paolo Abeni <pabeni@redhat.com>
show more ...
|