Skip to content

Commit 84fa793

Browse files
kaberDavid S. Miller
authored andcommitted
[NET]: Replace CHECKSUM_HW by CHECKSUM_PARTIAL/CHECKSUM_COMPLETE
Replace CHECKSUM_HW by CHECKSUM_PARTIAL (for outgoing packets, whose checksum still needs to be completed) and CHECKSUM_COMPLETE (for incoming packets, device supplied full checksum). Patch originally from Herbert Xu, updated by myself for 2.6.18-rc3. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 8584d6d commit 84fa793

72 files changed

Lines changed: 168 additions & 169 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎drivers/atm/he.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1912,7 +1912,7 @@ he_service_rbrq(struct he_dev *he_dev, int group)
19121912
skb->tail = skb->data + skb->len;
19131913
#ifdef USE_CHECKSUM_HW
19141914
if (vcc->vpi == 0 && vcc->vci >= ATM_NOT_RSV_VCI) {
1915-
skb->ip_summed = CHECKSUM_HW;
1915+
skb->ip_summed = CHECKSUM_COMPLETE;
19161916
skb->csum = TCP_CKSUM(skb->data,
19171917
he_vcc->pdu_len);
19181918
}

‎drivers/net/3c59x.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2077,7 +2077,7 @@ boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev)
20772077

20782078
vp->tx_ring[entry].next = 0;
20792079
#if DO_ZEROCOPY
2080-
if (skb->ip_summed != CHECKSUM_HW)
2080+
if (skb->ip_summed != CHECKSUM_PARTIAL)
20812081
vp->tx_ring[entry].status = cpu_to_le32(skb->len | TxIntrUploaded);
20822082
else
20832083
vp->tx_ring[entry].status = cpu_to_le32(skb->len | TxIntrUploaded | AddTCPChksum | AddUDPChksum);

‎drivers/net/8139cp.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
813813

