* [PATCH net-next 1/3] net/vlan: introduce __vlan_hwaccel_clear_tag() helper
2017-01-03 23:53 [PATCH net-next 0/3] Preparation for VLAN_TAG_PRESENT cleanup Michał Mirosław
@ 2017-01-03 23:53 ` Michał Mirosław
2017-01-03 23:53 ` [PATCH net-next 3/3] net/vlan: include the shift in skb_vlan_tag_get_prio() Michał Mirosław
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Michał Mirosław @ 2017-01-03 23:53 UTC (permalink / raw)
To: netdev
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
include/linux/if_vlan.h | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 8d5fcd6284ce..38be9041cde4 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -382,6 +382,17 @@ static inline struct sk_buff *vlan_insert_tag_set_proto(struct sk_buff *skb,
return skb;
}
+/**
+ * __vlan_hwaccel_clear_tag - clear hardware accelerated VLAN info
+ * @skb: skbuff to clear
+ *
+ * Clears the VLAN information from @skb
+ */
+static inline void __vlan_hwaccel_clear_tag(struct sk_buff *skb)
+{
+ skb->vlan_tci = 0;
+}
+
/*
* __vlan_hwaccel_push_inside - pushes vlan tag to the payload
* @skb: skbuff to tag
@@ -396,7 +407,7 @@ static inline struct sk_buff *__vlan_hwaccel_push_inside(struct sk_buff *skb)
skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto,
skb_vlan_tag_get(skb));
if (likely(skb))
- skb->vlan_tci = 0;
+ __vlan_hwaccel_clear_tag(skb);
return skb;
}
--
2.11.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH net-next 3/3] net/vlan: include the shift in skb_vlan_tag_get_prio()
2017-01-03 23:53 [PATCH net-next 0/3] Preparation for VLAN_TAG_PRESENT cleanup Michał Mirosław
2017-01-03 23:53 ` [PATCH net-next 1/3] net/vlan: introduce __vlan_hwaccel_clear_tag() helper Michał Mirosław
@ 2017-01-03 23:53 ` Michał Mirosław
2017-01-03 23:53 ` [PATCH net-next 2/3] net/vlan: introduce __vlan_hwaccel_copy_tag() helper Michał Mirosław
2017-01-04 3:23 ` [PATCH net-next 0/3] Preparation for VLAN_TAG_PRESENT cleanup David Miller
3 siblings, 0 replies; 5+ messages in thread
From: Michał Mirosław @ 2017-01-03 23:53 UTC (permalink / raw)
To: netdev
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
include/linux/if_vlan.h | 2 +-
net/core/flow_dissector.c | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 75e839b84a63..bc4e8c2533da 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -81,7 +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)
+#define skb_vlan_tag_get_prio(__skb) (((__skb)->vlan_tci & VLAN_PRIO_MASK) >> VLAN_PRIO_SHIFT)
/**
* struct vlan_pcpu_stats - VLAN percpu rx/tx stats
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index d6447dc10371..d93768ac39a1 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -295,8 +295,7 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
if (vlan_tag_present) {
key_vlan->vlan_id = skb_vlan_tag_get_id(skb);
- key_vlan->vlan_priority =
- (skb_vlan_tag_get_prio(skb) >> VLAN_PRIO_SHIFT);
+ key_vlan->vlan_priority = skb_vlan_tag_get_prio(skb);
} else {
key_vlan->vlan_id = ntohs(vlan->h_vlan_TCI) &
VLAN_VID_MASK;
--
2.11.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH net-next 2/3] net/vlan: introduce __vlan_hwaccel_copy_tag() helper
2017-01-03 23:53 [PATCH net-next 0/3] Preparation for VLAN_TAG_PRESENT cleanup Michał Mirosław
2017-01-03 23:53 ` [PATCH net-next 1/3] net/vlan: introduce __vlan_hwaccel_clear_tag() helper Michał Mirosław
2017-01-03 23:53 ` [PATCH net-next 3/3] net/vlan: include the shift in skb_vlan_tag_get_prio() Michał Mirosław
@ 2017-01-03 23:53 ` Michał Mirosław
2017-01-04 3:23 ` [PATCH net-next 0/3] Preparation for VLAN_TAG_PRESENT cleanup David Miller
3 siblings, 0 replies; 5+ messages in thread
From: Michał Mirosław @ 2017-01-03 23:53 UTC (permalink / raw)
To: netdev
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
include/linux/if_vlan.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 38be9041cde4..75e839b84a63 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -393,6 +393,19 @@ static inline void __vlan_hwaccel_clear_tag(struct sk_buff *skb)
skb->vlan_tci = 0;
}
+/**
+ * __vlan_hwaccel_copy_tag - copy hardware accelerated VLAN info from another skb
+ * @dst: skbuff to copy to
+ * @src: skbuff to copy from
+ *
+ * Copies VLAN information from @src to @dst (for branchless code)
+ */
+static inline void __vlan_hwaccel_copy_tag(struct sk_buff *dst, const struct sk_buff *src)
+{
+ dst->vlan_proto = src->vlan_proto;
+ dst->vlan_tci = src->vlan_tci;
+}
+
/*
* __vlan_hwaccel_push_inside - pushes vlan tag to the payload
* @skb: skbuff to tag
--
2.11.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH net-next 0/3] Preparation for VLAN_TAG_PRESENT cleanup
2017-01-03 23:53 [PATCH net-next 0/3] Preparation for VLAN_TAG_PRESENT cleanup Michał Mirosław
` (2 preceding siblings ...)
2017-01-03 23:53 ` [PATCH net-next 2/3] net/vlan: introduce __vlan_hwaccel_copy_tag() helper Michał Mirosław
@ 2017-01-04 3:23 ` David Miller
3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2017-01-04 3:23 UTC (permalink / raw)
To: mirq-linux; +Cc: netdev
By submitted these in sections, but all at once, you are subverting
my requirement to submit only small self contained patch series.
Please do not do this.
The whole point is to not have a lot of patches in flight for one
thing for people to review at one time. Contributors can review
more easily small, easily digestable, pieces.
Start over, and only submit small numbers of patches at one time. Do
not submit new patches until the first series has been processed.
Thank you.
^ permalink raw reply [flat|nested] 5+ messages in thread