netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rostislav Lisovy <lisovy@gmail.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev@vger.kernel.org, linux-can@vger.kernel.org,
	lartc@vger.kernel.org, pisa@cmp.felk.cvut.cz,
	sojkam1@fel.cvut.cz
Subject: Re: [PATCH 2/2] net/sched: CAN Filter/Classifier
Date: Thu, 07 Jun 2012 11:53:26 +0200	[thread overview]
Message-ID: <1339062806.4816.3.camel@lolumad> (raw)
In-Reply-To: <1338883798.2760.2043.camel@edumazet-glaptop>

On Tue, 2012-06-05 at 10:09 +0200, Eric Dumazet wrote: 
> On Mon, 2012-06-04 at 18:09 +0200, Rostislav Lisovy wrote:
> > This classifier classifies CAN frames (AF_CAN) according to their
> > identifiers. This functionality can not be easily achieved with
> > existing classifiers, such as u32. This classifier can be used
> > with any available qdisc and it is able to classify both SFF
> > or EFF frames.
> > 
> > The filtering rules for EFF frames are stored in an array, which
> > is traversed during classification. A bitmap is used to store SFF
> > rules -- one bit for each ID.
> > 
> > More info about the project:
> > http://rtime.felk.cvut.cz/can/socketcan-qdisc-final.pdf
> > 
> > Signed-off-by: Rostislav Lisovy <lisovy@gmail.com>
> > ---
> >  net/sched/Kconfig   |   10 +
> >  net/sched/Makefile  |    1 +
> >  net/sched/cls_can.c |  572 +++++++++++++++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 583 insertions(+)
> >  create mode 100644 net/sched/cls_can.c
> 
> It seems a huge amount of code, and before reviewing it I would like to
> ask :
> 
> 1) Did you try to extend cls_flow somehow ?
I did not. If I understand it right, cls_flow is intended to be mainly
used with SFQ qdisc (which tries to ensure fairness among different
flows).
My intention was to make a simple and deterministic filter (which may be
used with any available qdisc).

However, after thoroughly going through cls_flow I realized that
implementing an ematch function (to be used with cls_basic or others)
will preserve the functionality and save some code at the same time.
Therefore I tend to implement a new ematch function and resubmit the
patch later if it turns to be a good approach. What do you think?

Command syntax proposed in this patch was
tc filter add ... can sffid 0x123 sffid 0x500:0x700 effid 0x00:0xff ...
An ematch could look like
tc filter add ... basic match 'canid(sff 0x123 sff 0x124:0x7f0 \
  eff 0x1234)' ...


> 2) Adding a cls_filter (or extend cls_flow to be able to use a bpf),
> could be more generic, and thanks to bpf jit could be way faster.
What do you mean with 'adding a cls_filter'?
BPF is useful only for filtering incoming data, isn't it?


> 
> 3) sfq/fq_codel could be CAN aware if you adapt skb_flow_dissect() ?
I will try to implement "deterministic ematch" filter in the first
place.
I may extend skb_flow_dissect() later.

Regards;
Rostislav Lisovy

  reply	other threads:[~2012-06-07  9:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-04 16:09 [PATCH 1/2] can: Add constants containing length of CAN identifiers Rostislav Lisovy
2012-06-04 16:09 ` [PATCH 2/2] net/sched: CAN Filter/Classifier Rostislav Lisovy
2012-06-05  8:09   ` Eric Dumazet
2012-06-07  9:53     ` Rostislav Lisovy [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-05-25  9:12 [PATCH 1/2] can: Added constants containing length of CAN identifiers Rostislav Lisovy
2012-05-25  9:12 ` [PATCH 2/2] net/sched: CAN Filter/Classifier Rostislav Lisovy

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=1339062806.4816.3.camel@lolumad \
    --to=lisovy@gmail.com \
    --cc=eric.dumazet@gmail.com \
    --cc=lartc@vger.kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pisa@cmp.felk.cvut.cz \
    --cc=sojkam1@fel.cvut.cz \
    /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).