Commit 365a1028 authored by Sowmini Varadhan's avatar Sowmini Varadhan Committed by David S. Miller

sunvnet: perf tracepoint invocations to trace LDC state machine

Use sunvnet perf trace macros to monitor LDC message exchange state.
Signed-off-by: default avatarSowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 46fcc6ef
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/highmem.h> #include <linux/highmem.h>
#include <linux/if_vlan.h> #include <linux/if_vlan.h>
#define CREATE_TRACE_POINTS
#include <trace/events/sunvnet.h>
#if IS_ENABLED(CONFIG_IPV6) #if IS_ENABLED(CONFIG_IPV6)
#include <linux/icmpv6.h> #include <linux/icmpv6.h>
...@@ -540,6 +542,8 @@ static int vnet_walk_rx_one(struct vnet_port *port, ...@@ -540,6 +542,8 @@ static int vnet_walk_rx_one(struct vnet_port *port,
err = vnet_rx_one(port, desc); err = vnet_rx_one(port, desc);
if (err == -ECONNRESET) if (err == -ECONNRESET)
return err; return err;
trace_vnet_rx_one(port->vio._local_sid, port->vio._peer_sid,
index, desc->hdr.ack);
desc->hdr.state = VIO_DESC_DONE; desc->hdr.state = VIO_DESC_DONE;
err = put_rx_desc(port, dr, desc, index); err = put_rx_desc(port, dr, desc, index);
if (err < 0) if (err < 0)
...@@ -587,9 +591,15 @@ static int vnet_walk_rx(struct vnet_port *port, struct vio_dring_state *dr, ...@@ -587,9 +591,15 @@ static int vnet_walk_rx(struct vnet_port *port, struct vio_dring_state *dr,
ack_start = ack_end = vio_dring_prev(dr, start); ack_start = ack_end = vio_dring_prev(dr, start);
if (send_ack) { if (send_ack) {
port->napi_resume = false; port->napi_resume = false;
trace_vnet_tx_send_stopped_ack(port->vio._local_sid,
port->vio._peer_sid,
ack_end, *npkts);
return vnet_send_ack(port, dr, ack_start, ack_end, return vnet_send_ack(port, dr, ack_start, ack_end,
VIO_DRING_STOPPED); VIO_DRING_STOPPED);
} else { } else {
trace_vnet_tx_defer_stopped_ack(port->vio._local_sid,
port->vio._peer_sid,
ack_end, *npkts);
port->napi_resume = true; port->napi_resume = true;
port->napi_stop_idx = ack_end; port->napi_stop_idx = ack_end;
return 1; return 1;
...@@ -663,6 +673,8 @@ static int vnet_ack(struct vnet_port *port, void *msgbuf) ...@@ -663,6 +673,8 @@ static int vnet_ack(struct vnet_port *port, void *msgbuf)
/* sync for race conditions with vnet_start_xmit() and tell xmit it /* sync for race conditions with vnet_start_xmit() and tell xmit it
* is time to send a trigger. * is time to send a trigger.
*/ */
trace_vnet_rx_stopped_ack(port->vio._local_sid,
port->vio._peer_sid, end);
dr->cons = vio_dring_next(dr, end); dr->cons = vio_dring_next(dr, end);
desc = vio_dring_entry(dr, dr->cons); desc = vio_dring_entry(dr, dr->cons);
if (desc->hdr.state == VIO_DESC_READY && !port->start_cons) { if (desc->hdr.state == VIO_DESC_READY && !port->start_cons) {
...@@ -886,6 +898,9 @@ static int __vnet_tx_trigger(struct vnet_port *port, u32 start) ...@@ -886,6 +898,9 @@ static int __vnet_tx_trigger(struct vnet_port *port, u32 start)
int retries = 0; int retries = 0;
if (port->stop_rx) { if (port->stop_rx) {
trace_vnet_tx_pending_stopped_ack(port->vio._local_sid,
port->vio._peer_sid,
port->stop_rx_idx, -1);
err = vnet_send_ack(port, err = vnet_send_ack(port,
&port->vio.drings[VIO_DRIVER_RX_RING], &port->vio.drings[VIO_DRIVER_RX_RING],
port->stop_rx_idx, -1, port->stop_rx_idx, -1,
...@@ -908,6 +923,8 @@ static int __vnet_tx_trigger(struct vnet_port *port, u32 start) ...@@ -908,6 +923,8 @@ static int __vnet_tx_trigger(struct vnet_port *port, u32 start)
if (retries++ > VNET_MAX_RETRIES) if (retries++ > VNET_MAX_RETRIES)
break; break;
} while (err == -EAGAIN); } while (err == -EAGAIN);
trace_vnet_tx_trigger(port->vio._local_sid,
port->vio._peer_sid, start, err);
return err; return err;
} }
...@@ -1414,8 +1431,11 @@ static int vnet_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -1414,8 +1431,11 @@ static int vnet_start_xmit(struct sk_buff *skb, struct net_device *dev)
* producer to consumer announcement that work is available to the * producer to consumer announcement that work is available to the
* consumer * consumer
*/ */
if (!port->start_cons) if (!port->start_cons) { /* previous trigger suffices */
goto ldc_start_done; /* previous trigger suffices */ trace_vnet_skip_tx_trigger(port->vio._local_sid,
port->vio._peer_sid, dr->cons);
goto ldc_start_done;
}
err = __vnet_tx_trigger(port, dr->cons); err = __vnet_tx_trigger(port, dr->cons);
if (unlikely(err < 0)) { if (unlikely(err < 0)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment