@@ -66,7 +66,7 @@ struct lnet_ioctl_config_o2iblnd_tunables {
__u32 lnd_fmr_flush_trigger;
__u32 lnd_fmr_cache;
__u16 lnd_conns_per_peer;
- __u16 pad;
+ __u16 lnd_ntx;
};
struct lnet_lnd_tunables {
@@ -2034,9 +2034,13 @@ static void kiblnd_destroy_tx_pool(struct kib_pool *pool)
kfree(tpo);
}
-static int kiblnd_tx_pool_size(int ncpts)
+static int kiblnd_tx_pool_size(struct lnet_ni *ni, int ncpts)
{
- int ntx = *kiblnd_tunables.kib_ntx / ncpts;
+ struct lnet_ioctl_config_o2iblnd_tunables *tunables;
+ int ntx;
+
+ tunables = &ni->ni_lnd_tunables.lnd_tun_u.lnd_o2ib;
+ ntx = tunables->lnd_ntx / ncpts;
return max(IBLND_TX_POOL, ntx);
}
@@ -2176,10 +2180,10 @@ static int kiblnd_net_init_pools(struct kib_net *net, struct lnet_ni *ni,
tunables = &ni->ni_lnd_tunables.lnd_tun_u.lnd_o2ib;
- if (tunables->lnd_fmr_pool_size < *kiblnd_tunables.kib_ntx / 4) {
+ if (tunables->lnd_fmr_pool_size < tunables->lnd_ntx / 4) {
CERROR("Can't set fmr pool size (%d) < ntx / 4(%d)\n",
tunables->lnd_fmr_pool_size,
- *kiblnd_tunables.kib_ntx / 4);
+ tunables->lnd_ntx / 4);
rc = -EINVAL;
goto failed;
}
@@ -2237,7 +2241,7 @@ static int kiblnd_net_init_pools(struct kib_net *net, struct lnet_ni *ni,
cpt = !cpts ? i : cpts[i];
rc = kiblnd_init_poolset(&net->ibn_tx_ps[cpt]->tps_poolset,
cpt, net, "TX",
- kiblnd_tx_pool_size(ncpts),
+ kiblnd_tx_pool_size(ni, ncpts),
kiblnd_create_tx_pool,
kiblnd_destroy_tx_pool,
kiblnd_tx_init, NULL);
@@ -157,7 +157,6 @@ struct kib_tunables kiblnd_tunables = {
.kib_cksum = &cksum,
.kib_timeout = &timeout,
.kib_keepalive = &keepalive,
- .kib_ntx = &ntx,
.kib_default_ipif = &ipif_name,
.kib_retry_count = &retry_count,
.kib_rnr_retry_count = &rnr_retry_count,
@@ -282,6 +281,8 @@ int kiblnd_tunables_setup(struct lnet_ni *ni)
tunables->lnd_fmr_flush_trigger = fmr_flush_trigger;
if (!tunables->lnd_fmr_cache)
tunables->lnd_fmr_cache = fmr_cache;
+ if (!tunables->lnd_ntx)
+ tunables->lnd_ntx = ntx;
if (!tunables->lnd_conns_per_peer) {
tunables->lnd_conns_per_peer = (conns_per_peer) ?
conns_per_peer : 1;
@@ -299,5 +300,6 @@ void kiblnd_tunables_init(void)
default_tunables.lnd_fmr_pool_size = fmr_pool_size;
default_tunables.lnd_fmr_flush_trigger = fmr_flush_trigger;
default_tunables.lnd_fmr_cache = fmr_cache;
+ default_tunables.lnd_ntx = ntx;
default_tunables.lnd_conns_per_peer = conns_per_peer;
}