Whamcloud - gitweb
LU-10391 lnet: migrate full LNet NI information collection
[fs/lustre-release.git] / lnet / klnds / kfilnd / kfilnd.c
index 3bd70c7..e3d7732 100644 (file)
@@ -366,6 +366,31 @@ static const struct ln_key_list kfilnd_tunables_keys = {
 };
 
 static int
+kfilnd_nl_get(int cmd, struct sk_buff *msg, int type, void *data)
+{
+       struct lnet_lnd_tunables *tunables;
+       struct lnet_ni *ni = data;
+
+       if (!ni || !msg)
+               return -EINVAL;
+
+       if (cmd != LNET_CMD_NETS || type != LNET_NET_LOCAL_NI_ATTR_LND_TUNABLES)
+               return -EOPNOTSUPP;
+
+       tunables = &ni->ni_lnd_tunables;
+       nla_put_s32(msg, LNET_NET_KFILND_TUNABLES_ATTR_PROV_MAJOR,
+                   tunables->lnd_tun_u.lnd_kfi.lnd_prov_major_version);
+       nla_put_s32(msg, LNET_NET_KFILND_TUNABLES_ATTR_PROV_MINOR,
+                   tunables->lnd_tun_u.lnd_kfi.lnd_prov_minor_version);
+       nla_put_s32(msg, LNET_NET_KFILND_TUNABLES_ATTR_AUTH_KEY,
+                   tunables->lnd_tun_u.lnd_kfi.lnd_auth_key);
+       nla_put_string(msg, LNET_NET_KFILND_TUNABLES_ATTR_TRAFFIC_CLASS,
+                      tunables->lnd_tun_u.lnd_kfi.lnd_traffic_class_str);
+
+       return 0;
+}
+
+static int
 kfilnd_nl_set(int cmd, struct nlattr *attr, int type, void *data)
 {
        struct lnet_lnd_tunables *tunables = data;
@@ -407,6 +432,7 @@ static const struct lnet_lnd the_kfilnd = {
        .lnd_shutdown   = kfilnd_shutdown,
        .lnd_send       = kfilnd_send,
        .lnd_recv       = kfilnd_recv,
+       .lnd_nl_get     = kfilnd_nl_get,
        .lnd_nl_set     = kfilnd_nl_set,
        .lnd_keys       = &kfilnd_tunables_keys,
 };