From patchwork Mon Feb 11 18:07:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 1040055 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="asdoEMMK"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43ytyT4Myxz9sCh for ; Tue, 12 Feb 2019 05:06:20 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 4EC262D012C for ; Mon, 11 Feb 2019 19:06:17 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [IPv6:2001:4b78:1:20::4]) by picard.linux.it (Postfix) with ESMTP id 79C832D0072 for ; Mon, 11 Feb 2019 19:06:15 +0100 (CET) Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id C48621001195 for ; Mon, 11 Feb 2019 19:06:13 +0100 (CET) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x1BI4TQm035702 for ; Mon, 11 Feb 2019 18:06:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=iKrK5rmBBNtpDjfheRMEUc1sPmzo/p1q2CnIf3NgUNI=; b=asdoEMMKHV63THAyaaWFHo5qu1hO9yz1LXUwmdKYfgYhfGDzB52Gr1r91JDqCnxARl2p l2ei/3eSTZZRcNe3U6MABS5NZt0YXI0YQ4yI8UySPX3+5YybVzTngLGx7eLeTrzNKZjr YsFisgp7K02InPFQ1ROu+SYqr5kNNN+IEBlQx+F+9eMrwZ1WFilr3wOW8QIz8mV79QEB 0jXUKTScrw4G49d4IbOm8h2bgnzYIufdDitJyFUd98n6lWKhWlDDP2mO50glg99iHgzE 3DyZiLhR6thMZ1117uP0lT1EuZ2Fb63i2Q3K60YnS4dwABWnr9jc4A3Fck60c+qxGC0f XQ== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2qhrek7c73-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 11 Feb 2019 18:06:12 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x1BI6CgG005481 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 11 Feb 2019 18:06:12 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x1BI6BHm001073 for ; Mon, 11 Feb 2019 18:06:12 GMT Received: from ak.ru.oracle.com (/10.162.80.29) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 11 Feb 2019 10:06:10 -0800 From: Alexey Kodanev To: ltp@lists.linux.it Date: Mon, 11 Feb 2019 21:07:44 +0300 Message-Id: <1549908467-15609-2-git-send-email-alexey.kodanev@oracle.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1549908467-15609-1-git-send-email-alexey.kodanev@oracle.com> References: <1549908467-15609-1-git-send-email-alexey.kodanev@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9164 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902110135 X-Virus-Scanned: clamav-milter 0.99.2 at in-4.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-4.smtp.seeweb.it Subject: [LTP] [PATCH 1/4] netstress: support SO_REUSEPORT with new 'P' flag X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" netstress tool can be used manually by setting -P flag for a server. There is no test-case yet that specifically auto tests this functionality or uses it, but it should be easy to create one. For example, starting multiple netstress instances on the same port. Signed-off-by: Alexey Kodanev Reviewed-by: Petr Vorel --- testcases/network/netstress/netstress.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/testcases/network/netstress/netstress.c b/testcases/network/netstress/netstress.c index 2c5a6bd..2cdc91a 100644 --- a/testcases/network/netstress/netstress.c +++ b/testcases/network/netstress/netstress.c @@ -147,6 +147,7 @@ struct sock_info { static char *zcopy; static int send_flags = MSG_NOSIGNAL; +static char *reuse_port; static void init_socket_opts(int sd) { @@ -308,6 +309,8 @@ static void bind_before_connect(int sd) if (bind_no_port) SAFE_SETSOCKOPT_INT(sd, SOL_IP, IP_BIND_ADDRESS_NO_PORT, 1); + if (reuse_port) + SAFE_SETSOCKOPT_INT(sd, SOL_SOCKET, SO_REUSEPORT, 1); SAFE_BIND(sd, local_addrinfo->ai_addr, local_addrinfo->ai_addrlen); @@ -674,6 +677,8 @@ static void server_init(void) /* IPv6 socket is also able to access IPv4 protocol stack */ sfd = SAFE_SOCKET(family, sock_type, protocol); SAFE_SETSOCKOPT_INT(sfd, SOL_SOCKET, SO_REUSEADDR, 1); + if (reuse_port) + SAFE_SETSOCKOPT_INT(sfd, SOL_SOCKET, SO_REUSEPORT, 1); tst_res(TINFO, "assigning a name to the server socket..."); SAFE_BIND(sfd, local_addrinfo->ai_addr, local_addrinfo->ai_addrlen); @@ -996,6 +1001,7 @@ static struct tst_option options[] = { {"b:", &barg, "-b x x - low latency busy poll timeout"}, {"T:", &type, "-T x tcp (default), udp, udp_lite, dccp, sctp"}, {"z", &zcopy, "-z enable SO_ZEROCOPY"}, + {"P:", &reuse_port, "-P enable SO_REUSEPORT"}, {"D:", &dev, "-d x bind to device x\n"}, {"H:", &server_addr, "Client:\n-H x Server name or IP address"}, From patchwork Mon Feb 11 18:07:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 1040057 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="1+63M0GS"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43ytyY4HMnz9s6w for ; Tue, 12 Feb 2019 05:06:29 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 2D8052D0077 for ; Mon, 11 Feb 2019 19:06:27 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [217.194.8.3]) by picard.linux.it (Postfix) with ESMTP id 661372D0072 for ; Mon, 11 Feb 2019 19:06:16 +0100 (CET) Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-3.smtp.seeweb.it (Postfix) with ESMTPS id CB8691A01071 for ; Mon, 11 Feb 2019 19:06:15 +0100 (CET) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x1BI4UOd042068 for ; Mon, 11 Feb 2019 18:06:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=A3EAIKr2r+E/qdCc4VMx35sx8h6lNkv0Li4cmYE4IZE=; b=1+63M0GS2DCZ15Bkp/PqD1Cjy6OY0glgb6qB6LEqAV48zkOpL345sv+8Dg5+hgX57qMU /oQhf23rSbwCFFHW+360dUc90tW9xDJoLMj+iG8Djn4QOQSvy1hL8T4QELi5LC+vhMrH 7LW7Z1ISrNLqY7TxJGqbQHhAJeTb0SzSwSsoPW8ZfQeMotG5Hv2gyDSqOXkm6jM2M5i+ PMh10hC+aRCx/EaM7DZACAaRy8m3RYHeMMuF7EQFG1p3TKAQWJ6tDF6pHjWS+Red908L bKuBxO5XC3KKVjGWiCogHBoT1HO+s2Z8S3NWJMKICEDGkg1Qxevu6+eHCrG3CEV6mCOc pw== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2qhredqcks-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 11 Feb 2019 18:06:13 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x1BI6CE5001449 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 11 Feb 2019 18:06:12 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x1BI6CE0001079 for ; Mon, 11 Feb 2019 18:06:12 GMT Received: from ak.ru.oracle.com (/10.162.80.29) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 11 Feb 2019 10:06:11 -0800 From: Alexey Kodanev To: ltp@lists.linux.it Date: Mon, 11 Feb 2019 21:07:45 +0300 Message-Id: <1549908467-15609-3-git-send-email-alexey.kodanev@oracle.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1549908467-15609-1-git-send-email-alexey.kodanev@oracle.com> References: <1549908467-15609-1-git-send-email-alexey.kodanev@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9164 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=901 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902110135 X-Virus-Scanned: clamav-milter 0.99.2 at in-3.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-3.smtp.seeweb.it Subject: [LTP] [PATCH 2/4] netstress: allow setting MSG_ZEROCOPY for other protocols X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Signed-off-by: Alexey Kodanev Reviewed-by: Petr Vorel --- testcases/network/netstress/netstress.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/testcases/network/netstress/netstress.c b/testcases/network/netstress/netstress.c index 2cdc91a..63d02c9 100644 --- a/testcases/network/netstress/netstress.c +++ b/testcases/network/netstress/netstress.c @@ -942,13 +942,14 @@ static void setup(void) } } + if (zcopy) + send_flags |= MSG_ZEROCOPY; + switch (proto_type) { case TYPE_TCP: tst_res(TINFO, "TCP %s is using %s TCP API.", (client_mode) ? "client" : "server", (fastopen_api) ? "Fastopen" : "old"); - if (zcopy) - send_flags |= MSG_ZEROCOPY; check_tfo_value(); break; case TYPE_UDP: From patchwork Mon Feb 11 18:07:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 1040058 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="RE/hVYBR"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43ytyf3yLZz9s6w for ; Tue, 12 Feb 2019 05:06:34 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id BDD142D0162 for ; Mon, 11 Feb 2019 19:06:31 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [217.194.8.6]) by picard.linux.it (Postfix) with ESMTP id 895042D0073 for ; Mon, 11 Feb 2019 19:06:16 +0100 (CET) Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-6.smtp.seeweb.it (Postfix) with ESMTPS id DF7341401170 for ; Mon, 11 Feb 2019 19:06:15 +0100 (CET) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x1BI4lR1036123 for ; Mon, 11 Feb 2019 18:06:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=Bzc5VMnzCFmD8iqlwsnM8HNqZUu4Uv0iHoTqlgGjsyc=; b=RE/hVYBRv3CZFyrFieCCf8PAo8M5nrTjjsrd+R11iNhG5C/Dm0yCSuMgo69sxYVbnEMh jL10LLXlvJxufdGb2C+oFP09kMjQ93bLu3nJNOTkhcxSbmA/GO1iAnn3tTb/vLE4ObHE 1z74CcyQAp2GioL0bHd4R1CKZbeZsMKn/qdYZPhcnLFS31w3UqHe2yZSx8RCnzBuaXKN /jzOuxvPK2iS1mfXIFNBle/K9ZWlGhxPa2EdAU/4TTxOqhfCBTVKswjHEiWndN+VljkC v2YgAYNZa/LXtmRSzMfCKcX+IG34hZUc8aW+/C9hx/AY2sbvzsKXGfjC7Ca6fkbe1nfs XA== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2qhrek7c76-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 11 Feb 2019 18:06:14 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x1BI6DF0005666 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 11 Feb 2019 18:06:13 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x1BI6DUZ011383 for ; Mon, 11 Feb 2019 18:06:13 GMT Received: from ak.ru.oracle.com (/10.162.80.29) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 11 Feb 2019 10:06:12 -0800 From: Alexey Kodanev To: ltp@lists.linux.it Date: Mon, 11 Feb 2019 21:07:46 +0300 Message-Id: <1549908467-15609-4-git-send-email-alexey.kodanev@oracle.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1549908467-15609-1-git-send-email-alexey.kodanev@oracle.com> References: <1549908467-15609-1-git-send-email-alexey.kodanev@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9164 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=931 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902110135 X-Virus-Scanned: clamav-milter 0.99.2 at in-6.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-6.smtp.seeweb.it Subject: [LTP] [PATCH 3/4] netstress: handle zero length message for datagram sockets X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Don't treat them as errors unless there are too many of them. Signed-off-by: Alexey Kodanev --- testcases/network/netstress/netstress.c | 26 ++++++++++++++++++-------- 1 files changed, 18 insertions(+), 8 deletions(-) diff --git a/testcases/network/netstress/netstress.c b/testcases/network/netstress/netstress.c index 63d02c9..63fbaed 100644 --- a/testcases/network/netstress/netstress.c +++ b/testcases/network/netstress/netstress.c @@ -89,6 +89,7 @@ static char *source_addr; static char *server_bg; static int busy_poll = -1; static int max_etime_cnt = 12; /* ~30 sec max timeout if no connection */ +static int max_eshutdown_cnt = 10; static int max_pmtu_err = 10; enum { @@ -142,6 +143,7 @@ struct sock_info { socklen_t raddr_len; int etime_cnt; int pmtu_err_cnt; + int eshutdown_cnt; int timeout; }; @@ -287,14 +289,22 @@ static int client_recv(char *buf, int srv_msg_len, struct sock_info *i) return 0; } - if (errno == ETIME && sock_type != SOCK_STREAM) { - if (++(i->etime_cnt) > max_etime_cnt) - tst_brk(TFAIL, "client requests timeout %d times, last timeout %dms", - i->etime_cnt, i->timeout); - /* Increase timeout in poll up to 3.2 sec */ - if (i->timeout < 3000) - i->timeout <<= 1; - return 0; + if (sock_type != SOCK_STREAM) { + if (errno == ETIME) { + if (++(i->etime_cnt) > max_etime_cnt) + tst_brk(TFAIL, "client requests timeout %d times, last timeout %dms", + i->etime_cnt, i->timeout); + /* Increase timeout in poll up to 3.2 sec */ + if (i->timeout < 3000) + i->timeout <<= 1; + return 0; + } + if (errno == ESHUTDOWN) { + if (++(i->eshutdown_cnt) > max_eshutdown_cnt) + tst_brk(TFAIL, "too many zero-length msgs"); + tst_res(TINFO, "%d-length msg on sock %d", len, i->fd); + return 0; + } } SAFE_CLOSE(i->fd); From patchwork Mon Feb 11 18:07:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 1040059 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="3Go1IUwz"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43ytyk3F2Gz9s6w for ; Tue, 12 Feb 2019 05:06:38 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id C97A82D0184 for ; Mon, 11 Feb 2019 19:06:35 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [217.194.8.4]) by picard.linux.it (Postfix) with ESMTP id 68D232D012F for ; Mon, 11 Feb 2019 19:06:17 +0100 (CET) Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id CA625100116C for ; Mon, 11 Feb 2019 19:06:15 +0100 (CET) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x1BI497U035584 for ; Mon, 11 Feb 2019 18:06:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=+BP11PfnzG6iQLMdES6TS7zzRYJnuYH1d+0UmAkBM70=; b=3Go1IUwzsUvPAQm32ytmfthbtl8d43zgfdtZgw0AGrZTgageTaiH7VbBYEW52K68SNIS UkxoCBEBhVXKjJi1Az7MMllzV8LoFdWZd80PVUkgrm0rIB0iah8snC3sUIzPchf8Fsxw kdpyE3T08Ysdy7Pb6tTdIh3VbotdA0dr17Kj0+l5EjxdwIFhHpSSuj/JlHRfFT3P6grj yDlP9xMUJJW8KfXO7ubqmlSJqc8DlGpRF626gdWrb3IAz3rle/UEDACuTOdvnIj2cbn0 ijckSo3O6DDjR8oUz7wELDeSuDo/5fSsYOaT+RNqZ1MDZs+SCB7bwUbcnC8ue/HN9wCr 9w== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2qhrek7c79-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 11 Feb 2019 18:06:15 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x1BI6EmR028701 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 11 Feb 2019 18:06:14 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x1BI6EP1001092 for ; Mon, 11 Feb 2019 18:06:14 GMT Received: from ak.ru.oracle.com (/10.162.80.29) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 11 Feb 2019 10:06:14 -0800 From: Alexey Kodanev To: ltp@lists.linux.it Date: Mon, 11 Feb 2019 21:07:47 +0300 Message-Id: <1549908467-15609-5-git-send-email-alexey.kodanev@oracle.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1549908467-15609-1-git-send-email-alexey.kodanev@oracle.com> References: <1549908467-15609-1-git-send-email-alexey.kodanev@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9164 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902110135 X-Virus-Scanned: clamav-milter 0.99.2 at in-4.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-4.smtp.seeweb.it Subject: [LTP] [PATCH 4/4] netstress: increase timeout errors counter X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Make sure we avoid false-positives with stress test scenarious. Signed-off-by: Alexey Kodanev --- testcases/network/netstress/netstress.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/testcases/network/netstress/netstress.c b/testcases/network/netstress/netstress.c index 63fbaed..06882b1 100644 --- a/testcases/network/netstress/netstress.c +++ b/testcases/network/netstress/netstress.c @@ -88,7 +88,7 @@ static char *server_addr = "localhost"; static char *source_addr; static char *server_bg; static int busy_poll = -1; -static int max_etime_cnt = 12; /* ~30 sec max timeout if no connection */ +static int max_etime_cnt = 21; /* ~60 sec max timeout if no connection */ static int max_eshutdown_cnt = 10; static int max_pmtu_err = 10;