Commit 5e29c16f authored by Ionut-robert Aron's avatar Ionut-robert Aron Committed by David S. Miller

dpaa2-eth: install a single steering rule when SHARED_FS is enabled

When SHARED_FS is enabled on a DPNI object the flow steering tables are
shared between all the traffic classes. Modify the driver so that we
only add a new flow steering entry on the TC#0 when this new option is
enabled.
Signed-off-by: default avatarIonut-robert Aron <ionut-robert.aron@nxp.com>
Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4c33a5bd
...@@ -3454,6 +3454,12 @@ static int dpaa2_eth_config_hash_key(struct dpaa2_eth_priv *priv, dma_addr_t key ...@@ -3454,6 +3454,12 @@ static int dpaa2_eth_config_hash_key(struct dpaa2_eth_priv *priv, dma_addr_t key
dev_err(dev, "dpni_set_rx_hash_dist failed\n"); dev_err(dev, "dpni_set_rx_hash_dist failed\n");
break; break;
} }
/* If the flow steering / hashing key is shared between all
* traffic classes, install it just once
*/
if (priv->dpni_attrs.options & DPNI_OPT_SHARED_FS)
break;
} }
return err; return err;
...@@ -3480,6 +3486,12 @@ static int dpaa2_eth_config_cls_key(struct dpaa2_eth_priv *priv, dma_addr_t key) ...@@ -3480,6 +3486,12 @@ static int dpaa2_eth_config_cls_key(struct dpaa2_eth_priv *priv, dma_addr_t key)
dev_err(dev, "dpni_set_rx_fs_dist failed\n"); dev_err(dev, "dpni_set_rx_fs_dist failed\n");
break; break;
} }
/* If the flow steering / hashing key is shared between all
* traffic classes, install it just once
*/
if (priv->dpni_attrs.options & DPNI_OPT_SHARED_FS)
break;
} }
return err; return err;
......
...@@ -618,7 +618,7 @@ static int dpaa2_eth_do_cls_rule(struct net_device *net_dev, ...@@ -618,7 +618,7 @@ static int dpaa2_eth_do_cls_rule(struct net_device *net_dev,
err = dpni_remove_fs_entry(priv->mc_io, 0, err = dpni_remove_fs_entry(priv->mc_io, 0,
priv->mc_token, i, priv->mc_token, i,
&rule_cfg); &rule_cfg);
if (err) if (err || priv->dpni_attrs.options & DPNI_OPT_SHARED_FS)
break; break;
} }
......
...@@ -75,6 +75,10 @@ struct fsl_mc_io; ...@@ -75,6 +75,10 @@ struct fsl_mc_io;
* Disables the flow steering table. * Disables the flow steering table.
*/ */
#define DPNI_OPT_NO_FS 0x000020 #define DPNI_OPT_NO_FS 0x000020
/**
* Flow steering table is shared between all traffic classes
*/
#define DPNI_OPT_SHARED_FS 0x001000
int dpni_open(struct fsl_mc_io *mc_io, int dpni_open(struct fsl_mc_io *mc_io,
u32 cmd_flags, u32 cmd_flags,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment