mbox series

[v1,net,0/2] fix shared vcap_props reference

Message ID 20220429233049.3726791-1-colin.foster@in-advantage.com (mailing list archive)
Headers show
Series fix shared vcap_props reference | expand

Message

Colin Foster April 29, 2022, 11:30 p.m. UTC
Felix vcap_props get statically allocated at the file scope, while the
felix / ocelot instances get dynamically allocated at initialization. If
there's more than one instance, each instance will be writing over the
same vcap_props memory region, which would lead to corruption.

I don't have any hardware to confidently test the vcap portions of
Ocelot / Felix, so any testers would be appreciated.

Also, I believe the memcpy of a structure array should be
architecture-portable, but I'm not 100% confident there, so that might
be an area of extra scrutiny.


Colin Foster (2):
  net: ethernet: ocelot: rename vcap_props to clearly be an ocelot
    member
  net: mscc: ocelot: fix possible memory conflict for vcap_props

 drivers/net/dsa/ocelot/felix.c             |  3 +-
 drivers/net/dsa/ocelot/felix.h             |  2 +-
 drivers/net/dsa/ocelot/felix_vsc9959.c     |  2 +-
 drivers/net/dsa/ocelot/seville_vsc9953.c   |  2 +-
 drivers/net/ethernet/mscc/ocelot_flower.c  |  4 +-
 drivers/net/ethernet/mscc/ocelot_vcap.c    | 54 +++++++++++-----------
 drivers/net/ethernet/mscc/ocelot_vsc7514.c |  5 +-
 include/soc/mscc/ocelot.h                  | 34 +++++++++++++-
 include/soc/mscc/ocelot_vcap.h             | 32 -------------
 9 files changed, 71 insertions(+), 67 deletions(-)

Comments

Vladimir Oltean May 1, 2022, 10:52 a.m. UTC | #1
On Fri, Apr 29, 2022 at 04:30:47PM -0700, Colin Foster wrote:
> I don't have any hardware to confidently test the vcap portions of
> Ocelot / Felix, so any testers would be appreciated.

You know about tools/testing/selftests/drivers/net/ocelot/tc_flower_chains.sh,
right?
Colin Foster May 1, 2022, 9:09 p.m. UTC | #2
On Sun, May 01, 2022 at 10:52:09AM +0000, Vladimir Oltean wrote:
> On Fri, Apr 29, 2022 at 04:30:47PM -0700, Colin Foster wrote:
> > I don't have any hardware to confidently test the vcap portions of
> > Ocelot / Felix, so any testers would be appreciated.
> 
> You know about tools/testing/selftests/drivers/net/ocelot/tc_flower_chains.sh,
> right?

I'll add this to the (long) list of things you've taught / shown me.
Thanks! And thanks for testing.