Commit d329729a authored by Jiri Pirko's avatar Jiri Pirko Committed by Sasha Levin

vlan: rename __vlan_put_tag to vlan_insert_tag_set_proto

[ Upstream commit 62749e2c ]

Name fits better. Plus there's going to be introduced
__vlan_insert_tag later on.
Signed-off-by: default avatarJiri Pirko <jiri@resnulli.us>
Acked-by: default avatarPravin B Shelar <pshelar@nicira.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
parent c01a1cb6
...@@ -2143,8 +2143,8 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op, ...@@ -2143,8 +2143,8 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op,
netdev_dbg(slave_dev, "inner tag: proto %X vid %X\n", netdev_dbg(slave_dev, "inner tag: proto %X vid %X\n",
ntohs(outer_tag->vlan_proto), tags->vlan_id); ntohs(outer_tag->vlan_proto), tags->vlan_id);
skb = __vlan_put_tag(skb, tags->vlan_proto, skb = vlan_insert_tag_set_proto(skb, tags->vlan_proto,
tags->vlan_id); tags->vlan_id);
if (!skb) { if (!skb) {
net_err_ratelimited("failed to insert inner VLAN tag\n"); net_err_ratelimited("failed to insert inner VLAN tag\n");
return; return;
......
...@@ -887,7 +887,8 @@ static struct sk_buff *be_insert_vlan_in_pkt(struct be_adapter *adapter, ...@@ -887,7 +887,8 @@ static struct sk_buff *be_insert_vlan_in_pkt(struct be_adapter *adapter,
} }
if (vlan_tag) { if (vlan_tag) {
skb = __vlan_put_tag(skb, htons(ETH_P_8021Q), vlan_tag); skb = vlan_insert_tag_set_proto(skb, htons(ETH_P_8021Q),
vlan_tag);
if (unlikely(!skb)) if (unlikely(!skb))
return skb; return skb;
skb->vlan_tci = 0; skb->vlan_tci = 0;
...@@ -896,7 +897,8 @@ static struct sk_buff *be_insert_vlan_in_pkt(struct be_adapter *adapter, ...@@ -896,7 +897,8 @@ static struct sk_buff *be_insert_vlan_in_pkt(struct be_adapter *adapter,
/* Insert the outer VLAN, if any */ /* Insert the outer VLAN, if any */
if (adapter->qnq_vid) { if (adapter->qnq_vid) {
vlan_tag = adapter->qnq_vid; vlan_tag = adapter->qnq_vid;
skb = __vlan_put_tag(skb, htons(ETH_P_8021Q), vlan_tag); skb = vlan_insert_tag_set_proto(skb, htons(ETH_P_8021Q),
vlan_tag);
if (unlikely(!skb)) if (unlikely(!skb))
return skb; return skb;
if (skip_hw_vlan) if (skip_hw_vlan)
......
...@@ -1594,9 +1594,9 @@ static int vxlan6_xmit_skb(struct vxlan_sock *vs, ...@@ -1594,9 +1594,9 @@ static int vxlan6_xmit_skb(struct vxlan_sock *vs,
return err; return err;
if (vlan_tx_tag_present(skb)) { if (vlan_tx_tag_present(skb)) {
if (WARN_ON(!__vlan_put_tag(skb, skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto,
skb->vlan_proto, vlan_tx_tag_get(skb));
vlan_tx_tag_get(skb)))) if (WARN_ON(!skb))
return -ENOMEM; return -ENOMEM;
skb->vlan_tci = 0; skb->vlan_tci = 0;
...@@ -1638,9 +1638,9 @@ int vxlan_xmit_skb(struct vxlan_sock *vs, ...@@ -1638,9 +1638,9 @@ int vxlan_xmit_skb(struct vxlan_sock *vs,
return err; return err;
if (vlan_tx_tag_present(skb)) { if (vlan_tx_tag_present(skb)) {
if (WARN_ON(!__vlan_put_tag(skb, skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto,
skb->vlan_proto, vlan_tx_tag_get(skb));
vlan_tx_tag_get(skb)))) if (WARN_ON(!skb))
return -ENOMEM; return -ENOMEM;
skb->vlan_tci = 0; skb->vlan_tci = 0;
......
...@@ -320,8 +320,9 @@ static inline struct sk_buff *vlan_insert_tag(struct sk_buff *skb, ...@@ -320,8 +320,9 @@ static inline struct sk_buff *vlan_insert_tag(struct sk_buff *skb,
} }
/** /**
* __vlan_put_tag - regular VLAN tag inserting * vlan_insert_tag_set_proto - regular VLAN tag inserting
* @skb: skbuff to tag * @skb: skbuff to tag
* @vlan_proto: VLAN encapsulation protocol
* @vlan_tci: VLAN TCI to insert * @vlan_tci: VLAN TCI to insert
* *
* Inserts the VLAN tag into @skb as part of the payload * Inserts the VLAN tag into @skb as part of the payload
...@@ -330,8 +331,9 @@ static inline struct sk_buff *vlan_insert_tag(struct sk_buff *skb, ...@@ -330,8 +331,9 @@ static inline struct sk_buff *vlan_insert_tag(struct sk_buff *skb,
* Following the skb_unshare() example, in case of error, the calling function * Following the skb_unshare() example, in case of error, the calling function
* doesn't have to worry about freeing the original skb. * doesn't have to worry about freeing the original skb.
*/ */
static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, static inline struct sk_buff *vlan_insert_tag_set_proto(struct sk_buff *skb,
__be16 vlan_proto, u16 vlan_tci) __be16 vlan_proto,
u16 vlan_tci)
{ {
skb = vlan_insert_tag(skb, vlan_proto, vlan_tci); skb = vlan_insert_tag(skb, vlan_proto, vlan_tci);
if (skb) if (skb)
......
...@@ -199,8 +199,8 @@ bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v, ...@@ -199,8 +199,8 @@ bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v,
if (skb->vlan_proto != proto) { if (skb->vlan_proto != proto) {
/* Protocol-mismatch, empty out vlan_tci for new tag */ /* Protocol-mismatch, empty out vlan_tci for new tag */
skb_push(skb, ETH_HLEN); skb_push(skb, ETH_HLEN);
skb = __vlan_put_tag(skb, skb->vlan_proto, skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto,
vlan_tx_tag_get(skb)); vlan_tx_tag_get(skb));
if (unlikely(!skb)) if (unlikely(!skb))
return false; return false;
......
...@@ -2664,8 +2664,8 @@ static struct sk_buff *validate_xmit_vlan(struct sk_buff *skb, ...@@ -2664,8 +2664,8 @@ static struct sk_buff *validate_xmit_vlan(struct sk_buff *skb,
{ {
if (vlan_tx_tag_present(skb) && if (vlan_tx_tag_present(skb) &&
!vlan_hw_offload_capable(features, skb->vlan_proto)) { !vlan_hw_offload_capable(features, skb->vlan_proto)) {
skb = __vlan_put_tag(skb, skb->vlan_proto, skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto,
vlan_tx_tag_get(skb)); vlan_tx_tag_get(skb));
if (skb) if (skb)
skb->vlan_tci = 0; skb->vlan_tci = 0;
} }
......
...@@ -79,8 +79,8 @@ static int netpoll_start_xmit(struct sk_buff *skb, struct net_device *dev, ...@@ -79,8 +79,8 @@ static int netpoll_start_xmit(struct sk_buff *skb, struct net_device *dev,
if (vlan_tx_tag_present(skb) && if (vlan_tx_tag_present(skb) &&
!vlan_hw_offload_capable(features, skb->vlan_proto)) { !vlan_hw_offload_capable(features, skb->vlan_proto)) {
skb = __vlan_put_tag(skb, skb->vlan_proto, skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto,
vlan_tx_tag_get(skb)); vlan_tx_tag_get(skb));
if (unlikely(!skb)) { if (unlikely(!skb)) {
/* This is actually a packet drop, but we /* This is actually a packet drop, but we
* don't want the code that calls this * don't want the code that calls this
......
...@@ -132,12 +132,11 @@ int geneve_xmit_skb(struct geneve_sock *gs, struct rtable *rt, ...@@ -132,12 +132,11 @@ int geneve_xmit_skb(struct geneve_sock *gs, struct rtable *rt,
return err; return err;
if (vlan_tx_tag_present(skb)) { if (vlan_tx_tag_present(skb)) {
if (unlikely(!__vlan_put_tag(skb, skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto,
skb->vlan_proto, vlan_tx_tag_get(skb));
vlan_tx_tag_get(skb)))) { if (unlikely(!skb)
err = -ENOMEM; return -ENOMEM;
return err;
}
skb->vlan_tci = 0; skb->vlan_tci = 0;
} }
......
...@@ -184,7 +184,9 @@ static int push_vlan(struct sk_buff *skb, const struct ovs_action_push_vlan *vla ...@@ -184,7 +184,9 @@ static int push_vlan(struct sk_buff *skb, const struct ovs_action_push_vlan *vla
/* push down current VLAN tag */ /* push down current VLAN tag */
current_tag = vlan_tx_tag_get(skb); current_tag = vlan_tx_tag_get(skb);
if (!__vlan_put_tag(skb, skb->vlan_proto, current_tag)) skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto,
current_tag);
if (!skb)
return -ENOMEM; return -ENOMEM;
if (skb->ip_summed == CHECKSUM_COMPLETE) if (skb->ip_summed == CHECKSUM_COMPLETE)
......
...@@ -423,7 +423,8 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb, ...@@ -423,7 +423,8 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
if (!nskb) if (!nskb)
return -ENOMEM; return -ENOMEM;
nskb = __vlan_put_tag(nskb, nskb->vlan_proto, vlan_tx_tag_get(nskb)); nskb = vlan_insert_tag_set_proto(nskb, nskb->vlan_proto,
vlan_tx_tag_get(nskb));
if (!nskb) if (!nskb)
return -ENOMEM; return -ENOMEM;
......
...@@ -173,9 +173,9 @@ static int gre_tnl_send(struct vport *vport, struct sk_buff *skb) ...@@ -173,9 +173,9 @@ static int gre_tnl_send(struct vport *vport, struct sk_buff *skb)
} }
if (vlan_tx_tag_present(skb)) { if (vlan_tx_tag_present(skb)) {
if (unlikely(!__vlan_put_tag(skb, skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto,
skb->vlan_proto, vlan_tx_tag_get(skb));
vlan_tx_tag_get(skb)))) { if (unlikely(!skb) {
err = -ENOMEM; err = -ENOMEM;
goto err_free_rt; goto err_free_rt;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment