All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>, netdev@vger.kernel.org
Cc: Paul Blakey <paulb@mellanox.com>, Saeed Mahameed <saeedm@mellanox.com>
Subject: [net-next 12/14] net/mlx5: E-Switch, Enable setting goto slow path chain action
Date: Wed, 17 Oct 2018 17:08:57 -0700	[thread overview]
Message-ID: <20181018000859.16212-13-saeedm@mellanox.com> (raw)
In-Reply-To: <20181018000859.16212-1-saeedm@mellanox.com>

From: Paul Blakey <paulb@mellanox.com>

A pre-step for the tc offloads code to use this when a neigh is
not available for encap rules.

Signed-off-by: Paul Blakey <paulb@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.h          | 2 ++
 drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
index 54215f4312fa..aaafc9f17115 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
@@ -60,6 +60,7 @@
 	MLX5_CAP_ESW_FLOWTABLE(dev, fdb_multi_path_to_table)
 
 #define FDB_MAX_CHAIN 3
+#define FDB_SLOW_PATH_CHAIN (FDB_MAX_CHAIN + 1)
 #define FDB_MAX_PRIO 16
 
 struct vport_ingress {
@@ -356,6 +357,7 @@ static inline int  mlx5_eswitch_enable_sriov(struct mlx5_eswitch *esw, int nvfs,
 static inline void mlx5_eswitch_disable_sriov(struct mlx5_eswitch *esw) {}
 
 #define FDB_MAX_CHAIN 1
+#define FDB_SLOW_PATH_CHAIN (FDB_MAX_CHAIN + 1)
 #define FDB_MAX_PRIO 1
 
 #endif /* CONFIG_MLX5_ESWITCH */
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index 289f1992f624..42a130455ef8 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -671,6 +671,9 @@ esw_get_prio_table(struct mlx5_eswitch *esw, u32 chain, u16 prio, int level)
 	int table_prio, l = 0;
 	u32 flags = 0;
 
+	if (chain == FDB_SLOW_PATH_CHAIN)
+		return esw->fdb_table.offloads.slow_fdb;
+
 	mutex_lock(&esw->fdb_table.offloads.fdb_prio_lock);
 
 	fdb = fdb_prio_table(esw, chain, prio, level).fdb;
@@ -730,6 +733,9 @@ esw_put_prio_table(struct mlx5_eswitch *esw, u32 chain, u16 prio, int level)
 {
 	int l;
 
+	if (chain == FDB_SLOW_PATH_CHAIN)
+		return;
+
 	mutex_lock(&esw->fdb_table.offloads.fdb_prio_lock);
 
 	for (l = level; l >= 0; l--) {
-- 
2.17.2

  parent reply	other threads:[~2018-10-18  8:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-18  0:08 [pull request][net-next 00/14] Mellanox, mlx5 updates Saeed Mahameed
2018-10-18  0:08 ` [net-next 01/14] net/mlx5: E-Switch, Get counters for offloaded flows from callers Saeed Mahameed
2018-10-18  0:08 ` [net-next 02/14] net/mlx5: Use flow counter IDs and not the wrapping cache object Saeed Mahameed
2018-10-18  0:08 ` [net-next 03/14] net/mlx5e: Change return type of tc add flow functions Saeed Mahameed
2018-10-18  0:08 ` [net-next 04/14] net/mlx5e: Split TC add rule path for nic vs e-switch Saeed Mahameed
2018-10-18  0:08 ` [net-next 05/14] net/mlx5: Add cap bits for multi fdb encap Saeed Mahameed
2018-10-18  0:08 ` [net-next 06/14] net/mlx5: Split FDB fast path prio to multiple namespaces Saeed Mahameed
2018-10-18  0:08 ` [net-next 07/14] net/mlx5: E-Switch, Have explicit API to delete fwd rules Saeed Mahameed
2018-10-18  0:08 ` [net-next 08/14] net/mlx5: E-Switch, Add chains and priorities Saeed Mahameed
2018-10-18  0:08 ` [net-next 09/14] net/mlx5: Add a no-append flow insertion mode Saeed Mahameed
2018-10-18  0:08 ` [net-next 10/14] net/mlx5e: For TC offloads, always add new flow instead of appending the actions Saeed Mahameed
2018-10-18  0:08 ` [net-next 11/14] net/mlx5e: Avoid duplicated code for tc offloads add/del fdb rule Saeed Mahameed
2018-10-18  0:08 ` Saeed Mahameed [this message]
2018-10-18  0:08 ` [net-next 13/14] net/mlx5e: Use a slow path rule instead if vxlan neighbour isn't available Saeed Mahameed
2018-10-18  0:08 ` [net-next 14/14] net/mlx5e: Support offloading tc priorities and chains for eswitch flows Saeed Mahameed
2018-10-18 17:26 ` [pull request][net-next 00/14] Mellanox, mlx5 updates David Miller

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=20181018000859.16212-13-saeedm@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=paulb@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 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.