Skip to content

Commit 51ccc37

Browse files
Dirk van der Merwedavem330
authored andcommitted
nfp: refactor nfp_app_reprs_set
The criteria that reprs cannot be replaced with another new set of reprs has been removed. This check is not needed since the only use case that could exercise this at the moment, would be to modify the number of SRIOV VFs without first disabling them. This case is explicitly disallowed in any case and subsequent patches in this series need to be able to replace the running set of reprs. All cases where the return code used to be checked for the nfp_app_reprs_set function have been removed. As stated above, it is not possible for the current code to encounter a case where reprs exist and need to be replaced. Signed-off-by: Dirk van der Merwe <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7717c31 commit 51ccc37

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

drivers/net/ethernet/netronome/nfp/flower/main.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ nfp_flower_spawn_vnic_reprs(struct nfp_app *app,
142142
{
143143
u8 nfp_pcie = nfp_cppcore_pcie_unit(app->pf->cpp);
144144
struct nfp_flower_priv *priv = app->priv;
145-
struct nfp_reprs *reprs, *old_reprs;
146145
enum nfp_port_type port_type;
146+
struct nfp_reprs *reprs;
147147
const u8 queue = 0;
148148
int i, err;
149149

@@ -194,11 +194,7 @@ nfp_flower_spawn_vnic_reprs(struct nfp_app *app,
194194
reprs->reprs[i]->name);
195195
}
196196

197-
old_reprs = nfp_app_reprs_set(app, repr_type, reprs);
198-
if (IS_ERR(old_reprs)) {
199-
err = PTR_ERR(old_reprs);
200-
goto err_reprs_clean;
201-
}
197+
nfp_app_reprs_set(app, repr_type, reprs);
202198

203199
return 0;
204200
err_reprs_clean:
@@ -222,8 +218,8 @@ static int
222218
nfp_flower_spawn_phy_reprs(struct nfp_app *app, struct nfp_flower_priv *priv)
223219
{
224220
struct nfp_eth_table *eth_tbl = app->pf->eth_tbl;
225-
struct nfp_reprs *reprs, *old_reprs;
226221
struct sk_buff *ctrl_skb;
222+
struct nfp_reprs *reprs;
227223
unsigned int i;
228224
int err;
229225

@@ -280,11 +276,7 @@ nfp_flower_spawn_phy_reprs(struct nfp_app *app, struct nfp_flower_priv *priv)
280276
phys_port, reprs->reprs[phys_port]->name);
281277
}
282278

283-
old_reprs = nfp_app_reprs_set(app, NFP_REPR_TYPE_PHYS_PORT, reprs);
284-
if (IS_ERR(old_reprs)) {
285-
err = PTR_ERR(old_reprs);
286-
goto err_reprs_clean;
287-
}
279+
nfp_app_reprs_set(app, NFP_REPR_TYPE_PHYS_PORT, reprs);
288280

289281
/* The MAC_REPR control message should be sent after the MAC
290282
* representors are registered using nfp_app_reprs_set(). This is

drivers/net/ethernet/netronome/nfp/nfp_app.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,8 @@ nfp_app_reprs_set(struct nfp_app *app, enum nfp_repr_type type,
106106

107107
old = rcu_dereference_protected(app->reprs[type],
108108
lockdep_is_held(&app->pf->lock));
109-
if (reprs && old) {
110-
old = ERR_PTR(-EBUSY);
111-
goto exit_unlock;
112-
}
113-
114109
rcu_assign_pointer(app->reprs[type], reprs);
115110

116-
exit_unlock:
117111
return old;
118112
}
119113

0 commit comments

Comments
 (0)