From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07822472793 for ; Mon, 18 May 2026 12:56:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779108990; cv=none; b=jw+QgbEYcfzKf5Z60lvx0cqDKnom3vKRJRL9qkYZfNCt4GChT6H0MSuqD/IwM7H6LgI/N/Hy3plilUulLe/WnInWsxv8wSzAci86pE8Etb9RRld0tNOF7y1D9yPr4QAbK1dB6ARwNPejMwkDX5U5sXswMjFSwKyFauIO2OgnHRw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779108990; c=relaxed/simple; bh=ZAuMBx6unadbACjjupcjZEyuZSeHhtlA21qQueRbAfs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=gu7XBbBMpJMqlRkxJZA5YxgQWvm3wjg/cINIPFdy2MP/RA3EKIQgx+wABKsjOI22+lvHXkcior/NbscY3vVuqYR4tpzZ4qMj+W159v+RZykw0NRl8cCwFuC0QBnu22SewFt3RaWBsX0ndRkR+kEA4jhQ3Tpgo5I5XbkhATIfyAE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=6wind.com; spf=pass smtp.mailfrom=6wind.com; dkim=pass (2048-bit key) header.d=6wind.com header.i=@6wind.com header.b=MzLlTkUR; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=6wind.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=6wind.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=6wind.com header.i=@6wind.com header.b="MzLlTkUR" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-48fde2f2d61so4324965e9.3 for ; Mon, 18 May 2026 05:56:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; t=1779108984; x=1779713784; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:organization:content-language :from:references:cc:to:subject:reply-to:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=0NWlYTSwdMpd9k30WRuv0VLgXhIMq511o0HjE5SQVdk=; b=MzLlTkUR/qQFe8Ry+d7kbnM+cnh1pI2DB6qZm+HNjGelgChWSnB0y/eI2NdwFuRbrw 9H11PnIafcW7bPvepSeQ4//qXsyqxGKierwBTWDnbat3xhn4RA3mdnZK3SfQ98A7RgJR mhNT/AspgfDaf9vIM3sJXri2UlyVle2Ef6QHESdvuxGOj4U0yi4QhwM99ZCiIDkk/ApD vdMpRIr8U7dUNV3VTW0ruIATNuU5cKuhU1V9jDNQr6Vpf9xQBFlwS85DCDImIFK1PRrz GnnrIPz6iVHNz1hGj74bBDRKOV6EVJyqaUD6ci6ieHbUhrp3CT7suBck9bw+vIB95R0Z bwpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779108984; x=1779713784; h=content-transfer-encoding:in-reply-to:organization:content-language :from:references:cc:to:subject:reply-to:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=0NWlYTSwdMpd9k30WRuv0VLgXhIMq511o0HjE5SQVdk=; b=Sg5KRafqSSkFIymPvG0+37hxAvegdCNAl14Nfng86xfJ0eO15b9UX2cZgFvSD4mOhK DyZhJKSuRwRRKu40AYkIob4ppQ1Jqfh1gL9yYrsoPGqGmuQlMjIqZKw1Zhnh63NK+408 YCWs2wfcrcCDNDFPzPEKXDQCmFX4yPS2/yt3vWvQ6ppAaph9KRRcGK8VOAvWA6ei0jDL pi0cGBHxMJ+NNt8wgqMh2vPlGaBALu+KdCC4r+IdJQe2QpMrzsSCHcNkbrqjJZDRuelx txnvHxdvoI6DO5ZNs3p1zop39SA78F9p6KLkCvKfWg6q4Uz55COtwLU44sWOoo4g9idd 8knQ== X-Forwarded-Encrypted: i=1; AFNElJ8UT5xEgk7PaTjtyr/PpjE+0L8XgsgsyMwV4J0qxOJWU5dB83X12vdXKfRfzH7iFodoTJOHNq54Hl89ym8=@vger.kernel.org X-Gm-Message-State: AOJu0YwDFdvLj2k7tcEK0cNggB93kLC7WS+CcntF7eHxnu8YZjXCaJpL ppR+k0QvG6fx6GxjTpBYJMBMEKuRIi+itF9Mq5EKMLb6nIlB+JusXSkYG0cNAanpqA0= X-Gm-Gg: Acq92OGsQYD8dRtQccFby4OLhSVLNtCwEf3/5gQzPt74FZi7ZUvpaIPXo7KNFvdNLsr lmdYAHng9ljKBdtuNrjgC96WfqHtOU6ut9vXLCd2ig2Q2vllxsrbtJvxjK4U7a5EMof5CFAXPxv 2Cky3nIm8A1MzrbqyvauVH4YIOe/rnMHUALQ9aqpCxeY6DfhI5zBK72xh3SEal8aNfG8XN3xOKr rKObfAuF8Gq3IzDuSI9zg8uM97QqMYN5I1l4M42xw58vFNuFiqyxBafgUsI/CQQvhmrHabtKCpn YMv/PIesVSuFqlfHW8CgTzL9P3aSe3Eo8MSmO/zApXsg7oXTaJvb/TlM0IqWHpciKtQs5IrIsUd A4dR4AdTxPuS84xXVtnnE0uC73frBYxeipAh261oC2T/bQe39esyRPg6wE2XU9X/CzSzoVjOaH1 rlyG/fEQJUSqmApRmv89/7HqPjVct2MMfsCbKDr7v27XneAW5EuYRllThEl7vAzNEzA00fNgU9a 5Dm X-Received: by 2002:a05:600c:1d0d:b0:485:c456:5e4f with SMTP id 5b1f17b1804b1-48fe59b071bmr114106455e9.0.1779108984558; Mon, 18 May 2026 05:56:24 -0700 (PDT) Received: from ?IPV6:2a01:e0a:b41:c160:6a1d:efff:fe52:1959? ([2a01:e0a:b41:c160:6a1d:efff:fe52:1959]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48febe5bc94sm149189915e9.4.2026.05.18.05.56.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 May 2026 05:56:24 -0700 (PDT) Message-ID: <5d19e543-ac3b-4d32-a464-377d03cde500@6wind.com> Date: Mon, 18 May 2026 14:56:23 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Reply-To: nicolas.dichtel@6wind.com Subject: Re: [PATCH net 3/5] net: netlink: don't set nsid on local notifications To: Ilya Maximets , netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Donald Hunter , Shuah Khan , Adrian Moreno , Jiri Benc , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Matteo Perin References: <20260515201937.2813983-1-i.maximets@ovn.org> <20260515201937.2813983-4-i.maximets@ovn.org> <40603dce-f801-42ad-96ec-c8c0a57e5aae@6wind.com> <5344852f-e920-4232-9b54-5b22f6c8a1d3@ovn.org> From: Nicolas Dichtel Content-Language: en-US Organization: 6WIND In-Reply-To: <5344852f-e920-4232-9b54-5b22f6c8a1d3@ovn.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le 18/05/2026 à 14:46, Ilya Maximets a écrit : [snip] > True and also not really. The main problem is that ID can be allocated > at any point in time, so the application needs to listen for NEW messages > on the same socket that it is listening for the events that are interesting > to it (to avoid races), if it doesn't want to make a separate GET request > per notification or track all the IDs that were previously checked. It's a > non-trivial amount of code depending on the application structure. iproute2 handles it ;-) You certainly need to maintain a cache, but once a nsid is allocated, it never changes until the netns is deleted. > > Alternative is to always try and allocate the self-referential mapping on > the application startup and remember it, and then check that no-id, -1 and > the allocated one all mean 'current'.Yep. > >> >>> >>> A search though open-source projects doesn't reveal any projects >>> that use NETNSA_NSID_NOT_ASSIGNED and rely on metadata to contain >>> self-referential NSIDs. Quite the opposite, ovs-vswitchd relies >>> on the metadata to not be present to separate local and remote >>> events. And the 'ip monitor' relies on the metadata to not be present >>> to show '[nsid current]', though this is more like "print 'current' >>> if there is nothing to print" situation, but still can be a little >>> confusing for the user to see an ID for a local event. >> >> We (6WIND) are using NETLINK_LISTEN_ALL_NSID. Like iproute2, 'current' is >> assumed if there is no nsid, else the corresponding netns is checked (which may >> match the current netns). > > OK. It sounds like this one patch will not affect your use case than, > which is good to know. Thanks! Probably not, but I didn't say this ;-) I need to make some tests with your series. Regards, Nicolas