* - skb->csum does not include the inner Ethernet header.
* - The layer pointers are undefined.
*/
-void ovs_tnl_rcv(struct vport *vport, struct sk_buff *skb)
+void ovs_tnl_rcv(struct vport *vport, struct sk_buff *skb,
+ struct ovs_key_ipv4_tunnel *tun_key)
{
struct ethhdr *eh;
return;
}
- ovs_vport_receive(vport, skb);
+ ovs_vport_receive(vport, skb, tun_key);
}
static struct rtable *find_route(struct net *net,
struct sk_buff *,
int tunnel_hlen));
-void ovs_tnl_rcv(struct vport *vport, struct sk_buff *skb);
+void ovs_tnl_rcv(struct vport *vport, struct sk_buff *skb,
+ struct ovs_key_ipv4_tunnel *tun_key);
u16 ovs_tnl_get_src_port(struct sk_buff *skb);
static inline void tnl_tun_key_init(struct ovs_key_ipv4_tunnel *tun_key,
iph = ip_hdr(skb);
tnl_flags = gre_flags_to_tunnel_flags(gre_flags, is_gre64);
tnl_tun_key_init(&tun_key, iph, key, tnl_flags);
- OVS_CB(skb)->tun_key = &tun_key;
__skb_pull(skb, hdr_len);
skb_postpull_rcsum(skb, skb_transport_header(skb), hdr_len + ETH_HLEN);
- ovs_tnl_rcv(vport, skb);
+ ovs_tnl_rcv(vport, skb, &tun_key);
return 0;
error:
const struct vport_ops ovs_gre_vport_ops = {
.type = OVS_VPORT_TYPE_GRE,
- .flags = VPORT_F_TUN_ID,
.create = gre_create,
.destroy = gre_tnl_destroy,
.get_name = gre_get_name,
const struct vport_ops ovs_gre64_vport_ops = {
.type = OVS_VPORT_TYPE_GRE64,
- .flags = VPORT_F_TUN_ID,
.create = gre64_create,
.destroy = gre64_tnl_destroy,
.get_name = gre_get_name,
vlan_copy_skb_tci(skb);
rcu_read_lock();
- ovs_vport_receive(internal_dev_priv(netdev)->vport, skb);
+ ovs_vport_receive(internal_dev_priv(netdev)->vport, skb, NULL);
rcu_read_unlock();
return 0;
}
/* Save outer tunnel values */
iph = ip_hdr(skb);
tnl_tun_key_init(&tun_key, iph, key, OVS_TNL_F_KEY);
- OVS_CB(skb)->tun_key = &tun_key;
/* Drop non-IP inner packets */
inner_iph = (struct iphdr *)(lisph + 1);
ethh->h_source[0] = 0x02;
ethh->h_proto = protocol;
- ovs_tnl_rcv(vport_from_priv(lisp_port), skb);
+ ovs_tnl_rcv(vport_from_priv(lisp_port), skb, &tun_key);
goto out;
error:
const struct vport_ops ovs_lisp_vport_ops = {
.type = OVS_VPORT_TYPE_LISP,
- .flags = VPORT_F_TUN_ID,
.create = lisp_tnl_create,
.destroy = lisp_tnl_destroy,
.get_name = lisp_get_name,
vlan_copy_skb_tci(skb);
- ovs_vport_receive(vport, skb);
+ ovs_vport_receive(vport, skb, NULL);
return;
error:
/* Save outer tunnel values */
iph = ip_hdr(skb);
tnl_tun_key_init(&tun_key, iph, key, OVS_TNL_F_KEY);
- OVS_CB(skb)->tun_key = &tun_key;
- ovs_tnl_rcv(vport_from_priv(vxlan_vport), skb);
+ ovs_tnl_rcv(vport_from_priv(vxlan_vport), skb, &tun_key);
goto out;
error:
const struct vport_ops ovs_vxlan_vport_ops = {
.type = OVS_VPORT_TYPE_VXLAN,
- .flags = VPORT_F_TUN_ID,
.create = vxlan_tnl_create,
.destroy = vxlan_tnl_destroy,
.get_name = vxlan_get_name,
* skb->data should point to the Ethernet header. The caller must have already
* called compute_ip_summed() to initialize the checksumming fields.
*/
-void ovs_vport_receive(struct vport *vport, struct sk_buff *skb)
+void ovs_vport_receive(struct vport *vport, struct sk_buff *skb,
+ struct ovs_key_ipv4_tunnel *tun_key)
{
struct pcpu_tstats *stats;
stats->rx_bytes += skb->len;
u64_stats_update_end(&stats->syncp);
- if (!(vport->ops->flags & VPORT_F_TUN_ID))
- OVS_CB(skb)->tun_key = NULL;
-
+ OVS_CB(skb)->tun_key = tun_key;
ovs_dp_process_received_packet(vport, skb);
}
struct ovs_vport_stats offset_stats;
};
-#define VPORT_F_TUN_ID (1 << 0) /* Sets OVS_CB(skb)->tun_id. */
-
/**
* struct vport_parms - parameters for creating a new vport
*
* struct vport_ops - definition of a type of virtual port
*
* @type: %OVS_VPORT_TYPE_* value for this type of virtual port.
- * @flags: Flags of type VPORT_F_* that influence how the generic vport layer
- * handles this vport.
* @create: Create a new vport configured as specified. On success returns
* a new vport allocated with ovs_vport_alloc(), otherwise an ERR_PTR() value.
* @destroy: Destroys a vport. Must call vport_free() on the vport but not
*/
struct vport_ops {
enum ovs_vport_type type;
- u32 flags;
/* Called with ovs_mutex. */
struct vport *(*create)(const struct vport_parms *);
return (struct vport *)(priv - ALIGN(sizeof(struct vport), VPORT_ALIGN));
}
-void ovs_vport_receive(struct vport *, struct sk_buff *);
+void ovs_vport_receive(struct vport *, struct sk_buff *,
+ struct ovs_key_ipv4_tunnel *);
void ovs_vport_record_error(struct vport *, enum vport_err_type err_type);
/* List of statically compiled vport implementations. Don't forget to also