Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1162164pxu; Fri, 27 Nov 2020 00:53:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJzw6CplxSMnAIgnCBPqzoIUoRHj39EvsZpVEbO3TD3IjlOwxCXUJ9eDgzdth/j+e1ZUWEvJ X-Received: by 2002:a17:906:7813:: with SMTP id u19mr6563614ejm.153.1606467214802; Fri, 27 Nov 2020 00:53:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606467214; cv=none; d=google.com; s=arc-20160816; b=zuJ5VdidnKXSI+rQof0upsDeHEvLDDlqHLmK4wVCjcOrvSD+WzEwskYvkDL7gotsjJ vbvwxNnQ6aTZmRoITGY8aX7QJHfgDe2+tBw+FzBK8pVM0PGMDMWPskaR+DT52tDl/5TZ VQCvT+zyTnlD/gkUQAlx8wqnP0sa4hOpwRC9QIUXgcnf9YLQZP2vmn6d2H96LCQtIeyu Lf39RCvwlWNhJ320j428pQgUrZCjjQ58VaK0OydCXHWkbOeAUDsdkv7NSnwChH+tahoK vau1+Dw4Vux5DWRiVQCaDP3XR2oq+gAXR7tOnSQmPse/5rc5wv+XFMb3iGhFnH8Po4tc TMWA== 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=ofnRM1vPxs6Z1Dh5RlbJ6mIhU4Yv5EcitgSCPhDD/xo=; b=iJHLh4Eesv8kGz16UYIMPIoqlFyqs318pDro3L0oRnz9ox8denWRRyl17SLQg9S/Mg Kj0BIO6K3j8TPkFkixhXljrGBY1fBG7aYpMIvhcTfYN4u9ZyLZsaS9rR2fwf8tjmxNmQ y2U3khOtD6sNrAlKVoB3N2VOwx5cLIwRNoxx5oOfQcvf4g/Kv94cesGxQHlWHq0a0QYw FVLHVF2cTYOmR2TT4QXwqXsjTjBISTCKd5mWumtsMApENazoIBhjKfmYOCspnFC8jXDo LfE182Z3YXzLlqBSmCAd0Lr6kR8ZVI9/4dMAcA2ATyYZwS4x4/s/Lr3hKA296AYPZeMR F9Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NopATpg0; 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 f23si4572495ejc.182.2020.11.27.00.53.12; Fri, 27 Nov 2020 00:53:34 -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=NopATpg0; 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 S1727686AbgK0IXW (ORCPT + 99 others); Fri, 27 Nov 2020 03:23:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725980AbgK0IXT (ORCPT ); Fri, 27 Nov 2020 03:23:19 -0500 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECA90C0613D1; Fri, 27 Nov 2020 00:23:19 -0800 (PST) Received: by mail-pg1-x542.google.com with SMTP id l17so3774816pgk.1; Fri, 27 Nov 2020 00:23:19 -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=ofnRM1vPxs6Z1Dh5RlbJ6mIhU4Yv5EcitgSCPhDD/xo=; b=NopATpg0UMa9XOyN/DeJE4gTE8VQKs/j7vUCHqEvkGgXQOanCReUUXtgW3QtEPyWse EcY75QZDB1lu9PZFSJSSRGsOoIz+omuHjMerXQV5/qh84Hr/y/a93uX8hJaLkqesNrz6 X+XPlTF+mIWbQd+mswDebDzD4NIqe+USkOUaFgNVoq8BysnnYiXu90vfUjACjP7P0NhY w68hj2koPDc6Ef58l1kGxk9DiXfeinSJ/1DvTEbbb7k9VUSH3ZIohSfPO8vNdDzEnri1 pkj3QklDikg6x9uL9r6fq1/yiSjS7RX6cNpvS8LH+agxb9ze8J+bOcQ7pksyz3woFHjW ciLw== 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=ofnRM1vPxs6Z1Dh5RlbJ6mIhU4Yv5EcitgSCPhDD/xo=; b=LtBwbhhhHQvw3Cnv9rAR0NzpqvFr++yo3FFmV9a1WCXeimMMrRRpKYy9ktf/8iWGR1 +e73doPpzFLYQkVE05Te+QITSnWxn6/OeHtFtUe4SJN7cTzVloPM7ECcoW/aPjvD3316 6UDDoqPA1pkO9lHN8c774XCZCCm06t8NNQqblJtp0qEPSiUX5FX9fsYsp9eNDhGX3Oon ZIJvtCd57qOuNgQgsaaygORLqvikKjZfHlgeupTv2EKCHcfj7JvNMat3hsvlVYUcSA+D bpw6TnuFI4iv1O1veM/bX+XC2wbSbSnypBYUDO65ROG63siraolTEt6/yLH6OjdsnwfB t5pA== X-Gm-Message-State: AOAM532ihRJe12EACYAMC+ajnl1vuXdGuUj+Q/nXZeC8qXDyMashrv/g 3eE9E7rh3fIToTzB3kq4jvCCjgyP8wnJJ5pec+8= X-Received: by 2002:aa7:9521:0:b029:18b:b43:6cc with SMTP id c1-20020aa795210000b029018b0b4306ccmr6126287pfp.73.1606465399522; Fri, 27 Nov 2020 00:23:19 -0800 (PST) MIME-Version: 1.0 References: <01f59423cad1b634fe704fe238a0038fd74df3ba.1606285978.git.xuanzhuo@linux.alibaba.com> In-Reply-To: <01f59423cad1b634fe704fe238a0038fd74df3ba.1606285978.git.xuanzhuo@linux.alibaba.com> From: Magnus Karlsson Date: Fri, 27 Nov 2020 09:23:08 +0100 Message-ID: Subject: Re: [PATCH bpf v2 1/2] xsk: replace datagram_poll by sock_poll_wait To: Xuan Zhuo Cc: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Magnus Karlsson , Jonathan Lemon , "David S. Miller" , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , 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 Wed, Nov 25, 2020 at 7:49 AM 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. > > Signed-off-by: Xuan Zhuo > --- > net/xdp/xsk.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) Acked-by: Magnus Karlsson > diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c > index b014197..0df8651 100644 > --- a/net/xdp/xsk.c > +++ b/net/xdp/xsk.c > @@ -534,11 +534,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 >