linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next PATCH 0/3] Add devlink and devlink health reporters to
@ 2020-11-02  5:06 George Cherian
  2020-11-02  5:06 ` [net-next PATCH 1/3] octeontx2-af: Add devlink suppoort to af driver George Cherian
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: George Cherian @ 2020-11-02  5:06 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: kuba, davem, sgoutham, lcherian, gakula, masahiroy, george.cherian

Add basic devlink and devlink health reporters.
Devlink health reporters are added for NPA and NIX blocks.
These reporters report the error count in respective blocks.

Address Jakub's comment to add devlink support for error reporting.
https://www.spinics.net/lists/netdev/msg670712.html


George Cherian (3):
  octeontx2-af: Add devlink suppoort to af driver
  octeontx2-af: Add devlink health reporters for NPA
  octeontx2-af: Add devlink health reporters for NIX

 .../net/ethernet/marvell/octeontx2/Kconfig    |   1 +
 .../ethernet/marvell/octeontx2/af/Makefile    |   3 +-
 .../net/ethernet/marvell/octeontx2/af/rvu.c   |   9 +-
 .../net/ethernet/marvell/octeontx2/af/rvu.h   |   5 +-
 .../marvell/octeontx2/af/rvu_devlink.c        | 875 ++++++++++++++++++
 .../marvell/octeontx2/af/rvu_devlink.h        |  67 ++
 .../marvell/octeontx2/af/rvu_struct.h         |  33 +
 7 files changed, 990 insertions(+), 3 deletions(-)
 create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c
 create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.h

-- 
2.25.1


^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [net-next PATCH 1/3] octeontx2-af: Add devlink suppoort to af driver
@ 2020-11-03  3:38 George Cherian
  0 siblings, 0 replies; 10+ messages in thread
From: George Cherian @ 2020-11-03  3:38 UTC (permalink / raw)
  To: Willem de Bruijn
  Cc: Network Development, linux-kernel, Jakub Kicinski, David Miller,
	Sunil Kovvuri Goutham, Linu Cherian, Geethasowjanya Akula,
	masahiroy

Hi Willem,

Thanks for the review.

> -----Original Message-----
> From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
> Sent: Monday, November 2, 2020 7:01 PM
> To: George Cherian <gcherian@marvell.com>
> Cc: Network Development <netdev@vger.kernel.org>; linux-kernel <linux-
> kernel@vger.kernel.org>; Jakub Kicinski <kuba@kernel.org>; David Miller
> <davem@davemloft.net>; Sunil Kovvuri Goutham
> <sgoutham@marvell.com>; Linu Cherian <lcherian@marvell.com>;
> Geethasowjanya Akula <gakula@marvell.com>; masahiroy@kernel.org
> Subject: Re: [net-next PATCH 1/3] octeontx2-af: Add devlink suppoort
> to af driver
> 
> On Mon, Nov 2, 2020 at 12:07 AM George Cherian
> <george.cherian@marvell.com> wrote:
> >
> > Add devlink support to AF driver. Basic devlink support is added.
> > Currently info_get is the only supported devlink ops.
> >
> > devlink ouptput looks like this
> >  # devlink dev
> >  pci/0002:01:00.0
> >  # devlink dev info
> >  pci/0002:01:00.0:
> >   driver octeontx2-af
> >   versions:
> >       fixed:
> >         mbox version: 9
> >
> > Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
> > Signed-off-by: Jerin Jacob <jerinj@marvell.com>
> > Signed-off-by: George Cherian <george.cherian@marvell.com>
> 
> > diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
> > b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
> > index 5ac9bb12415f..c112b299635d 100644
> > --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
> > +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
> > @@ -12,7 +12,10 @@
> >  #define RVU_H
> >
> >  #include <linux/pci.h>
> > +#include <net/devlink.h>
> > +
> >  #include "rvu_struct.h"
> > +#include "rvu_devlink.h"
> >  #include "common.h"
> >  #include "mbox.h"
> >
> > @@ -372,10 +375,10 @@ struct rvu {
> >         struct npc_kpu_profile_adapter kpu;
> >
> >         struct ptp              *ptp;
> > -
> 
> accidentally removed this line?
Yes.
> 
> >  #ifdef CONFIG_DEBUG_FS
> >         struct rvu_debugfs      rvu_dbg;
> >  #endif
> > +       struct rvu_devlink      *rvu_dl;
> >  };
> 
> 
> > +int rvu_register_dl(struct rvu *rvu)
> > +{
> > +       struct rvu_devlink *rvu_dl;
> > +       struct devlink *dl;
> > +       int err;
> > +
> > +       rvu_dl = kzalloc(sizeof(*rvu_dl), GFP_KERNEL);
> > +       if (!rvu_dl)
> > +               return -ENOMEM;
> > +
> > +       dl = devlink_alloc(&rvu_devlink_ops, sizeof(struct rvu_devlink));
> > +       if (!dl) {
> > +               dev_warn(rvu->dev, "devlink_alloc failed\n");
> > +               return -ENOMEM;
> 
> rvu_dl not freed on error.
Thanks for pointing out, will address in v2.
> 
> This happens a couple of times in these patches
Will fix it.
> 
> Is the intermediate struct needed, or could you embed the fields directly into
> rvu and use container_of to get from devlink to struct rvu? Even if needed,
> perhaps easier to embed the struct into rvu rather than a pointer.
Currently only 2 hardware blocks are supported NIX and NPA.
Error reporting for more HW blocks will be added, that’s the reason for the intermediate struct.
> 
> > +       }
> > +
> > +       err = devlink_register(dl, rvu->dev);
> > +       if (err) {
> > +               dev_err(rvu->dev, "devlink register failed with error %d\n", err);
> > +               devlink_free(dl);
> > +               return err;
> > +       }
> > +
> > +       rvu_dl->dl = dl;
> > +       rvu_dl->rvu = rvu;
> > +       rvu->rvu_dl = rvu_dl;
> > +       return 0;
> > +}
> > +
> > +void rvu_unregister_dl(struct rvu *rvu) {
> > +       struct rvu_devlink *rvu_dl = rvu->rvu_dl;
> > +       struct devlink *dl = rvu_dl->dl;
> > +
> > +       if (!dl)
> > +               return;
> > +
> > +       devlink_unregister(dl);
> > +       devlink_free(dl);
> 
> here too
Yes, will fix in v2.

Regards,
-George

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-11-03  7:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-02  5:06 [net-next PATCH 0/3] Add devlink and devlink health reporters to George Cherian
2020-11-02  5:06 ` [net-next PATCH 1/3] octeontx2-af: Add devlink suppoort to af driver George Cherian
2020-11-02 13:31   ` Willem de Bruijn
2020-11-02  5:06 ` [net-next PATCH 2/3] octeontx2-af: Add devlink health reporters for NPA George Cherian
2020-11-02 13:42   ` Willem de Bruijn
2020-11-03  7:26   ` kernel test robot
2020-11-02  5:06 ` [net-next PATCH 3/3] octeontx2-af: Add devlink health reporters for NIX George Cherian
2020-11-03  7:30   ` kernel test robot
2020-11-02 18:00 ` [net-next PATCH 0/3] Add devlink and devlink health reporters to Jakub Kicinski
2020-11-03  3:38 [net-next PATCH 1/3] octeontx2-af: Add devlink suppoort to af driver George Cherian

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).