]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
net: skbuff: hide wifi_acked when CONFIG_WIRELESS not set
authorJakub Kicinski <kuba@kernel.org>
Mon, 17 Apr 2023 15:53:46 +0000 (08:53 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Apr 2023 12:04:30 +0000 (13:04 +0100)
Datacenter kernel builds will very likely not include WIRELESS,
so let them shave 2 bits off the skb by hiding the wifi fields.

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/skbuff.h
include/net/sock.h
net/core/skbuff.c
net/socket.c

index a823ec3aa32629aa3d5388ed24113b28a6e9146e..513f03b23a73925a5438fb355751d338f0953cf5 100644 (file)
@@ -953,8 +953,10 @@ struct sk_buff {
 
        __u8                    l4_hash:1;
        __u8                    sw_hash:1;
+#ifdef CONFIG_WIRELESS
        __u8                    wifi_acked_valid:1;
        __u8                    wifi_acked:1;
+#endif
        __u8                    no_fcs:1;
        /* Indicates the inner headers are valid in the skbuff. */
        __u8                    encapsulation:1;
@@ -1187,6 +1189,15 @@ static inline unsigned int skb_napi_id(const struct sk_buff *skb)
 #endif
 }
 
+static inline bool skb_wifi_acked_valid(const struct sk_buff *skb)
+{
+#ifdef CONFIG_WIRELESS
+       return skb->wifi_acked_valid;
+#else
+       return 0;
+#endif
+}
+
 /**
  * skb_unref - decrement the skb's reference count
  * @skb: buffer
index 5edf0038867ce939544a7a22bf4a4ffe23d3b114..8b7ed7167243db4eeb13793a8c465c9392623888 100644 (file)
@@ -2697,7 +2697,7 @@ sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb)
        else
                sock_write_timestamp(sk, kt);
 
-       if (sock_flag(sk, SOCK_WIFI_STATUS) && skb->wifi_acked_valid)
+       if (sock_flag(sk, SOCK_WIFI_STATUS) && skb_wifi_acked_valid(skb))
                __sock_recv_wifi_status(msg, sk, skb);
 }
 
index ef81452759be3fd251faaf76d89cfd002ee79256..768f9d04911fb16a40e057aec7bfa2381a40d7a7 100644 (file)
@@ -5189,6 +5189,7 @@ void skb_tstamp_tx(struct sk_buff *orig_skb,
 }
 EXPORT_SYMBOL_GPL(skb_tstamp_tx);
 
+#ifdef CONFIG_WIRELESS
 void skb_complete_wifi_ack(struct sk_buff *skb, bool acked)
 {
        struct sock *sk = skb->sk;
@@ -5214,6 +5215,7 @@ void skb_complete_wifi_ack(struct sk_buff *skb, bool acked)
                kfree_skb(skb);
 }
 EXPORT_SYMBOL_GPL(skb_complete_wifi_ack);
+#endif /* CONFIG_WIRELESS */
 
 /**
  * skb_partial_csum_set - set up and verify partial csum values for packet
index 73e493da45896a53b30e9e0f8ab84fc494c8b7cd..a7b4b37d86df7a9232d582a14863c05b5fd34b68 100644 (file)
@@ -957,6 +957,7 @@ void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk,
 }
 EXPORT_SYMBOL_GPL(__sock_recv_timestamp);
 
+#ifdef CONFIG_WIRELESS
 void __sock_recv_wifi_status(struct msghdr *msg, struct sock *sk,
        struct sk_buff *skb)
 {
@@ -972,6 +973,7 @@ void __sock_recv_wifi_status(struct msghdr *msg, struct sock *sk,
        put_cmsg(msg, SOL_SOCKET, SCM_WIFI_STATUS, sizeof(ack), &ack);
 }
 EXPORT_SYMBOL_GPL(__sock_recv_wifi_status);
+#endif
 
 static inline void sock_recv_drops(struct msghdr *msg, struct sock *sk,
                                   struct sk_buff *skb)