From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Fastabend Subject: Re: [bpf-next PATCH v2 1/7] bpf: refactor sockmap sample program update for arg parsing Date: Thu, 11 Jan 2018 19:54:56 -0800 Message-ID: <9e182a59-9f3f-62e4-902d-98244edd0f82@gmail.com> References: <20180110183600.5930.68261.stgit@john-Precision-Tower-5810> <20180110183904.5930.42185.stgit@john-Precision-Tower-5810> <20180111210517.mv43lxgzildejw3y@kafai-mbp.dhcp.thefacebook.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: borkmann@iogearbox.net, ast@kernel.org, netdev@vger.kernel.org To: Martin KaFai Lau Return-path: Received: from mail-pg0-f51.google.com ([74.125.83.51]:46986 "EHLO mail-pg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932860AbeALDzJ (ORCPT ); Thu, 11 Jan 2018 22:55:09 -0500 Received: by mail-pg0-f51.google.com with SMTP id s9so1945049pgq.13 for ; Thu, 11 Jan 2018 19:55:09 -0800 (PST) In-Reply-To: <20180111210517.mv43lxgzildejw3y@kafai-mbp.dhcp.thefacebook.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 01/11/2018 01:05 PM, Martin KaFai Lau wrote: > On Wed, Jan 10, 2018 at 10:39:04AM -0800, John Fastabend wrote: >> 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. >> [...] >> /* 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