On Fri, Dec 06, 2019 at 02:09:24AM -0500, [email protected] wrote:
> From: Yi Yang <[email protected]>
> 
> Current netdev_linux_rxq_recv_tap and netdev_linux_rxq_recv_sock
> just receive single packet, that is very inefficient, per my test
> case which adds two tap ports or veth ports into OVS bridge
> (datapath_type=netdev) and use iperf3 to do performance test
> between two ports (they are set into different network name space).

Thanks for the patch!  This is an impressive performance improvement!

Each call to netdev_linux_batch_rxq_recv_sock() now calls malloc() 32
times.  This is expensive if only a few packets (or none) are received.
Maybe it doesn't matter, but I wonder whether it affects performance.

I think that no packets are freed on error.  Fix:

diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index 9cb45d5c7d29..3414a6495ced 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -1198,6 +1198,7 @@ netdev_linux_batch_rxq_recv_sock(int fd, int mtu,
     if (retval < 0) {
         /* Save -errno to retval temporarily */
         retval = -errno;
+        i = 0;
         goto free_buffers;
     }
 

To get sparse to work, one must fold in the following:

diff --git a/include/sparse/sys/socket.h b/include/sparse/sys/socket.h
index 4178f57e2bda..e954ade714b5 100644
--- a/include/sparse/sys/socket.h
+++ b/include/sparse/sys/socket.h
@@ -27,6 +27,7 @@
 
 typedef unsigned short int sa_family_t;
 typedef __socklen_t socklen_t;
+struct timespec;
 
 struct sockaddr {
     sa_family_t sa_family;
@@ -171,4 +172,7 @@ int sockatmark(int);
 int socket(int, int, int);
 int socketpair(int, int, int, int[2]);
 
+int sendmmsg(int, struct mmsghdr *, unsigned int, int);
+int recvmmsg(int, struct mmsghdr *, unsigned int, int, struct timespec *);
+
 #endif /* <sys/socket.h> for sparse */
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to