All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net/gtp: Add udp source port generation according to flow hash
@ 2017-02-16 14:59 Or Gerlitz
  2017-02-16 21:58 ` Andreas Schultz
  0 siblings, 1 reply; 18+ messages in thread
From: Or Gerlitz @ 2017-02-16 14:59 UTC (permalink / raw)
  To: David S. Miller
  Cc: Jamal Hadi Salim, Pablo Neira Ayuso, laforge, netdev, Or Gerlitz

Generate the source udp header according to the flow represented by
the packet we are encapsulating, as done for other udp tunnels. This
helps on the receiver side to apply RSS spreading.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
---

found in code inspection.. compile tested only


 drivers/net/gtp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
index bda0c64..ff1244b 100644
--- a/drivers/net/gtp.c
+++ b/drivers/net/gtp.c
@@ -564,6 +564,7 @@ static netdev_tx_t gtp_dev_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	unsigned int proto = ntohs(skb->protocol);
 	struct gtp_pktinfo pktinfo;
+	__be16 src_port;
 	int err;
 
 	/* Ensure there is sufficient headroom. */
@@ -572,6 +573,8 @@ static netdev_tx_t gtp_dev_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	skb_reset_inner_headers(skb);
 
+	src_port = udp_flow_src_port(dev_net(dev), skb, 0, 0, true);
+
 	/* PDP context lookups in gtp_build_skb_*() need rcu read-side lock. */
 	rcu_read_lock();
 	switch (proto) {
@@ -596,7 +599,7 @@ static netdev_tx_t gtp_dev_xmit(struct sk_buff *skb, struct net_device *dev)
 				    pktinfo.iph->tos,
 				    ip4_dst_hoplimit(&pktinfo.rt->dst),
 				    0,
-				    pktinfo.gtph_port, pktinfo.gtph_port,
+				    src_port, pktinfo.gtph_port,
 				    true, false);
 		break;
 	}
-- 
2.3.7

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2017-03-15 16:25 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-16 14:59 [PATCH net-next] net/gtp: Add udp source port generation according to flow hash Or Gerlitz
2017-02-16 21:58 ` Andreas Schultz
2017-02-22 21:29   ` Or Gerlitz
2017-02-22 21:47     ` Tom Herbert
2017-02-23  9:35       ` Andreas Schultz
2017-02-23 14:00         ` Pablo Neira Ayuso
2017-02-23 16:35           ` Tom Herbert
2017-02-23 16:50             ` Harald Welte
2017-02-23 17:01               ` David Miller
2017-02-23 13:49       ` Pablo Neira Ayuso
2017-02-23 13:58         ` Or Gerlitz
2017-02-23 14:21         ` Andreas Schultz
2017-02-23 16:42           ` Pablo Neira Ayuso
2017-02-23 17:19             ` Andreas Schultz
2017-02-23 17:54               ` David Miller
2017-03-15 16:14                 ` Or Gerlitz
2017-03-15 16:25                   ` Pablo Neira Ayuso
2017-02-23 16:42           ` Tom Herbert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.