Message ID | 20160623020436.GA28594@vergenet.net |
---|---|
State | Not Applicable |
Headers | show |
On Thu, 23 Jun 2016 11:04:38 +0900, Simon Horman wrote: > I think you are right as IIRC the call to skb_reset_mac_header was > added for this use-case. Its unfortunate that we can't use it in > internal_dev_xmit() because of loosing track of MPLS as you mentioned > earlier. But it does seem that setting mac_header to ~0 works well > in conjunction with updates to OvS posted earlier in this sub-therad. > > I have the following working. Jiri, is the ip_gre portion acceptable to you? Sorry for the late reply, I was off the last week. > diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c > index 58d323289872..e6772b6934a3 100644 > --- a/net/ipv4/ip_gre.c > +++ b/net/ipv4/ip_gre.c > @@ -279,7 +279,7 @@ static int __ipgre_rcv(struct sk_buff *skb, const struct tnl_ptk_info *tpi, > if (tunnel->dev->type != ARPHRD_NONE) > skb_pop_mac_header(skb); > else > - skb_reset_mac_header(skb); > + skb->mac_header = (typeof(skb->mac_header))~0U; Looks good. We should introduce a helper for this, though (skb_unset_mac_header or so). Thanks! Jiri
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 58d323289872..e6772b6934a3 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -279,7 +279,7 @@ static int __ipgre_rcv(struct sk_buff *skb, const struct tnl_ptk_info *tpi, if (tunnel->dev->type != ARPHRD_NONE) skb_pop_mac_header(skb); else - skb_reset_mac_header(skb); + skb->mac_header = (typeof(skb->mac_header))~0U; if (tunnel->collect_md) { __be16 flags; __be64 tun_id; diff --git a/net/openvswitch/vport-netdev.c b/net/openvswitch/vport-netdev.c index 4cf3f12ffc99..82b10802abe6 100644 --- a/net/openvswitch/vport-netdev.c +++ b/net/openvswitch/vport-netdev.c @@ -60,9 +60,6 @@ static void netdev_port_receive(struct sk_buff *skb) if (vport->dev->type == ARPHRD_ETHER) { skb_push(skb, ETH_HLEN); skb_postpush_rcsum(skb, skb->data, ETH_HLEN); - } else if (vport->dev->type == ARPHRD_NONE && - skb->protocol != htons(ETH_P_TEB)) { - skb->mac_header = (typeof(skb->mac_header))~0U; } ovs_vport_receive(vport, skb, skb_tunnel_info(skb));