[ovs-dev] [PATCH 01/11] datapath: Account for "rename vlan_tx_* helpers since "tx" is misleading there"
Thomas Graf
tgraf at noironetworks.com
Thu Jan 22 21:44:23 UTC 2015
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 at resnulli.us>
Signed-off-by: David S. Miller <davem at davemloft.net>
Upstream: df8a39d ("net: rename vlan_tx_* helpers since "tx" is misleading there")
Signed-off-by: Thomas Graf <tgraf at noironetworks.com>
---
acinclude.m4 | 1 +
datapath/actions.c | 4 ++--
datapath/datapath.c | 4 ++--
datapath/flow.c | 4 ++--
datapath/linux/compat/gso.c | 4 ++--
datapath/linux/compat/include/linux/if_vlan.h | 5 +++++
datapath/linux/compat/netdevice.c | 2 +-
datapath/linux/compat/skbuff-openvswitch.c | 6 +++---
datapath/linux/compat/vxlan.c | 6 +++---
datapath/vport-geneve.c | 6 +++---
datapath/vport-gre.c | 6 +++---
datapath/vport-internal_dev.c | 4 ++--
datapath/vport.c | 2 +-
13 files changed, 30 insertions(+), 24 deletions(-)
diff --git a/acinclude.m4 b/acinclude.m4
index 10ede83..39ceb50 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -289,6 +289,7 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
OVS_GREP_IFELSE([$KSRC/include/linux/etherdevice.h], [ether_addr_copy])
OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [vlan_set_encap_proto])
+ OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [skb_vlan_tag_present])
OVS_GREP_IFELSE([$KSRC/include/linux/in.h], [ipv4_is_multicast])
OVS_GREP_IFELSE([$KSRC/include/net/ip.h], [__ip_select_ident.*dst_entry],
diff --git a/datapath/actions.c b/datapath/actions.c
index 0ac6684..98c4376 100644
--- a/datapath/actions.c
+++ b/datapath/actions.c
@@ -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;
diff --git a/datapath/datapath.c b/datapath/datapath.c
index c562e89..5873f07 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -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;
diff --git a/datapath/flow.c b/datapath/flow.c
index b3a59e7..69efe70 100644
--- a/datapath/flow.c
+++ b/datapath/flow.c
@@ -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)))
diff --git a/datapath/linux/compat/gso.c b/datapath/linux/compat/gso.c
index 56f9493..13e8f4e 100644
--- a/datapath/linux/compat/gso.c
+++ b/datapath/linux/compat/gso.c
@@ -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);
diff --git a/datapath/linux/compat/include/linux/if_vlan.h b/datapath/linux/compat/include/linux/if_vlan.h
index ab13a46..c39dad7 100644
--- a/datapath/linux/compat/include/linux/if_vlan.h
+++ b/datapath/linux/compat/include/linux/if_vlan.h
@@ -135,4 +135,9 @@ static inline int rpl_vlan_insert_tag(struct sk_buff *skb, u16 vlan_tci)
}
#endif
+#ifndef HAVE_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 */
diff --git a/datapath/linux/compat/netdevice.c b/datapath/linux/compat/netdevice.c
index 7930823..2932f5c 100644
--- a/datapath/linux/compat/netdevice.c
+++ b/datapath/linux/compat/netdevice.c
@@ -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);
}
diff --git a/datapath/linux/compat/skbuff-openvswitch.c b/datapath/linux/compat/skbuff-openvswitch.c
index b2eab79..5de43b3 100644
--- a/datapath/linux/compat/skbuff-openvswitch.c
+++ b/datapath/linux/compat/skbuff-openvswitch.c
@@ -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;
diff --git a/datapath/linux/compat/vxlan.c b/datapath/linux/compat/vxlan.c
index c509ee8..7deaa11 100644
--- a/datapath/linux/compat/vxlan.c
+++ b/datapath/linux/compat/vxlan.c
@@ -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);
diff --git a/datapath/vport-geneve.c b/datapath/vport-geneve.c
index 86f90f5..6c6ec75 100644
--- a/datapath/vport-geneve.c
+++ b/datapath/vport-geneve.c
@@ -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;
diff --git a/datapath/vport-gre.c b/datapath/vport-gre.c
index 53df865..c0ed009 100644
--- a/datapath/vport-gre.c
+++ b/datapath/vport-gre.c
@@ -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;
diff --git a/datapath/vport-internal_dev.c b/datapath/vport-internal_dev.c
index b698f6f..040b371 100644
--- a/datapath/vport-internal_dev.c
+++ b/datapath/vport-internal_dev.c
@@ -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)
diff --git a/datapath/vport.c b/datapath/vport.c
index 06560fa..5a7067b 100644
--- a/datapath/vport.c
+++ b/datapath/vport.c
@@ -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);
--
1.9.3
More information about the dev
mailing list