All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amir Vadai <amir@vadai.me>
To: "David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org,
	John Fastabend <john.r.fastabend@intel.com>
Cc: Or Gerlitz <ogerlitz@mellanox.com>,
	Hadar Har-Zion <hadarh@mellanox.com>,
	Jiri Pirko <jiri@mellanox.com>,
	Jamal Hadi Salim <jhs@mojatatu.com>, Amir Vadai <amir@vadai.me>
Subject: [RFC net-next 7/9] net/mlx5_core: Go to next flow table support
Date: Mon,  1 Feb 2016 08:34:43 +0000	[thread overview]
Message-ID: <1454315685-32202-8-git-send-email-amir@vadai.me> (raw)
In-Reply-To: <1454315685-32202-1-git-send-email-amir@vadai.me>

When destination is NULL, continue processing packet in the following
table.
Will be used by the offloads table, to process the traffic before any
other table (without it knowing who is the next table)

Signed-off-by: Amir Vadai <amir@vadai.me>
---
 drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
index 6f68dba..fb3717a 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
@@ -993,9 +993,27 @@ mlx5_add_flow_rule(struct mlx5_flow_table *ft,
 		   u32 flow_tag,
 		   struct mlx5_flow_destination *dest)
 {
+	struct mlx5_flow_destination *my_dest = NULL;
 	struct mlx5_flow_group *g;
 	struct mlx5_flow_rule *rule;
 
+	if (!dest) {
+		struct mlx5_flow_table *next_ft;
+		struct fs_prio *prio;
+
+		fs_get_obj(prio, ft->node.parent);
+		next_ft = find_next_chained_ft(prio);
+		if (!next_ft) {
+			pr_warn("There is no next flow table\n");
+			return ERR_PTR(-EINVAL);
+		}
+		my_dest = kzalloc(sizeof(*my_dest), GFP_KERNEL);
+		if (!my_dest)
+			return ERR_PTR(-ENOMEM);
+		my_dest->type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE;
+		my_dest->ft = next_ft;
+		dest = my_dest;
+	}
 	nested_lock_ref_node(&ft->node, FS_MUTEX_GRANDPARENT);
 	fs_for_each_fg(g, ft)
 		if (compare_match_criteria(g->mask.match_criteria_enable,
@@ -1012,6 +1030,7 @@ mlx5_add_flow_rule(struct mlx5_flow_table *ft,
 				   match_value, action, flow_tag, dest);
 unlock:
 	unlock_ref_node(&ft->node);
+	kfree(my_dest);
 	return rule;
 }
 EXPORT_SYMBOL(mlx5_add_flow_rule);
-- 
2.7.0

  parent reply	other threads:[~2016-02-01  8:37 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-01  8:34 [RFC net-next 0/9] TC filter HW offloads Amir Vadai
2016-02-01  8:34 ` [RFC net-next 1/9] net/flow_dissector: Make dissector_uses_key() and skb_flow_dissector_target() public Amir Vadai
2016-02-01  8:34 ` [RFC net-next 2/9] net/switchdev: Introduce hardware offload support Amir Vadai
2016-02-01  9:06   ` Jiri Pirko
2016-02-01  9:11     ` amirva
2016-02-01  9:26   ` John Fastabend
2016-02-01  8:34 ` [RFC net-next 3/9] net/act: Offload support by tc actions Amir Vadai
2016-02-01  8:34 ` [RFC net-next 4/9] net/act_skbedit: Introduce hardware offload support Amir Vadai
2016-02-01  8:34 ` [RFC net-next 5/9] net/act_gact: Introduce hardware offload support for drop Amir Vadai
2016-02-01  8:34 ` [RFC net-next 6/9] net/cls_flower: Introduce hardware offloading Amir Vadai
2016-02-01  9:31   ` John Fastabend
2016-02-01  9:47     ` John Fastabend
2016-02-01 10:43     ` Amir Vadai
2016-02-01 21:25       ` John Fastabend
2016-02-01  8:34 ` Amir Vadai [this message]
2016-02-01  8:34 ` [RFC net-next 8/9] net/mlx5e: Introduce MLX5_FLOW_NAMESPACE_OFFLOADS Amir Vadai
2016-02-01  8:34 ` [RFC net-next 9/9] net/mlx5e: Flow steering support through switchdev Amir Vadai
2016-02-01 18:52   ` Saeed Mahameed
2016-02-01 21:45     ` Or Gerlitz
2016-02-01  9:21 ` [RFC net-next 0/9] TC filter HW offloads John Fastabend
2016-02-01 14:37   ` Amir Vadai
2016-02-01 19:59     ` Tom Herbert
2016-02-01 20:14     ` John Fastabend

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=1454315685-32202-8-git-send-email-amir@vadai.me \
    --to=amir@vadai.me \
    --cc=davem@davemloft.net \
    --cc=hadarh@mellanox.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@mellanox.com \
    --cc=john.r.fastabend@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@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.