git: 952643ea4526 - main - LinuxKPI: skbuff: dev_kfree_skb_irq() and improvements
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 15 Apr 2022 15:56:49 UTC
The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=952643ea452655a8e80d1b5e1cc2cae35cb73870 commit 952643ea452655a8e80d1b5e1cc2cae35cb73870 Author: Bjoern A. Zeeb <bz@FreeBSD.org> AuthorDate: 2022-04-15 12:25:39 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> CommitDate: 2022-04-15 15:54:03 +0000 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 --- sys/compat/linuxkpi/common/include/linux/skbuff.h | 9 +++++++-- 1 file 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); }