bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Björn Töpel" <bjorn.topel@intel.com>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>
Cc: Magnus Karlsson <magnus.karlsson@intel.com>,
	Jonathan Lemon <jonathan.lemon@gmail.com>,
	bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH] xsk: fix xsk_poll()'s return type
Date: Wed, 20 Nov 2019 07:15:42 +0100	[thread overview]
Message-ID: <103f550e-4a78-e540-4a57-bdecc2f066cf@intel.com> (raw)
In-Reply-To: <20191120001042.30830-1-luc.vanoostenryck@gmail.com>

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 <bjorn.topel@intel.com>

Daniel/Alexei: This should go through bpf-next.


Björn



> CC: Björn Töpel <bjorn.topel@intel.com>
> CC: Magnus Karlsson <magnus.karlsson@intel.com>
> CC: Jonathan Lemon <jonathan.lemon@gmail.com>
> CC: netdev@vger.kernel.org
> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
> ---
>   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;
>   }
> 

       reply	other threads:[~2019-11-20  6:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20191120001042.30830-1-luc.vanoostenryck@gmail.com>
2019-11-20  6:15 ` Björn Töpel [this message]
2019-11-21  8:49   ` [PATCH] xsk: fix xsk_poll()'s return type Daniel Borkmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=103f550e-4a78-e540-4a57-bdecc2f066cf@intel.com \
    --to=bjorn.topel@intel.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=jonathan.lemon@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).