Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1448539pxp; Sun, 6 Mar 2022 15:51:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJz0GwtLItD/mEAcPI8l2Mgx6yoA+NAQ8oPWJKQVLZ1UiIBfml6PmXMyQEf3gE3F20SEWr9e X-Received: by 2002:a17:906:1ece:b0:6ce:e14:6d92 with SMTP id m14-20020a1709061ece00b006ce0e146d92mr7262100ejj.408.1646610691239; Sun, 06 Mar 2022 15:51:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646610691; cv=none; d=google.com; s=arc-20160816; b=VdWGkh9NE7tb+hp3seUrQGXi9PLSMVeBme5nTXjCjl+y0FeV2kGsfMAumx/SciyYSz E+9UDM1Rem2tA7Lj3473c2YSutbEsyoyFYPqIvW6mw3zTFPyzYpfuBIT/25g3Kuxwd9G MLwgp8fuqpFqOUNd557mpgn0j8yQphPXOw3LlMhWtYP0jD7a0mOCgyGlVnvZfzX2qhIm 7PCW7Sh1qhn+vRV9aC3iAyz6gJTx71Bw6yOyBgC0gXLjzecErwq9kL1bZXU0rJfWv+A9 jaBIGRFUJXnp67KugHIZ8l31Bokj+vANcmgPRFriOmBl1ug1shazsNWzrw4O9AZafv4q oltg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:organization:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date; bh=eKWsHLjtARo7DAJum24l0zuLMJHKXBcakX6gio9gzS8=; b=cIkXXsex8JX/Mixz1yN6aGPAVtMqpJfRJX3cBnYcxvZumc/K79O6CAoG1Fb3mQeY9a KOcQoQDsea4X3gQIXR5c8fZBB/McvEMn76eBSc8+0a4Hv5WpJ4PtLgUt+WT9PRuzJ9d1 Cw2QTbTFjh5i8LYN4ddnU1XAO2NPiIgO2E/YSmtKgvWyxJW+/WI4xeiDDfLm+2qVi3tl 6evWYfB9Nbjp6doFUo4AlrU87aeg1WoWdmi3fiFLXfkykRQpRBwufuufI5cbnNo870Vg bt1kg8Tn3o0xGTv8wI1Po4PQCwfwXU4A269LpLuup0oxhWq8oqJvAfMhPJer3mSptqBC /eFA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=labri.fr Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i18-20020a1709064fd200b006db2ba2a9a3si1412802ejw.196.2022.03.06.15.51.09; Sun, 06 Mar 2022 15:51:31 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=labri.fr Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234065AbiCFTXj (ORCPT + 99 others); Sun, 6 Mar 2022 14:23:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233281AbiCFTXh (ORCPT ); Sun, 6 Mar 2022 14:23:37 -0500 Received: from v-zimmta03.u-bordeaux.fr (v-zimmta03.u-bordeaux.fr [147.210.215.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61F012899F; Sun, 6 Mar 2022 11:22:41 -0800 (PST) Received: from v-zimmta03.u-bordeaux.fr (localhost [127.0.0.1]) by v-zimmta03.u-bordeaux.fr (Postfix) with ESMTP id 3C04B1800F22; Sun, 6 Mar 2022 20:22:39 +0100 (CET) Received: from begin (lfbn-bor-1-255-114.w90-50.abo.wanadoo.fr [90.50.98.114]) by v-zimmta03.u-bordeaux.fr (Postfix) with ESMTPSA id E09751800F20; Sun, 6 Mar 2022 20:22:38 +0100 (CET) Received: from samy by begin with local (Exim 4.95) (envelope-from ) id 1nQwSk-0010iI-DQ; Sun, 06 Mar 2022 20:22:38 +0100 Date: Sun, 6 Mar 2022 20:22:38 +0100 From: Samuel Thibault To: Willem de Bruijn Cc: willemb@google.com, davem@davemloft.net, kuba@kernel.org, linux-kernel@vger.kernel.org, Network Development Subject: Re: [PATCH] SO_ZEROCOPY should rather return -ENOPROTOOPT Message-ID: <20220306192238.fbvp2t32fsemqssf@begin> Mail-Followup-To: Samuel Thibault , Willem de Bruijn , willemb@google.com, davem@davemloft.net, kuba@kernel.org, linux-kernel@vger.kernel.org, Network Development References: <20220301144453.snstwdjy3kmpi4zf@begin> <20220301150028.romzjw2b4aczl7kf@begin> <20220301152017.jkx7amcbfqkoojin@begin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) X-AV-Checked: ClamAV using ClamSMTP X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 Hello, Willem de Bruijn, le mar. 01 mars 2022 10:21:41 -0500, a ecrit: > > > > > > @@ -1377,9 +1377,9 @@ int sock_setsockopt(struct socket *sock, int level, int optname, > > > > > > if (!(sk_is_tcp(sk) || > > > > > > (sk->sk_type == SOCK_DGRAM && > > > > > > sk->sk_protocol == IPPROTO_UDP))) > > > > > > - ret = -ENOTSUPP; > > > > > > + ret = -ENOPROTOOPT; > > > > > > } else if (sk->sk_family != PF_RDS) { > > > > > > - ret = -ENOTSUPP; > > > > > > + ret = -ENOPROTOOPT; > > > > > > } > > > > > > if (!ret) { > > > > > > if (val < 0 || val > 1) > > > > > > > > > > That should have been a public error code. Perhaps rather EOPNOTSUPP. > > > > > > > > > > The problem with a change now is that it will confuse existing > > > > > applications that check for -524 (ENOTSUPP). > > > > > > > > They were not supposed to hardcord -524... > > > > > > > > Actually, they already had to check against EOPNOTSUPP to support older > > > > kernels, so EOPNOTSUPP is not supposed to pose a problem. > > > > > > Which older kernels returned EOPNOTSUPP on SO_ZEROCOPY? > > > > Sorry, bad copy/paste, I meant ENOPROTOOPT. > > Same point though, right? These are not legacy concerns, but specific > to applications written to SO_ZEROCOPY. > > I expect that most will just ignore the exact error code and will work > with either. Ok, so, is this an Acked-by: you? :) Samuel