From: Alex Elder <elder@linaro.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Jakub Kicinski <kuba@kernel.org>,
Network Development <netdev@vger.kernel.org>,
"bjorn.andersson@linaro.org" <bjorn.andersson@linaro.org>,
Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: IPA monitor (Final RFC)
Date: Tue, 1 Feb 2022 18:41:45 -0600 [thread overview]
Message-ID: <cadf424a-6d67-cfd0-03e8-810233f7712d@linaro.org> (raw)
In-Reply-To: <YfnOFpUcOgAGeqln@lunn.ch>
On 2/1/22 6:19 PM, Andrew Lunn wrote:
> Hi Alex
>
> This looks good in general.
>
>
>> - If any monitor packet received from hardware is bad, it--along
>>
>> with everything beyond it in its page--will be discarded.
>>
>> - The received data must be big enough to hold a status
>>
>> header.
>>
>> - The received data must contain the packet data, meaning
>>
>> packet length in the status header lies within range.
>
> So bad in just the sense that capturing the packet and passing it to
> the application processor somehow went wrong.
All I'm saying is that the driver will take a little responsibility
for ensuring the stuff delivered to user space isn't complete crap.
To a certain extent that's to protect itself. It would be easiest
to pass exactly what was received up to user space, without doing
any interpretation of it whatsoever. But I think the kernel can
add this value at very little net cost.
The reality is, this should not happen.
> What about packets with bad CRC? Since the application processor is
> not involved, i assume something in the APA architecture is validating
> L2 and L3 CRCs. Do they get dropped, or can they be seen in the
The hardware can offload things like CRC calculation, but in that case
it's up to the receiving code to be told "this has a bad CRC" and
then decide to drop the received packet. I think the replication
occurs early--possibly before hardware CRC calculations, so the
replica just gets delivered out this special endpoint just the way
it arrived.
> monitor stream? Does the header contain any indication of CRC errors,
> since if the packet has been truncated, it won't be possible to
> validate them. And you said L2 headers are not present anyway.
From what I can tell, CRC errors are not indicated in the status
header. The status seems to be more oriented toward "this is
the processing that the IPA hardware performed on this packet."
Including "it entered IPA on this 'port' and matched this
filter rule and got routed out this other 'port'." But to be
honest my focus has been more on providing the feature than
what exactly those bits represent...
> Do you look at various libpcap-ng implementations? Since this is
> debugfs you are not defining a stable ABI, you can change it any time
> you want and break userspace. But maybe there could be small changes
> in the API which make it easier to feed to wireshark via libpcap.
I considered that. That was really the interface I was envisioning
at first. Those things don't really align perfectly with the
information that's made available here though. This is more like
"what is the hardware doing to each packet" (so we can maybe
understand behavior, or identify a bug). Rather than "what is
the content of packets flowing through?" It might be useful
to use the powerful capabilities of things like wireshark for
analysis, but I kind of concluded the purpose of exposing this
information is a little different.
I've got most of the code buffering received data and making
it available through a file interface done. But I have some
fine tuning to do before I'll be ready to post it for review.
Yes, the non-stable API means I can tweak it a bit even after
it's merged. But we'll see. It might be reasonable as-is.
Thanks a lot.
-Alex
>
> Andrew
next prev parent reply other threads:[~2022-02-02 0:41 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-14 14:47 Port mirroring (RFC) Alex Elder
2021-12-14 18:27 ` Andrew Lunn
2021-12-14 22:55 ` Alex Elder
2021-12-15 9:18 ` Andrew Lunn
2021-12-15 14:47 ` Alex Elder
2021-12-15 17:42 ` Andrew Lunn
2021-12-20 19:27 ` Alex Elder
2021-12-15 20:12 ` Florian Fainelli
2021-12-20 19:51 ` Alex Elder
2021-12-15 17:48 ` Florian Fainelli
2021-12-20 19:41 ` Alex Elder
2021-12-15 23:33 ` Jakub Kicinski
2021-12-20 20:17 ` Alex Elder
2022-01-14 16:50 ` Port mirroring, v2 (RFC) Alex Elder
2022-01-14 17:03 ` Alex Elder
2022-01-14 20:46 ` Andrew Lunn
2022-01-14 21:12 ` Alex Elder
2022-01-18 18:07 ` Jakub Kicinski
2022-01-18 18:14 ` Alex Elder
2022-01-15 15:14 ` Andrew Lunn
2022-01-18 17:37 ` Alex Elder
2022-01-18 18:30 ` Jakub Kicinski
2022-01-18 18:33 ` Alex Elder
2022-01-26 23:37 ` IPA monitor (Final RFC) Alex Elder
2022-01-26 23:43 ` Alex Elder
2022-02-02 0:19 ` Andrew Lunn
2022-02-02 0:41 ` Alex Elder [this message]
2022-02-02 19:05 ` Andrew Lunn
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=cadf424a-6d67-cfd0-03e8-810233f7712d@linaro.org \
--to=elder@linaro.org \
--cc=andrew@lunn.ch \
--cc=bjorn.andersson@linaro.org \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
/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).