From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Vincent Mailhol <mailhol@kernel.org>,
Marc Kleine-Budde <mkl@pengutronix.de>
Cc: linux-can@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] can: fix IFF_ECHO example in documentation
Date: Wed, 5 Aug 2026 08:08:35 +0200 [thread overview]
Message-ID: <b47de328-322d-46b8-88e4-af12fbdbea64@hartkopp.net> (raw)
In-Reply-To: <20260804-automate_iff_echo_flag-v1-2-26f06ff0f8bc@kernel.org>
On 04.08.26 21:55, Vincent Mailhol wrote:
> The documentation suggests doing:
>
> dev->flags = (IFF_NOARP | IFF_ECHO);
>
> to set the IFF_ECHO flag. This is problematic because by doing so,
> other potentially enabled flags would be overwritten. Furthermore,
> none of the drivers do it like that.
>
> Replace the example by:
>
> dev->flags |= IFF_ECHO;
IFF_NOARP is important for CAN interfaces and it looks like it could be
missed now.
Please document that IFF_NOARP is already set in can_setup().
E.g. out of tree drivers might stumble into problems when they set up
the flags differently.
>
> which is more robust and consistent with what all the drivers are doing.
>
> Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
> ---
> Documentation/networking/can.rst | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/networking/can.rst b/Documentation/networking/can.rst
> index 536ff411da1d..fbd0d501ea4e 100644
> --- a/Documentation/networking/can.rst
> +++ b/Documentation/networking/can.rst
> @@ -1126,7 +1126,7 @@ e.g. of tty devices. In this case the driver flag IFF_ECHO has to be
> set to prevent the PF_CAN core from locally echoing sent frames
> (aka loopback) as fallback solution::
>
> - dev->flags = (IFF_NOARP | IFF_ECHO);
> + dev->flags |= IFF_ECHO;
Here also a documentation about IFF_NOARP is needed now.
Best regards,
Oliver
next prev parent reply other threads:[~2026-08-05 6:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-04 19:55 [PATCH 0/4] can: automate IFF_ECHO flag for generic echo skbs Vincent Mailhol
2026-08-04 19:55 ` [PATCH 1/4] can: slcan: do not allocate unused echo skb Vincent Mailhol
2026-08-04 19:55 ` [PATCH 2/4] can: fix IFF_ECHO example in documentation Vincent Mailhol
2026-08-05 6:08 ` Oliver Hartkopp [this message]
2026-08-04 19:55 ` [PATCH 3/4] can: dev: set IFF_ECHO when allocating echo skbs Vincent Mailhol
2026-08-04 19:55 ` [PATCH 4/4] can: treewide: remove redundant IFF_ECHO assignments Vincent Mailhol
2026-08-05 6:29 ` [PATCH 0/4] can: automate IFF_ECHO flag for generic echo skbs Oliver Hartkopp
2026-08-05 7:25 ` Vincent Mailhol
2026-08-05 16:17 ` Oliver Hartkopp
2026-08-05 21:06 ` Vincent Mailhol
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=b47de328-322d-46b8-88e4-af12fbdbea64@hartkopp.net \
--to=socketcan@hartkopp.net \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mailhol@kernel.org \
--cc=mkl@pengutronix.de \
/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
all inboxes | Powered by JetHome®