Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1172135ybl; Thu, 22 Aug 2019 10:21:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9eeirA2gEjqgesdKb7jW7VLuN8YjbkAGViwmpQeG4vmHy3WI22OWtUppyjunVfno/jybJ X-Received: by 2002:aa7:97b7:: with SMTP id d23mr247707pfq.203.1566494460274; Thu, 22 Aug 2019 10:21:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566494460; cv=none; d=google.com; s=arc-20160816; b=iIUAa3ylVuSyY7TcZ3sAzKu/A4bo+4GYgftGIQhVMYMSkAAShW94Mhyupg/jE1d00c NhtbCogKCtS7c38E6mAjmiP40umbWcaHO1QsaA2YfBTBWaTfNYpXr2dnm027HunBr5C4 SPMzXu4aFj23xJ6Dp7OK9YRLgISI7JTB3n+pnZnjMeEiQ8SbTnJJCx8YQHu+lln+zTAp 0uM4vy92FwCBdAohLDouBY9sSxc/B37/7IWu/4QsKlSDWWOqWslwOZLVs7X7/BtOVk2S Woc1DIEkcHn6zcty3Vj0EzpDclmQ/Y8KMLkS2iRtVDTGgtyr6XmJIIIcAhlM2xPPNaTR lMXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=LYvKe5wejsC6qDJ+UX43WDzJLWa+tddnchjuNlT6Thg=; b=StnwZpXw7lFuGMhy6R86Au8fbcoCSCETNaYdW1QX0V0wt2QO++lnLZNXGKVKfmxc+j 69B/uWxHMaU+IhSxp9RKfNTeGedjOk+vAub+wXrvq8zEstN39cFO+Kvpruu+Mqkce7HJ QqC2NlfRYpbiB9HEs23G/Z4xz0i4awnyR/EzMACWhLjwPV/5yFfpgJDmqWYDLCUT7EJ2 TqHXnASfXLrHZ6iihtq/06N8Wq/eHmp6GtKv5G91q4Wb6AagueLU2fyWEaPDTwCj5aNN l9Kv/J7Ms6CnKV927oXU97qbIiB0t3XSkS/izg4UOiR6ldjUGnU36ThfN8DxNh3vcyO1 SVfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="S1E6/5ih"; 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 q3si17953341pgs.576.2019.08.22.10.20.45; Thu, 22 Aug 2019 10:21:00 -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="S1E6/5ih"; 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 S2389883AbfHVQYZ (ORCPT + 99 others); Thu, 22 Aug 2019 12:24:25 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:42376 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389867AbfHVQYZ (ORCPT ); Thu, 22 Aug 2019 12:24:25 -0400 Received: by mail-qk1-f195.google.com with SMTP id 201so5656949qkm.9; Thu, 22 Aug 2019 09:24:24 -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; bh=LYvKe5wejsC6qDJ+UX43WDzJLWa+tddnchjuNlT6Thg=; b=S1E6/5ihriAAmGPzQLCB11TvQvxLBG3TaqCYx881WTAFnA0NYUxSZ3JgJam/+Ww1WF A/72qew6cN1tcS5IcZdOo/CfqZX0yQe3Kod8GaULbE7evm8fina+eR5zncgwEIsjdg0k hK6I5fhJneS5ym5mhqt5eVgzaqAsnpkFQM3dqtYWbf9Dy6598B7Znj550p/0cJdP9pIJ B9UxgFMJFnRg4aBUxuN7zGzk/2xC+KAs15xseZQdfTvrF1raGnqTLbNqrLzrb5L8jTge 8k9iUUkb/4LbaZIHQMzlBAccuvPNiy1gGTdXDfQPKzv3XrYAf0YIU4WLwWCpFyACNQPN mtGg== 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=LYvKe5wejsC6qDJ+UX43WDzJLWa+tddnchjuNlT6Thg=; b=Sp4a5Ko4FEmXUn4IT6lkfNHcGkzgk94y+UiNeQC64YPv0yy4xMA0EQQKpb8T4ZC+u8 G3vfS36cvf76MryO4U/jN/maGu+tCbhNlBBaiVOtTVryi5ULN4/uq/w7MTNhVZHwdUHT 20HY1CKRmD0oUF0d9huJ5Xx6zlKUgfku+8S643VMgN9hw9yuyz9bKJP267zvg4CQN2B0 1Nh5+dgSPWD/35DD6bjwDprM0HE2ijBJNRSKBLYUHRaiZCGpoGKVnk+aYKAnZiS1GWhb UoQ8TbcuimUO/tRziMNCA+CIVXhiN73+WNHg4hQKBW4ityyBs1ihwATl8ck89Ba61SD3 YrEA== X-Gm-Message-State: APjAAAVjYTxnjTkjqcKJggYkyQF89zdksVcptncj8cX/UeXygJASdDzB njVhIAKTANSsHILJZEqLPFBbILzKbdIukxsW5fM= X-Received: by 2002:a37:e306:: with SMTP id y6mr37349543qki.174.1566491064158; Thu, 22 Aug 2019 09:24:24 -0700 (PDT) MIME-Version: 1.0 References: <20190822123037.28068-1-i.maximets@samsung.com> In-Reply-To: <20190822123037.28068-1-i.maximets@samsung.com> From: William Tu Date: Thu, 22 Aug 2019 09:23:46 -0700 Message-ID: Subject: Re: [PATCH net v2] ixgbe: fix double clean of tx descriptors with xdp To: Ilya Maximets Cc: Linux Kernel Network Developers , LKML , bpf , "David S. Miller" , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Magnus Karlsson , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Jeff Kirsher , intel-wired-lan , Eelco Chaudron , Alexander Duyck Content-Type: text/plain; charset="UTF-8" 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 5:30 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 move > prod_tail far beyond the prod_head breaking the comletion queue ring. s/comletion/completion/ > > 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 don't need most of the > complications implemented in the regular 'ixgbe_clean_tx_irq()' > and 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 > --- Tested-by: William Tu Instead of measuring tx performance at the tx machine, I measured the TX performance at the other side (the traffic generating machine). This time it is more consistent and showing not much difference with (5.9Mpps) and without this patch (6.1Mpps). > > 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 | 34 ++++++++------------ > 1 file changed, 13 insertions(+), 21 deletions(-) >