net: stmmac: restructure tc implementation for RX VLAN Priority steering
The current tc_add_flow() and tc_del_flow() use hardware L3 & L4 filters as offloading. The number of L3/L4 filters is read from L3L4FNUM field from MAC_HW_Feature1 register and is used to alloc priv->tc_entries[]. For RX frame steering based on VLAN priority offloading, we use MAC_RXQ_CTRL2 & MAC_RXQ_CTRL3 registers and all VLAN priority level can be configured independent from L3 & L4 filters. Signed-off-by: Ong Boon Leong <boon.leong.ong@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
3122216255
commit
bd0f670e79
|
@ -598,6 +598,26 @@ static int tc_del_flow(struct stmmac_priv *priv,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int tc_add_flow_cls(struct stmmac_priv *priv,
|
||||||
|
struct flow_cls_offload *cls)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = tc_add_flow(priv, cls);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int tc_del_flow_cls(struct stmmac_priv *priv,
|
||||||
|
struct flow_cls_offload *cls)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = tc_del_flow(priv, cls);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
static int tc_setup_cls(struct stmmac_priv *priv,
|
static int tc_setup_cls(struct stmmac_priv *priv,
|
||||||
struct flow_cls_offload *cls)
|
struct flow_cls_offload *cls)
|
||||||
{
|
{
|
||||||
|
@ -609,10 +629,10 @@ static int tc_setup_cls(struct stmmac_priv *priv,
|
||||||
|
|
||||||
switch (cls->command) {
|
switch (cls->command) {
|
||||||
case FLOW_CLS_REPLACE:
|
case FLOW_CLS_REPLACE:
|
||||||
ret = tc_add_flow(priv, cls);
|
ret = tc_add_flow_cls(priv, cls);
|
||||||
break;
|
break;
|
||||||
case FLOW_CLS_DESTROY:
|
case FLOW_CLS_DESTROY:
|
||||||
ret = tc_del_flow(priv, cls);
|
ret = tc_del_flow_cls(priv, cls);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
Loading…
Reference in New Issue