814814
if (mss)
815815
flags |= LargeSend | ((mss & MSSMask) << MSSShift);
816-
else if (skb->ip_summed == CHECKSUM_HW) {
816+
else if (skb->ip_summed == CHECKSUM_PARTIAL) {
817817
const struct iphdr *ip = skb->nh.iph;
818818
if (ip->protocol == IPPROTO_TCP)
819819
flags |= IPCS | TCPCS;
@@ -867,7 +867,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
867867
if (mss)
868868
ctrl |= LargeSend |
869869
((mss & MSSMask) << MSSShift);
870-
else if (skb->ip_summed == CHECKSUM_HW) {
870+
else if (skb->ip_summed == CHECKSUM_PARTIAL) {
871871
if (ip->protocol == IPPROTO_TCP)
872872
ctrl |= IPCS | TCPCS;
873873
else if (ip->protocol == IPPROTO_UDP)
@@ -898,7 +898,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
898898
txd->addr = cpu_to_le64(first_mapping);
899899
wmb();
900900

901-
if (skb->ip_summed == CHECKSUM_HW) {
901+
if (skb->ip_summed == CHECKSUM_PARTIAL) {
902902
if (ip->protocol == IPPROTO_TCP)
903903
txd->opts1 = cpu_to_le32(first_eor | first_len |
904904
FirstFrag | DescOwn |

‎drivers/net/acenic.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2040,7 +2040,7 @@ static void ace_rx_int(struct net_device *dev, u32 rxretprd, u32 rxretcsm)
20402040
*/
20412041
if (bd_flags & BD_FLG_TCP_UDP_SUM) {
20422042
skb->csum = htons(csum);
2043-
skb->ip_summed = CHECKSUM_HW;
2043+
skb->ip_summed = CHECKSUM_COMPLETE;
20442044
} else {
20452045
skb->ip_summed = CHECKSUM_NONE;
20462046
}
@@ -2511,7 +2511,7 @@ static int ace_start_xmit(struct sk_buff *skb, struct net_device *dev)
25112511

25122512
mapping = ace_map_tx_skb(ap, skb, skb, idx);
25132513
flagsize = (skb->len << 16) | (BD_FLG_END);
2514-
if (skb->ip_summed == CHECKSUM_HW)
2514+
if (skb->ip_summed == CHECKSUM_PARTIAL)
25152515
flagsize |= BD_FLG_TCP_UDP_SUM;
25162516
#if ACENIC_DO_VLAN
25172517
if (vlan_tx_tag_present(skb)) {
@@ -2534,7 +2534,7 @@ static int ace_start_xmit(struct sk_buff *skb, struct net_device *dev)
25342534

25352535
mapping = ace_map_tx_skb(ap, skb, NULL, idx);
25362536
flagsize = (skb_headlen(skb) << 16);
2537-
if (skb->ip_summed == CHECKSUM_HW)
2537+
if (skb->ip_summed == CHECKSUM_PARTIAL)
25382538
flagsize |= BD_FLG_TCP_UDP_SUM;
25392539
#if ACENIC_DO_VLAN
25402540
if (vlan_tx_tag_present(skb)) {
@@ -2560,7 +2560,7 @@ static int ace_start_xmit(struct sk_buff *skb, struct net_device *dev)
25602560
PCI_DMA_TODEVICE);
25612561

25622562
flagsize = (frag->size << 16);
2563-
if (skb->ip_summed == CHECKSUM_HW)
2563+
if (skb->ip_summed == CHECKSUM_PARTIAL)
25642564
flagsize |= BD_FLG_TCP_UDP_SUM;
25652565
idx = (idx + 1) % ACE_TX_RING_ENTRIES(ap);
25662566

‎drivers/net/bnx2.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4423,7 +4423,7 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
44234423
ring_prod = TX_RING_IDX(prod);
44244424

44254425
vlan_tag_flags = 0;
4426-
if (skb->ip_summed == CHECKSUM_HW) {
4426+
if (skb->ip_summed == CHECKSUM_PARTIAL) {
44274427
vlan_tag_flags |= TX_BD_FLAGS_TCP_UDP_CKSUM;
44284428
}
44294429

‎drivers/net/cassini.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2167,7 +2167,7 @@ static int cas_rx_process_pkt(struct cas *cp, struct cas_rx_comp *rxc,
21672167
cas_page_unmap(addr);
21682168
}
21692169
skb->csum = ntohs(i ^ 0xffff);
2170-
skb->ip_summed = CHECKSUM_HW;
2170+
skb->ip_summed = CHECKSUM_COMPLETE;
21712171
skb->protocol = eth_type_trans(skb, cp->dev);
21722172
return len;
21732173
}
@@ -2821,7 +2821,7 @@ static inline int cas_xmit_tx_ringN(struct cas *cp, int ring,
28212821
}
28222822

28232823
ctrl = 0;
2824-
if (skb->ip_summed == CHECKSUM_HW) {
2824+
if (skb->ip_summed == CHECKSUM_PARTIAL) {
28252825
u64 csum_start_off, csum_stuff_off;
28262826

28272827
csum_start_off = (u64) (skb->h.raw - skb->data);

‎drivers/net/chelsio/sge.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,9 +1470,9 @@ int t1_start_xmit(struct sk_buff *skb, struct net_device *dev)
14701470
}
14711471

14721472
if (!(adapter->flags & UDP_CSUM_CAPABLE) &&
1473-
skb->ip_summed == CHECKSUM_HW &&
1473+
skb->ip_summed == CHECKSUM_PARTIAL &&
14741474
skb->nh.iph->protocol == IPPROTO_UDP)
1475-
if (unlikely(skb_checksum_help(skb, 0))) {
1475+
if (unlikely(skb_checksum_help(skb))) {
14761476
dev_kfree_skb_any(skb);
14771477
return NETDEV_TX_OK;
14781478
}
@@ -1495,11 +1495,11 @@ int t1_start_xmit(struct sk_buff *skb, struct net_device *dev)
14951495
cpl = (struct cpl_tx_pkt *)__skb_push(skb, sizeof(*cpl));
14961496
cpl->opcode = CPL_TX_PKT;
14971497
cpl->ip_csum_dis = 1; /* SW calculates IP csum */
1498-
cpl->l4_csum_dis = skb->ip_summed == CHECKSUM_HW ? 0 : 1;
1498+
cpl->l4_csum_dis = skb->ip_summed == CHECKSUM_PARTIAL ? 0 : 1;
14991499
/* the length field isn't used so don't bother setting it */
15001500

1501-
st->tx_cso += (skb->ip_summed == CHECKSUM_HW);
1502-
sge->stats.tx_do_cksum += (skb->ip_summed == CHECKSUM_HW);
1501+
st->tx_cso += (skb->ip_summed == CHECKSUM_PARTIAL);
1502+
sge->stats.tx_do_cksum += (skb->ip_summed == CHECKSUM_PARTIAL);
15031503
sge->stats.tx_reg_pkts++;
15041504
}
15051505
cpl->iff = dev->if_port;

‎drivers/net/dl2k.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ start_xmit (struct sk_buff *skb, struct net_device *dev)
611611
txdesc = &np->tx_ring[entry];
612612

613613
#if 0
614-
if (skb->ip_summed == CHECKSUM_HW) {
614+
if (skb->ip_summed == CHECKSUM_PARTIAL) {
615615
txdesc->status |=
616616
cpu_to_le64 (TCPChecksumEnable | UDPChecksumEnable |
617617
IPChecksumEnable);

‎drivers/net/e1000/e1000_main.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2600,7 +2600,7 @@ e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
26002600
unsigned int i;
26012601
uint8_t css;
26022602

2603-
if (likely(skb->ip_summed == CHECKSUM_HW)) {
2603+
if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
26042604
css = skb->h.raw - skb->data;
26052605

26062606
i = tx_ring->next_to_use;
@@ -2927,11 +2927,11 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
29272927
}
29282928

29292929
/* reserve a descriptor for the offload context */
2930-
if ((mss) || (skb->ip_summed == CHECKSUM_HW))
2930+
if ((mss) || (skb->ip_summed == CHECKSUM_PARTIAL))
29312931
count++;
29322932
count++;
29332933
#else
2934-
if (skb->ip_summed == CHECKSUM_HW)
2934+
if (skb->ip_summed == CHECKSUM_PARTIAL)
29352935
count++;
29362936
#endif
29372937

@@ -3608,7 +3608,7 @@ e1000_rx_checksum(struct e1000_adapter *adapter,
36083608
*/
36093609
csum = ntohl(csum ^ 0xFFFF);
36103610
skb->csum = csum;
3611-
skb->ip_summed = CHECKSUM_HW;
3611+
skb->ip_summed = CHECKSUM_COMPLETE;
36123612
}
36133613
adapter->hw_csum_good++;
36143614
}

‎drivers/net/forcedeth.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1503,7 +1503,8 @@ static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
15031503
tx_flags_extra = NV_TX2_TSO | (skb_shinfo(skb)->gso_size << NV_TX2_TSO_SHIFT);
15041504
else
15051505
#endif
1506-
tx_flags_extra = (skb->ip_summed == CHECKSUM_HW ? (NV_TX2_CHECKSUM_L3|NV_TX2_CHECKSUM_L4) : 0);
1506+
tx_flags_extra = skb->ip_summed == CHECKSUM_PARTIAL ?
1507+
NV_TX2_CHECKSUM_L3 | NV_TX2_CHECKSUM_L4 : 0;
15071508

15081509
/* vlan tag */
15091510
if (np->vlangrp && vlan_tx_tag_present(skb)) {

0 commit comments

Comments
 (0)