Skip to content
Snippets Groups Projects
Commit bf43434f authored by Rp, Vijaykumar's avatar Rp, Vijaykumar Committed by Kenneth Johansson
Browse files

Merge pull request #253 in SW_PON/linux from bugfix/UGW_SW-20918-copy-vlan-pcp-to-extmark to xrx500

* commit 'e907b80c84619df7c90ac29ab3869d7b7c480821':
  Using VLAN_PRIO_SHIFT macro
  Fixed Review Comments
  UGW_SW-20918 : copy VLAN ID and PCP vlaue to extmark for 802.1p classification
parent 2794baae
No related branches found
No related tags found
No related merge requests found
......@@ -53,7 +53,6 @@
/*
* Common Head File
*/
/*#include <linux/autoconf.h>*/
#include <linux/version.h>
#include <generated/autoconf.h>
#include <asm/atomic.h>
......@@ -977,6 +976,23 @@ static struct nf_hook_ops ebt_hook_ops[] __read_mostly = {
#endif /* CONFIG_PPA_BR_SESS_LEARNING*/
#if defined(CONFIG_INTEL_IPQOS)
#if defined(CONFIG_VLAN_8021Q_COPY_TO_EXTMARK)
static unsigned int ppa_qos_br_prert_hook_fn(void *priv,
struct sk_buff *skb,
const struct nf_hook_state *state)
{
u16 vlan_id = skb_vlan_tag_get_id(skb);
u16 vlan_tci = skb->vlan_tci;
u32 vprio = (vlan_tci >> VLAN_PRIO_SHIFT);
SET_DATA_FROM_MARK_OPT(skb->extmark, VLANID_MASK,
VLANID_START_BIT_POS, vlan_id);
SET_DATA_FROM_MARK_OPT(skb->extmark, VPRIO_MASK,
VPRIO_START_BIT_POS, vprio);
return NF_ACCEPT;
}
#endif
static unsigned int ppa_qos_br_postrt_hook_fn(void *priv,
struct sk_buff *skb,
const struct nf_hook_state *state)
......@@ -988,6 +1004,15 @@ static unsigned int ppa_qos_br_postrt_hook_fn(void *priv,
}
static struct nf_hook_ops qos_ebt_hook_ops[] __read_mostly = {
#if defined(CONFIG_VLAN_8021Q_COPY_TO_EXTMARK)
/* hook for bridge pre-routing packets */
{
.hook = ppa_qos_br_prert_hook_fn,
.hooknum = NF_BR_PRE_ROUTING,
.pf = NFPROTO_BRIDGE,
.priority = NF_BR_PRI_NAT_DST_BRIDGED,
},
#endif
/* hook for bridge post-routing packets */
{
.hook = ppa_qos_br_postrt_hook_fn,
......
......@@ -110,6 +110,14 @@ config INTEL_IPQOS_ACCEL_DISABLE
If unsure say N
config VLAN_8021Q_COPY_TO_EXTMARK
bool "Will copy 8021Q vlan-id and vlan-prio into extmark"
depends on VLAN_8021Q && NETWORK_EXTMARK
help
Select this to copy 8021Q valn-id and vlan-prio into extmark.
If unsure, say N.
if INET
source "net/ipv4/Kconfig"
source "net/ipv6/Kconfig"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment