From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B7E1C6369E for ; Mon, 16 Nov 2020 14:31:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1D0E322314 for ; Mon, 16 Nov 2020 14:31:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730124AbgKPObb (ORCPT ); Mon, 16 Nov 2020 09:31:31 -0500 Received: from mga02.intel.com ([134.134.136.20]:25467 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729614AbgKPObb (ORCPT ); Mon, 16 Nov 2020 09:31:31 -0500 IronPort-SDR: 7WkET3B31E6scFgsZJF/xXo8HC3kyPLCYDFfdNfh8E7ic+4RghOCo9YZbpnzRqtGY+YS/dW9ik Hwm1OI8UsfoA== X-IronPort-AV: E=McAfee;i="6000,8403,9806"; a="157778516" X-IronPort-AV: E=Sophos;i="5.77,482,1596524400"; d="scan'208";a="157778516" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Nov 2020 06:31:29 -0800 IronPort-SDR: K+El57vBYgY5hP1q9UKFPgeoUch/f9q3VoR1XZukigW7fBy5imXpuuCprZOKjFffXpaEwBbTLh jarEOLfyJcYQ== X-IronPort-AV: E=Sophos;i="5.77,482,1596524400"; d="scan'208";a="543620406" Received: from wrzedzic-mobl1.ger.corp.intel.com (HELO btopel-mobl.ger.intel.com) ([10.252.34.230]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Nov 2020 06:31:25 -0800 Subject: Re: [PATCH] xsk: add cq event To: Xuan Zhuo , netdev@vger.kernel.org Cc: Magnus Karlsson , Jonathan Lemon , "David S. Miller" , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , bpf@vger.kernel.org, linux-kernel@vger.kernel.org References: From: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= Message-ID: <90c58756-934d-adf6-64e8-680cfc019cd4@intel.com> Date: Mon, 16 Nov 2020 15:31:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On 2020-11-16 09:10, Xuan Zhuo wrote: > When we write all cq items to tx, we have to wait for a new event based > on poll to indicate that it is writable. But the current writability is > triggered based on whether tx is full or not, and In fact, when tx is > dissatisfied, the user of cq's item may not necessarily get it, because it > may still be occupied by the network card. In this case, we need to know > when cq is available, so this patch adds a socket option, When the user > configures this option using setsockopt, when cq is available, a > readable event is generated for all xsk bound to this umem. > > I can't find a better description of this event, > I think it can also be 'readable', although it is indeed different from > the 'readable' of the new data. But the overhead of xsk checking whether > cq or rx is readable is small. > > Signed-off-by: Xuan Zhuo Thanks for the patch! I'm not a fan of having two different "readable" event (both Rx and cq). Could you explain a bit what the use case is, so I get a better understanding. The Tx queues has a back-pressure mechanism, determined of the number of elements in cq. Is it related to that? Please explain a bit more what you're trying to solve, and maybe we can figure out a better way forward! Thanks! Björn