Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4312589pxb; Mon, 4 Oct 2021 23:45:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPYAfkyM5ngHCOrXRdaQNSvHhhzBnEaHqIJBFb398bcZa5WA6Owk3rpg59JdRT66m53zgs X-Received: by 2002:aa7:d502:: with SMTP id y2mr17918194edq.231.1633416332527; Mon, 04 Oct 2021 23:45:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633416332; cv=none; d=google.com; s=arc-20160816; b=CBdgCrsB4jEPmqdt0aPD+6fJbstNizN557I0pIlhiPl6bxC/eI23Hru/jJNJNd0V8W CAo+CuM6o4ve+T8T7o/J3dotCjDbEt4Ev0zemlQ1cOz6DJIShmzB2r/SawWw0zwBPzBx ZXjWzYnyzTxCcvnWk1IfttY8TyR7FZHxmR/BhN7inR8YD4y6x2q5Y/VQVWEeRwxwBd3s 9zG1jfN8KYVoJL9LMHMPMSo5t7oqlzaKmhvBD8JPgi7WeKCCSpG5XR6LOksE6d070dzH vn2+LWp3/b/UDS+tjIkHIJPteX+MMDsToJWmJ6fOzoH55y3VaY6TVgb4LUwEdSLNIcX9 n6BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:reply-to:dkim-signature; bh=RQd1eb7LuGWMGXLW0Toj0Xy2/OgdsTmnaijiP9bfs9U=; b=p1kLLXlE+qY6AriEcDXe3ktuN0juPtdEAU2nH+bgIS9NhjRGZrSh7iMyg0EPv86y6t Tp2aPX/kycuCixzoGI8yL3+gTdsq2WqQUPNhXN1NKdzHy+ycZM4LnwF55ce6IAtnyITT wb2U7aPNGvNXdN98m2Ftkre97oZZ/8pWwYeyDW0zadwkevung0TvOd9Kj1fCxR0c/QCt TFBX518IWdWmdJLYlEhiAsvM+4DhGb+Qi/xiuaCiTMZXW5Z0rKYMI/V+LF/KGl7h4FwF kLnlbPYWgHza/0+DY9R86a2/RMvflDUGSK/Z9jCIMZjtikNEGHvgzE0OvdrdxvSZOdGL PBGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@6wind.com header.s=google header.b=RPHqYA3e; 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=6wind.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p4si22649011edj.221.2021.10.04.23.45.08; Mon, 04 Oct 2021 23:45:32 -0700 (PDT) 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=pass header.i=@6wind.com header.s=google header.b=RPHqYA3e; 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=6wind.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232346AbhJEGnF (ORCPT + 99 others); Tue, 5 Oct 2021 02:43:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231913AbhJEGm6 (ORCPT ); Tue, 5 Oct 2021 02:42:58 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04293C061745 for ; Mon, 4 Oct 2021 23:41:06 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id j10-20020a1c230a000000b0030d523b6693so1979091wmj.2 for ; Mon, 04 Oct 2021 23:41:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=reply-to:subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=RQd1eb7LuGWMGXLW0Toj0Xy2/OgdsTmnaijiP9bfs9U=; b=RPHqYA3e3EwHYTUB3ZxwTfsF8lSLbP97gBZAXp/Qh0rKVVJRSUJxMFhjfA6T1BeCBm LW4SosYc0ZipAwZLYXCfNfqjzrgBqNBY8TwUpUlEVb3Mu6jb4bCgYL4traaopI3szxsR LlKpRmFJN8ZXa9cfVqclrLQuDxA7t9EGWF7TohOFrkvIZl0f4w/8hqhL212bHnMSxhW8 6kOgzrvrz4U696/iQD37Lb/vogdOVzXvt65pwGrc5P0FWoyjlWhPyBh5iIZ/+HkSIGWk 2B0FxFD9vacmkuPphLWv8iH1echfyjf7R/KF73PVEIgcEqRf5fbocGsugZ8ay3bgjHv5 Zc1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:reply-to:subject:to:cc:references:from :organization:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=RQd1eb7LuGWMGXLW0Toj0Xy2/OgdsTmnaijiP9bfs9U=; b=mUYB656cXMlcjy4EaNDgAUUuE59rtxpXW6IWOCQMo/fAb/aPdzu8oiUwASzc2EfuRN XS1gCl/9ZHe4gAaVkZG9XsYYxYH1/3GxtFxvKrWvnV2FQ9AFY6vtm5Hcmz9MTPJwpDG+ Zh5YCMkXWwfn4FUq2sFtAR5yIBDADBel5b3UZL0KGS6ZXcEngZDV2llnwLcFwPMRuszK jZgMvDcILBEMHQVjiP7IjB/jpsGOQhsixdFdfNwBQVPD3vcAUcPDkHCNboSJzazzBPE1 JXs0a0+NeqQlEFVxyaHs8rDrsU82JqJlRSlIHbU7jHAX1SqEPHMpHKxJYVKMQS7IZ7Uf lVIQ== X-Gm-Message-State: AOAM531ZeG+3Iq42pYKvdbz3kYS00/NG7pm5w7+NsmPElot8UlHbuoZ2 eIIDwu6Kf1BEXrM/58br9CPmRsPab85vOQ== X-Received: by 2002:a7b:c5d8:: with SMTP id n24mr1573727wmk.51.1633416064597; Mon, 04 Oct 2021 23:41:04 -0700 (PDT) Received: from ?IPv6:2a01:e0a:410:bb00:573:1b46:b04d:a14c? ([2a01:e0a:410:bb00:573:1b46:b04d:a14c]) by smtp.gmail.com with ESMTPSA id c17sm772160wmr.15.2021.10.04.23.41.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Oct 2021 23:41:04 -0700 (PDT) Reply-To: nicolas.dichtel@6wind.com Subject: Re: [PATCH net-next v6] net: openvswitch: IPv6: Add IPv6 extension header support To: Cpp Code Cc: Jakub Kicinski , netdev@vger.kernel.org, pshelar@ovn.org, "David S. Miller" , ovs dev , linux-kernel@vger.kernel.org References: <20210928194727.1635106-1-cpp.code.lv@gmail.com> <20210928174853.06fe8e66@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20210929061909.59c94eff@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> From: Nicolas Dichtel Organization: 6WIND Message-ID: Date: Tue, 5 Oct 2021 08:41:03 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 01/10/2021 à 22:42, Cpp Code a écrit : > On Fri, Oct 1, 2021 at 12:21 AM Nicolas Dichtel > wrote: >> >> Le 30/09/2021 à 18:11, Cpp Code a écrit : >>> On Wed, Sep 29, 2021 at 6:19 AM Jakub Kicinski wrote: >>>> >>>> On Wed, 29 Sep 2021 08:19:05 +0200 Nicolas Dichtel wrote: >>>>>> /* Insert a kernel only KEY_ATTR */ >>>>>> #define OVS_KEY_ATTR_TUNNEL_INFO __OVS_KEY_ATTR_MAX >>>>>> #undef OVS_KEY_ATTR_MAX >>>>>> #define OVS_KEY_ATTR_MAX __OVS_KEY_ATTR_MAX >>>>> Following the other thread [1], this will break if a new app runs over an old >>>>> kernel. >>>> >>>> Good point. >>>> >>>>> Why not simply expose this attribute to userspace and throw an error if a >>>>> userspace app uses it? >>>> >>>> Does it matter if it's exposed or not? Either way the parsing policy >>>> for attrs coming from user space should have a reject for the value. >>>> (I say that not having looked at the code, so maybe I shouldn't...) >>> >>> To remove some confusion, there are some architectural nuances if we >>> want to extend code without large refactor. >>> The ovs_key_attr is defined only in kernel side. Userspace side is >>> generated from this file. As well the code can be built without kernel >>> modules. >>> The code inside OVS repository and net-next is not identical, but I >>> try to keep some consistency. >> I didn't get why OVS_KEY_ATTR_TUNNEL_INFO cannot be exposed to userspace. > > OVS_KEY_ATTR_TUNNEL_INFO is compressed version of OVS_KEY_ATTR_TUNNEL > and for clarity purposes its not exposed to userspace as it will never > use it. > I would say it's a coding style as it would not brake anything if exposed. In fact, it's the best way to keep the compatibility in the long term. You can define it like this: OVS_KEY_ATTR_TUNNEL_INFO, /* struct ip_tunnel_info, reserved for kernel use */ > >> >>> >>> JFYI This is the file responsible for generating userspace part: >>> https://github.com/openvswitch/ovs/blob/master/build-aux/extract-odp-netlink-h >>> This is the how corresponding file for ovs_key_attr looks inside OVS: >>> https://github.com/openvswitch/ovs/blob/master/datapath/linux/compat/include/linux/openvswitch.h >>> one can see there are more values than in net-next version. >> There are still some '#ifdef __KERNEL__'. The standard 'make headers_install' >> filters them. Why not using this standard mechanism? > > Could you elaborate on this, I don't quite understand the idea!? Which > ifdef you are referring, the one along OVS_KEY_ATTR_TUNNEL_INFO or > some other? My understanding is that this file is used for the userland third party, thus, theoretically, there should be no '#ifdef __KERNEL__'. uapi headers generated with 'make headers_install' are filtered to remove them. > >> >> In this file, there are two attributes (OVS_KEY_ATTR_PACKET_TYPE and >> OVS_KEY_ATTR_ND_EXTENSIONS) that doesn't exist in the kernel. >> This will also breaks if an old app runs over a new kernel. I don't see how it >> is possible to keep the compat between {old|new} {kernel|app}. > > Looks like this most likely is a bug while working on multiple > versions of code. Need to do add more padding. As said above, just define the same uapi for everybody and the problem is gone forever. Regards, Nicolas