netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 11/34]bnx2x: Endianness issues
@ 2009-01-14 16:43 Eilon Greenstein
  2009-01-15  5:27 ` David Miller
  2009-01-18 16:59 ` Christoph Hellwig
  0 siblings, 2 replies; 5+ messages in thread
From: Eilon Greenstein @ 2009-01-14 16:43 UTC (permalink / raw)
  To: David Miller, netdev

Adding missing le_to_cpu and disabling wrong HW endianity flag (the two complete
each other)

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/bnx2x_main.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index ba56d1c..d32b98f 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -1454,7 +1454,7 @@ static int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
 		DP(NETIF_MSG_RX_STATUS, "CQE type %x  err %x  status %x"
 		   "  queue %x  vlan %x  len %u\n", CQE_TYPE(cqe_fp_flags),
 		   cqe_fp_flags, cqe->fast_path_cqe.status_flags,
-		   cqe->fast_path_cqe.rss_hash_result,
+		   le32_to_cpu(cqe->fast_path_cqe.rss_hash_result),
 		   le16_to_cpu(cqe->fast_path_cqe.vlan_tag),
 		   le16_to_cpu(cqe->fast_path_cqe.pkt_len));
 
@@ -2837,8 +2837,10 @@ static void bnx2x_attn_int_deasserted(struct bnx2x *bp, u32 deasserted)
 static void bnx2x_attn_int(struct bnx2x *bp)
 {
 	/* read local copy of bits */
-	u32 attn_bits = bp->def_status_blk->atten_status_block.attn_bits;
-	u32 attn_ack = bp->def_status_blk->atten_status_block.attn_bits_ack;
+	u32 attn_bits = le32_to_cpu(bp->def_status_blk->atten_status_block.
+								attn_bits);
+	u32 attn_ack = le32_to_cpu(bp->def_status_blk->atten_status_block.
+								attn_bits_ack);
 	u32 attn_state = bp->attn_state;
 
 	/* look for changed bits */
@@ -2886,7 +2888,7 @@ static void bnx2x_sp_task(struct work_struct *work)
 	if (status & 0x2)
 		bp->stats_pending = 0;
 
-	bnx2x_ack_sb(bp, DEF_SB_ID, ATTENTION_ID, bp->def_att_idx,
+	bnx2x_ack_sb(bp, DEF_SB_ID, ATTENTION_ID, le16_to_cpu(bp->def_att_idx),
 		     IGU_INT_NOP, 1);
 	bnx2x_ack_sb(bp, DEF_SB_ID, USTORM_ID, le16_to_cpu(bp->def_u_idx),
 		     IGU_INT_NOP, 1);
@@ -5177,7 +5179,6 @@ static int bnx2x_init_common(struct bnx2x *bp)
 	REG_WR(bp, PXP2_REG_RQ_SRC_ENDIAN_M, 1);
 	REG_WR(bp, PXP2_REG_RQ_CDU_ENDIAN_M, 1);
 	REG_WR(bp, PXP2_REG_RQ_DBG_ENDIAN_M, 1);
-	REG_WR(bp, PXP2_REG_RQ_HC_ENDIAN_M, 1);
 
 /*	REG_WR(bp, PXP2_REG_RD_PBF_SWAP_MODE, 1); */
 	REG_WR(bp, PXP2_REG_RD_QM_SWAP_MODE, 1);
-- 
1.5.4.3





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

* Re: [PATCH 11/34]bnx2x: Endianness issues
  2009-01-14 16:43 [PATCH 11/34]bnx2x: Endianness issues Eilon Greenstein
@ 2009-01-15  5:27 ` David Miller
  2009-01-18 16:59 ` Christoph Hellwig
  1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2009-01-15  5:27 UTC (permalink / raw)
  To: eilong; +Cc: netdev

From: "Eilon Greenstein" <eilong@broadcom.com>
Date: Wed, 14 Jan 2009 18:43:15 +0200

> Adding missing le_to_cpu and disabling wrong HW endianity flag (the
> two complete each other)
>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>

Applied.

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

* Re: [PATCH 11/34]bnx2x: Endianness issues
  2009-01-14 16:43 [PATCH 11/34]bnx2x: Endianness issues Eilon Greenstein
  2009-01-15  5:27 ` David Miller
@ 2009-01-18 16:59 ` Christoph Hellwig
  2009-01-19 10:13   ` Eilon Greenstein
  1 sibling, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2009-01-18 16:59 UTC (permalink / raw)
  To: Eilon Greenstein; +Cc: David Miller, netdev

On Wed, Jan 14, 2009 at 06:43:15PM +0200, Eilon Greenstein wrote:
> Adding missing le_to_cpu and disabling wrong HW endianity flag (the two complete
> each other)

Did you run sparse over the driver to verify you've sorted out all
endianess issues?


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

* Re: [PATCH 11/34]bnx2x: Endianness issues
  2009-01-18 16:59 ` Christoph Hellwig
@ 2009-01-19 10:13   ` Eilon Greenstein
  2009-01-19 19:54     ` Harvey Harrison
  0 siblings, 1 reply; 5+ messages in thread
From: Eilon Greenstein @ 2009-01-19 10:13 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: David Miller, netdev

On Sun, 2009-01-18 at 08:59 -0800, Christoph Hellwig wrote:
> On Wed, Jan 14, 2009 at 06:43:15PM +0200, Eilon Greenstein wrote:
> > Adding missing le_to_cpu and disabling wrong HW endianity flag (the two complete
> > each other)
> 
> Did you run sparse over the driver to verify you've sorted out all
> endianess issues?
> 
No - those are errors with the FW/HW and not general issues. When
running sparse with CF=-D__CHECK_ENDIAN__ I get "too many warnings"...
So I cannot send the patch right now. I will definitely add it to my
queue and I hope to sort it out soon.

Eilon



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

* Re: [PATCH 11/34]bnx2x: Endianness issues
  2009-01-19 10:13   ` Eilon Greenstein
@ 2009-01-19 19:54     ` Harvey Harrison
  0 siblings, 0 replies; 5+ messages in thread
From: Harvey Harrison @ 2009-01-19 19:54 UTC (permalink / raw)
  To: Eilon Greenstein; +Cc: Christoph Hellwig, David Miller, netdev

On Mon, 2009-01-19 at 12:13 +0200, Eilon Greenstein wrote:
> On Sun, 2009-01-18 at 08:59 -0800, Christoph Hellwig wrote:
> > On Wed, Jan 14, 2009 at 06:43:15PM +0200, Eilon Greenstein wrote:
> > > Adding missing le_to_cpu and disabling wrong HW endianity flag (the two complete
> > > each other)
> > 
> > Did you run sparse over the driver to verify you've sorted out all
> > endianess issues?
> > 
> No - those are errors with the FW/HW and not general issues. When
> running sparse with CF=-D__CHECK_ENDIAN__ I get "too many warnings"...
> So I cannot send the patch right now. I will definitely add it to my
> queue and I hope to sort it out soon.
> 
> Eilon

I'll take a look as well.  BTW, make sure you don't have the trace all
if statements tracer enabled in your config or you'll be drowned in
shadowed variable warnings and won't be able to see anything from your
driver.

Harvey


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

end of thread, other threads:[~2009-01-19 20:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-14 16:43 [PATCH 11/34]bnx2x: Endianness issues Eilon Greenstein
2009-01-15  5:27 ` David Miller
2009-01-18 16:59 ` Christoph Hellwig
2009-01-19 10:13   ` Eilon Greenstein
2009-01-19 19:54     ` Harvey Harrison

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).