Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3093116ybt; Mon, 29 Jun 2020 15:10:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUVnWcAKS510aGv0TpOMgHKV5LYeeBW7uGjfRYHZTBPsZx1IV2ofsioC5sOoY+J4og4SzP X-Received: by 2002:a05:6402:b23:: with SMTP id bo3mr20213655edb.331.1593468624651; Mon, 29 Jun 2020 15:10:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593468624; cv=none; d=google.com; s=arc-20160816; b=Cci8vmVvJAIxZFeZGC5+X3gcYuAgOxfxA8h6qynKKuHtB1oxzRacWMRaqi7VTy1dtT wNcCX3KbJr4CzXJdmAj1PlaY48feZpPh5umfvJi+gZyBYBJgUPzQxEl5PaIr9GeZgs0M 2rK7tkOYQ1t8h35/gsAy2UiVAdHJQeAFb/1XdpMp959sNA1CZYmbvFjt7icu8IK6C3TY cGCcmkkVc1dCOF70/v0GiW1rfz0CkzIALlcp+RBimAt/bscx/LrIbFozWBTUxnqdh2BX Rknopy49K4W6bGzWa4KaaGwCT12649s0WLIgB4S2xZQQ+xjVlVvOfI89t6it9iObaqyU lU+g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Df28p8ER0Dc2hQCoFRXMvMvPjDgvTNxzbBWF8VN6LQE=; b=pCMggyL/tnALgX9entQ/tC+DV0rkJ/33E3wOeQsdyooDnP5die6KXapqwdK4syG4Gi wZpiyfmJI9Aq6vDR7Shz8szFwhgG/TAB35ZgMISq7P8Cz/tSyfowYqlcgXf4JhYvqVjW 96gqtudhVhsdHqQN17OFCygItviMkJmKfnk9aU7DAly1AHAQ3Oci6kB2nLlk8PA9A02H I/zH6DUArOYhTIZwbxYcUK7T8YdB6qLTZucqbhigxW5cm6Z0SdeFCg8tBW8yp82Ks+8c JBGkdO52HFQNg5yHfpLocYSMd7uRaV0D51HRgHH82JMc0b7lbCWzpntydY1iZhVMZZ2y skPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="wtE3fHB/"; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i13si461080edn.462.2020.06.29.15.10.01; Mon, 29 Jun 2020 15:10:24 -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="wtE3fHB/"; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726466AbgF2WGT (ORCPT + 99 others); Mon, 29 Jun 2020 18:06:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:56780 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726131AbgF2SfS (ORCPT ); Mon, 29 Jun 2020 14:35:18 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 942FC24726; Mon, 29 Jun 2020 15:20:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593444048; bh=5xZ9Bfz31l30pCq45KyeE0+gkOEVNXg0vIJALHphUow=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wtE3fHB/MOwn8HQfpPKBpLlC34XKZ6nEJEU01oX5eggfvXaNX58jQndKaKFNyd1v5 oOefkTFZvUhstohIckcC0Hbh0QXWn7PBqYpslaPkYAJiA92FkD3PL+WBVJwOkJxeFy n90vzYY6CclVeOpVugsZJSLvsDLbZd/bZVHjBRd8= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Rahul Lakkireddy , "David S . Miller" , Sasha Levin Subject: [PATCH 5.7 155/265] cxgb4: move handling L2T ARP failures to caller Date: Mon, 29 Jun 2020 11:16:28 -0400 Message-Id: <20200629151818.2493727-156-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200629151818.2493727-1-sashal@kernel.org> References: <20200629151818.2493727-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.7.7-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.7.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.7.7-rc1 X-KernelTest-Deadline: 2020-07-01T15:14+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rahul Lakkireddy [ Upstream commit 11d8cd5c9f3b46f397f889cefdb66795518aaebd ] Move code handling L2T ARP failures to the only caller. Fixes following sparse warning: skbuff.h:2091:29: warning: context imbalance in 'handle_failed_resolution' - unexpected unlock Fixes: 749cb5fe48bb ("cxgb4: Replace arpq_head/arpq_tail with SKB double link-list code") Signed-off-by: Rahul Lakkireddy Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/chelsio/cxgb4/l2t.c | 52 +++++++++++------------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/drivers/net/ethernet/chelsio/cxgb4/l2t.c b/drivers/net/ethernet/chelsio/cxgb4/l2t.c index 72b37a66c7d88..0ed20a9cca144 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/l2t.c +++ b/drivers/net/ethernet/chelsio/cxgb4/l2t.c @@ -502,41 +502,20 @@ u64 cxgb4_select_ntuple(struct net_device *dev, } EXPORT_SYMBOL(cxgb4_select_ntuple); -/* - * Called when address resolution fails for an L2T entry to handle packets - * on the arpq head. If a packet specifies a failure handler it is invoked, - * otherwise the packet is sent to the device. - */ -static void handle_failed_resolution(struct adapter *adap, struct l2t_entry *e) -{ - struct sk_buff *skb; - - while ((skb = __skb_dequeue(&e->arpq)) != NULL) { - const struct l2t_skb_cb *cb = L2T_SKB_CB(skb); - - spin_unlock(&e->lock); - if (cb->arp_err_handler) - cb->arp_err_handler(cb->handle, skb); - else - t4_ofld_send(adap, skb); - spin_lock(&e->lock); - } -} - /* * Called when the host's neighbor layer makes a change to some entry that is * loaded into the HW L2 table. */ void t4_l2t_update(struct adapter *adap, struct neighbour *neigh) { - struct l2t_entry *e; - struct sk_buff_head *arpq = NULL; - struct l2t_data *d = adap->l2t; unsigned int addr_len = neigh->tbl->key_len; u32 *addr = (u32 *) neigh->primary_key; - int ifidx = neigh->dev->ifindex; - int hash = addr_hash(d, addr, addr_len, ifidx); + int hash, ifidx = neigh->dev->ifindex; + struct sk_buff_head *arpq = NULL; + struct l2t_data *d = adap->l2t; + struct l2t_entry *e; + hash = addr_hash(d, addr, addr_len, ifidx); read_lock_bh(&d->lock); for (e = d->l2tab[hash].first; e; e = e->next) if (!addreq(e, addr) && e->ifindex == ifidx) { @@ -569,8 +548,25 @@ void t4_l2t_update(struct adapter *adap, struct neighbour *neigh) write_l2e(adap, e, 0); } - if (arpq) - handle_failed_resolution(adap, e); + if (arpq) { + struct sk_buff *skb; + + /* Called when address resolution fails for an L2T + * entry to handle packets on the arpq head. If a + * packet specifies a failure handler it is invoked, + * otherwise the packet is sent to the device. + */ + while ((skb = __skb_dequeue(&e->arpq)) != NULL) { + const struct l2t_skb_cb *cb = L2T_SKB_CB(skb); + + spin_unlock(&e->lock); + if (cb->arp_err_handler) + cb->arp_err_handler(cb->handle, skb); + else + t4_ofld_send(adap, skb); + spin_lock(&e->lock); + } + } spin_unlock_bh(&e->lock); } -- 2.25.1