diff options
| author | Sowmini Varadhan <sowmini.varadhan@oracle.com> | 2016-02-02 13:41:56 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2016-02-07 14:13:06 -0500 |
| commit | 365a10289fccbf769ad8b172c30716fac50fa278 (patch) | |
| tree | 0eb95a14efde8576eec627b868be93e87802ae59 /drivers/net/ethernet/sun | |
| parent | 46fcc6ef9d39eb7b1becaa5ef5cba64d230f7c3f (diff) | |
sunvnet: perf tracepoint invocations to trace LDC state machine
Use sunvnet perf trace macros to monitor LDC message exchange state.
Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sun')
| -rw-r--r-- | drivers/net/ethernet/sun/sunvnet.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/drivers/net/ethernet/sun/sunvnet.c b/drivers/net/ethernet/sun/sunvnet.c index 23fa29877f5b..942a95db2061 100644 --- a/drivers/net/ethernet/sun/sunvnet.c +++ b/drivers/net/ethernet/sun/sunvnet.c | |||
| @@ -17,6 +17,8 @@ | |||
| 17 | #include <linux/mutex.h> | 17 | #include <linux/mutex.h> |
| 18 | #include <linux/highmem.h> | 18 | #include <linux/highmem.h> |
| 19 | #include <linux/if_vlan.h> | 19 | #include <linux/if_vlan.h> |
| 20 | #define CREATE_TRACE_POINTS | ||
| 21 | #include <trace/events/sunvnet.h> | ||
| 20 | 22 | ||
| 21 | #if IS_ENABLED(CONFIG_IPV6) | 23 | #if IS_ENABLED(CONFIG_IPV6) |
| 22 | #include <linux/icmpv6.h> | 24 | #include <linux/icmpv6.h> |
| @@ -540,6 +542,8 @@ static int vnet_walk_rx_one(struct vnet_port *port, | |||
| 540 | err = vnet_rx_one(port, desc); | 542 | err = vnet_rx_one(port, desc); |
| 541 | if (err == -ECONNRESET) | 543 | if (err == -ECONNRESET) |
| 542 | return err; | 544 | return err; |
| 545 | trace_vnet_rx_one(port->vio._local_sid, port->vio._peer_sid, | ||
| 546 | index, desc->hdr.ack); | ||
| 543 | desc->hdr.state = VIO_DESC_DONE; | 547 | desc->hdr.state = VIO_DESC_DONE; |
| 544 | err = put_rx_desc(port, dr, desc, index); | 548 | err = put_rx_desc(port, dr, desc, index); |
| 545 | if (err < 0) | 549 | if (err < 0) |
| @@ -587,9 +591,15 @@ static int vnet_walk_rx(struct vnet_port *port, struct vio_dring_state *dr, | |||
| 587 | ack_start = ack_end = vio_dring_prev(dr, start); | 591 | ack_start = ack_end = vio_dring_prev(dr, start); |
| 588 | if (send_ack) { | 592 | if (send_ack) { |
| 589 | port->napi_resume = false; | 593 | port->napi_resume = false; |
| 594 | trace_vnet_tx_send_stopped_ack(port->vio._local_sid, | ||
| 595 | port->vio._peer_sid, | ||
| 596 | ack_end, *npkts); | ||
| 590 | return vnet_send_ack(port, dr, ack_start, ack_end, | 597 | return vnet_send_ack(port, dr, ack_start, ack_end, |
| 591 | VIO_DRING_STOPPED); | 598 | VIO_DRING_STOPPED); |
| 592 | } else { | 599 | } else { |
| 600 | trace_vnet_tx_defer_stopped_ack(port->vio._local_sid, | ||
| 601 | port->vio._peer_sid, | ||
| 602 | ack_end, *npkts); | ||
| 593 | port->napi_resume = true; | 603 | port->napi_resume = true; |
| 594 | port->napi_stop_idx = ack_end; | 604 | port->napi_stop_idx = ack_end; |
| 595 | return 1; | 605 | return 1; |
| @@ -663,6 +673,8 @@ static int vnet_ack(struct vnet_port *port, void *msgbuf) | |||
| 663 | /* sync for race conditions with vnet_start_xmit() and tell xmit it | 673 | /* sync for race conditions with vnet_start_xmit() and tell xmit it |
| 664 | * is time to send a trigger. | 674 | * is time to send a trigger. |
| 665 | */ | 675 | */ |
| 676 | trace_vnet_rx_stopped_ack(port->vio._local_sid, | ||
| 677 | port->vio._peer_sid, end); | ||
| 666 | dr->cons = vio_dring_next(dr, end); | 678 | dr->cons = vio_dring_next(dr, end); |
| 667 | desc = vio_dring_entry(dr, dr->cons); | 679 | desc = vio_dring_entry(dr, dr->cons); |
| 668 | if (desc->hdr.state == VIO_DESC_READY && !port->start_cons) { | 680 | 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 | int retries = 0; | 898 | int retries = 0; |
| 887 | 899 | ||
| 888 | if (port->stop_rx) { | 900 | if (port->stop_rx) { |
| 901 | trace_vnet_tx_pending_stopped_ack(port->vio._local_sid, | ||
| 902 | port->vio._peer_sid, | ||
| 903 | port->stop_rx_idx, -1); | ||
| 889 | err = vnet_send_ack(port, | 904 | err = vnet_send_ack(port, |
| 890 | &port->vio.drings[VIO_DRIVER_RX_RING], | 905 | &port->vio.drings[VIO_DRIVER_RX_RING], |
| 891 | port->stop_rx_idx, -1, | 906 | port->stop_rx_idx, -1, |
| @@ -908,6 +923,8 @@ static int __vnet_tx_trigger(struct vnet_port *port, u32 start) | |||
| 908 | if (retries++ > VNET_MAX_RETRIES) | 923 | if (retries++ > VNET_MAX_RETRIES) |
| 909 | break; | 924 | break; |
| 910 | } while (err == -EAGAIN); | 925 | } while (err == -EAGAIN); |
| 926 | trace_vnet_tx_trigger(port->vio._local_sid, | ||
| 927 | port->vio._peer_sid, start, err); | ||
| 911 | 928 | ||
| 912 | return err; | 929 | return err; |
| 913 | } | 930 | } |
| @@ -1414,8 +1431,11 @@ static int vnet_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 1414 | * producer to consumer announcement that work is available to the | 1431 | * producer to consumer announcement that work is available to the |
| 1415 | * consumer | 1432 | * consumer |
| 1416 | */ | 1433 | */ |
| 1417 | if (!port->start_cons) | 1434 | if (!port->start_cons) { /* previous trigger suffices */ |
| 1418 | goto ldc_start_done; /* previous trigger suffices */ | 1435 | trace_vnet_skip_tx_trigger(port->vio._local_sid, |
| 1436 | port->vio._peer_sid, dr->cons); | ||
| 1437 | goto ldc_start_done; | ||
| 1438 | } | ||
| 1419 | 1439 | ||
| 1420 | err = __vnet_tx_trigger(port, dr->cons); | 1440 | err = __vnet_tx_trigger(port, dr->cons); |
| 1421 | if (unlikely(err < 0)) { | 1441 | if (unlikely(err < 0)) { |
