mbox series

[net-next,v2,0/2] Introduce mbox tracepoints for Octeontx2

Message ID 1600707762-24422-1-git-send-email-sundeep.lkml@gmail.com
Headers show
Series Introduce mbox tracepoints for Octeontx2 | expand

Message

sundeep subbaraya Sept. 21, 2020, 5:02 p.m. UTC
From: Subbaraya Sundeep <sbhatta@marvell.com>

This patchset adds tracepoints support for mailbox.
In Octeontx2, PFs and VFs need to communicate with AF
for allocating and freeing resources. Once all the
configuration is done by AF for a PF/VF then packet I/O
can happen on PF/VF queues. When an interface
is brought up many mailbox messages are sent
to AF for initializing queues. Say a VF is brought up
then each message is sent to PF and PF forwards to
AF and response also traverses from AF to PF and then VF.
To aid debugging, tracepoints are added at places where
messages are allocated, sent and message interrupts.
Below is the trace of one of the messages from VF to AF
and AF response back to VF:

~ # echo 1 > /sys/kernel/tracing/events/rvu/enable
~ # ifconfig eth20 up
[  279.379559] eth20 NIC Link is UP 10000 Mbps Full duplex
~ # cat /sys/kernel/tracing/trace
# tracer: nop
#
# entries-in-buffer/entries-written: 880/880   #P:4
#
#                              _-----=> irqs-off
#                             / _----=> need-resched
#                            | / _---=> hardirq/softirq
#                            || / _--=> preempt-depth
#                            ||| /     delay
#           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
#              | |       |   ||||       |         |
        ifconfig-171   [000] ....   275.753345: otx2_msg_alloc: [0002:02:00.1] msg:(0x400) size:40

        ifconfig-171   [000] ...1   275.753347: otx2_msg_send: [0002:02:00.1] sent 1 msg(s) of size:48

          <idle>-0     [001] dNh1   275.753356: otx2_msg_interrupt: [0002:02:00.0] mbox interrupt VF(s) to PF (0x1)

    kworker/u9:1-90    [001] ...1   275.753364: otx2_msg_send: [0002:02:00.0] sent 1 msg(s) of size:48

    kworker/u9:1-90    [001] d.h.   275.753367: otx2_msg_interrupt: [0002:01:00.0] mbox interrupt PF(s) to AF (0x2)

    kworker/u9:2-167   [002] ....   275.753535: otx2_msg_process: [0002:01:00.0] msg:(0x400) error:0

    kworker/u9:2-167   [002] ...1   275.753537: otx2_msg_send: [0002:01:00.0] sent 1 msg(s) of size:32

          <idle>-0     [003] d.h1   275.753543: otx2_msg_interrupt: [0002:02:00.0] mbox interrupt AF to PF (0x1)

          <idle>-0     [001] d.h2   275.754376: otx2_msg_interrupt: [0002:02:00.1] mbox interrupt PF to VF (0x1)


v2 changes:
 Removed otx2_msg_err tracepoint since it is similar to devlink_hwerr
 and it will be used instead when devlink supported is added.

Subbaraya Sundeep (2):
  octeontx2-af: Introduce tracepoints for mailbox
  octeontx2-pf: Add tracepoints for PF/VF mailbox

 drivers/net/ethernet/marvell/octeontx2/af/Makefile |   3 +-
 drivers/net/ethernet/marvell/octeontx2/af/mbox.c   |  11 ++-
 drivers/net/ethernet/marvell/octeontx2/af/rvu.c    |   7 ++
 .../net/ethernet/marvell/octeontx2/af/rvu_cgx.c    |   2 +
 .../net/ethernet/marvell/octeontx2/af/rvu_trace.c  |  14 +++
 .../net/ethernet/marvell/octeontx2/af/rvu_trace.h  | 103 +++++++++++++++++++++
 .../ethernet/marvell/octeontx2/nic/otx2_common.h   |   2 +
 .../net/ethernet/marvell/octeontx2/nic/otx2_pf.c   |   6 ++
 .../net/ethernet/marvell/octeontx2/nic/otx2_vf.c   |   2 +
 9 files changed, 148 insertions(+), 2 deletions(-)
 create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.c
 create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.h

Comments

Jakub Kicinski Sept. 21, 2020, 11:18 p.m. UTC | #1
On Mon, 21 Sep 2020 22:32:41 +0530 sundeep.lkml@gmail.com wrote:
> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.c
> new file mode 100644
> index 0000000..f0b3f17
> --- /dev/null
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.c
> @@ -0,0 +1,14 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/* Marvell OcteonTx2 RVU Admin Function driver tracepoints
> + *
> + * Copyright (C) 2020 Marvell International Ltd.
> + */
> +
> +#define CREATE_TRACE_POINTS
> +#include "rvu_trace.h"
> +
> +EXPORT_TRACEPOINT_SYMBOL(otx2_msg_alloc);
> +EXPORT_TRACEPOINT_SYMBOL(otx2_msg_send);
> +EXPORT_TRACEPOINT_SYMBOL(otx2_msg_check);

I don't think you need to export send and check.

They are only used in the mbox module where they are defined.

Otherwise looks acceptable to me.

Please make sure you CC everyone who gave you feedback.
sundeep subbaraya Sept. 22, 2020, 2:53 a.m. UTC | #2
Hi Jakub,

On Tue, Sep 22, 2020 at 4:48 AM Jakub Kicinski <kuba@kernel.org> wrote:
>

> On Mon, 21 Sep 2020 22:32:41 +0530 sundeep.lkml@gmail.com wrote:

> > diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.c

> > new file mode 100644

> > index 0000000..f0b3f17

> > --- /dev/null

> > +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.c

> > @@ -0,0 +1,14 @@

> > +// SPDX-License-Identifier: GPL-2.0

> > +/* Marvell OcteonTx2 RVU Admin Function driver tracepoints

> > + *

> > + * Copyright (C) 2020 Marvell International Ltd.

> > + */

> > +

> > +#define CREATE_TRACE_POINTS

> > +#include "rvu_trace.h"

> > +

> > +EXPORT_TRACEPOINT_SYMBOL(otx2_msg_alloc);

> > +EXPORT_TRACEPOINT_SYMBOL(otx2_msg_send);

> > +EXPORT_TRACEPOINT_SYMBOL(otx2_msg_check);

>

> I don't think you need to export send and check.

>

> They are only used in the mbox module where they are defined.

>

Agreed. I will remove those and send the next spin.

> Otherwise looks acceptable to me.

>

Thanks

> Please make sure you CC everyone who gave you feedback.

Sure.

Sundeep