From nobody Fri Jul 29 16:17:06 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4LvXhy6LXQz4Xddj; Fri, 29 Jul 2022 16:17:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LvXhy5rwfz3Y2y; Fri, 29 Jul 2022 16:17:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659111426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bUphY0RvhEEJU/GRXWlBg2cIRQ3Y4NorzOcHteu5OyE=; b=IsnEuMFTPRa4esY65NkQp6glIk1xbAptU9RsSk4pu9EXtgdnbnnliehBJ3GzZkbdC7P3Ye OC9OP4D/DGEsvLZAaPRfig+3bIs4LEdIgtaBKYqgryuNDB7r/P+n4xY2cWSx0n5bFw4FIH 8XrhSKp+my9VWHLgoB02P2embMbscS6S151/fLTsTdhOndZNJooVffaGkADLqTdhn1u6Qw O+fbkAta9IfzvSpwRRTyIefSoeWd9rldYdYWbo7FA046iy9OWjOCf3xI2sBmRpM/UeRpX5 Cp+LH1HgOefW/9uu+0IgggItTE+SLCqNipy8s3FaH2ltyWmu6uoJ41UcvBoXyQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4LvXhy4VjSzhZ6; Fri, 29 Jul 2022 16:17:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26TGH6Gp019636; Fri, 29 Jul 2022 16:17:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26TGH6dY019635; Fri, 29 Jul 2022 16:17:06 GMT (envelope-from git) Date: Fri, 29 Jul 2022 16:17:06 GMT Message-Id: <202207291617.26TGH6dY019635@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 89c32dafa560 - main - LinuxKPI: skbuff: sort list header and add new (dummy) functions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 89c32dafa560fe0e0259f14185ceefbcee3dcec6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659111426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bUphY0RvhEEJU/GRXWlBg2cIRQ3Y4NorzOcHteu5OyE=; b=K0DHW/HJxjvp4YWY+XnLuHHFWaHPWVJH3ZtwvDvp3TAsKGaHCkPplB1VYIhFi8Yi/kl3rY LJM6e1KcpLnvSq/abwHc73WqazrHlA1m1WRJmYGSVxcX93rMAM7lzfroTJn+2cPZS/fmMT XNOpfQr598Kb9uM79PCtRqX0JeGZoc0heu6Z1Vp2QafZRzsLQU8rgL69FPHZNjq34DN7mZ MhtKg/K4hVkkJbCSzEEkjLBSkG7cy5sLHhVjjfgrQDlAc6umWCSJ7NiY/IBaV+J1+HCIym AHKjLELtGZbU8pe3QmR4klA89/hDSTC5tGmioz//bXDlNggTaHOMz1/4xQO3zQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659111426; a=rsa-sha256; cv=none; b=HFQeGLErgr+NduPsQyHtfpnzAYH76cKaX80Qu/LNfffff2lYGWY9nsCrx8OldE1XbkskHX UTfLjHTK186FiOqYL7Xp0hPTo+GRyMxOyb3g+7ZiuRA6McHP54C0LWie+YamMYfua1peu0 1W5jJ88KJ5I/VALDT91qXhiYAi2l2mC2ObcgHQCZXxXnmv+bndT97bYL21UFKddxWmCj82 EvpsipycCEUwFcSjlP7fLXtjNp6i0XV0klpPiGmvgaCokea4fF/wEmOILKYuxmZyznOlRK ySRiYK3jgH+GDsnaVYQ7v9qhIkSDHsfWQIQl+k8LOC3EPQ2Wz5ibHiyG46Wbgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=89c32dafa560fe0e0259f14185ceefbcee3dcec6 commit 89c32dafa560fe0e0259f14185ceefbcee3dcec6 Author: Bjoern A. Zeeb AuthorDate: 2022-07-29 15:21:48 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-07-29 15:21:48 +0000 LinuxKPI: skbuff: sort list header and add new (dummy) functions While working on new and updates to drivers more skbuff changes came up. Sort out the list/prev/next header problem and add more (so far dummy) functions needed. MFC after: 1 week --- sys/compat/linuxkpi/common/include/linux/skbuff.h | 86 +++++++++++++++++++++-- sys/compat/linuxkpi/common/src/linux_skbuff.c | 2 +- 2 files changed, 80 insertions(+), 8 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/skbuff.h b/sys/compat/linuxkpi/common/include/linux/skbuff.h index 3caf7059dd15..d3a795344f86 100644 --- a/sys/compat/linuxkpi/common/include/linux/skbuff.h +++ b/sys/compat/linuxkpi/common/include/linux/skbuff.h @@ -124,11 +124,15 @@ struct skb_shared_info { }; struct sk_buff { - /* XXX TODO */ - /* struct sk_buff_head */ - struct sk_buff *next; - struct sk_buff *prev; - int list; /* XXX TYPE */ + /* XXX TODO */ + union { + /* struct sk_buff_head */ + struct { + struct sk_buff *next; + struct sk_buff *prev; + }; + struct list_head list; + }; uint32_t _alloc_len; /* Length of alloc data-buf. XXX-BZ give up for truesize? */ uint32_t len; /* ? */ uint32_t data_len; /* ? If we have frags? */ @@ -266,7 +270,7 @@ skb_reserve(struct sk_buff *skb, size_t len) * front to copy data in (manually). */ static inline void * -skb_push(struct sk_buff *skb, size_t len) +__skb_push(struct sk_buff *skb, size_t len) { SKB_TRACE(skb); KASSERT(((skb->data - len) >= skb->head), ("%s: skb %p (data %p - " @@ -276,6 +280,14 @@ skb_push(struct sk_buff *skb, size_t len) return (skb->data); } +static inline void * +skb_push(struct sk_buff *skb, size_t len) +{ + + SKB_TRACE(skb); + return (__skb_push(skb, len)); +} + /* * Length of the data on the skb (without any frags)??? */ @@ -324,7 +336,7 @@ skb_headroom(struct sk_buff *skb) * the end to copy data in (manually). See also skb_put_data() below. */ static inline void * -skb_put(struct sk_buff *skb, size_t len) +__skb_put(struct sk_buff *skb, size_t len) { void *s; @@ -347,6 +359,14 @@ skb_put(struct sk_buff *skb, size_t len) return (s); } +static inline void * +skb_put(struct sk_buff *skb, size_t len) +{ + + SKB_TRACE(skb); + return (__skb_put(skb, len)); +} + /* skb_put() + copying data in. */ static inline void * skb_put_data(struct sk_buff *skb, const void *buf, size_t len) @@ -749,6 +769,13 @@ skb_frag_address(const skb_frag_t *frag) return (NULL); } +static inline void +skb_free_frag(void *frag) +{ + + SKB_TODO(); +} + static inline struct sk_buff * skb_gso_segment(struct sk_buff *skb, netdev_features_t netdev_flags) { @@ -938,4 +965,49 @@ skb_copy_from_linear_data(const struct sk_buff *skb, void *dst, size_t len) memcpy(dst, skb->data, len); } +static inline struct sk_buff * +build_skb(void *data, unsigned int fragsz) +{ + + SKB_TODO(); + return (NULL); +} + +static inline int +skb_pad(struct sk_buff *skb, int pad) +{ + + SKB_TRACE(skb); + SKB_TODO(); + return (-1); +} + +static inline void +skb_list_del_init(struct sk_buff *skb) +{ + + SKB_TRACE(skb); + SKB_TODO(); +} + +static inline void +napi_consume_skb(struct sk_buff *skb, int budget) +{ + + SKB_TRACE(skb); + SKB_TODO(); +} + +static inline bool +skb_linearize(struct sk_buff *skb) +{ + + SKB_TRACE(skb); + SKB_TODO(); + return (false); +} + +#define SKB_WITH_OVERHEAD(_s) \ + (_s) - ALIGN(sizeof(struct skb_shared_info), CACHE_LINE_SIZE) + #endif /* _LINUXKPI_LINUX_SKBUFF_H */ diff --git a/sys/compat/linuxkpi/common/src/linux_skbuff.c b/sys/compat/linuxkpi/common/src/linux_skbuff.c index fb0fcaf99239..df8e3fda8d56 100644 --- a/sys/compat/linuxkpi/common/src/linux_skbuff.c +++ b/sys/compat/linuxkpi/common/src/linux_skbuff.c @@ -258,7 +258,7 @@ DB_SHOW_COMMAND(skb, db_show_skb) db_printf("skb %p\n", skb); db_printf("\tnext %p prev %p\n", skb->next, skb->prev); - db_printf("\tlist %d\n", skb->list); + db_printf("\tlist %p\n", &skb->list); db_printf("\t_alloc_len %u len %u data_len %u truesize %u mac_len %u\n", skb->_alloc_len, skb->len, skb->data_len, skb->truesize, skb->mac_len);