diff options
author | Bjoern A. Zeeb <bz@FreeBSD.org> | 2022-04-15 12:25:39 +0000 |
---|---|---|
committer | Bjoern A. Zeeb <bz@FreeBSD.org> | 2022-04-15 15:54:03 +0000 |
commit | 952643ea452655a8e80d1b5e1cc2cae35cb73870 (patch) | |
tree | fe9e26ade61b379c8bb37d90bbef814b403519eb /sys/compat | |
parent | 0a90043e63d3d3fe0b39a05794af5ea0e0e05938 (diff) | |
download | src-952643ea452655a8e80d1b5e1cc2cae35cb73870.tar.gz src-952643ea452655a8e80d1b5e1cc2cae35cb73870.zip |
LinuxKPI: skbuff: dev_kfree_skb_irq() and improvements
While it is currently unclear if we will have to defer work in
dev_kfree_skb_irq() to call dev_kfree_skb().
We only have one caller which seems to be fine on FreeBSD by calling
it directly for now.
While here shortcut skb_put()/skb_put_data() saving us work if there
are no adjustments to do.
Also adjust the logging in skb_is_gso() to avoid getting spammed by it.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/linuxkpi/common/include/linux/skbuff.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/skbuff.h b/sys/compat/linuxkpi/common/include/linux/skbuff.h index 79d65c0169b3..2b1b66844640 100644 --- a/sys/compat/linuxkpi/common/include/linux/skbuff.h +++ b/sys/compat/linuxkpi/common/include/linux/skbuff.h @@ -231,7 +231,8 @@ static inline void dev_kfree_skb_irq(struct sk_buff *skb) { SKB_TRACE(skb); - SKB_TODO(); + SKB_IMPROVE("Do we have to defer this?"); + dev_kfree_skb(skb); } /* -------------------------------------------------------------------------- */ @@ -331,6 +332,8 @@ skb_put(struct sk_buff *skb, size_t len) skb, skb->tail, len, skb->end, skb->head, skb->data, skb->len)); s = skb_tail_pointer(skb); + if (len == 0) + return (s); skb->tail += len; skb->len += len; #ifdef SKB_DEBUG @@ -350,6 +353,8 @@ skb_put_data(struct sk_buff *skb, const void *buf, size_t len) SKB_TRACE2(skb, buf); s = skb_put(skb, len); + if (len == 0) + return (s); memcpy(s, buf, len); return (s); } @@ -752,7 +757,7 @@ static inline bool skb_is_gso(struct sk_buff *skb) { SKB_TRACE(skb); - SKB_TODO(); + SKB_IMPROVE("Really a TODO but get it away from logging"); return (false); } |