Thread (12 messages) flat view 12 messages, 3 authors, 2012-09-13

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 statistics
query
quoted
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 3
times\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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help