On 10/17/13 3:23 AM, Simon Horman wrote:
On Wed, Oct 16, 2013 at 02:32:55PM +0300, Lori Jakab wrote:
On 10/16/13 1:17 PM, Simon Horman wrote:
This alters the way rx packets are accounted for by
counting them when they are processed by netdev_dummy_rx_recv(),
which seems to be a common path used by all received packets.

Previously accounting was done earlier, in netdev_dummy_receive(),
however this does not appear to count packets that are received via
a socket.

This resolves packet counting errors reported by the following
OFtest tests:

        port_stats.MultiFlowStats
        port_stats.SingleFlowStats
I confirm that the above OFtests are passed on my (similar) setup as
well with the below patch.

        pktact.WildcardPriorityWithDelete
        pktact.WildcardPriority
These tests didn't fail on my setup, but the following two which
did, are now "ok":
         counters.RxBytPerPort
         counters.RxPktPerPort
Interesting. Could you let me know which versions (git checkouts?)
of OFtest and OVS you are using?

I was using the tips of the master branches at the time of checkout, specifically:

OVS:    48a5f33 OPENFLOW-1.1+: note on table-miss
OFtest: 9679581 Merge into master from pull request #75: group table management tests (https://github.com/floodlight/oftest/pull/75)

OVS is same as you, OFtest not sure, since I think you pasted your patch commit in the email you sent in reply to Ben. BTW, 9679581 is still the tip of the master branch of OFtest.

I just updated OVS to "307464a ofproto-dpif-monitor: Use heap to order the mport wakeup time." and I still get 7 failures:

FAIL: load.FlowRemovedLoad
FAIL: pktact.DirectLlcPackets
FAIL: flow_expire.FlowExpire
FAIL: detailed_contr_sw_messages.DeleteEmerFlow
FAIL: message_types.QueueConfigReply
FAIL: message_types.ErrorMsg
FAIL: flow_stats.SingleFlowStats
FAILED (failures=7)

-Lori


Signed-off-by: Simon Horman <ho...@verge.net.au>
---
  lib/netdev-dummy.c | 9 +++++++--
  1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c
index e40c099..061ad0c 100644
--- a/lib/netdev-dummy.c
+++ b/lib/netdev-dummy.c
@@ -468,8 +468,15 @@ netdev_dummy_rx_recv(struct netdev_rx *rx_, void *buffer, 
size_t size)
      }
      if (packet->size <= size) {
+        struct netdev_dummy *dummy_dev = netdev_dummy_cast(netdev);
+
          memcpy(buffer, packet->data, packet->size);
          retval = packet->size;
+        ovs_mutex_lock(&dummy_dev->mutex);
+        dummy_dev->stats.rx_packets++;
+        dummy_dev->stats.rx_bytes += packet->size;
+        ovs_mutex_unlock(&dummy_dev->mutex);
+
      } else {
          retval = -EMSGSIZE;
      }
@@ -870,8 +877,6 @@ netdev_dummy_receive(struct unixctl_conn *conn,
          }
          ovs_mutex_lock(&dummy_dev->mutex);
-        dummy_dev->stats.rx_packets++;
-        dummy_dev->stats.rx_bytes += packet->size;
          netdev_dummy_queue_packet(dummy_dev, packet);
          ovs_mutex_unlock(&dummy_dev->mutex);
      }

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to