[NET]: Replace CHECKSUM_HW by CHECKSUM_PARTIAL/CHECKSUM_COMPLETE
authorPatrick McHardy <kaber@trash.net>
Tue, 29 Aug 2006 23:44:56 +0000 (16:44 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Fri, 22 Sep 2006 21:53:53 +0000 (14:53 -0700)
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>
72 files changed:
drivers/atm/he.c
drivers/net/3c59x.c
drivers/net/8139cp.c
drivers/net/acenic.c
drivers/net/bnx2.c
drivers/net/cassini.c
drivers/net/chelsio/sge.c
drivers/net/dl2k.c
drivers/net/e1000/e1000_main.c
drivers/net/forcedeth.c
drivers/net/gianfar.c
drivers/net/hamachi.c
drivers/net/ibm_emac/ibm_emac_core.c
drivers/net/ioc3-eth.c
drivers/net/ixgb/ixgb_main.c
drivers/net/mv643xx_eth.c
drivers/net/myri10ge/myri10ge.c
drivers/net/ns83820.c
drivers/net/r8169.c
drivers/net/s2io.c
drivers/net/sk98lin/skge.c
drivers/net/skge.c
drivers/net/sky2.c
drivers/net/starfire.c
drivers/net/sungem.c
drivers/net/sunhme.c
drivers/net/tg3.c
drivers/net/typhoon.c
drivers/net/via-rhine.c
drivers/net/via-velocity.c
include/linux/netdevice.h
include/linux/skbuff.h
net/core/datagram.c
net/core/dev.c
net/core/netpoll.c
net/core/skbuff.c
net/ipv4/icmp.c
net/ipv4/igmp.c
net/ipv4/ip_fragment.c
net/ipv4/ip_gre.c
net/ipv4/ip_output.c
net/ipv4/ipvs/ip_vs_proto_tcp.c
net/ipv4/ipvs/ip_vs_proto_udp.c
net/ipv4/netfilter.c
net/ipv4/netfilter/ip_conntrack_proto_tcp.c
net/ipv4/netfilter/ip_conntrack_proto_udp.c
net/ipv4/netfilter/ip_nat_standalone.c
net/ipv4/netfilter/ip_queue.c
net/ipv4/netfilter/ipt_ECN.c
net/ipv4/netfilter/ipt_TCPMSS.c
net/ipv4/tcp.c
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_output.c
net/ipv4/udp.c
net/ipv4/xfrm4_output.c
net/ipv6/exthdrs.c
net/ipv6/icmp.c
net/ipv6/ip6_output.c
net/ipv6/netfilter.c
net/ipv6/netfilter/ip6_queue.c
net/ipv6/netfilter/nf_conntrack_reasm.c
net/ipv6/raw.c
net/ipv6/reassembly.c
net/ipv6/tcp_ipv6.c
net/ipv6/udp.c
net/ipv6/xfrm6_output.c
net/netfilter/nf_conntrack_proto_tcp.c
net/netfilter/nf_conntrack_proto_udp.c
net/netfilter/nfnetlink_queue.c
net/packet/af_packet.c
net/sched/sch_netem.c
net/sunrpc/socklib.c

index ffcb9fd31c38fbdd7a1efbb2b52eb6f7e5d2c116..41e052fecd7fdfe60f4f571ee2e13ae439c3ad39 100644 (file)
@@ -1912,7 +1912,7 @@ he_service_rbrq(struct he_dev *he_dev, int group)
                                skb->tail = skb->data + skb->len;
 #ifdef USE_CHECKSUM_HW
                                if (vcc->vpi == 0 && vcc->vci >= ATM_NOT_RSV_VCI) {
-                                       skb->ip_summed = CHECKSUM_HW;
+                                       skb->ip_summed = CHECKSUM_COMPLETE;
                                        skb->csum = TCP_CKSUM(skb->data,
                                                        he_vcc->pdu_len);
                                }
index 80e8ca013e448a96e54af66220810e80b3c794fb..29dede2eaa850d3d1f7fca430697b8a65c844498 100644 (file)
@@ -2077,7 +2077,7 @@ boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
        vp->tx_ring[entry].next = 0;
 #if DO_ZEROCOPY
-       if (skb->ip_summed != CHECKSUM_HW)
+       if (skb->ip_summed != CHECKSUM_PARTIAL)
                        vp->tx_ring[entry].status = cpu_to_le32(skb->len | TxIntrUploaded);
        else
                        vp->tx_ring[entry].status = cpu_to_le32(skb->len | TxIntrUploaded | AddTCPChksum | AddUDPChksum);
index 1428bb7715afd16a04fb6132cd560b420636d111..a48b211c489dfe947b1683af9d0cde36e2bb0846 100644 (file)
@@ -813,7 +813,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
 
                if (mss)
                        flags |= LargeSend | ((mss & MSSMask) << MSSShift);
-               else if (skb->ip_summed == CHECKSUM_HW) {
+               else if (skb->ip_summed == CHECKSUM_PARTIAL) {
                        const struct iphdr *ip = skb->nh.iph;
                        if (ip->protocol == IPPROTO_TCP)
                                flags |= IPCS | TCPCS;
@@ -867,7 +867,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
                        if (mss)
                                ctrl |= LargeSend |
                                        ((mss & MSSMask) << MSSShift);
-                       else if (skb->ip_summed == CHECKSUM_HW) {
+                       else if (skb->ip_summed == CHECKSUM_PARTIAL) {
                                if (ip->protocol == IPPROTO_TCP)
                                        ctrl |= IPCS | TCPCS;
                                else if (ip->protocol == IPPROTO_UDP)
@@ -898,7 +898,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
                txd->addr = cpu_to_le64(first_mapping);
                wmb();
 
-               if (skb->ip_summed == CHECKSUM_HW) {
+               if (skb->ip_summed == CHECKSUM_PARTIAL) {
                        if (ip->protocol == IPPROTO_TCP)
                                txd->opts1 = cpu_to_le32(first_eor | first_len |
                                                         FirstFrag | DescOwn |
index 1c01e9b3d07c88cd2856232d268736ac77d87adc..826548644d7b13779dda4a67a9809e13d972d843 100644 (file)
@@ -2040,7 +2040,7 @@ static void ace_rx_int(struct net_device *dev, u32 rxretprd, u32 rxretcsm)
                 */
                if (bd_flags & BD_FLG_TCP_UDP_SUM) {
                        skb->csum = htons(csum);
-                       skb->ip_summed = CHECKSUM_HW;
+                       skb->ip_summed = CHECKSUM_COMPLETE;
                } else {
                        skb->ip_summed = CHECKSUM_NONE;
                }
@@ -2511,7 +2511,7 @@ restart:
 
                mapping = ace_map_tx_skb(ap, skb, skb, idx);
                flagsize = (skb->len << 16) | (BD_FLG_END);
-               if (skb->ip_summed == CHECKSUM_HW)
+               if (skb->ip_summed == CHECKSUM_PARTIAL)
                        flagsize |= BD_FLG_TCP_UDP_SUM;
 #if ACENIC_DO_VLAN
                if (vlan_tx_tag_present(skb)) {
@@ -2534,7 +2534,7 @@ restart:
 
                mapping = ace_map_tx_skb(ap, skb, NULL, idx);
                flagsize = (skb_headlen(skb) << 16);
-               if (skb->ip_summed == CHECKSUM_HW)
+               if (skb->ip_summed == CHECKSUM_PARTIAL)
                        flagsize |= BD_FLG_TCP_UDP_SUM;
 #if ACENIC_DO_VLAN
                if (vlan_tx_tag_present(skb)) {
@@ -2560,7 +2560,7 @@ restart:
                                               PCI_DMA_TODEVICE);
 
                        flagsize = (frag->size << 16);
-                       if (skb->ip_summed == CHECKSUM_HW)
+                       if (skb->ip_summed == CHECKSUM_PARTIAL)
                                flagsize |= BD_FLG_TCP_UDP_SUM;
                        idx = (idx + 1) % ACE_TX_RING_ENTRIES(ap);
 
index 652eb05a6c2df6c7e406eef8ecbfa82cfcb03564..7857b463012447c404eb256206921427cc20d56c 100644 (file)
@@ -4423,7 +4423,7 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
        ring_prod = TX_RING_IDX(prod);
 
        vlan_tag_flags = 0;
-       if (skb->ip_summed == CHECKSUM_HW) {
+       if (skb->ip_summed == CHECKSUM_PARTIAL) {
                vlan_tag_flags |= TX_BD_FLAGS_TCP_UDP_CKSUM;
        }
 
index a31544ccb3c494aed1e63cd01335aca8d2926583..558fdb8ad2dc248a2250d4f61cd8ccf879989920 100644 (file)
@@ -2167,7 +2167,7 @@ end_copy_pkt:
                        cas_page_unmap(addr);
        }
        skb->csum = ntohs(i ^ 0xffff);
-       skb->ip_summed = CHECKSUM_HW;
+       skb->ip_summed = CHECKSUM_COMPLETE;
        skb->protocol = eth_type_trans(skb, cp->dev);
        return len;
 }
@@ -2821,7 +2821,7 @@ static inline int cas_xmit_tx_ringN(struct cas *cp, int ring,
        }
 
        ctrl = 0;
-       if (skb->ip_summed == CHECKSUM_HW) {
+       if (skb->ip_summed == CHECKSUM_PARTIAL) {
                u64 csum_start_off, csum_stuff_off;
 
                csum_start_off = (u64) (skb->h.raw - skb->data);
index 61b3754f50ff6645a16b7f8352dcb57b699b1dcc..ddd0bdb498f4f4f7dcf1bbd62c614dd21756f6e7 100644 (file)
@@ -1470,9 +1470,9 @@ int t1_start_xmit(struct sk_buff *skb, struct net_device *dev)
                }
 
                if (!(adapter->flags & UDP_CSUM_CAPABLE) &&
-                   skb->ip_summed == CHECKSUM_HW &&
+                   skb->ip_summed == CHECKSUM_PARTIAL &&
                    skb->nh.iph->protocol == IPPROTO_UDP)
-                       if (unlikely(skb_checksum_help(skb, 0))) {
+                       if (unlikely(skb_checksum_help(skb))) {
                                dev_kfree_skb_any(skb);
                                return NETDEV_TX_OK;
                        }
@@ -1495,11 +1495,11 @@ int t1_start_xmit(struct sk_buff *skb, struct net_device *dev)
                cpl = (struct cpl_tx_pkt *)__skb_push(skb, sizeof(*cpl));
                cpl->opcode = CPL_TX_PKT;
                cpl->ip_csum_dis = 1;    /* SW calculates IP csum */
-               cpl->l4_csum_dis = skb->ip_summed == CHECKSUM_HW ? 0 : 1;
+               cpl->l4_csum_dis = skb->ip_summed == CHECKSUM_PARTIAL ? 0 : 1;
                /* the length field isn't used so don't bother setting it */
 
-               st->tx_cso += (skb->ip_summed == CHECKSUM_HW);
-               sge->stats.tx_do_cksum += (skb->ip_summed == CHECKSUM_HW);
+               st->tx_cso += (skb->ip_summed == CHECKSUM_PARTIAL);
+               sge->stats.tx_do_cksum += (skb->ip_summed == CHECKSUM_PARTIAL);
                sge->stats.tx_reg_pkts++;
        }
        cpl->iff = dev->if_port;
index 402961e68c89fca4223fc07503274367668c9117..b74e67654764f22d374c802ca51838ab6e749e1b 100644 (file)
@@ -611,7 +611,7 @@ start_xmit (struct sk_buff *skb, struct net_device *dev)
        txdesc = &np->tx_ring[entry];
 
 #if 0
-       if (skb->ip_summed == CHECKSUM_HW) {
+       if (skb->ip_summed == CHECKSUM_PARTIAL) {
                txdesc->status |=
                    cpu_to_le64 (TCPChecksumEnable | UDPChecksumEnable |
                                 IPChecksumEnable);
index 98ef9f85482f0b15578e0ee08c9ced8b5b90ccfa..2ab9f96f5dab899274a1bfb024f5094a7f5c9879 100644 (file)
@@ -2600,7 +2600,7 @@ e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
        unsigned int i;
        uint8_t css;
 
-       if (likely(skb->ip_summed == CHECKSUM_HW)) {
+       if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
                css = skb->h.raw - skb->data;
 
                i = tx_ring->next_to_use;
@@ -2927,11 +2927,11 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
        }
 
        /* reserve a descriptor for the offload context */
-       if ((mss) || (skb->ip_summed == CHECKSUM_HW))
+       if ((mss) || (skb->ip_summed == CHECKSUM_PARTIAL))
                count++;
        count++;
 #else
-       if (skb->ip_summed == CHECKSUM_HW)
+       if (skb->ip_summed == CHECKSUM_PARTIAL)
                count++;
 #endif
 
@@ -3608,7 +3608,7 @@ e1000_rx_checksum(struct e1000_adapter *adapter,
                 */
                csum = ntohl(csum ^ 0xFFFF);
                skb->csum = csum;
-               skb->ip_summed = CHECKSUM_HW;
+               skb->ip_summed = CHECKSUM_COMPLETE;
        }
        adapter->hw_csum_good++;
 }
index 11b8f1b43dd5994a255c1b6613d0cfa868a4bdeb..32cacf115f754f0c500432363d930c01ceb39ebd 100644 (file)
@@ -1503,7 +1503,8 @@ static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
                tx_flags_extra = NV_TX2_TSO | (skb_shinfo(skb)->gso_size << NV_TX2_TSO_SHIFT);
        else
 #endif
-       tx_flags_extra = (skb->ip_summed == CHECKSUM_HW ? (NV_TX2_CHECKSUM_L3|NV_TX2_CHECKSUM_L4) : 0);
+       tx_flags_extra = skb->ip_summed == CHECKSUM_PARTIAL ?
+                        NV_TX2_CHECKSUM_L3 | NV_TX2_CHECKSUM_L4 : 0;
 
        /* vlan tag */
        if (np->vlangrp && vlan_tx_tag_present(skb)) {
index ebbbd6ca6204e28ba605cd980d8b6d5e1a408047..ba960913c034f08d8485235b1de3ccb1b04bf187 100644 (file)
@@ -947,7 +947,7 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
        /* Set up checksumming */
        if (likely((dev->features & NETIF_F_IP_CSUM)
-                       && (CHECKSUM_HW == skb->ip_summed))) {
+                       && (CHECKSUM_PARTIAL == skb->ip_summed))) {
                fcb = gfar_add_fcb(skb, txbdp);
                status |= TXBD_TOE;
                gfar_tx_checksum(skb, fcb);
index 409c6aab0411c510431ce16d562eeb02943d62bb..763373ae966601c3dbaacb4d74f4e9deb5922de9 100644 (file)
@@ -1648,7 +1648,7 @@ static int hamachi_rx(struct net_device *dev)
                                                * could do the pseudo myself and return
                                                * CHECKSUM_UNNECESSARY
                                                */
-                                               skb->ip_summed = CHECKSUM_HW;
+                                               skb->ip_summed = CHECKSUM_COMPLETE;
                                        }
                                }       
                        }
index 82468e2dc7991dfc386ccae6d96ccfba8aa36f65..57e214d85e9ac4cd5601fd686888ce489da91c98 100644 (file)
@@ -1036,7 +1036,7 @@ static inline u16 emac_tx_csum(struct ocp_enet_private *dev,
                               struct sk_buff *skb)
 {
 #if defined(CONFIG_IBM_EMAC_TAH)
-       if (skb->ip_summed == CHECKSUM_HW) {
+       if (skb->ip_summed == CHECKSUM_PARTIAL) {
                ++dev->stats.tx_packets_csum;
                return EMAC_TX_CTRL_TAH_CSUM;
        }
index 68d8af7df08e31fe6e1bee61f7c495782ceba1ec..65f897ddb9205ce83ec443a2f56b1b0344dff2e3 100644 (file)
@@ -1387,7 +1387,7 @@ static int ioc3_start_xmit(struct sk_buff *skb, struct net_device *dev)
         * MAC header which should not be summed and the TCP/UDP pseudo headers
         * manually.
         */
-       if (skb->ip_summed == CHECKSUM_HW) {
+       if (skb->ip_summed == CHECKSUM_PARTIAL) {
                int proto = ntohs(skb->nh.iph->protocol);
                unsigned int csoff;
                struct iphdr *ih = skb->nh.iph;
index 7bbd447289b58df7906c396d6948701770ff2c6e..9405b44f321485913df35f118b26a31b15f6e154 100644 (file)
@@ -1232,7 +1232,7 @@ ixgb_tx_csum(struct ixgb_adapter *adapter, struct sk_buff *skb)
        unsigned int i;
        uint8_t css, cso;
 
-       if(likely(skb->ip_summed == CHECKSUM_HW)) {
+       if(likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
                css = skb->h.raw - skb->data;
                cso = (skb->h.raw + skb->csum) - skb->data;
 
index eeab1df5bef3fba416adb963ce557db02f2ba734..38df58fdb358e8d7719fb2b577c6ccb91cf1a7c3 100644 (file)
@@ -1147,7 +1147,7 @@ static void eth_tx_submit_descs_for_skb(struct mv643xx_private *mp,
        desc->byte_cnt = length;
        desc->buf_ptr = dma_map_single(NULL, skb->data, length, DMA_TO_DEVICE);
 
-       if (skb->ip_summed == CHECKSUM_HW) {
+       if (skb->ip_summed == CHECKSUM_PARTIAL) {
                BUG_ON(skb->protocol != ETH_P_IP);
 
                cmd_sts |= ETH_GEN_TCP_UDP_CHECKSUM |
index 9bdd43ab3573afb5981b456d9a50b0a7a7c6ce73..9f16681d0e7ee7c3b2a00bde3e4fb14542c8554b 100644 (file)
@@ -930,7 +930,7 @@ static inline void myri10ge_vlan_ip_csum(struct sk_buff *skb, u16 hw_csum)
            (vh->h_vlan_encapsulated_proto == htons(ETH_P_IP) ||
             vh->h_vlan_encapsulated_proto == htons(ETH_P_IPV6))) {
                skb->csum = hw_csum;
-               skb->ip_summed = CHECKSUM_HW;
+               skb->ip_summed = CHECKSUM_COMPLETE;
        }
 }
 
@@ -973,7 +973,7 @@ myri10ge_rx_done(struct myri10ge_priv *mgp, struct myri10ge_rx_buf *rx,
                if ((skb->protocol == ntohs(ETH_P_IP)) ||
                    (skb->protocol == ntohs(ETH_P_IPV6))) {
                        skb->csum = ntohs((u16) csum);
-                       skb->ip_summed = CHECKSUM_HW;
+                       skb->ip_summed = CHECKSUM_COMPLETE;
                } else
                        myri10ge_vlan_ip_csum(skb, ntohs((u16) csum));
        }
@@ -1897,13 +1897,13 @@ again:
        pseudo_hdr_offset = 0;
        odd_flag = 0;
        flags = (MXGEFW_FLAGS_NO_TSO | MXGEFW_FLAGS_FIRST);
-       if (likely(skb->ip_summed == CHECKSUM_HW)) {
+       if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
                cksum_offset = (skb->h.raw - skb->data);
                pseudo_hdr_offset = (skb->h.raw + skb->csum) - skb->data;
                /* If the headers are excessively large, then we must
                 * fall back to a software checksum */
                if (unlikely(cksum_offset > 255 || pseudo_hdr_offset > 127)) {
-                       if (skb_checksum_help(skb, 0))
+                       if (skb_checksum_help(skb))
                                goto drop;
                        cksum_offset = 0;
                        pseudo_hdr_offset = 0;
index 0e76859c90a2af03b3c967b4bf1bd1061b34d236..5143f5dbb2e53e34f52a83a0a08d9bad57dbb566 100644 (file)
@@ -1153,7 +1153,7 @@ again:
        if (!nr_frags)
                frag = NULL;
        extsts = 0;
-       if (skb->ip_summed == CHECKSUM_HW) {
+       if (skb->ip_summed == CHECKSUM_PARTIAL) {
                extsts |= EXTSTS_IPPKT;
                if (IPPROTO_TCP == skb->nh.iph->protocol)
                        extsts |= EXTSTS_TCPPKT;
index 4c2f575faad709db506ce5c250ab81eefacd2e79..d9b960aa9b0dbfaa44298288335d6e73b8ab2c32 100644 (file)
@@ -2169,7 +2169,7 @@ static inline u32 rtl8169_tso_csum(struct sk_buff *skb, struct net_device *dev)
                if (mss)
                        return LargeSend | ((mss & MSSMask) << MSSShift);
        }
-       if (skb->ip_summed == CHECKSUM_HW) {
+       if (skb->ip_summed == CHECKSUM_PARTIAL) {
                const struct iphdr *ip = skb->nh.iph;
 
                if (ip->protocol == IPPROTO_TCP)
index e72e0e099060f6386f22e3800dfdef76aa326e1e..5b3713f622d7229915ba5425e254232bebb9be25 100644 (file)
@@ -3893,7 +3893,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
                txdp->Control_1 |= TXD_TCP_LSO_MSS(s2io_tcp_mss(skb));
        }
 #endif
-       if (skb->ip_summed == CHECKSUM_HW) {
+       if (skb->ip_summed == CHECKSUM_PARTIAL) {
                txdp->Control_2 |=
                    (TXD_TX_CKO_IPV4_EN | TXD_TX_CKO_TCP_EN |
                     TXD_TX_CKO_UDP_EN);
index ee62845d3ac9d9140eea0e2a8c0e801ce75a9682..eb3b35180c2fabbc669c614dd9ad2d4751758c6f 100644 (file)
@@ -1559,7 +1559,7 @@ struct sk_buff    *pMessage)      /* pointer to send-message              */
        pTxd->VDataHigh = (SK_U32) (PhysAddr >> 32);
        pTxd->pMBuf     = pMessage;
 
-       if (pMessage->ip_summed == CHECKSUM_HW) {
+       if (pMessage->ip_summed == CHECKSUM_PARTIAL) {
                u16 hdrlen = pMessage->h.raw - pMessage->data;
                u16 offset = hdrlen + pMessage->csum;
 
@@ -1678,7 +1678,7 @@ struct sk_buff    *pMessage)      /* pointer to send-message              */
        /* 
        ** Does the HW need to evaluate checksum for TCP or UDP packets? 
        */
-       if (pMessage->ip_summed == CHECKSUM_HW) {
+       if (pMessage->ip_summed == CHECKSUM_PARTIAL) {
                u16 hdrlen = pMessage->h.raw - pMessage->data;
                u16 offset = hdrlen + pMessage->csum;
 
@@ -2158,7 +2158,7 @@ rx_start:
 
 #ifdef USE_SK_RX_CHECKSUM
                pMsg->csum = pRxd->TcpSums & 0xffff;
-               pMsg->ip_summed = CHECKSUM_HW;
+               pMsg->ip_summed = CHECKSUM_COMPLETE;
 #else
                pMsg->ip_summed = CHECKSUM_NONE;
 #endif
index ad878dfddef461395ce80c00bad17df9a34a1733..b3d6fa3d6df4b54d0b85fa3c33759600aa347921 100644 (file)
@@ -2338,7 +2338,7 @@ static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev)
        td->dma_lo = map;
        td->dma_hi = map >> 32;
 
-       if (skb->ip_summed == CHECKSUM_HW) {
+       if (skb->ip_summed == CHECKSUM_PARTIAL) {
                int offset = skb->h.raw - skb->data;
 
                /* This seems backwards, but it is what the sk98lin
@@ -2642,7 +2642,7 @@ static inline struct sk_buff *skge_rx_get(struct skge_port *skge,
        skb->dev = skge->netdev;
        if (skge->rx_csum) {
                skb->csum = csum;
-               skb->ip_summed = CHECKSUM_HW;
+               skb->ip_summed = CHECKSUM_COMPLETE;
        }
 
        skb->protocol = eth_type_trans(skb, skge->netdev);
index 933e87f1cc687dc6c8c300af83f6725dde79c7d9..8e92566b587eeb26549362fa0eb849c16f2e9a5e 100644 (file)
@@ -1163,7 +1163,7 @@ static unsigned tx_le_req(const struct sk_buff *skb)
        if (skb_is_gso(skb))
                ++count;
 
-       if (skb->ip_summed == CHECKSUM_HW)
+       if (skb->ip_summed == CHECKSUM_PARTIAL)
                ++count;
 
        return count;
@@ -1272,7 +1272,7 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)
 #endif
 
        /* Handle TCP checksum offload */
-       if (skb->ip_summed == CHECKSUM_HW) {
+       if (skb->ip_summed == CHECKSUM_PARTIAL) {
                u16 hdr = skb->h.raw - skb->data;
                u16 offset = hdr + skb->csum;
 
@@ -2000,7 +2000,7 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do)
 #endif
                case OP_RXCHKS:
                        skb = sky2->rx_ring[sky2->rx_next].skb;
-                       skb->ip_summed = CHECKSUM_HW;
+                       skb->ip_summed = CHECKSUM_COMPLETE;
                        skb->csum = le16_to_cpu(status);
                        break;
 
index c0a62b00ffc896879be84b96fbca0572692d46e3..2607aa51d8e034267d5883d116bd11f8a128455c 100644 (file)
@@ -1230,7 +1230,7 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev)
        }
 
 #if defined(ZEROCOPY) && defined(HAS_BROKEN_FIRMWARE)
-       if (skb->ip_summed == CHECKSUM_HW) {
+       if (skb->ip_summed == CHECKSUM_PARTIAL) {
                if (skb_padto(skb, (skb->len + PADDING_MASK) & ~PADDING_MASK))
                        return NETDEV_TX_OK;
        }
@@ -1252,7 +1252,7 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev)
                                status |= TxDescIntr;
                                np->reap_tx = 0;
                        }
-                       if (skb->ip_summed == CHECKSUM_HW) {
+                       if (skb->ip_summed == CHECKSUM_PARTIAL) {
                                status |= TxCalTCP;
                                np->stats.tx_compressed++;
                        }
@@ -1499,7 +1499,7 @@ static int __netdev_rx(struct net_device *dev, int *quota)
                 * Until then, the printk stays. :-) -Ion
                 */
                else if (le16_to_cpu(desc->status2) & 0x0040) {
-                       skb->ip_summed = CHECKSUM_HW;
+                       skb->ip_summed = CHECKSUM_COMPLETE;
                        skb->csum = le16_to_cpu(desc->csum);
                        printk(KERN_DEBUG "%s: checksum_hw, status2 = %#x\n", dev->name, le16_to_cpu(desc->status2));
                }
index d7b1d1882cab5fb773dc9ce58c6c12e9e9a233c2..b388651b78361182a510b51a93f1921fc03ac427 100644 (file)
@@ -855,7 +855,7 @@ static int gem_rx(struct gem *gp, int work_to_do)
                }
 
                skb->csum = ntohs((status & RXDCTRL_TCPCSUM) ^ 0xffff);
-               skb->ip_summed = CHECKSUM_HW;
+               skb->ip_summed = CHECKSUM_COMPLETE;
                skb->protocol = eth_type_trans(skb, gp->dev);
 
                netif_receive_skb(skb);
@@ -1026,7 +1026,7 @@ static int gem_start_xmit(struct sk_buff *skb, struct net_device *dev)
        unsigned long flags;
 
        ctrl = 0;
-       if (skb->ip_summed == CHECKSUM_HW) {
+       if (skb->ip_summed == CHECKSUM_PARTIAL) {
                u64 csum_start_off, csum_stuff_off;
 
                csum_start_off = (u64) (skb->h.raw - skb->data);
index c6f5bc3c042ffde958ba2841f1730d92ae325f82..17981da22730e270cf952198574a3c29e1517abe 100644 (file)
@@ -1207,7 +1207,7 @@ static void happy_meal_transceiver_check(struct happy_meal *hp, void __iomem *tr
  * flags, thus:
  *
  *     skb->csum = rxd->rx_flags & 0xffff;
- *     skb->ip_summed = CHECKSUM_HW;
+ *     skb->ip_summed = CHECKSUM_COMPLETE;
  *
  * before sending off the skb to the protocols, and we are good as gold.
  */
@@ -2074,7 +2074,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev)
 
                /* This card is _fucking_ hot... */
                skb->csum = ntohs(csum ^ 0xffff);
-               skb->ip_summed = CHECKSUM_HW;
+               skb->ip_summed = CHECKSUM_COMPLETE;
 
                RXD(("len=%d csum=%4x]", len, csum));
                skb->protocol = eth_type_trans(skb, dev);
@@ -2268,7 +2268,7 @@ static int happy_meal_start_xmit(struct sk_buff *skb, struct net_device *dev)
        u32 tx_flags;
 
        tx_flags = TXFLAG_OWN;
-       if (skb->ip_summed == CHECKSUM_HW) {
+       if (skb->ip_summed == CHECKSUM_PARTIAL) {
                u32 csum_start_off, csum_stuff_off;
 
                csum_start_off = (u32) (skb->h.raw - skb->data);
index eafabb253f08d244585e8be5e74164586c111f91..6f5d3a38c582291bdb830c41930cb8d296e2193e 100644 (file)
@@ -3851,11 +3851,11 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
                skb->h.th->check = 0;
 
        }
-       else if (skb->ip_summed == CHECKSUM_HW)
+       else if (skb->ip_summed == CHECKSUM_PARTIAL)
                base_flags |= TXD_FLAG_TCPUDP_CSUM;
 #else
        mss = 0;
-       if (skb->ip_summed == CHECKSUM_HW)
+       if (skb->ip_summed == CHECKSUM_PARTIAL)
                base_flags |= TXD_FLAG_TCPUDP_CSUM;
 #endif
 #if TG3_VLAN_TAG_USED
@@ -3981,7 +3981,7 @@ static int tg3_start_xmit_dma_bug(struct sk_buff *skb, struct net_device *dev)
 
        entry = tp->tx_prod;
        base_flags = 0;
-       if (skb->ip_summed == CHECKSUM_HW)
+       if (skb->ip_summed == CHECKSUM_PARTIAL)
                base_flags |= TXD_FLAG_TCPUDP_CSUM;
 #if TG3_TSO_SUPPORT != 0
        mss = 0;
index 4103c37172f9b154804f882ebf87be6ae3e26e29..c6e601dc6bbcfe16d9615832798dcaff5b88a18d 100644 (file)
@@ -830,7 +830,7 @@ typhoon_start_tx(struct sk_buff *skb, struct net_device *dev)
        first_txd->addrHi = (u64)((unsigned long) skb) >> 32;
        first_txd->processFlags = 0;
 
-       if(skb->ip_summed == CHECKSUM_HW) {
+       if(skb->ip_summed == CHECKSUM_PARTIAL) {
                /* The 3XP will figure out if this is UDP/TCP */
                first_txd->processFlags |= TYPHOON_TX_PF_TCP_CHKSUM;
                first_txd->processFlags |= TYPHOON_TX_PF_UDP_CHKSUM;
index ae971080e2e4389fb681f191c05b785d2984556e..66547159bfd9b8ec4cf367ca7d41182b9abdfd85 100644 (file)
@@ -1230,7 +1230,7 @@ static int rhine_start_tx(struct sk_buff *skb, struct net_device *dev)
        rp->tx_skbuff[entry] = skb;
 
        if ((rp->quirks & rqRhineI) &&
-           (((unsigned long)skb->data & 3) || skb_shinfo(skb)->nr_frags != 0 || skb->ip_summed == CHECKSUM_HW)) {
+           (((unsigned long)skb->data & 3) || skb_shinfo(skb)->nr_frags != 0 || skb->ip_summed == CHECKSUM_PARTIAL)) {
                /* Must use alignment buffer. */
                if (skb->len > PKT_BUF_SZ) {
                        /* packet too long, drop it */
index aa9cd92f46b2dbbb51716416acd4f26d503aca1c..f1e0c746a388e87110d623505c7655fa9a08eb19 100644 (file)
@@ -2002,7 +2002,7 @@ static int velocity_xmit(struct sk_buff *skb, struct net_device *dev)
         *      Handle hardware checksum
         */
        if ((vptr->flags & VELOCITY_FLAGS_TX_CSUM)
-                                && (skb->ip_summed == CHECKSUM_HW)) {
+                                && (skb->ip_summed == CHECKSUM_PARTIAL)) {
                struct iphdr *ip = skb->nh.iph;
                if (ip->protocol == IPPROTO_TCP)
                        td_ptr->tdesc1.TCR |= TCR0_TCPCK;
index 50a4719512ede141d2fbf045031ff2096227f98b..4f2c2b6beb5e14df087b59b037865dda35234d1d 100644 (file)
@@ -976,7 +976,7 @@ extern void         dev_mcast_init(void);
 extern int             netdev_max_backlog;
 extern int             weight_p;
 extern int             netdev_set_master(struct net_device *dev, struct net_device *master);
-extern int skb_checksum_help(struct sk_buff *skb, int inward);
+extern int skb_checksum_help(struct sk_buff *skb);
 extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features);
 #ifdef CONFIG_BUG
 extern void netdev_rx_csum_fault(struct net_device *dev);
@@ -1012,7 +1012,7 @@ static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
 {
        return skb_is_gso(skb) &&
               (!skb_gso_ok(skb, dev->features) ||
-               unlikely(skb->ip_summed != CHECKSUM_HW));
+               unlikely(skb->ip_summed != CHECKSUM_PARTIAL));
 }
 
 /* On bonding slaves other than the currently active slave, suppress
index 755e9cddac47eebe516751a55929f4339b576c5f..85577a4ffa618d5e319487ab396648a485c6223c 100644 (file)
@@ -34,8 +34,9 @@
 #define HAVE_ALIGNABLE_SKB     /* Ditto 8)                */
 
 #define CHECKSUM_NONE 0
-#define CHECKSUM_HW 1
+#define CHECKSUM_PARTIAL 1
 #define CHECKSUM_UNNECESSARY 2
+#define CHECKSUM_COMPLETE 3
 
 #define SKB_DATA_ALIGN(X)      (((X) + (SMP_CACHE_BYTES - 1)) & \
                                 ~(SMP_CACHE_BYTES - 1))
  *           Apparently with secret goal to sell you new device, when you
  *           will add new protocol to your host. F.e. IPv6. 8)
  *
- *     HW: the most generic way. Device supplied checksum of _all_
+ *     COMPLETE: the most generic way. Device supplied checksum of _all_
  *         the packet as seen by netif_rx in skb->csum.
  *         NOTE: Even if device supports only some protocols, but
- *         is able to produce some skb->csum, it MUST use HW,
+ *         is able to produce some skb->csum, it MUST use COMPLETE,
  *         not UNNECESSARY.
  *
  * B. Checksumming on output.
  *
  *     NONE: skb is checksummed by protocol or csum is not required.
  *
- *     HW: device is required to csum packet as seen by hard_start_xmit
+ *     PARTIAL: device is required to csum packet as seen by hard_start_xmit
  *     from skb->h.raw to the end and to record the checksum
  *     at skb->h.raw+skb->csum.
  *
@@ -1261,14 +1262,14 @@ static inline int skb_linearize_cow(struct sk_buff *skb)
  *     @len: length of data pulled
  *
  *     After doing a pull on a received packet, you need to call this to
- *     update the CHECKSUM_HW checksum, or set ip_summed to CHECKSUM_NONE
- *     so that it can be recomputed from scratch.
+ *     update the CHECKSUM_COMPLETE checksum, or set ip_summed to
+ *     CHECKSUM_NONE so that it can be recomputed from scratch.
  */
 
 static inline void skb_postpull_rcsum(struct sk_buff *skb,
                                      const void *start, unsigned int len)
 {
-       if (skb->ip_summed == CHECKSUM_HW)
+       if (skb->ip_summed == CHECKSUM_COMPLETE)
                skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0));
 }
 
@@ -1287,7 +1288,7 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len)
 {
        if (likely(len >= skb->len))
                return 0;
-       if (skb->ip_summed == CHECKSUM_HW)
+       if (skb->ip_summed == CHECKSUM_COMPLETE)
                skb->ip_summed = CHECKSUM_NONE;
        return __pskb_trim(skb, len);
 }
index aecddcc304012d48769e9f98b91157aa946cd60d..f558c61aecc7644dc9f7847f9f1bbb44ddafcf15 100644 (file)
@@ -417,7 +417,7 @@ unsigned int __skb_checksum_complete(struct sk_buff *skb)
 
        sum = (u16)csum_fold(skb_checksum(skb, 0, skb->len, skb->csum));
        if (likely(!sum)) {
-               if (unlikely(skb->ip_summed == CHECKSUM_HW))
+               if (unlikely(skb->ip_summed == CHECKSUM_COMPLETE))
                        netdev_rx_csum_fault(skb->dev);
                skb->ip_summed = CHECKSUM_UNNECESSARY;
        }
@@ -462,7 +462,7 @@ int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb,
                        goto fault;
                if ((unsigned short)csum_fold(csum))
                        goto csum_error;
-               if (unlikely(skb->ip_summed == CHECKSUM_HW))
+               if (unlikely(skb->ip_summed == CHECKSUM_COMPLETE))
                        netdev_rx_csum_fault(skb->dev);
                iov->iov_len -= chunk;
                iov->iov_base += chunk;
index d4a1ec3bded5f6afa92c0cbb860101b509f0f338..fc82f6f6e1c17dcfff62081088292ecc643d72e7 100644 (file)
@@ -1166,12 +1166,12 @@ EXPORT_SYMBOL(netif_device_attach);
  * Invalidate hardware checksum when packet is to be mangled, and
  * complete checksum manually on outgoing path.
  */
-int skb_checksum_help(struct sk_buff *skb, int inward)
+int skb_checksum_help(struct sk_buff *skb)
 {
        unsigned int csum;
        int ret = 0, offset = skb->h.raw - skb->data;
 
-       if (inward)
+       if (skb->ip_summed == CHECKSUM_COMPLETE)
                goto out_set_summed;
 
        if (unlikely(skb_shinfo(skb)->gso_size)) {
@@ -1223,7 +1223,7 @@ struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features)
        skb->mac_len = skb->nh.raw - skb->data;
        __skb_pull(skb, skb->mac_len);
 
-       if (unlikely(skb->ip_summed != CHECKSUM_HW)) {
+       if (unlikely(skb->ip_summed != CHECKSUM_PARTIAL)) {
                if (skb_header_cloned(skb) &&
                    (err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC)))
                        return ERR_PTR(err);
@@ -1232,7 +1232,7 @@ struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features)
        rcu_read_lock();
        list_for_each_entry_rcu(ptype, &ptype_base[ntohs(type) & 15], list) {
                if (ptype->type == type && !ptype->dev && ptype->gso_segment) {
-                       if (unlikely(skb->ip_summed != CHECKSUM_HW)) {
+                       if (unlikely(skb->ip_summed != CHECKSUM_PARTIAL)) {
                                err = ptype->gso_send_check(skb);
                                segs = ERR_PTR(err);
                                if (err || skb_gso_ok(skb, features))
@@ -1444,11 +1444,11 @@ int dev_queue_xmit(struct sk_buff *skb)
        /* If packet is not checksummed and device does not support
         * checksumming for this protocol, complete checksumming here.
         */
-       if (skb->ip_summed == CHECKSUM_HW &&
+       if (skb->ip_summed == CHECKSUM_PARTIAL &&
            (!(dev->features & NETIF_F_GEN_CSUM) &&
             (!(dev->features & NETIF_F_IP_CSUM) ||
              skb->protocol != htons(ETH_P_IP))))
-               if (skb_checksum_help(skb, 0))
+               if (skb_checksum_help(skb))
                        goto out_kfree_skb;
 
 gso:
index 471da451cd4879dce17a7fe5a4bc20ef0f5e8d38..ead5920c26d644d949369987f28adb83f461d1c9 100644 (file)
@@ -110,7 +110,7 @@ static int checksum_udp(struct sk_buff *skb, struct udphdr *uh,
 
        psum = csum_tcpudp_nofold(saddr, daddr, ulen, IPPROTO_UDP, 0);
 
-       if (skb->ip_summed == CHECKSUM_HW &&
+       if (skb->ip_summed == CHECKSUM_COMPLETE &&
            !(u16)csum_fold(csum_add(psum, skb->csum)))
                return 0;
 
index c54f3664bce5b0e868928df71c392dc18f89f2a0..8a476f1956e5868e947aa9a4834349b83cdd0855 100644 (file)
@@ -1397,7 +1397,7 @@ void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to)
        unsigned int csum;
        long csstart;
 
-       if (skb->ip_summed == CHECKSUM_HW)
+       if (skb->ip_summed == CHECKSUM_PARTIAL)
                csstart = skb->h.raw - skb->data;
        else
                csstart = skb_headlen(skb);
@@ -1411,7 +1411,7 @@ void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to)
                csum = skb_copy_and_csum_bits(skb, csstart, to + csstart,
                                              skb->len - csstart, 0);
 
-       if (skb->ip_summed == CHECKSUM_HW) {
+       if (skb->ip_summed == CHECKSUM_PARTIAL) {
                long csstuff = csstart + skb->csum;
 
                *((unsigned short *)(to + csstuff)) = csum_fold(csum);
@@ -1898,10 +1898,10 @@ int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb,
  *     @len: length of data pulled
  *
  *     This function performs an skb_pull on the packet and updates
- *     update the CHECKSUM_HW checksum.  It should be used on receive
- *     path processing instead of skb_pull unless you know that the
- *     checksum difference is zero (e.g., a valid IP header) or you
- *     are setting ip_summed to CHECKSUM_NONE.
+ *     update the CHECKSUM_COMPLETE checksum.  It should be used on
+ *     receive path processing instead of skb_pull unless you know
+ *     that the checksum difference is zero (e.g., a valid IP header)
+ *     or you are setting ip_summed to CHECKSUM_NONE.
  */
 unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len)
 {
@@ -1994,7 +1994,7 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features)
                frag = skb_shinfo(nskb)->frags;
                k = 0;
 
-               nskb->ip_summed = CHECKSUM_HW;
+               nskb->ip_summed = CHECKSUM_PARTIAL;
                nskb->csum = skb->csum;
                memcpy(skb_put(nskb, hsize), skb->data + offset, hsize);
 
index 6ad797c14163e84356f9c17177a1eb33f2e78da4..6d223e5c6741050577d09d9b27c5ac33a1010c2c 100644 (file)
@@ -930,7 +930,7 @@ int icmp_rcv(struct sk_buff *skb)
        ICMP_INC_STATS_BH(ICMP_MIB_INMSGS);
 
        switch (skb->ip_summed) {
-       case CHECKSUM_HW:
+       case CHECKSUM_COMPLETE:
                if (!(u16)csum_fold(skb->csum))
                        break;
                /* fall through */
index 8e8117c19e4db24ad74d55cfe540fb0d4c9816f3..7003e763d9700e9e48dcf9a5e2473bfd20a5b9ca 100644 (file)
@@ -931,7 +931,7 @@ int igmp_rcv(struct sk_buff *skb)
                goto drop;
 
        switch (skb->ip_summed) {
-       case CHECKSUM_HW:
+       case CHECKSUM_COMPLETE:
                if (!(u16)csum_fold(skb->csum))
                        break;
                /* fall through */
index b84b53a4752658e3f712328276f973f67069ea2a..8d7f107c2eefde9b982c5fee5d2b7babbb4778ac 100644 (file)
@@ -665,7 +665,7 @@ static struct sk_buff *ip_frag_reasm(struct ipq *qp, struct net_device *dev)
                head->len += fp->len;
                if (head->ip_summed != fp->ip_summed)
                        head->ip_summed = CHECKSUM_NONE;
-               else if (head->ip_summed == CHECKSUM_HW)
+               else if (head->ip_summed == CHECKSUM_COMPLETE)
                        head->csum = csum_add(head->csum, fp->csum);
                head->truesize += fp->truesize;
                atomic_sub(fp->truesize, &ip_frag_mem);
index 0f9b3a31997be8af4360f55ec77fa99f7da3f69f..e66f6ff2e1989a01411212dce8080fd699365908 100644 (file)
@@ -576,7 +576,7 @@ static int ipgre_rcv(struct sk_buff *skb)
 
                if (flags&GRE_CSUM) {
                        switch (skb->ip_summed) {
-                       case CHECKSUM_HW:
+                       case CHECKSUM_COMPLETE:
                                csum = (u16)csum_fold(skb->csum);
                                if (!csum)
                                        break;
@@ -584,7 +584,7 @@ static int ipgre_rcv(struct sk_buff *skb)
                        case CHECKSUM_NONE:
                                skb->csum = 0;
                                csum = __skb_checksum_complete(skb);
-                               skb->ip_summed = CHECKSUM_HW;
+                               skb->ip_summed = CHECKSUM_COMPLETE;
                        }
                        offset += 4;
                }
index 308bdeac3455a4576773f36df761fa7bdda1500e..1b9b6742ef77289e6f54cbfaf45f325738a118c9 100644 (file)
@@ -680,7 +680,7 @@ ip_generic_getfrag(void *from, char *to, int offset, int len, int odd, struct sk
 {
        struct iovec *iov = from;
 
-       if (skb->ip_summed == CHECKSUM_HW) {
+       if (skb->ip_summed == CHECKSUM_PARTIAL) {
                if (memcpy_fromiovecend(to, iov, offset, len) < 0)
                        return -EFAULT;
        } else {
@@ -736,7 +736,7 @@ static inline int ip_ufo_append_data(struct sock *sk,
                /* initialize protocol header pointer */
                skb->h.raw = skb->data + fragheaderlen;
 
-               skb->ip_summed = CHECKSUM_HW;
+               skb->ip_summed = CHECKSUM_PARTIAL;
                skb->csum = 0;
                sk->sk_sndmsg_off = 0;
        }
@@ -844,7 +844,7 @@ int ip_append_data(struct sock *sk,
            length + fragheaderlen <= mtu &&
            rt->u.dst.dev->features & NETIF_F_ALL_CSUM &&
            !exthdrlen)
-               csummode = CHECKSUM_HW;
+               csummode = CHECKSUM_PARTIAL;
 
        inet->cork.length += length;
        if (((length > mtu) && (sk->sk_protocol == IPPROTO_UDP)) &&
index bc28b1160a3aad85c93ee520f5c6a3ce660b7bf0..820e8318d10df06be7412054814838b41e6ad17d 100644 (file)
@@ -151,7 +151,7 @@ tcp_snat_handler(struct sk_buff **pskb,
                /* Only port and addr are changed, do fast csum update */
                tcp_fast_csum_update(tcph, cp->daddr, cp->vaddr,
                                     cp->dport, cp->vport);
-               if ((*pskb)->ip_summed == CHECKSUM_HW)
+               if ((*pskb)->ip_summed == CHECKSUM_COMPLETE)
                        (*pskb)->ip_summed = CHECKSUM_NONE;
        } else {
                /* full checksum calculation */
@@ -204,7 +204,7 @@ tcp_dnat_handler(struct sk_buff **pskb,
                /* Only port and addr are changed, do fast csum update */
                tcp_fast_csum_update(tcph, cp->vaddr, cp->daddr,
                                     cp->vport, cp->dport);
-               if ((*pskb)->ip_summed == CHECKSUM_HW)
+               if ((*pskb)->ip_summed == CHECKSUM_COMPLETE)
                        (*pskb)->ip_summed = CHECKSUM_NONE;
        } else {
                /* full checksum calculation */
@@ -229,7 +229,7 @@ tcp_csum_check(struct sk_buff *skb, struct ip_vs_protocol *pp)
        switch (skb->ip_summed) {
        case CHECKSUM_NONE:
                skb->csum = skb_checksum(skb, tcphoff, skb->len - tcphoff, 0);
-       case CHECKSUM_HW:
+       case CHECKSUM_COMPLETE:
                if (csum_tcpudp_magic(skb->nh.iph->saddr, skb->nh.iph->daddr,
                                      skb->len - tcphoff,
                                      skb->nh.iph->protocol, skb->csum)) {
@@ -239,7 +239,7 @@ tcp_csum_check(struct sk_buff *skb, struct ip_vs_protocol *pp)
                }
                break;
        default:
-               /* CHECKSUM_UNNECESSARY */
+               /* No need to checksum. */
                break;
        }
 
index 89d9175d8f288360463fde69a0248acc763abba4..90c8166c0ec129a5c84aa449876ef4139bab9e48 100644 (file)
@@ -161,7 +161,7 @@ udp_snat_handler(struct sk_buff **pskb,
                /* Only port and addr are changed, do fast csum update */
                udp_fast_csum_update(udph, cp->daddr, cp->vaddr,
                                     cp->dport, cp->vport);
-               if ((*pskb)->ip_summed == CHECKSUM_HW)
+               if ((*pskb)->ip_summed == CHECKSUM_COMPLETE)
                        (*pskb)->ip_summed = CHECKSUM_NONE;
        } else {
                /* full checksum calculation */
@@ -216,7 +216,7 @@ udp_dnat_handler(struct sk_buff **pskb,
                /* Only port and addr are changed, do fast csum update */
                udp_fast_csum_update(udph, cp->vaddr, cp->daddr,
                                     cp->vport, cp->dport);
-               if ((*pskb)->ip_summed == CHECKSUM_HW)
+               if ((*pskb)->ip_summed == CHECKSUM_COMPLETE)
                        (*pskb)->ip_summed = CHECKSUM_NONE;
        } else {
                /* full checksum calculation */
@@ -250,7 +250,7 @@ udp_csum_check(struct sk_buff *skb, struct ip_vs_protocol *pp)
                case CHECKSUM_NONE:
                        skb->csum = skb_checksum(skb, udphoff,
                                                 skb->len - udphoff, 0);
-               case CHECKSUM_HW:
+               case CHECKSUM_COMPLETE:
                        if (csum_tcpudp_magic(skb->nh.iph->saddr,
                                              skb->nh.iph->daddr,
                                              skb->len - udphoff,
@@ -262,7 +262,7 @@ udp_csum_check(struct sk_buff *skb, struct ip_vs_protocol *pp)
                        }
                        break;
                default:
-                       /* CHECKSUM_UNNECESSARY */
+                       /* No need to checksum. */
                        break;
                }
        }
index 6a9e34b794bc7d3c495566045ef2c38bad3a0c5d..f88347de21a9927a2877b11b0cf31d39979b6763 100644 (file)
@@ -168,7 +168,7 @@ unsigned int nf_ip_checksum(struct sk_buff *skb, unsigned int hook,
        unsigned int csum = 0;
 
        switch (skb->ip_summed) {
-       case CHECKSUM_HW:
+       case CHECKSUM_COMPLETE:
                if (hook != NF_IP_PRE_ROUTING && hook != NF_IP_LOCAL_IN)
                        break;
                if ((protocol == 0 && !(u16)csum_fold(skb->csum)) ||
index fb920e76ec106744746b7716a3ea54be01333e94..9de81ff645d508d7e81d74b8c471ac50155463b4 100644 (file)
@@ -865,8 +865,7 @@ static int tcp_error(struct sk_buff *skb,
   
        /* Checksum invalid? Ignore.
         * We skip checking packets on the outgoing path
-        * because the semantic of CHECKSUM_HW is different there 
-        * and moreover root might send raw packets.
+        * because it is assumed to be correct.
         */
        /* FIXME: Source route IP option packets --RR */
        if (ip_conntrack_checksum && hooknum == NF_IP_PRE_ROUTING &&
index 9b2c16b4d2ffdce020abb9a9ee1a7a941d7bf90a..e58e52f1455369d346344d655b8362fe7925637f 100644 (file)
@@ -117,8 +117,7 @@ static int udp_error(struct sk_buff *skb, enum ip_conntrack_info *ctinfo,
 
        /* Checksum invalid? Ignore.
         * We skip checking packets on the outgoing path
-        * because the semantic of CHECKSUM_HW is different there 
-        * and moreover root might send raw packets.
+        * because the checksum is assumed to be correct.
         * FIXME: Source route IP option packets --RR */
        if (ip_conntrack_checksum && hooknum == NF_IP_PRE_ROUTING &&
            nf_ip_checksum(skb, hooknum, iph->ihl * 4, IPPROTO_UDP)) {
index 17de077a790169166533da0a12056012b668f77d..f4f00c816d87415c6581c2742db17f49c6d8c5f7 100644 (file)
@@ -111,8 +111,9 @@ ip_nat_fn(unsigned int hooknum,
                       & htons(IP_MF|IP_OFFSET)));
 
        /* If we had a hardware checksum before, it's now invalid */
-       if ((*pskb)->ip_summed == CHECKSUM_HW)
-               if (skb_checksum_help(*pskb, (out == NULL)))
+       if ((*pskb)->ip_summed == CHECKSUM_PARTIAL ||
+           (*pskb)->ip_summed == CHECKSUM_COMPLETE)
+               if (skb_checksum_help(*pskb))
                        return NF_DROP;
 
        ct = ip_conntrack_get(*pskb, &ctinfo);
index 198ac36db861225ec879f21b3ce3b833b082ce0b..276a964ee6cfca0461f403c68e21640881190190 100644 (file)
@@ -208,9 +208,9 @@ ipq_build_packet_message(struct ipq_queue_entry *entry, int *errp)
                break;
        
        case IPQ_COPY_PACKET:
-               if (entry->skb->ip_summed == CHECKSUM_HW &&
-                   (*errp = skb_checksum_help(entry->skb,
-                                              entry->info->outdev == NULL))) {
+               if ((entry->skb->ip_summed == CHECKSUM_PARTIAL ||
+                    entry->skb->ip_summed == CHECKSUM_COMPLETE) &&
+                   (*errp = skb_checksum_help(entry->skb))) {
                        read_unlock_bh(&queue_lock);
                        return NULL;
                }
index 4adf5c9d34f52b964e84b9d183a313929554918f..4ec43f98fe492729322ff77b7838a27c50ea7342 100644 (file)
@@ -49,7 +49,7 @@ set_ect_ip(struct sk_buff **pskb, const struct ipt_ECN_info *einfo)
 
 /* Return 0 if there was an error. */
 static inline int
-set_ect_tcp(struct sk_buff **pskb, const struct ipt_ECN_info *einfo, int inward)
+set_ect_tcp(struct sk_buff **pskb, const struct ipt_ECN_info *einfo)
 {
        struct tcphdr _tcph, *tcph;
        u_int16_t diffs[2];
@@ -70,8 +70,9 @@ set_ect_tcp(struct sk_buff **pskb, const struct ipt_ECN_info *einfo, int inward)
                return 0;
        tcph = (void *)(*pskb)->nh.iph + (*pskb)->nh.iph->ihl*4;
 
-       if ((*pskb)->ip_summed == CHECKSUM_HW &&
-           skb_checksum_help(*pskb, inward))
+       if (((*pskb)->ip_summed == CHECKSUM_PARTIAL ||
+            (*pskb)->ip_summed == CHECKSUM_COMPLETE) &&
+           skb_checksum_help(*pskb))
                return 0;
 
        diffs[0] = ((u_int16_t *)tcph)[6];
@@ -106,7 +107,7 @@ target(struct sk_buff **pskb,
 
        if (einfo->operation & (IPT_ECN_OP_SET_ECE | IPT_ECN_OP_SET_CWR)
            && (*pskb)->nh.iph->protocol == IPPROTO_TCP)
-               if (!set_ect_tcp(pskb, einfo, (out == NULL)))
+               if (!set_ect_tcp(pskb, einfo))
                        return NF_DROP;
 
        return IPT_CONTINUE;
index ef2fe5b3f0d8f09f79ca5e501f1b93fbcf5ee772..c998dc0fcd1596e6349b212c202760672d12bf52 100644 (file)
@@ -62,8 +62,9 @@ ipt_tcpmss_target(struct sk_buff **pskb,
        if (!skb_make_writable(pskb, (*pskb)->len))
                return NF_DROP;
 
-       if ((*pskb)->ip_summed == CHECKSUM_HW &&
-           skb_checksum_help(*pskb, out == NULL))
+       if (((*pskb)->ip_summed == CHECKSUM_PARTIAL ||
+            (*pskb)->ip_summed == CHECKSUM_COMPLETE) &&
+           skb_checksum_help(*pskb))
                return NF_DROP;
 
        iph = (*pskb)->nh.iph;
index 934396bb1376f84b43dd60215c04466690686f93..b0124e69ab3839b9d5c5a5a4e55f0b4f91bea3fc 100644 (file)
@@ -568,7 +568,7 @@ new_segment:
                skb->truesize += copy;
                sk->sk_wmem_queued += copy;
                sk->sk_forward_alloc -= copy;
-               skb->ip_summed = CHECKSUM_HW;
+               skb->ip_summed = CHECKSUM_PARTIAL;
                tp->write_seq += copy;
                TCP_SKB_CB(skb)->end_seq += copy;
                skb_shinfo(skb)->gso_segs = 0;
@@ -723,7 +723,7 @@ new_segment:
                                 * Check whether we can use HW checksum.
                                 */
                                if (sk->sk_route_caps & NETIF_F_ALL_CSUM)
-                                       skb->ip_summed = CHECKSUM_HW;
+                                       skb->ip_summed = CHECKSUM_PARTIAL;
 
                                skb_entail(sk, tp, skb);
                                copy = size_goal;
@@ -2205,7 +2205,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features)
                th->fin = th->psh = 0;
 
                th->check = ~csum_fold(th->check + delta);
-               if (skb->ip_summed != CHECKSUM_HW)
+               if (skb->ip_summed != CHECKSUM_PARTIAL)
                        th->check = csum_fold(csum_partial(skb->h.raw, thlen,
                                                           skb->csum));
 
@@ -2219,7 +2219,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features)
 
        delta = htonl(oldlen + (skb->tail - skb->h.raw) + skb->data_len);
        th->check = ~csum_fold(th->check + delta);
-       if (skb->ip_summed != CHECKSUM_HW)
+       if (skb->ip_summed != CHECKSUM_PARTIAL)
                th->check = csum_fold(csum_partial(skb->h.raw, thlen,
                                                   skb->csum));
 
index 43f6740244f8f576853d97135a7a0c53d9e1c9d4..b2aa512a30e9d1e91890185c45387aa1843e122e 100644 (file)
@@ -484,7 +484,7 @@ void tcp_v4_send_check(struct sock *sk, int len, struct sk_buff *skb)
        struct inet_sock *inet = inet_sk(sk);
        struct tcphdr *th = skb->h.th;
 
-       if (skb->ip_summed == CHECKSUM_HW) {
+       if (skb->ip_summed == CHECKSUM_PARTIAL) {
                th->check = ~tcp_v4_check(th, len, inet->saddr, inet->daddr, 0);
                skb->csum = offsetof(struct tcphdr, check);
        } else {
@@ -509,7 +509,7 @@ int tcp_v4_gso_send_check(struct sk_buff *skb)
        th->check = 0;
        th->check = ~tcp_v4_check(th, skb->len, iph->saddr, iph->daddr, 0);
        skb->csum = offsetof(struct tcphdr, check);
-       skb->ip_summed = CHECKSUM_HW;
+       skb->ip_summed = CHECKSUM_PARTIAL;
        return 0;
 }
 
@@ -973,7 +973,7 @@ static struct sock *tcp_v4_hnd_req(struct sock *sk, struct sk_buff *skb)
 
 static int tcp_v4_checksum_init(struct sk_buff *skb)
 {
-       if (skb->ip_summed == CHECKSUM_HW) {
+       if (skb->ip_summed == CHECKSUM_COMPLETE) {
                if (!tcp_v4_check(skb->h.th, skb->len, skb->nh.iph->saddr,
                                  skb->nh.iph->daddr, skb->csum)) {
                        skb->ip_summed = CHECKSUM_UNNECESSARY;
index b4f3ffe1b3b4423211dd9f4e13e42f3d6ecbe230..9252a50c4b4908a0ee3129e8c4c32de65101aeea 100644 (file)
@@ -577,7 +577,7 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss
        TCP_SKB_CB(buff)->sacked = TCP_SKB_CB(skb)->sacked;
        TCP_SKB_CB(skb)->sacked &= ~TCPCB_AT_TAIL;
 
-       if (!skb_shinfo(skb)->nr_frags && skb->ip_summed != CHECKSUM_HW) {
+       if (!skb_shinfo(skb)->nr_frags && skb->ip_summed != CHECKSUM_PARTIAL) {
                /* Copy and checksum data tail into the new buffer. */
                buff->csum = csum_partial_copy_nocheck(skb->data + len, skb_put(buff, nsize),
                                                       nsize, 0);
@@ -586,7 +586,7 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss
 
                skb->csum = csum_block_sub(skb->csum, buff->csum, len);
        } else {
-               skb->ip_summed = CHECKSUM_HW;
+               skb->ip_summed = CHECKSUM_PARTIAL;
                skb_split(skb, buff, len);
        }
 
@@ -689,7 +689,7 @@ int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len)
                __pskb_trim_head(skb, len - skb_headlen(skb));
 
        TCP_SKB_CB(skb)->seq += len;
-       skb->ip_summed = CHECKSUM_HW;
+       skb->ip_summed = CHECKSUM_PARTIAL;
 
        skb->truesize        -= len;
        sk->sk_wmem_queued   -= len;
@@ -1062,7 +1062,7 @@ static int tso_fragment(struct sock *sk, struct sk_buff *skb, unsigned int len,
        /* This packet was never sent out yet, so no SACK bits. */
        TCP_SKB_CB(buff)->sacked = 0;
 
-       buff->ip_summed = skb->ip_summed = CHECKSUM_HW;
+       buff->ip_summed = skb->ip_summed = CHECKSUM_PARTIAL;
        skb_split(skb, buff, len);
 
        /* Fix up tso_factor for both original and new SKB.  */
@@ -1206,8 +1206,7 @@ static int tcp_mtu_probe(struct sock *sk)
        TCP_SKB_CB(nskb)->flags = TCPCB_FLAG_ACK;
        TCP_SKB_CB(nskb)->sacked = 0;
        nskb->csum = 0;
-       if (skb->ip_summed == CHECKSUM_HW)
-               nskb->ip_summed = CHECKSUM_HW;
+       nskb->ip_summed = skb->ip_summed;
 
        len = 0;
        while (len < probe_size) {
@@ -1231,7 +1230,7 @@ static int tcp_mtu_probe(struct sock *sk)
                                                   ~(TCPCB_FLAG_FIN|TCPCB_FLAG_PSH);
                        if (!skb_shinfo(skb)->nr_frags) {
                                skb_pull(skb, copy);
-                               if (skb->ip_summed != CHECKSUM_HW)
+                               if (skb->ip_summed != CHECKSUM_PARTIAL)
                                        skb->csum = csum_partial(skb->data, skb->len, 0);
                        } else {
                                __pskb_trim_head(skb, copy);
@@ -1572,10 +1571,9 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *skb, int m
 
                memcpy(skb_put(skb, next_skb_size), next_skb->data, next_skb_size);
 
-               if (next_skb->ip_summed == CHECKSUM_HW)
-                       skb->ip_summed = CHECKSUM_HW;
+               skb->ip_summed = next_skb->ip_summed;
 
-               if (skb->ip_summed != CHECKSUM_HW)
+               if (skb->ip_summed != CHECKSUM_PARTIAL)
                        skb->csum = csum_block_add(skb->csum, next_skb->csum, skb_size);
 
                /* Update sequence range on original skb. */
index a4d005eccc7f6668fb5f67abad9d9930fb63f999..87152510980c84df1693f1e29c4c58d25c9ed75e 100644 (file)
@@ -429,7 +429,7 @@ static int udp_push_pending_frames(struct sock *sk, struct udp_sock *up)
                /*
                 * Only one fragment on the socket.
                 */
-               if (skb->ip_summed == CHECKSUM_HW) {
+               if (skb->ip_summed == CHECKSUM_PARTIAL) {
                        skb->csum = offsetof(struct udphdr, check);
                        uh->check = ~csum_tcpudp_magic(fl->fl4_src, fl->fl4_dst,
                                        up->len, IPPROTO_UDP, 0);
@@ -448,7 +448,7 @@ static int udp_push_pending_frames(struct sock *sk, struct udp_sock *up)
                 * fragments on the socket so that all csums of sk_buffs
                 * should be together.
                 */
-               if (skb->ip_summed == CHECKSUM_HW) {
+               if (skb->ip_summed == CHECKSUM_PARTIAL) {
                        int offset = (unsigned char *)uh - skb->data;
                        skb->csum = skb_checksum(skb, offset, skb->len - offset, 0);
 
@@ -1088,7 +1088,7 @@ static void udp_checksum_init(struct sk_buff *skb, struct udphdr *uh,
 {
        if (uh->check == 0) {
                skb->ip_summed = CHECKSUM_UNNECESSARY;
-       } else if (skb->ip_summed == CHECKSUM_HW) {
+       } else if (skb->ip_summed == CHECKSUM_COMPLETE) {
                if (!udp_check(uh, ulen, saddr, daddr, skb->csum))
                        skb->ip_summed = CHECKSUM_UNNECESSARY;
        }
index d16f863cf687645198a6299cab9b718c7c25af97..4a96a9e3ef3bc99c80c95ae62b38b2caf58072e4 100644 (file)
@@ -48,8 +48,8 @@ static int xfrm4_output_one(struct sk_buff *skb)
        struct xfrm_state *x = dst->xfrm;
        int err;
        
-       if (skb->ip_summed == CHECKSUM_HW) {
-               err = skb_checksum_help(skb, 0);
+       if (skb->ip_summed == CHECKSUM_PARTIAL) {
+               err = skb_checksum_help(skb);
                if (err)
                        goto error_nolock;
        }
index 86dac106873b735cbde1913b29a4bc659b8a199a..05afa6b1912b7aef46f1c8243781e38633e43947 100644 (file)
@@ -294,7 +294,7 @@ looped_back:
                hdr = (struct ipv6_rt_hdr *) skb2->h.raw;
        }
 
-       if (skb->ip_summed == CHECKSUM_HW)
+       if (skb->ip_summed == CHECKSUM_COMPLETE)
                skb->ip_summed = CHECKSUM_NONE;
 
        i = n - --hdr->segments_left;
index dbfce089e916d4088788fc00ccef432395390e93..10305510767415b96316d22848b2824bdd1a6763 100644 (file)
@@ -606,7 +606,7 @@ static int icmpv6_rcv(struct sk_buff **pskb)
 
        /* Perform checksum. */
        switch (skb->ip_summed) {
-       case CHECKSUM_HW:
+       case CHECKSUM_COMPLETE:
                if (!csum_ipv6_magic(saddr, daddr, skb->len, IPPROTO_ICMPV6,
                                     skb->csum))
                        break;
index 4fb47a25291313ea0851a6539bed48a73a97c1c8..65514f21c1864bae6cad95a6dd3c78faf45897f9 100644 (file)
@@ -866,7 +866,7 @@ static inline int ip6_ufo_append_data(struct sock *sk,
                /* initialize protocol header pointer */
                skb->h.raw = skb->data + fragheaderlen;
 
-               skb->ip_summed = CHECKSUM_HW;
+               skb->ip_summed = CHECKSUM_PARTIAL;
                skb->csum = 0;
                sk->sk_sndmsg_off = 0;
        }
index 395a417ba9554baaeb0d9678c543abe4e802b3eb..580b1aba6722bd61438d4a52b3ed09bea2668f9f 100644 (file)
@@ -87,7 +87,7 @@ unsigned int nf_ip6_checksum(struct sk_buff *skb, unsigned int hook,
        unsigned int csum = 0;
 
        switch (skb->ip_summed) {
-       case CHECKSUM_HW:
+       case CHECKSUM_COMPLETE:
                if (hook != NF_IP6_PRE_ROUTING && hook != NF_IP6_LOCAL_IN)
                        break;
                if (!csum_ipv6_magic(&ip6h->saddr, &ip6h->daddr,
index 968a14be0d0578eb17f48e2ea03018845cbd40f8..c01c126224e2a921723dc17b895a39b8d471f6ea 100644 (file)
@@ -206,9 +206,9 @@ ipq_build_packet_message(struct ipq_queue_entry *entry, int *errp)
                break;
        
        case IPQ_COPY_PACKET:
-               if (entry->skb->ip_summed == CHECKSUM_HW &&
-                   (*errp = skb_checksum_help(entry->skb,
-                                              entry->info->outdev == NULL))) {
+               if ((entry->skb->ip_summed == CHECKSUM_PARTIAL ||
+                    entry->skb->ip_summed == CHECKSUM_COMPLETE) &&
+                   (*errp = skb_checksum_help(entry->skb))) {
                        read_unlock_bh(&queue_lock);
                        return NULL;
                }
index 00d5583807f76c0e5f22f6c2a7f7fb9d74fc7a1b..7a4e4c2e319729203ed3b99feb05e31575515108 100644 (file)
@@ -408,7 +408,7 @@ static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb,
                return -1;
        }
 
-       if (skb->ip_summed == CHECKSUM_HW)
+       if (skb->ip_summed == CHECKSUM_COMPLETE)
                skb->csum = csum_sub(skb->csum,
                                     csum_partial(skb->nh.raw,
                                                  (u8*)(fhdr + 1) - skb->nh.raw,
@@ -640,7 +640,7 @@ nf_ct_frag6_reasm(struct nf_ct_frag6_queue *fq, struct net_device *dev)
                head->len += fp->len;
                if (head->ip_summed != fp->ip_summed)
                        head->ip_summed = CHECKSUM_NONE;
-               else if (head->ip_summed == CHECKSUM_HW)
+               else if (head->ip_summed == CHECKSUM_COMPLETE)
                        head->csum = csum_add(head->csum, fp->csum);
                head->truesize += fp->truesize;
                atomic_sub(fp->truesize, &nf_ct_frag6_mem);
@@ -652,7 +652,7 @@ nf_ct_frag6_reasm(struct nf_ct_frag6_queue *fq, struct net_device *dev)
        head->nh.ipv6h->payload_len = htons(payload_len);
 
        /* Yes, and fold redundant checksum back. 8) */
-       if (head->ip_summed == CHECKSUM_HW)
+       if (head->ip_summed == CHECKSUM_COMPLETE)
                head->csum = csum_partial(head->nh.raw, head->h.raw-head->nh.raw, head->csum);
 
        fq->fragments = NULL;
index d5040e172292eb945fcc57e7d269b7ec848ba66a..d4af1cb5e19fe9144d679063a55e07ebebf05d4f 100644 (file)
@@ -334,7 +334,7 @@ int rawv6_rcv(struct sock *sk, struct sk_buff *skb)
        if (!rp->checksum)
                skb->ip_summed = CHECKSUM_UNNECESSARY;
 
-       if (skb->ip_summed == CHECKSUM_HW) {
+       if (skb->ip_summed == CHECKSUM_COMPLETE) {
                skb_postpull_rcsum(skb, skb->nh.raw,
                                   skb->h.raw - skb->nh.raw);
                if (!csum_ipv6_magic(&skb->nh.ipv6h->saddr,
index 4e299c69e1c60f1c469cd6dd8b8b90a3d0f016b0..a8623d2b0879c3a9b4599948664f5a10b52eb93d 100644 (file)
@@ -433,7 +433,7 @@ static void ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
                return;
        }
 
-       if (skb->ip_summed == CHECKSUM_HW)
+       if (skb->ip_summed == CHECKSUM_COMPLETE)
                skb->csum = csum_sub(skb->csum,
                                     csum_partial(skb->nh.raw, (u8*)(fhdr+1)-skb->nh.raw, 0));
 
@@ -647,7 +647,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff **skb_in,
                head->len += fp->len;
                if (head->ip_summed != fp->ip_summed)
                        head->ip_summed = CHECKSUM_NONE;
-               else if (head->ip_summed == CHECKSUM_HW)
+               else if (head->ip_summed == CHECKSUM_COMPLETE)
                        head->csum = csum_add(head->csum, fp->csum);
                head->truesize += fp->truesize;
                atomic_sub(fp->truesize, &ip6_frag_mem);
@@ -662,7 +662,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff **skb_in,
        *skb_in = head;
 
        /* Yes, and fold redundant checksum back. 8) */
-       if (head->ip_summed == CHECKSUM_HW)
+       if (head->ip_summed == CHECKSUM_COMPLETE)
                head->csum = csum_partial(head->nh.raw, head->h.raw-head->nh.raw, head->csum);
 
        IP6_INC_STATS_BH(IPSTATS_MIB_REASMOKS);
index 302786a11cd6711eb321f6801cc13947b7845699..7f1b660493b78497d357c6bf7a301e3fc511cdba 100644 (file)
@@ -545,7 +545,7 @@ static void tcp_v6_send_check(struct sock *sk, int len, struct sk_buff *skb)
        struct ipv6_pinfo *np = inet6_sk(sk);
        struct tcphdr *th = skb->h.th;
 
-       if (skb->ip_summed == CHECKSUM_HW) {
+       if (skb->ip_summed == CHECKSUM_PARTIAL) {
                th->check = ~csum_ipv6_magic(&np->saddr, &np->daddr, len, IPPROTO_TCP,  0);
                skb->csum = offsetof(struct tcphdr, check);
        } else {
@@ -570,7 +570,7 @@ static int tcp_v6_gso_send_check(struct sk_buff *skb)
        th->check = ~csum_ipv6_magic(&ipv6h->saddr, &ipv6h->daddr, skb->len,
                                     IPPROTO_TCP, 0);
        skb->csum = offsetof(struct tcphdr, check);
-       skb->ip_summed = CHECKSUM_HW;
+       skb->ip_summed = CHECKSUM_PARTIAL;
        return 0;
 }
 
@@ -1033,7 +1033,7 @@ out:
 
 static int tcp_v6_checksum_init(struct sk_buff *skb)
 {
-       if (skb->ip_summed == CHECKSUM_HW) {
+       if (skb->ip_summed == CHECKSUM_COMPLETE) {
                if (!tcp_v6_check(skb->h.th,skb->len,&skb->nh.ipv6h->saddr,
                                  &skb->nh.ipv6h->daddr,skb->csum)) {
                        skb->ip_summed = CHECKSUM_UNNECESSARY;
index 82c7c9cde2a8653dfa744d3ceac7b3451fa9eb37..780b89f6dfcc3e2cb221d528f44523fae3c9a495 100644 (file)
@@ -475,7 +475,7 @@ static int udpv6_rcv(struct sk_buff **pskb)
                uh = skb->h.uh;
        }
 
-       if (skb->ip_summed == CHECKSUM_HW &&
+       if (skb->ip_summed == CHECKSUM_COMPLETE &&
            !csum_ipv6_magic(saddr, daddr, ulen, IPPROTO_UDP, skb->csum))
                skb->ip_summed = CHECKSUM_UNNECESSARY;
 
index c8c8b44a0f581ee2e486ab5469ed8f9e4ba0bc81..6d111743e508383d4329c3da9ef9c785cec65aad 100644 (file)
@@ -41,8 +41,8 @@ static int xfrm6_output_one(struct sk_buff *skb)
        struct xfrm_state *x = dst->xfrm;
        int err;
        
-       if (skb->ip_summed == CHECKSUM_HW) {
-               err = skb_checksum_help(skb, 0);
+       if (skb->ip_summed == CHECKSUM_PARTIAL) {
+               err = skb_checksum_help(skb);
                if (err)
                        goto error_nolock;
        }
index af8adcba23a7235da6a57206d36e53ef451fb67a..308d2abd7ee5815a74a0a2e03bcdb65979d1027b 100644 (file)
@@ -823,8 +823,7 @@ static int tcp_error(struct sk_buff *skb,
   
        /* Checksum invalid? Ignore.
         * We skip checking packets on the outgoing path
-        * because the semantic of CHECKSUM_HW is different there 
-        * and moreover root might send raw packets.
+        * because the checksum is assumed to be correct.
         */
        /* FIXME: Source route IP option packets --RR */
        if (nf_conntrack_checksum &&
index ae07ebe3ab3754cd85099715d46c118aeaf5b122..d36e03139e8b5e3841920a6cce1a1e9c269f1c06 100644 (file)
@@ -131,8 +131,7 @@ static int udp_error(struct sk_buff *skb, unsigned int dataoff,
 
        /* Checksum invalid? Ignore.
         * We skip checking packets on the outgoing path
-        * because the semantic of CHECKSUM_HW is different there
-        * and moreover root might send raw packets.
+        * because the checksum is assumed to be correct.
         * FIXME: Source route IP option packets --RR */
        if (nf_conntrack_checksum &&
            ((pf == PF_INET && hooknum == NF_IP_PRE_ROUTING) ||
index 49ef41e34c48309eb3d7dc6553056a822e6fb112..eddfbe4441a2aa0c565a2fa4f7b3e1a24bcfd5e0 100644 (file)
@@ -377,9 +377,9 @@ nfqnl_build_packet_message(struct nfqnl_instance *queue,
                break;
        
        case NFQNL_COPY_PACKET:
-               if (entskb->ip_summed == CHECKSUM_HW &&
-                   (*errp = skb_checksum_help(entskb,
-                                              outdev == NULL))) {
+               if ((entskb->ip_summed == CHECKSUM_PARTIAL ||
+                    entskb->ip_summed == CHECKSUM_COMPLETE) &&
+                   (*errp = skb_checksum_help(entskb))) {
                        spin_unlock_bh(&queue->lock);
                        return NULL;
                }
index 4172a5235916e3f71ee6fbed85b4c296ab9de3c4..300215bdbf46660fd748d4fc1eac44238453d465 100644 (file)
@@ -586,7 +586,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, struct packe
                else if (skb->pkt_type == PACKET_OUTGOING) {
                        /* Special case: outgoing packets have ll header at head */
                        skb_pull(skb, skb->nh.raw - skb->data);
-                       if (skb->ip_summed == CHECKSUM_HW)
+                       if (skb->ip_summed == CHECKSUM_PARTIAL)
                                status |= TP_STATUS_CSUMNOTREADY;
                }
        }
index a08ec4c7c55d7cfc0889d48bf5d001f483ffad4c..45939bafbdf894dfcb61a0ed993d1d79204aa5a8 100644 (file)
@@ -192,8 +192,8 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
         */
        if (q->corrupt && q->corrupt >= get_crandom(&q->corrupt_cor)) {
                if (!(skb = skb_unshare(skb, GFP_ATOMIC))
-                   || (skb->ip_summed == CHECKSUM_HW
-                       && skb_checksum_help(skb, 0))) {
+                   || (skb->ip_summed == CHECKSUM_PARTIAL
+                       && skb_checksum_help(skb))) {
                        sch->qstats.drops++;
                        return NET_XMIT_DROP;
                }
index eb330d4f66d6ce79afb9a7badcc0706429abc127..6f17527b9e695684038b2824443e2ab6a80a550e 100644 (file)
@@ -168,7 +168,7 @@ int csum_partial_copy_to_xdr(struct xdr_buf *xdr, struct sk_buff *skb)
                return -1;
        if ((unsigned short)csum_fold(desc.csum))
                return -1;
-       if (unlikely(skb->ip_summed == CHECKSUM_HW))
+       if (unlikely(skb->ip_summed == CHECKSUM_COMPLETE))
                netdev_rx_csum_fault(skb->dev);
        return 0;
 no_checksum: