Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3127931pxb; Mon, 16 Nov 2020 06:34:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJz6THnPv4/tSJpNMkG0e2s6DV9EST2u+/XCRDKF6hUsiQOxLz7FM6+mw+baALaJyakGb6Fz X-Received: by 2002:aa7:c508:: with SMTP id o8mr16021231edq.339.1605537259978; Mon, 16 Nov 2020 06:34:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605537259; cv=none; d=google.com; s=arc-20160816; b=EgZIG4PAIj/su4CNj/2vfqah/glIk8gK7FXlATIVdB1bSGUh0ROfVV/Mp73Yfx6RH+ wh0XbyToPE/2aupM3jsQibvnCZX6JLq6AZKc3EXan+sBPXow+sBN/1z+1iCGXHVQI+JY ir1Y5tkayDGi4Mky48yn5mMAR/zSVp3Ir3SwxXbK0SzT1Dkpgy1Yb71G9Hk1jaEJkb3P xvap/wRdtUc0jpJGb7czO6JrHSQeWtE6Il8gGHD/SKpTPQtOlPkZ2gKMIJgfva9kjEn/ gfelmiXRfdgtpjlRYlfGsP+8Z8IhWSPPSIN/SjbIGsjRC4Mn1e5WkKj9UOUzg04pX5QH 61vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=yyHUJl966oHX91fGS200OUMWv9DoVXiL0x9CUCDsVL8=; b=vwj5LZHJcI3ZNBHcrS45aaY3hPzFKqAXzLiy/ZpXC7W2kwil4CQJE05mXnwKkJzMAj e6hPOWzZeS5/FLdAQD/80xOqrZbv/9xQLKXzvWAR5yfExD7tTpzznRVaQIPvCeRWUTNk XRSVVVGaLXdhx2CvuQ79rF/8D3mI6K8eL0ImN3kOZkTcmAOiU9h4SeDiObi7pKx3Cg0R TyRJib6J49NkS1oAbinpTw4uu9+DFAjL7aKwiNF5SCc7DRej/XuoOFmKnpA+soGFRgvv yZ8K/TkMrIuTNbPp+laPTr+eZ+hrl13M4ZI/xgS78HSYpSOe6QrfijJEliOL/SopQfVd b+GQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oa19si11571812ejb.280.2020.11.16.06.33.56; Mon, 16 Nov 2020 06:34:19 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730180AbgKPObb (ORCPT + 99 others); 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: linux-kernel@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