From patchwork Fri May 20 06:38:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yun Lu X-Patchwork-Id: 12856353 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6A97C433FE for ; Fri, 20 May 2022 06:55:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346089AbiETGzk (ORCPT ); Fri, 20 May 2022 02:55:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346102AbiETGzf (ORCPT ); Fri, 20 May 2022 02:55:35 -0400 X-Greylist: delayed 910 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 19 May 2022 23:55:33 PDT Received: from mail-m971.mail.163.com (mail-m971.mail.163.com [123.126.97.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C53A114FC9F; Thu, 19 May 2022 23:55:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=Mff2d v08+/B+/bGWeUwW9MgjlQSqdbbmS0SIwTwzpAA=; b=oiRmqPUIAMx9gAlb4+4UB ItCLlwFGKqM+AbF6FLh7WkR9YGYjtow+dT4ZYZZJ8adHQR1ZppNYnAGT/2EPaxLi ZxcT5+89Di0VoUoA0qVVltLuDWd8kL3L6Oi3CGYWtC4CmbM8Ubx+aGOpcKpnnnX3 K/BDfJLu/fF7bA2edpKYrE= Received: from localhost.localdomain (unknown [116.128.244.169]) by smtp1 (Coremail) with SMTP id GdxpCgDn24XFN4diP0VpDQ--.42783S2; Fri, 20 May 2022 14:40:08 +0800 (CST) From: Yun Lu To: willemb@google.com, davem@davemloft.net, edumazet@google.com Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH] selftests/net: enable lo.accept_local in psock_snd test Date: Fri, 20 May 2022 14:38:35 +0800 Message-Id: <20220520063835.866445-1-luyun_611@163.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CM-TRANSID: GdxpCgDn24XFN4diP0VpDQ--.42783S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7Jw17GF4rKr18ZFyUXF1fJFb_yoWktrcEqa 1Yqrn7Zr4UZFnxtF4xuw4UZr4Fka13WrWDGrsxJF17tw4xWa1rJFWkZws3AF1kWFWYkFW2 va1fJryYq3Z29jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUUZmR7UUUUU== X-Originating-IP: [116.128.244.169] X-CM-SenderInfo: pox130jbwriqqrwthudrp/1tbi6wIHzlXl1m+fkAAAsm Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: luyun The psock_snd test sends and recievs packets over loopback, but the parameter lo.accept_local is disabled by default, this test will fail with Resource temporarily unavailable: sudo ./psock_snd.sh dgram tx: 128 rx: 142 ./psock_snd: recv: Resource temporarily unavailable So enable the parameter lo.accept_local in psock_snd test. Signed-off-by: luyun Reviewed-by: Jackie Liu --- tools/testing/selftests/net/psock_snd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/net/psock_snd.c b/tools/testing/selftests/net/psock_snd.c index 7d15e10a9fb6..edf1e6f80d41 100644 --- a/tools/testing/selftests/net/psock_snd.c +++ b/tools/testing/selftests/net/psock_snd.c @@ -389,6 +389,8 @@ int main(int argc, char **argv) error(1, errno, "ip link set mtu"); if (system("ip addr add dev lo 172.17.0.1/24")) error(1, errno, "ip addr add"); + if (system("sysctl -w net.ipv4.conf.lo.accept_local=1")) + error(1, errno, "sysctl lo.accept_local"); run_test();