From nobody Wed Sep 21 14:01:12 2022 X-Original-To: dev-commits-src-all@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 4MXg7D5tZdz4cY05; Wed, 21 Sep 2022 14:01:12 +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 4MXg7D2TwNz485X; Wed, 21 Sep 2022 14:01:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663768872; 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=qNlEcuacAJt5iatYM94+U6+9B9klTGM1VXl5zg0jdIM=; b=dRL5J/lZ0W99NtIYtgTh29jciLWd5iFzA41nrBRJVcULwWITC0n4P/6giymLZAdHDSz6Uw DvZOKN1ZtwlDnl+bZjnKaaMUnZrtjpn2FAI/J29b1eIN+MRpStWpgRk/raDEJSLHwicVun 5CxJ8g+dOSSN3e6OLEKb1iCbJEWdt46nPW1t6M2yxGC9ATXPoh9d5Qf4a0/P39ivwXHkSR aPUgu2s8VqZu9pNMHbahUE7HcllfhNq0XWngr7+2mPpfgaWFx7TGe8Gs/efjbUmEP4ri7c xXYBdwW5of9MCej3DNYwDg8gQSgy4Mf3u/wAqQk4E59GoqAUS+3jRdBjlB06Ag== 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 4MXg7D1bYsz14mX; Wed, 21 Sep 2022 14:01:12 +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 28LE1COi099732; Wed, 21 Sep 2022 14:01:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28LE1CW0099731; Wed, 21 Sep 2022 14:01:12 GMT (envelope-from git) Date: Wed, 21 Sep 2022 14:01:12 GMT Message-Id: <202209211401.28LE1CW0099731@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 6145d25fa01b - stable/13 - LinuxKPI: skbuff: sort list header and add new (dummy) functions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6145d25fa01b0478cf9fef3adcfad7600064068c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663768872; 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=qNlEcuacAJt5iatYM94+U6+9B9klTGM1VXl5zg0jdIM=; b=c1YQUigWgz6CSFe2rtaAqyVhPvvYca/oKxeqPO+cdKMMt9DzIh81Mnt8Y5sn2vTDy+YzVG hBB4FcQeTt/X4ZiY76Y7dq4lhq3b86dyPbab6xiyeTZ3L9tGF1KrTyTMuYHbRSKyDNJDXT wDqZKS4elrz0oqxJ7UCfWOd5JGBE9SfaVlS8OC0FG1e2RaS0ZnNQTf/PZRoVLGym10Gl5c b0MWFRe3QXTevdavWXtCcztLWV+VNLujck1c0q0dloMa8AndCT4Wtow2NyW8D7Xeo6NSDj UUkAkFx9ZD+zxThxHyiyiuLAl1o6gLp9RhHSDscPMDxR/XejiryUb4z4XguAeg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1663768872; a=rsa-sha256; cv=none; b=kDYvpdLcQRZyOVQd4Rwn/gY2aJzjjbG4eIDYVg8gRwr9o7qPL+lEbx8OekXMIIeC3dLJ3y S2vFk8Ybb09IVN16n8xz3wXUrXHSYiSwNOPWASBQWMhwFRi40IxoP9Zv3GrEW+fYL5mm1X F0O1dcx6llv7Qxp5SwP0Zci3H9zgGibt1wAaceo4KbyT2MwrEP+aZZHbMP4ckPGZB88Syf VzJhSrP/GxKnGKHVyDsyg2Hw/vJ0pcEqXQ9skKCDcp49cZ36xr6lVQwwP4X0pYO0vN1qkw BepfPRKS1y6bGqb4FJK6IaFVUaC6ZxZ9y5d7vop/6HobPkAOSfv/5NVmhOhZZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=6145d25fa01b0478cf9fef3adcfad7600064068c commit 6145d25fa01b0478cf9fef3adcfad7600064068c Author: Bjoern A. Zeeb AuthorDate: 2022-07-29 15:21:48 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-09-21 11:40:04 +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. (cherry picked from commit 89c32dafa560fe0e0259f14185ceefbcee3dcec6) --- 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);