All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net v2 1/1] tipc: move fragment importance field to new header position
@ 2015-10-14 13:23 Jon Maloy
  2015-10-15  2:11 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jon Maloy @ 2015-10-14 13:23 UTC (permalink / raw)
  To: davem
  Cc: netdev, Paul Gortmaker, parthasarathy.xx.bhuvaragan,
	richard.alpe, ying.xue, maloy, tipc-discussion, Jon Maloy

In commit e3eea1eb47a ("tipc: clean up handling of message priorities")
we introduced a field in the packet header for keeping track of the
priority of fragments, since this value is not present in the specified
protocol header. Since the value so far only is used at the transmitting
end of the link, we have not yet officially defined it as part of the
protocol.

Unfortunately, the field we use for keeping this value, bits 13-15 in
in word 5, has turned out to be a poor choice; it is already used by the
broadcast protocol for carrying the 'network id' field of the sending
node. Since packet fragments also need to be transported across the
broadcast protocol, the risk of conflict is obvious, and we see this
happen when we use network identities larger than 2^13-1. This has
escaped our testing because we have so far only been using small network
id values.

We now move this field to bits 0-2 in word 9, a field that is guaranteed
to be unused by all involved protocols.

Fixes: e3eea1eb47a ("tipc: clean up handling of message priorities")
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Acked-by: Ying Xue <ying.xue@windriver.com>
---
 net/tipc/msg.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/tipc/msg.h b/net/tipc/msg.h
index a82c584..5351a3f 100644
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -357,7 +357,7 @@ static inline u32 msg_importance(struct tipc_msg *m)
 	if (likely((usr <= TIPC_CRITICAL_IMPORTANCE) && !msg_errcode(m)))
 		return usr;
 	if ((usr == MSG_FRAGMENTER) || (usr == MSG_BUNDLER))
-		return msg_bits(m, 5, 13, 0x7);
+		return msg_bits(m, 9, 0, 0x7);
 	return TIPC_SYSTEM_IMPORTANCE;
 }
 
@@ -366,7 +366,7 @@ static inline void msg_set_importance(struct tipc_msg *m, u32 i)
 	int usr = msg_user(m);
 
 	if (likely((usr == MSG_FRAGMENTER) || (usr == MSG_BUNDLER)))
-		msg_set_bits(m, 5, 13, 0x7, i);
+		msg_set_bits(m, 9, 0, 0x7, i);
 	else if (i < TIPC_SYSTEM_IMPORTANCE)
 		msg_set_user(m, i);
 	else
-- 
1.9.1

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

* Re: [PATCH net v2 1/1] tipc: move fragment importance field to new header position
  2015-10-14 13:23 [PATCH net v2 1/1] tipc: move fragment importance field to new header position Jon Maloy
@ 2015-10-15  2:11 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-10-15  2:11 UTC (permalink / raw)
  To: jon.maloy
  Cc: netdev, paul.gortmaker, parthasarathy.xx.bhuvaragan,
	richard.alpe, ying.xue, maloy, tipc-discussion

From: Jon Maloy <jon.maloy@ericsson.com>
Date: Wed, 14 Oct 2015 09:23:18 -0400

> In commit e3eea1eb47a ("tipc: clean up handling of message priorities")
> we introduced a field in the packet header for keeping track of the
> priority of fragments, since this value is not present in the specified
> protocol header. Since the value so far only is used at the transmitting
> end of the link, we have not yet officially defined it as part of the
> protocol.
> 
> Unfortunately, the field we use for keeping this value, bits 13-15 in
> in word 5, has turned out to be a poor choice; it is already used by the
> broadcast protocol for carrying the 'network id' field of the sending
> node. Since packet fragments also need to be transported across the
> broadcast protocol, the risk of conflict is obvious, and we see this
> happen when we use network identities larger than 2^13-1. This has
> escaped our testing because we have so far only been using small network
> id values.
> 
> We now move this field to bits 0-2 in word 9, a field that is guaranteed
> to be unused by all involved protocols.
> 
> Fixes: e3eea1eb47a ("tipc: clean up handling of message priorities")
> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
> Acked-by: Ying Xue <ying.xue@windriver.com>

Applied and queued up for -stable, thanks.

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

end of thread, other threads:[~2015-10-15  1:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-14 13:23 [PATCH net v2 1/1] tipc: move fragment importance field to new header position Jon Maloy
2015-10-15  2:11 ` David Miller

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.