Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp601850pxu; Wed, 25 Nov 2020 10:55:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJwjowh6qUEoJ20jWq8w008kKvinBHQeJdS7CwHKcwsjosbVVsir/HtKzo69UsjO2nufLU7C X-Received: by 2002:a50:f0dc:: with SMTP id a28mr3471103edm.291.1606330548861; Wed, 25 Nov 2020 10:55:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606330548; cv=none; d=google.com; s=arc-20160816; b=Ngj5yfT6FhituNRlyV5w4igYQ6feZCzsvdmvP8Yt+FRuCC02HM7L+cgdQQEqYJKM9A DWbL0rYmuC5LI2TC2xZcb/tiRMY6uY8aXXyQ1Q2k9Voi4R7wVuBL4W/u4jFuXflGkwhF iFwZ31zEDk1yiLCBZHgzlPNmyBxCZ/schI+Qp07OlMX+RK1yKkjau4u7nrgOgWye7yGS UhLfIa1g1JPdrIuaMKCLt1tYx4o/gSzC3oQL1B4YZXLjS0tVdU4dFD3P8edpLAPZ+OzY 9TFCsUZ++2Op8rOk6g1Y9e6Qc8Z7U1A56C/p/66EjFJy3Mh6TceOgJfzsz0K8CrCyxYi TmUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=RI2z5auShChbvX++r2Eysg8y/Lw5LNxiLNrqt336ilY=; b=GUV4tTunQXUNoVKgPrK4tsre0Xx/YtoluO6fCrewcXEYIqZAwvmBdpBdpocIHdny6B +Ba5wXziERR42e+GJRh/2fPI0DBknkl1ExJd2j2OrPb0gMeYj1yIwCI+uJmAAbniz313 h0ivPcUOUfLGD9Po9wZxuQRxqepss5lLNxaltnLc7m8jr9PCIMjKOhp8+AIEFgxZo5aS oqQEvkPLMH+yT9X4kWL5UuqcWTJiSHO9wJdqJUul+OkcOZnweDkqjYhfTu9JDO5WONbQ /XzA6UyT/kP8Hpmzy0QSnEyOLMcbb/HXNSSw7anf5RrWz643wqR61KOIhDYYIAMiYiF+ f7wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (no key) header.i=@uniroma2.it header.b=a9BFTfaT; dkim=pass header.i=@uniroma2.it header.s=rsa201904 header.b=uhniSVlj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=uniroma2.it Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r8si1006698eji.608.2020.11.25.10.55.24; Wed, 25 Nov 2020 10:55:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=neutral (no key) header.i=@uniroma2.it header.b=a9BFTfaT; dkim=pass header.i=@uniroma2.it header.s=rsa201904 header.b=uhniSVlj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=uniroma2.it Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732531AbgKYSvx (ORCPT + 99 others); Wed, 25 Nov 2020 13:51:53 -0500 Received: from smtp.uniroma2.it ([160.80.6.22]:34413 "EHLO smtp.uniroma2.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730989AbgKYSvw (ORCPT ); Wed, 25 Nov 2020 13:51:52 -0500 Received: from smtpauth-2019-1.uniroma2.it (smtpauth.uniroma2.it [160.80.5.46]) by smtp-2015.uniroma2.it (8.14.4/8.14.4/Debian-8) with ESMTP id 0APIof21029257; Wed, 25 Nov 2020 19:50:46 +0100 Received: from lubuntu-18.04 (unknown [160.80.103.126]) by smtpauth-2019-1.uniroma2.it (Postfix) with ESMTPSA id AFEE3120099; Wed, 25 Nov 2020 19:50:36 +0100 (CET) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=uniroma2.it; s=ed201904; t=1606330237; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RI2z5auShChbvX++r2Eysg8y/Lw5LNxiLNrqt336ilY=; b=a9BFTfaTFwoIPlEon8IwPMC8Zd4D2AYhXbCfhWgkLjDpooYa6+D8KnoBGoxtlHRRsDZKWN e0jsV6ediANHCbDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uniroma2.it; s=rsa201904; t=1606330237; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RI2z5auShChbvX++r2Eysg8y/Lw5LNxiLNrqt336ilY=; b=uhniSVljPrm5cmIiqWilJ6AKE101ATakXX/24p2Vj0OIT2PBRnLZHW6G1XgobI9SRFGSxJ +d03TmH4kA+BfcZ5WuYfRXyqv9AH7AyXUX4xRu5uKKq+jdtedMIWcRSCsvvuQzkmb9ZbB8 s0+OQCDsnyFADSm+02aWGrRmWSdMoccCI+virAPvTQIYMttoTP3M+QH/DfDS10iZr7H9G+ ZDeDHUPSKOzUmnA+CHsNYOLYL7LqdTkDQW+x1DBeIhVKy/A0ayWu4u/FEexKTz0VzLD0q6 74Rz26bPBHpriYNHHF9vkiCQ0NXOpd1WEstbt2xtHHPts5qTX3mUCC2VKXwzyw== Date: Wed, 25 Nov 2020 19:50:36 +0100 From: Andrea Mayer To: Jakub Kicinski Cc: "David S. Miller" , David Ahern , Alexey Kuznetsov , Hideaki YOSHIFUJI , Shuah Khan , Shrijeet Mukherjee , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Nathan Chancellor , Stefano Salsano , Paolo Lungaroni , Ahmed Abdelsalam , Andrea Mayer Subject: Re: [net-next v3 5/8] seg6: add support for the SRv6 End.DT4 behavior Message-Id: <20201125195036.4b5b5645ff32926ca83b1359@uniroma2.it> In-Reply-To: <20201124154017.4b1a905c@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> References: <20201123182857.4640-1-andrea.mayer@uniroma2.it> <20201123182857.4640-6-andrea.mayer@uniroma2.it> <20201124154017.4b1a905c@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.100.0 at smtp-2015 X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jakub, thanks for your review. On Tue, 24 Nov 2020 15:40:17 -0800 Jakub Kicinski wrote: > On Mon, 23 Nov 2020 19:28:53 +0100 Andrea Mayer wrote: > > +static int cmp_nla_vrftable(struct seg6_local_lwt *a, struct seg6_local_lwt *b) > > +{ > > + struct seg6_end_dt_info *info_a = seg6_possible_end_dt_info(a); > > + struct seg6_end_dt_info *info_b = seg6_possible_end_dt_info(b); > > + > > + if (IS_ERR(info_a) || IS_ERR(info_b)) > > + return 1; > > Isn't this impossible? I thought cmp() can only be called on fully > created lwtunnels and if !CONFIG_NET_L3_MASTER_DEV the tunnel won't > be created? > The function cmp_nla_vrftable() can be called only if the lwtunnel is created successfully. A SRv6 behavior using a vrftable attribute can be successfully instantiated only if CONFIG_NET_L3_MASTER_DEV is set. Otherwise (CONFIG_NET_L3_MASTER_DEV not set), the function parse_nla_vrftable() returns an error (obtained from the seg6_possible_end_dt_info()) and tunnel creation fails. The pointer returned from seg6_possible_end_dt_info() depends on CONFIG_NET_L3_MASTER_DEV. I thought it would be reasonable to check its validity in functions that make explicit use of seg6_possible_end_dt_info() even in cases where this was not strictly necessary (i.e: cmp_nla_vrftable()). Therefore, it turns out to be an impossible case. I can remove these checks in the next v4. Thank you, Andrea > > + if (info_a->vrf_table != info_b->vrf_table) > > + return 1; > > + > > + return 0;