diff options
author | Eliezer Tamir <eliezert@broadcom.com> | 2008-02-28 14:57:55 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-02-28 14:57:55 -0500 |
commit | 96fc1784007bf194399759e9b7d9c836c7bbda2a (patch) | |
tree | a6807c454b097b0642f83faeab35c3ee7db6dd91 /drivers/net | |
parent | e8717a47266b1527e620ddf262613b9d010bbbe7 (diff) |
[BNX2X]: Fix Xmit bugs
Several endianity corrections in start_xmit()
Fixed TSO bug where packets were missing the TCP flags.
Signed-off-by: Eliezer Tamir <eliezert@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/bnx2x.c | 12 | ||||
-rw-r--r-- | drivers/net/bnx2x.h | 3 |
2 files changed, 10 insertions, 5 deletions
diff --git a/drivers/net/bnx2x.c b/drivers/net/bnx2x.c index d21599cfeb89..2db0427b0c92 100644 --- a/drivers/net/bnx2x.c +++ b/drivers/net/bnx2x.c | |||
@@ -9269,7 +9269,7 @@ static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
9269 | 9269 | ||
9270 | /* for now NS flag is not used in Linux */ | 9270 | /* for now NS flag is not used in Linux */ |
9271 | pbd->global_data = (len | | 9271 | pbd->global_data = (len | |
9272 | ((skb->protocol == ETH_P_8021Q) << | 9272 | ((skb->protocol == ntohs(ETH_P_8021Q)) << |
9273 | ETH_TX_PARSE_BD_LLC_SNAP_EN_SHIFT)); | 9273 | ETH_TX_PARSE_BD_LLC_SNAP_EN_SHIFT)); |
9274 | pbd->ip_hlen = ip_hdrlen(skb) / 2; | 9274 | pbd->ip_hlen = ip_hdrlen(skb) / 2; |
9275 | pbd->total_hlen = cpu_to_le16(len + pbd->ip_hlen); | 9275 | pbd->total_hlen = cpu_to_le16(len + pbd->ip_hlen); |
@@ -9278,7 +9278,7 @@ static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
9278 | 9278 | ||
9279 | tx_bd->bd_flags.as_bitfield |= | 9279 | tx_bd->bd_flags.as_bitfield |= |
9280 | ETH_TX_BD_FLAGS_TCP_CSUM; | 9280 | ETH_TX_BD_FLAGS_TCP_CSUM; |
9281 | pbd->tcp_flags = htonl(tcp_flag_word(skb)) & 0xFFFF; | 9281 | pbd->tcp_flags = pbd_tcp_flags(skb); |
9282 | pbd->total_hlen += cpu_to_le16(tcp_hdrlen(skb) / 2); | 9282 | pbd->total_hlen += cpu_to_le16(tcp_hdrlen(skb) / 2); |
9283 | pbd->tcp_pseudo_csum = swab16(th->check); | 9283 | pbd->tcp_pseudo_csum = swab16(th->check); |
9284 | 9284 | ||
@@ -9322,7 +9322,7 @@ static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
9322 | 9322 | ||
9323 | if (skb_shinfo(skb)->gso_size && | 9323 | if (skb_shinfo(skb)->gso_size && |
9324 | (skb->len > (bp->dev->mtu + ETH_HLEN))) { | 9324 | (skb->len > (bp->dev->mtu + ETH_HLEN))) { |
9325 | int hlen = 2 * le32_to_cpu(pbd->total_hlen); | 9325 | int hlen = 2 * le16_to_cpu(pbd->total_hlen); |
9326 | 9326 | ||
9327 | DP(NETIF_MSG_TX_QUEUED, | 9327 | DP(NETIF_MSG_TX_QUEUED, |
9328 | "TSO packet len %d hlen %d total len %d tso size %d\n", | 9328 | "TSO packet len %d hlen %d total len %d tso size %d\n", |
@@ -9439,9 +9439,11 @@ static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
9439 | 9439 | ||
9440 | DP(NETIF_MSG_TX_QUEUED, "doorbell: nbd %u bd %d\n", nbd, bd_prod); | 9440 | DP(NETIF_MSG_TX_QUEUED, "doorbell: nbd %u bd %d\n", nbd, bd_prod); |
9441 | 9441 | ||
9442 | fp->hw_tx_prods->bds_prod += cpu_to_le16(nbd); | 9442 | fp->hw_tx_prods->bds_prod = |
9443 | cpu_to_le16(le16_to_cpu(fp->hw_tx_prods->bds_prod) + nbd); | ||
9443 | mb(); /* FW restriction: must not reorder writing nbd and packets */ | 9444 | mb(); /* FW restriction: must not reorder writing nbd and packets */ |
9444 | fp->hw_tx_prods->packets_prod += cpu_to_le32(1); | 9445 | fp->hw_tx_prods->packets_prod = |
9446 | cpu_to_le32(le32_to_cpu(fp->hw_tx_prods->packets_prod) + 1); | ||
9445 | DOORBELL(bp, fp_index, 0); | 9447 | DOORBELL(bp, fp_index, 0); |
9446 | 9448 | ||
9447 | mmiowb(); | 9449 | mmiowb(); |
diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index 6a86afbc7525..4f0c0d31e7c1 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h | |||
@@ -869,6 +869,9 @@ struct bnx2x { | |||
869 | #define PCICFG_LINK_SPEED_SHIFT 16 | 869 | #define PCICFG_LINK_SPEED_SHIFT 16 |
870 | 870 | ||
871 | #define BMAC_CONTROL_RX_ENABLE 2 | 871 | #define BMAC_CONTROL_RX_ENABLE 2 |
872 | |||
873 | #define pbd_tcp_flags(skb) (ntohl(tcp_flag_word(tcp_hdr(skb)))>>16 & 0xff) | ||
874 | |||
872 | /* stuff added to make the code fit 80Col */ | 875 | /* stuff added to make the code fit 80Col */ |
873 | 876 | ||
874 | #define TPA_TYPE_START ETH_FAST_PATH_RX_CQE_START_FLG | 877 | #define TPA_TYPE_START ETH_FAST_PATH_RX_CQE_START_FLG |