datapath: Update 32/64 bit compat ioctl to match new names.
[sliver-openvswitch.git] / datapath / actions.c
index 5365278..ec6a460 100644 (file)
@@ -21,6 +21,7 @@
 #include <net/checksum.h>
 
 #include "actions.h"
+#include "checksum.h"
 #include "datapath.h"
 #include "openvswitch/datapath-protocol.h"
 #include "vport.h"
@@ -56,7 +57,7 @@ static struct sk_buff *vlan_pull_tag(struct sk_buff *skb)
        if (vh->h_vlan_proto != htons(ETH_P_8021Q) || skb->len < VLAN_ETH_HLEN)
                return skb;
 
-       if (OVS_CB(skb)->ip_summed == OVS_CSUM_COMPLETE)
+       if (get_ip_summed(skb) == OVS_CSUM_COMPLETE)
                skb->csum = csum_sub(skb->csum, csum_partial(skb->data
                                        + ETH_HLEN, VLAN_HLEN, 0));
 
@@ -74,7 +75,6 @@ static struct sk_buff *modify_vlan_tci(struct datapath *dp, struct sk_buff *skb,
                                       const struct odp_flow_key *key,
                                       const union odp_action *a, int n_actions)
 {
-       __be16 mask = a->dl_tci.mask;
        __be16 tci = a->dl_tci.tci;
 
        skb = make_writable(skb, VLAN_HLEN);
@@ -92,9 +92,9 @@ static struct sk_buff *modify_vlan_tci(struct datapath *dp, struct sk_buff *skb,
                vh = vlan_eth_hdr(skb);
                old_tci = vh->h_vlan_TCI;
 
-               vh->h_vlan_TCI = (vh->h_vlan_TCI & ~mask) | tci;
+               vh->h_vlan_TCI = tci;
 
-               if (OVS_CB(skb)->ip_summed == OVS_CSUM_COMPLETE) {
+               if (get_ip_summed(skb) == OVS_CSUM_COMPLETE) {
                        __be16 diff[] = { ~old_tci, vh->h_vlan_TCI };
 
                        skb->csum = ~csum_partial((char *)diff, sizeof(diff),
@@ -183,7 +183,7 @@ static struct sk_buff *modify_vlan_tci(struct datapath *dp, struct sk_buff *skb,
 
                /* GSO doesn't fix up the hardware computed checksum so this
                 * will only be hit in the non-GSO case. */
-               if (OVS_CB(skb)->ip_summed == OVS_CSUM_COMPLETE)
+               if (get_ip_summed(skb) == OVS_CSUM_COMPLETE)
                        skb->csum = csum_add(skb->csum, csum_partial(skb->data
                                                + ETH_HLEN, VLAN_HLEN, 0));
        }
@@ -222,10 +222,10 @@ static void update_csum(__sum16 *sum, struct sk_buff *skb,
 {
        __be32 diff[] = { ~from, to };
 
-       if (OVS_CB(skb)->ip_summed != OVS_CSUM_PARTIAL) {
+       if (get_ip_summed(skb) != OVS_CSUM_PARTIAL) {
                *sum = csum_fold(csum_partial((char *)diff, sizeof(diff),
                                ~csum_unfold(*sum)));
-               if (OVS_CB(skb)->ip_summed == OVS_CSUM_COMPLETE && pseudohdr)
+               if (get_ip_summed(skb) == OVS_CSUM_COMPLETE && pseudohdr)
                        skb->csum = ~csum_partial((char *)diff, sizeof(diff),
                                                ~skb->csum);
        } else if (pseudohdr)
@@ -369,7 +369,7 @@ static bool is_spoofed_arp(struct sk_buff *skb, const struct odp_flow_key *key)
 
 static void do_output(struct datapath *dp, struct sk_buff *skb, int out_port)
 {
-       struct dp_port *p;
+       struct vport *p;
 
        if (!skb)
                goto error;
@@ -378,7 +378,7 @@ static void do_output(struct datapath *dp, struct sk_buff *skb, int out_port)
        if (!p)
                goto error;
 
-       vport_send(p->vport, skb);
+       vport_send(p, skb);
        return;
 
 error:
@@ -397,7 +397,7 @@ static int output_control(struct datapath *dp, struct sk_buff *skb, u32 arg)
  * information about what happened to it. */
 static void sflow_sample(struct datapath *dp, struct sk_buff *skb,
                         const union odp_action *a, int n_actions,
-                        struct dp_port *dp_port)
+                        struct vport *vport)
 {
        struct odp_sflow_sample_header *hdr;
        unsigned int actlen = n_actions * sizeof(union odp_action);
@@ -411,7 +411,7 @@ static void sflow_sample(struct datapath *dp, struct sk_buff *skb,
        memcpy(__skb_push(nskb, actlen), a, actlen);
        hdr = (struct odp_sflow_sample_header*)__skb_push(nskb, hdrlen);
        hdr->n_actions = n_actions;
-       hdr->sample_pool = atomic_read(&dp_port->sflow_pool);
+       hdr->sample_pool = atomic_read(&vport->sflow_pool);
        dp_output_control(dp, nskb, _ODPL_SFLOW_NR, 0);
 }
 
@@ -429,7 +429,7 @@ int execute_actions(struct datapath *dp, struct sk_buff *skb,
        int err;
 
        if (dp->sflow_probability) {
-               struct dp_port *p = OVS_CB(skb)->dp_port;
+               struct vport *p = OVS_CB(skb)->vport;
                if (p) {
                        atomic_inc(&p->sflow_pool);
                        if (dp->sflow_probability == UINT_MAX ||