lede/target/linux/ipq807x/patches-5.10/603-net-core-Flag-to-identify-ingress-shaping-done-for-e.patch
2023-06-12 12:08:04 +08:00

75 lines
2.2 KiB
Diff

From a0c69a23c66ec6f527c439714eb2cc5857a71492 Mon Sep 17 00:00:00 2001
From: Himanshu Joshi <himajosh@codeaurora.org>
Date: Tue, 3 Nov 2020 16:41:26 +0530
Subject: [PATCH] net: core: Flag to identify ingress shaping done for
exceptioned packets.
Signed-off-by: Himanshu Joshi <himajosh@codeaurora.org>
Change-Id: Ib3cd341e5b2d4dcf552e02e38d3f34a4f00351cd
---
include/linux/skbuff.h | 2 ++
include/net/sch_generic.h | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+)
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -648,6 +648,7 @@ typedef unsigned char *sk_buff_data_t;
* @offload_fwd_mark: Packet was L2-forwarded in hardware
* @offload_l3_fwd_mark: Packet was L3-forwarded in hardware
* @tc_skip_classify: do not classify packet. set by IFB device
+ * @tc_skip_classify_nss: do not classify packet. set by NSS IFB device
* @tc_at_ingress: used within tc_classify to distinguish in/egress
* @redirected: packet was redirected by packet classifier
* @from_ingress: packet was redirected from the ingress path
@@ -855,6 +856,7 @@ struct sk_buff {
#ifdef CONFIG_NET_CLS_ACT
__u8 tc_skip_classify:1;
__u8 tc_at_ingress:1;
+ __u8 tc_skip_classify_nss:1;
#endif
#ifdef CONFIG_NET_REDIRECT
__u8 redirected:1;
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -740,6 +740,40 @@ static inline bool skb_skip_tc_classify(
return false;
}
+/*
+ * Set skb classify bit field.
+ */
+static inline void skb_set_tc_classify_nss(struct sk_buff *skb)
+{
+#ifdef CONFIG_NET_CLS_ACT
+ skb->tc_skip_classify_nss = 1;
+#endif
+}
+
+/*
+ * Clear skb classify bit field.
+ */
+static inline void skb_clear_tc_classify_nss(struct sk_buff *skb)
+{
+#ifdef CONFIG_NET_CLS_ACT
+ skb->tc_skip_classify_nss = 0;
+#endif
+}
+
+/*
+ * Skip skb processing if sent from ifb dev.
+ */
+static inline bool skb_skip_tc_classify_nss(struct sk_buff *skb)
+{
+#ifdef CONFIG_NET_CLS_ACT
+ if (skb->tc_skip_classify_nss) {
+ skb_clear_tc_classify_nss(skb);
+ return true;
+ }
+#endif
+ return false;
+}
+
/* Reset all TX qdiscs greater than index of a device. */
static inline void qdisc_reset_all_tx_gt(struct net_device *dev, unsigned int i)
{