netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Herbert <tom@herbertland.com>
To: davem@davemloft.net, kuba@kernel.org, edumazet@google.com,
	netdev@vger.kernel.org, felipe@sipanda.io
Cc: Tom Herbert <tom@herbertland.com>
Subject: [PATCH 01/12] skbuff: Unconstantify struct net argument in flowdis functions
Date: Wed, 31 Jul 2024 10:23:21 -0700	[thread overview]
Message-ID: <20240731172332.683815-2-tom@herbertland.com> (raw)
In-Reply-To: <20240731172332.683815-1-tom@herbertland.com>

We want __skb_flow_dissect to be able to call functions that
take a non-constant struct net argument (UDP socket lookup
functions for instance). Change the net argument of flow dissector
functions to not be const

Signed-off-by: Tom Herbert <tom@herbertland.com>
---
 include/linux/skbuff.h    | 10 +++++-----
 net/core/flow_dissector.c |  6 +++---
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 29c3ea5b6e93..a0b5687fa49c 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1504,14 +1504,14 @@ __skb_set_sw_hash(struct sk_buff *skb, __u32 hash, bool is_l4)
 	__skb_set_hash(skb, hash, true, is_l4);
 }
 
-u32 __skb_get_hash_symmetric_net(const struct net *net, const struct sk_buff *skb);
+u32 __skb_get_hash_symmetric_net(struct net *net, const struct sk_buff *skb);
 
 static inline u32 __skb_get_hash_symmetric(const struct sk_buff *skb)
 {
 	return __skb_get_hash_symmetric_net(NULL, skb);
 }
 
-void __skb_get_hash_net(const struct net *net, struct sk_buff *skb);
+void __skb_get_hash_net(struct net *net, struct sk_buff *skb);
 u32 skb_get_poff(const struct sk_buff *skb);
 u32 __skb_get_poff(const struct sk_buff *skb, const void *data,
 		   const struct flow_keys_basic *keys, int hlen);
@@ -1532,7 +1532,7 @@ struct bpf_flow_dissector;
 u32 bpf_flow_dissect(struct bpf_prog *prog, struct bpf_flow_dissector *ctx,
 		     __be16 proto, int nhoff, int hlen, unsigned int flags);
 
