Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Or Gerlitz <or.gerlitz@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>,
	Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Subject: Re: [PATCH net-next] mlx4_en: dont change mac_header on xmit
Date: Sun, 04 Mar 2012 07:56:50 -0800	[thread overview]
Message-ID: <1330876610.2730.23.camel@edumazet-laptop> (raw)
In-Reply-To: <CAJZOPZKAwrx-u_onDQCCxipkLPdZkPE6cokRtZOa1uRZiZTYug@mail.gmail.com>

Le dimanche 04 mars 2012 à 13:19 +0200, Or Gerlitz a écrit :
> > +       ethh = (struct ethhdr *)skb->data;
> > +       tx_desc->ctrl.srcrb_flags16[0] = get_unaligned((u16 *)ethh->h_dest);
> > +       tx_desc->ctrl.imm = get_unaligned((u32 *)(ethh->h_dest + 2));
> 
> Hi Eric,
> 
> commit 622121719934f60378279eb440d3cec2fc3176d2 of your triggers the
> below sparse
> warnings, could you advise what would be the correct way to fix that out?
> 
> Or.
> 
>  CHECK   drivers/net/ethernet/mellanox/mlx4/en_tx.c
> drivers/net/ethernet/mellanox/mlx4/en_tx.c:689:40: warning: incorrect
> type in assignment (different base types)
> drivers/net/ethernet/mellanox/mlx4/en_tx.c:689:40:    expected
> restricted __be16 <noident>
> drivers/net/ethernet/mellanox/mlx4/en_tx.c:689:40:    got unsigned
> short [unsigned] <noident>
> drivers/net/ethernet/mellanox/mlx4/en_tx.c:690:27: warning: incorrect
> type in assignment (different base types)
> drivers/net/ethernet/mellanox/mlx4/en_tx.c:690:27:    expected
> restricted __be32 [usertype] imm
> drivers/net/ethernet/mellanox/mlx4/en_tx.c:690:27:    got unsigned int
> [unsigned] <noident>

Oh yes, I forgot about sparse, sorry.
By the way you have existing problems about ctrl_flags

drivers/net/ethernet/mellanox/mlx4/en_netdev.c:1013:34: warning: invalid assignment: |=
drivers/net/ethernet/mellanox/mlx4/en_netdev.c:1013:34:    left side has type unsigned int
drivers/net/ethernet/mellanox/mlx4/en_netdev.c:1013:34:    right side has type restricted __be32
drivers/net/ethernet/mellanox/mlx4/en_netdev.c:1015:34: warning: invalid assignment: &=
drivers/net/ethernet/mellanox/mlx4/en_netdev.c:1015:34:    left side has type unsigned int
drivers/net/ethernet/mellanox/mlx4/en_netdev.c:1015:34:    right side has type restricted __be32
drivers/net/ethernet/mellanox/mlx4/en_netdev.c:1069:26: warning: incorrect type in assignment (different base types)
drivers/net/ethernet/mellanox/mlx4/en_netdev.c:1069:26:    expected unsigned int [unsigned] [usertype] ctrl_flags
drivers/net/ethernet/mellanox/mlx4/en_netdev.c:1069:26:    got restricted __be32 [usertype] <noident>


Probably something like this is needed, but you also need to take a look
at the ctrl_flags problem.

I have to run, will submit official patch at the end of the (sunny)day,
if you dont beat me ;)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
index 2fd5140..50b3fa5 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
@@ -686,8 +686,8 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	/* Copy dst mac address to wqe */
 	ethh = (struct ethhdr *)skb->data;
-	tx_desc->ctrl.srcrb_flags16[0] = get_unaligned((u16 *)ethh->h_dest);
-	tx_desc->ctrl.imm = get_unaligned((u32 *)(ethh->h_dest + 2));
+	tx_desc->ctrl.srcrb_flags16[0] = get_unaligned((__be16 *)ethh->h_dest);
+	tx_desc->ctrl.imm = get_unaligned((__be32 *)(ethh->h_dest + 2));
 	/* Handle LSO (TSO) packets */
 	if (lso_header_size) {
 		/* Mark opcode as LSO */

  reply	other threads:[~2012-03-04 15:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-25 10:51 [PATCH net-next] mlx4_en: dont change mac_header on xmit Eric Dumazet
2012-03-04 11:19 ` Or Gerlitz
2012-03-04 15:56   ` Eric Dumazet [this message]
2012-03-04 20:02     ` Or Gerlitz
2012-03-05 15:01     ` [PATCH net-next] mlx4_en: remove sparse errors Eric Dumazet
2012-03-05 21:43       ` David Miller
     [not found] <953B660C027164448AE903364AC447D2618B88E7@MTLDAG02.mtl.com>
2012-02-26 19:12 ` [PATCH net-next] mlx4_en: dont change mac_header on xmit Eugenia Emantayev
2012-02-26 19:27   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1330876610.2730.23.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=or.gerlitz@gmail.com \
    --cc=yevgenyp@mellanox.co.il \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox