diff mbox series

[net-next,01/10] net: rename tc_cls_can_offload_and_chain0() to tc_cls_can_offload_basic()

Message ID 20200221095643.6642-2-jiri@resnulli.us
State Changes Requested
Delegated to: David Miller
Headers show
Series net: allow user specify TC filter HW stats type | expand

Commit Message

Jiri Pirko Feb. 21, 2020, 9:56 a.m. UTC
From: Jiri Pirko <jiri@mellanox.com>

The function is going to be extended for checking not only chain 0, but
also HW stats type. So rename it accordingly as this checks for basic
offloading functionality.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c           | 2 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c       | 2 +-
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c     | 4 ++--
 drivers/net/ethernet/intel/i40e/i40e_main.c         | 2 +-
 drivers/net/ethernet/intel/igb/igb_main.c           | 2 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c       | 2 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c     | 2 +-
 drivers/net/ethernet/mellanox/mlxsw/spectrum.c      | 3 +--
 drivers/net/ethernet/mscc/ocelot_flower.c           | 2 +-
 drivers/net/ethernet/mscc/ocelot_tc.c               | 2 +-
 drivers/net/ethernet/netronome/nfp/abm/cls.c        | 2 +-
 drivers/net/ethernet/netronome/nfp/bpf/main.c       | 2 +-
 drivers/net/ethernet/netronome/nfp/flower/offload.c | 2 +-
 drivers/net/ethernet/qlogic/qede/qede_main.c        | 2 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c   | 2 +-
 drivers/net/netdevsim/bpf.c                         | 2 +-
 include/net/pkt_cls.h                               | 4 ++--
 17 files changed, 19 insertions(+), 20 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 597e6fd5bfea..f62a1d9667fa 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -11043,7 +11043,7 @@  static int bnxt_setup_tc_block_cb(enum tc_setup_type type, void *type_data,
 	struct bnxt *bp = cb_priv;
 
 	if (!bnxt_tc_flower_enabled(bp) ||
-	    !tc_cls_can_offload_and_chain0(bp->dev, type_data))
+	    !tc_cls_can_offload_basic(bp->dev, type_data))
 		return -EOPNOTSUPP;
 
 	switch (type) {
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
index b010b34cdaf8..2ab3ecb298de 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
@@ -150,7 +150,7 @@  static int bnxt_vf_rep_setup_tc_block_cb(enum tc_setup_type type,
 	int vf_fid = bp->pf.vf[vf_rep->vf_idx].fw_fid;
 
 	if (!bnxt_tc_flower_enabled(vf_rep->bp) ||
-	    !tc_cls_can_offload_and_chain0(bp->dev, type_data))
+	    !tc_cls_can_offload_basic(bp->dev, type_data))
 		return -EOPNOTSUPP;
 
 	switch (type) {
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 649842a8aa28..7b98c8e2ce69 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -3316,7 +3316,7 @@  static int cxgb_setup_tc_block_ingress_cb(enum tc_setup_type type,
 		return -EINVAL;
 	}
 
-	if (!tc_cls_can_offload_and_chain0(dev, type_data))
+	if (!tc_cls_can_offload_basic(dev, type_data))
 		return -EOPNOTSUPP;
 
 	switch (type) {
@@ -3345,7 +3345,7 @@  static int cxgb_setup_tc_block_egress_cb(enum tc_setup_type type,
 		return -EINVAL;
 	}
 
-	if (!tc_cls_can_offload_and_chain0(dev, type_data))
+	if (!tc_cls_can_offload_basic(dev, type_data))
 		return -EOPNOTSUPP;
 
 	switch (type) {
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 8c3e753bfb9d..afa9a96e9212 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -8141,7 +8141,7 @@  static int i40e_setup_tc_block_cb(enum tc_setup_type type, void *type_data,
 {
 	struct i40e_netdev_priv *np = cb_priv;
 
-	if (!tc_cls_can_offload_and_chain0(np->vsi->netdev, type_data))
+	if (!tc_cls_can_offload_basic(np->vsi->netdev, type_data))
 		return -EOPNOTSUPP;
 
 	switch (type) {
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index b46bff8fe056..396bda31ab76 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -2775,7 +2775,7 @@  static int igb_setup_tc_block_cb(enum tc_setup_type type, void *type_data,
 {
 	struct igb_adapter *adapter = cb_priv;
 
-	if (!tc_cls_can_offload_and_chain0(adapter->netdev, type_data))
+	if (!tc_cls_can_offload_basic(adapter->netdev, type_data))
 		return -EOPNOTSUPP;
 
 	switch (type) {
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 718931d951bc..a91623b7ba19 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -9631,7 +9631,7 @@  static int ixgbe_setup_tc_block_cb(enum tc_setup_type type, void *type_data,
 {
 	struct ixgbe_adapter *adapter = cb_priv;
 
-	if (!tc_cls_can_offload_and_chain0(adapter->netdev, type_data))
+	if (!tc_cls_can_offload_basic(adapter->netdev, type_data))
 		return -EOPNOTSUPP;
 
 	switch (type) {
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 74091f72c9a8..bcfe2b6e35e5 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -3865,7 +3865,7 @@  mlx5e_add_nic_flow(struct mlx5e_priv *priv,
 	int attr_size, err;
 
 	/* multi-chain not supported for NIC rules */
-	if (!tc_cls_can_offload_and_chain0(priv->netdev, &f->common))
+	if (!tc_cls_can_offload_basic(priv->netdev, &f->common))
 		return -EOPNOTSUPP;
 
 	flow_flags |= BIT(MLX5E_TC_FLOW_FLAG_NIC);
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index d78e790ba94a..de8c11b5c487 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -1589,8 +1589,7 @@  static int mlxsw_sp_setup_tc_block_cb_matchall(enum tc_setup_type type,
 
 	switch (type) {
 	case TC_SETUP_CLSMATCHALL:
-		if (!tc_cls_can_offload_and_chain0(mlxsw_sp_port->dev,
-						   type_data))
+		if (!tc_cls_can_offload_basic(mlxsw_sp_port->dev, type_data))
 			return -EOPNOTSUPP;
 
 		return mlxsw_sp_setup_tc_cls_matchall(mlxsw_sp_port, type_data,
diff --git a/drivers/net/ethernet/mscc/ocelot_flower.c b/drivers/net/ethernet/mscc/ocelot_flower.c
index 3d65b99b9734..64d2758eb223 100644
--- a/drivers/net/ethernet/mscc/ocelot_flower.c
+++ b/drivers/net/ethernet/mscc/ocelot_flower.c
@@ -261,7 +261,7 @@  static int ocelot_setup_tc_block_cb_flower(enum tc_setup_type type,
 {
 	struct ocelot_port_block *port_block = cb_priv;
 
-	if (!tc_cls_can_offload_and_chain0(port_block->priv->dev, type_data))
+	if (!tc_cls_can_offload_basic(port_block->priv->dev, type_data))
 		return -EOPNOTSUPP;
 
 	switch (type) {
diff --git a/drivers/net/ethernet/mscc/ocelot_tc.c b/drivers/net/ethernet/mscc/ocelot_tc.c
index a4f7fbd76507..954136db2f62 100644
--- a/drivers/net/ethernet/mscc/ocelot_tc.c
+++ b/drivers/net/ethernet/mscc/ocelot_tc.c
@@ -94,7 +94,7 @@  static int ocelot_setup_tc_block_cb(enum tc_setup_type type,
 {
 	struct ocelot_port_private *priv = cb_priv;
 
-	if (!tc_cls_can_offload_and_chain0(priv->dev, type_data))
+	if (!tc_cls_can_offload_basic(priv->dev, type_data))
 		return -EOPNOTSUPP;
 
 	switch (type) {
diff --git a/drivers/net/ethernet/netronome/nfp/abm/cls.c b/drivers/net/ethernet/netronome/nfp/abm/cls.c
index 23ebddfb9532..7c59b248e216 100644
--- a/drivers/net/ethernet/netronome/nfp/abm/cls.c
+++ b/drivers/net/ethernet/netronome/nfp/abm/cls.c
@@ -238,7 +238,7 @@  static int nfp_abm_setup_tc_block_cb(enum tc_setup_type type,
 				   "only offload of u32 classifier supported");
 		return -EOPNOTSUPP;
 	}
-	if (!tc_cls_can_offload_and_chain0(repr->netdev, &cls_u32->common))
+	if (!tc_cls_can_offload_basic(repr->netdev, &cls_u32->common))
 		return -EOPNOTSUPP;
 
 	if (cls_u32->common.protocol != htons(ETH_P_IP) &&
diff --git a/drivers/net/ethernet/netronome/nfp/bpf/main.c b/drivers/net/ethernet/netronome/nfp/bpf/main.c
index 11c83a99b014..4c1b2bd655a0 100644
--- a/drivers/net/ethernet/netronome/nfp/bpf/main.c
+++ b/drivers/net/ethernet/netronome/nfp/bpf/main.c
@@ -116,7 +116,7 @@  static int nfp_bpf_setup_tc_block_cb(enum tc_setup_type type,
 				   "only offload of BPF classifiers supported");
 		return -EOPNOTSUPP;
 	}
-	if (!tc_cls_can_offload_and_chain0(nn->dp.netdev, &cls_bpf->common))
+	if (!tc_cls_can_offload_basic(nn->dp.netdev, &cls_bpf->common))
 		return -EOPNOTSUPP;
 	if (!nfp_net_ebpf_capable(nn)) {
 		NL_SET_ERR_MSG_MOD(cls_bpf->common.extack,
diff --git a/drivers/net/ethernet/netronome/nfp/flower/offload.c b/drivers/net/ethernet/netronome/nfp/flower/offload.c
index 7ca5c1becfcf..7a9bb55deec2 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/offload.c
+++ b/drivers/net/ethernet/netronome/nfp/flower/offload.c
@@ -1523,7 +1523,7 @@  static int nfp_flower_setup_tc_block_cb(enum tc_setup_type type,
 {
 	struct nfp_repr *repr = cb_priv;
 
-	if (!tc_cls_can_offload_and_chain0(repr->netdev, type_data))
+	if (!tc_cls_can_offload_basic(repr->netdev, type_data))
 		return -EOPNOTSUPP;
 
 	switch (type) {
diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c
index 34fa3917eb33..6168bb6e855c 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_main.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_main.c
@@ -567,7 +567,7 @@  static int qede_setup_tc_block_cb(enum tc_setup_type type, void *type_data,
 	struct flow_cls_offload *f;
 	struct qede_dev *edev = cb_priv;
 
-	if (!tc_cls_can_offload_and_chain0(edev->ndev, type_data))
+	if (!tc_cls_can_offload_basic(edev->ndev, type_data))
 		return -EOPNOTSUPP;
 
 	switch (type) {
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 37920b4da091..80b528a58723 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -4120,7 +4120,7 @@  static int stmmac_setup_tc_block_cb(enum tc_setup_type type, void *type_data,
 	struct stmmac_priv *priv = cb_priv;
 	int ret = -EOPNOTSUPP;
 
-	if (!tc_cls_can_offload_and_chain0(priv->dev, type_data))
+	if (!tc_cls_can_offload_basic(priv->dev, type_data))
 		return ret;
 
 	stmmac_disable_all_queues(priv);
diff --git a/drivers/net/netdevsim/bpf.c b/drivers/net/netdevsim/bpf.c
index 0b362b8dac17..537a4233a989 100644
--- a/drivers/net/netdevsim/bpf.c
+++ b/drivers/net/netdevsim/bpf.c
@@ -124,7 +124,7 @@  int nsim_bpf_setup_tc_block_cb(enum tc_setup_type type,
 		return -EOPNOTSUPP;
 	}
 
-	if (!tc_cls_can_offload_and_chain0(ns->netdev, &cls_bpf->common))
+	if (!tc_cls_can_offload_basic(ns->netdev, &cls_bpf->common))
 		return -EOPNOTSUPP;
 
 	if (cls_bpf->common.protocol != htons(ETH_P_ALL)) {
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 53946b509b51..779364ed080a 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -584,8 +584,8 @@  static inline bool tc_can_offload_extack(const struct net_device *dev,
 }
 
 static inline bool
-tc_cls_can_offload_and_chain0(const struct net_device *dev,
-			      struct flow_cls_common_offload *common)
+tc_cls_can_offload_basic(const struct net_device *dev,
+			 struct flow_cls_common_offload *common)
 {
 	if (!tc_can_offload_extack(dev, common->extack))
 		return false;