bnx2x: further annotations
Subsystems (2)
PATCH 8/9 bnx2x: further annotations
No functional annotations, just documenting the status quo.
--- drivers/net/bnx2x_hsi.h | 8 ++++---- drivers/net/bnx2x_main.c | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/net/bnx2x_hsi.h +4 -4
@@ -1955,10 +1955,10 @@ struct eth_tx_parse_bd {#define ETH_TX_PARSE_BD_CWR_FLG_SHIFT 7u8 ip_hlen;s8 cs_offset; -u16 total_hlen; -u16 lso_mss; +__le16 total_hlen; +__le16 lso_mss;u16 tcp_pseudo_csum; -u16 ip_id; +__le16 ip_id;u32 tcp_send_seq; };
@@ -2424,7 +2424,7 @@ struct tstorm_cam_entry {u16 lsb_mac_addr;u16 middle_mac_addr;u16 msb_mac_addr; -u16 flags; +__le16 flags;#define TSTORM_CAM_ENTRY_PORT_ID (0x1<<0)#define TSTORM_CAM_ENTRY_PORT_ID_SHIFT 0#define TSTORM_CAM_ENTRY_RSRVVAL0 (0x7<<1)
drivers/net/bnx2x_main.c +5 -5
@@ -468,7 +468,7 @@ static int bnx2x_mc_assert(struct bnx2x *bp)static void bnx2x_fw_dump (struct bnx2x *bp) {u32 mark, offset; -u32 data[9 ]; +__be32 data[9 ];int word; mark =REG_RD (bp,MCP_REG_MCPR_SCRATCH +0xf104 );
@@ -479,14 +479,14 @@ static void bnx2x_fw_dump(struct bnx2x *bp)for (word =0 ; word <8 ; word++) data[word] =htonl (REG_RD (bp,MCP_REG_MCPR_SCRATCH + offset +4 *word)); - data[8 ] =0x0 ; + data[8 ] =cpu_to_be32 (0 );printk (KERN_CONT "%s" , (char *)data); }for (offset =0xF108 ; offset <= mark -0x08000000 ; offset +=0x8 *4 ) {for (word =0 ; word <8 ; word++) data[word] =htonl (REG_RD (bp,MCP_REG_MCPR_SCRATCH + offset +4 *word)); - data[8 ] =0x0 ; + data[8 ] =cpu_to_be32 (0 );printk (KERN_CONT "%s" , (char *)data); }printk ("\n" KERN_ERR PFX "end of fw dump\n" );
@@ -9699,11 +9699,11 @@ static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) bd_prod, ++nbd); pbd->lso_mss =cpu_to_le16 (skb_shinfo (skb)->gso_size); - pbd->tcp_send_seq =swab32 (tcp_hdr (skb)->seq); + pbd->tcp_send_seq =cpu_to_le32 (be32_to_cpu (tcp_hdr (skb)->seq)); pbd->tcp_flags =pbd_tcp_flags (skb); if (xmit_type & XMIT_GSO_V4) { - pbd->ip_id = swab16(ip_hdr(skb)->id); + pbd->ip_id = cpu_to_le16(be16_to_cpu(ip_hdr(skb)->id)); pbd->tcp_pseudo_csum = swab16(~csum_tcpudp_magic(ip_hdr(skb)->saddr, ip_hdr(skb)->daddr,
Signature · 1 line
1.6.1.249.g455e5
Quoted 3 lines · Harvey Harrison
No functional annotations, just documenting the status quo.
Signed-off-by Harvey Harrison <[email protected]>
[...]
drivers/net/bnx2x_main.c static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) · line 9702
Quoted 6 lines
drivers/net/bnx2x_main.c +1
-1@@ -9699,11 +9699,11 @@ static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) bd_prod, ++nbd); pbd->lso_mss =cpu_to_le16 (skb_shinfo (skb)->gso_size); - pbd->tcp_send_seq =swab32 (tcp_hdr (skb)->seq); + pbd->tcp_send_seq =cpu_to_le32 (be32_to_cpu (tcp_hdr (skb)->seq));
Hmmm.... That looks worse to me. Do we really need to replace swab with cpu_to_le on top of be_to_cpu?
drivers/net/bnx2x_main.c static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) · line 9706
Quoted 5 lines
drivers/net/bnx2x_main.c +1
-1pbd->tcp_flags =pbd_tcp_flags (skb);if (xmit_type &XMIT_GSO_V4 ) { - pbd->ip_id =swab16 (ip_hdr (skb)->id); + pbd->ip_id =cpu_to_le16 (be16_to_cpu (ip_hdr (skb)->id));
Same question
Quoted 3 lines
drivers/net/bnx2x_main.c +0
-0pbd->tcp_pseudo_csum = swab16(~csum_tcpudp_magic(ip_hdr(skb)->saddr, ip_hdr(skb)->daddr,
Quoted 10 lines · Eilon Greenstein
Quoted 3 lines · Harvey Harrison
No functional annotations, just documenting the status quo.
Signed-off-by Harvey Harrison <[email protected]>[...]
Quoted 3 lines
drivers/net/bnx2x_main.c +0
-0@@ -9699,11 +9699,11 @@ static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) bd_prod, ++nbd);
Quoted 6 lines
drivers/net/bnx2x_main.c static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) · line 9702
Quoted 3 lines
drivers/net/bnx2x_main.c +1
-1pbd->lso_mss =cpu_to_le16 (skb_shinfo (skb)->gso_size); - pbd->tcp_send_seq =swab32 (tcp_hdr (skb)->seq); + pbd->tcp_send_seq =cpu_to_le32 (be32_to_cpu (tcp_hdr (skb)->seq));Hmmm.... That looks worse to me. Do we really need to replace swab with
cpu_to_leon top ofbe_to_cpu?
Agreed that it is ugly, in a future patch I was thinking of changing tcp_send_seq to just be treated as a be-value throughout the driver, or at least a cpu-endian.
These patches are more about documenting the status quo than making functional changes like that, so I went with the somewhat ugly annotation for now. Once the endian noise has been reduced, it will be a lot easier to make changes without introducing bugs.
Harvey