netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: "Volodymyr Mytnyk [C]" <vmytnyk@marvell.com>
Cc: Vadym Kochan <vadym.kochan@plvision.eu>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Cong Wang <xiyou.wangcong@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>, Vladimir Oltean <olteanv@gmail.com>,
	Serhiy Boiko <serhiy.boiko@plvision.eu>,
	Volodymyr Mytnyk <volodymyr.mytnyk@plvision.eu>,
	Taras Chornyi <taras.chornyi@plvision.eu>,
	"Taras Chornyi [C]" <tchornyi@marvell.com>,
	Mickey Rachamim <mickeyr@marvell.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Vadym Kochan [C]" <vkochan@marvell.com>
Subject: Re: [PATCH net-next v2 4/4] net: marvell: prestera: Offload FLOW_ACTION_POLICE
Date: Tue, 3 Aug 2021 19:46:44 +0300	[thread overview]
Message-ID: <YQly9LnGStm2Ju0H@shredder> (raw)
In-Reply-To: <SJ0PR18MB4009243B42CB9A03C2C35647B2F09@SJ0PR18MB4009.namprd18.prod.outlook.com>

On Tue, Aug 03, 2021 at 04:19:03PM +0000, Volodymyr Mytnyk [C] wrote:
> > On Mon, Aug 02, 2021 at 05:08:49PM +0300, Vadym Kochan wrote:
> > It seems the implementation assumes that each rule has a different
> > policer, so an error should be returned in case the same policer is
> > shared between different rules.
> 
> Each rule has a different policer assigned by HW. Do you mean the police.index should be checked here ?

Yes. Checked to make sure each rule uses a different policer.

> 
> >
> > > +                     break;
> > >                default:
> > >                        NL_SET_ERR_MSG_MOD(extack, "Unsupported action");
> > >                        pr_err("Unsupported action\n");
> > > @@ -110,6 +117,17 @@ static int prestera_flower_parse(struct prestera_flow_block *block,
> > >                return -EOPNOTSUPP;
> > >        }
> > >
> > > +     if (f->classid) {
> > > +             int hw_tc = __tc_classid_to_hwtc(PRESTERA_HW_TC_NUM, f->classid);
> > > +
> > > +             if (hw_tc < 0) {
> > > +                     NL_SET_ERR_MSG_MOD(f->common.extack, "Unsupported HW TC");
> > > +                     return hw_tc;
> > > +             }
> > > +
> > > +             prestera_acl_rule_hw_tc_set(rule, hw_tc);
> > > +     }
> >
> > Not sure what this is. Can you show a command line example of how this
> > is used?
> 
> This is HW traffic class used for packets that are trapped to CPU port. The usage is as the following:
> 
> tc qdisc add dev DEV clsact
> tc filter add dev DEV ingress flower skip_sw dst_mac 00:AA:AA:AA:AA:00 hw_tc 1 action trap

You are not using any police action in this example and the changelogs
do not say anything about trap / CPU port so I fail to understand how
this hunk is related to the submission.

> 
> >
> > What about visibility regarding number of packets that were dropped by
> > the policer?
> 
> This is not support at this moment by the driver, so it is always zero now.

You plan to support it? I imagine the hardware policer is able to report
the number of packets it dropped.

      reply	other threads:[~2021-08-03 16:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-02 14:08 [PATCH net-next v2 0/4] Marvell Prestera add policer support Vadym Kochan
2021-08-02 14:08 ` [PATCH net-next v2 1/4] net: marvell: prestera: do not fail if FW reply is bigger Vadym Kochan
2021-08-02 14:08 ` [PATCH net-next v2 2/4] net: marvell: prestera: turn FW supported versions into an array Vadym Kochan
2021-08-02 14:08 ` [PATCH net-next v2 3/4] net: sched: introduce __tc_classid_to_hwtc() helper Vadym Kochan
2021-08-02 14:08 ` [PATCH net-next v2 4/4] net: marvell: prestera: Offload FLOW_ACTION_POLICE Vadym Kochan
2021-08-02 15:23   ` Ido Schimmel
2021-08-03 16:19     ` Volodymyr Mytnyk [C]
2021-08-03 16:46       ` Ido Schimmel [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=YQly9LnGStm2Ju0H@shredder \
    --to=idosch@idosch.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=jhs@mojatatu.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mickeyr@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=serhiy.boiko@plvision.eu \
    --cc=taras.chornyi@plvision.eu \
    --cc=tchornyi@marvell.com \
    --cc=vadym.kochan@plvision.eu \
    --cc=vkochan@marvell.com \
    --cc=vmytnyk@marvell.com \
    --cc=volodymyr.mytnyk@plvision.eu \
    --cc=xiyou.wangcong@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).