datapath: Account for "rename vlan_tx_* helpers since "tx" is misleading there"
authorThomas Graf <tgraf@noironetworks.com>
Tue, 3 Feb 2015 20:53:35 +0000 (21:53 +0100)
committerThomas Graf <tgraf@noironetworks.com>
Tue, 3 Feb 2015 20:55:38 +0000 (21:55 +0100)
Upstream commit:
    net: rename vlan_tx_* helpers since "tx" is misleading there

    The same macros are used for rx as well. So rename it.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream: df8a39d ("net: rename vlan_tx_* helpers since "tx" is misleading there")
Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
12 files changed:
datapath/actions.c
datapath/datapath.c
datapath/flow.c
datapath/linux/compat/gso.c
datapath/linux/compat/include/linux/if_vlan.h
datapath/linux/compat/netdevice.c
datapath/linux/compat/skbuff-openvswitch.c
datapath/linux/compat/vxlan.c
datapath/vport-geneve.c
datapath/vport-gre.c
datapath/vport-internal_dev.c
datapath/vport.c

index 0ac6684..98c4376 100644 (file)
@@ -217,7 +217,7 @@ static int pop_vlan(struct sk_buff *skb, struct sw_flow_key *key)
        int err;
 
        err = skb_vlan_pop(skb);
-       if (vlan_tx_tag_present(skb))
+       if (skb_vlan_tag_present(skb))
                invalidate_flow_key(key);
        else
                key->eth.tci = 0;
