Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Apr 2024 19:44:00 GMT
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 6b2686ca9bc6 - stable/14 - LinuxKPI: sk_buff: implement skb_queue_splice_tail_init()
Message-ID:  <202404221944.43MJi0JV032162@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=6b2686ca9bc600f6658e9bd02093484a9b5a4fe5

commit 6b2686ca9bc600f6658e9bd02093484a9b5a4fe5
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2024-04-02 09:17:31 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2024-04-22 16:59:54 +0000

    LinuxKPI: sk_buff: implement skb_queue_splice_tail_init()
    
    Implement skb_queue_splice_tail_init() and SKB_DATA_ALIGN() as
    needed by the mt76 wireless driver.
    
    Sponsord by:    The FreeBD Foundation
    Reviewed by:    emaste
    Differential Revision: https://reviews.freebsd.org/D44590
    
    (cherry picked from commit 3d3ec17825a124f0119d76c4d2523d73012fa226)
---
 sys/compat/linuxkpi/common/include/linux/skbuff.h | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/skbuff.h b/sys/compat/linuxkpi/common/include/linux/skbuff.h
index 02190a29e241..ee3f427aa6e9 100644
--- a/sys/compat/linuxkpi/common/include/linux/skbuff.h
+++ b/sys/compat/linuxkpi/common/include/linux/skbuff.h
@@ -89,6 +89,7 @@ struct skb_shared_hwtstamps {
 };
 
 #define	NET_SKB_PAD		max(CACHE_LINE_SIZE, 32)
+#define	SKB_DATA_ALIGN(_x)	roundup2(_x, CACHE_LINE_SIZE)
 
 struct sk_buff_head {
 		/* XXX TODO */
@@ -824,7 +825,7 @@ skb_mark_not_on_list(struct sk_buff *skb)
 }
 
 static inline void
-___skb_queue_splice_init(const struct sk_buff_head *from,
+___skb_queue_splice(const struct sk_buff_head *from,
     struct sk_buff *p, struct sk_buff *n)
 {
 	struct sk_buff *b, *e;
@@ -847,7 +848,21 @@ skb_queue_splice_init(struct sk_buff_head *from, struct sk_buff_head *to)
 	if (skb_queue_empty(from))
 		return;
 
-	___skb_queue_splice_init(from, (struct sk_buff *)to, to->next);
+	___skb_queue_splice(from, (struct sk_buff *)to, to->next);
+	to->qlen += from->qlen;
+	__skb_queue_head_init(from);
+}
+
+static inline void
+skb_queue_splice_tail_init(struct sk_buff_head *from, struct sk_buff_head *to)
+{
+
+	SKB_TRACE2(from, to);
+
+	if (skb_queue_empty(from))
+		return;
+
+	___skb_queue_splice(from, to->prev, (struct sk_buff *)to);
 	to->qlen += from->qlen;
 	__skb_queue_head_init(from);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202404221944.43MJi0JV032162>