All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Santos <daniel.santos@pobox.com>
To: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
Cc: Oliver Hartkopp <socketcan@hartkopp.net>,
	linux-can <linux-can@vger.kernel.org>
Subject: Re: Framework for hardware filter support?
Date: Wed, 14 Feb 2018 16:40:19 -0600	[thread overview]
Message-ID: <55e3a0ef-82ea-b62d-34f7-ca7518b9d534@pobox.com> (raw)
In-Reply-To: <20180213194203.GA15640@airbook.vandijck-laurijssen.be>

Thanks for your response, Kurt.


On 02/13/2018 01:42 PM, Kurt Van Dijck wrote:
> On zo, 11 feb 2018 16:33:43 -0600, Daniel Santos wrote:
>>> where the CAN_RAW filter design would easily fit.
>> This is what I mean by a framework.  So the driver should inform the
>> core CAN driver what it's filtering capabilities are -- again, I would
>> have to study a number of devices to design this sanely.  It would seem
>> that iproute2 would be the best userland mechanism to specify them, and
>> it could pass an array of struct can_filter objects.  Then based upon
>> the hardware, it can apply or reject them.  It would also be nice for
>> iproute2 to query the driver and be able to report those capabilities.
> I remember this discussion has passed a few times already.
> The end result has always been to:
> 1. give the kernel/driver a list of id/masks.
> 2. The driver does no aggregation, the root operator should know
>    what to do.

I don't understand what driver aggregation means.  But yes, this makes
good sense.

> Maybe some day this will become limited for hardware that can do special
> tricks, like having a random list of identifiers.
> This can most probable be addressed in some clever way that is specific
> for the driver (like adding a list of id/masks where mask is always
> 0x7ff for a random canid list).
> Due to the driver doing smart things, the driver may not be capable of
> informing filtering capabilities in a static way. I would start without
> it.
>
> The support of hardware filters is hardware specific anyway, and
> intersects the multi-user principle. The only justification is ....
> that the root operator knows the hardware and the application.

Yes, perfect!

> What matters for a generic implementation is that the API is simple,
> clear and usable. That is where the id/mask list pops in.
> Operators that don't understand the id/mask list will probably fail
> anyway to use hardware filters on CAN. No framework can prevent that.
>
> Kurt
>

Yes, this makes great sense. And the driver (I presume) can always
reject the filter configuration if it can't do what is asked.  In the
case of the MCP2210, however, there is one small hole; it has a bit that
decides rather or not to rollover messages from it's first rx buffer to
it's second (and it only has two).  I'm wondering about some free-form,
driver specific configuration string to handle any loose ends of the
device?  Too ugly?

Then again, it supports 6 filters.  Perhaps a 7th filter could be passed
to specify the rollover configuration.  Uglier still? :)

And actually, the device has bits to en/disable filtering for each rx
buffer that can be changed (along with the rollover) while the link is
up.  I'm probably *really* reaching here.  I can't think of many reasons
to have to change this while the link is up and rather or not they are
enabled can be implied by the filter/mask array.

Thanks,
Daniel


  parent reply	other threads:[~2018-02-14 22:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-11  2:38 Framework for hardware filter support? Daniel Santos
2018-02-11 12:32 ` Oliver Hartkopp
2018-02-11 22:33   ` Daniel Santos
2018-02-13 19:42     ` Kurt Van Dijck
2018-02-13 20:44       ` Oliver Hartkopp
2018-02-14 22:40       ` Daniel Santos [this message]
2018-02-15 23:03         ` Kurt Van Dijck

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=55e3a0ef-82ea-b62d-34f7-ca7518b9d534@pobox.com \
    --to=daniel.santos@pobox.com \
    --cc=dev.kurt@vandijck-laurijssen.be \
    --cc=linux-can@vger.kernel.org \
    --cc=socketcan@hartkopp.net \
    /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.