@@ -228,7 +228,7 @@ static int pop_vlan(struct sk_buff *skb, struct sw_flow_key *key)
 static int push_vlan(struct sk_buff *skb, struct sw_flow_key *key,
                     const struct ovs_action_push_vlan *vlan)
 {
-       if (vlan_tx_tag_present(skb))
+       if (skb_vlan_tag_present(skb))
                invalidate_flow_key(key);
        else
                key->eth.tci = vlan->vlan_tci;
index c562e89..5873f07 100644 (file)
@@ -423,12 +423,12 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
        if (!dp_ifindex)
                return -ENODEV;
 
-       if (vlan_tx_tag_present(skb)) {
+       if (skb_vlan_tag_present(skb)) {
                nskb = skb_clone(skb, GFP_ATOMIC);
                if (!nskb)
                        return -ENOMEM;
 
-               nskb = vlan_insert_tag_set_proto(nskb, nskb->vlan_proto, vlan_tx_tag_get(nskb));
+               nskb = vlan_insert_tag_set_proto(nskb, nskb->vlan_proto, skb_vlan_tag_get(nskb));
                if (!nskb)
                        return -ENOMEM;
 
index b3a59e7..69efe70 100644 (file)
@@ -71,7 +71,7 @@ void ovs_flow_stats_update(struct sw_flow *flow, __be16 tcp_flags,
 {
        struct flow_stats *stats;
        int node = numa_node_id();
-       int len = skb->len + (vlan_tx_tag_present(skb) ? VLAN_HLEN : 0);
+       int len = skb->len + (skb_vlan_tag_present(skb) ? VLAN_HLEN : 0);
 
        stats = rcu_dereference(flow->stats[node]);
 
@@ -473,7 +473,7 @@ static int key_extract(struct sk_buff *skb, struct sw_flow_key *key)
         */
 
        key->eth.tci = 0;
-       if (vlan_tx_tag_present(skb))
+       if (skb_vlan_tag_present(skb))
                key->eth.tci = htons(vlan_get_tci(skb));
        else if (eth->h_proto == htons(ETH_P_8021Q))
                if (unlikely(parse_vlan(skb, key)))
index 56f9493..13e8f4e 100644 (file)
@@ -97,7 +97,7 @@ int rpl_dev_queue_xmit(struct sk_buff *skb)
        if (skb->mac_len != skb_network_offset(skb) && !supports_mpls_gso())
                mpls = true;
 
-       if (vlan_tx_tag_present(skb) && !dev_supports_vlan_tx(skb->dev))
+       if (skb_vlan_tag_present(skb) && !dev_supports_vlan_tx(skb->dev))
                vlan = true;
 
        if (vlan || mpls) {
@@ -111,7 +111,7 @@ int rpl_dev_queue_xmit(struct sk_buff *skb)
                                              NETIF_F_UFO | NETIF_F_FSO);
 
                        skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto,
-                                                       vlan_tx_tag_get(skb));
+                                                       skb_vlan_tag_get(skb));
                        if (unlikely(!skb))
                                return err;
                        vlan_set_tci(skb, 0);
index ab13a46..bc7d6c1 100644 (file)
@@ -135,4 +135,9 @@ static inline int rpl_vlan_insert_tag(struct sk_buff *skb, u16 vlan_tci)
 }
 #endif
 
+#ifndef skb_vlan_tag_present
+#define skb_vlan_tag_present(skb) vlan_tx_tag_present(skb)
+#define skb_vlan_tag_get(skb) vlan_tx_tag_get(skb)
+#endif
+
 #endif /* linux/if_vlan.h wrapper */
index 7930823..2932f5c 100644 (file)
@@ -58,7 +58,7 @@ netdev_features_t rpl_netif_skb_features(struct sk_buff *skb)
        if (protocol == htons(ETH_P_8021Q)) {
                struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data;
                protocol = veh->h_vlan_encapsulated_proto;
-       } else if (!vlan_tx_tag_present(skb)) {
+       } else if (!skb_vlan_tag_present(skb)) {
                return harmonize_features(skb, protocol, features);
        }
 
index b2eab79..5de43b3 100644 (file)
@@ -179,7 +179,7 @@ int skb_vlan_pop(struct sk_buff *skb)
        __be16 vlan_proto;
        int err;
 
-       if (likely(vlan_tx_tag_present(skb))) {
+       if (likely(skb_vlan_tag_present(skb))) {
                skb->vlan_tci = 0;
        } else {
                if (unlikely((skb->protocol != htons(ETH_P_8021Q) &&
@@ -210,7 +210,7 @@ int skb_vlan_pop(struct sk_buff *skb)
 #ifndef HAVE_SKB_VLAN_PUSH
 int skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci)
 {
-       if (vlan_tx_tag_present(skb)) {
+       if (skb_vlan_tag_present(skb)) {
                unsigned int offset = skb->data - skb_mac_header(skb);
                int err;
 
@@ -220,7 +220,7 @@ int skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci)
                 */
                __skb_push(skb, offset);
                err = __vlan_insert_tag(skb, skb->vlan_proto,
-                                       vlan_tx_tag_get(skb));
+                                       skb_vlan_tag_get(skb));
                if (err)
                        return err;
                skb->mac_len += VLAN_HLEN;
index c509ee8..7deaa11 100644 (file)
@@ -183,7 +183,7 @@ int vxlan_xmit_skb(struct vxlan_sock *vs,
 
        min_headroom = LL_RESERVED_SPACE(rt_dst(rt).dev) + rt_dst(rt).header_len
                        + VXLAN_HLEN + sizeof(struct iphdr)
-                       + (vlan_tx_tag_present(skb) ? VLAN_HLEN : 0);
+                       + (skb_vlan_tag_present(skb) ? VLAN_HLEN : 0);
 
        /* Need space for new headers (invalidates iph ptr) */
        err = skb_cow_head(skb, min_headroom);
@@ -192,10 +192,10 @@ int vxlan_xmit_skb(struct vxlan_sock *vs,
                return err;
        }
 
-       if (vlan_tx_tag_present(skb)) {
+       if (skb_vlan_tag_present(skb)) {
                if (unlikely(!vlan_insert_tag_set_proto(skb,
                                                        skb->vlan_proto,
-                                                       vlan_tx_tag_get(skb))))
+                                                       skb_vlan_tag_get(skb))))
                        return -ENOMEM;
 
                vlan_set_tci(skb, 0);
index 86f90f5..6c6ec75 100644 (file)
@@ -390,7 +390,7 @@ static int geneve_send(struct vport *vport, struct sk_buff *skb)
                        + GENEVE_BASE_HLEN
                        + OVS_CB(skb)->egress_tun_info->options_len
                        + sizeof(struct iphdr)
-                       + (vlan_tx_tag_present(skb) ? VLAN_HLEN : 0);
+                       + (skb_vlan_tag_present(skb) ? VLAN_HLEN : 0);
 
        if (skb_headroom(skb) < min_headroom || skb_header_cloned(skb)) {
                int head_delta = SKB_DATA_ALIGN(min_headroom -
@@ -403,10 +403,10 @@ static int geneve_send(struct vport *vport, struct sk_buff *skb)
                        goto err_free_rt;
        }
 
-       if (vlan_tx_tag_present(skb)) {
+       if (skb_vlan_tag_present(skb)) {
                if (unlikely(!vlan_insert_tag_set_proto(skb,
                                                        skb->vlan_proto,
-                                                       vlan_tx_tag_get(skb)))) {
+                                                       skb_vlan_tag_get(skb)))) {
                        err = -ENOMEM;
                        skb = NULL;
                        goto err_free_rt;
index 53df865..c0ed009 100644 (file)
@@ -162,7 +162,7 @@ static int __send(struct vport *vport, struct sk_buff *skb,
 
        min_headroom = LL_RESERVED_SPACE(rt_dst(rt).dev) + rt_dst(rt).header_len
                        + tunnel_hlen + sizeof(struct iphdr)
-                       + (vlan_tx_tag_present(skb) ? VLAN_HLEN : 0);
+                       + (skb_vlan_tag_present(skb) ? VLAN_HLEN : 0);
 
        if (skb_headroom(skb) < min_headroom || skb_header_cloned(skb)) {
                int head_delta = SKB_DATA_ALIGN(min_headroom -
@@ -174,10 +174,10 @@ static int __send(struct vport *vport, struct sk_buff *skb,
                        goto err_free_rt;
        }
 
-       if (vlan_tx_tag_present(skb)) {
+       if (skb_vlan_tag_present(skb)) {
                if (unlikely(!vlan_insert_tag_set_proto(skb,
                                                        skb->vlan_proto,
-                                                       vlan_tx_tag_get(skb)))) {
+                                                       skb_vlan_tag_get(skb)))) {
                        err = -ENOMEM;
                        skb = NULL;
                        goto err_free_rt;
index b698f6f..040b371 100644 (file)
@@ -254,10 +254,10 @@ static int internal_dev_recv(struct vport *vport, struct sk_buff *skb)
        }
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
-       if (vlan_tx_tag_present(skb)) {
+       if (skb_vlan_tag_present(skb)) {
                if (unlikely(!vlan_insert_tag_set_proto(skb,
                                                        skb->vlan_proto,
-                                                       vlan_tx_tag_get(skb))))
+                                                       skb_vlan_tag_get(skb))))
                        return 0;
 
                if (skb->ip_summed == CHECKSUM_COMPLETE)
index 06560fa..5a7067b 100644 (file)
@@ -453,7 +453,7 @@ void ovs_vport_receive(struct vport *vport, struct sk_buff *skb,
        stats = this_cpu_ptr(vport->percpu_stats);
        u64_stats_update_begin(&stats->syncp);
        stats->rx_packets++;
-       stats->rx_bytes += skb->len + (vlan_tx_tag_present(skb) ? VLAN_HLEN : 0);
+       stats->rx_bytes += skb->len + (skb_vlan_tag_present(skb) ? VLAN_HLEN : 0);
        u64_stats_update_end(&stats->syncp);
 
        ovs_skb_init_inner_protocol(skb);