mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Jaakko Karrenpalo <jkarrenpalo@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Simon Horman <horms@kernel.org>,
	Lukasz Majewski <lukma@denx.de>,
	MD Danish Anwar <danishanwar@ti.com>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	Jaakko Karrenpalo <jaakko.karrenpalo@fi.abb.com>
Subject: Re: [PATCH net-next v3 1/2] net: hsr: Fix PRP duplicate detection
Date: Tue, 4 Mar 2025 10:30:45 +0100	[thread overview]
Message-ID: <7759fdfb-1aee-4a62-a2fb-33a22150ca9b@redhat.com> (raw)
In-Reply-To: <20250227050923.10241-1-jkarrenpalo@gmail.com>

On 2/27/25 6:09 AM, Jaakko Karrenpalo wrote:
> +int prp_register_frame_out(struct hsr_port *port, struct hsr_frame_info *frame)
> +{
> +	enum hsr_port_type other_port;
> +	enum hsr_port_type rcv_port;
> +	struct hsr_node *node;
> +	u16 sequence_diff;
> +	u16 sequence_exp;
> +	u16 sequence_nr;
> +
> +	/* out-going frames are always in order
> +	 *and can be checked the same way as for HSR
> +	 */
> +	if (frame->port_rcv->type == HSR_PT_MASTER)
> +		return hsr_register_frame_out(port, frame);
> +
> +	/* for PRP we should only forward frames from the slave ports
> +	 * to the master port
> +	 */
> +	if (port->type != HSR_PT_MASTER)
> +		return 1;
> +
> +	node = frame->node_src;
> +	sequence_nr = frame->sequence_nr;
> +	sequence_exp = sequence_nr + 1;
> +	rcv_port = frame->port_rcv->type;
> +	other_port =
> +		rcv_port == HSR_PT_SLAVE_A ? HSR_PT_SLAVE_B : HSR_PT_SLAVE_A;

I'm again surprised checkpatch did not complain WRT the above. Please
reformat it as:

	other_port = rcv_port == HSR_PT_SLAVE_A ? HSR_PT_SLAVE_B :
						  HSR_PT_SLAVE_A;

Also, please address the other things mentioned by Simon.

Note: you can retain Simon's tag in next iteration.

Thanks,

Paolo


      parent reply	other threads:[~2025-03-04  9:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-27  5:09 Jaakko Karrenpalo
2025-02-27  5:09 ` [PATCH net-next v3 2/2] net: hsr: Add KUnit test for PRP Jaakko Karrenpalo
2025-03-03 13:09   ` Simon Horman
2025-03-04  9:27   ` Paolo Abeni
2025-03-03 13:09 ` [PATCH net-next v3 1/2] net: hsr: Fix PRP duplicate detection Simon Horman
2025-03-04  9:30 ` Paolo Abeni [this message]

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=7759fdfb-1aee-4a62-a2fb-33a22150ca9b@redhat.com \
    --to=pabeni@redhat.com \
    --cc=danishanwar@ti.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jaakko.karrenpalo@fi.abb.com \
    --cc=jkarrenpalo@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukma@denx.de \
    --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

all inboxes | Powered by JetHome®