[PATCH 05/12] net/stack: fresh rtskb should have ip_summed set to CHECKSUM_NONE

Philippe Gerum rpm at xenomai.org
Fri Jan 25 10:26:07 CET 2019

On 1/24/19 7:21 PM, Jan Kiszka wrote:
> Cleanup or fix?
> I agree with the change, but if it's a fix, it should also go into stable.

There seem to be a general issue with checking for ip_summed. I can figure out how this is supposed to work in the regular IP stack, but I'm unsure about the RTnet logic regarding ip_summed. Specifically, the way rtskb_checksum_none_assert() is implemented puzzles me. I would expect some change along these lines for this code to ever make sense:

diff --git a/kernel/drivers/net/stack/include/rtskb.h b/kernel/drivers/net/stack/include/rtskb.h
index a1793e9a8..2d95d6ff8 100644
--- a/kernel/drivers/net/stack/include/rtskb.h
+++ b/kernel/drivers/net/stack/include/rtskb.h
@@ -282,6 +282,9 @@ extern unsigned int rtskb_amount_max;   /* maximum number of allocated rtskbs */
 extern void rtskb_over_panic(struct rtskb *skb, int len, void *here);
 extern void rtskb_under_panic(struct rtskb *skb, int len, void *here);
+#define rtskb_checksum_none_assert(skb) (WARN_ON_ONCE(skb->ip_summed != CHECKSUM_NONE))
+#define rtskb_checksum_none_assert(skb) do { (void)skb; } while (0)
 extern struct rtskb *rtskb_pool_dequeue(struct rtskb_pool *pool);
@@ -294,8 +297,6 @@ extern void kfree_rtskb(struct rtskb *skb);
 #define dev_kfree_rtskb(a)  kfree_rtskb(a)
-#define rtskb_checksum_none_assert(skb) (skb->ip_summed = CHECKSUM_NONE)
 static inline void rtskb_tx_timestamp(struct rtskb *skb)
 	nanosecs_abs_t *ts = skb->xmit_stamp;


More information about the Xenomai mailing list