Skip to content

Commit

Permalink
datapath: compat: Prepare tnl-segmentation for ipv6.
Browse files Browse the repository at this point in the history
Current tnl_skb_gso_segment() is written for ipv4 tunnels. Following
patch make it generic so that it can also handle ipv6 tunnels.

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
  • Loading branch information
pshelar committed Jul 9, 2016
1 parent 43dd2fc commit d244215
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions datapath/linux/compat/gso.c
Expand Up @@ -181,9 +181,11 @@ static struct sk_buff *tnl_skb_gso_segment(struct sk_buff *skb,
netdev_features_t features,
bool tx_path)
{
struct iphdr *iph = ip_hdr(skb);
void *iph = skb_network_header(skb);
int pkt_hlen = skb_inner_network_offset(skb); /* inner l2 + tunnel hdr. */
int mac_offset = skb_inner_mac_offset(skb);
int outer_l3_offset = skb_network_offset(skb);
int outer_l4_offset = skb_transport_offset(skb);
struct sk_buff *skb1 = skb;
struct sk_buff *segs;
__be16 proto = skb->protocol;
Expand Down Expand Up @@ -221,11 +223,11 @@ static struct sk_buff *tnl_skb_gso_segment(struct sk_buff *skb,
while (skb) {
__skb_push(skb, pkt_hlen);
skb_reset_mac_header(skb);
skb_reset_network_header(skb);
skb_set_transport_header(skb, sizeof(struct iphdr));
skb_set_network_header(skb, outer_l3_offset);
skb_set_transport_header(skb, outer_l4_offset);
skb->mac_len = 0;

memcpy(ip_hdr(skb), iph, pkt_hlen);
memcpy(skb_network_header(skb), iph, pkt_hlen);
memcpy(skb->cb, cb, sizeof(cb));
OVS_GSO_CB(skb)->fix_segment(skb);

Expand Down

0 comments on commit d244215

Please sign in to comment.