提交 b5d83fec 编写于 作者: J John Fastabend 提交者: Daniel Borkmann

bpf: sockmap test remove shutdown() calls

Currently, we do a shutdown(sk, SHUT_RDWR) on both peer sockets and
a shutdown on the sender as well. However, this is incorrect and can
occasionally cause issues if you happen to have bad timing. First
peer1 or peer2 may still be in use depending on the test and timing.
Second we really should only be closing the read side and/or write
side depending on if the test is receiving or sending.

But, really none of this is needed just remove the shutdown calls.
Signed-off-by: NJohn Fastabend <john.fastabend@gmail.com>
Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
上级 efbaec89
...@@ -469,8 +469,6 @@ static int sendmsg_test(struct sockmap_options *opt) ...@@ -469,8 +469,6 @@ static int sendmsg_test(struct sockmap_options *opt)
fprintf(stderr, fprintf(stderr,
"msg_loop_rx: iov_count %i iov_buf %i cnt %i err %i\n", "msg_loop_rx: iov_count %i iov_buf %i cnt %i err %i\n",
iov_count, iov_buf, cnt, err); iov_count, iov_buf, cnt, err);
shutdown(p2, SHUT_RDWR);
shutdown(p1, SHUT_RDWR);
if (s.end.tv_sec - s.start.tv_sec) { if (s.end.tv_sec - s.start.tv_sec) {
sent_Bps = sentBps(s); sent_Bps = sentBps(s);
recvd_Bps = recvdBps(s); recvd_Bps = recvdBps(s);
...@@ -500,7 +498,6 @@ static int sendmsg_test(struct sockmap_options *opt) ...@@ -500,7 +498,6 @@ static int sendmsg_test(struct sockmap_options *opt)
fprintf(stderr, fprintf(stderr,
"msg_loop_tx: iov_count %i iov_buf %i cnt %i err %i\n", "msg_loop_tx: iov_count %i iov_buf %i cnt %i err %i\n",
iov_count, iov_buf, cnt, err); iov_count, iov_buf, cnt, err);
shutdown(c1, SHUT_RDWR);
if (s.end.tv_sec - s.start.tv_sec) { if (s.end.tv_sec - s.start.tv_sec) {
sent_Bps = sentBps(s); sent_Bps = sentBps(s);
recvd_Bps = recvdBps(s); recvd_Bps = recvdBps(s);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册