Re: [ovs-dev] [PATCH v3] Detailed packet drop statistics per dpdk and vhostuser ports

2019-07-15 Thread 0-day Robot
Bleep bloop.  Greetings Sriram Vatala via dev, I am a robot and I have tried 
out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
WARNING: Line is 138 characters long (recommended limit is 79)
#344 FILE: utilities/bugtool/plugins/network-status/openvswitch.xml:37:
/usr/share/openvswitch/scripts/ovs-bugtool-get-iface-stats

Lines checked: 367, Warnings: 1, Errors: 0


build:
reading sources... [ 88%] topics/ovsdb-replication
reading sources... [ 88%] topics/porting
reading sources... [ 89%] topics/role-based-access-control
reading sources... [ 90%] topics/testing
reading sources... [ 91%] topics/tracing
reading sources... [ 92%] topics/windows
reading sources... [ 93%] tutorials/faucet
reading sources... [ 94%] tutorials/index
reading sources... [ 94%] tutorials/ipsec
reading sources... [ 95%] tutorials/ovn-ipsec
reading sources... [ 96%] tutorials/ovn-openstack
reading sources... [ 97%] tutorials/ovn-rbac
reading sources... [ 98%] tutorials/ovn-sandbox
reading sources... [ 99%] tutorials/ovs-advanced
reading sources... [100%] tutorials/ovs-conntrack


Warning, treated as error:
/var/lib/jenkins/jobs/upstream_build_from_pw/workspace/Documentation/topics/dpdk/bridge.rst:85:
 WARNING: Definition list ends without a blank line; unexpected unindent.

make[2]: *** [docs-check] Error 1
make[2]: Leaving directory 
`/var/lib/jenkins/jobs/upstream_build_from_pw/workspace'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory 
`/var/lib/jenkins/jobs/upstream_build_from_pw/workspace'
make: *** [all] Error 2


Please check this out.  If you feel there has been an error, please email 
acon...@bytheb.org

Thanks,
0-day Robot
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v3] Detailed packet drop statistics per dpdk and vhostuser ports

2019-07-15 Thread Sriram Vatala via dev
OVS may be unable to transmit packets for multiple reasons and
today there is a single counter to track packets dropped due to
any of those reasons. The most common reason is that a VM is
unable to read packets fast enough causing the vhostuser port
transmit queue on the OVS side to become full. This manifests
as a problem with VNFs not receiving all packets. Having a
separate drop counter to track packets dropped because the
transmit queue is full will clearly indicate that the problem
is on the VM side and not in OVS. Similarly maintaining separate
counters for all possible drops helps in indicating sensible
cause for packet drops.

This patch adds counters to track packets dropped due to all
possible reasons and these counters are displayed along with
other stats in "ovs-vsctl get interface  statistics"
command. The detailed stats will be available for both dpdk and
vhostuser ports.

Following are the details of the new counters :

tx_failed_drops : Sometimes DPDK physical/vHost port transmit
API fails to send all/some packets. These untransmited packets
are dropped.The most likely reason for this to happen is
because of transmit queue overrun. Besides transmit queue
overrun, there are other unlikely reasons such as invalid
queue id etc.

tx_mtu_exceeded_drops : These are the packets dropped due
to MTU mismatch (i.e Pkt len > Max Dev MTU).

tx_qos_drops/rx_qos_drops : These are the packets dropped due
to transmission/reception rate exceeding the configured
Egress/Ingress policer rate on the interface.

Signed-off-by: Sriram Vatala 
---
 Documentation/topics/dpdk/bridge.rst   | 25 ++
 include/openvswitch/netdev.h   |  9 
 lib/netdev-dpdk.c  | 56 ++
 utilities/bugtool/automake.mk  |  3 +-
 utilities/bugtool/ovs-bugtool-get-iface-stats  | 25 ++
 .../bugtool/plugins/network-status/openvswitch.xml |  1 +
 vswitchd/bridge.c  |  6 ++-
 7 files changed, 115 insertions(+), 10 deletions(-)
 create mode 100755 utilities/bugtool/ovs-bugtool-get-iface-stats

diff --git a/Documentation/topics/dpdk/bridge.rst 
b/Documentation/topics/dpdk/bridge.rst
index a3ed926..df87c7a 100644
--- a/Documentation/topics/dpdk/bridge.rst
+++ b/Documentation/topics/dpdk/bridge.rst
@@ -74,6 +74,31 @@ OpenFlow14`` option::
 
 $ ovs-ofctl -O OpenFlow14 dump-ports br0
 
+Detail statistics counters for transmit dropped packets and receive
+dropped packets are implemented and supported only for DPDK physical
+and vHost ports.
+
+Following are the details of the new counters :
+
+tx_failure_drops : Sometimes DPDK transmit API for physical/vHost ports
+   may fail to transmit all/some packets in its packet
+buffer which is passed as input argument to the dpdk xmit API. These
+untransmitted packets are dropped. The most likely reason for this to
+happens is when the transmit queue is full or has been filled up.
+There are other unlikely reasons such as invalid Tx queue id etc.
+
+tx_mtu_exceeded_drops : These are the packets dropped due to MTU mismatch
+(i.e Pkt len > Max Dev MTU).
+
+tx_qos_drops/rx_qos_drops : These are the packets dropped due to
+transmission/reception rate exceeding the
+configured Egress/Ingress policer rate on the interface.
+
+These statistic counters can be viewed with the following commands:
+
+$ ovs-vsctl get interface  statistics
+$ ovs-vsctl list interface
+
 EMC Insertion Probability
 -
 
diff --git a/include/openvswitch/netdev.h b/include/openvswitch/netdev.h
index 0c10f7b..7851736 100644
--- a/include/openvswitch/netdev.h
+++ b/include/openvswitch/netdev.h
@@ -61,6 +61,15 @@ struct netdev_stats {
 uint64_t tx_heartbeat_errors;
 uint64_t tx_window_errors;
 
+/* Detailed receive drops. */
+uint64_t rx_qos_drops;  /* rx rate exceeded conf'd qos rate */
+
+/* Detailed transmit drops. */
+uint64_t tx_failure_drops;  /* Dpdk tx failure, probably tx
+ * queue is full. */
+uint64_t tx_qos_drops;  /* tx rate exceeded conf'd qos rate */
+uint64_t tx_mtu_drops;  /* tx pkt len exceeded max dev MTU */
+
 /* Extended statistics based on RFC2819. */
 uint64_t rx_1_to_64_packets;
 uint64_t rx_65_to_127_packets;
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 4805783..3f22701 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -68,6 +68,7 @@
 #include "uuid.h"
 
 enum {VIRTIO_RXQ, VIRTIO_TXQ, VIRTIO_QNUM};
+enum {QOS_DROPS, MTU_DROPS, TX_FAILURE_DROPS, MAX_DROPS};
 
 VLOG_DEFINE_THIS_MODULE(netdev_dpdk);
 static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20);
@@ -2170,6 +2171,7 @@ netdev_dpdk_vhost_update_rx_counters(struct netdev_stats 
*stats,
 
 stats->rx_packets += count;
 stats->rx_dropped += dropped;
+stats->rx_qos_drops += dropped;
 for (i = 0; i