netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] be2net: remove BUG_ON() in be_mcc_compl_is_new()
@ 2013-02-13  9:05 Sathya Perla
  2013-02-13 18:53 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Sathya Perla @ 2013-02-13  9:05 UTC (permalink / raw)
  To: netdev; +Cc: Sathya Perla

The current code expects that the last word (with valid bit)
of an MCC compl is DMAed in one shot. This may not be the case.
Remove this assertion.

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
 drivers/net/ethernet/emulex/benet/be_cmds.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
index 8b04880..071aea7 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -93,13 +93,16 @@ static void be_mcc_notify(struct be_adapter *adapter)
  * little endian) */
 static inline bool be_mcc_compl_is_new(struct be_mcc_compl *compl)
 {
+	u32 flags;
+
 	if (compl->flags != 0) {
-		compl->flags = le32_to_cpu(compl->flags);
-		BUG_ON((compl->flags & CQE_FLAGS_VALID_MASK) == 0);
-		return true;
-	} else {
-		return false;
+		flags = le32_to_cpu(compl->flags);
+		if (flags & CQE_FLAGS_VALID_MASK) {
+			compl->flags = flags;
+			return true;
+		}
 	}
+	return false;
 }
 
 /* Need to reset the entire word that houses the valid bit */
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] be2net: remove BUG_ON() in be_mcc_compl_is_new()
  2013-02-13  9:05 [PATCH net-next] be2net: remove BUG_ON() in be_mcc_compl_is_new() Sathya Perla
@ 2013-02-13 18:53 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-02-13 18:53 UTC (permalink / raw)
  To: sathya.perla; +Cc: netdev

From: Sathya Perla <sathya.perla@emulex.com>
Date: Wed, 13 Feb 2013 14:35:19 +0530

> The current code expects that the last word (with valid bit)
> of an MCC compl is DMAed in one shot. This may not be the case.
> Remove this assertion.
> 
> Signed-off-by: Sathya Perla <sathya.perla@emulex.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-02-13 18:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-13  9:05 [PATCH net-next] be2net: remove BUG_ON() in be_mcc_compl_is_new() Sathya Perla
2013-02-13 18:53 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).