Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4883126pjb; Mon, 27 Jul 2020 07:32:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAf4QEmxOz7g8+gEHBslY+L7yLcubJ7t5TvGV9hb3DOhMLvMgPG1AjTARi0Xk8UroF5tol X-Received: by 2002:aa7:ca10:: with SMTP id y16mr14892235eds.345.1595860334245; Mon, 27 Jul 2020 07:32:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595860334; cv=none; d=google.com; s=arc-20160816; b=RHYxGfg3EVVb5enWyfZ7hKiCYJ2Q7IZ+9Oq552hgsKuB/GaK7mtGBiO7IZUlvy+VE2 4d2AMaHzU0YGq+lbboVE9Txhx8cng9QwH+dReXzVOfdoxm726fIRQjSK8Edqy96JQiph bzJ2fWcONIOIRMopyifBAANrdBDfWDPqEElPoORKG3VUIuq/ksM7nlU+RNoIGjJWO/Fx kNB2nA2OrxMyjENlUgVggGL+oRRh6yxVInqPq42h0ElEchZtpEfC0YExCOkQWv8Ej8wZ gPYk8XHNfpOfaU3bSLKyX7va14ByiHg2/PKnRTvuB3oBYhu80VhGSBJmUKaQPsbYQm9f nkpg== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1BS3yOg6/yUmTPU4X9S37w/RUomxLgb5r1lU/lHjVr4=; b=RTbZwz2XHo/VlnNvndxDN6VqED5i6lDNq/9p16Gkc/iLrC2iJTujixhsNtKFHIVyDe Ez8Jorr2tOVs/OK903bT4UfDRiEyRv2RRZODdHviQOREbDCs4mP5p6yywxiERPMNQ9Px 40zdOg4I06gj6HoioQf9h3eWIKb2V0ydg0BLZ0Ev04DGIku+/2mr1FtZgLFlOsEHy1al I5lNukML3qXX6RCA4emgg1OJuPOaDxhq7FBY8gfD2TNw+q1Rl/lSaiWDC5Kd944R3g0I 0E33B5me3IQJTC0SQgPlrJHOqpICjnG5nZTr30tX1sb0ixY2OBHKDRf05HzmODRU5Wq1 SCFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zoTSmTp5; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v6si1296365ejr.682.2020.07.27.07.31.52; Mon, 27 Jul 2020 07:32:14 -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=@kernel.org header.s=default header.b=zoTSmTp5; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732110AbgG0Oak (ORCPT + 99 others); Mon, 27 Jul 2020 10:30:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:50364 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731772AbgG0OVl (ORCPT ); Mon, 27 Jul 2020 10:21:41 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2D0B22070A; Mon, 27 Jul 2020 14:21:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859700; bh=0egnQEd/O+j//ciAsYesnArgxjTTurAsUK3+NIBF79A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zoTSmTp5Ad/sNGuKclUJvy4xv+gDRj1jI6P5qmIX08xtD5xnBzQlYwSnd1k+btp7E eQl1QlOdLx79BzMjHC6+8JhjlmYrKGmeQe5mvm3Z44gkQEN7uOt/uScdnzz7iE115i rVdP4IkU04rTKvwnN/6Ji2qnn8ixIHFi9j8HD2v8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shannon Nelson , "David S. Miller" , Sasha Levin Subject: [PATCH 5.7 071/179] ionic: fix up filter locks and debug msgs Date: Mon, 27 Jul 2020 16:04:06 +0200 Message-Id: <20200727134936.142291407@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shannon Nelson [ Upstream commit cbec2153a9a68d011454960ba84887e46e40b37d ] Add in a couple of forgotten spinlocks and fix up some of the debug messages around filter management. Fixes: c1e329ebec8d ("ionic: Add management of rx filters") Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 17 +++++++---------- .../ethernet/pensando/ionic/ionic_rx_filter.c | 5 +++++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 7fea60fc3e089..48aa502e4bd3d 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -849,8 +849,7 @@ static int ionic_lif_addr_add(struct ionic_lif *lif, const u8 *addr) if (f) return 0; - netdev_dbg(lif->netdev, "rx_filter add ADDR %pM (id %d)\n", addr, - ctx.comp.rx_filter_add.filter_id); + netdev_dbg(lif->netdev, "rx_filter add ADDR %pM\n", addr); memcpy(ctx.cmd.rx_filter_add.mac.addr, addr, ETH_ALEN); err = ionic_adminq_post_wait(lif, &ctx); @@ -879,6 +878,9 @@ static int ionic_lif_addr_del(struct ionic_lif *lif, const u8 *addr) return -ENOENT; } + netdev_dbg(lif->netdev, "rx_filter del ADDR %pM (id %d)\n", + addr, f->filter_id); + ctx.cmd.rx_filter_del.filter_id = cpu_to_le32(f->filter_id); ionic_rx_filter_free(lif, f); spin_unlock_bh(&lif->rx_filters.lock); @@ -887,9 +889,6 @@ static int ionic_lif_addr_del(struct ionic_lif *lif, const u8 *addr) if (err && err != -EEXIST) return err; - netdev_dbg(lif->netdev, "rx_filter del ADDR %pM (id %d)\n", addr, - ctx.cmd.rx_filter_del.filter_id); - return 0; } @@ -1341,13 +1340,11 @@ static int ionic_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, }; int err; + netdev_dbg(netdev, "rx_filter add VLAN %d\n", vid); err = ionic_adminq_post_wait(lif, &ctx); if (err) return err; - netdev_dbg(netdev, "rx_filter add VLAN %d (id %d)\n", vid, - ctx.comp.rx_filter_add.filter_id); - return ionic_rx_filter_save(lif, 0, IONIC_RXQ_INDEX_ANY, 0, &ctx); } @@ -1372,8 +1369,8 @@ static int ionic_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto, return -ENOENT; } - netdev_dbg(netdev, "rx_filter del VLAN %d (id %d)\n", vid, - le32_to_cpu(ctx.cmd.rx_filter_del.filter_id)); + netdev_dbg(netdev, "rx_filter del VLAN %d (id %d)\n", + vid, f->filter_id); ctx.cmd.rx_filter_del.filter_id = cpu_to_le32(f->filter_id); ionic_rx_filter_free(lif, f); diff --git a/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c b/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c index 80eeb7696e014..fb9d828812bd2 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c @@ -69,10 +69,12 @@ int ionic_rx_filters_init(struct ionic_lif *lif) spin_lock_init(&lif->rx_filters.lock); + spin_lock_bh(&lif->rx_filters.lock); for (i = 0; i < IONIC_RX_FILTER_HLISTS; i++) { INIT_HLIST_HEAD(&lif->rx_filters.by_hash[i]); INIT_HLIST_HEAD(&lif->rx_filters.by_id[i]); } + spin_unlock_bh(&lif->rx_filters.lock); return 0; } @@ -84,11 +86,13 @@ void ionic_rx_filters_deinit(struct ionic_lif *lif) struct hlist_node *tmp; unsigned int i; + spin_lock_bh(&lif->rx_filters.lock); for (i = 0; i < IONIC_RX_FILTER_HLISTS; i++) { head = &lif->rx_filters.by_id[i]; hlist_for_each_entry_safe(f, tmp, head, by_id) ionic_rx_filter_free(lif, f); } + spin_unlock_bh(&lif->rx_filters.lock); } int ionic_rx_filter_save(struct ionic_lif *lif, u32 flow_id, u16 rxq_index, @@ -124,6 +128,7 @@ int ionic_rx_filter_save(struct ionic_lif *lif, u32 flow_id, u16 rxq_index, f->filter_id = le32_to_cpu(ctx->comp.rx_filter_add.filter_id); f->rxq_index = rxq_index; memcpy(&f->cmd, ac, sizeof(f->cmd)); + netdev_dbg(lif->netdev, "rx_filter add filter_id %d\n", f->filter_id); INIT_HLIST_NODE(&f->by_hash); INIT_HLIST_NODE(&f->by_id); -- 2.25.1