mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Ravi Gunasekaran <r-gunasekaran@ti.com>,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	bigeasy@linutronix.de
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, rogerq@kernel.org
Subject: Re: [PATCH] net: hsr: Disable promiscuous mode in offload mode
Date: Wed, 14 Jun 2023 11:42:43 +0200	[thread overview]
Message-ID: <dffbf0474b1352f1eac63125a973c8f8cd7b3e8d.camel@redhat.com> (raw)
In-Reply-To: <20230612093933.13267-1-r-gunasekaran@ti.com>

On Mon, 2023-06-12 at 15:09 +0530, Ravi Gunasekaran wrote:
> When port-to-port forwarding for interfaces in HSR node is enabled,
> disable promiscuous mode since L2 frame forward happens at the
> offloaded hardware.
> 
> Signed-off-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
> ---
>  net/hsr/hsr_device.c |  5 +++++
>  net/hsr/hsr_main.h   |  1 +
>  net/hsr/hsr_slave.c  | 15 +++++++++++----
>  3 files changed, 17 insertions(+), 4 deletions(-)
> 
> diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c
> index 5a236aae2366..306f942c3b28 100644
> --- a/net/hsr/hsr_device.c
> +++ b/net/hsr/hsr_device.c
> @@ -531,6 +531,11 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2],
>  	if (res)
>  		goto err_add_master;
>  
> +	/* HSR forwarding offload supported in lower device? */
> +	if ((slave[0]->features & NETIF_F_HW_HSR_FWD) &&
> +	    (slave[1]->features & NETIF_F_HW_HSR_FWD))
> +		hsr->fwd_offloaded = true;
> +
>  	res = register_netdevice(hsr_dev);
>  	if (res)
>  		goto err_unregister;
> diff --git a/net/hsr/hsr_main.h b/net/hsr/hsr_main.h
> index 5584c80a5c79..0225fabbe6d1 100644
> --- a/net/hsr/hsr_main.h
> +++ b/net/hsr/hsr_main.h
> @@ -195,6 +195,7 @@ struct hsr_priv {
>  	struct hsr_self_node	__rcu *self_node;	/* MACs of slaves */
>  	struct timer_list	announce_timer;	/* Supervision frame dispatch */
>  	struct timer_list	prune_timer;
> +	unsigned int            fwd_offloaded : 1; /* Forwarding offloaded to HW */

Please use plain 'bool' instead.

Also there is an hole in 'struct hsr_priv' just after 'net_id', you
could consider moving this new field there.


Thanks!

Paolo


  parent reply	other threads:[~2023-06-14  9:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-12  9:39 Ravi Gunasekaran
2023-06-14  8:01 ` Simon Horman
2023-06-14  9:42 ` Paolo Abeni [this message]
2023-06-14  9:44   ` Paolo Abeni
2023-06-14 10:05     ` Ravi Gunasekaran
2023-06-14 10:05   ` Ravi Gunasekaran

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=dffbf0474b1352f1eac63125a973c8f8cd7b3e8d.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=bigeasy@linutronix.de \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=r-gunasekaran@ti.com \
    --cc=rogerq@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®