From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AEF8B284662; Thu, 18 Jun 2026 21:12:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.89.141.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781817156; cv=none; b=G4GgdNdEzmb+1/Hrm/ccLbCh37b1LKph+Sl4xabrVHbji/y82R8WECJzp1yu6QOUtwWhcKUC+ZLzsCQwFMTQ3muT0JnE4k+JGqnBj4bMihPYB+OBzlHyA2RjTgAqVHzrAchJqUaDMWdNhgdmK79p0sEfGmj3HUxLdvtKywV91Ts= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781817156; c=relaxed/simple; bh=K3qESzyCheBDLi5ScRh7TdjxExqxcUymoAQ3JTLgyw8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=H8dS2fu8TZqgomNGQFK7XxQetfBFkUQuqvMRGZ+3MxV0l86rkDb0i1pJ5b9qvjzY0XIOpkh2S/TygEpnEJoLQOTrZ7o9dT/keZTuHaw7LAGzNP/ngf3XzKkjKGjPEOiKcW23IHomwtL2QM/iE3c7VEBon0T/utTrXDWbFn9mW6A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk; spf=none smtp.mailfrom=ftp.linux.org.uk; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b=MR1Fz1ld; arc=none smtp.client-ip=62.89.141.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ftp.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="MR1Fz1ld" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=K3qESzyCheBDLi5ScRh7TdjxExqxcUymoAQ3JTLgyw8=; b=MR1Fz1ldJ8AX3Wa/b01tCIUea+ r4CnL0w0Q2FdSp1Lnd3VOZ2Ja/4sjatLet/NHGxTi414L+R12g8b6MMg5EyB/yMMwDhKeoBcCHWSE lD62lZVns1TcLeperitfM7Ivle+w4SbfGmTQ9BCm7e/ISXLhP15od85jEkYDVN/swObKKnDzkGgMi PG2A5mg7rMuoprs81fZHA5HrYm6KV3sJNsY2AMWOPse6bTkD8AdOhJ2bGhsHr3CHB70kI36L4nOH5 4roBMEZKNCGK9exDqotV1sJoHcwtHOvkg+grqI06JWRhu8NN3bO/krND20g8iG9/ACuJjzQw4AIHQ QNYpE6dg==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.99.4 #2 (Red Hat Linux)) id 1waK2J-00000006tbX-3jK8; Thu, 18 Jun 2026 21:12:32 +0000 Date: Thu, 18 Jun 2026 22:12:31 +0100 From: Al Viro To: Alex Goltsev Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: add sock_open() for unified socket creation Message-ID: <20260618211231.GB2636677@ZenIV> References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro On Thu, Jun 18, 2026 at 04:06:31PM +0300, Alex Goltsev wrote: > +/** > + * sock_open - creates a socket (unified interface) > + * @family: protocol family (AF_INET, ...) > + * @type: communication type (SOCK_STREAM, ...) > + * @protocol: protocol (0, ...) > + * @res: new socket > + * @sock_type: one of SOCK_USER, SOCK_KERN, or SOCK_LITE > + * > + * Unified entry point for all socket creation variants. > + * SOCK_USER creates a userspace socket (via sock_create). > + * SOCK_KERN creates a kernel socket (via sock_create_kern). > + * SOCK_LITE creates a lightweight uninitialized socket (via sock_create_lite). > + * > + * Return: 0 on success, negative errno on failure. On failure @res is NULL. > + */ What's the point (and why not make it inline, while we are at it)? Are there really callers that would pass a non-constant value as the last argument, and if so, what are they doing next?