Thread (7 messages) 7 messages, 3 authors, 2018-03-22

Re: [PATCH net-next v2] net: mvpp2: Don't use dynamic allocs for local variables

flat view

From: Maxime Chevallier <maxime.chevallier@bootlin.com>
Date: 2018-03-21 21:14:56
Also in: lkml

Hello Yan,

On Wed, 21 Mar 2018 19:57:47 +0000,
Yan Markman [off-list ref] wrote :
Hi Maxime
Please avoid top-posting on this list.
Please check the TWO points:

1). The mvpp2_prs_flow_find() returns TID if found
    The TID=0 is valid FOUND value
    For Not-found use -ENOENT (just like your mvpp2_prs_vlan_find)
This is actually what is used in this patch. You might be refering to
a previous draft version of this patch.
2). The original code always uses "mvpp2_prs_entry *pe" storage
Zero-Allocated Please check the correctnes of new "mvpp2_prs_entry
pe" without memset(pe, 0, sizeof(pe));
   in all procedures where pe=kzalloc() has been replaced
I think we're good on that regard. On places where I didn't memset the
prs_entry, the pe.index field is set, and this is followed by a read
from TCAM that will initialize the prs_entry to the correct value :

		pe.index = tid;
		mvpp2_prs_hw_read(priv, &pe);
Thanks
Yan Markman
[...]

Thanks,

Maxime
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help