From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 85D13A0613 for ; Wed, 28 Aug 2019 15:42:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6C9291C22E; Wed, 28 Aug 2019 15:42:54 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id E41FE1BF82 for ; Wed, 28 Aug 2019 15:42:52 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 60D30C0546F2; Wed, 28 Aug 2019 13:42:52 +0000 (UTC) Received: from rh.redhat.com (ovpn-117-52.ams2.redhat.com [10.36.117.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 94517196AE; Wed, 28 Aug 2019 13:42:51 +0000 (UTC) From: Kevin Traynor To: Rasesh Mody Cc: dpdk stable Date: Wed, 28 Aug 2019 14:41:44 +0100 Message-Id: <20190828134234.20547-8-ktraynor@redhat.com> In-Reply-To: <20190828134234.20547-1-ktraynor@redhat.com> References: <20190828134234.20547-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 28 Aug 2019 13:42:52 +0000 (UTC) Subject: [dpdk-stable] patch 'net/bnx2x: fix fastpath SB allocation for SRIOV' has been queued to LTS release 18.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 09/04/19. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/ae110478a3face082f270c58d430676064763ff2 Thanks. Kevin Traynor --- >From ae110478a3face082f270c58d430676064763ff2 Mon Sep 17 00:00:00 2001 From: Rasesh Mody Date: Wed, 3 Jul 2019 16:43:13 -0700 Subject: [PATCH] net/bnx2x: fix fastpath SB allocation for SRIOV [ upstream commit 0cdbc98f6ed48b769ed5b22a61c38fbe3c90538a ] For SRIOV, fastpath status blocks are not allocated resulting in segfault. Separate out fastpath DMA allocation/free from rest of memory allocation/free. It is now done as part of NIC load/unload. Comment indentation changes in bnx2x_alloc_hsi_mem() and bnx2x_free_hsi_mem() APIs. Fixes: f0219d98defd ("net/bnx2x: fix interrupt flood") Signed-off-by: Rasesh Mody --- drivers/net/bnx2x/bnx2x.c | 117 +++++++++++++++++++------------------- 1 file changed, 60 insertions(+), 57 deletions(-) diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index 4ac5ea8d8..3b034b1e9 100644 --- a/drivers/net/bnx2x/bnx2x.c +++ b/drivers/net/bnx2x/bnx2x.c @@ -2121,4 +2121,7 @@ bnx2x_nic_unload(struct bnx2x_softc *sc, uint32_t unload_mode, uint8_t keep_link } + /* free the host hardware/software hsi structures */ + bnx2x_free_hsi_mem(sc); + bnx2x_free_fw_stats_mem(sc); @@ -2404,7 +2407,4 @@ static void bnx2x_free_mem(struct bnx2x_softc *sc) bnx2x_free_ilt_lines_mem(sc); - - /* free the host hardware/software hsi structures */ - bnx2x_free_hsi_mem(sc); } @@ -2457,11 +2457,4 @@ static int bnx2x_alloc_mem(struct bnx2x_softc *sc) } - /* allocate the host hardware/software hsi structures */ - if (bnx2x_alloc_hsi_mem(sc) != 0) { - PMD_DRV_LOG(ERR, sc, "bnx2x_alloc_hsi_mem was failed"); - bnx2x_free_mem(sc); - return -ENXIO; - } - return 0; } @@ -7243,4 +7236,12 @@ int bnx2x_nic_load(struct bnx2x_softc *sc) } + /* allocate the host hardware/software hsi structures */ + if (bnx2x_alloc_hsi_mem(sc) != 0) { + PMD_DRV_LOG(ERR, sc, "bnx2x_alloc_hsi_mem was failed"); + sc->state = BNX2X_STATE_CLOSED; + rc = -ENOMEM; + goto bnx2x_nic_load_error0; + } + if (bnx2x_alloc_fw_stats_mem(sc) != 0) { sc->state = BNX2X_STATE_CLOSED; @@ -7458,4 +7459,5 @@ bnx2x_nic_load_error0: bnx2x_free_fw_stats_mem(sc); + bnx2x_free_hsi_mem(sc); bnx2x_free_mem(sc); @@ -8903,7 +8905,7 @@ int bnx2x_alloc_hsi_mem(struct bnx2x_softc *sc) if (IS_PF(sc)) { -/************************/ -/* DEFAULT STATUS BLOCK */ -/************************/ + /************************/ + /* DEFAULT STATUS BLOCK */ + /************************/ if (bnx2x_dma_alloc(sc, sizeof(struct host_sp_status_block), @@ -8915,7 +8917,7 @@ int bnx2x_alloc_hsi_mem(struct bnx2x_softc *sc) sc->def_sb = (struct host_sp_status_block *)sc->def_sb_dma.vaddr; -/***************/ -/* EVENT QUEUE */ -/***************/ + /***************/ + /* EVENT QUEUE */ + /***************/ if (bnx2x_dma_alloc(sc, BNX2X_PAGE_SIZE, @@ -8928,7 +8930,7 @@ int bnx2x_alloc_hsi_mem(struct bnx2x_softc *sc) sc->eq = (union event_ring_elem *)sc->eq_dma.vaddr; -/*************/ -/* SLOW PATH */ -/*************/ + /*************/ + /* SLOW PATH */ + /*************/ if (bnx2x_dma_alloc(sc, sizeof(struct bnx2x_slowpath), @@ -8942,7 +8944,7 @@ int bnx2x_alloc_hsi_mem(struct bnx2x_softc *sc) sc->sp = (struct bnx2x_slowpath *)sc->sp_dma.vaddr; -/*******************/ -/* SLOW PATH QUEUE */ -/*******************/ + /*******************/ + /* SLOW PATH QUEUE */ + /*******************/ if (bnx2x_dma_alloc(sc, BNX2X_PAGE_SIZE, @@ -8957,7 +8959,7 @@ int bnx2x_alloc_hsi_mem(struct bnx2x_softc *sc) sc->spq = (struct eth_spe *)sc->spq_dma.vaddr; -/***************************/ -/* FW DECOMPRESSION BUFFER */ -/***************************/ + /***************************/ + /* FW DECOMPRESSION BUFFER */ + /***************************/ if (bnx2x_dma_alloc(sc, FW_BUF_SIZE, &sc->gz_buf_dma, @@ -8983,7 +8985,7 @@ int bnx2x_alloc_hsi_mem(struct bnx2x_softc *sc) fp->index = i; -/*******************/ -/* FP STATUS BLOCK */ -/*******************/ + /*******************/ + /* FP STATUS BLOCK */ + /*******************/ snprintf(buf, sizeof(buf), "fp_%d_sb", i); @@ -9016,7 +9018,7 @@ void bnx2x_free_hsi_mem(struct bnx2x_softc *sc) fp = &sc->fp[i]; -/*******************/ -/* FP STATUS BLOCK */ -/*******************/ + /*******************/ + /* FP STATUS BLOCK */ + /*******************/ memset(&fp->status_block, 0, sizeof(fp->status_block)); @@ -9024,39 +9026,40 @@ void bnx2x_free_hsi_mem(struct bnx2x_softc *sc) } - /***************************/ - /* FW DECOMPRESSION BUFFER */ - /***************************/ + if (IS_PF(sc)) { + /***************************/ + /* FW DECOMPRESSION BUFFER */ + /***************************/ - bnx2x_dma_free(&sc->gz_buf_dma); - sc->gz_buf = NULL; + bnx2x_dma_free(&sc->gz_buf_dma); + sc->gz_buf = NULL; - /*******************/ - /* SLOW PATH QUEUE */ - /*******************/ + /*******************/ + /* SLOW PATH QUEUE */ + /*******************/ - bnx2x_dma_free(&sc->spq_dma); - sc->spq = NULL; + bnx2x_dma_free(&sc->spq_dma); + sc->spq = NULL; - /*************/ - /* SLOW PATH */ - /*************/ + /*************/ + /* SLOW PATH */ + /*************/ - bnx2x_dma_free(&sc->sp_dma); - sc->sp = NULL; + bnx2x_dma_free(&sc->sp_dma); + sc->sp = NULL; - /***************/ - /* EVENT QUEUE */ - /***************/ + /***************/ + /* EVENT QUEUE */ + /***************/ - bnx2x_dma_free(&sc->eq_dma); - sc->eq = NULL; + bnx2x_dma_free(&sc->eq_dma); + sc->eq = NULL; - /************************/ - /* DEFAULT STATUS BLOCK */ - /************************/ - - bnx2x_dma_free(&sc->def_sb_dma); - sc->def_sb = NULL; + /************************/ + /* DEFAULT STATUS BLOCK */ + /************************/ + bnx2x_dma_free(&sc->def_sb_dma); + sc->def_sb = NULL; + } } -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-08-28 14:32:32.264882681 +0100 +++ 0009-net-bnx2x-fix-fastpath-SB-allocation-for-SRIOV.patch 2019-08-28 14:32:31.615957940 +0100 @@ -1 +1 @@ -From 0cdbc98f6ed48b769ed5b22a61c38fbe3c90538a Mon Sep 17 00:00:00 2001 +From ae110478a3face082f270c58d430676064763ff2 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 0cdbc98f6ed48b769ed5b22a61c38fbe3c90538a ] + @@ -14 +15,0 @@ -Cc: stable@dpdk.org @@ -22 +23 @@ -index 877f5b73d..1a088269f 100644 +index 4ac5ea8d8..3b034b1e9 100644