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 B78E4C61DA3 for ; Fri, 24 Feb 2023 12:02:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229833AbjBXMCH (ORCPT ); Fri, 24 Feb 2023 07:02:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229458AbjBXMCH (ORCPT ); Fri, 24 Feb 2023 07:02:07 -0500 Received: from eidolon.nox.tf (eidolon.nox.tf [IPv6:2a07:2ec0:2185::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C82664D54 for ; Fri, 24 Feb 2023 04:02:04 -0800 (PST) Received: from equinox by eidolon.nox.tf with local (Exim 4.94.2) (envelope-from ) id 1pVWly-007isE-OF; Fri, 24 Feb 2023 13:01:59 +0100 Date: Fri, 24 Feb 2023 13:01:58 +0100 From: David Lamparter To: Eric Dumazet Cc: David Lamparter , Jens Axboe , netdev@vger.kernel.org, "David S. Miller" , Willem de Bruijn Subject: Re: [PATCH net-next] packet: allow MSG_NOSIGNAL in recvmsg Message-ID: References: <20230224071745.20717-1-equinox@diac24.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, Feb 24, 2023 at 11:26:27AM +0100, Eric Dumazet wrote: > On Fri, Feb 24, 2023 at 8:18 AM David Lamparter wrote: [...] > > packet_recvmsg() whitelists a bunch of MSG_* flags, which notably does > > not include MSG_NOSIGNAL. Unfortunately, io_uring always sets > > MSG_NOSIGNAL, meaning AF_PACKET sockets can't be used in io_uring > > recvmsg(). > > This is odd... I think MSG_NOSIGNAL flag has a meaning for sendmsg() > (or write sides in general) > > EPIPE is not supposed to be generated at the receiving side ? I would agree, but then again the behavior is inconsistent between socket types. (AF_INET6, SOCK_RAW, ...) works fine with io_uring/MSG_NOSIGNAL, meanwhile setting MSG_NOSIGNAL on (AF_PACKET, SOCK_RAW, ...) gives EINVAL. Just to get consistency, MSG_NOSIGNAL might be worth ignoring in AF_PACKET recvmsg? Independent of dropping it from io_uring... > So I would rather make io_uring slightly faster : [...] > - sr->msg_flags = READ_ONCE(sqe->msg_flags) | MSG_NOSIGNAL; > + sr->msg_flags = READ_ONCE(sqe->msg_flags);