All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Saeed Mahameed <saeedm@mellanox.com>
Cc: "antoine.tenart@bootlin.com" <antoine.tenart@bootlin.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"gregory.clement@bootlin.com" <gregory.clement@bootlin.com>,
	"linux@armlinux.org.uk" <linux@armlinux.org.uk>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"nadavh@marvell.com" <nadavh@marvell.com>,
	"thomas.petazzoni@bootlin.com" <thomas.petazzoni@bootlin.com>,
	"miquel.raynal@bootlin.com" <miquel.raynal@bootlin.com>,
	"stefanc@marvell.com" <stefanc@marvell.com>,
	"mw@semihalf.com" <mw@semihalf.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH net-next v2] net: mvpp2: cls: Add Classification offload support
Date: Wed, 24 Apr 2019 09:01:23 +0200	[thread overview]
Message-ID: <20190424090123.5089586c@bootlin.com> (raw)
In-Reply-To: <d62a09aa9194784f93d8ca1df6b4607529008a5f.camel@mellanox.com>

Hello Saeed,

Thanks for the review,

>> When inserting a rule in a given flow, the location given is relative
>> to
>> the flow :
>> 
>> ethtool -N eth0 flow-type udp4 dst-port 1234 action 2 loc 0
>> 
>> ethtool -N eth0 flow-type tcp4 dst-port 1234 action 3 loc 0
>> 
>> However when removing a rule, the global location is to be used. This
>> location can be retrieved by using ethtool -n <interface>.
>>   
>
>I am not sure what you mean by "the location given is relative to the
>flow", it seems like the rule will end up in a different location than
>the user intended, but looking at ethtool documentation it clearly says
>that the location the user provides is an absolute rule id/location,
>which will be used to delete this rule.
>
>from "man ethtool":
>loc N:
>Specify the location/ID to insert the rule. This will overwrite any
>rule present in that location and will not go through any of the rule
>ordering process.
>
>delete N
>Deletes the RX classification rule with the given ID.

I was unsure about this, so I'm glad you commented. One thing
that made me think what I did could be okay is that the documentation
for ETHTOOL_SRXCLSRLINS in ethtool.h says :

"For %ETHTOOL_SRXCLSRLINS, @fs specifies the rule to add or update.
 @fs.@location either specifies the location to use or is a special
 location value with %RX_CLS_LOC_SPECIAL flag set.  On return,
 @fs.@location is the actual rule location."

