From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=none 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=S32/VuQE; 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 7BFF25A0624 for ; Sat, 01 Feb 2025 08:45:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738395924; 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=+/u0fPIZacPxNHPUmqANux7i2XAvinwN9vxqvfpxlf4=; b=S32/VuQEGel42dMp6kPoPz+fjso8mOdGjPk/CF0BfSRCFXTNqcIX49WqYUqIHyxNLKPIJj ArsRmFSO9O9hCcldnP53tPE7VFJqmKhPo0hdulIGeJDzRujP9DiOTHsANJojAYOvFnR5CO hTP5R8oRwNPbs6S5b3aAmQY1P6rOOPY= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-321-E9Ayj0XiOEOTHLobQNj1-w-1; Sat, 01 Feb 2025 02:45:22 -0500 X-MC-Unique: E9Ayj0XiOEOTHLobQNj1-w-1 X-Mimecast-MFC-AGG-ID: E9Ayj0XiOEOTHLobQNj1-w Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-38bf4913669so1237949f8f.2 for ; Fri, 31 Jan 2025 23:45:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738395922; x=1739000722; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=+/u0fPIZacPxNHPUmqANux7i2XAvinwN9vxqvfpxlf4=; b=sWEtAEWBjdk0EVAdBnYYMLyNjkivifhAxaZF00k5W/K/9y6qpSTxX6EXisXU8DryxP oezaBMN8/aD+bNsdiIbrig+fVE70jYeK4OKNI5peFFk0F5LZn+CpBYD1D/xJ3SSldcMA JFWTUAjovFz08OoqYi57n7i5SZnRcbBjXvkrI23kmykcR9yox9G+qQF3Y1pMTieX4y1J Efb3V09iiKsXp6O6pVQEMw9Jxin0eXrF0TZTU14RFTpkmHP7GS6Bi+4Jyns06VaBmIS1 teGGvDVDx+wA408pGKb4b1h38qfZF5jNH2HhrNJDciABlG5Kx0qjPOSpaRZRQp5KaPqu E9eg== X-Gm-Message-State: AOJu0Yw+gwEiAnQ+JoG23AT/I2zAUBBpuDJU4KoBU8Moc6vCaws49SJ1 f52fXiH4Bdvugalra3nSYVRGwabbHOoyFGMZrz0w84cORJigwKEUwuGk3gVIYQkRIGGsJCryIGC Qc6JmlMhx5fJnRii2g6P9TTLIgahGy+nRv8PgCxmTJQfu94CXow== X-Gm-Gg: ASbGncvoUfNDnTt7GlaPSpI+q3c7rEunuHeIJ4nQ5JYAcYAR36RtYpJesWC0+Gzge03 myLgp4ETDopbJZVsA4xyzmuqSKxMaI33G/KJPfaFw3TTlvkZCh3eEtaK00HVeO3/snHHuYfUHyd 2f4NK71nKHtMQ2qmf7gCJcHTH1btWbbeA14dcOC6ws2NhyV/oghClSKRDFq25kUJfBZrFRywMP6 GZyBwNZDQQFF7Rw0LneZGU/j1EawTuNrioX0QT7Jkya3ziakHa/LihKs79fhq8nxq24zLDbW2I8 deZfQuP9wXbUtObLx88LUTf1qbNwNQ81Cw== X-Received: by 2002:a05:6000:1545:b0:385:d7a7:ad60 with SMTP id ffacd0b85a97d-38c5193102emr11614544f8f.3.1738395921792; Fri, 31 Jan 2025 23:45:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IGZP51WZDhMWGqE7hCxUM/hA/eZ/qPUXVfYkOkX+3Yjbof+6S/40Wvqe/7/GbpTIlVpOpHs1w== X-Received: by 2002:a05:6000:1545:b0:385:d7a7:ad60 with SMTP id ffacd0b85a97d-38c5193102emr11614528f8f.3.1738395921412; Fri, 31 Jan 2025 23:45:21 -0800 (PST) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438dcc6df1esm115179305e9.27.2025.01.31.23.45.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jan 2025 23:45:20 -0800 (PST) Date: Sat, 1 Feb 2025 08:45:18 +0100 From: Stefano Brivio To: passt-dev@passt.top Subject: Re: [PATCH v3 00/20] Draft, incomplete series introducing state migration Message-ID: <20250201084518.04689645@elisabeth> In-Reply-To: <20250131193953.3034031-1-sbrivio@redhat.com> References: <20250131193953.3034031-1-sbrivio@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: aLfTkvAuPzyWdYS9MZp4cuYNrvApwjiYIUJrMDic6ec_1738395922 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 2JU5PIJZP7Y2UNFDBCCI2DPPE2WJPUOH X-Message-ID-Hash: 2JU5PIJZP7Y2UNFDBCCI2DPPE2WJPUOH X-MailFrom: sbrivio@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: Laurent Vivier , David Gibson 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 Fri, 31 Jan 2025 20:39:33 +0100 Stefano Brivio wrote: > What clearly needs changes: Maybe something less elegant but actually functional like: --- static int migrate_data_v1(int fd, struct ctx *c, bool target) { struct iovec context[] { /* All these need to be network endian */ c->hash_secret, sizeof(c->hash_secret), c->ipv4.addr_seen, sizeof(c->ipv4.addr_seen), c->ipv6.addr_seen, sizeof(c->ipv6.addr_seen), c->ipv6.addr_ll_seen, sizeof(c->ipv6.addr_ll_seen), /* Leave NDP's next_ra alone, start from 0 */ &log_written /* Drop static */ sizeof(log_written), }; int rc; if (target) rc = read_remainder(fd, context, ARRAY_SIZE(context), 0); else rc = write_remainder(fd, context, ARRAY_SIZE(context), 0); if (rc) return errno; if (target) return flow_migrate_data_target_v1(fd, c); return flow_migrate_data_source_v1(fd, c); } --- and: --- struct tcp_flow_transfer_v1 { struct flow_common f; uint8_t retrans; uint16_t ws_from_tap; /* All BE */ uint16_t ws_to_tap; uint16_t tap_mss; ... } __attribute__((packed)); union flow_transfer_v1 { struct tcp_flow_transfer_v1 tcp; ... }; int flow_migrate_data_source_v1(int fd, struct ctx *c) { for_each_active_flow(flowtab) { union flow_transfer_v1 d; switch (flow->f.type) { case FLOW_TCP: d.tcp.f = flow->f; d.tcp.retrans = flow->tcp.retrans; d.tcp.ws_from_tap = htons(d.tcp.ws_from_tap); ...; /* Fetch window stuff, socket must be in repair mode */ send(...); } int flow_migrate_data_target_v1(int fd, struct ctx *c) { ... } And I'm not sure about "[PATCH 0/2] Fancier version handling for migration": perhaps we could switch to something radically easier from the beginning. I mean, as we have to drop the declarative approach altogether, at least let's minimise LoCs... -- Stefano