[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210627075740.68554-1-xiangxia.m.yue@gmail.com>
Date: Sun, 27 Jun 2021 15:57:40 +0800
From: Tonghao Zhang <xiangxia.m.yue@...il.com>
To: netdev@...r.kernel.org
Cc: Tonghao Zhang <xiangxia.m.yue@...il.com>
Subject: [PATCH net-next] udp: allow changing mapping of a socket to queue
There are many containers running on host. These containers
share the host resources(e.g. netdev rx/tx queue). For isolating
tx/rx queue, when the process migrated to other cpu, we hope
this process will use tx/rx queue mapped to this cpu.
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@...il.com>
---
net/ipv4/udp.c | 2 ++
net/ipv4/udp_offload.c | 4 ++++
2 files changed, 6 insertions(+)
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 15f5504adf5b..72104c45e6b4 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -950,6 +950,8 @@ static int udp_send_skb(struct sk_buff *skb, struct flowi4 *fl4,
uh->check = CSUM_MANGLED_0;
send:
+ /* pick tx queue for this skb list. */
+ skb->ooo_okay = true;
err = ip_send_skb(sock_net(sk), skb);
if (err) {
if (err == -ENOBUFS && !inet->recverr) {
diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c
index 54e06b88af69..62683efca647 100644
--- a/net/ipv4/udp_offload.c
+++ b/net/ipv4/udp_offload.c
@@ -269,6 +269,7 @@ struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb,
struct udphdr *uh;
unsigned int mss;
bool copy_dtor;
+ bool ooo_okay;
__sum16 check;
__be16 newlen;
@@ -286,6 +287,8 @@ struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb,
if (copy_dtor)
gso_skb->destructor = NULL;
+ ooo_okay = gso_skb->ooo_okay;
+ gso_skb->ooo_okay = 0;
segs = skb_segment(gso_skb, features);
if (IS_ERR_OR_NULL(segs)) {
if (copy_dtor)
@@ -293,6 +296,7 @@ struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb,
return segs;
}
+ segs->ooo_okay = ooo_okay;
/* GSO partial and frag_list segmentation only requires splitting
* the frame into an MSS multiple and possibly a remainder, both
* cases return a GSO skb. So update the mss now.
--
2.27.0
Powered by blists - more mailing lists