From: Tom Herbert <tom@herbertland.com>
To: <saeedm@mellanox.com>, <davem@davemloft.net>, <netdev@vger.kernel.org>
Cc: <kernel-team@fb.com>
Subject: [PATCH net-next 3/4] mlx5: Make building tc hardware offload configurable
Date: Thu, 26 Jan 2017 15:32:40 -0800 [thread overview]
Message-ID: <20170126233241.2268449-4-tom@herbertland.com> (raw)
In-Reply-To: <20170126233241.2268449-1-tom@herbertland.com>
Add a configuration option (CONFIG_MLX5_CORE_EN_TC) for controlling
whether the eswitch code is built. Change Kconfig and Makefile
accordingly.
Signed-off-by: Tom Herbert <tom@herbertland.com>
---
drivers/net/ethernet/mellanox/mlx5/core/Kconfig | 8 ++++++++
drivers/net/ethernet/mellanox/mlx5/core/Makefile | 4 +++-
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 10 ++++++++++
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
index 7ade61a..b38c920 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
+++ b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
@@ -49,3 +49,11 @@ config MLX5_CORE_EN_SRIOV
Say Y here if you want to use SR-IOV.
If unsure, set to Y
+
+config MLX5_CORE_EN_TC
+ bool "TC offload"
+ default y
+ ---help---
+ Say Y here if you want to use TC hardware offload support.
+
+ If unsure, set to Y
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Makefile b/drivers/net/ethernet/mellanox/mlx5/core/Makefile
index 6d38250..c308531 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/Makefile
+++ b/drivers/net/ethernet/mellanox/mlx5/core/Makefile
@@ -8,10 +8,12 @@ mlx5_core-y := main.o cmd.o debugfs.o fw.o eq.o uar.o pagealloc.o \
mlx5_core-$(CONFIG_MLX5_CORE_EN) += wq.o \
en_main.o en_common.o en_fs.o en_ethtool.o en_tx.o \
en_rx.o en_rx_am.o en_txrx.o en_clock.o vxlan.o \
- en_tc.o en_arfs.o en_fs_ethtool.o en_selftest.o
+ en_arfs.o en_fs_ethtool.o en_selftest.o
mlx5_core-$(CONFIG_MLX5_CORE_EN_DCB) += en_dcbnl.o
mlx5_core-$(CONFIG_MLX5_CORE_EN_ESWITCH) += eswitch.o eswitch_offloads.o en_rep.o
mlx5_core-$(CONFIG_MLX5_CORE_EN_SRIOV) += sriov.o
+
+mlx5_core-$(CONFIG_MLX5_CORE_EN_TC) += en_tc.o
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 1db4d98..2d2c982 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -2690,6 +2690,7 @@ int mlx5e_modify_rqs_vsd(struct mlx5e_priv *priv, bool vsd)
return 0;
}
+#ifdef CONFIG_MLX5_CORE_EN_TC
static int mlx5e_setup_tc(struct net_device *netdev, u8 tc)
{
struct mlx5e_priv *priv = netdev_priv(netdev);
@@ -2743,6 +2744,7 @@ static int mlx5e_ndo_setup_tc(struct net_device *dev, u32 handle,
return mlx5e_setup_tc(dev, tc->tc);
}
+#endif
static void
mlx5e_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats)
@@ -3323,7 +3325,9 @@ static const struct net_device_ops mlx5e_netdev_ops_basic = {
.ndo_open = mlx5e_open,
.ndo_stop = mlx5e_close,
.ndo_start_xmit = mlx5e_xmit,
+#ifdef CONFIG_MLX5_CORE_EN_TC
.ndo_setup_tc = mlx5e_ndo_setup_tc,
+#endif
.ndo_select_queue = mlx5e_select_queue,
.ndo_get_stats64 = mlx5e_get_stats,
.ndo_set_rx_mode = mlx5e_set_rx_mode,
@@ -3349,7 +3353,9 @@ static const struct net_device_ops mlx5e_netdev_ops_sriov = {
.ndo_open = mlx5e_open,
.ndo_stop = mlx5e_close,
.ndo_start_xmit = mlx5e_xmit,
+#ifdef CONFIG_MLX5_CORE_EN_TC
.ndo_setup_tc = mlx5e_ndo_setup_tc,
+#endif
.ndo_select_queue = mlx5e_select_queue,
.ndo_get_stats64 = mlx5e_get_stats,
.ndo_set_rx_mode = mlx5e_set_rx_mode,
@@ -3762,9 +3768,11 @@ static int mlx5e_init_nic_rx(struct mlx5e_priv *priv)
goto err_destroy_direct_tirs;
}
+#ifdef CONFIG_MLX5_CORE_EN_TC
err = mlx5e_tc_init(priv);
if (err)
goto err_destroy_flow_steering;
+#endif
return 0;
@@ -3786,7 +3794,9 @@ static void mlx5e_cleanup_nic_rx(struct mlx5e_priv *priv)
{
int i;
+#ifdef CONFIG_MLX5_CORE_EN_TC
mlx5e_tc_cleanup(priv);
+#endif
mlx5e_destroy_flow_steering(priv);
mlx5e_destroy_direct_tirs(priv);
mlx5e_destroy_indirect_tirs(priv);
--
2.9.3
next prev parent reply other threads:[~2017-01-26 23:51 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-26 23:32 [PATCH net-next 0/4] mlx5: Create build configuration options Tom Herbert
2017-01-26 23:32 ` [PATCH net-next 1/4] mlx5: Make building eswitch configurable Tom Herbert
2017-01-27 5:34 ` Or Gerlitz
2017-01-27 17:38 ` Saeed Mahameed
2017-01-27 17:50 ` Tom Herbert
2017-01-27 18:05 ` Saeed Mahameed
2017-01-27 18:16 ` Tom Herbert
2017-01-27 18:28 ` Saeed Mahameed
2017-01-27 18:42 ` Tom Herbert
2017-01-27 21:15 ` Saeed Mahameed
2017-01-27 23:23 ` Alexei Starovoitov
2017-01-28 11:20 ` Saeed Mahameed
2017-01-28 17:52 ` Alexei Starovoitov
2017-01-29 9:11 ` Saeed Mahameed
2017-01-30 16:45 ` Alexei Starovoitov
2017-01-30 21:18 ` Saeed Mahameed
2017-01-31 3:32 ` Alexei Starovoitov
2017-01-31 14:44 ` Mohamad Haj Yahia
2017-01-27 18:19 ` Saeed Mahameed
2017-01-27 18:33 ` Tom Herbert
2017-01-27 20:59 ` Saeed Mahameed
2017-01-26 23:32 ` [PATCH net-next 2/4] mlx5: Make building SR-IOV configurable Tom Herbert
2017-01-26 23:32 ` Tom Herbert [this message]
2017-01-27 6:29 ` [PATCH net-next 3/4] mlx5: Make building tc hardware offload configurable kbuild test robot
2017-01-27 13:43 ` kbuild test robot
2017-01-26 23:32 ` [PATCH net-next 4/4] mlx5: Make building vxlan " Tom Herbert
2017-01-27 17:58 ` [PATCH net-next 0/4] mlx5: Create build configuration options Saeed Mahameed
2017-01-27 18:13 ` Tom Herbert
2017-01-28 11:38 ` Saeed Mahameed
2017-01-28 17:19 ` Tom Herbert
2017-01-29 8:07 ` Saeed Mahameed
2017-01-30 20:00 ` Tom Herbert
2017-01-30 21:26 ` Saeed Mahameed
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=20170126233241.2268449-4-tom@herbertland.com \
--to=tom@herbertland.com \
--cc=davem@davemloft.net \
--cc=kernel-team@fb.com \
--cc=netdev@vger.kernel.org \
--cc=saeedm@mellanox.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).