From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA1D8EE020C for ; Wed, 13 Sep 2023 19:39:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231678AbjIMTkB (ORCPT ); Wed, 13 Sep 2023 15:40:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230475AbjIMTj7 (ORCPT ); Wed, 13 Sep 2023 15:39:59 -0400 Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A22091 for ; Wed, 13 Sep 2023 12:39:55 -0700 (PDT) Received: by mail-il1-x12e.google.com with SMTP id e9e14a558f8ab-34bae11c5a6so286455ab.0 for ; Wed, 13 Sep 2023 12:39:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1694633995; x=1695238795; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=tft1HooN87hi/19RuephXAGarkXU4BD94o5nCoYckJ8=; b=pNQ0oV1Wwn3LRIFz/Kn8b8xec3OuZPtPpz/wzOcOfDndpvgi6/oE8Y8qDS1W23RBl/ gsjsyUxgzV9SIXxLsBhEz80kFbNmjjpntZ2K+hIlCRuuIDc00ARCHjsP2qjsFFYtU+8d adccqSp4pwsT+Mz+rfrjOUbXf5MZkx2ttYieZyLeznSDIVl7vxk/UVTDRNWzfEImsJa2 PYLUNpD6cKeZ9HGUhFlqIKpCKka8NMUE/rvZWMq+HUQfLMg3SlO+OdX865sPO7923rkw ZPICN4yBO6BpIhqGWUztAfkHMugorYZALESivKg4DLoAmMinwMhcfYZGwuIXziPys7SH SleQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694633995; x=1695238795; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tft1HooN87hi/19RuephXAGarkXU4BD94o5nCoYckJ8=; b=YDqBFT/Xrjy2Ln+h18rsyOsGygazSBCL7Hw6thq6JGsSoM0iXz9wVAqplY3bnAsyiN jVXiCs+Hf/99PuFygjXRg3H6Yeech9VPg4mxSE2DghEK+pZRzg40baoddBOvur87IIfF g1roxkrqCCRadQOPvAkYjb5JrGeEa7jmGRT8vWtO4vbKTTZdO19is1RKwcwWDYbcfybT L1SGjxQ6m9XAh/3QuBJgpF44ajkQfaAhPsvefr/x32H2isdNe8ptXNbpMd10Ne5a85w6 orCHibXCYxWCfE5zLe0SMoZlQ5u01O8lZ7mk/xIF7lyJ+SUUzl0nYRDFj208v+NBOHuo fKxA== X-Gm-Message-State: AOJu0Yw7msjy6h64gfV/f/4NiKcrdiIHGFKRaXr+QkdulA833+Hfr3xl sW+T53Qz2o7mktPlF9+hTo8zYw== X-Google-Smtp-Source: AGHT+IGtBzcobfCWCkQ5HPj4+SqKK9ECxFRGlGCGQqDAtr3vPCIrAPClhL0Dsulx18cZsBLQCEwl2g== X-Received: by 2002:a92:d986:0:b0:349:4e1f:e9a0 with SMTP id r6-20020a92d986000000b003494e1fe9a0mr3254955iln.2.1694633994913; Wed, 13 Sep 2023 12:39:54 -0700 (PDT) Received: from [192.168.1.94] ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id d4-20020a056e02214400b0034ac1a32fd9sm2500863ilv.44.2023.09.13.12.39.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 Sep 2023 12:39:54 -0700 (PDT) Message-ID: Date: Wed, 13 Sep 2023 13:39:53 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 7/8] io_uring/cmd: Introduce SOCKET_URING_OP_SETSOCKOPT Content-Language: en-US To: Breno Leitao , sdf@google.com, asml.silence@gmail.com, willemdebruijn.kernel@gmail.com, kuba@kernel.org, pabeni@redhat.com, martin.lau@linux.dev, krisman@suse.de Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, io-uring@vger.kernel.org References: <20230913152744.2333228-1-leitao@debian.org> <20230913152744.2333228-8-leitao@debian.org> From: Jens Axboe In-Reply-To: <20230913152744.2333228-8-leitao@debian.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/13/23 9:27 AM, Breno Leitao wrote: > Add support for SOCKET_URING_OP_SETSOCKOPT. This new command is similar > to setsockopt(2). This implementation leverages the function > do_sock_setsockopt(), which is shared with the setsockopt() system call > path. > > Important to say that userspace needs to keep the pointer's memory alive > until the operation is completed. I.e, the memory could not be > deallocated before the CQE is returned to userspace. This is different than other commands that write data. Since IORING_FEAT_SUBMIT_STABLE was introduced, any command that writes data should ensure that this data is stable. Eg it follows the life time of the SQE, and doesn't need to be available until a CQE has been posted for it. This is _generally_ true, even if we do have a few exceptions. The problem is that then you cannot use user pointers, obviously, you'd need to be able to pass in the value directly to do_sock_setsockopt()... -- Jens Axboe