*
* Copyright (c) 2013, 2017, Intel Corporation.
*
- * This file is part of Lustre, https://wiki.hpdd.intel.com/
+ * This file is part of Lustre, https://wiki.whamcloud.com/
*
* Portals is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
{ .name = "portal", .has_arg = required_argument, .val = 'p' },
{ .name = "message", .has_arg = required_argument, .val = 'm' },
{ .name = "health_error", .has_arg = required_argument, .val = 'e' },
+ { .name = "local_nid", .has_arg = required_argument, .val = 'o' },
+ { .name = "drop_all", .has_arg = no_argument, .val = 'x' },
{ .name = NULL } };
if (argc == 1) {
return -1;
}
- optstr = opc == LNET_CTL_DROP_ADD ? "s:d:r:i:p:m:e:n" : "s:d:r:l:p:m:";
+ optstr = opc == LNET_CTL_DROP_ADD ? "s:d:o:r:i:p:m:e:nx" : "s:d:o:r:l:p:m:";
memset(&attr, 0, sizeof(attr));
while (1) {
char c = getopt_long(argc, argv, optstr, opts, NULL);
break;
switch (c) {
+ case 'o':
+ rc = fault_attr_nid_parse(optarg, &attr.fa_local_nid);
+ if (rc != 0)
+ goto getopt_failed;
+ break;
case 's': /* source NID/NET */
rc = fault_attr_nid_parse(optarg, &attr.fa_src);
if (rc != 0)
}
break;
+ case 'x':
+ if (opc == LNET_CTL_DROP_ADD)
+ attr.u.drop.da_drop_all = true;
+ break;
+
case 'n':
if (opc == LNET_CTL_DROP_ADD)
attr.u.drop.da_random = true;
return -1;
}
+ if (attr.fa_local_nid == 0)
+ attr.fa_local_nid = LNET_NID_ANY;
+
data.ioc_flags = opc;
data.ioc_inllen1 = sizeof(attr);
data.ioc_inlbuf1 = (char *)&attr;