tipc: fix htmldoc and smatch warnings

2021-03-29 Thread jmaloy
From: Jon Maloy We fix a warning from the htmldoc tool and an indentation error reported by smatch. There are no functional changes in this commit. Signed-off-by: Jon Maloy --- net/tipc/socket.c | 2 +- net/tipc/subscr.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/n

[net-next 16/16] tipc: remove some unnecessary warnings

2021-03-16 Thread jmaloy
From: Jon Maloy We move some warning printouts to more strategic locations to avoid duplicates and yield more detailed information about the reported problem. Signed-off-by: Jon Maloy Acked-by: Ying Xue Acked-by: Hoang Le Acked-by: Tung Nguyen Acked-by: Xin Long --- net/tipc/name_distr.c |

[net-next 15/16] tipc: add host-endian copy of user subscription to struct tipc_subscription

2021-03-16 Thread jmaloy
From: Jon Maloy We reduce and localize the usage of the tipc_sub_xx() macros by adding a corresponding member, with fields set in host-endian format, to struct tipc_subscription. Signed-off-by: Jon Maloy Acked-by: Ying Xue Acked-by: Hoang Le Acked-by: Tung Nguyen Acked-by: Xin Long --- net

[net-next 14/16] tipc: simplify api between binding table and topology server

2021-03-16 Thread jmaloy
From: Jon Maloy The function tipc_report_overlap() is called from the binding table with numerous parameters taken from an instance of struct publication. A closer look reveals that it always is safe to send along a pointer to the instance itself, and hence reduce the call signature. We do that i

[net-next 13/16] tipc: simplify signature of tipc_find_service()

2021-03-16 Thread jmaloy
From: Jon Maloy We reduce the signature of tipc_find_service() and tipc_create_service(). The reason for doing this might not be obvious, but we plan to let struct tipc_uaddr contain information that is relevant for these functions in a later commit. Signed-off-by: Jon Maloy Acked-by: Ying Xue

[net-next 12/16] tipc: simplify signature of tipc_service_find_range()

2021-03-16 Thread jmaloy
From: Jon Maloy We simplify the signatures of the functions tipc_service_create_range() and tipc_service_find_range(). Signed-off-by: Jon Maloy Acked-by: Ying Xue Acked-by: Hoang Le Acked-by: Tung Nguyen Acked-by: Xin Long --- net/tipc/name_table.c | 14 -- 1 file changed, 8 in

[net-next 11/16] tipc: simplify signature of tipc_nametbl_lookup_group()

2021-03-16 Thread jmaloy
From: Jon Maloy We reduce the signature of tipc_nametbl_lookup_group() by using a struct tipc_uaddr pointer. This entails a couple of minor changes in the functions tipc_send_group_mcast/anycast/unicast/bcast() in socket.c Signed-off-by: Jon Maloy Acked-by: Ying Xue Acked-by: Hoang Le Acked-b

[net-next 10/16] tipc: simplify signature of tipc_nametbl_lookup_mcast_nodes()

2021-03-16 Thread jmaloy
From: Jon Maloy We follow up the preceding commits by reducing the signature of the function tipc_nametbl_lookup_mcast_nodes(). Signed-off-by: Jon Maloy Acked-by: Ying Xue Acked-by: Hoang Le Acked-by: Tung Nguyen Acked-by: Xin Long --- net/tipc/name_table.c | 8 net/tipc/name_tab

[net-next 09/16] tipc: simplify signature of tipc_namtbl_lookup_mcast_sockets()

2021-03-16 Thread jmaloy
From: Jon Maloy We reduce the signature of this function according to the same principle as the preceding commits. Signed-off-by: Jon Maloy Acked-by: Ying Xue Acked-by: Hoang Le Acked-by: Tung Nguyen Acked-by: Xin Long --- net/tipc/name_table.c | 10 +- net/tipc/name_table.h | 5 +

[net-next 07/16] tipc: rename binding table lookup functions

2021-03-16 Thread jmaloy
From: Jon Maloy The binding table provides four different lookup functions, which purpose is not obvious neither by their names nor by the (lack of) descriptions. We now give these functions names that better match their purposes, and improve the comments that describe what they are doing. Sign

[net-next 08/16] tipc: refactor tipc_sendmsg() and tipc_lookup_anycast()

2021-03-16 Thread jmaloy
From: Jon Maloy We simplify the signature if function tipc_nametbl_lookup_anycast(), using address structures instead of discrete integers. This also makes it possible to make some improvements to the functions __tipc_sendmsg() in socket.c and tipc_msg_lookup_dest() in msg.c. Signed-off-by: Jon

[net-next 06/16] tipc: simplify signature of tipc_nametbl_withdraw() functions

2021-03-16 Thread jmaloy
From: Jon Maloy Following the principles of the preceding commits, we reduce the number of parameters passed along in tipc_sk_withdraw(), tipc_nametbl_withdraw() and associated functions. Signed-off-by: Jon Maloy Acked-by: Ying Xue Acked-by: Hoang Le Acked-by: Tung Nguyen Acked-by: Xin Long

[net-next 05/16] tipc: simplify call signatures for publication creation

2021-03-16 Thread jmaloy
From: Jon Maloy We simplify the call signatures for tipc_nametbl_insert_publ() and tipc_publ_create() so that fewer parameters are passed around. Signed-off-by: Jon Maloy Acked-by: Ying Xue Acked-by: Hoang Le Acked-by: Tung Nguyen Acked-by: Xin Long --- net/tipc/name_distr.c | 23 +

