Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp952300pxu; Wed, 2 Dec 2020 07:28:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJxsqDh/+crGWRb4oARBqb9rLKB8xbplEwcB0lPLlaKN6fjFfMVx0BsWORClRgy0wItsQ1Tx X-Received: by 2002:a05:6402:456:: with SMTP id p22mr453382edw.26.1606922902196; Wed, 02 Dec 2020 07:28:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606922902; cv=none; d=google.com; s=arc-20160816; b=dqcO3WbfIbURAfnn5Lhq42zy6IV5stFMTorWIg4gdxH1PuJQ0M+nb9ktwX05BxKX7I gvdoinzgRf7a5IxyFRRIYC9DCskiTNuHN4j1nx3VtIjZ0YHElWzWBDTSOfoV0stmA8Is BQiasfIrlT3fN9RaszleyUuO7KW9uzDaPWdOimCWm/sSEmzUC3YWw4mM2hdeF7JAYID2 work+a0gwW9LGenome22m8SbvY3aqeCDwmD0kA1xyPPHpHSOGC+4Bd77iv5rVCg9dnn/ AqCU/nX04rINlNDmlDyQE9sDyhGW+dgOAK4pREbI7IuzKT/0ZvGoepzEk0g8Z+ccUDf/ T8Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=HonYG6K8yyEAJPcRbmBUz568mb+2cYoZIgvfVgtc6Zg=; b=j6IlJRGjnEgl/JYX4xhlMSS5AMci12unu8ay7fC6pW3Xi86QqFp2bpJcZywJBMt9Jl 4eTC/vT6oA1ISLj8kqiQSvpJDKvYMjYjwoeWXjc5zYlZ83308M6LYKuTucgOYTmGdVU2 gtdTtgwWYWbkUy4uDwOeWyt2B3R2tOrXFQdwswwEZZUnMzXsZgf9xt4AoP/lX0GiNvhB uqcecSStD2S0qL8xGrmnZ+KolWbIYZ/Z/gJKwMYj9ILWS2Tk8It3+mEfkxo5E27CPP0D SCNWM9wTOtPycwmdzi+/L9UqhL+FP+wtOHx/eSU/kJ91PJejBeV02GlFVX72TjU4sARd KwVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OvkzNTF4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j12si147395eds.530.2020.12.02.07.27.58; Wed, 02 Dec 2020 07:28:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OvkzNTF4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730458AbgLBP0j (ORCPT + 99 others); Wed, 2 Dec 2020 10:26:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726088AbgLBP0i (ORCPT ); Wed, 2 Dec 2020 10:26:38 -0500 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FC24C0613CF; Wed, 2 Dec 2020 07:25:52 -0800 (PST) Received: by mail-pj1-x1044.google.com with SMTP id l23so1161949pjg.1; Wed, 02 Dec 2020 07:25:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HonYG6K8yyEAJPcRbmBUz568mb+2cYoZIgvfVgtc6Zg=; b=OvkzNTF4jQ8jb8tj1Lr+NmzMd10zopaokeXK6ucA/bRT7iwayNa8vS5zqSyyM9+qPJ 8S8n594EBorUAtvsqGg3x6h+9xyFLgHD/5G7An498N6ZR5SKeUQc7X4YMI/EUngzcEYP 62VJFCg5cSuNEMRbOiZtq+9c5BzrUH520J2y9OmdW8MAg7cjFWCe7l4slXD3fFLGWE1A tsbFp8VYdGVu+Z/FYTKPnTxmBv1Srz3FXsmZTo5fhRSPXZX3ts+rXM+vmu5EFXrrNh+t tAMrPQYJ1X0/E7/0xv4unh8gLcbzsaPB68NCubz2yKzS/r4touBoEfxidouXKpGUgvgu S36g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HonYG6K8yyEAJPcRbmBUz568mb+2cYoZIgvfVgtc6Zg=; b=TFiSQNUS7h//5ZJOBTUd+4CJXVugdYLC0dVbm+XEeBRa3Jk7p8GWz/54zo6rDUFdH8 jqJvBUas0tH2CE2ILUnVqGB0ewG6LRF46BdtnEpfTkE2zzwvjJXH6JhlR+W35DZlormp ygGz8se8J89eYnPBDvbRqaFqSfDqLJZFPsjvj4YiQRG/Fj3umYqpd3MoGkfV3QrGtCA6 yET/MicANDpQRp4PyjZ4YFA3cMiEmx17k+6WGDJLyMfIWxI5dFRwLO3x+AGMlSqiIhyZ JaX5mRHxpkpqNeh0+GtlPpxZkR4me81DDO+MvcwEYyzin/9ZY6NHCU6b4tfJ0Ne2Lg9w 4uow== X-Gm-Message-State: AOAM530K/fEglbUGR1BiuzihrsjBFRLiYPOQUzAI7DSZAJDENBbqG2Sp pjyKOl+4Yu3498miIJj4EEkEgIiPudEGcGM/8zU= X-Received: by 2002:a17:90a:fcc:: with SMTP id 70mr367368pjz.168.1606922751841; Wed, 02 Dec 2020 07:25:51 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Magnus Karlsson Date: Wed, 2 Dec 2020 16:25:40 +0100 Message-ID: Subject: Re: [PATCH bpf V3 1/2] xsk: replace datagram_poll by sock_poll_wait To: Xuan Zhuo Cc: "Karlsson, Magnus" , Daniel Borkmann , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Jonathan Lemon , "David S. Miller" , Jakub Kicinski , Alexei Starovoitov , Jesper Dangaard Brouer , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , KP Singh , "open list:XDP SOCKETS (AF_XDP)" , "open list:XDP SOCKETS (AF_XDP)" , open list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 1, 2020 at 3:00 PM Xuan Zhuo wrote: > > datagram_poll will judge the current socket status (EPOLLIN, EPOLLOUT) > based on the traditional socket information (eg: sk_wmem_alloc), but > this does not apply to xsk. So this patch uses sock_poll_wait instead of > datagram_poll, and the mask is calculated by xsk_poll. > Could you please add a Fixes label here as this is a bug fix? It will help the persons backporting this. Here is the line that goes just above your Sign-off-by. Fixes: c497176cb2e4 ("xsk: add Rx receive functions and poll support") Thanks: Magnus > Signed-off-by: Xuan Zhuo > Acked-by: Magnus Karlsson > --- > net/xdp/xsk.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c > index b7b039b..9bbfd8a 100644 > --- a/net/xdp/xsk.c > +++ b/net/xdp/xsk.c > @@ -471,11 +471,13 @@ static int xsk_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len) > static __poll_t xsk_poll(struct file *file, struct socket *sock, > struct poll_table_struct *wait) > { > - __poll_t mask = datagram_poll(file, sock, wait); > + __poll_t mask = 0; > struct sock *sk = sock->sk; > struct xdp_sock *xs = xdp_sk(sk); > struct xsk_buff_pool *pool; > > + sock_poll_wait(file, sock, wait); > + > if (unlikely(!xsk_is_bound(xs))) > return mask; > > -- > 1.8.3.1 >