]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: mctp: test: Use dev_direct_xmit for TX to our test device
authorJeremy Kerr <jk@codeconstruct.com.au>
Wed, 29 Apr 2026 08:21:42 +0000 (16:21 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 30 Apr 2026 20:36:47 +0000 (13:36 -0700)
In our test cases, we typically feed a packet sequence into the routing
code, then inspect the device's TXed skbs to assert specific behaviours.

Using dev_queue_xmit() for our TX path introduces a fair bit of
complexity between the test packet sequence and the test device's
ndo_start_xmit callback; which may mean that the skbs have not hit the
device at the point we're inspecting the TXed skb list.

Use dev_direct_xmit instead, as we want a direct a path as possible
here, and the test dev does not need any queueing, scheduling or flow
control.

Fixes: 6ab578739a4c ("net: mctp: test: move TX packetqueue from dst to dev")
Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202604281320.525eee17-lkp@intel.com
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260429-dev-mctp-test-fixes-v1-2-1127b7425809@codeconstruct.com.au
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mctp/test/utils.c

index c3987d5ade7adc3a48d44b09dd3aebae7a59108c..6eef8d485c25e2bd97ab28514de1a2c6852267a6 100644 (file)
@@ -116,7 +116,7 @@ void mctp_test_destroy_dev(struct mctp_test_dev *dev)
 static int mctp_test_dst_output(struct mctp_dst *dst, struct sk_buff *skb)
 {
        skb->dev = dst->dev->dev;
-       dev_queue_xmit(skb);
+       dev_direct_xmit(skb, 0);
 
        return 0;
 }