RE: [net PATCH v2 1/7] bnx2x: Avoid sending multiple statistics queries
From: Yuval Mintz <hidden>
Date: 2012-09-13 20:35:27
quoted
This patch prevents the sending of an additional instance of statisticsqueryquoted
while the previous query hasn't completed.This change results in no change in behavior as far as I can tell.quoted
- if (bnx2x_storm_stats_update(bp) && (bp->stats_pending++ == 3)) { - BNX2X_ERR("storm stats were not updated for 3 times\n"); - bnx2x_panic(); + if (bnx2x_storm_stats_update(bp)) { + if (bp->stats_pending++ == 3) { + BNX2X_ERR("storm stats were not updated for 3times\n");quoted
+ bnx2x_panic(); + }
But you're missing the 'return;' statement at the end.
There is no difference between:
if (A && B) {
C;
}
and:
if (A) {
if (B) {
C;
}
}
But there is a difference between:
If (A && B) {
C;
D;
}
And:
if (A) {
if (B) {
C;
}
D;
}
The point of this patch was not to change the condition of the print & panic but rather to guarantee that
if bnx2x_storm_stats_update failed, no more ramrods will be posted, as the function will return
(regardless of stats_pending value).
Sorry it wasn't clearer in the patch.