Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fb36938d authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'flow-dissector-vlan-tag'



Hadar Hen Zion says:

====================
net_sched, flow_dissector, flower: Introduce vlan tag support

This patchset introduce vlan tag support to the flower classifier and the flow
dissector. In addition to adding vlan priority to act vlan.

The first 2 patches are dealing with flow-dissector:
 - The first patch is a fix, in case the vlan was already stripped from the
   skb, take it from skb->vlan_tci.
 - The second patch adds support for vlan priority.

The next 2 patches are dealing with flower:
 - The first patch is a fix, sets flow dissector 'used_keys' according to the
   mask value of each key.
 - The secound patch adds vlan tag support to the flower classifier, user space
   patches will be sent later to complete it.

The last patch adds vlan priority to act vlan since only vlan id is currently supported.

Changes from V1:
 - A new patch was added to this series "net_sched: flower: Avoid dissection of unmasked keys"
 - Adding u16 padding to struct flow_dissector_key_vlan
 - change flow_label field in struct flow_dissector_key_tags form 20 bits field to u32
 - Remove 'if (v->tcfv_push_prio)' check from tcf_vlan_dump function
 - Add support to un-stripped vlan skb and skb with multipale vlans in __skb_flow_dissect
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 92bcdcc6 956af371
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ static inline bool is_vlan_dev(const struct net_device *dev)
#define skb_vlan_tag_present(__skb)	((__skb)->vlan_tci & VLAN_TAG_PRESENT)
#define skb_vlan_tag_get(__skb)		((__skb)->vlan_tci & ~VLAN_TAG_PRESENT)
#define skb_vlan_tag_get_id(__skb)	((__skb)->vlan_tci & VLAN_VID_MASK)
#define skb_vlan_tag_get_prio(__skb)	((__skb)->vlan_tci & VLAN_PRIO_MASK)

/**
 *	struct vlan_pcpu_stats - VLAN percpu rx/tx stats
+9 −3
Original line number Diff line number Diff line
@@ -32,8 +32,13 @@ struct flow_dissector_key_basic {
};

struct flow_dissector_key_tags {
	u32	vlan_id:12,
		flow_label:20;
	u32	flow_label;
};

struct flow_dissector_key_vlan {
	u16	vlan_id:12,
		vlan_priority:3;
	u16	padding;
};

struct flow_dissector_key_keyid {
@@ -119,7 +124,7 @@ enum flow_dissector_key_id {
	FLOW_DISSECTOR_KEY_PORTS, /* struct flow_dissector_key_ports */
	FLOW_DISSECTOR_KEY_ETH_ADDRS, /* struct flow_dissector_key_eth_addrs */
	FLOW_DISSECTOR_KEY_TIPC_ADDRS, /* struct flow_dissector_key_tipc_addrs */
	FLOW_DISSECTOR_KEY_VLANID, /* struct flow_dissector_key_flow_tags */
	FLOW_DISSECTOR_KEY_VLAN, /* struct flow_dissector_key_flow_vlan */
	FLOW_DISSECTOR_KEY_FLOW_LABEL, /* struct flow_dissector_key_flow_tags */
	FLOW_DISSECTOR_KEY_GRE_KEYID, /* struct flow_dissector_key_keyid */
	FLOW_DISSECTOR_KEY_MPLS_ENTROPY, /* struct flow_dissector_key_keyid */
@@ -148,6 +153,7 @@ struct flow_keys {
#define FLOW_KEYS_HASH_START_FIELD basic
	struct flow_dissector_key_basic basic;
	struct flow_dissector_key_tags tags;
	struct flow_dissector_key_vlan vlan;
	struct flow_dissector_key_keyid keyid;
	struct flow_dissector_key_ports ports;
	struct flow_dissector_key_addrs addrs;
+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ struct tcf_vlan {
	int			tcfv_action;
	u16			tcfv_push_vid;
	__be16			tcfv_push_proto;
	u8			tcfv_push_prio;
};
#define to_vlan(a) ((struct tcf_vlan *)a)

+3 −0
Original line number Diff line number Diff line
@@ -428,6 +428,9 @@ enum {
	TCA_FLOWER_KEY_UDP_DST,		/* be16 */

	TCA_FLOWER_FLAGS,
	TCA_FLOWER_KEY_VLAN_ID,
	TCA_FLOWER_KEY_VLAN_PRIO,
	TCA_FLOWER_KEY_VLAN_ETH_TYPE,
	__TCA_FLOWER_MAX,
};

+1 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ enum {
	TCA_VLAN_PUSH_VLAN_ID,
	TCA_VLAN_PUSH_VLAN_PROTOCOL,
	TCA_VLAN_PAD,
	TCA_VLAN_PUSH_VLAN_PRIORITY,
	__TCA_VLAN_MAX,
};
#define TCA_VLAN_MAX (__TCA_VLAN_MAX - 1)
Loading