From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 078D9C43381 for ; Mon, 25 Feb 2019 11:35:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CB02620842 for ; Mon, 25 Feb 2019 11:35:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726854AbfBYLfU (ORCPT ); Mon, 25 Feb 2019 06:35:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41178 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726701AbfBYLfU (ORCPT ); Mon, 25 Feb 2019 06:35:20 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2323C59456; Mon, 25 Feb 2019 11:35:20 +0000 (UTC) Received: from localhost (ovpn-200-19.brq.redhat.com [10.40.200.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B2F205D71A; Mon, 25 Feb 2019 11:35:16 +0000 (UTC) Date: Mon, 25 Feb 2019 12:35:11 +0100 From: Stefano Brivio To: Paolo Abeni Cc: netdev@vger.kernel.org, "David S. Miller" , David Ahern Subject: Re: [PATCH net v2 2/2] selftests: pmtu: add explicit tests for PMTU exceptions cleanup Message-ID: <20190225123511.2eb7c352@redhat.com> In-Reply-To: <6d6f6a2512743d6e1968dbfe765eb85b478bd033.1551093086.git.pabeni@redhat.com> References: <6d6f6a2512743d6e1968dbfe765eb85b478bd033.1551093086.git.pabeni@redhat.com> Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 25 Feb 2019 11:35:20 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Just three minor details, feel free to ignore: On Mon, 25 Feb 2019 12:13:46 +0100 Paolo Abeni wrote: > @@ -1006,6 +1017,60 @@ test_pmtu_vti6_link_change_mtu() { > return ${fail} > } > > +chk_command() { All the other functions checking something are called 'check_*'. > + cmd=${1} > + > + if ! which ${cmd} > /dev/null 2>&1; then > + err " missing required command: '${cmd}'" > + return 1 > + fi > + return 0 > +} > + > +test_cleanup_vxlanX_exception() { > + outer="${1}" > + encap="vxlan" > + ll_mtu=4000 > + > + chk_command taskset || return 2 > + chk_command timeout || return 2 > + cpu_list=$(grep -m 2 processor /proc/cpuinfo | cut -d ' ' -f 2) > + > + setup namespaces routing ${encap}${outer} || return 2 > + trace "${ns_a}" ${encap}_a "${ns_b}" ${encap}_b \ > + "${ns_a}" veth_A-R1 "${ns_r1}" veth_R1-A \ > + "${ns_b}" veth_B-R1 "${ns_r1}" veth_R1-B > + > + # Create route exception by exceeding link layer MTU > + mtu "${ns_a}" veth_A-R1 $((${ll_mtu} + 1000)) > + mtu "${ns_r1}" veth_R1-A $((${ll_mtu} + 1000)) > + mtu "${ns_b}" veth_B-R1 ${ll_mtu} > + mtu "${ns_r1}" veth_R1-B ${ll_mtu} > + > + mtu "${ns_a}" ${encap}_a $((${ll_mtu} + 1000)) > + mtu "${ns_b}" ${encap}_b $((${ll_mtu} + 1000)) > + > + # Fill exception cache for multiple CPUs (2) > + # we can always use inner IPv4 for that > + for cpu in ${cpu_list}; do > + taskset --cpu-list ${cpu} ${ns_a} ping -q -M want -i 0.1 -w 1 -s $((${ll_mtu} + 500)) ${tunnel4_b_addr} > /dev/null > + done > + > + if ! timeout 1 ${ns_a} ip link del dev veth_A-R1; then > + err " can't delete veth device in a timely manner, PMTU dst likely leaked" > + return 1 > + fi > + return 0 No need for explicit return 0. > +} > + > +test_pmtu_ipv6_exception_cleanup() { > + test_cleanup_vxlanX_exception 6 vxlan > +} > + > +test_pmtu_ipv4_exception_cleanup() { > + test_cleanup_vxlanX_exception 4 vxlan This function now takes just one argument. -- Stefano