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 00A695A004F for ; Thu, 04 Jul 2024 23:20:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720128020; 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=3ZaViDeIpV4f4TQTbp6nRvlx7O1Bw+DkOpKxudRjmPs=; b=A1GwzSIkR+g3j1C7obUSnx1MggPUJqNk0gRmQIF6xnUxvOM57NPbLC31naF+iCIHwi/Ndq j7nNkt2E4nDd4DQjPy3LSKxaDYev6N8Ed8AkiudDSvQPXMKm1s4udHF3vPh17y6U9tGtz5 OowP1axVkngjb3Otcb1a7+cuyl5DaNw= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-623-HgNT3ESxPGaNsPQ-k1xxyQ-1; Thu, 04 Jul 2024 17:20:19 -0400 X-MC-Unique: HgNT3ESxPGaNsPQ-k1xxyQ-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-6b5d97b7431so13267526d6.3 for ; Thu, 04 Jul 2024 14:20:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720128018; x=1720732818; 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=3ZaViDeIpV4f4TQTbp6nRvlx7O1Bw+DkOpKxudRjmPs=; b=gldwVQ3rpIQ3l4rDAsAEe4Jg15vu5f8M4nMsQ2XsePsAHCS2ehJICJqEB/CPsiHBrN sR5s5UVAwHbcLR6MhU+8RzWLQK2j6sOCRP9lzZURx+xHC47iawwKi6SYoxnfuJFFQF9U nU2eEt0m3d5TU8TyWH9zhLoBjOuZFhQBUZypnxTddxw7BJUdomDRSQNhcv6/ctOyhK9z rQmtVuEIQ2B22ZvD93cNP3aKVOGblILRR8+f+I1HBpTG9+r8h7HaT4fp44hcLUeutS85 Wi+7DzOX+2jsY8h+N3lj33cvTwo0tGM6Q6KwymW5uQQsC9VqJwWTSFwUZN2R60BQOeLn QXow== X-Gm-Message-State: AOJu0YxEKb1hROFdD8ti4EPEe5HUtBow1M1fHBRWExS/afthCNXZO+TK 4tH9cqMlDXmlblfNDkJ5TknU8qsrfZVCf0j6NlxUCY4Y3jAFH+3ZjrmquzTldfCCquQnZLkGG7X igbzC6P0pt22MSsz2t9o5XtL5sR0mnCZXMWKz0J/PbrvNvh39b/hGINcgMJwC X-Received: by 2002:ad4:5bc7:0:b0:6b4:fe1a:eeee with SMTP id 6a1803df08f44-6b5ed251062mr40311486d6.46.1720128018149; Thu, 04 Jul 2024 14:20:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGpfEe8b0UgnXQ8uDsOYRAIrN/YOQ8/sTfHNivDf3ynWqktE2NgelNoAsMbBeWQ1myBuRT/4w== X-Received: by 2002:ad4:5bc7:0:b0:6b4:fe1a:eeee with SMTP id 6a1803df08f44-6b5ed251062mr40311296d6.46.1720128017839; Thu, 04 Jul 2024 14:20:17 -0700 (PDT) Received: from maya.cloud.tilaa.com (maya.cloud.tilaa.com. [164.138.29.33]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b59e5770fasm66364746d6.62.2024.07.04.14.20.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jul 2024 14:20:17 -0700 (PDT) Date: Thu, 4 Jul 2024 23:19:25 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 01/11] util: sock_l4() determine protocol from epoll type rather than the reverse Message-ID: <20240704231925.7f663869@elisabeth> In-Reply-To: <20240704045835.1149746-2-david@gibson.dropbear.id.au> References: <20240704045835.1149746-1-david@gibson.dropbear.id.au> <20240704045835.1149746-2-david@gibson.dropbear.id.au> 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-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: THNKZIY3WPHHLUXI3WREIXZCGZARLEDO X-Message-ID-Hash: THNKZIY3WPHHLUXI3WREIXZCGZARLEDO 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, 4 Jul 2024 14:58:25 +1000 David Gibson wrote: > sock_l4() creates a socket of the given IP protocol number, and adds it to > the epoll state. Currently it determines the correct tag for the epoll > data based on the protocol. However, we have some future cases where we > might want different semantics, and therefore epoll types, for sockets of > the same protocol. So, change sock_l4() to take the epoll type as an > explicit parameter, and determine the protocol from that. The interface is a bit surprising, but I guess it makes later changes much more convenient, so be it. Just one nit: > Signed-off-by: David Gibson > --- > epoll_type.h | 41 +++++++++++++++++++++++++++++++++++++++++ > icmp.c | 2 +- > passt.h | 32 -------------------------------- > tcp.c | 10 +++++----- > udp.c | 12 ++++++------ > util.c | 48 ++++++++++++++++++++++++++---------------------- > util.h | 3 ++- > 7 files changed, 81 insertions(+), 67 deletions(-) > create mode 100644 epoll_type.h > > diff --git a/epoll_type.h b/epoll_type.h > new file mode 100644 > index 00000000..42e876e5 > --- /dev/null > +++ b/epoll_type.h > @@ -0,0 +1,41 @@ > +/* SPDX-License-Identifier: GPL-2.0-or-later > + * Copyright Red Hat > + * Author: Davd Gibson I'm fairly sure it's spellt David. :) -- Stefano