Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp955923ybl; Fri, 23 Aug 2019 10:52:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqzC3skaHFiE50fgJIOwGSj7E5DAzlXuMN5xNB/nbTRirgNsXA9QOUqHK1nlznbgQDmwRFbI X-Received: by 2002:a65:56c1:: with SMTP id w1mr4924874pgs.395.1566582762991; Fri, 23 Aug 2019 10:52:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566582762; cv=none; d=google.com; s=arc-20160816; b=AJzJv8vdX4CodqrvPKq+GJsUaYejzfgdq3lHvFfEDqYCn01pa1WIyOInoTdAkpR/oj GHkCcOfDQNY0ZH/RQ95I+YBI/Zsxachh0w2+CXax77Ti4Rh/R9Y8gOs0m8cz6oDD2Vgy KHFrJ5Iq8a+4D/XH3+AArTdUCJS5VsLuU6eRII6IwA4kWGAz2DDcKw1i48RIBiMsTLP1 fTwD5VAr/eJKDruxfouytEvsJvQInG5Fkp6y2pdLYY0yDSMCtJ0Mk7UFKQ+Vhev8rhoR LGIQdlmx/VruLIL7eFNzGED/so30MTTjTdCWstImz7pYXH0zIZV2o74autivbVyqbGxW /l+w== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=HZVcMY5I9Z1H7HQy7OIZPrSUqQoLeC7HFrUdH0QU+WA=; b=SbQbl8bSYzxeIbc3V+FZNhcydFbodDy7ejxnT0O4rARvRU639X5A5I5uDScqz8Aiks MwOpNqt05PfqmAObhOsyCwINFgVyTbpPdTxKj8YGwuyk6alkLR9pbDb5SZZ9raOOe9pX +ykFGf1R/vJNp+3pHJVUWdYyC6ssxLPZKmXAAvhivTW2DWptKMEAMD2SJRtssUnZqMfZ 8xqooCXveHI9YoYfTnfIM26JfZ+U3kH6cRSco2/SroRqDN6GISNG1OoOOGCr16g2Gyj8 xnajZIntV+oauOkN5io3UyEXb+TuAV8xFrdWB+C8+BcT5pXtfCfAey2cQEefkWIRAWmT 6k5w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1si3102745pll.393.2019.08.23.10.52.18; Fri, 23 Aug 2019 10:52:42 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404049AbfHWGKd (ORCPT + 99 others); Fri, 23 Aug 2019 02:10:33 -0400 Received: from mga01.intel.com ([192.55.52.88]:60504 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392300AbfHWGKc (ORCPT ); Fri, 23 Aug 2019 02:10:32 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 23:10:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,420,1559545200"; d="scan'208";a="170030314" Received: from arappl-mobl2.ger.corp.intel.com (HELO btopel-mobl.ger.intel.com) ([10.252.53.140]) by orsmga007.jf.intel.com with ESMTP; 22 Aug 2019 23:10:27 -0700 Subject: Re: [PATCH net v3] ixgbe: fix double clean of tx descriptors with xdp To: William Tu , Alexander Duyck Cc: Ilya Maximets , Netdev , LKML , bpf , "David S. Miller" , Magnus Karlsson , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Jeff Kirsher , intel-wired-lan , Eelco Chaudron References: <20190822171237.20798-1-i.maximets@samsung.com> From: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= Message-ID: <217e90f5-206a-bb80-6699-f6dd750b57d9@intel.com> Date: Fri, 23 Aug 2019 08:10:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 > Will, thanks for testing! For this patch, did you notice any performance degradation? Cheers, Björn