Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1479583ybc; Tue, 19 Nov 2019 22:17:11 -0800 (PST) X-Google-Smtp-Source: APXvYqyJX704j7DjgrxvD8zWSseWaTc4vsNKcYbWQp/tKbBcY1s2VqNM3lAZoAmUnlswGWRX6bEc X-Received: by 2002:a17:906:278a:: with SMTP id j10mr2887472ejc.125.1574230630988; Tue, 19 Nov 2019 22:17:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574230630; cv=none; d=google.com; s=arc-20160816; b=ZfAOgctJIzM2s9Xf+BWfh3HXdkgCkeWaJgZ21tf1XlRWeQuLrEpX6ja77Tofrp3ej6 TJntsVx6EIk4cjpz/xEtvl1mGGmYyRe6sQetKMZOsZTO3X/ih2PGztJwKN3dguzj2Hl4 I5Z8kD4Tqgq3bipspLYpIJ97zlx3M7hR4vGyw2bpqMB+cAXH+viFc/LtlaL4ZG/h/iuy I3R2KExR4qy2/y1aedvAsWdrkpUNSOdXz/B7zl/VqmK2ttO+MjjCEW23yiQHaCEdT2OP FKf25HavDFAl8CSAFjd9z1J9S8pAMbgKmLdKEolltzID23Hv7b/pI2EFXEEg2uewib32 JVxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=uo1vOKOGUxfSDqq+Y7uDZd60bwXR4PfR7D3vdOIkYpE=; b=OnB6PZ0ImU5uybGxMYwh3QHBK1PbxpwMnpnhtI/WsLDiLesx6bbJ4dtnf2uJf631P9 gzDYX2cXDMeE1ESKtNP5/tkjiReqtJ3fIduRXJSdlvqb2j7wyMY7dzR6gMz5F8CXf9Bm NGB5hGeTElzHKAL2F1YbTNNg1rV7ukjVk37KfIHj0K20NwpTKde/PWtLCNl6ZNdZILfx tN7djEiWyPBTgEFgDzTvxVxk49vhFfUsEhM2OvKJJ4JUjVm2y9P76LcrtX46a6wQOfP9 1XQGDDc4qHBnlB7+pXQXMBbNO2UemQbgkKzZTLUg6cSr7Y7JusXSfcjejQl4K3KIzkHN cypQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dt19si15676555ejb.206.2019.11.19.22.16.46; Tue, 19 Nov 2019 22:17:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727586AbfKTGPs (ORCPT + 99 others); Wed, 20 Nov 2019 01:15:48 -0500 Received: from mga09.intel.com ([134.134.136.24]:33771 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726014AbfKTGPr (ORCPT ); Wed, 20 Nov 2019 01:15:47 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Nov 2019 22:15:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,220,1571727600"; d="scan'208";a="357337027" Received: from jesusale-mobl4.ger.corp.intel.com (HELO btopel-mobl.ger.intel.com) ([10.249.32.22]) by orsmga004.jf.intel.com with ESMTP; 19 Nov 2019 22:15:43 -0800 Subject: Re: [PATCH] xsk: fix xsk_poll()'s return type To: Luc Van Oostenryck , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann Cc: Magnus Karlsson , Jonathan Lemon , bpf References: <20191120001042.30830-1-luc.vanoostenryck@gmail.com> From: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= Message-ID: <103f550e-4a78-e540-4a57-bdecc2f066cf@intel.com> Date: Wed, 20 Nov 2019 07:15:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: <20191120001042.30830-1-luc.vanoostenryck@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-11-20 01:10, Luc Van Oostenryck wrote: > xsk_poll() is defined as returning 'unsigned int' but the > .poll method is declared as returning '__poll_t', a bitwise type. > > Fix this by using the proper return type and using the EPOLL > constants instead of the POLL ones, as required for __poll_t. > Thanks for the cleanup! Acked-by: Björn Töpel Daniel/Alexei: This should go through bpf-next. Björn > CC: Björn Töpel > CC: Magnus Karlsson > CC: Jonathan Lemon > CC: netdev@vger.kernel.org > Signed-off-by: Luc Van Oostenryck > --- > net/xdp/xsk.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c > index 9044073fbf22..7b59f36eec0d 100644 > --- a/net/xdp/xsk.c > +++ b/net/xdp/xsk.c > @@ -418,10 +418,10 @@ static int xsk_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len) > return __xsk_sendmsg(sk); > } > > -static unsigned int xsk_poll(struct file *file, struct socket *sock, > +static __poll_t xsk_poll(struct file *file, struct socket *sock, > struct poll_table_struct *wait) > { > - unsigned int mask = datagram_poll(file, sock, wait); > + __poll_t mask = datagram_poll(file, sock, wait); > struct sock *sk = sock->sk; > struct xdp_sock *xs = xdp_sk(sk); > struct net_device *dev; > @@ -443,9 +443,9 @@ static unsigned int xsk_poll(struct file *file, struct socket *sock, > } > > if (xs->rx && !xskq_empty_desc(xs->rx)) > - mask |= POLLIN | POLLRDNORM; > + mask |= EPOLLIN | EPOLLRDNORM; > if (xs->tx && !xskq_full_desc(xs->tx)) > - mask |= POLLOUT | POLLWRNORM; > + mask |= EPOLLOUT | EPOLLWRNORM; > > return mask; > } >