Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <dan.carpenter@linaro.org>
Cc: <kuniyu@amazon.com>, <linux-kselftest@vger.kernel.org>,
	<netdev@vger.kernel.org>
Subject: Re: [bug report] selftest: Add test for SO_INCOMING_CPU.
Date: Mon, 31 Jul 2023 10:41:43 -0700	[thread overview]
Message-ID: <20230731174143.99810-1-kuniyu@amazon.com> (raw)
In-Reply-To: <fe376760-33b6-4fc9-88e8-178e809af1ac@moroto.mountain>

Hi Dan,

From:   Dan Carpenter <dan.carpenter@linaro.org>
Date:   Mon, 31 Jul 2023 17:18:37 +0300
> Hello Kuniyuki Iwashima,
> 
> The patch 6df96146b202: "selftest: Add test for SO_INCOMING_CPU."
> from Oct 21, 2022 (linux-next), leads to the following Smatch static
> checker warning:
> 
> 	./tools/testing/selftests/net/so_incoming_cpu.c:163 create_clients()
> 	error: uninitialized symbol 'ret'.
> 
> ./tools/testing/selftests/net/so_incoming_cpu.c
>     146 void create_clients(struct __test_metadata *_metadata,
>     147                     FIXTURE_DATA(so_incoming_cpu) *self)
>     148 {
>     149         cpu_set_t cpu_set;
>     150         int i, j, fd, ret;
>     151 
>     152         for (i = 0; i < NR_SERVER; i++) {
>     153                 CPU_ZERO(&cpu_set);
>     154 
>     155                 CPU_SET(i, &cpu_set);
>     156                 ASSERT_EQ(CPU_COUNT(&cpu_set), 1);
>     157                 ASSERT_NE(CPU_ISSET(i, &cpu_set), 0);
>     158 
>     159                 /* Make sure SYN will be processed on the i-th CPU
>     160                  * and finally distributed to the i-th listener.
>     161                  */
>     162                 sched_setaffinity(0, sizeof(cpu_set), &cpu_set);
> 
> Presumabley ret = sched_setaffinity() was intended.

Right, thanks for reporting.
I'll post a patch.

Thanks!


> 
> --> 163                 ASSERT_EQ(ret, 0);
>     164 
>     165                 for (j = 0; j < CLIENT_PER_SERVER; j++) {
>     166                         fd  = socket(AF_INET, SOCK_STREAM, 0);
>     167                         ASSERT_NE(fd, -1);
>     168 
>     169                         ret = connect(fd, &self->addr, self->addrlen);
>     170                         ASSERT_EQ(ret, 0);
>     171 
>     172                         close(fd);
>     173                 }
>     174         }
>     175 }
> 
> regards,
> dan carpenter

      reply	other threads:[~2023-07-31 17:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-31 14:18 [bug report] selftest: Add test for SO_INCOMING_CPU Dan Carpenter
2023-07-31 17:41 ` Kuniyuki Iwashima [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230731174143.99810-1-kuniyu@amazon.com \
    --to=kuniyu@amazon.com \
    --cc=dan.carpenter@linaro.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox