Skip to content

Commit 3eedb41

Browse files
Pravin B Shelardavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 24d43f3 commit 3eedb41

File tree

8 files changed

+7
-20
lines changed

8 files changed

+7
-20
lines changed

net/openvswitch/actions.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -896,10 +896,6 @@ static int execute_set_action(struct sk_buff *skb,
896896
skb_dst_drop(skb);
897897
dst_hold((struct dst_entry *)tun->tun_dst);
898898
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-
903899
return 0;
904900
}
905901

@@ -1159,7 +1155,6 @@ int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb,
11591155
int err;
11601156

11611157
this_cpu_inc(exec_actions_level);
1162-
OVS_CB(skb)->egress_tun_info = NULL;
11631158
err = do_execute_actions(dp, skb, key,
11641159
acts->actions, acts->actions_len);
11651160

net/openvswitch/datapath.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,6 @@ static int ovs_packet_cmd_execute(struct sk_buff *skb, struct genl_info *info)
610610
goto err_flow_free;
611611

612612
rcu_assign_pointer(flow->sf_acts, acts);
613-
OVS_CB(packet)->egress_tun_info = NULL;
614613
packet->priority = flow->key.phy.priority;
615614
packet->mark = flow->key.phy.skb_mark;
616615

net/openvswitch/datapath.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,12 @@ struct datapath {
9494

9595
/**
9696
* 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.
9997
* @input_vport: The original vport packet came in on. This value is cached
10098
* when a packet is received by OVS.
10199
* @mru: The maximum received fragement size; 0 if the packet is not
102100
* fragmented.
103101
*/
104102
struct ovs_skb_cb {
105-
struct ip_tunnel_info *egress_tun_info;
106103
struct vport *input_vport;
107104
u16 mru;
108105
};

net/openvswitch/vport-geneve.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ static int geneve_get_egress_tun_info(struct vport *vport, struct sk_buff *skb,
6262

6363
return ovs_tunnel_get_egress_info(egress_tun_info,
6464
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);
6766
}
6867

6968
static struct vport *geneve_tnl_create(const struct vport_parms *parms)

net/openvswitch/vport-gre.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ static int gre_get_egress_tun_info(struct vport *vport, struct sk_buff *skb,
8989
{
9090
return ovs_tunnel_get_egress_info(egress_tun_info,
9191
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);
9493
}
9594

9695
static struct vport_ops ovs_gre_vport_ops = {

net/openvswitch/vport-vxlan.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,7 @@ static int vxlan_get_egress_tun_info(struct vport *vport, struct sk_buff *skb,
160160
src_port = udp_flow_src_port(net, skb, 0, 0, true);
161161

162162
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,
165164
src_port, dst_port);
166165
}
167166

net/openvswitch/vport.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,6 @@ void ovs_vport_receive(struct vport *vport, struct sk_buff *skb,
483483
u64_stats_update_end(&stats->syncp);
484484

485485
OVS_CB(skb)->input_vport = vport;
486-
OVS_CB(skb)->egress_tun_info = NULL;
487486
OVS_CB(skb)->mru = 0;
488487
/* Extract flow from 'skb' into 'key'. */
489488
error = ovs_flow_key_extract(tun_info, skb, &key);
@@ -575,13 +574,14 @@ EXPORT_SYMBOL_GPL(ovs_vport_deferred_free);
575574

576575
int ovs_tunnel_get_egress_info(struct ip_tunnel_info *egress_tun_info,
577576
struct net *net,
578-
const struct ip_tunnel_info *tun_info,
577+
struct sk_buff *skb,
579578
u8 ipproto,
580-
u32 skb_mark,
581579
__be16 tp_src,
582580
__be16 tp_dst)
583581
{
582+
const struct ip_tunnel_info *tun_info = skb_tunnel_info(skb);
584583
const struct ip_tunnel_key *tun_key;
584+
u32 skb_mark = skb->mark;
585585
struct rtable *rt;
586586
struct flowi4 fl;
587587

net/openvswitch/vport.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,8 @@ int ovs_vport_send(struct vport *, struct sk_buff *);
6161

6262
int ovs_tunnel_get_egress_info(struct ip_tunnel_info *egress_tun_info,
6363
struct net *net,
64-
const struct ip_tunnel_info *tun_info,
64+
struct sk_buff *,
6565
u8 ipproto,
66-
u32 skb_mark,
6766
__be16 tp_src,
6867
__be16 tp_dst);
6968
int ovs_vport_get_egress_tun_info(struct vport *vport, struct sk_buff *skb,

0 commit comments

Comments
 (0)