-bool __skb_flow_dissect(const struct net *net,
+bool __skb_flow_dissect(struct net *net,
 			const struct sk_buff *skb,
 			struct flow_dissector *flow_dissector,
 			void *target_container, const void *data,
@@ -1556,7 +1556,7 @@ static inline bool skb_flow_dissect_flow_keys(const struct sk_buff *skb,
 }
 
 static inline bool
-skb_flow_dissect_flow_keys_basic(const struct net *net,
+skb_flow_dissect_flow_keys_basic(struct net *net,
 				 const struct sk_buff *skb,
 				 struct flow_keys_basic *flow,
 				 const void *data, __be16 proto,
@@ -1590,7 +1590,7 @@ void skb_flow_dissect_hash(const struct sk_buff *skb,
 			   struct flow_dissector *flow_dissector,
 			   void *target_container);
 
-static inline __u32 skb_get_hash_net(const struct net *net, struct sk_buff *skb)
+static inline __u32 skb_get_hash_net(struct net *net, struct sk_buff *skb)
 {
 	if (!skb->l4_hash && !skb->sw_hash)
 		__skb_get_hash_net(net, skb);
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index 0e638a37aa09..e034e502ab49 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -1045,7 +1045,7 @@ static bool is_pppoe_ses_hdr_valid(const struct pppoe_hdr *hdr)
  *
  * Caller must take care of zeroing target container memory.
  */
-bool __skb_flow_dissect(const struct net *net,
+bool __skb_flow_dissect(struct net *net,
 			const struct sk_buff *skb,
 			struct flow_dissector *flow_dissector,
 			void *target_container, const void *data,
@@ -1854,7 +1854,7 @@ EXPORT_SYMBOL(make_flow_keys_digest);
 
 static struct flow_dissector flow_keys_dissector_symmetric __read_mostly;
 
-u32 __skb_get_hash_symmetric_net(const struct net *net, const struct sk_buff *skb)
+u32 __skb_get_hash_symmetric_net(struct net *net, const struct sk_buff *skb)
 {
 	struct flow_keys keys;
 
@@ -1878,7 +1878,7 @@ EXPORT_SYMBOL_GPL(__skb_get_hash_symmetric_net);
  * on success, zero indicates no valid hash.  Also, sets l4_hash in skb
  * if hash is a canonical 4-tuple hash over transport ports.
  */
-void __skb_get_hash_net(const struct net *net, struct sk_buff *skb)
+void __skb_get_hash_net(struct net *net, struct sk_buff *skb)
 {
 	struct flow_keys keys;
 	u32 hash;
-- 
2.34.1


  reply	other threads:[~2024-07-31 17:23 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-31 17:23 [PATCH 00/12] flow_dissector: Dissect UDP encapsulation protocols Tom Herbert
2024-07-31 17:23 ` Tom Herbert [this message]
2024-08-01 13:13   ` [PATCH 01/12] skbuff: Unconstantify struct net argument in flowdis functions Willem de Bruijn
2024-08-02 13:33   ` Eric Dumazet
2024-08-15 18:50     ` Tom Herbert
2024-08-15 19:42       ` Tom Herbert
2024-07-31 17:23 ` [PATCH 02/12] flow_dissector: Parse ETH_P_TEB Tom Herbert
2024-08-01 13:12   ` Willem de Bruijn
2024-07-31 17:23 ` [PATCH 03/12] flow_dissector: Move ETH_P_TEB out of GRE Tom Herbert
2024-08-01 13:13   ` Willem de Bruijn
2024-07-31 17:23 ` [PATCH 04/12] udp_encaps: Add new UDP_ENCAP constants Tom Herbert
2024-08-01 13:22   ` Willem de Bruijn
2024-08-15 18:52     ` Tom Herbert
2024-07-31 17:23 ` [PATCH 05/12] udp_encaps: Set proper UDP_ENCAP types in tunnel setup Tom Herbert
2024-08-01 13:33   ` Willem de Bruijn
2024-07-31 17:23 ` [PATCH 06/12] flow_dissector: UDP encap infrastructure Tom Herbert
2024-08-01 13:58   ` Willem de Bruijn
2024-08-02 12:29   ` kernel test robot
2024-08-02 13:00   ` kernel test robot
2024-07-31 17:23 ` [PATCH 07/12] flow_dissector: Parse vxlan in UDP Tom Herbert
2024-08-01 18:22   ` Simon Horman
2024-08-03  3:26   ` kernel test robot
2024-07-31 17:23 ` [PATCH 08/12] flow_dissector: Parse foo-over-udp (FOU) Tom Herbert
2024-08-01 14:03   ` Willem de Bruijn
2024-07-31 17:23 ` [PATCH 09/12] flow_dissector: Parse ESP, L2TP, and SCTP in UDP Tom Herbert
2024-07-31 17:23 ` [PATCH 10/12] flow_dissector: Parse Geneve " Tom Herbert
2024-08-03 19:13   ` Willem de Bruijn
2024-08-03 19:19     ` Willem de Bruijn
2024-08-15 20:03     ` Tom Herbert
2024-07-31 17:23 ` [PATCH 11/12] flow_dissector: Parse GUE " Tom Herbert
2024-07-31 17:23 ` [PATCH 12/12] flow_dissector: Parse gtp " Tom Herbert
2024-08-03 19:30   ` Willem de Bruijn
2024-08-01 13:20 ` [PATCH 00/12] flow_dissector: Dissect UDP encapsulation protocols Willem de Bruijn
2024-08-14 20:28   ` Tom Herbert
2024-08-14 20:37     ` Tom Herbert
2024-08-01 16:16 ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240731172332.683815-2-tom@herbertland.com \
    --to=tom@herbertland.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=felipe@sipanda.io \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).