Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1536598ybl; Thu, 22 Aug 2019 16:39:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqwiRgLnpAA2qbjyWB9rjsUsMPdqcW+hWB5d9k2U0i0HFCjOuzjdSPM4yI8lgADW6mGplHYu X-Received: by 2002:aa7:9abc:: with SMTP id x28mr1952185pfi.234.1566517173837; Thu, 22 Aug 2019 16:39:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566517173; cv=none; d=google.com; s=arc-20160816; b=BfZLfI36nQNuWfT2cJX+iyDiPrY6PfTWM6Q5FJo5aXLF6FWh7vzaHHqAfh1LtAhDfg nHvFKrXmbkeXtPyDuUA74wH+jQVyaApCLFlM94NjZOZAP6rMgl6KvHGHDsiJbO/QwWlz N7DBrHdtDWei0mPtc0SrkvO5kSat0qJFocgNwGyBS92KoXH8Sdp+v+nTPBSqjRRhiZkw suxYY0EYUnIyzMvHFUmySATUvluPmxuxF4le5v932pbRNEJyW52tagn2m8mn8/OP36u/ 8s8/H5YDMNTYS9YhLYYd4UG9+EKQUcb2MPNI8Abvmopn4FnmlFDOPZ8KTM0/zy+Mz+GO hOAw== 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=aLr+sd5BMRYCClHI4smsxLPlBWSdoS3nfQ+XpNRCO6U=; b=M0A/ljBXKodCLp4UFtlG+ME4OduVFN2zyoz0Q3oumhSW8qohnHPRk1PgU69qHyPzBI eWVPqZEjtel6T7jizGcZvcsXhCUeGxfZRJvtXqiHO5U/FGaseeyrq/y1aY03iQl2NN8I 0xIxE84Ro85ShX3ElkltxodqQSLcvCVHte62TtCAQTRNF1OuLQutuR+6CAzlIspUoPlw jx6VomdGk8SyQ+OY3ESUzrcXV1FHy0FBqGRjU8XmAXl3HMhKsJC1H8tDxhiIpwEfOd+J QYTcCwuP9b5KmwjdG9ubD1QcbWbLlCukIkDYBUI0wPMB4KR3mrJkdlK1OhPu4IHQ5MoQ ZZIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bLz1UxSg; 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 a10si926840pfc.215.2019.08.22.16.39.14; Thu, 22 Aug 2019 16:39:33 -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=bLz1UxSg; 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 S2388289AbfHVRV1 (ORCPT + 99 others); Thu, 22 Aug 2019 13:21:27 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:33242 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730997AbfHVRV0 (ORCPT ); Thu, 22 Aug 2019 13:21:26 -0400 Received: by mail-io1-f68.google.com with SMTP id z3so13513311iog.0; Thu, 22 Aug 2019 10:21: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; bh=aLr+sd5BMRYCClHI4smsxLPlBWSdoS3nfQ+XpNRCO6U=; b=bLz1UxSg3goHpLmdM1XGhxTgPMZasAb3H3QPWRN13W+SCAgmQtFI59RkBF9I1BoCJ3 gfRTGkAtZBHs5sOF5tM7Khx4mYb3AP6M7MXD1f6xuIe8/SXnKS9oo6RYV4MIkKamVuru iVoY5Ljg7iov3VuRbjauI0Sg79O0/G3qyJde2n4wkKIl+nVzSEmRKCBB/Xn0DC0g39Um f/x0pzC3lDmi3nSbI6X+6MNSUMXbIPZ7/Z9BEpkck9KXUKhTqFXZ7gFl0cQT9jNgWi9/ 9BSNLwRyKkqqgogpRFtZkWxcmAqawm1GyV4bX/86wQZFTQ+ME0Q6GpJFGHPkG6DfwaOV 5mfg== 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=aLr+sd5BMRYCClHI4smsxLPlBWSdoS3nfQ+XpNRCO6U=; b=CH4vkIMzBCzE7R5qYyDv8neBVUs3bnmISBIMKfI/9a6en9Zql5v+C6+5IOXKFTCFDA Heb4bxDonvtkfFT7ZCiJWOJcS3RWlExcmy/AXbRb9paNtxQMI9exR/m2LXTifhuCBsf/ a2MSVYpkuYnM1hYydAcmV0nEIpndz0uGIQZkpxjH18TToupsTpc1pCaY8A/YXW586EK/ yThtaBNLHAf0wZWALAEWSzqhk35gYkDqSOSlhsHZCPNpGg3mXWLggUm7WdoDgyGz2abs 0jYFuQZiYn6GkgyVjyt0ZQgxAl4V377BjvCUcKSqXaLOxffR5vQpDYot3XM0nso8Dj1K yMqw== X-Gm-Message-State: APjAAAX9jT/ojJqiNKAsDEMeU5cYtULPyfypXicAs/Cum98mIMffW+tv XnBXgq1nbQbyijvqYItexF3sh/G1UMK4DG/oHZY= X-Received: by 2002:a5d:8908:: with SMTP id b8mr965993ion.237.1566494485368; Thu, 22 Aug 2019 10:21:25 -0700 (PDT) MIME-Version: 1.0 References: <20190822171237.20798-1-i.maximets@samsung.com> In-Reply-To: <20190822171237.20798-1-i.maximets@samsung.com> From: Alexander Duyck Date: Thu, 22 Aug 2019 10:21:14 -0700 Message-ID: Subject: Re: [PATCH net v3] ixgbe: fix double clean of tx descriptors with xdp To: Ilya Maximets Cc: Netdev , LKML , bpf@vger.kernel.org, "David S. Miller" , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Magnus Karlsson , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Jeff Kirsher , intel-wired-lan , Eelco Chaudron , William Tu 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: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