[PATCH net-next v2 2/3] net: airoha: Add FLOW_CLS_STATS callback support

Lorenzo Bianconi lorenzo at kernel.org
Mon May 19 02:55:46 PDT 2025


On May 19, Simon Horman wrote:
> On Fri, May 16, 2025 at 10:00:00AM +0200, Lorenzo Bianconi wrote:
> 
> ...
> 
> > @@ -1027,6 +1255,15 @@ int airoha_ppe_init(struct airoha_eth *eth)
> >  	if (!ppe->foe_flow)
> >  		return -ENOMEM;
> >  
> > +	foe_size = PPE_STATS_NUM_ENTRIES * sizeof(*ppe->foe_stats);
> > +	if (foe_size) {
> 
> Hi Lorenzo,
> 
> It's unclear to me how foe_size can be zero.

Hi Simon,

foe_size will be 0 if you disable CONFIG_NET_AIROHA_FLOW_STATS since in this
case PPE_STATS_NUM_ENTRIES will be 0.

Regards,
Lorenzo

> 
> > +		ppe->foe_stats = dmam_alloc_coherent(eth->dev, foe_size,
> > +						     &ppe->foe_stats_dma,
> > +						     GFP_KERNEL);
> > +		if (!ppe->foe_stats)
> > +			return -ENOMEM;
> > +	}
> > +
> >  	err = rhashtable_init(&eth->flow_table, &airoha_flow_table_params);
> >  	if (err)
> >  		return err;
> 
> ...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mediatek/attachments/20250519/3d316a5c/attachment.sig>


More information about the Linux-mediatek mailing list