[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1330876610.2730.23.camel@edumazet-laptop>
Date: Sun, 04 Mar 2012 07:56:50 -0800
From: Eric Dumazet <eric.dumazet@...il.com>
To: Or Gerlitz <or.gerlitz@...il.com>
Cc: David Miller <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>,
Yevgeny Petrilin <yevgenyp@...lanox.co.il>
Subject: Re: [PATCH net-next] mlx4_en: dont change mac_header on xmit
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 */
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists