netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Michal Kubiak <michal.kubiak@intel.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, netdev@vger.kernel.org
Subject: Re: [PATCH net-next 3/3] net: airoha: Add L2 hw acceleration support
Date: Wed, 9 Apr 2025 01:19:16 +0200	[thread overview]
Message-ID: <Z_Wu9EDZM9jvmgAU@lore-desk> (raw)
In-Reply-To: <Z/V/ip/dA+aw+dCW@localhost.localdomain>

[-- Attachment #1: Type: text/plain, Size: 3087 bytes --]

> On Mon, Apr 07, 2025 at 04:18:32PM +0200, Lorenzo Bianconi wrote:
> > Similar to mtk driver, introduce the capability to offload L2 traffic
> > defining flower rules in the PSE/PPE engine available on EN7581 SoC.
> > Since the hw always reports L2/L3/L4 flower rules, link all L2 rules
> > sharing the same L2 info (with different L3/L4 info) in the L2 subflows
> > list of a given L2 PPE entry.
> > 
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > ---
> >  drivers/net/ethernet/airoha/airoha_eth.c |   2 +-
> >  drivers/net/ethernet/airoha/airoha_eth.h |  11 ++-
> >  drivers/net/ethernet/airoha/airoha_ppe.c | 162 +++++++++++++++++++++++++------
> >  3 files changed, 144 insertions(+), 31 deletions(-)
> > 
> 
> [...]
> 
> > +static void airoha_ppe_foe_remove_flow(struct airoha_ppe *ppe,
> > +				       struct airoha_flow_table_entry *e)
> > +{
> > +	lockdep_assert_held(&ppe_lock);
> > +
> > +	hlist_del_init(&e->list);
> > +	if (e->hash != 0xffff) {
> > +		e->data.ib1 &= ~AIROHA_FOE_IB1_BIND_STATE;
> > +		e->data.ib1 |= FIELD_PREP(AIROHA_FOE_IB1_BIND_STATE,
> > +					  AIROHA_FOE_STATE_INVALID);
> > +		airoha_ppe_foe_commit_entry(ppe, &e->data, e->hash);
> > +		e->hash = 0xffff;
> > +	}
> > +	if (e->type == FLOW_TYPE_L2_SUBFLOW) {
> > +		hlist_del_init(&e->l2_subflow_node);
> > +		kfree(e);
> > +	}
> > +}
> > +
> > +static void airoha_ppe_foe_remove_l2_flow(struct airoha_ppe *ppe,
> > +					  struct airoha_flow_table_entry *e)
> > +{
> > +	struct hlist_head *head = &e->l2_flows;
> > +	struct hlist_node *n;
> > +
> > +	lockdep_assert_held(&ppe_lock);
> > +
> > +	rhashtable_remove_fast(&ppe->l2_flows, &e->l2_node,
> > +			       airoha_l2_flow_table_params);
> > +	hlist_for_each_entry_safe(e, n, head, l2_subflow_node)
> > +		airoha_ppe_foe_remove_flow(ppe, e);
> > +}
> > +
> >  static void airoha_ppe_foe_flow_remove_entry(struct airoha_ppe *ppe,
> >  					     struct airoha_flow_table_entry *e)
> >  {
> >  	lockdep_assert_held(&ppe_lock);
> >  
> > -	if (e->type == FLOW_TYPE_L2) {
> > -		rhashtable_remove_fast(&ppe->l2_flows, &e->l2_node,
> > -				       airoha_l2_flow_table_params);
> > -	} else {
> > -		hlist_del_init(&e->list);
> > -		if (e->hash != 0xffff) {
> > -			e->data.ib1 &= ~AIROHA_FOE_IB1_BIND_STATE;
> > -			e->data.ib1 |= FIELD_PREP(AIROHA_FOE_IB1_BIND_STATE,
> > -						  AIROHA_FOE_STATE_INVALID);
> > -			airoha_ppe_foe_commit_entry(ppe, &e->data, e->hash);
> > -			e->hash = 0xffff;
> > -		}
> > -	}
> > +	if (e->type == FLOW_TYPE_L2)
> > +		airoha_ppe_foe_remove_l2_flow(ppe, e);
> > +	else
> > +		airoha_ppe_foe_remove_flow(ppe, e);
> 
> It's not a hard request, more of a question: wouldn't it be better to
> introduce "airoha_ppe_foe_remove_l2_flow()" and
> "airoha_ppe_foe_remove_flow()" in the patch #2?
> It looks like reorganizing the code can be part of the preliminary
> patch and the current patch can just add the feature, e.g. L2_SUBFLOW.

ack, fine for me. I will fix it in v2.

Regards,
Lorenzo

> 
> Thanks,
> Michal
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2025-04-08 23:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-07 14:18 [PATCH net-next 0/3] Add L2 hw acceleration for airoha_eth driver Lorenzo Bianconi
2025-04-07 14:18 ` [PATCH net-next 1/3] net: airoha: Add l2_flows rhashtable Lorenzo Bianconi
2025-04-08 15:36   ` Michal Kubiak
2025-04-08 16:49     ` Lorenzo Bianconi
2025-04-08 18:41       ` Michal Kubiak
2025-04-08 18:57       ` Jakub Kicinski
2025-04-08 22:54         ` Lorenzo Bianconi
2025-04-07 14:18 ` [PATCH net-next 2/3] net: airoha: Add airoha_ppe_foe_flow_remove_entry_locked() Lorenzo Bianconi
2025-04-08 20:12   ` Michal Kubiak
2025-04-08 23:23     ` Lorenzo Bianconi
2025-04-07 14:18 ` [PATCH net-next 3/3] net: airoha: Add L2 hw acceleration support Lorenzo Bianconi
2025-04-08 19:56   ` Michal Kubiak
2025-04-08 23:19     ` Lorenzo Bianconi [this message]
2025-04-08 18:52 ` [PATCH net-next 0/3] Add L2 hw acceleration for airoha_eth driver Lorenzo Bianconi

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=Z_Wu9EDZM9jvmgAU@lore-desk \
    --to=lorenzo@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=michal.kubiak@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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).