From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTP id E267F5A0272 for ; Thu, 28 Dec 2023 19:25:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1703787942; 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=F/TpWIhaodtcKOW02tBCFOBAkf8FbdT0Zd2w2vkB5GU=; b=gNmeARmgQtQVuKA2FkG5K+97h2h+asLN6D1pwGraT0ziTqhxcjTIFlCEhWpoByt6Eci5oR mUJtYGjPzhmk2/rOgRmySWBPjdlt3JwnAw0BrKuQggqdLXJhSzPDEGzAX1VyYFcQNPu7In 1r44Ch4nXXFZYdJQXE5m9QM6R2H3hSA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-101-1gyZLG1jNZartVqZMEd9vg-1; Thu, 28 Dec 2023 13:25:21 -0500 X-MC-Unique: 1gyZLG1jNZartVqZMEd9vg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8B684832D1A; Thu, 28 Dec 2023 18:25:21 +0000 (UTC) Received: from elisabeth (unknown [10.39.208.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B4A1E492BE6; Thu, 28 Dec 2023 18:25:20 +0000 (UTC) Date: Thu, 28 Dec 2023 19:25:18 +0100 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH v3 10/13] flow: Move flow_count from context structure to a global Message-ID: <20231228192459.312cc508@elisabeth> In-Reply-To: <20231221061549.976358-11-david@gibson.dropbear.id.au> References: <20231221061549.976358-1-david@gibson.dropbear.id.au> <20231221061549.976358-11-david@gibson.dropbear.id.au> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 5F6LLGWH34TE6SJAGECYUB242C5DKXSQ X-Message-ID-Hash: 5F6LLGWH34TE6SJAGECYUB242C5DKXSQ 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: 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 Thu, 21 Dec 2023 17:15:46 +1100 David Gibson wrote: > In general, the passt code is a bit haphazard about what's a true global > variable and what's in the quasi-global 'context structure'. The > flow_count field is one such example: it's in the context structure, > although it's really part of the same data structure as flowtab[], which > is a genuine global. Well, the reason is that flow_tab[FLOW_MAX] might be problematically too big to live on the stack, unlike flow_count. But anyway, as far as thoughts of multithreading are concerned, both should probably be global. And sure, it's more consistent this way. > Move flow_count to be a regular global to match. For now it needs to be > public, rather than static, but we expect to be able to change that in > future. If it's not static, it should be initialised, and that's not done here. This becomes 'flow_first_free' in 13/13, but it's not initialised either, and that should also start off as zero. -- Stefano