All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, saeedm@mellanox.com,
	leon@kernel.org, michael.chan@broadcom.com, vishal@chelsio.com,
	jeffrey.t.kirsher@intel.com, idosch@mellanox.com,
	aelior@marvell.com, peppe.cavallaro@st.com,
	alexandre.torgue@st.com, jhs@mojatatu.com,
	xiyou.wangcong@gmail.com, pablo@netfilter.org,
	mlxsw@mellanox.com
Subject: [patch net-next 01/10] net: rename tc_cls_can_offload_and_chain0() to tc_cls_can_offload_basic()
Date: Fri, 21 Feb 2020 10:56:34 +0100	[thread overview]
Message-ID: <20200221095643.6642-2-jiri@resnulli.us> (raw)
In-Reply-To: <20200221095643.6642-1-jiri@resnulli.us>

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 --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;
-- 
2.21.1


  reply	other threads:[~2020-02-21  9:56 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-21  9:56 [patch net-next 00/10] net: allow user specify TC filter HW stats type Jiri Pirko
2020-02-21  9:56 ` Jiri Pirko [this message]
2020-02-21  9:56 ` [patch net-next 02/10] iavf: use tc_cls_can_offload_basic() instead of chain check Jiri Pirko
2020-02-21  9:56 ` [patch net-next 03/10] flow_offload: Introduce offload of HW stats type Jiri Pirko
2020-02-21  9:56 ` [patch net-next 04/10] net: extend tc_cls_can_offload_basic() to check " Jiri Pirko
2020-02-21  9:56 ` [patch net-next 05/10] mlx5: restrict supported HW stats type to "any" Jiri Pirko
2020-02-21  9:56 ` [patch net-next 06/10] mlxsw: " Jiri Pirko
2020-02-21  9:56 ` [patch net-next 07/10] flow_offload: introduce "immediate" HW stats type and allow it in mlxsw Jiri Pirko
2020-02-21  9:56 ` [patch net-next 08/10] flow_offload: introduce "delayed" HW stats type and allow it in mlx5 Jiri Pirko
2020-02-21  9:56 ` [patch net-next 09/10] flow_offload: introduce "disabled" HW stats type and allow it in mlxsw Jiri Pirko
2020-02-21  9:56 ` [patch net-next 10/10] sched: cls_flower: allow user to specify type of HW stats for a filter Jiri Pirko
2020-02-21 18:22 ` [patch net-next 00/10] net: allow user specify TC filter HW stats type Jakub Kicinski
2020-02-22  6:38   ` Jiri Pirko
2020-02-24 11:38     ` Edward Cree
2020-02-24 13:11       ` Jiri Pirko
2020-02-24 15:45         ` Jamal Hadi Salim
2020-02-24 15:50           ` Edward Cree
2020-02-24 15:55             ` Jamal Hadi Salim
2020-02-24 16:25           ` Jiri Pirko
2020-02-25 16:01             ` Jamal Hadi Salim
2020-02-25 16:22               ` Jiri Pirko
2020-02-25 18:06                 ` Jakub Kicinski
2020-02-26 12:52                 ` Jamal Hadi Salim
2020-02-26 13:56                   ` Jiri Pirko
2020-02-28 19:59                 ` Pablo Neira Ayuso
2020-02-29  8:01                   ` Jiri Pirko
2020-02-29 19:56                     ` Pablo Neira Ayuso
2020-03-02 16:07                     ` Edward Cree
2020-02-27 15:57             ` Edward Cree

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200221095643.6642-2-jiri@resnulli.us \
    --to=jiri@resnulli.us \
    --cc=aelior@marvell.com \
    --cc=alexandre.torgue@st.com \
    --cc=davem@davemloft.net \
    --cc=idosch@mellanox.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=jhs@mojatatu.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=michael.chan@broadcom.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=peppe.cavallaro@st.com \
    --cc=saeedm@mellanox.com \
    --cc=vishal@chelsio.com \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.