From: Stathis Voukelatos <stathis.voukelatos@linn.co.uk>
To: Florian Fainelli <f.fainelli@gmail.com>,
Stathis Voukelatos <stathisv70@gmail.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org
Cc: abrestic@chromium.org
Subject: Re: [PATCH] net: Linn Ethernet Packet Sniffer driver
Date: Tue, 27 Jan 2015 10:51:09 +0000 [thread overview]
Message-ID: <54C76D9D.8070704@linn.co.uk> (raw)
In-Reply-To: <54C6BFEA.5020101@gmail.com>
Hi Florian,
On 26/01/15 22:30, Florian Fainelli wrote:
> On 23/01/15 02:07, Stathis Voukelatos wrote:
>> This patch adds support the Ethernet Packet Sniffer H/W module
>> developed by Linn Products Ltd and found in the IMG Pistachio SoC.
>> The module allows Ethernet packets to be parsed, matched against
>> a user-defined pattern and timestamped. It sits between a 100M
>> Ethernet MAC and PHY and is completely passive with respect to
>> Ethernet frames.
> Is there any latency penalty involved in capturing (or not) packets as
> opposed to having this capture HW unused?
There is no additional latency introduced by the sniffer at the H/W level,
if that is what you mean. Only the S/W overhead for handling the
sniffer interrupt for each match event.
>> Matched packet bytes and timestamp values are returned through a
>> FIFO. Timestamps are provided to the module through an externally
>> generated Gray-encoded counter.
>>
>> The command pattern for packet matching is stored in module RAM
>> and consists of a sequence of 16-bit entries. Each entry includes
>> an 8-bit command code and and 8-bit data value. Valid command
>> codes are:
>> 0 - Don't care
>> 1 - Match: packet data must match command string byte
>> 2 - Copy: packet data will be copied to FIFO
>> 3 - Match/Stamp: if packet data matches string byte, a timestamp
>> is copied into the FIFO
>> 4 - Copy/Done: packet data will be copied into the FIFO.
>> This command terminates the command string.
>>
>> The driver consists of two modules:
>> - Core: it provides an API to user space using the Generic Netlink
>> framework. Specific backend implementations, like the
>> Ethernet Packet Sniffer, register one or more channels
>> with the Core. For each channel a Genl family is created.
>> User space can access a channel by sending Genl messages
>> to the Genl family associated with the channel. Packet
>> matching events are multicast.
> Instead of having this new generic netlink family to control sniffing,
> could we imagine registering a netdevice which does not nothing but
> still allows for tools like tcpdump, af_packet and other capture tools
> to work transparently and just leverage the HW capture?
Thanks, I will work on that change. It has been suggested by a previous
reviewer too and it makes sense to go down that route.
Stathis
WARNING: multiple messages have this Message-ID (diff)
From: Stathis Voukelatos <stathis.voukelatos@linn.co.uk>
To: Florian Fainelli <f.fainelli@gmail.com>,
Stathis Voukelatos <stathisv70@gmail.com>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<devicetree@vger.kernel.org>
Cc: <abrestic@chromium.org>
Subject: Re: [PATCH] net: Linn Ethernet Packet Sniffer driver
Date: Tue, 27 Jan 2015 10:51:09 +0000 [thread overview]
Message-ID: <54C76D9D.8070704@linn.co.uk> (raw)
In-Reply-To: <54C6BFEA.5020101@gmail.com>
Hi Florian,
On 26/01/15 22:30, Florian Fainelli wrote:
> On 23/01/15 02:07, Stathis Voukelatos wrote:
>> This patch adds support the Ethernet Packet Sniffer H/W module
>> developed by Linn Products Ltd and found in the IMG Pistachio SoC.
>> The module allows Ethernet packets to be parsed, matched against
>> a user-defined pattern and timestamped. It sits between a 100M
>> Ethernet MAC and PHY and is completely passive with respect to
>> Ethernet frames.
> Is there any latency penalty involved in capturing (or not) packets as
> opposed to having this capture HW unused?
There is no additional latency introduced by the sniffer at the H/W level,
if that is what you mean. Only the S/W overhead for handling the
sniffer interrupt for each match event.
>> Matched packet bytes and timestamp values are returned through a
>> FIFO. Timestamps are provided to the module through an externally
>> generated Gray-encoded counter.
>>
>> The command pattern for packet matching is stored in module RAM
>> and consists of a sequence of 16-bit entries. Each entry includes
>> an 8-bit command code and and 8-bit data value. Valid command
>> codes are:
>> 0 - Don't care
>> 1 - Match: packet data must match command string byte
>> 2 - Copy: packet data will be copied to FIFO
>> 3 - Match/Stamp: if packet data matches string byte, a timestamp
>> is copied into the FIFO
>> 4 - Copy/Done: packet data will be copied into the FIFO.
>> This command terminates the command string.
>>
>> The driver consists of two modules:
>> - Core: it provides an API to user space using the Generic Netlink
>> framework. Specific backend implementations, like the
>> Ethernet Packet Sniffer, register one or more channels
>> with the Core. For each channel a Genl family is created.
>> User space can access a channel by sending Genl messages
>> to the Genl family associated with the channel. Packet
>> matching events are multicast.
> Instead of having this new generic netlink family to control sniffing,
> could we imagine registering a netdevice which does not nothing but
> still allows for tools like tcpdump, af_packet and other capture tools
> to work transparently and just leverage the HW capture?
Thanks, I will work on that change. It has been suggested by a previous
reviewer too and it makes sense to go down that route.
Stathis
next prev parent reply other threads:[~2015-01-27 10:51 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-23 10:07 [PATCH] net: Linn Ethernet Packet Sniffer driver Stathis Voukelatos
[not found] ` <1422007621-13567-1-git-send-email-stathis.voukelatos-zgcZaY4qg+21Qrn1Bg8BZw@public.gmane.org>
2015-01-23 10:21 ` Arnd Bergmann
2015-01-23 10:21 ` Arnd Bergmann
2015-01-26 11:23 ` Stathis Voukelatos
2015-01-26 11:23 ` Stathis Voukelatos
2015-01-23 10:51 ` Mark Rutland
2015-01-23 10:51 ` Mark Rutland
2015-01-26 10:16 ` Stathis Voukelatos
2015-01-27 10:53 ` Mark Rutland
2015-01-23 11:20 ` Daniel Borkmann
2015-01-23 11:20 ` Daniel Borkmann
2015-01-26 9:49 ` Stathis Voukelatos
2015-01-26 10:10 ` Daniel Borkmann
2015-01-27 11:15 ` Stathis Voukelatos
2015-01-27 14:46 ` Daniel Borkmann
2015-01-27 17:22 ` Stathis Voukelatos
2015-01-27 17:22 ` Stathis Voukelatos
2015-01-23 18:12 ` James Hogan
2015-01-23 18:12 ` James Hogan
2015-01-26 11:05 ` Stathis Voukelatos
2015-01-26 11:05 ` Stathis Voukelatos
2015-01-26 11:05 ` Stathis Voukelatos
2015-01-26 22:30 ` Florian Fainelli
2015-01-26 22:30 ` Florian Fainelli
2015-01-27 10:51 ` Stathis Voukelatos [this message]
2015-01-27 10:51 ` Stathis Voukelatos
2015-01-24 21:37 ` Joe Perches
2015-01-26 11:11 ` Stathis Voukelatos
2015-01-26 11:11 ` Stathis Voukelatos
2015-01-26 19:39 ` Joe Perches
[not found] ` <1422301185.18650.4.camel-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
2015-01-27 9:52 ` Stathis Voukelatos
2015-01-27 9:52 ` Stathis Voukelatos
2015-01-27 9:52 ` Stathis Voukelatos
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=54C76D9D.8070704@linn.co.uk \
--to=stathis.voukelatos@linn.co.uk \
--cc=abrestic@chromium.org \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stathisv70@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 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.