public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Amir Vadai <amir@vadai•me>
To: Jiri Pirko <jiri@resnulli•us>
Cc: "David S. Miller" <davem@davemloft•net>,
	netdev@vger•kernel.org, Or Gerlitz <ogerlitz@mellanox•com>,
	John Fastabend <john.r.fastabend@intel•com>,
	Saeed Mahameed <saeedm@mellanox•com>,
	Hadar Har-Zion <hadarh@mellanox•com>,
	Jiri Pirko <jiri@mellanox•com>
Subject: Re: [PATCH net-next 7/8] net/mlx5e: Support offload cls_flower with drop action
Date: Tue, 1 Mar 2016 18:50:57 +0200	[thread overview]
Message-ID: <56d5c778.06b01c0a.3dc1a.0045@mx.google.com> (raw)
In-Reply-To: <20160301145548.GD2098@nanopsycho.orion>

On Tue, Mar 01, 2016 at 03:55:48PM +0100, Jiri Pirko wrote:
> Tue, Mar 01, 2016 at 03:24:49PM CET, amir@vadai•me wrote:
> >Parse tc_cls_flower_offload into device specific commands and program
> >the hardware to classify and act accordingly.
> >
> >For example, to drop ICMP (ip_proto 1) packets from specific smac, dmac,
> >src_ip, src_ip, arriving to interface ens9:
> >
> > # tc qdisc add dev ens9 ingress
> >
> > # tc filter add dev ens9 protocol ip parent ffff: \
> >     flower ip_proto 1 \
> >     dst_mac 7c:fe:90:69:81:62 src_mac 7c:fe:90:69:81:56 \
> >     dst_ip 11.11.11.11 src_ip 11.11.11.12 indev ens9 \
> >     action drop
> >
> >Signed-off-by: Amir Vadai <amir@vadai•me>
> >Signed-off-by: Or Gerlitz <ogerlitz@mellanox•com>
> >---
> > drivers/net/ethernet/mellanox/mlx5/core/en_main.c |   9 +
> > drivers/net/ethernet/mellanox/mlx5/core/en_tc.c   | 287 ++++++++++++++++++++++
> > drivers/net/ethernet/mellanox/mlx5/core/en_tc.h   |   5 +
> > 3 files changed, 301 insertions(+)
> >
> >diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> >index cb02b4c..1d1da94 100644
> >--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> >+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> >@@ -1889,6 +1889,15 @@ static int mlx5e_ndo_setup_tc(struct net_device *dev, u32 handle,
> > 		goto mqprio;
> > 
> > 	switch (tc->type) {
> >+	case TC_SETUP_CLSFLOWER:
> >+		switch (tc->cls_flower->command) {
> >+		case TC_CLSFLOWER_REPLACE:
> >+			return mlx5e_configure_flower(priv, proto, tc->cls_flower);
> >+		case TC_CLSFLOWER_DESTROY:
> >+			return mlx5e_delete_flower(priv, tc->cls_flower);
> >+		default:
> >+			return -EINVAL;
> 
> No need to default case here is you change "command" to enum as I
> suggested it the reply to patch 1.
ack

  reply	other threads:[~2016-03-01 16:46 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-01 14:24 [PATCH net-next 0/8] cls_flower hardware offload support Amir Vadai
2016-03-01 14:24 ` [PATCH net-next 1/8] net/flower: Introduce " Amir Vadai
2016-03-01 14:47   ` Jiri Pirko
2016-03-01 16:49     ` Amir Vadai
2016-03-01 17:01       ` Jiri Pirko
2016-03-02 11:14         ` Or Gerlitz
2016-03-02 13:22           ` Jiri Pirko
2016-03-02 16:22             ` John Fastabend
2016-03-02 16:30               ` Jiri Pirko
2016-03-01 14:53   ` Jiri Pirko
2016-03-01 16:50     ` Amir Vadai
2016-03-01 14:24 ` [PATCH net-next 2/8] net/flow_dissector: Make dissector_uses_key() and skb_flow_dissector_target() public Amir Vadai
2016-03-01 14:24 ` [PATCH net-next 3/8] net/act_skbedit: Utility functions for mark action Amir Vadai
2016-03-01 14:24 ` [PATCH net-next 4/8] net/mlx5_core: Set flow steering dest only for forward rules Amir Vadai
2016-03-01 14:24 ` [PATCH net-next 5/8] net/mlx5e: Add a new priority for kernel flow tables Amir Vadai
2016-03-01 14:24 ` [PATCH net-next 6/8] net/mlx5e: Introduce tc offload support Amir Vadai
2016-03-01 14:52   ` Jiri Pirko
2016-03-01 17:00     ` Amir Vadai
2016-03-01 17:13       ` John Fastabend
2016-03-02 15:53         ` Amir Vadai
2016-03-02 15:58           ` Jiri Pirko
2016-03-01 15:59   ` Saeed Mahameed
2016-03-01 17:07     ` Amir Vadai
2016-03-01 14:24 ` [PATCH net-next 7/8] net/mlx5e: Support offload cls_flower with drop action Amir Vadai
2016-03-01 14:55   ` Jiri Pirko
2016-03-01 16:50     ` Amir Vadai [this message]
2016-03-01 15:03   ` Jiri Pirko
2016-03-01 14:24 ` [PATCH net-next 8/8] net/mlx5e: Support offload cls_flower with sskbedit mark action Amir Vadai
2016-03-01 14:58   ` Jiri Pirko
2016-03-01 16:53     ` Amir Vadai
2016-03-01 17:18 ` [PATCH net-next 0/8] cls_flower hardware offload support 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=56d5c778.06b01c0a.3dc1a.0045@mx.google.com \
    --to=amir@vadai$(echo .)me \
    --cc=davem@davemloft$(echo .)net \
    --cc=hadarh@mellanox$(echo .)com \
    --cc=jiri@mellanox$(echo .)com \
    --cc=jiri@resnulli$(echo .)us \
    --cc=john.r.fastabend@intel$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=ogerlitz@mellanox$(echo .)com \
    --cc=saeedm@mellanox$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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