Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp11410604rwd; Thu, 22 Jun 2023 12:55:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5kWbdoPOIerpSVzA05sa6LgB8oaErQJs8Uh2psa0na4YLQXB5uaC406RBo5WV6Zr0PksGw X-Received: by 2002:a17:90a:f284:b0:25e:93ee:ac0d with SMTP id fs4-20020a17090af28400b0025e93eeac0dmr11467110pjb.42.1687463728919; Thu, 22 Jun 2023 12:55:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687463728; cv=none; d=google.com; s=arc-20160816; b=zVtwcz/bUYKMgkJnHcmHZX2koOrORrgGmZN0CIeb+8GWsIFqn5QeTMZqNp1mfwset0 l1CDBPceedL86E2hCqXpQKN2eWWfw4POsstTAvxWtwBbAHEEJWIl8c0kYpCaepun0e79 A/OVyzx62CpSe4awGOoabhmX8fhVxkMFwWSc0X6ZbxmkulyMJLI9W9/mfxwhoZ+chq8z 15SmN2y80QlOoWDfBV9JFWxBO7Comt7huBOVSAGVZxuwqWlSiqpMkqGFr5NeR2KMObdb g7ROikFO6HAWIMLH8cmwj/STWTF2IKsqh0n4wqWUsFwX4GmFiuQfS6oDXP4FUfTP44zh kTqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=+D7IxMvZiNc4XLA71ABTPWob0+kv7MAt7f1wzI5iIVk=; fh=Agpwp6L/XOFKRc9Sh4mVWWzyGiBrAnAyfiW3uuLsE7g=; b=tJaI79bDyJ67M4WgxITJcGSWyO1emujZqGgZKC8EdtpLybYSBs7wVjh5EXaxb8fOgM fkc1xy09ffl6EyfZswN1TTb0wpXRfJ9tXOck1iAMxZduCaXZ9t2zIkkDHOUSll3PuAJb U+v93wq1y8LCJRH1ws5nYWTJTPEFy9QDTELtbl430ZOJfwnWOO5l7YwCzNwHxgpCcaDt JD3iga5vfDK7+mMJ94f17EC1usKXcHhFO8v5g39rxL5j07c+ETaDVtVzdLF7CwK1BSo3 IPKJV5VjCw8USbubwhZjVElIWe/Ls8cWPLtr1JxdzO4j438d3D5ppprjiyaJVlpyKwqd CTwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ob13-20020a17090b390d00b0025bde5b7785si302027pjb.105.2023.06.22.12.55.17; Thu, 22 Jun 2023 12:55:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231140AbjFVS55 (ORCPT + 99 others); Thu, 22 Jun 2023 14:57:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230132AbjFVS54 (ORCPT ); Thu, 22 Jun 2023 14:57:56 -0400 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83BAC9B; Thu, 22 Jun 2023 11:57:54 -0700 (PDT) Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-3113dabc549so6373464f8f.1; Thu, 22 Jun 2023 11:57:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687460272; x=1690052272; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+D7IxMvZiNc4XLA71ABTPWob0+kv7MAt7f1wzI5iIVk=; b=iZ/UfTaOiB84bHYkRP8lgxCMFXL2DnnjP0dYt7uh8xnsz37f+pbDUsGPE25VXIPSio sLqnLAK4NGzhoaHXVU5pdfniRsh3E01SqcVGCMrLerKabWbwrTMJq8iUklm9T7Jy7Fld qjWUGDRR8St1rcjnJ//NsvGVwgquT74CAD4Hry+Qpsro/6Jc81i3sR+LnftPERbaQIms sBl0TEZUUuOKDP4cenx3BL12kjLd+ZCqUEwrXRsgaX8QpNXpeCqpyWIzA1Vl+W1ATSEK UJ4sxaVtVsHYyKf+v7G/gSQgcgB6RANPEXCe7J5A36nO29YJmcwuTE+ZNNLu9gyAYffE TUCQ== X-Gm-Message-State: AC+VfDwaCT6mbRbODzzla/jebSR0oqIbD7wHuRqJJkhvIQZEVChPT3AY s/27+a7llhCOY6uhoxEtjt8= X-Received: by 2002:a5d:530f:0:b0:311:14ab:5621 with SMTP id e15-20020a5d530f000000b0031114ab5621mr20128451wrv.30.1687460272341; Thu, 22 Jun 2023 11:57:52 -0700 (PDT) Received: from gmail.com (fwdproxy-cln-120.fbsv.net. [2a03:2880:31ff:78::face:b00c]) by smtp.gmail.com with ESMTPSA id e25-20020a5d5959000000b003063db8f45bsm7660178wri.23.2023.06.22.11.57.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 11:57:51 -0700 (PDT) Date: Thu, 22 Jun 2023 11:57:49 -0700 From: Breno Leitao To: Greg Kroah-Hartman Cc: Jonathan Corbet , Jens Axboe , Pavel Begunkov , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , leit@meta.com, Arnd Bergmann , Steve French , Lu Baolu , Jiri Slaby , Stephen Hemminger , Jason Gunthorpe , Simon Ser , "open list:DOCUMENTATION" , open list , "open list:IO_URING" , "open list:NETWORKING [GENERAL]" Subject: Re: [PATCH] io_uring: Add io_uring command support for sockets Message-ID: References: <20230621232129.3776944-1-leitao@debian.org> <2023062231-tasting-stranger-8882@gregkh> <2023062208-animosity-squabble-c1ba@gregkh> <2023062228-cloak-wish-ec12@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2023062228-cloak-wish-ec12@gregkh> X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,FSL_HELO_FAKE, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 22, 2023 at 07:03:04PM +0200, Greg Kroah-Hartman wrote: > On Thu, Jun 22, 2023 at 09:38:15AM -0700, Breno Leitao wrote: > > On Thu, Jun 22, 2023 at 06:10:00PM +0200, Greg Kroah-Hartman wrote: > > > On Thu, Jun 22, 2023 at 08:02:37AM -0700, Breno Leitao wrote: > > > > On Thu, Jun 22, 2023 at 07:20:48AM +0200, Greg Kroah-Hartman wrote: > > > > > On Wed, Jun 21, 2023 at 04:21:26PM -0700, Breno Leitao wrote: > > > > > > --- a/Documentation/userspace-api/ioctl/ioctl-number.rst > > > > > > +++ b/Documentation/userspace-api/ioctl/ioctl-number.rst > > > > > > @@ -361,6 +361,7 @@ Code Seq# Include File Comments > > > > > > 0xCB 00-1F CBM serial IEC bus in development: > > > > > > > > > > > > 0xCC 00-0F drivers/misc/ibmvmc.h pseries VMC driver > > > > > > +0xCC A0-BF uapi/linux/io_uring.h io_uring cmd subsystem > > > > > > > > > > This change is nice, but not totally related to this specific one, > > > > > shouldn't it be separate? > > > > > > > > This is related to this patch, since I am using it below, in the > > > > following part: > > > > > > > > +#define SOCKET_URING_OP_SIOCINQ _IOR(0xcc, 0xa0, int) > > > > +#define SOCKET_URING_OP_SIOCOUTQ _IOR(0xcc, 0xa1, int) > > > > > > > > Should I have a different patch, even if they are related? > > > > > > Yes, as you are not using the 0xa2-0xbf range that you just carved out > > > here, right? Where did those numbers come from? > > > > Correct. For now we are just using 0xa0 and 0xa1, and eventually we > > might need more ioctls numbers. > > > > I got these numbers finding a unused block and having some room for > > expansion, as suggested by Documentation/userspace-api/ioctl/ioctl-number.rst, > > that says: > > > > If you are writing a driver for a new device and need a letter, pick an > > unused block with enough room for expansion: 32 to 256 ioctl commands. > > So is this the first io_uring ioctl? If so, why is this an ioctl and > not just a "normal" io_uring call? This is a way to pass a generic command to file. This is not a ioctl per se (not called through ioctl). I am leveraging the ioctl to embedded the "direction" and "size" information in the command itself. I can defintely do something as the following, if it is a better implementation: #define SOCKET_URING_OP_SIOCINQ 0 #define SOCKET_URING_OP_SIOCOUTQ 1