4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 2.1 of the
9 * License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
21 * Copyright (c) 2014, 2017, Intel Corporation.
24 * Amir Shehata <amir.shehata@intel.com>
27 #ifndef LIB_LNET_CONFIG_API_H
28 #define LIB_LNET_CONFIG_API_H
31 #include <libcfs/util/string.h>
32 #include <linux/lnet/lnet-dlc.h>
33 #include <linux/lnet/nidstr.h>
35 #define LUSTRE_CFG_RC_NO_ERR 0
36 #define LUSTRE_CFG_RC_BAD_PARAM -1
37 #define LUSTRE_CFG_RC_MISSING_PARAM -2
38 #define LUSTRE_CFG_RC_OUT_OF_RANGE_PARAM -3
39 #define LUSTRE_CFG_RC_OUT_OF_MEM -4
40 #define LUSTRE_CFG_RC_GENERIC_ERR -5
41 #define LUSTRE_CFG_RC_NO_MATCH -6
42 #define LUSTRE_CFG_RC_MATCH -7
43 #define LUSTRE_CFG_RC_SKIP -8
44 #define LUSTRE_CFG_RC_LAST_ELEM -9
45 #define LUSTRE_CFG_RC_MARSHAL_FAIL -10
47 #define CONFIG_CMD "configure"
48 #define UNCONFIG_CMD "unconfigure"
51 #define SHOW_CMD "show"
53 #define MANAGE_CMD "manage"
55 #define MAX_NUM_IPS 128
57 #define modparam_path "/sys/module/lnet/parameters/"
58 #define o2ib_modparam_path "/sys/module/ko2iblnd/parameters/"
59 #define gni_nid_path "/proc/cray_xt/"
62 LNETCTL_CONFIG_CMD = 1,
63 LNETCTL_UNCONFIG_CMD = 2,
68 LNETCTL_MANAGE_CMD = 7,
73 * Max number of nids we'll configure for a single peer via a single DLC
76 #define LNET_MAX_NIDS_PER_PEER 128
78 struct lnet_dlc_network_descr {
79 struct list_head network_on_rule;
81 struct list_head nw_intflist;
84 struct lnet_dlc_intf_descr {
85 struct list_head intf_on_network;
86 char intf_name[IFNAMSIZ];
87 struct cfs_expr_list *cpt_expr;
90 /* This UDSP structures need to match the kernel space structures
91 * in order for the marshall and unmarshall functions to be the same.
94 /* Net is described as a
98 struct lnet_ud_net_descr {
100 struct list_head udn_net_num_range;
103 /* each NID range is defined as
105 * 2. address range descriptor
107 struct lnet_ud_nid_descr {
108 struct lnet_ud_net_descr ud_net_id;
109 struct list_head ud_addr_range;
112 /* a UDSP rule can have up to three user defined NID descriptors
113 * - src: defines the local NID range for the rule
114 * - dst: defines the peer NID range for the rule
115 * - rte: defines the router NID range for the rule
117 * An action union defines the action to take when the rule
121 struct list_head udsp_on_list;
123 struct lnet_ud_nid_descr udsp_src;
124 struct lnet_ud_nid_descr udsp_dst;
125 struct lnet_ud_nid_descr udsp_rte;
126 enum lnet_udsp_action_type udsp_action_type;
132 /* This union is passed from lnetctl to fill the action union in udsp
134 * TODO: The idea here is if we add extra actions, ex: drop, it can be
137 union lnet_udsp_action {
141 /* forward declaration of the cYAML structure. */
145 * lustre_lnet_config_lib_init()
146 * Initialize the Library to enable communication with the LNET kernel
147 * module. Returns the device ID or -EINVAL if there is an error
149 int lustre_lnet_config_lib_init();
152 * lustre_lnet_config_lib_uninit
153 * Uninitialize the DLC Library
155 void lustre_lnet_config_lib_uninit();
158 * lustre_lnet_config_ni_system
159 * Initialize/Uninitialize the lnet NI system.
161 * up - whehter to init or uninit the system
162 * load_ni_from_mod - load NI from mod params.
163 * seq_no - sequence number of the request
164 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
167 int lustre_lnet_config_ni_system(bool up, bool load_ni_from_mod,
168 int seq_no, struct cYAML **err_rc);
171 * lustre_lnet_config_route
172 * Send down an IOCTL to the kernel to configure the route
176 * hops - number of hops passed down by the user
177 * prio - priority of the route
178 * sen - health sensitivity value for the gateway
179 * seq_no - sequence number of the request
180 * err_rc - [OUT] struct cYAML tree describing the error. Freed by caller
182 int lustre_lnet_config_route(char *nw, char *gw, int hops, int prio,
183 int sen, int seq_no, struct cYAML **err_rc);
186 * lustre_lnet_del_route
187 * Send down an IOCTL to the kernel to delete a route
191 * seq_no - sequence number of the request
192 * err_rc - [OUT] struct cYAML tree describing the error. Freed by caller
194 int lustre_lnet_del_route(char *nw, char *gw, int seq_no,
195 struct cYAML **err_rc);
198 * lustre_lnet_show_route
199 * Send down an IOCTL to the kernel to show routes
200 * This function will get one route at a time and filter according to
201 * provided parameters. If no routes are available then it will dump all
202 * routes that are in the system.
204 * nw - network. Optional. Used to filter output
205 * gw - gateway. Optional. Used to filter ouptut
206 * hops - number of hops passed down by the user
207 * Optional. Used to filter output.
208 * prio - priority of the route. Optional. Used to filter output.
209 * detail - flag to indicate whether detail output is required
210 * seq_no - sequence number of the request
211 * show_rc - [OUT] The show output in YAML. Must be freed by caller.
212 * err_rc - [OUT] struct cYAML tree describing the error. Freed by caller
213 * backup - true to output only what's necessary for reconfiguring
216 int lustre_lnet_show_route(char *nw, char *gw,
217 int hops, int prio, int detail,
218 int seq_no, struct cYAML **show_rc,
219 struct cYAML **err_rc, bool backup);
222 * lustre_lnet_config_ni
223 * Send down an IOCTL to configure a network interface. It implicitly
224 * creates a network if one doesn't exist..
226 * nw_descr - network and interface descriptor
227 * global_cpts - globally defined CPTs
228 * ip2net - this parameter allows configuring multiple networks.
229 * it takes precedence over the net and intf parameters
230 * tunables - LND tunables
231 * seq_no - sequence number of the request
232 * lnd_tunables - lnet specific tunable parameters
233 * err_rc - [OUT] struct cYAML tree describing the error. Freed by caller
235 int lustre_lnet_config_ni(struct lnet_dlc_network_descr *nw_descr,
236 struct cfs_expr_list *global_cpts,
238 struct lnet_ioctl_config_lnd_tunables *tunables,
239 int seq_no, struct cYAML **err_rc);
243 * Send down an IOCTL to delete a network interface. It implicitly
244 * deletes a network if it becomes empty of nis
246 * nw - network and interface list
247 * seq_no - sequence number of the request
248 * err_rc - [OUT] struct cYAML tree describing the error. Freed by caller
250 int lustre_lnet_del_ni(struct lnet_dlc_network_descr *nw,
251 int seq_no, struct cYAML **err_rc);
254 * lustre_lnet_show_net
255 * Send down an IOCTL to show networks.
256 * This function will use the nw paramter to filter the output. If it's
257 * not provided then all networks are listed.
259 * nw - network to show. Optional. Used to filter output.
260 * detail - flag to indicate if we require detail output.
261 * seq_no - sequence number of the request
262 * show_rc - [OUT] The show output in YAML. Must be freed by caller.
263 * err_rc - [OUT] struct cYAML tree describing the error. Freed by caller
264 * backup - true to output only what's necessary for reconfiguring
267 int lustre_lnet_show_net(char *nw, int detail, int seq_no,
268 struct cYAML **show_rc, struct cYAML **err_rc,
272 * lustre_lnet_enable_routing
273 * Send down an IOCTL to enable or diable routing
275 * enable - 1 to enable routing, 0 to disable routing
276 * seq_no - sequence number of the request
277 * err_rc - [OUT] struct cYAML tree describing the error. Freed by caller
279 int lustre_lnet_enable_routing(int enable, int seq_no,
280 struct cYAML **err_rc);
283 * lustre_lnet_config_numa_range
284 * Set the NUMA range which impacts the NIs to be selected
285 * during sending. If the NUMA range is large the NUMA
286 * distance between the message memory and the NI becomes
287 * less significant. The NUMA range is a relative number
288 * with no other meaning besides allowing a wider breadth
289 * for picking an NI to send from.
291 * range - numa range value.
292 * seq_no - sequence number of the request
293 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
296 int lustre_lnet_config_numa_range(int range, int seq_no,
297 struct cYAML **err_rc);
300 * lustre_lnet_show_num_range
301 * Get the currently set NUMA range
303 * seq_no - sequence number of the request
304 * show_rc - [OUT] struct cYAML tree containing NUMA range info
305 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
308 int lustre_lnet_show_numa_range(int seq_no, struct cYAML **show_rc,
309 struct cYAML **err_rc);
312 * lustre_lnet_config_ni_healthv
313 * set the health value of the NI. -1 resets the value to maximum.
315 * value: health value to set.
316 * all: true to set all local NIs to that value.
317 * ni_nid: NI NID to set its health value. all parameter always takes
319 * seq_no - sequence number of the request
320 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
323 int lustre_lnet_config_ni_healthv(int value, bool all, char *ni_nid,
324 int seq_no, struct cYAML **err_rc);
327 * lustre_lnet_config_peer_ni_healthv
328 * set the health value of the peer NI. -1 resets the value to maximum.
330 * value: health value to set.
331 * all: true to set all local NIs to that value.
332 * pni_nid: Peer NI NID to set its health value. all parameter always takes
334 * seq_no - sequence number of the request
335 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
338 int lustre_lnet_config_peer_ni_healthv(int value, bool all, char *pni_nid,
339 int seq_no, struct cYAML **err_rc);
342 * lustre_lnet_config_recov_intrv
343 * set the recovery interval in seconds. That's the interval to ping an
344 * unhealthy interface.
346 * intrv - recovery interval value to configure
347 * seq_no - sequence number of the request
348 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
351 int lustre_lnet_config_recov_intrv(int intrv, int seq_no, struct cYAML **err_rc);
354 * lustre_lnet_show_recov_intrv
355 * show the recovery interval set in the system
357 * seq_no - sequence number of the request
358 * show_rc - [OUT] struct cYAML tree containing health sensitivity info
359 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
362 int lustre_lnet_show_recov_intrv(int seq_no, struct cYAML **show_rc,
363 struct cYAML **err_rc);
366 * lustre_lnet_config_rtr_sensitivity
367 * sets the router sensitivity percentage. If the percentage health
368 * of a router interface drops below that it's considered failed
370 * sen - sensitivity value to configure
371 * seq_no - sequence number of the request
372 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
375 int lustre_lnet_config_rtr_sensitivity(int sen, int seq_no, struct cYAML **err_rc);
378 * lustre_lnet_config_hsensitivity
379 * sets the health sensitivity; the value by which to decrement the
380 * health value of a local or peer NI. If 0 then health is turned off
382 * sen - sensitivity value to configure
383 * seq_no - sequence number of the request
384 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
387 int lustre_lnet_config_hsensitivity(int sen, int seq_no, struct cYAML **err_rc);
390 * lustre_lnet_show_hsensitivity
391 * show the health sensitivity in the system
393 * seq_no - sequence number of the request
394 * show_rc - [OUT] struct cYAML tree containing health sensitivity info
395 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
398 int lustre_lnet_show_hsensitivity(int seq_no, struct cYAML **show_rc,
399 struct cYAML **err_rc);
402 * lustre_lnet_show_rtr_sensitivity
403 * show the router sensitivity percentage in the system
405 * seq_no - sequence number of the request
406 * show_rc - [OUT] struct cYAML tree containing health sensitivity info
407 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
410 int lustre_lnet_show_rtr_sensitivity(int seq_no, struct cYAML **show_rc,
411 struct cYAML **err_rc);
414 * lustre_lnet_config_transaction_to
415 * sets the timeout after which a message expires or a timeout event is
416 * propagated for an expired response.
418 * timeout - timeout value to configure
419 * seq_no - sequence number of the request
420 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
423 int lustre_lnet_config_transaction_to(int timeout, int seq_no, struct cYAML **err_rc);
426 * lustre_lnet_show_transaction_to
427 * show the transaction timeout in the system
429 * seq_no - sequence number of the request
430 * show_rc - [OUT] struct cYAML tree containing transaction timeout info
431 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
434 int lustre_lnet_show_transaction_to(int seq_no, struct cYAML **show_rc,
435 struct cYAML **err_rc);
438 * lustre_lnet_config_retry_count
439 * sets the maximum number of retries to resend a message
441 * count - maximum value to configure
442 * seq_no - sequence number of the request
443 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
446 int lustre_lnet_config_retry_count(int count, int seq_no, struct cYAML **err_rc);
449 * lustre_lnet_show_retry_count
450 * show current maximum number of retries in the system
452 * seq_no - sequence number of the request
453 * show_rc - [OUT] struct cYAML tree containing retry count info
454 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
457 int lustre_lnet_show_retry_count(int seq_no, struct cYAML **show_rc,
458 struct cYAML **err_rc);
460 int lustre_lnet_show_lnd_timeout(int seq_no, struct cYAML **show_rc,
461 struct cYAML **err_rc);
463 int lustre_lnet_show_local_ni_recovq(int seq_no, struct cYAML **show_rc,
464 struct cYAML **err_rc);
466 int lustre_lnet_show_peer_ni_recovq(int seq_no, struct cYAML **show_rc,
467 struct cYAML **err_rc);
468 int lustre_lnet_config_response_tracking(int count, int seq_no,
469 struct cYAML **err_rc);
470 int lustre_lnet_show_response_tracking(int seq_no, struct cYAML **show_rc,
471 struct cYAML **err_rc);
472 int lustre_lnet_config_recovery_limit(int val, int seq_no,
473 struct cYAML **err_rc);
474 int lustre_lnet_show_recovery_limit(int seq_no, struct cYAML **show_rc,
475 struct cYAML **err_rc);
478 * lustre_lnet_config_max_intf
479 * Sets the maximum number of interfaces per node. this tunable is
480 * primarily useful for sanity checks prior to allocating memory.
482 * max - maximum value to configure
483 * seq_no - sequence number of the request
484 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
487 int lustre_lnet_config_max_intf(int max, int seq_no, struct cYAML **err_rc);
490 * lustre_lnet_show_max_intf
491 * show current maximum interface setting
493 * seq_no - sequence number of the request
494 * show_rc - [OUT] struct cYAML tree containing NUMA range info
495 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
498 int lustre_lnet_show_max_intf(int seq_no, struct cYAML **show_rc,
499 struct cYAML **err_rc);
502 * lustre_lnet_calc_service_id
503 * Calculate the lustre service id to be used for qos
505 int lustre_lnet_calc_service_id(__u64 *service_id);
508 * lustre_lnet_config_discovery
509 * Enable or disable peer discovery. Peer discovery is enabled by default.
511 * enable - non-0 enables, 0 disables
512 * seq_no - sequence number of the request
513 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
516 int lustre_lnet_config_discovery(int enable, int seq_no, struct cYAML **err_rc);
519 * lustre_lnet_show_discovery
520 * show current peer discovery setting
522 * seq_no - sequence number of the request
523 * show_rc - [OUT] struct cYAML tree containing NUMA range info
524 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
527 int lustre_lnet_show_discovery(int seq_no, struct cYAML **show_rc,
528 struct cYAML **err_rc);
531 * lustre_lnet_config_drop_asym_route
532 * Drop or accept asymmetrical route messages. Accept by default.
534 * drop - non-0 drops, 0 accepts
535 * seq_no - sequence number of the request
536 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
539 int lustre_lnet_config_drop_asym_route(int drop, int seq_no,
540 struct cYAML **err_rc);
543 * lustre_lnet_show_drop_asym_route
544 * show current drop asym route setting
546 * seq_no - sequence number of the request
547 * show_rc - [OUT] struct cYAML tree containing NUMA range info
548 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
551 int lustre_lnet_show_drop_asym_route(int seq_no, struct cYAML **show_rc,
552 struct cYAML **err_rc);
555 * lustre_lnet_config_buffers
556 * Send down an IOCTL to configure routing buffer sizes. A value of 0 means
557 * default that particular buffer to default size. A value of -1 means
558 * leave the value of the buffer un changed.
560 * tiny - tiny buffers
561 * small - small buffers
562 * large - large buffers.
563 * seq_no - sequence number of the request
564 * err_rc - [OUT] struct cYAML tree describing the error. Freed by caller
566 int lustre_lnet_config_buffers(int tiny, int small, int large,
567 int seq_no, struct cYAML **err_rc);
570 * lustre_lnet_show_routing
571 * Send down an IOCTL to dump buffers and routing status
572 * This function is used to dump buffers for all CPU partitions.
574 * seq_no - sequence number of the request
575 * show_rc - [OUT] The show output in YAML. Must be freed by caller.
576 * err_rc - [OUT] struct cYAML tree describing the error. Freed by caller
577 * backup - true to output only what's necessary for reconfiguring
580 int lustre_lnet_show_routing(int seq_no, struct cYAML **show_rc,
581 struct cYAML **err_rc, bool backup);
584 * lustre_lnet_show_stats
585 * Shows internal LNET statistics. This is useful to display the
586 * current LNET activity, such as number of messages route, etc
588 * seq_no - sequence number of the command
589 * show_rc - YAML structure of the resultant show
590 * err_rc - YAML strucutre of the resultant return code.
592 int lustre_lnet_show_stats(int seq_no, struct cYAML **show_rc,
593 struct cYAML **err_rc);
596 * lustre_lnet_modify_peer
597 * Handle a peer config or delete operation.
600 * Add a peer NID to a peer with primary NID pnid.
601 * If the provided primary NID is unique, then a new peer is
602 * created with this primary NID, and the NIDs in the NID list are added as
603 * secondary NIDs to this new peer.
604 * If any of the NIDs in the NID list are not unique then the operation
605 * fails. Some peer NIDs might have already been added. It's the responsibility
606 * of the caller of this API to remove the added NIDs if so desired.
609 * Delete the NIDs given in the NID list from the peer with the primary NID
610 * pnid. If pnid is NULL, or it doesn't identify a peer, the operation fails,
611 * and no change happens to the system.
612 * The operation is aborted on the first NID that fails to be deleted.
614 * prim_nid - The desired primary NID of a new peer, or the primary NID of
616 * nids - a comma separated string of nids
617 * is_mr - Specifies whether this peer is MR capable.
618 * cmd - CONFIG or DELETE
619 * seq_no - sequence number of the command
620 * err_rc - YAML structure of the resultant return code
622 int lustre_lnet_modify_peer(char *prim_nid, char *nids, bool is_mr,
623 int cmd, int seq_no, struct cYAML **err_rc);
626 * lustre_lnet_show_peer
627 * Show the peer identified by nid, knid. If knid is NULL all
628 * peers in the system are shown.
630 * knid - A NID of the peer
631 * detail - display detailed information
632 * seq_no - sequence number of the command
633 * show_rc - YAML structure of the resultant show
634 * err_rc - YAML strucutre of the resultant return code.
635 * backup - true to output only what's necessary for reconfiguring
639 int lustre_lnet_show_peer(char *knid, int detail, int seq_no,
640 struct cYAML **show_rc, struct cYAML **err_rc,
644 * lustre_lnet_list_peer
645 * List the known peers.
647 * seq_no - sequence number of the command
648 * show_rc - YAML structure of the resultant show
649 * err_rc - YAML strucutre of the resultant return code.
652 int lustre_lnet_list_peer(int seq_no,
653 struct cYAML **show_rc, struct cYAML **err_rc);
655 /* lustre_lnet_ping_nid
656 * Ping the nid list, pnids.
658 * pnids - NID list to ping.
659 * timeout - timeout(seconds) for ping.
660 * seq_no - sequence number of the command.
661 * show_rc - YAML structure of the resultant show.
662 * err_rc - YAML strucutre of the resultant return code.
665 int lustre_lnet_ping_nid(char *pnid, int timeout, int seq_no,
666 struct cYAML **show_rc, struct cYAML **err_rc);
668 /* lustre_lnet_discover_nid
669 * Discover the nid list, pnids.
671 * pnids - NID list to discover.
672 * force - force discovery.
673 * seq_no - sequence number of the command.
674 * show_rc - YAML structure of the resultant show.
675 * err_rc - YAML strucutre of the resultant return code.
678 int lustre_lnet_discover_nid(char *pnid, int force, int seq_no,
679 struct cYAML **show_rc, struct cYAML **err_rc);
683 * Parses the provided YAML file and then calls the specific APIs
684 * to configure the entities identified in the file
687 * err_rc - [OUT] struct cYAML tree describing the error. Freed by caller
689 int lustre_yaml_config(char *f, struct cYAML **err_rc);
693 * Parses the provided YAML file and then calls the specific APIs
694 * to delete the entities identified in the file
697 * err_rc - [OUT] struct cYAML tree describing the error. Freed by caller
699 int lustre_yaml_del(char *f, struct cYAML **err_rc);
703 * Parses the provided YAML file and then calls the specific APIs
704 * to show the entities identified in the file
707 * show_rc - [OUT] The show output in YAML. Must be freed by caller.
708 * err_rc - [OUT] struct cYAML tree describing the error. Freed by caller
710 int lustre_yaml_show(char *f, struct cYAML **show_rc,
711 struct cYAML **err_rc);
715 * Parses the provided YAML file and then calls the specific APIs
716 * to execute the entities identified in the file
719 * show_rc - [OUT] The show output in YAML. Must be freed by caller.
720 * err_rc - [OUT] struct cYAML tree describing the error. Freed by caller
722 int lustre_yaml_exec(char *f, struct cYAML **show_rc,
723 struct cYAML **err_rc);
726 * lustre_lnet_init_nw_descr
727 * initialize the network descriptor structure for use
729 void lustre_lnet_init_nw_descr(struct lnet_dlc_network_descr *nw_descr);
732 * lustre_lnet_parse_interfaces
733 * prase an interface string and populate descriptor structures
734 * intf_str - interface string of the format
735 * <intf>[<expr>], <intf>[<expr>],..
736 * nw_descr - network descriptor to populate
737 * init - True to initialize nw_descr
739 int lustre_lnet_parse_interfaces(char *intf_str,
740 struct lnet_dlc_network_descr *nw_descr);
743 * lustre_lnet_parse_nidstr
744 * This is a small wrapper around cfs_parse_nidlist.
745 * nidstr - A string parseable by cfs_parse_nidlist
746 * lnet_nidlist - An array of lnet_nid_t to hold the nids specified
748 * max_nids - Size of the lnet_nidlist array, and the maximum number of
749 * nids that can be expressed by the nidstring. If the
750 * nidstring expands to a larger number of nids than max_nids
751 * then an error is returned.
752 * err_str - char pointer where we store an informative error
753 * message when an error is encountered
755 * The number (> 0) of lnet_nid_t stored in the supplied array, or
756 * LUSTRE_CFG_RC_BAD_PARAM if:
758 * - nidstr contains an asterisk. This character is not allowed
759 * because it would cause the size of the expanded nidlist to exceed
760 * the maximum number of nids that is supported by expected callers
762 * - cfs_parse_nidlist fails to parse the nidstring
763 * - The nidlist populated by cfs_parse_nidlist is empty
764 * - The nidstring expands to a larger number of nids than max_nids
765 * - The nidstring expands to zero nids
766 * LUSTRE_CFG_RC_OUT_OF_MEM if:
767 * - cfs_expand_nidlist can return ENOMEM. We return out of mem in
770 int lustre_lnet_parse_nidstr(char *nidstr, lnet_nid_t *lnet_nidlist,
771 int max_nids, char *err_str);
773 /* lustre_lnet_add_udsp
774 * Add a selection policy.
775 * src - source NID descriptor
776 * dst - destination NID descriptor
777 * rte - router NID descriptor
779 * action - union of the action
780 * idx - the index to delete
781 * seq_no - sequence number of the request
782 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
785 int lustre_lnet_add_udsp(char *src, char *dst, char *rte, char *type,
786 union lnet_udsp_action *action, int idx,
787 int seq_no, struct cYAML **err_rc);
789 /* lustre_lnet_del_udsp
790 * Delete a net selection policy.
791 * idx - the index to delete
792 * seq_no - sequence number of the request
793 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
796 int lustre_lnet_del_udsp(unsigned int idx, int seq_no, struct cYAML **err_rc);
798 /* lustre_lnet_show_udsp
799 * show selection policy.
800 * idx - the index to show. -1 to show all policies
801 * seq_no - sequence number of the request
802 * err_rc - [IN/OUT] struct cYAML tree containing udsp info
803 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
806 int lustre_lnet_show_udsp(int idx, int seq_no, struct cYAML **show_rc,
807 struct cYAML **err_rc);
809 #endif /* LIB_LNET_CONFIG_API_H */