diff options
| author | Jiri Benc <jbenc@redhat.com> | 2016-09-30 13:08:07 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2016-10-03 02:00:22 -0400 |
| commit | 85de4a2101acb85c3b1dde465e84596ccca99f2c (patch) | |
| tree | c93484e9f3001d3afb4c030eb632d2994b6b8b84 /net/openvswitch | |
| parent | 9095e10edd28e1e4a10ba5ca61fb54d9f74f8968 (diff) | |
openvswitch: use mpls_hdr
skb_mpls_header is equivalent to mpls_hdr now. Use the existing helper
instead.
Signed-off-by: Jiri Benc <jbenc@redhat.com>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch')
| -rw-r--r-- | net/openvswitch/actions.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c index 863e992dfbc0..4e03f64709bc 100644 --- a/net/openvswitch/actions.c +++ b/net/openvswitch/actions.c | |||
| @@ -160,7 +160,7 @@ static void update_ethertype(struct sk_buff *skb, struct ethhdr *hdr, | |||
| 160 | static int push_mpls(struct sk_buff *skb, struct sw_flow_key *key, | 160 | static int push_mpls(struct sk_buff *skb, struct sw_flow_key *key, |
| 161 | const struct ovs_action_push_mpls *mpls) | 161 | const struct ovs_action_push_mpls *mpls) |
| 162 | { | 162 | { |
| 163 | __be32 *new_mpls_lse; | 163 | struct mpls_shim_hdr *new_mpls_lse; |
| 164 | 164 | ||
| 165 | /* Networking stack do not allow simultaneous Tunnel and MPLS GSO. */ | 165 | /* Networking stack do not allow simultaneous Tunnel and MPLS GSO. */ |
| 166 | if (skb->encapsulation) | 166 | if (skb->encapsulation) |
| @@ -180,8 +180,8 @@ static int push_mpls(struct sk_buff *skb, struct sw_flow_key *key, | |||
| 180 | skb_reset_mac_header(skb); | 180 | skb_reset_mac_header(skb); |
| 181 | skb_set_network_header(skb, skb->mac_len); | 181 | skb_set_network_header(skb, skb->mac_len); |
| 182 | 182 | ||
| 183 | new_mpls_lse = (__be32 *)skb_mpls_header(skb); | 183 | new_mpls_lse = mpls_hdr(skb); |
| 184 | *new_mpls_lse = mpls->mpls_lse; | 184 | new_mpls_lse->label_stack_entry = mpls->mpls_lse; |
| 185 | 185 | ||
| 186 | skb_postpush_rcsum(skb, new_mpls_lse, MPLS_HLEN); | 186 | skb_postpush_rcsum(skb, new_mpls_lse, MPLS_HLEN); |
| 187 | 187 | ||
| @@ -202,7 +202,7 @@ static int pop_mpls(struct sk_buff *skb, struct sw_flow_key *key, | |||
| 202 | if (unlikely(err)) | 202 | if (unlikely(err)) |
| 203 | return err; | 203 | return err; |
| 204 | 204 | ||
| 205 | skb_postpull_rcsum(skb, skb_mpls_header(skb), MPLS_HLEN); | 205 | skb_postpull_rcsum(skb, mpls_hdr(skb), MPLS_HLEN); |
| 206 | 206 | ||
| 207 | memmove(skb_mac_header(skb) + MPLS_HLEN, skb_mac_header(skb), | 207 | memmove(skb_mac_header(skb) + MPLS_HLEN, skb_mac_header(skb), |
| 208 | skb->mac_len); | 208 | skb->mac_len); |
| @@ -211,10 +211,10 @@ static int pop_mpls(struct sk_buff *skb, struct sw_flow_key *key, | |||
| 211 | skb_reset_mac_header(skb); | 211 | skb_reset_mac_header(skb); |
| 212 | skb_set_network_header(skb, skb->mac_len); | 212 | skb_set_network_header(skb, skb->mac_len); |
| 213 | 213 | ||
| 214 | /* skb_mpls_header() is used to locate the ethertype | 214 | /* mpls_hdr() is used to locate the ethertype field correctly in the |
| 215 | * field correctly in the presence of VLAN tags. | 215 | * presence of VLAN tags. |
| 216 | */ | 216 | */ |
| 217 | hdr = (struct ethhdr *)(skb_mpls_header(skb) - ETH_HLEN); | 217 | hdr = (struct ethhdr *)((void *)mpls_hdr(skb) - ETH_HLEN); |
| 218 | update_ethertype(skb, hdr, ethertype); | 218 | update_ethertype(skb, hdr, ethertype); |
| 219 | if (eth_p_mpls(skb->protocol)) | 219 | if (eth_p_mpls(skb->protocol)) |
| 220 | skb->protocol = ethertype; | 220 | skb->protocol = ethertype; |
| @@ -226,7 +226,7 @@ static int pop_mpls(struct sk_buff *skb, struct sw_flow_key *key, | |||
| 226 | static int set_mpls(struct sk_buff *skb, struct sw_flow_key *flow_key, | 226 | static int set_mpls(struct sk_buff *skb, struct sw_flow_key *flow_key, |
| 227 | const __be32 *mpls_lse, const __be32 *mask) | 227 | const __be32 *mpls_lse, const __be32 *mask) |
| 228 | { | 228 | { |
| 229 | __be32 *stack; | 229 | struct mpls_shim_hdr *stack; |
| 230 | __be32 lse; | 230 | __be32 lse; |
| 231 | int err; | 231 | int err; |
| 232 | 232 | ||
| @@ -234,16 +234,16 @@ static int set_mpls(struct sk_buff *skb, struct sw_flow_key *flow_key, | |||
| 234 | if (unlikely(err)) | 234 | if (unlikely(err)) |
| 235 | return err; | 235 | return err; |
| 236 | 236 | ||
| 237 | stack = (__be32 *)skb_mpls_header(skb); | 237 | stack = mpls_hdr(skb); |
| 238 | lse = OVS_MASKED(*stack, *mpls_lse, *mask); | 238 | lse = OVS_MASKED(stack->label_stack_entry, *mpls_lse, *mask); |
| 239 | if (skb->ip_summed == CHECKSUM_COMPLETE) { | 239 | if (skb->ip_summed == CHECKSUM_COMPLETE) { |
| 240 | __be32 diff[] = { ~(*stack), lse }; | 240 | __be32 diff[] = { ~(stack->label_stack_entry), lse }; |
| 241 | 241 | ||
| 242 | skb->csum = ~csum_partial((char *)diff, sizeof(diff), | 242 | skb->csum = ~csum_partial((char *)diff, sizeof(diff), |
| 243 | ~skb->csum); | 243 | ~skb->csum); |
| 244 | } | 244 | } |
| 245 | 245 | ||
| 246 | *stack = lse; | 246 | stack->label_stack_entry = lse; |
| 247 | flow_key->mpls.top_lse = lse; | 247 | flow_key->mpls.top_lse = lse; |
| 248 | return 0; | 248 | return 0; |
| 249 | } | 249 | } |
