bnx2x:Fix error handling in the function bnxc2x_dbcx_set_params
Subsystems (2)
Quoted 4 lines
This fixes the error handling in the function
bnxc2x_dbcx_paramsfor both calls tobnx2x_dcbnl_update_applistby checking if they failed by returning a error code and if so return immediately to this function's caller due to this nonrecoverable internal failure.
Hi Nicholas,
Even assuming this is the reasonable thing to do [which I'm not fully convinced], I don't think this solution is complete - you'd also need to break the iteration in bnx2x_dcbnl_update_applist() [at the moment said function always returns 'rc' from the last dcb_app weve tried setting].
Also, why do you send multiple patches for fixing the same issue in different functions in the same file?
Thanks,
Yuval
Quoted 35 lines
Signed-off-by Nicholas Krause <[email protected]>--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c +2
-1@@ -724,7 +724,8 @@ void bnx2x_dcbx_set_params(struct bnx2x *bp, u32state) * Delete app tlvs from dcbnl before reading new * negotiation results */ -bnx2x_dcbnl_update_applist (bp, true); +if (bnx2x_dcbnl_update_applist (bp, true)) +return ;/* Read remote mib if dcbx is in the FW */ drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c +2
-1if (bnx2x_dcbx_read_shmem_remote_mib (bp))@@ -748,7 +749,8 @@ void bnx2x_dcbx_set_params(struct bnx2x *bp, u32 state)/* * Add new app tlvs to dcbnl */ -bnx2x_dcbnl_update_applist (bp ,false ); +if (bnx2x_dcbnl_update_applist (bp, false)) +return ;#endif /* * reconfigure the netdevice with the results of the new
--
2.1.4
Quoted 3 lines
I am used to sending out one patch per each fix like this for each function. If you don't like me doing this I don't when sending patches for your subsystem(s).
I think that would be preferable.
Quoted 6 lines
In addition would something like this fix your complains about not fixing error handling in
bnx2x_dcbnl_update_applist.
intbnx2x_dcbnl_update_applist(struct bnx2x *bp, bool delall){(quoted diff) +0
-0int i, err = 0; for (i = 0; i < DCBX_MAX_APP_PROTOCOL && err == 0; i++) {
...
Review
Quoted 3 lines
err = dcb_setapp(bp->dev, &app);(quoted diff) +2
-0+ if (err) + break;
Well, either that or retain the fact there's an error and return it at the end.