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 C8BA95A027A for ; Wed, 29 Nov 2023 15:32:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701268361; 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=XNkN1ZdziPh5ggSmP6my3h9wmr8THzPu/hUzb0RADZI=; b=AgfKBiozdEeF+eFd0Jv4nzV0S6B1PLEMYBRz2LXz1sGZTz9l+TVr+J5heGBnmh7wKa6GWB 1vUcU1djC8GSIb+n4FaQlj6LKlR8KvnpaJgOO+uG2r00BXvfgNjXQXJmlM4YkAuPE8DfDs LL5NmdJfzUtvBwYfwZjJbIWALVaeG2Q= 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-159-0FjpGFlGMOmcJJ2A0l0g-Q-1; Wed, 29 Nov 2023 09:32:36 -0500 X-MC-Unique: 0FjpGFlGMOmcJJ2A0l0g-Q-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 0A150101A53B; Wed, 29 Nov 2023 14:32:36 +0000 (UTC) Received: from elisabeth (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 41BF449BB67; Wed, 29 Nov 2023 14:32:34 +0000 (UTC) Date: Wed, 29 Nov 2023 15:32:32 +0100 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH v2 07/11] flow: Introduce 'sidx' type to represent one side of one flow Message-ID: <20231129153232.6abfe53c@elisabeth> In-Reply-To: <20231126233348.1599864-8-david@gibson.dropbear.id.au> References: <20231126233348.1599864-1-david@gibson.dropbear.id.au> <20231126233348.1599864-8-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: UOZYTMVO6LZSMDHPJYZDATVXYI4DVNHI X-Message-ID-Hash: UOZYTMVO6LZSMDHPJYZDATVXYI4DVNHI 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 Mon, 27 Nov 2023 10:33:44 +1100 David Gibson wrote: > In a number of places, we use indices into the flow table to identify a > specific flow. We also have cases where we need to identify a particular > side of a particular flow, and we expect those to become more common as > we generalise the flow table to cover more things. > > To assist with that, introduces flow_sidx_t, an index type which identifies > a specific side of a specific flow in the table. > > Signed-off-by: David Gibson > --- > flow.h | 13 +++++++++++++ > flow_table.h | 36 ++++++++++++++++++++++++++++++++++++ > 2 files changed, 49 insertions(+) > > diff --git a/flow.h b/flow.h > index b6da516..3c90bbd 100644 > --- a/flow.h > +++ b/flow.h > @@ -39,6 +39,19 @@ struct flow_common { > #define FLOW_TABLE_PRESSURE 30 /* % of FLOW_MAX */ > #define FLOW_FILE_PRESSURE 30 /* % of c->nofile */ > > +/** > + * struct flow_sidx - ID for one side of a specific flow > + * @side: Side referenced (0 or 1) > + * @flow: Index of flow referenced > + */ > +typedef struct flow_sidx { Implying my usual argument :) ...is there any advantage over using this simply as a struct? > + int side :1; > + unsigned flow :FLOW_INDEX_BITS; > +} flow_sidx_t; -- Stefano