* [B.A.T.M.A.N.] [PATCH 0/2] Fragments and QoS
@ 2016-05-09 18:03 Andrew Lunn
2016-05-09 18:03 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Set skb priority in fragments Andrew Lunn
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Andrew Lunn @ 2016-05-09 18:03 UTC (permalink / raw)
To: B.A.T.M.A.N
BATMAN currently does not allow QoS policies to be used with
fragmented packets. The first patch copies the skb priority from the
unfragmented packet into the fragments as they are built, so the lower
layers can then prioritise as appropriated.
The second patch places the priority into the fragment header, and
upon reception of a fragment, copies it into the skb priority, so that
when the fragment is retransmitted, it is correctly prioritised.
Andrew Lunn (2):
batman-adv: Set skb priority in fragments
batman-adv: Include frame priority in fragment header
net/batman-adv/fragmentation.c | 4 +++-
net/batman-adv/packet.h | 7 +++++--
net/batman-adv/routing.c | 2 ++
3 files changed, 10 insertions(+), 3 deletions(-)
--
2.8.0.rc3
^ permalink raw reply [flat|nested] 7+ messages in thread* [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Set skb priority in fragments 2016-05-09 18:03 [B.A.T.M.A.N.] [PATCH 0/2] Fragments and QoS Andrew Lunn @ 2016-05-09 18:03 ` Andrew Lunn 2016-05-11 6:21 ` Sven Eckelmann 2016-05-11 8:06 ` Marek Lindner 2016-05-09 18:03 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Include frame priority in fragment header Andrew Lunn 2016-05-10 14:23 ` [B.A.T.M.A.N.] [PATCH 0/2] Fragments and QoS Simon Wunderlich 2 siblings, 2 replies; 7+ messages in thread From: Andrew Lunn @ 2016-05-09 18:03 UTC (permalink / raw) To: B.A.T.M.A.N BATMAN will set the skb->priority based on the IP precedence or 802.1q tag. However, if it needs to fragment the frame, it currently leaves the fragment skb with the default priority and actually overwrites the priority in the unfragmented frame. Fix this. Signed-off-by: Andrew Lunn <andrew@lunn.ch> --- net/batman-adv/fragmentation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c index 65536db..a3fefbd 100644 --- a/net/batman-adv/fragmentation.c +++ b/net/batman-adv/fragmentation.c @@ -414,7 +414,7 @@ static struct sk_buff *batadv_frag_create(struct sk_buff *skb, if (!skb_fragment) goto err; - skb->priority = TC_PRIO_CONTROL; + skb_fragment->priority = skb->priority; /* Eat the last mtu-bytes of the skb */ skb_reserve(skb_fragment, header_size + ETH_HLEN); -- 2.8.0.rc3 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Set skb priority in fragments 2016-05-09 18:03 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Set skb priority in fragments Andrew Lunn @ 2016-05-11 6:21 ` Sven Eckelmann 2016-05-11 8:06 ` Marek Lindner 1 sibling, 0 replies; 7+ messages in thread From: Sven Eckelmann @ 2016-05-11 6:21 UTC (permalink / raw) To: b.a.t.m.a.n [-- Attachment #1: Type: text/plain, Size: 1093 bytes --] On Monday 09 May 2016 20:03:35 Andrew Lunn wrote: > BATMAN will set the skb->priority based on the IP precedence or 802.1q > tag. However, if it needs to fragment the frame, it currently leaves > the fragment skb with the default priority and actually overwrites the > priority in the unfragmented frame. Fix this. > > Signed-off-by: Andrew Lunn <andrew@lunn.ch> > --- > net/batman-adv/fragmentation.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c > index 65536db..a3fefbd 100644 > --- a/net/batman-adv/fragmentation.c > +++ b/net/batman-adv/fragmentation.c > @@ -414,7 +414,7 @@ static struct sk_buff *batadv_frag_create(struct sk_buff *skb, > if (!skb_fragment) > goto err; > > - skb->priority = TC_PRIO_CONTROL; > + skb_fragment->priority = skb->priority; > > /* Eat the last mtu-bytes of the skb */ > skb_reserve(skb_fragment, header_size + ETH_HLEN); > Please remove linux/pkt_sched.h in fragmentation.c because it is only used for TC_PRIO_CONTROL in master. Kind regards, Sven [-- Attachment #2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Set skb priority in fragments 2016-05-09 18:03 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Set skb priority in fragments Andrew Lunn 2016-05-11 6:21 ` Sven Eckelmann @ 2016-05-11 8:06 ` Marek Lindner 1 sibling, 0 replies; 7+ messages in thread From: Marek Lindner @ 2016-05-11 8:06 UTC (permalink / raw) To: b.a.t.m.a.n [-- Attachment #1: Type: text/plain, Size: 507 bytes --] On Monday, May 09, 2016 20:03:35 Andrew Lunn wrote: > BATMAN will set the skb->priority based on the IP precedence or 802.1q > tag. However, if it needs to fragment the frame, it currently leaves > the fragment skb with the default priority and actually overwrites the > priority in the unfragmented frame. Fix this. > > Signed-off-by: Andrew Lunn <andrew@lunn.ch> > --- > net/batman-adv/fragmentation.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied in revision e374d75. Thanks, Marek [-- Attachment #2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 473 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Include frame priority in fragment header 2016-05-09 18:03 [B.A.T.M.A.N.] [PATCH 0/2] Fragments and QoS Andrew Lunn 2016-05-09 18:03 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Set skb priority in fragments Andrew Lunn @ 2016-05-09 18:03 ` Andrew Lunn 2016-05-12 10:04 ` Marek Lindner 2016-05-10 14:23 ` [B.A.T.M.A.N.] [PATCH 0/2] Fragments and QoS Simon Wunderlich 2 siblings, 1 reply; 7+ messages in thread From: Andrew Lunn @ 2016-05-09 18:03 UTC (permalink / raw) To: B.A.T.M.A.N Unfragmented frames which traverse a node have their skb->priority set by looking at the IP ToS byte, or the 802.1p header. However for fragments this is not possible, only one of the fragments will contain the headers. Instead, place the priority into the fragment header and on receiving a fragment, use this information to set the skb->priority for when the fragment is forwarded. Signed-off-by: Andrew Lunn <andrew@lunn.ch> --- net/batman-adv/fragmentation.c | 2 ++ net/batman-adv/packet.h | 7 +++++-- net/batman-adv/routing.c | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c index a3fefbd..c703767 100644 --- a/net/batman-adv/fragmentation.c +++ b/net/batman-adv/fragmentation.c @@ -473,6 +473,8 @@ bool batadv_frag_send_packet(struct sk_buff *skb, frag_header.reserved = 0; frag_header.no = 0; frag_header.total_size = htons(skb->len); + if (skb->priority >= 256 && skb->priority <= 263) + frag_header.priority = skb->priority - 256; ether_addr_copy(frag_header.orig, primary_if->net_dev->dev_addr); ether_addr_copy(frag_header.dest, orig_node->orig); diff --git a/net/batman-adv/packet.h b/net/batman-adv/packet.h index b45460d..7acc6a2 100644 --- a/net/batman-adv/packet.h +++ b/net/batman-adv/packet.h @@ -384,6 +384,7 @@ struct batadv_unicast_4addr_packet { * @dest: final destination used when routing fragments * @orig: originator of the fragment used when merging the packet * @no: fragment number within this sequence + * @priority: priority of frame, from ToS IP precedence or 802.1p * @reserved: reserved byte for alignment * @seqno: sequence identification * @total_size: size of the merged packet @@ -394,9 +395,11 @@ struct batadv_frag_packet { u8 ttl; #if defined(__BIG_ENDIAN_BITFIELD) u8 no:4; - u8 reserved:4; + u8 priority:3; + u8 reserved:1; #elif defined(__LITTLE_ENDIAN_BITFIELD) - u8 reserved:4; + u8 reserved:1; + u8 priority:3; u8 no:4; #else #error "unknown bitfield endianness" diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index ae850f2..01d36e3 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c @@ -1004,6 +1004,8 @@ int batadv_recv_frag_packet(struct sk_buff *skb, if (!orig_node_src) goto out; + skb->priority = frag_packet->priority + 256; + /* Route the fragment if it is not for us and too big to be merged. */ if (!batadv_is_my_mac(bat_priv, frag_packet->dest) && batadv_frag_skb_fwd(skb, recv_if, orig_node_src)) { -- 2.8.0.rc3 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Include frame priority in fragment header 2016-05-09 18:03 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Include frame priority in fragment header Andrew Lunn @ 2016-05-12 10:04 ` Marek Lindner 0 siblings, 0 replies; 7+ messages in thread From: Marek Lindner @ 2016-05-12 10:04 UTC (permalink / raw) To: b.a.t.m.a.n [-- Attachment #1: Type: text/plain, Size: 728 bytes --] On Monday, May 09, 2016 20:03:36 Andrew Lunn wrote: > Unfragmented frames which traverse a node have their skb->priority set > by looking at the IP ToS byte, or the 802.1p header. However for > fragments this is not possible, only one of the fragments will contain > the headers. Instead, place the priority into the fragment header and > on receiving a fragment, use this information to set the skb->priority > for when the fragment is forwarded. > > Signed-off-by: Andrew Lunn <andrew@lunn.ch> > --- > net/batman-adv/fragmentation.c | 2 ++ > net/batman-adv/packet.h | 7 +++++-- > net/batman-adv/routing.c | 2 ++ > 3 files changed, 9 insertions(+), 2 deletions(-) Applied in revision 4f241fc. Thanks, Marek [-- Attachment #2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 473 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH 0/2] Fragments and QoS 2016-05-09 18:03 [B.A.T.M.A.N.] [PATCH 0/2] Fragments and QoS Andrew Lunn 2016-05-09 18:03 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Set skb priority in fragments Andrew Lunn 2016-05-09 18:03 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Include frame priority in fragment header Andrew Lunn @ 2016-05-10 14:23 ` Simon Wunderlich 2 siblings, 0 replies; 7+ messages in thread From: Simon Wunderlich @ 2016-05-10 14:23 UTC (permalink / raw) To: b.a.t.m.a.n [-- Attachment #1: Type: text/plain, Size: 741 bytes --] On Monday 09 May 2016 20:03:34 Andrew Lunn wrote: > BATMAN currently does not allow QoS policies to be used with > fragmented packets. The first patch copies the skb priority from the > unfragmented packet into the fragments as they are built, so the lower > layers can then prioritise as appropriated. > > The second patch places the priority into the fragment header, and > upon reception of a fragment, copies it into the skb priority, so that > when the fragment is retransmitted, it is correctly prioritised. > > Andrew Lunn (2): > batman-adv: Set skb priority in fragments > batman-adv: Include frame priority in fragment header Series looks good to me. Reviewed-by: Simon Wunderlich <sw@simonwunderlich.de> Thanks, Simon [-- Attachment #2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-05-12 10:04 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-05-09 18:03 [B.A.T.M.A.N.] [PATCH 0/2] Fragments and QoS Andrew Lunn 2016-05-09 18:03 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Set skb priority in fragments Andrew Lunn 2016-05-11 6:21 ` Sven Eckelmann 2016-05-11 8:06 ` Marek Lindner 2016-05-09 18:03 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Include frame priority in fragment header Andrew Lunn 2016-05-12 10:04 ` Marek Lindner 2016-05-10 14:23 ` [B.A.T.M.A.N.] [PATCH 0/2] Fragments and QoS Simon Wunderlich
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox