From nobody Tue May 16 21:27:18 2023 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 4QLTpZ6hNPz4BTnP; Tue, 16 May 2023 21:27:18 +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 4QLTpZ5VBSz4MbJ; Tue, 16 May 2023 21:27:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684272438; 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=8B4lC3m3xFxtYf6wvvBbCPC1sodtDx7cadMMAaPmin4=; b=qeKzIRbe/KQgZ0wqDVylF0VX1oFKCebfGojQm9Qk/kc5HyThUAEDjyxQDXGJU9pqhvSk1c WxqyEtn4j8iA3B0L4SijKrMZ5o5gq3eeTYxn15n8FMcbVHYBp5FgrEjPTsi/Y2OiPOUpKQ AMTTqHu/7OAwvLXo9fmOHcAUupQQ/PwV2OSHb/2WP6wzC4Fbewq3C7zkuUknZMgkWxeVtw up7+58qCt/2RDsJ2nxn5/RBjD7On76jnlztcj+fUrAQo6sonwfjb04BuiRn6lRxgEYQ32k nYcssSZtPogN1Ikc2GxhVAShmhkZJbeTQRPa/nQth6z5dSCNRhyxaPBBGeQoOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684272438; 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=8B4lC3m3xFxtYf6wvvBbCPC1sodtDx7cadMMAaPmin4=; b=XBlRzRi8Fuwq6bxxEzRIOsfNVuvlvwDSaRyOLcbDo17ps8GzMVOZHWV4aCHnJY95zJqh23 BBQYy1SHfduHKWZkJ18Yap04QIh1kAcsoexMafo+VythrmKEmloajiMV0LtrSEU7p/AgtI 255Erzd5rIU5H8P+5MfvXFWtq/0W16wQ/EHuAuLCrJQEDTY1I7/MKVzosv7y6PT+xjjLns Nz6fCT54z6YWxeRS7JeyqqfYL85GwuESw/WvO/uwNCGzGTpNoc4R98PaJtotKnJ8+rCnrB cgiHYHueYboG3RNOjxG3w/I2U4IPPrZ26e64IOxiMv25JXcxosASu4mcso1RvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684272438; a=rsa-sha256; cv=none; b=WnnwXupzBpUt1yhHmYYHhqRlgUIPHLt9dou10WhuRqMvBnzoQHpPcAd/K+FxYbzo1F6zkc 4pXRIqlPgcQvDVx4jrq8Z9Cz5CeJRWp5fWcSu/+mC1rEPSIAlUhDKgkNYDVBnv8JqyesfT Mb8dsCPvpl9vERaX9bBhw0lGkSLkGK3CPjsgYMMfxO/9vjZfA0h0CcH1zk6/hxbUiF1jH0 nHGT+1iWPq2hBJHUR2lR4DUrW+aOqAcsBThdGaskWZuEQF4r9t6F3X5xQxZWqV2jkEjXpv FKjaVjMm0Q+G+kCfFPDR9xlqj3vmcwWKdgoGnLUr2LtCKqscZPfd3L9xCTl8JA== 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 4QLTpZ4PHDzdbV; Tue, 16 May 2023 21:27:18 +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 34GLRIU9004604; Tue, 16 May 2023 21:27:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34GLRIjv004603; Tue, 16 May 2023 21:27:18 GMT (envelope-from git) Date: Tue, 16 May 2023 21:27:18 GMT Message-Id: <202305162127.34GLRIjv004603@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: 262c5e81937f - main - LinuxKPI: skbuff.h: add skb_hwtstamps(), implement *mac_header() 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: 262c5e81937ff1682632f33e92c3e42bc92e5a77 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=262c5e81937ff1682632f33e92c3e42bc92e5a77 commit 262c5e81937ff1682632f33e92c3e42bc92e5a77 Author: Bjoern A. Zeeb AuthorDate: 2023-05-16 21:22:34 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-05-16 21:26:50 +0000 LinuxKPI: skbuff.h: add skb_hwtstamps(), implement *mac_header() Add a dummy skb_hwtstamps() function for now, and implement skb_mac_header(), skb_reset_mac_header(), and skb_set_mac_header(). Sponsored by: The FreeBSD Foundation MFC after: 10 days --- sys/compat/linuxkpi/common/include/linux/skbuff.h | 34 +++++++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/skbuff.h b/sys/compat/linuxkpi/common/include/linux/skbuff.h index fca161537837..cb1e7cef98e0 100644 --- a/sys/compat/linuxkpi/common/include/linux/skbuff.h +++ b/sys/compat/linuxkpi/common/include/linux/skbuff.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2020-2022 The FreeBSD Foundation + * Copyright (c) 2020-2023 The FreeBSD Foundation * Copyright (c) 2021-2022 Bjoern A. Zeeb * * This software was developed by Björn Zeeb under sponsorship from @@ -46,6 +46,7 @@ #include #include #include +#include /* #define SKB_DEBUG */ #ifdef SKB_DEBUG @@ -85,6 +86,10 @@ enum sk_buff_pkt_type { PACKET_OTHERHOST, }; +struct skb_shared_hwtstamps { + ktime_t hwtstamp; +}; + #define NET_SKB_PAD max(CACHE_LINE_SIZE, 32) struct sk_buff_head { @@ -154,6 +159,7 @@ struct sk_buff { uint16_t _flags; /* Internal flags. */ #define _SKB_FLAGS_SKBEXTFRAG 0x0001 enum sk_buff_pkt_type pkt_type; + uint16_t mac_header; /* offset of mac_header */ /* "Scratch" area for layers to store metadata. */ /* ??? I see sizeof() operations so probably an array. */ @@ -928,22 +934,38 @@ skb_header_cloned(struct sk_buff *skb) } static inline uint8_t * -skb_mac_header(struct sk_buff *skb) +skb_mac_header(const struct sk_buff *skb) { SKB_TRACE(skb); - SKB_TODO(); - return (NULL); + /* Make sure the mac_header was set as otherwise we return garbage. */ + WARN_ON(skb->mac_header == 0); + return (skb->head + skb->mac_header); +} +static inline void +skb_reset_mac_header(struct sk_buff *skb) +{ + SKB_TRACE(skb); + skb->mac_header = skb->data - skb->head; } static inline void -skb_orphan(struct sk_buff *skb) +skb_set_mac_header(struct sk_buff *skb, const size_t len) +{ + SKB_TRACE(skb); + skb_reset_mac_header(skb); + skb->mac_header += len; +} + +static inline struct skb_shared_hwtstamps * +skb_hwtstamps(struct sk_buff *skb) { SKB_TRACE(skb); SKB_TODO(); + return (NULL); } static inline void -skb_reset_mac_header(struct sk_buff *skb) +skb_orphan(struct sk_buff *skb) { SKB_TRACE(skb); SKB_TODO();