Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

openvswitch: Remove egress_tun_info.

tun info is passed using skb-dst pointer. Now we have
converted all vports to netdev based implementation so
Now we can remove redundant pointer to tun-info from OVS_CB.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Pravin B Shelar and committed by
David S. Miller
3eedb41f 24d43f32

+7 -20
-5
net/openvswitch/actions.c
··· 896 896 skb_dst_drop(skb); 897 897 dst_hold((struct dst_entry *)tun->tun_dst); 898 898 skb_dst_set(skb, (struct dst_entry *)tun->tun_dst); 899 - 900 - /* FIXME: Remove when all vports have been converted */ 901 - OVS_CB(skb)->egress_tun_info = &tun->tun_dst->u.tun_info; 902 - 903 899 return 0; 904 900 } 905 901 ··· 1155 1159 int err; 1156 1160 1157 1161 this_cpu_inc(exec_actions_level); 1158 - OVS_CB(skb)->egress_tun_info = NULL; 1159 1162 err = do_execute_actions(dp, skb, key, 1160 1163 acts->actions, acts->actions_len); 1161 1164
-1
net/openvswitch/datapath.c
··· 610 610 goto err_flow_free; 611 611 612 612 rcu_assign_pointer(flow->sf_acts, acts); 613 - OVS_CB(packet)->egress_tun_info = NULL; 614 613 packet->priority = flow->key.phy.priority; 615 614 packet->mark = flow->key.phy.skb_mark; 616 615
-3
net/openvswitch/datapath.h
··· 94 94 95 95 /** 96 96 * struct ovs_skb_cb - OVS data in skb CB 97 - * @egress_tun_key: Tunnel information about this packet on egress path. 98 - * NULL if the packet is not being tunneled. 99 97 * @input_vport: The original vport packet came in on. This value is cached 100 98 * when a packet is received by OVS. 101 99 * @mru: The maximum received fragement size; 0 if the packet is not 102 100 * fragmented. 103 101 */ 104 102 struct ovs_skb_cb { 105 - struct ip_tunnel_info *egress_tun_info; 106 103 struct vport *input_vport; 107 104 u16 mru; 108 105 };
+1 -2
net/openvswitch/vport-geneve.c
··· 62 62 63 63 return ovs_tunnel_get_egress_info(egress_tun_info, 64 64 ovs_dp_get_net(vport->dp), 65 - OVS_CB(skb)->egress_tun_info, 66 - IPPROTO_UDP, skb->mark, sport, dport); 65 + skb, IPPROTO_UDP, sport, dport); 67 66 } 68 67 69 68 static struct vport *geneve_tnl_create(const struct vport_parms *parms)
+1 -2
net/openvswitch/vport-gre.c
··· 89 89 { 90 90 return ovs_tunnel_get_egress_info(egress_tun_info, 91 91 ovs_dp_get_net(vport->dp), 92 - OVS_CB(skb)->egress_tun_info, 93 - IPPROTO_GRE, skb->mark, 0, 0); 92 + skb, IPPROTO_GRE, 0, 0); 94 93 } 95 94 96 95 static struct vport_ops ovs_gre_vport_ops = {
+1 -2
net/openvswitch/vport-vxlan.c
··· 160 160 src_port = udp_flow_src_port(net, skb, 0, 0, true); 161 161 162 162 return ovs_tunnel_get_egress_info(egress_tun_info, net, 163 - OVS_CB(skb)->egress_tun_info, 164 - IPPROTO_UDP, skb->mark, 163 + skb, IPPROTO_UDP, 165 164 src_port, dst_port); 166 165 } 167 166
+3 -3
net/openvswitch/vport.c
··· 483 483 u64_stats_update_end(&stats->syncp); 484 484 485 485 OVS_CB(skb)->input_vport = vport; 486 - OVS_CB(skb)->egress_tun_info = NULL; 487 486 OVS_CB(skb)->mru = 0; 488 487 /* Extract flow from 'skb' into 'key'. */ 489 488 error = ovs_flow_key_extract(tun_info, skb, &key); ··· 574 575 575 576 int ovs_tunnel_get_egress_info(struct ip_tunnel_info *egress_tun_info, 576 577 struct net *net, 577 - const struct ip_tunnel_info *tun_info, 578 + struct sk_buff *skb, 578 579 u8 ipproto, 579 - u32 skb_mark, 580 580 __be16 tp_src, 581 581 __be16 tp_dst) 582 582 { 583 + const struct ip_tunnel_info *tun_info = skb_tunnel_info(skb); 583 584 const struct ip_tunnel_key *tun_key; 585 + u32 skb_mark = skb->mark; 584 586 struct rtable *rt; 585 587 struct flowi4 fl; 586 588
+1 -2
net/openvswitch/vport.h
··· 61 61 62 62 int ovs_tunnel_get_egress_info(struct ip_tunnel_info *egress_tun_info, 63 63 struct net *net, 64 - const struct ip_tunnel_info *tun_info, 64 + struct sk_buff *, 65 65 u8 ipproto, 66 - u32 skb_mark, 67 66 __be16 tp_src, 68 67 __be16 tp_dst); 69 68 int ovs_vport_get_egress_tun_info(struct vport *vport, struct sk_buff *skb,