From patchwork Thu Apr 5 10:56:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 895348 X-Patchwork-Delegate: akodanev@gmail.com 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="Ej4Box8K"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40H00G3L0zz9s0q for ; Thu, 5 Apr 2018 20:47:42 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id E4E4B3E76E4 for ; Thu, 5 Apr 2018 12:47:39 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [217.194.8.2]) by picard.linux.it (Postfix) with ESMTP id 5DA0C3E76AC for ; Thu, 5 Apr 2018 12:47:32 +0200 (CEST) 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-2.smtp.seeweb.it (Postfix) with ESMTPS id 36AF0601F60 for ; Thu, 5 Apr 2018 12:47:31 +0200 (CEST) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w35AU5hS045499 for ; Thu, 5 Apr 2018 10:47:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2017-10-26; bh=mrOJST0Z42Ro91CFLzWZCmBZkmvS6NzCOB+E0N7Ekw4=; b=Ej4Box8KjvTOBIlRp79j+U5B2eqkEScKPL5g/Y0vQI06WOK/aiZmzDCSLLwO7RHRPw6d hAUyaol/QeiXY1BlPDaCB/CiWHE6CTSgqKfqsF3bsoSoPX1tfxbHiqYbFfGi50u8lK+6 BTKZepWICwAOoNqozilo8f9u4HxgFuqp5CbOsrkvCy9pGD4sRA+da2/LjbmTetatBuKC xAP3sayf4FR4/jLr70XwWVCtVAtQGLMM8eDKDRs02MxT3DpzpbrYO49T/2n1Q9r/YjjV j/c+QpbOId7MGQ7VXyEydrcRiD2Ehhk3xXPxtN1imrh5PNUgN++Y5R/kRhBjykc8YkYX 0g== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2h5j3hr1wj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 05 Apr 2018 10:47:28 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w35AlR3C016182 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 5 Apr 2018 10:47:27 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w35AlQ9a011807 for ; Thu, 5 Apr 2018 10:47:26 GMT Received: from ak.ru.oracle.com (/10.162.80.29) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 05 Apr 2018 03:47:26 -0700 From: Alexey Kodanev To: ltp@lists.linux.it Date: Thu, 5 Apr 2018 13:56:50 +0300 Message-Id: <1522925812-17200-1-git-send-email-alexey.kodanev@oracle.com> X-Mailer: git-send-email 1.7.1 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8853 signatures=668697 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1804050107 X-Virus-Scanned: clamav-milter 0.99.2 at in-2.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_PASS, T_RP_MATCHES_RCVD autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-2.smtp.seeweb.it Subject: [LTP] [PATCH COMMITTED 1/3] netstress: handle pmtu update on EMSGSIZE error 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" After the error we should get a new route cache with updated pmtu, resend datagram again using the new one. The exact number of errors during the test may depend on the route cache expire time, by defualt it is 600 sec: net.ipv4.route.mtu_expires net.ipv6.route.mtu_expires and the total test time. Therefore it is difficult to anticipate what value we would need, especially for the server that don't have the requests number parameter. Set it to 10, it should be enough for most of the test scenarios. Signed-off-by: Alexey Kodanev --- testcases/network/netstress/netstress.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/testcases/network/netstress/netstress.c b/testcases/network/netstress/netstress.c index 369a5ee..72f4a40 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_pmtu_err = 10; enum { TYPE_TCP = 0, @@ -139,6 +140,7 @@ struct sock_info { struct sockaddr_storage raddr; socklen_t raddr_len; int etime_cnt; + int pmtu_err_cnt; int timeout; }; @@ -255,8 +257,15 @@ static int client_recv(char *buf, int srv_msg_len, struct sock_info *i) /* socket closed or msg is not valid */ if (len < 1 || (offset + len) > srv_msg_len || (buf[0] != start_byte && buf[0] != start_fin_byte)) { - if (!errno) + /* packet too big message, resend with new pmtu */ + if (errno == EMSGSIZE) { + if (++(i->pmtu_err_cnt) < max_pmtu_err) + return 0; + tst_brk(TFAIL, "too many pmtu errors %d", + i->pmtu_err_cnt); + } else if (!errno) { errno = ENOMSG; + } break; } offset += len; @@ -357,6 +366,7 @@ void *client_fn(LTP_ATTRIBUTE_UNUSED void *arg) inf.raddr_len = sizeof(inf.raddr); inf.etime_cnt = 0; inf.timeout = wait_timeout; + inf.pmtu_err_cnt = 0; make_client_request(client_msg, &cln_len, &srv_len);