From: Roger Quadros <rogerq@kernel.org>
To: MD Danish Anwar <danishanwar@ti.com>,
Dan Carpenter <dan.carpenter@linaro.org>,
Andrew Lunn <andrew@lunn.ch>, Jan Kiszka <jan.kiszka@siemens.com>,
Vignesh Raghavendra <vigneshr@ti.com>,
Javier Carrasco <javier.carrasco.cruz@gmail.com>,
Jacob Keller <jacob.e.keller@intel.com>,
Diogo Ivo <diogo.ivo@siemens.com>,
Simon Horman <horms@kernel.org>,
Richard Cochran <richardcochran@gmail.com>,
Paolo Abeni <pabeni@redhat.com>, Jakub Kicinski <kuba@kernel.org>,
Eric Dumazet <edumazet@google.com>,
"David S. Miller" <davem@davemloft.net>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, srk@ti.com
Subject: Re: [PATCH net-next v2 6/7] net: ti: icssg-prueth: Add multicast filtering support in HSR mode
Date: Wed, 21 Aug 2024 15:10:42 +0300 [thread overview]
Message-ID: <aa3d740f-403e-4bd3-a74a-d077b163dbdd@kernel.org> (raw)
In-Reply-To: <20240813074233.2473876-7-danishanwar@ti.com>
On 13/08/2024 10:42, MD Danish Anwar wrote:
> Add support for multicast filtering in HSR mode
>
> Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
> ---
> drivers/net/ethernet/ti/icssg/icssg_prueth.c | 38 +++++++++++++++++++-
> 1 file changed, 37 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.c b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
> index b32a2bff34dc..521e9f914459 100644
> --- a/drivers/net/ethernet/ti/icssg/icssg_prueth.c
> +++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
> @@ -490,6 +490,36 @@ static int icssg_prueth_del_mcast(struct net_device *ndev, const u8 *addr)
> return 0;
> }
>
> +static int icssg_prueth_hsr_add_mcast(struct net_device *ndev, const u8 *addr)
> +{
> + struct prueth_emac *emac = netdev_priv(ndev);
> + struct prueth *prueth = emac->prueth;
> +
> + icssg_fdb_add_del(emac, addr, prueth->default_vlan,
> + ICSSG_FDB_ENTRY_P0_MEMBERSHIP |
> + ICSSG_FDB_ENTRY_P1_MEMBERSHIP |
> + ICSSG_FDB_ENTRY_P2_MEMBERSHIP |
> + ICSSG_FDB_ENTRY_BLOCK, true);
> +
> + icssg_vtbl_modify(emac, emac->port_vlan, BIT(emac->port_id),
> + BIT(emac->port_id), true);
> + return 0;
> +}
> +
> +static int icssg_prueth_hsr_del_mcast(struct net_device *ndev, const u8 *addr)
> +{
> + struct prueth_emac *emac = netdev_priv(ndev);
> + struct prueth *prueth = emac->prueth;
> +
> + icssg_fdb_add_del(emac, addr, prueth->default_vlan,
> + ICSSG_FDB_ENTRY_P0_MEMBERSHIP |
> + ICSSG_FDB_ENTRY_P1_MEMBERSHIP |
> + ICSSG_FDB_ENTRY_P2_MEMBERSHIP |
> + ICSSG_FDB_ENTRY_BLOCK, false);
> +
> + return 0;
> +}
> +
> /**
> * emac_ndo_open - EMAC device open
> * @ndev: network adapter device
> @@ -651,6 +681,7 @@ static int emac_ndo_stop(struct net_device *ndev)
> icssg_class_disable(prueth->miig_rt, prueth_emac_slice(emac));
>
> __dev_mc_unsync(ndev, icssg_prueth_del_mcast);
Above unsync call will already remove all MC addresses so nothing
is left to unsync in the below unsync call.
> + __dev_mc_unsync(ndev, icssg_prueth_hsr_del_mcast);
Do you have to use an if/else like you do while calling __dev_mc_sync?
>
> atomic_set(&emac->tdown_cnt, emac->tx_ch_num);
> /* ensure new tdown_cnt value is visible */
> @@ -728,7 +759,12 @@ static void emac_ndo_set_rx_mode_work(struct work_struct *work)
> return;
> }
>
> - __dev_mc_sync(ndev, icssg_prueth_add_mcast, icssg_prueth_del_mcast);
> + if (emac->prueth->is_hsr_offload_mode)
> + __dev_mc_sync(ndev, icssg_prueth_hsr_add_mcast,
> + icssg_prueth_hsr_del_mcast);
> + else
> + __dev_mc_sync(ndev, icssg_prueth_add_mcast,
> + icssg_prueth_del_mcast);
> }
>
> /**
--
cheers,
-roger
next prev parent reply other threads:[~2024-08-21 12:10 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-13 7:42 [PATCH net-next v2 0/7] Introduce HSR offload support for ICSSG MD Danish Anwar
2024-08-13 7:42 ` [PATCH net-next v2 1/7] net: ti: icssg-prueth: Enable IEP1 MD Danish Anwar
2024-08-21 11:27 ` Roger Quadros
2024-08-21 11:33 ` Anwar, Md Danish
2024-08-21 11:53 ` Roger Quadros
2024-08-22 5:52 ` MD Danish Anwar
2024-08-22 11:27 ` Roger Quadros
2024-08-22 12:12 ` Anwar, Md Danish
2024-08-23 11:30 ` Roger Quadros
2024-08-23 11:41 ` MD Danish Anwar
2024-08-22 11:32 ` Dan Carpenter
2024-08-22 12:13 ` Anwar, Md Danish
2024-08-13 7:42 ` [PATCH net-next v2 2/7] net: ti: icss-iep: Move icss_iep structure MD Danish Anwar
2024-08-21 11:53 ` Roger Quadros
2024-08-13 7:42 ` [PATCH net-next v2 3/7] net: ti: icssg-prueth: Stop hardcoding def_inc MD Danish Anwar
2024-08-13 8:06 ` Dan Carpenter
2024-08-21 11:54 ` Roger Quadros
2024-08-13 7:42 ` [PATCH net-next v2 4/7] net: ti: icssg-prueth: Add support for HSR frame forward offload MD Danish Anwar
2024-08-13 15:17 ` Andrew Lunn
2024-08-14 6:59 ` MD Danish Anwar
2024-08-14 14:02 ` Andrew Lunn
2024-08-14 14:54 ` Anwar, Md Danish
2024-08-19 10:51 ` Anwar, Md Danish
2024-08-15 15:14 ` Simon Horman
2024-08-19 7:16 ` Anwar, Md Danish
2024-08-13 7:42 ` [PATCH net-next v2 5/7] net: ti: icssg-prueth: Enable HSR Tx Packet duplication offload MD Danish Anwar
2024-08-13 15:23 ` Andrew Lunn
2024-08-14 6:59 ` MD Danish Anwar
2024-08-13 7:42 ` [PATCH net-next v2 6/7] net: ti: icssg-prueth: Add multicast filtering support in HSR mode MD Danish Anwar
2024-08-21 12:10 ` Roger Quadros [this message]
2024-08-22 5:56 ` MD Danish Anwar
2024-08-13 7:42 ` [PATCH net-next v2 7/7] net: ti: icssg-prueth: Enable HSR Tx Tag and Rx Tag offload MD Danish Anwar
2024-08-21 12:15 ` Roger Quadros
2024-08-22 8:03 ` MD Danish Anwar
2024-08-22 11:28 ` Roger Quadros
2024-08-22 12:14 ` Anwar, Md Danish
2024-08-13 14:49 ` [PATCH net-next v2 0/7] Introduce HSR offload support for ICSSG Andrew Lunn
2024-08-14 6:25 ` MD Danish Anwar
2024-08-14 14:04 ` Andrew Lunn
2024-08-14 14:56 ` Anwar, Md Danish
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=aa3d740f-403e-4bd3-a74a-d077b163dbdd@kernel.org \
--to=rogerq@kernel.org \
--cc=andrew@lunn.ch \
--cc=dan.carpenter@linaro.org \
--cc=danishanwar@ti.com \
--cc=davem@davemloft.net \
--cc=diogo.ivo@siemens.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jacob.e.keller@intel.com \
--cc=jan.kiszka@siemens.com \
--cc=javier.carrasco.cruz@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=srk@ti.com \
--cc=vigneshr@ti.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 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).