From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=KDQliUec; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id 70D4E5A0271 for ; Sat, 27 Sep 2025 01:06:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1758927960; h=from:from: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=ITn77mvtxVtkW93LBycvqvZjY5ygXOxy4b0IYF1TxFs=; b=KDQliUecvQtgQMNDPxqHvYtP2N4Qc8vZBQJNvcnek7yHpPkNOe1IETNuXCAFVIjMK+Y6qO w/6Q87ZJIg9578fotmZpgtFoeRVHjGtL2381lAjYft1abfdRDw0Hzmh4Fx/SpFim3Q3ukm Y+rzZiGuq7NeTNIeeHcdQMlzHxkp/64= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-117-iB8OFdEUPuWOgzTn_gAYUA-1; Fri, 26 Sep 2025 19:05:59 -0400 X-MC-Unique: iB8OFdEUPuWOgzTn_gAYUA-1 X-Mimecast-MFC-AGG-ID: iB8OFdEUPuWOgzTn_gAYUA_1758927958 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-4de53348322so33057291cf.0 for ; Fri, 26 Sep 2025 16:05:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758927958; x=1759532758; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ITn77mvtxVtkW93LBycvqvZjY5ygXOxy4b0IYF1TxFs=; b=xKM3FaQM0HrloQXtHYp/96x7hfpCSgLTgrpYrGowvC178SniFU8rnLcvmvdYvkTuO3 oTuheCZhex4Wut3hZnir1LULO7W+hyuN6FOUJFPcqesIcygiG0UrA+l9h1z2gTZi64/X zoGtqQpp+luRA9qXfVwP2x5qdJVdM1VT+ZIIDv0hiFjnagTFSaj2qdvJBzgndFVXvADX fMHoMQXkKStClQP92BpuBjNN8MvqsWhjNF7JRCtlJNyMuCABxJF2tBtjRQIUd0kHuQdS xWbZWjEp688ncWt55wTGlw+s4x9Qw7d98Qyonq0rqcnaPABLkL0depL5n637lLCHnBzf 6fdA== X-Forwarded-Encrypted: i=1; AJvYcCUxo1c1QRGEdxnwXKi+E3n1fp95aEwm2XCDhynLewetiC2hjGss43/KEk4CEQlqRR82Czko/wRWwlU=@passt.top X-Gm-Message-State: AOJu0Yw/ziEQLBlsP5sy4P38lpG2cRux9ugYf5i07qkejj1nM4LTSMvW hXYqDyZlGINfmRAdI5np9qzTX4kPhwaPFtNy0/sW1l/6PArJ0vNuF5qZ0e/kheVrVadixuAXQEH kRu9wedCZvtZq2lZpEku9H2JU4OyD2XzcQ39sM8LfAhjuaLeVFoMefg== X-Gm-Gg: ASbGncuXHpHEtlQ6B5nkxT2aMa+9PjiUnu5m6STMCJSKSlexEcvNwid9dyh1ATLk6fT Q91DxvpcFk55ycZsmZKnkMt3waPxMBo1f2BTk1RrcfB7e1Gy9sUxuSsdkDEehEKUred4SBG2m9l AG3GsSvIKBCsgI8Fv8OB3tvty7bKc0dGGFMJVIaVg9B6m57nBytRJo9mEXWFpK1UHGgevbHPyaG 7j8ekmCN8NpwgkFPUU2ceJkwgm/+dMo9zNlGhxFoBofZp9vhzcDXmeODJ1KJUWY6OhDEVjseZzy WrgLO4WTT6Pc904Ji5N5zl3c5+Eg6Rk3ZtKtPR2bcbrRwO6C7NaLbR4tImvA11JitQCjbBg0Ebs bo1MPJW7iCA== X-Received: by 2002:ac8:5852:0:b0:4b7:9ffb:18a0 with SMTP id d75a77b69052e-4da4cd4a061mr104906241cf.68.1758927958135; Fri, 26 Sep 2025 16:05:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHnr9DBz38ZiQlXNN8BwuLv/bWlM756Zurb1Lyrc211EJR9n4lh+3fmzfjDi+ZqY+UvyzBnWQ== X-Received: by 2002:ac8:5852:0:b0:4b7:9ffb:18a0 with SMTP id d75a77b69052e-4da4cd4a061mr104905951cf.68.1758927957660; Fri, 26 Sep 2025 16:05:57 -0700 (PDT) Received: from ?IPV6:2001:4958:2193:9901:6217:960c:2ef1:f0f3? ([2001:4958:2193:9901:6217:960c:2ef1:f0f3]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4db0b56fd8fsm33214171cf.22.2025.09.26.16.05.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Sep 2025 16:05:57 -0700 (PDT) Message-ID: <68dc6be3-9dad-422f-8c4f-ab5bdb580b5b@redhat.com> Date: Fri, 26 Sep 2025 19:05:56 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v9 9/9] arp/ndp: send gratuitous ARP / unsolicitated NA when MAC cache entry added To: David Gibson References: <20250924011330.1168921-1-jmaloy@redhat.com> <20250924011330.1168921-10-jmaloy@redhat.com> <5dda48fc-d854-436d-acd1-734d461efd59@redhat.com> From: Jon Maloy In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 4NYnI-GLUcqeqpxkA3zM4DN3lvEWbpYExuBWDkItFh4_1758927958 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID-Hash: YZQXYH6YLCUULQO4JUXVHIXRAXJEOHCK X-Message-ID-Hash: YZQXYH6YLCUULQO4JUXVHIXRAXJEOHCK X-MailFrom: jmaloy@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: sbrivio@redhat.com, dgibson@redhat.com, passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 2025-09-25 20:55, David Gibson wrote: > On Thu, Sep 25, 2025 at 09:14:42AM -0400, Jon Maloy wrote: >> >> >> On 2025-09-25 02:36, David Gibson wrote: >>> On Wed, Sep 24, 2025 at 06:18:52PM -0400, Jon Maloy wrote: >>>> >> [...] >>>> >>>> I experimented a bit with this. My test program is a simple UDP >>>> client-server pair, exchanging first 3 UDP messages client->server, followed >>>> by >>>> 3 messages server->client. >>> >>> With the client on the guest, and server outside? How is the outside >>> machine arranged - is it a physically separate host? A bridged VM or >>> container on the same host? Something else? >> >> It is a physically separate host. >> >>> >>>> First, I changed the main() loop a bit, so that netlink events are >>>> handled before all other events, if any. (Basically, I added >>>> an extra loop before the main loop, only handling netlink events, before >>>> moving on to the main loop (where netlink events had been excluded.) >>>> This should secure absolute priority of netlink events before any other >>>> events. As you will see below, this made no difference to the scenarios >>>> I describe. >>> >>> Drat. >>>> 1: When starting the container, I notice that there is no subscription >>>> event in PASTA, even though I can see the entry for the remote host >>>> is present in the host's ARP table. There is never any event coming >>>> up even if I wait for 10+ minutes. >>> >>> Huh.... do we need to do something to ensure we get events for >>> existing entries in the host ARP table, not just ones that are added >>> or updated after we're running? >> >> It doesn't seem to be possible, It actually *is* possible, and I just implemented it. It doesn't solve all problems, but makes a huge difference. I will add it in v10. > > Can we do an RTM_GETNEIGH, with no address specified? It's something > like that we do to get all our links and addresses in other places. > >> but even if it were it wouldn't help us much >> if the entry isn't here, which is also a problematic case. See below. >> >>> >>>> 2: The first UDP is attempted sent from the guest. An ARP request is >>>> sent to PASTA, and responded to with the 9a:9a: address. >>> >>> Maybe we still need to explicitly ask for an ARP resolution when the >>> guest ARPs. >> >> I think so. If we limit this to ARP and NDP, this should be unproblematic. > > I just realised this is harder than I thought, though. At least if we > want to get the right answer for the first guest ARP. It's not just a > netlink request, we'd need to wait for the host to ARP, which means > timeouts, and state we need to track, and ... Yes. I think with the above it is as good as it gets, and it isn't bad. ///jon >