summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2017-03-10 10:38:29 -0800
committerDavid S. Miller <davem@davemloft.net>2017-03-12 23:43:17 -0700
commit783496b0ddc2bd4ad561864138596ebb336a7100 (patch)
tree219ecd2967eaeb2549f318ad7df4fe50652e893e /drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
parentd2b84397601f370ca11a5a37a40787d31af778b7 (diff)
nfp: pass new data path to ring reconfig
Make callers of nfp_net_ring_reconfig() pass newly allocated data path structure. We will gradually make use of that structure instead of passing parameters around to all the allocation functions. This commit adds allocation and propagation of new data path struct, no parameters are converted, yet. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c')
-rw-r--r--drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c b/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
index 969c30589f23..326ccd74a4bf 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
@@ -196,13 +196,18 @@ static int nfp_net_set_ring_size(struct nfp_net *nn, u32 rxd_cnt, u32 txd_cnt)
.n_rings = nn->dp.num_tx_rings,
.dcnt = txd_cnt,
};
+ struct nfp_net_dp *dp;
if (nn->dp.rxd_cnt != rxd_cnt)
reconfig_rx = &rx;
if (nn->dp.txd_cnt != txd_cnt)
reconfig_tx = &tx;
- return nfp_net_ring_reconfig(nn, &nn->dp.xdp_prog,
+ dp = nfp_net_clone_dp(nn);
+ if (!dp)
+ return -ENOMEM;
+
+ return nfp_net_ring_reconfig(nn, dp, &nn->dp.xdp_prog,
reconfig_rx, reconfig_tx);
}
@@ -772,6 +777,7 @@ static int nfp_net_set_num_rings(struct nfp_net *nn, unsigned int total_rx,
.n_rings = total_tx,
.dcnt = nn->dp.txd_cnt,
};
+ struct nfp_net_dp *dp;
if (nn->dp.num_rx_rings != total_rx)
reconfig_rx = &rx;
@@ -783,7 +789,11 @@ static int nfp_net_set_num_rings(struct nfp_net *nn, unsigned int total_rx,
if (nn->dp.xdp_prog)
tx.n_rings += total_rx;
- return nfp_net_ring_reconfig(nn, &nn->dp.xdp_prog,
+ dp = nfp_net_clone_dp(nn);
+ if (!dp)
+ return -ENOMEM;
+
+ return nfp_net_ring_reconfig(nn, dp, &nn->dp.xdp_prog,
reconfig_rx, reconfig_tx);
}