Commit 0ae42dfc authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

nfp: rename ring allocation helpers

"Shadow" in ring helpers used to mean that the helper will allocate
rings without touching existing configuration, this was used for
reconfiguration while the device was running.  We will soon use
the same helpers for .ndo_open() path, so replace "shadow" with
"ring_set".

No functional changes.
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 68453c7a
...@@ -1573,7 +1573,7 @@ static int nfp_net_tx_ring_alloc(struct nfp_net_tx_ring *tx_ring, u32 cnt) ...@@ -1573,7 +1573,7 @@ static int nfp_net_tx_ring_alloc(struct nfp_net_tx_ring *tx_ring, u32 cnt)
} }
static struct nfp_net_tx_ring * static struct nfp_net_tx_ring *
nfp_net_shadow_tx_rings_prepare(struct nfp_net *nn, struct nfp_net_ring_set *s) nfp_net_tx_ring_set_prepare(struct nfp_net *nn, struct nfp_net_ring_set *s)
{ {
struct nfp_net_tx_ring *rings; struct nfp_net_tx_ring *rings;
unsigned int r; unsigned int r;
...@@ -1599,7 +1599,7 @@ nfp_net_shadow_tx_rings_prepare(struct nfp_net *nn, struct nfp_net_ring_set *s) ...@@ -1599,7 +1599,7 @@ nfp_net_shadow_tx_rings_prepare(struct nfp_net *nn, struct nfp_net_ring_set *s)
} }
static void static void
nfp_net_shadow_tx_rings_swap(struct nfp_net *nn, struct nfp_net_ring_set *s) nfp_net_tx_ring_set_swap(struct nfp_net *nn, struct nfp_net_ring_set *s)
{ {
struct nfp_net_tx_ring *rings = s->rings; struct nfp_net_tx_ring *rings = s->rings;
struct nfp_net_ring_set new = *s; struct nfp_net_ring_set new = *s;
...@@ -1616,7 +1616,7 @@ nfp_net_shadow_tx_rings_swap(struct nfp_net *nn, struct nfp_net_ring_set *s) ...@@ -1616,7 +1616,7 @@ nfp_net_shadow_tx_rings_swap(struct nfp_net *nn, struct nfp_net_ring_set *s)
} }
static void static void
nfp_net_shadow_tx_rings_free(struct nfp_net *nn, struct nfp_net_ring_set *s) nfp_net_tx_ring_set_free(struct nfp_net *nn, struct nfp_net_ring_set *s)
{ {
struct nfp_net_tx_ring *rings = s->rings; struct nfp_net_tx_ring *rings = s->rings;
unsigned int r; unsigned int r;
...@@ -1693,7 +1693,7 @@ nfp_net_rx_ring_alloc(struct nfp_net_rx_ring *rx_ring, unsigned int fl_bufsz, ...@@ -1693,7 +1693,7 @@ nfp_net_rx_ring_alloc(struct nfp_net_rx_ring *rx_ring, unsigned int fl_bufsz,
} }
static struct nfp_net_rx_ring * static struct nfp_net_rx_ring *
nfp_net_shadow_rx_rings_prepare(struct nfp_net *nn, struct nfp_net_ring_set *s) nfp_net_rx_ring_set_prepare(struct nfp_net *nn, struct nfp_net_ring_set *s)
{ {
unsigned int fl_bufsz = nfp_net_calc_fl_bufsz(nn, s->mtu); unsigned int fl_bufsz = nfp_net_calc_fl_bufsz(nn, s->mtu);
struct nfp_net_rx_ring *rings; struct nfp_net_rx_ring *rings;
...@@ -1726,7 +1726,7 @@ nfp_net_shadow_rx_rings_prepare(struct nfp_net *nn, struct nfp_net_ring_set *s) ...@@ -1726,7 +1726,7 @@ nfp_net_shadow_rx_rings_prepare(struct nfp_net *nn, struct nfp_net_ring_set *s)
} }
static void static void
nfp_net_shadow_rx_rings_swap(struct nfp_net *nn, struct nfp_net_ring_set *s) nfp_net_rx_ring_set_swap(struct nfp_net *nn, struct nfp_net_ring_set *s)
{ {
struct nfp_net_rx_ring *rings = s->rings; struct nfp_net_rx_ring *rings = s->rings;
struct nfp_net_ring_set new = *s; struct nfp_net_ring_set new = *s;
...@@ -1746,7 +1746,7 @@ nfp_net_shadow_rx_rings_swap(struct nfp_net *nn, struct nfp_net_ring_set *s) ...@@ -1746,7 +1746,7 @@ nfp_net_shadow_rx_rings_swap(struct nfp_net *nn, struct nfp_net_ring_set *s)
} }
static void static void
nfp_net_shadow_rx_rings_free(struct nfp_net *nn, struct nfp_net_ring_set *s) nfp_net_rx_ring_set_free(struct nfp_net *nn, struct nfp_net_ring_set *s)
{ {
struct nfp_net_rx_ring *rings = s->rings; struct nfp_net_rx_ring *rings = s->rings;
unsigned int r; unsigned int r;
...@@ -2268,9 +2268,9 @@ nfp_net_ring_swap_enable(struct nfp_net *nn, ...@@ -2268,9 +2268,9 @@ nfp_net_ring_swap_enable(struct nfp_net *nn,
struct nfp_net_ring_set *tx) struct nfp_net_ring_set *tx)
{ {
if (rx) if (rx)
nfp_net_shadow_rx_rings_swap(nn, rx); nfp_net_rx_ring_set_swap(nn, rx);
if (tx) if (tx)
nfp_net_shadow_tx_rings_swap(nn, tx); nfp_net_tx_ring_set_swap(nn, tx);
return __nfp_net_set_config_and_enable(nn); return __nfp_net_set_config_and_enable(nn);
} }
...@@ -2299,11 +2299,11 @@ nfp_net_ring_reconfig(struct nfp_net *nn, struct nfp_net_ring_set *rx, ...@@ -2299,11 +2299,11 @@ nfp_net_ring_reconfig(struct nfp_net *nn, struct nfp_net_ring_set *rx,
/* Prepare new rings */ /* Prepare new rings */
if (rx) { if (rx) {
if (!nfp_net_shadow_rx_rings_prepare(nn, rx)) if (!nfp_net_rx_ring_set_prepare(nn, rx))
return -ENOMEM; return -ENOMEM;
} }
if (tx) { if (tx) {
if (!nfp_net_shadow_tx_rings_prepare(nn, tx)) { if (!nfp_net_tx_ring_set_prepare(nn, tx)) {
err = -ENOMEM; err = -ENOMEM;
goto err_free_rx; goto err_free_rx;
} }
...@@ -2327,9 +2327,9 @@ nfp_net_ring_reconfig(struct nfp_net *nn, struct nfp_net_ring_set *rx, ...@@ -2327,9 +2327,9 @@ nfp_net_ring_reconfig(struct nfp_net *nn, struct nfp_net_ring_set *rx,
} }
if (rx) if (rx)
nfp_net_shadow_rx_rings_free(nn, rx); nfp_net_rx_ring_set_free(nn, rx);
if (tx) if (tx)
nfp_net_shadow_tx_rings_free(nn, tx); nfp_net_tx_ring_set_free(nn, tx);
nfp_net_open_stack(nn); nfp_net_open_stack(nn);
...@@ -2337,7 +2337,7 @@ nfp_net_ring_reconfig(struct nfp_net *nn, struct nfp_net_ring_set *rx, ...@@ -2337,7 +2337,7 @@ nfp_net_ring_reconfig(struct nfp_net *nn, struct nfp_net_ring_set *rx,
err_free_rx: err_free_rx:
if (rx) if (rx)
nfp_net_shadow_rx_rings_free(nn, rx); nfp_net_rx_ring_set_free(nn, rx);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment