Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4000239pxj; Tue, 8 Jun 2021 04:11:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIsWVNP6MgZoNHQtnfgrBjaHlbZWPBzBjUrvxi5mwHfFm9YNXgU0sgrzb8dQY0uaJ9+fz+ X-Received: by 2002:a17:906:6549:: with SMTP id u9mr22366896ejn.506.1623150677439; Tue, 08 Jun 2021 04:11:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623150677; cv=none; d=google.com; s=arc-20160816; b=QtpopePvMG0/OyMGzFIwr8ywaQ59cGFm20F5cdOIe30ziL4Bsy7GAidEfB45w1zDcJ lSp74MqUMZ31wGwnEd4HXCriAFAgFPC8jiFaM0PzYuBvJ8L67PzPXchzC2Y1aKNwLXbo 841tDQRpy2Bno/Hb7GtvkcVoPBC15PaIYwmiknlOktaMd9dikZCmMtw5prk36ICxmh+F 9ahnhIgwbKZKoQ55wV6Pbvp24HVfTWtjv+3eFbQL6yNI3juwU4uo0ZskOCBwM3t+Wxit zndbNzWjpsN4ZTQEnIHICDJaXqnFprk4Z1YqpQC0LN4iGRDNK/7rliG+YstPhrH9eO1K R2lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=UJVsqI/ei0WczshYuB8pLAQsFgqQWwx9v5zxVqgopwU=; b=QJ32YNfWG/5+I6/99alNBFh89cDL7ST355PB5EQi5VSNCUjfj5TzkiRE3LrWtWDMEl DtfRIKHTI2ZrSMG6PniLsg++PeA47V62KjHLmQtT/QE1dZkHY1v0m5uh7wGfkPRp4Zw/ QjQR4A6Vhs7C3PmGeQ1WTXlHoxX06f6FgCjxqVHDD9EyY3Six+9W88zGMP4TPqyr5oIR O/pCJrTY+XIHIHdLPVOlqFVYOI37vIgcCJiqv3CViv8tfGS0poQUNOciTK547RuoJTSY GXKT/Ds7CsdHE+mLtiT2spDRMlpS7nX05Sf9+t/Onm7t5ZAVH64hPW/TtXiiZbQIIkRm NGFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=B9ab52pb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id l5si15248699ejg.306.2021.06.08.04.10.53; Tue, 08 Jun 2021 04:11:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=B9ab52pb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231698AbhFHLKb (ORCPT + 99 others); Tue, 8 Jun 2021 07:10:31 -0400 Received: from mail-pg1-f169.google.com ([209.85.215.169]:38536 "EHLO mail-pg1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231303AbhFHLKb (ORCPT ); Tue, 8 Jun 2021 07:10:31 -0400 Received: by mail-pg1-f169.google.com with SMTP id 6so16221740pgk.5; Tue, 08 Jun 2021 04:08:22 -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=UJVsqI/ei0WczshYuB8pLAQsFgqQWwx9v5zxVqgopwU=; b=B9ab52pbsKXDXa+qRWwLhBk1hn1Q5Y5Epsog2G5yDfhkg5IOo9jKJ2yFIQFwMAzGud AcSRIaZ8KgYDCs+rim+4y/6lRxahUee70hAve0OSKrKrsbZZQij7nBPhyvvDc1HBnS6M ngcCKuustZvvUxVhpJYky5CuYcYU4kUvomXBT9SOle0uV5+XZoXfXEQH4t9GhG2hbRS3 Bj3KqAasLfgPV7LJBkffZQB5uBR+wC3S/r/+wrwD79PoJZgN9ov0Q6SlyNIkVznJzrKx VikGD3Fo8rv+94mK8O47KXO6kqFcS+lnDOMXrGGMWVpyB8mztLWH4TukVO7Hh8ZWKPf7 eXaA== 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=UJVsqI/ei0WczshYuB8pLAQsFgqQWwx9v5zxVqgopwU=; b=HUw/8bMBXZJWaXcNHSSIyXEuYo/qLlqkRjSN8CkC3ubQghE3vC4uUWXyVwGZifr5cm ahaFWnspBd2vVz0f5drpl66DzAHG5/k9b+IMVwHH7DNQiL8cujP82FXIGlpwDEgPOAnz LMP/6R5XN/+kY/uV2I90NZ1qW3atNWCoPm8MonRjavOOEf02cboymmmDEP+IFlQFZLfO xq8Je1PEjPiXKyi8qEuqviWy3gVd0B02vblaz7G42Fx4M1rfX2KYudXykmSlylKCqWtl L4tpJtE5QAzUCa61IehC6CmidqXy6Iu+MZTZvhXMWybSPZ/4UD/afsInNKVFxjRsQpW4 o5sA== X-Gm-Message-State: AOAM530W1bgvsqoODc/Ux9gqtu7bakhW4b9dM6g6mWokEOqn6cNYcoj9 Apr3jDSC3hCUo58fI5Vq1yuX9A1aCqOpkyxjMwU= X-Received: by 2002:a63:4e4f:: with SMTP id o15mr22260611pgl.208.1623150442052; Tue, 08 Jun 2021 04:07:22 -0700 (PDT) MIME-Version: 1.0 References: <20210607122644.59021-1-wanghai38@huawei.com> In-Reply-To: <20210607122644.59021-1-wanghai38@huawei.com> From: Magnus Karlsson Date: Tue, 8 Jun 2021 13:07:11 +0200 Message-ID: Subject: Re: [Intel-wired-lan] [PATCH net] ixgbe, xsk: clean up the resources in ixgbe_xsk_pool_enable error path To: Wang Hai Cc: "Brandeburg, Jesse" , "Nguyen, Anthony L" , "David S. Miller" , Alexei Starovoitov , Jakub Kicinski , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Jeff Kirsher , jan.sokolowski@intel.com, "Karlsson, Magnus" , Network Development , bpf , intel-wired-lan , open list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 7, 2021 at 2:17 PM Wang Hai wrote: > > In ixgbe_xsk_pool_enable(), if ixgbe_xsk_wakeup() fails, > We should restore the previous state and clean up the > resources. Add the missing clear af_xdp_zc_qps and unmap dma > to fix this bug. > > Fixes: d49e286d354e ("ixgbe: add tracking of AF_XDP zero-copy state for each queue pair") > Fixes: 4a9b32f30f80 ("ixgbe: fix potential RX buffer starvation for AF_XDP") > Signed-off-by: Wang Hai > --- > drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) Thanks Wang. Acked-by: Magnus Karlsson > diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c > index 91ad5b902673..d912f14d2ba4 100644 > --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c > +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c > @@ -52,8 +52,11 @@ static int ixgbe_xsk_pool_enable(struct ixgbe_adapter *adapter, > > /* Kick start the NAPI context so that receiving will start */ > err = ixgbe_xsk_wakeup(adapter->netdev, qid, XDP_WAKEUP_RX); > - if (err) > + if (err) { > + clear_bit(qid, adapter->af_xdp_zc_qps); > + xsk_pool_dma_unmap(pool, IXGBE_RX_DMA_ATTR); > return err; > + } > } > > return 0; > -- > 2.17.1 > > _______________________________________________ > Intel-wired-lan mailing list > Intel-wired-lan@osuosl.org > https://lists.osuosl.org/mailman/listinfo/intel-wired-lan