I interpreted the "On return [...]" part as if we could rewrite the
location if needed when inserting a rule (although it seems ethtool
doesn't do anything with this return value)

The point for doing so is that we have a clear separation in our
classification tables between different traffic classes, so we have a
range of entries for tcp4, one for udp4, one for tcp6, etc.

Having a "global" location numbering scheme would, I think, also be
confusing, since it would make the user use loc 0->7 for tcp4, loc
8->15 for udp4 and so on.

Maybe in this case I should stick with insertions thay rely on
RX_CLS_LOC_SPECIAL (such as "first", "last", "any") and have a scheme
where priorisation is based strictly on the rule insertion order ?

>So the above example should result in one flow rule in your hardware.
>but according the code below the calculated index in
>mvpp2_ethtool_cls_rule_ins might end up different than the requested
>location, which will confuse the user.

I'm also working on writing a proper documentation for this driver,
including the behaviour of the classifier implementation, hopefully
this would help.

Thanks again for the review,

Maxime

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Saeed Mahameed <saeedm@mellanox.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
	"miquel.raynal@bootlin.com" <miquel.raynal@bootlin.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux@armlinux.org.uk" <linux@armlinux.org.uk>,
	"thomas.petazzoni@bootlin.com" <thomas.petazzoni@bootlin.com>,
	"mw@semihalf.com" <mw@semihalf.com>,
	"gregory.clement@bootlin.com" <gregory.clement@bootlin.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"stefanc@marvell.com" <stefanc@marvell.com>,
	"nadavh@marvell.com" <nadavh@marvell.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"antoine.tenart@bootlin.com" <antoine.tenart@bootlin.com>
Subject: Re: [PATCH net-next v2] net: mvpp2: cls: Add Classification offload support
Date: Wed, 24 Apr 2019 09:01:23 +0200	[thread overview]
Message-ID: <20190424090123.5089586c@bootlin.com> (raw)
In-Reply-To: <d62a09aa9194784f93d8ca1df6b4607529008a5f.camel@mellanox.com>

Hello Saeed,

Thanks for the review,

>> When inserting a rule in a given flow, the location given is relative
>> to
>> the flow :
>> 
>> ethtool -N eth0 flow-type udp4 dst-port 1234 action 2 loc 0
>> 
>> ethtool -N eth0 flow-type tcp4 dst-port 1234 action 3 loc 0
>> 
>> However when removing a rule, the global location is to be used. This
>> location can be retrieved by using ethtool -n <interface>.
>>   
>
>I am not sure what you mean by "the location given is relative to the
>flow", it seems like the rule will end up in a different location than
>the user intended, but looking at ethtool documentation it clearly says
>that the location the user provides is an absolute rule id/location,
>which will be used to delete this rule.
>
>from "man ethtool":
>loc N:
>Specify the location/ID to insert the rule. This will overwrite any
>rule present in that location and will not go through any of the rule
>ordering process.
>
>delete N
>Deletes the RX classification rule with the given ID.

I was unsure about this, so I'm glad you commented. One thing
that made me think what I did could be okay is that the documentation
for ETHTOOL_SRXCLSRLINS in ethtool.h says :

"For %ETHTOOL_SRXCLSRLINS, @fs specifies the rule to add or update.
 @fs.@location either specifies the location to use or is a special
 location value with %RX_CLS_LOC_SPECIAL flag set.  On return,
 @fs.@location is the actual rule location."

I interpreted the "On return [...]" part as if we could rewrite the
location if needed when inserting a rule (although it seems ethtool
doesn't do anything with this return value)

The point for doing so is that we have a clear separation in our
classification tables between different traffic classes, so we have a
range of entries for tcp4, one for udp4, one for tcp6, etc.

Having a "global" location numbering scheme would, I think, also be
confusing, since it would make the user use loc 0->7 for tcp4, loc
8->15 for udp4 and so on.

Maybe in this case I should stick with insertions thay rely on
RX_CLS_LOC_SPECIAL (such as "first", "last", "any") and have a scheme
where priorisation is based strictly on the rule insertion order ?

>So the above example should result in one flow rule in your hardware.
>but according the code below the calculated index in
>mvpp2_ethtool_cls_rule_ins might end up different than the requested
>location, which will confuse the user.

I'm also working on writing a proper documentation for this driver,
including the behaviour of the classifier implementation, hopefully
this would help.

Thanks again for the review,

Maxime

  reply	other threads:[~2019-04-24  7:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-23  7:50 [PATCH net-next v2] net: mvpp2: cls: Add Classification offload support Maxime Chevallier
2019-04-23  7:50 ` Maxime Chevallier
2019-04-23 17:58 ` Saeed Mahameed
2019-04-23 17:58   ` Saeed Mahameed
2019-04-24  7:01   ` Maxime Chevallier [this message]
2019-04-24  7:01     ` Maxime Chevallier
2019-04-24 18:05     ` Saeed Mahameed
2019-04-24 18:05       ` Saeed Mahameed
2019-04-25  7:12       ` Maxime Chevallier
2019-04-25  7:12         ` Maxime Chevallier

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=20190424090123.5089586c@bootlin.com \
    --to=maxime.chevallier@bootlin.com \
    --cc=antoine.tenart@bootlin.com \
    --cc=davem@davemloft.net \
    --cc=gregory.clement@bootlin.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=miquel.raynal@bootlin.com \
    --cc=mw@semihalf.com \
    --cc=nadavh@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@mellanox.com \
    --cc=stefanc@marvell.com \
    --cc=thomas.petazzoni@bootlin.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.