Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp115155ybl; Thu, 22 Aug 2019 21:02:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFc3wdcNNZj3oBDLyTDRCCBqSf8N94P5MGxJzbi28D/eBy/MMcuwjNiKbdz235K+pqi1B8 X-Received: by 2002:aa7:8e44:: with SMTP id d4mr2829691pfr.220.1566532963186; Thu, 22 Aug 2019 21:02:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566532963; cv=none; d=google.com; s=arc-20160816; b=TV8muQGGlejGSeRaUa59gRRfcyMYlCeahKqAAJAckaswBTHl98wpxs771ObM7skM0z qOr5f5Qw3NC4r+2T/4VK8r/0++/vFPd+B9UdVpHPlkkWNSyuwdBW5yV94bx7rGLRczWq QTGc0mAlj/+BnuVWscQPuenceVk2SR8uRp5e/bpfyMN89ruUb4udFBHukzakrPXeRSDE pbDRVaQeVCyw1jFR2DuCWBO+KqNU5AN2diYIG6nEHXUMJNFRlHDc1z6G3dbrWHl41Z3m D/U4PgWpefC9sXhWtu6CkvCRBTEX1MZqwIyFUIJ2Sco9gv3v1EBein9WtyOZr8hIZfx1 zc1A== 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=7FtduzNMNJFnI5g1RLjKgEXAg+yuPVumc8YVJkrfUPo=; b=ZsAgAOo0CKmtoyy41F7Cv26TNylAZSRrKRezZFZe575vgPgmU8BClWwJUa6VuDtUjX fyebVl2J4nVyNHLKC93D7TMwEbEFoBIUEy8f0SAHJobj/zJuX1E+NHpGbYKen5dlILiQ jgFPN9zKFoLUkkJBrwEnRmp6kR9/2G091qFzv8CoRdHFKADPbOcoDEqrYusIqNu1t7Ev x48QygWj9tyfza85P5Ug0bo12ECvp7vctO2t+6JSLdNnQCT9wNZQmmugXC0CyV67420f Ud+EF1adFZpWiX/ngQuWEqjpPDSX9LKNyiuts7eN39LpATuDicZlK+66v+Svb22ZVPCw v/Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qEeYXn5z; 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 w9si1275802plp.329.2019.08.22.21.02.25; Thu, 22 Aug 2019 21:02:43 -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=qEeYXn5z; 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 S2391461AbfHVRcx (ORCPT + 99 others); Thu, 22 Aug 2019 13:32:53 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:47097 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392340AbfHVRcj (ORCPT ); Thu, 22 Aug 2019 13:32:39 -0400 Received: by mail-qk1-f196.google.com with SMTP id p13so5835637qkg.13; Thu, 22 Aug 2019 10:32:39 -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=7FtduzNMNJFnI5g1RLjKgEXAg+yuPVumc8YVJkrfUPo=; b=qEeYXn5zbDKeUYzAE395iJhxBSXY28NfVitbQtYAB3PyhcKFqVr0X8Y3AjTCXoMcUW 5Q6LV4kVvOVUcpwcdQd+RF2OffQr24rN0eQZq3BDv/35RQTRjTQUYxMeKsFlsZsXaPfH YrcMBwU0UhDNBbqSYOlRU++IvVq++BtYBmhkts46VzrTmF8KclLlqgc+CHt2WtCJO2r6 nIM7cD6wO544OQZp10ybXnkdiDQ+maOQ5nEjLFxf8tHi/wSXZ8JobjexChhEQFQRQPbi sY2neb0g/idAF/SUszOnQGAazwU50BHbnfUixRgwyyGMg7ihYlA73k5zIOtKUusHsRHS B4oQ== 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=7FtduzNMNJFnI5g1RLjKgEXAg+yuPVumc8YVJkrfUPo=; b=omjU5eRsKW89ppqvusB+XjarLHZrKkQZ7FQ2qBQO1EZ5i3FiqN2uCFR3uog7vZqhgl QhgIWiwB3q4ElHQSJ/IlGJGkLi6NYYnH2wU8IiAxOLX7HFUILkL1NNv7ZZkMAaDbXATg 9/8KjEWBC0dFh9KuiwRaF9HX6958poq52WwO1nZvnYW003aDwQuKzpmm+YDafbSAhs8N 08mfLdwOUUhvfJ9cBOOPC0cdN1ct6d0kEbDaa/YsnWuvTqOzB77QDbAp/9hORUupP+N8 Nfpb1yXISXxL8dGnWS9FEEocrHz5/GkPCoZWpm0RvWJomF1zTIdWGOEINlM+nis9nZTj 26Zw== X-Gm-Message-State: APjAAAV1rIPbhMutmHiI6uR45Z/Py/IdeWvmom+UqUIXmTC/UX6LUzX3 TzMKMN4IKXsICk0twvHouYVr+/zz3Dztn+3usKc= X-Received: by 2002:a37:690:: with SMTP id 138mr101661qkg.184.1566495158839; Thu, 22 Aug 2019 10:32:38 -0700 (PDT) MIME-Version: 1.0 References: <20190822171237.20798-1-i.maximets@samsung.com> In-Reply-To: From: William Tu Date: Thu, 22 Aug 2019 10:32:00 -0700 Message-ID: Subject: Re: [PATCH net v3] ixgbe: fix double clean of tx descriptors with xdp To: Alexander Duyck Cc: Ilya Maximets , Netdev , LKML , bpf , "David S. Miller" , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Magnus Karlsson , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Jeff Kirsher , intel-wired-lan , Eelco Chaudron 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 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 move > > 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