Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1258870ybl; Fri, 23 Aug 2019 16:22:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqxHTko12Qb9FdYIzihtOTLvdmE8LI+4YyWkM5+WSrprNojSOvqH3/IWDXUWLlRa2lUPjTm0 X-Received: by 2002:aa7:8b51:: with SMTP id i17mr8135595pfd.33.1566602545227; Fri, 23 Aug 2019 16:22:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566602545; cv=none; d=google.com; s=arc-20160816; b=W0vdSuUYHQvEspQENMteeZKr5WrOjJkLaT8r4/xwDZvVgpQj7NYXQ3k3yzMjyyxm6W umthyTt5XJ+sMDkWcMc0qHnwaJFRD2Rth9WFxqftLC/Wlix3l2lnWmKxxm5FLJvUAh7w b48KRZw/xGz73jTeaPWHZr4s9ZKS3GeMOAtDB5Yl09j/8EEh9cf+qCMWvlb184V6znCM vFXoFN/47AIUEA48ErFRAxrIF5/hzbwH2GeL2UPvKxxhpTW7blDCTBLoLUvF4+6DRW9I 0fRBn0EXoPCBl0c8UL1lG6OrPQqjUqaA98CGIVFEGAWPNf9Emm2x4TBpE5tkmjSaXiVd dmCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=1LfnWFWs0YWvUwvqhsL90T++L1EYbaF8DCL5i8TnlTQ=; b=BYR0UNAlDwN7vnH/NsSiYpWZZkiyDBAjop6iGuxdJqDXLE7GF9lPrET8eguzbo1INo J4SYjgUS6GjipJPm8NnUrnunhg9v2vc9Mxln4uu6Hk/ebf+6IsWNJhnyrdiWUP6lZvu2 0Q+ivWz9Udq6MAEoD70ptNpkZAKfjcB+JR1dCSo20AxXdKX8n6AhddwbNDGKuuL6D9NP qvslf7cxBps3pUpCnRzKfmBPxKbL2gpR7Rxegu/7SestZ1iejX6lqGUDXBVqDmke5piT 56mDd6BCZo09eSm7Vw5kdaDJQI8STnURKhpit1JyHBDQ6J117B15qblAKc8vGWTq+sLy jjEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IGcqT2L9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id i6si3416835pjs.13.2019.08.23.16.22.10; Fri, 23 Aug 2019 16:22:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IGcqT2L9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S2405441AbfHWNU1 (ORCPT + 99 others); Fri, 23 Aug 2019 09:20:27 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:34425 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404322AbfHWNU0 (ORCPT ); Fri, 23 Aug 2019 09:20:26 -0400 Received: by mail-qt1-f193.google.com with SMTP id q4so11144879qtp.1; Fri, 23 Aug 2019 06:20:26 -0700 (PDT) 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:content-transfer-encoding; bh=1LfnWFWs0YWvUwvqhsL90T++L1EYbaF8DCL5i8TnlTQ=; b=IGcqT2L9Wkft5cAwK651j3W3eBHxve8x0C4MyikQws9NcZLM190a7/AA3JZ1HtXWpy GdGzRMoVVUREaXD/dkNg6XQgREa2yhuygZpG1qGG7MEL2Hf2V3TlohAf1wgBYw4asGVS iZG2a+U7LL18sOQP9/LmObdflOitwFE4afnCDwhPo9LKKZdkGqSxdF18BsijKXc4C+qU I04eNIzpKktFUyypNR34I9HyQBVBufsb9RUKdTcB7yETG7bHE7Od/XvFgGtMSbaUy7Un 8iRj4oNsHd+pb7mswL7+8gOIzrxF05qPOBd0o5ksLHEvQCipM/Q8OP9zEV82Cs3yc5oF LzUw== 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:content-transfer-encoding; bh=1LfnWFWs0YWvUwvqhsL90T++L1EYbaF8DCL5i8TnlTQ=; b=brEH7N+bW7HHW94T6SUYRun/EZFF2317VKNtaId2V02F+V7777R17OrQ+7CF9+goTb JQn3cjTbAP32H9vFiaHgr9d/0ESvU/9PStuCln4Z3m7u7G6lkgudrA27+A0gRurCWo+L uc79PCeKgSrCa3kHxXrFSpH1HXDa66Frzh5m2fcL2OdmYZFk+mnkugI3Ywg1X1LTI0xV quJK/8bJigr+p0i4FQrfJZ1TvvJM0JHX+iKhqtZJng58N/siUrJCX9jZkya2TO7kSLhb 5GP56Kifp9riAXEkMtjXTUUtkJg4y2osjK08tvARsEcGvtM8vYCKB/G7leSOHd0+aycI 7LDw== X-Gm-Message-State: APjAAAWBPRGcR4BiFweSxcMlA76mwU4N19eUnYjmXwuOVZDpR55vzx4a IjNo+f6J+StNbWJNUbbv3KhfxlZ0iRWYXNTl6Zg= X-Received: by 2002:a0c:abca:: with SMTP id k10mr3794577qvb.177.1566566425657; Fri, 23 Aug 2019 06:20:25 -0700 (PDT) MIME-Version: 1.0 References: <20190822171237.20798-1-i.maximets@samsung.com> <217e90f5-206a-bb80-6699-f6dd750b57d9@intel.com> In-Reply-To: <217e90f5-206a-bb80-6699-f6dd750b57d9@intel.com> From: William Tu Date: Fri, 23 Aug 2019 06:19:49 -0700 Message-ID: Subject: Re: [PATCH net v3] ixgbe: fix double clean of tx descriptors with xdp To: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= Cc: Alexander Duyck , Ilya Maximets , Netdev , LKML , bpf , "David S. Miller" , Magnus Karlsson , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Jeff Kirsher , intel-wired-lan , Eelco Chaudron Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 22, 2019 at 11:10 PM Bj=C3=B6rn T=C3=B6pel wrote: > > On 2019-08-22 19:32, William Tu wrote: > > On Thu, Aug 22, 2019 at 10:21 AM Alexander Duyck > > wrote: > >> > >> On Thu, Aug 22, 2019 at 10:12 AM Ilya Maximets wrote: > >>> > >>> Tx code doesn't clear the descriptors' status after cleaning. > >>> So, if the budget is larger than number of used elems in a ring, some > >>> descriptors will be accounted twice and xsk_umem_complete_tx will mov= e > >>> prod_tail far beyond the prod_head breaking the completion queue ring= . > >>> > >>> Fix that by limiting the number of descriptors to clean by the number > >>> of used descriptors in the tx ring. > >>> > >>> 'ixgbe_clean_xdp_tx_irq()' function refactored to look more like > >>> 'ixgbe_xsk_clean_tx_ring()' since we're allowed to directly use > >>> 'next_to_clean' and 'next_to_use' indexes. > >>> > >>> Fixes: 8221c5eba8c1 ("ixgbe: add AF_XDP zero-copy Tx support") > >>> Signed-off-by: Ilya Maximets > >>> --- > >>> > >>> Version 3: > >>> * Reverted some refactoring made for v2. > >>> * Eliminated 'budget' for tx clean. > >>> * prefetch returned. > >>> > >>> Version 2: > >>> * 'ixgbe_clean_xdp_tx_irq()' refactored to look more like > >>> 'ixgbe_xsk_clean_tx_ring()'. > >>> > >>> drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 29 ++++++++---------= --- > >>> 1 file changed, 11 insertions(+), 18 deletions(-) > >> > >> Thanks for addressing my concerns. > >> > >> Acked-by: Alexander Duyck > > > > Thanks. > > > > Tested-by: William Tu > > > > Will, thanks for testing! For this patch, did you notice any performance > degradation? > No noticeable performance degradation seen this time. Thanks, William