[net-next 04/16] tipc: simplify signature of tipc_namtbl_publish()

2021-03-16 Thread jmaloy
From: Jon Maloy Using the new address structure tipc_uaddr, we simplify the signature of function tipc_sk_publish() and tipc_namtbl_publish() so that fewer parameters need to be passed around. Signed-off-by: Jon Maloy Acked-by: Ying Xue Acked-by: Hoang Le Acked-by: Tung Nguyen Acked-by: Xin

[net-next 03/16] tipc: introduce new unified address type for internal use

2021-03-16 Thread jmaloy
From: Jon Maloy We introduce a simplified version of struct sockaddr_tipc, using anonymous unions and structures. Apart from being nicer to work with, this struct will come in handy when we in a later commit add another address type. Signed-off-by: Jon Maloy Acked-by: Ying Xue Acked-by: Hoang

[net-next 02/16] tipc: move creation of publication item one level up in call chain

2021-03-16 Thread jmaloy
From: Jon Maloy We instantiate struct publication in tipc_nametbl_insert_publ() instead of as currently in tipc_service_insert_publ(). This has the advantage that we can pass a pointer to the publication struct to the next call levels, instead of the numerous individual parameters we pass on now.

[net-next 01/16] tipc: re-organize members of struct publication

2021-03-16 Thread jmaloy
From: Jon Maloy In a future commit we will introduce more members to struct publication. In order to keep this structure comprehensible we now group some of its current fields into the sub-structures where they really belong, - A struct tipc_service_range for the functional address the publicatio

[net-next 00/16] tipc: cleanups and simplifications

2021-03-16 Thread jmaloy
From: Jon Maloy We do a number of cleanups and simplifications, especially regarding call signatures in the binding table. This makes the code easier to understand and serves as preparation for upcoming functional additions. Jon Maloy (16): tipc: re-organize members of struct publication tip

[net-next 3/3] tipc: update address terminology in code

2020-11-25 Thread jmaloy
From: Jon Maloy We update the terminology in the code so that deprecated structure names and macros are replaced with those currently recommended in the user API. struct tipc_portid -> struct tipc_socket_addr struct tipc_name -> struct tipc_service_addr struct tipc_name_seq -> struct tipc_

[net-next v2 2/3] tipc: make node number calculation reproducible

2020-11-25 Thread jmaloy
From: Jon Maloy The 32-bit node number, aka node hash or node address, is calculated based on the 128-bit node identity when it is not set explicitly by the user. In future commits we will need to perform this hash operation on peer nodes while feeling safe that we obtain the same result. We do

[net-next 1/3] tipc: refactor tipc_sk_bind() function

2020-11-25 Thread jmaloy
From: Jon Maloy We refactor the tipc_sk_bind() function, so that the lock handling is handled separately from the logics. We also move some sanity tests to earlier in the call chain, to the function tipc_bind(). Acked-by: Ying Xue Signed-off-by: Jon Maloy --- net/tipc/socket.c | 66 ++

[net-next v2 0/3] tipc: some minor improvements

2020-11-25 Thread jmaloy
From: Jon Maloy We add some improvements that will be useful in future commits. --- v2: fixed sparse warning in patch #2 Jon Maloy (3): tipc: refactor tipc_sk_bind() function tipc: make node number calculation reproducible tipc: update address terminology in code net/tipc/addr.c |

[net-next 1/3] tipc: refactor tipc_sk_bind() function

2020-11-24 Thread jmaloy
From: Jon Maloy We refactor the tipc_sk_bind() function, so that the lock handling is handled separately from the logics. We also move some sanity tests to earlier in the call chain, to the function tipc_bind(). Acked-by: Ying Xue Signed-off-by: Jon Maloy --- net/tipc/socket.c | 66 ++

[net-next 2/3] tipc: make node number calculation reproducible

2020-11-24 Thread jmaloy
From: Jon Maloy The 32-bit node number, aka node hash or node address, is calculated based on the 128-bit node identity when it is not set explicitly by the user. In future commits we will need to perform this hash operation on peer nodes while feeling safe that we obtain the same result. We do

[net-next 0/3] tipc: some minor improvements

2020-11-24 Thread jmaloy
From: Jon Maloy We add some improvements that will be useful in future commits. Jon Maloy (3): tipc: refactor tipc_sk_bind() function tipc: make node number calculation reproducible tipc: update address terminology in code net/tipc/addr.c | 7 ++- net/tipc/addr.h | 1 + n

[net-next 3/3] tipc: update address terminology in code

2020-11-24 Thread jmaloy
From: Jon Maloy We update the terminology in the code so that deprecated structure names and macros are replaced with those currently recommended in the user API. struct tipc_portid -> struct tipc_socket_addr struct tipc_name -> struct tipc_service_addr struct tipc_name_seq -> struct tipc_

[net-next v2] tipc: add stricter control of reserved service types

2020-10-29 Thread jmaloy
From: Jon Maloy TIPC reserves 64 service types for current and future internal use. Therefore, the bind() function is meant to block regular user sockets from being bound to these values, while it should let through such bindings from internal users. However, since we at the design moment saw no

[net] tipc: add stricter control of reserved service types

2020-10-28 Thread jmaloy
From: Jon Maloy TIPC reserves 64 service types for current and future internal use. Therefore, the bind() function is meant to block regular user sockets from being bound to these values, while it should let through such bindings from internal users. However, since we at the design moment saw no