Thread (21 messages) flat view 21 messages, 3 authors, 2018-01-12

Re: [bpf-next PATCH v2 1/7] bpf: refactor sockmap sample program update for arg parsing

From: John Fastabend <john.fastabend@gmail.com>
Date: 2018-01-12 03:55:09

On 01/11/2018 01:05 PM, Martin KaFai Lau wrote:
On Wed, Jan 10, 2018 at 10:39:04AM -0800, John Fastabend wrote:
quoted
sockmap sample program takes arguments from cmd line but it reads them
in using offsets into the array. Because we want to add more arguments
in the future lets do proper argument handling.

Also refactor code to pull apart sock init and ping/pong test. This
allows us to add new tests in the future.
[...]
quoted
 	/* Accept Connecrtions */
@@ -149,23 +177,32 @@ static int sockmap_test_sockets(int rate, int dot)
 		goto out;
 	}
 
-	max_fd = p2;
-	timeout.tv_sec = 10;
-	timeout.tv_usec = 0;
-
 	printf("connected sockets: c1 <-> p1, c2 <-> p2\n");
 	printf("cgroups binding: c1(%i) <-> s1(%i) - - - c2(%i) <-> s2(%i)\n",
 		c1, s1, c2, s2);
+out:
+	return err;
err is not updated with p1 and p2 in the case that accept() errors out.
OK will fix to propagate the error, nice spot. This will avoid
trying to run the test without connected sockets.

Thanks,
John
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help