From 1fda174739ea9059c2e4963dc24a4808eb5958ac Mon Sep 17 00:00:00 2001 From: Amir Shehata Date: Wed, 13 Feb 2019 17:22:57 -0800 Subject: [PATCH] LU-9121 lnet: UDSP liblnetconfig structure def Definition of the UDSP structures used to store parsed UDSPs Test-Parameters: trivial testlist=lnet-selftest,sanity-lnet Signed-off-by: Amir Shehata Change-Id: Ifc61a191de85d7904c70917d0c45648aecdd0310 Reviewed-on: https://review.whamcloud.com/34254 Reviewed-by: Chris Horn Reviewed-by: Serguei Smirnov Tested-by: jenkins --- lnet/utils/lnetconfig/liblnetconfig.h | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/lnet/utils/lnetconfig/liblnetconfig.h b/lnet/utils/lnetconfig/liblnetconfig.h index fe9ce5d..d9087fb 100644 --- a/lnet/utils/lnetconfig/liblnetconfig.h +++ b/lnet/utils/lnetconfig/liblnetconfig.h @@ -72,6 +72,48 @@ struct lnet_dlc_intf_descr { struct cfs_expr_list *cpt_expr; }; +/* This UDSP structures need to match the kernel space structures + * in order for the marshall and unmarshall functions to be the same. + */ + +/* Net is described as a + * 1. net type + * 2. num range + */ +struct lnet_ud_net_descr { + __u32 udn_net_type; + struct list_head udn_net_num_range; +}; + +/* each NID range is defined as + * 1. net descriptor + * 2. address range descriptor + */ +struct lnet_ud_nid_descr { + struct lnet_ud_net_descr ud_net_id; + struct list_head ud_addr_range; +}; + +/* a UDSP rule can have up to three user defined NID descriptors + * - src: defines the local NID range for the rule + * - dst: defines the peer NID range for the rule + * - rte: defines the router NID range for the rule + * + * An action union defines the action to take when the rule + * is matched + */ +struct lnet_udsp { + struct list_head udsp_on_list; + __u32 udsp_idx; + struct lnet_ud_nid_descr udsp_src; + struct lnet_ud_nid_descr udsp_dst; + struct lnet_ud_nid_descr udsp_rte; + enum lnet_udsp_action_type udsp_action_type; + union { + __u32 udsp_priority; + } udsp_action; +}; + /* forward declaration of the cYAML structure. */ struct cYAML; -- 1.8.3.1