public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@netronome•com>
To: John Fastabend <john.fastabend@gmail•com>
Cc: netdev@vger•kernel.org
Subject: Re: [PATCH/RFC rocker-net-next 6/6] net: flow: Limit checking of ndo_flow_{set,del}_flows
Date: Tue, 6 Jan 2015 10:07:24 +0900	[thread overview]
Message-ID: <20150106010722.GC14077@vergenet.net> (raw)
In-Reply-To: <54AACA92.5030800@gmail.com>

On Mon, Jan 05, 2015 at 09:32:02AM -0800, John Fastabend wrote:
> On 01/04/2015 10:50 PM, Simon Horman wrote:
> >Only check for availability of ndo_flow_{set,del}_flows when
> >they are to be be used.
> >
> 
> I went ahead and merged this but, I'm not sure does it make
> sense to allow a user to add a flow that can't be deleted? Or
> delete a flow that wasn't ever added? I guess if the driver has
> a reason to do this it doesn't hurt to allow it and I think the
> code looks neater this way.
> 
> Also thanks for the other fixes I pulled the other 5 in as well
> I'll re-submit the series after running some basic tests.

I don't have any strong opinions on this but it
sounds like policy that doesn't belong in flow_table.c.

> >Signed-off-by: Simon Horman <simon.horman@netronome•com>
> >---
> >  net/core/flow_table.c | 15 +++++++++++++--
> >  1 file changed, 13 insertions(+), 2 deletions(-)
> >
> >diff --git a/net/core/flow_table.c b/net/core/flow_table.c
> >index bfc984f..6d620d4 100644
> >--- a/net/core/flow_table.c
> >+++ b/net/core/flow_table.c
> >@@ -1206,9 +1206,20 @@ static int net_flow_table_cmd_flows(struct sk_buff *recv_skb,
> >  	if (!dev)
> >  		return -EINVAL;
> >
> >-	if (!dev->netdev_ops->ndo_flow_set_flows ||
> >-	    !dev->netdev_ops->ndo_flow_del_flows)
> >+	switch (cmd) {
> >+	case NET_FLOW_TABLE_CMD_SET_FLOWS:
> >+		if (!dev->netdev_ops->ndo_flow_set_flows)
> >+			goto out;
> >+		break;
> >+
> >+	case NET_FLOW_TABLE_CMD_DEL_FLOWS:
> >+		if (!dev->netdev_ops->ndo_flow_del_flows)
> >+			goto out;
> >+		break;
> >+
> >+	default:
> >  		goto out;
> >+	}
> >
> >  	if (!info->attrs[NET_FLOW_IDENTIFIER_TYPE] ||
> >  	    !info->attrs[NET_FLOW_IDENTIFIER] ||
> >
> 
> 
> -- 
> John Fastabend         Intel Corporation

      reply	other threads:[~2015-01-06  1:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-05  6:50 [PATCH/RFC rocker-net-next 0/6] net: flow: Minor fixes and cleanups Simon Horman
2015-01-05  6:50 ` [PATCH/RFC rocker-net-next 1/6] net: flow: Cancel innermost nested attribute first Simon Horman
2015-01-05 21:17   ` David Miller
2015-01-05 22:01     ` Thomas Graf
2015-01-05 22:10       ` David Miller
2015-01-06  1:03     ` Simon Horman
2015-01-05  6:50 ` [PATCH/RFC rocker-net-next 2/6] net: flow: Handle error when putting a field while putting a flow Simon Horman
2015-01-05 17:28   ` John Fastabend
2015-01-06  1:04     ` Simon Horman
2015-01-05  6:50 ` [PATCH/RFC rocker-net-next 3/6] net: flow: Remove unnecessary zero-header check when " Simon Horman
2015-01-05  6:50 ` [PATCH/RFC rocker-net-next 4/6] net: flow: free action args Simon Horman
2015-01-05  6:50 ` [PATCH/RFC rocker-net-next 5/6] net: flow: Return more fine-grained error when handing flows commands Simon Horman
2015-01-05  6:50 ` [PATCH/RFC rocker-net-next 6/6] net: flow: Limit checking of ndo_flow_{set,del}_flows Simon Horman
2015-01-05 17:32   ` John Fastabend
2015-01-06  1:07     ` Simon Horman [this message]

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=20150106010722.GC14077@vergenet.net \
    --to=simon.horman@netronome$(echo .)com \
    --cc=john.fastabend@gmail$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /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