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);
474 * lustre_lnet_config_max_intf
475 * Sets the maximum number of interfaces per node. this tunable is
476 * primarily useful for sanity checks prior to allocating memory.
478 * max - maximum value to configure
479 * seq_no - sequence number of the request
480 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
483 int lustre_lnet_config_max_intf(int max, int seq_no, struct cYAML **err_rc);
486 * lustre_lnet_show_max_intf
487 * show current maximum interface setting
489 * seq_no - sequence number of the request
490 * show_rc - [OUT] struct cYAML tree containing NUMA range info
491 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
494 int lustre_lnet_show_max_intf(int seq_no, struct cYAML **show_rc,
495 struct cYAML **err_rc);
498 * lustre_lnet_calc_service_id
499 * Calculate the lustre service id to be used for qos
501 int lustre_lnet_calc_service_id(__u64 *service_id);
504 * lustre_lnet_config_discovery
505 * Enable or disable peer discovery. Peer discovery is enabled by default.
507 * enable - non-0 enables, 0 disables
508 * seq_no - sequence number of the request
509 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
512 int lustre_lnet_config_discovery(int enable, int seq_no, struct cYAML **err_rc);
515 * lustre_lnet_show_discovery
516 * show current peer discovery setting
518 * seq_no - sequence number of the request
519 * show_rc - [OUT] struct cYAML tree containing NUMA range info
520 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
523 int lustre_lnet_show_discovery(int seq_no, struct cYAML **show_rc,
524 struct cYAML **err_rc);
527 * lustre_lnet_config_drop_asym_route
528 * Drop or accept asymmetrical route messages. Accept by default.
530 * drop - non-0 drops, 0 accepts
531 * seq_no - sequence number of the request
532 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
535 int lustre_lnet_config_drop_asym_route(int drop, int seq_no,
536 struct cYAML **err_rc);
539 * lustre_lnet_show_drop_asym_route
540 * show current drop asym route setting
542 * seq_no - sequence number of the request
543 * show_rc - [OUT] struct cYAML tree containing NUMA range info
544 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
547 int lustre_lnet_show_drop_asym_route(int seq_no, struct cYAML **show_rc,
548 struct cYAML **err_rc);
551 * lustre_lnet_config_buffers
552 * Send down an IOCTL to configure routing buffer sizes. A value of 0 means
553 * default that particular buffer to default size. A value of -1 means
554 * leave the value of the buffer un changed.
556 * tiny - tiny buffers
557 * small - small buffers
558 * large - large buffers.
559 * seq_no - sequence number of the request
560 * err_rc - [OUT] struct cYAML tree describing the error. Freed by caller
562 int lustre_lnet_config_buffers(int tiny, int small, int large,
563 int seq_no, struct cYAML **err_rc);
566 * lustre_lnet_show_routing
567 * Send down an IOCTL to dump buffers and routing status
568 * This function is used to dump buffers for all CPU partitions.
570 * seq_no - sequence number of the request
571 * show_rc - [OUT] The show output in YAML. Must be freed by caller.
572 * err_rc - [OUT] struct cYAML tree describing the error. Freed by caller
573 * backup - true to output only what's necessary for reconfiguring
576 int lustre_lnet_show_routing(int seq_no, struct cYAML **show_rc,
577 struct cYAML **err_rc, bool backup);
580 * lustre_lnet_show_stats
581 * Shows internal LNET statistics. This is useful to display the
582 * current LNET activity, such as number of messages route, etc
584 * seq_no - sequence number of the command
585 * show_rc - YAML structure of the resultant show
586 * err_rc - YAML strucutre of the resultant return code.
588 int lustre_lnet_show_stats(int seq_no, struct cYAML **show_rc,
589 struct cYAML **err_rc);
592 * lustre_lnet_modify_peer
593 * Handle a peer config or delete operation.
596 * Add a peer NID to a peer with primary NID pnid.
597 * If the provided primary NID is unique, then a new peer is
598 * created with this primary NID, and the NIDs in the NID list are added as
599 * secondary NIDs to this new peer.
600 * If any of the NIDs in the NID list are not unique then the operation
601 * fails. Some peer NIDs might have already been added. It's the responsibility
602 * of the caller of this API to remove the added NIDs if so desired.
605 * Delete the NIDs given in the NID list from the peer with the primary NID
606 * pnid. If pnid is NULL, or it doesn't identify a peer, the operation fails,
607 * and no change happens to the system.
608 * The operation is aborted on the first NID that fails to be deleted.
610 * prim_nid - The desired primary NID of a new peer, or the primary NID of
612 * nids - a comma separated string of nids
613 * is_mr - Specifies whether this peer is MR capable.
614 * cmd - CONFIG or DELETE
615 * seq_no - sequence number of the command
616 * err_rc - YAML structure of the resultant return code
618 int lustre_lnet_modify_peer(char *prim_nid, char *nids, bool is_mr,
619 int cmd, int seq_no, struct cYAML **err_rc);
622 * lustre_lnet_show_peer
623 * Show the peer identified by nid, knid. If knid is NULL all
624 * peers in the system are shown.
626 * knid - A NID of the peer
627 * detail - display detailed information
628 * seq_no - sequence number of the command
629 * show_rc - YAML structure of the resultant show
630 * err_rc - YAML strucutre of the resultant return code.
631 * backup - true to output only what's necessary for reconfiguring
635 int lustre_lnet_show_peer(char *knid, int detail, int seq_no,
636 struct cYAML **show_rc, struct cYAML **err_rc,
640 * lustre_lnet_list_peer
641 * List the known peers.
643 * seq_no - sequence number of the command
644 * show_rc - YAML structure of the resultant show
645 * err_rc - YAML strucutre of the resultant return code.
648 int lustre_lnet_list_peer(int seq_no,
649 struct cYAML **show_rc, struct cYAML **err_rc);
651 /* lustre_lnet_ping_nid
652 * Ping the nid list, pnids.
654 * pnids - NID list to ping.
655 * timeout - timeout(seconds) for ping.
656 * seq_no - sequence number of the command.
657 * show_rc - YAML structure of the resultant show.
658 * err_rc - YAML strucutre of the resultant return code.
661 int lustre_lnet_ping_nid(char *pnid, int timeout, int seq_no,
662 struct cYAML **show_rc, struct cYAML **err_rc);
664 /* lustre_lnet_discover_nid
665 * Discover the nid list, pnids.
667 * pnids - NID list to discover.
668 * force - force discovery.
669 * seq_no - sequence number of the command.
670 * show_rc - YAML structure of the resultant show.
671 * err_rc - YAML strucutre of the resultant return code.
674 int lustre_lnet_discover_nid(char *pnid, int force, int seq_no,
675 struct cYAML **show_rc, struct cYAML **err_rc);
679 * Parses the provided YAML file and then calls the specific APIs
680 * to configure the entities identified in the file
683 * err_rc - [OUT] struct cYAML tree describing the error. Freed by caller
685 int lustre_yaml_config(char *f, struct cYAML **err_rc);
689 * Parses the provided YAML file and then calls the specific APIs
690 * to delete the entities identified in the file
693 * err_rc - [OUT] struct cYAML tree describing the error. Freed by caller
695 int lustre_yaml_del(char *f, struct cYAML **err_rc);
699 * Parses the provided YAML file and then calls the specific APIs
700 * to show the entities identified in the file
703 * show_rc - [OUT] The show output in YAML. Must be freed by caller.
704 * err_rc - [OUT] struct cYAML tree describing the error. Freed by caller
706 int lustre_yaml_show(char *f, struct cYAML **show_rc,
707 struct cYAML **err_rc);
711 * Parses the provided YAML file and then calls the specific APIs
712 * to execute the entities identified in the file
715 * show_rc - [OUT] The show output in YAML. Must be freed by caller.
716 * err_rc - [OUT] struct cYAML tree describing the error. Freed by caller
718 int lustre_yaml_exec(char *f, struct cYAML **show_rc,
719 struct cYAML **err_rc);
722 * lustre_lnet_init_nw_descr
723 * initialize the network descriptor structure for use
725 void lustre_lnet_init_nw_descr(struct lnet_dlc_network_descr *nw_descr);
728 * lustre_lnet_parse_interfaces
729 * prase an interface string and populate descriptor structures
730 * intf_str - interface string of the format
731 * <intf>[<expr>], <intf>[<expr>],..
732 * nw_descr - network descriptor to populate
733 * init - True to initialize nw_descr
735 int lustre_lnet_parse_interfaces(char *intf_str,
736 struct lnet_dlc_network_descr *nw_descr);
739 * lustre_lnet_parse_nidstr
740 * This is a small wrapper around cfs_parse_nidlist.
741 * nidstr - A string parseable by cfs_parse_nidlist
742 * lnet_nidlist - An array of lnet_nid_t to hold the nids specified
744 * max_nids - Size of the lnet_nidlist array, and the maximum number of
745 * nids that can be expressed by the nidstring. If the
746 * nidstring expands to a larger number of nids than max_nids
747 * then an error is returned.
748 * err_str - char pointer where we store an informative error
749 * message when an error is encountered
751 * The number (> 0) of lnet_nid_t stored in the supplied array, or
752 * LUSTRE_CFG_RC_BAD_PARAM if:
754 * - nidstr contains an asterisk. This character is not allowed
755 * because it would cause the size of the expanded nidlist to exceed
756 * the maximum number of nids that is supported by expected callers
758 * - cfs_parse_nidlist fails to parse the nidstring
759 * - The nidlist populated by cfs_parse_nidlist is empty
760 * - The nidstring expands to a larger number of nids than max_nids
761 * - The nidstring expands to zero nids
762 * LUSTRE_CFG_RC_OUT_OF_MEM if:
763 * - cfs_expand_nidlist can return ENOMEM. We return out of mem in
766 int lustre_lnet_parse_nidstr(char *nidstr, lnet_nid_t *lnet_nidlist,
767 int max_nids, char *err_str);
769 /* lustre_lnet_add_udsp
770 * Add a selection policy.
771 * src - source NID descriptor
772 * dst - destination NID descriptor
773 * rte - router NID descriptor
775 * action - union of the action
776 * idx - the index to delete
777 * seq_no - sequence number of the request
778 * err_rc - [OUT] struct cYAML tree describing the error. Freed by
781 int lustre_lnet_add_udsp(char *src, char *dst, char *rte, char *type,
782 union lnet_udsp_action *action, int idx,
783 int seq_no, struct cYAML **err_rc);
785 #endif /* LIB_LNET_CONFIG_API_H */