Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
/* lnet structure which will keep a list of UDSPs */
struct lnet {
	...
	list_head ln_udsp_list;
	...
};

/* net descriptor */
struct lnet_ud_net_descr {
	__u32 udn_net_type;
	list_head udn_net_num_range;
};

/* each NID range is defined as net_id and an ip range */
struct lnet_ud_nid_descr {
	struct lnet_ud_net_descr ud_net_id;
	list_head ud_ip_range;
};

/* UDSP action types */
enum lnet_udsp_action_type {
	EN_LNET_UDSP_ACTION_NONE = 0,
	EN_LNET_UDSP_ACTION_PRIORITY = 1,
	EN_LNET_UDSP_PREFERRED_LIST = 2,
};

 /*
 * 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 {
	list_head udsp_on_list;
	__u32 idx;
	lnet_ud_nid_descr *udsp_src;
	lnet_ud_nid_descr *udsp_dst;
	lnet_ud_nid_descr *udsp_rte;
	enum lnet_udsp_action_type udsp_action_type;
	union udsp_action {
		__u32 udsp_priority;
	};
};

/* The rules are flattened in the LNet structures as shown below */
struct lnet_net {
...
	/* defines the relative priority of this net compared to others in the system */
	__u32 net_priority;
...
};


struct lnet_ni {
...
	/* defines the relative priority of this NI compared to other NIs in the net */
	__u32 ni_priority;
...
};

struct lnet_peer_net {
...
	/* defines the relative priority of this peer net compared to others in the system */
	__u32 lpn_priority;
...
};

struct lnet_peer_ni {
...
	/* defines the relative peer_ni priority compared to other peer_nis in the peer */
	__u32 lpni_priority;

	/* defines the list of local NID(s) (>=1) which should be used as the source */
	union lpni_pref {
		lnet_nid_t nid;
		struct list_head nids;
	}

	/*
	 *	defines the list of router NID(s) to be used when sending to this peer NI
	 *	if the peer NI is remote
     */
	struct list_head lpni_rte_nids;
...
};

/* UDSPs will be passed to the kernel via IOCTL */
#define IOC_LIBCFS_ADD_UDSP _IOWR(IOC_LIBCFS_TYPE, 106, IOCTL_CONFIG_SIZE)
#define IOC_LIBCFS_DEL_UDSP _IOWR(IOC_LIBCFS_TYPE, 107, IOCTL_CONFIG_SIZE)
#define IOC_LIBCFS_GET_UDSP _IOWR(IOC_LIBCFS_TYPE, 108, IOCTL_CONFIG_SIZE)
#define IOC_LIBCFS_GET_UDSP_SIZE _IOWR(IOC_LIBCFS_TYPE, 108, IOCTL_CONFIG_SIZE)

There are two types of actions that can be applied on LNet constructs:

  1. Priority
  2. Preferred List

Priority is an integer value which is assigned to the LNet construct, such as Local Net or Remote NID.

Preferred List comes into play in the NID Pair and Router Rules. The NID Pair rules assign a set of local NIDs to destination peer NIs matching the destination NID descriptor.

The router rules assign a set of router NIDs to the destination peer NIs maching the destination NID descriptor.

The descriptor for the list of NIDs to be attached is carried in the udsp_src and udsp_rte fields. Although technically, they are part of the action, it is a simpler implementation for marshalling and unmarshalling to implement them as shown above.

UDSP Structure Diagram

Gliffy Diagram
nameUDSP_Storage_Structure
pagePin4

...