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 A9993A04DD for ; Wed, 18 Nov 2020 17:38:50 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9CA89C96A; Wed, 18 Nov 2020 17:38:24 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by dpdk.org (Postfix) with ESMTP id 2B5E1C964 for ; Wed, 18 Nov 2020 17:38:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605717501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uyLC/Qh7sVgq8nWdYxADiHOJDEaIj3diJX4pT7r5aPs=; b=F8Zp/1oKB/g5DXZqhpuibtSrtK2FQxPBMSbp8xPcaPy2jjtKNeoEhs3694jQa2zTBh4xId WGPW5/C6RVl1uodkVks6G9A+uuxHmPIENRe3F3CmUk5nkHdl0AXtPSP4PsabmR2Y1FfHxt ofsM119NixM2j0yKYt+324OlnsYXDQg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-193-QRwAsYBXN76Z-P5FRLbWgg-1; Wed, 18 Nov 2020 11:38:19 -0500 X-MC-Unique: QRwAsYBXN76Z-P5FRLbWgg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0C4AC8049CA; Wed, 18 Nov 2020 16:38:18 +0000 (UTC) Received: from rh.redhat.com (ovpn-113-249.ams2.redhat.com [10.36.113.249]) by smtp.corp.redhat.com (Postfix) with ESMTP id 331355C1A3; Wed, 18 Nov 2020 16:38:16 +0000 (UTC) From: Kevin Traynor To: Long Li Cc: dpdk stable Date: Wed, 18 Nov 2020 16:35:48 +0000 Message-Id: <20201118163558.1101823-62-ktraynor@redhat.com> In-Reply-To: <20201118163558.1101823-1-ktraynor@redhat.com> References: <20201118163558.1101823-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Subject: [dpdk-stable] patch 'net/netvsc: allocate contiguous physical memory for RNDIS' has been queued to LTS release 18.11.11 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.11 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/24/20. 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/dad2bfdf57b6d2dd3d9d7bb787f75de6fef6cf59 Thanks. Kevin. --- >From dad2bfdf57b6d2dd3d9d7bb787f75de6fef6cf59 Mon Sep 17 00:00:00 2001 From: Long Li Date: Wed, 21 Oct 2020 17:26:07 -0700 Subject: [PATCH] net/netvsc: allocate contiguous physical memory for RNDIS [ upstream commit b8c3c628aff6defbabf677b4eea14c0529486357 ] When sending data, netvsc assumes the tx_rndis buffer is contiguous and calculates physical addresses based on this assumption. Use memzone to allocate tx_rndis so it's guaranteed that this buffer is physically contiguous. Signed-off-by: Long Li --- drivers/net/netvsc/hn_rxtx.c | 23 ++++++++++++----------- drivers/net/netvsc/hn_var.h | 2 ++ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c index 63b0f83f3a..38df13ce75 100644 --- a/drivers/net/netvsc/hn_rxtx.c +++ b/drivers/net/netvsc/hn_rxtx.c @@ -284,8 +284,13 @@ hn_dev_tx_queue_setup(struct rte_eth_dev *dev, name, nb_desc, sizeof(struct hn_txdesc)); - txq->tx_rndis = rte_calloc("hn_txq_rndis", nb_desc, - HN_RNDIS_PKT_ALIGNED, RTE_CACHE_LINE_SIZE); - if (txq->tx_rndis == NULL) + txq->tx_rndis_mz = rte_memzone_reserve_aligned(name, + nb_desc * HN_RNDIS_PKT_ALIGNED, rte_socket_id(), + RTE_MEMZONE_IOVA_CONTIG, HN_RNDIS_PKT_ALIGNED); + if (!txq->tx_rndis_mz) { + err = -rte_errno; goto error; + } + txq->tx_rndis = txq->tx_rndis_mz->addr; + txq->tx_rndis_iova = txq->tx_rndis_mz->iova; txq->txdesc_pool = rte_mempool_create(name, nb_desc, @@ -316,5 +321,5 @@ error: if (txq->txdesc_pool) rte_mempool_free(txq->txdesc_pool); - rte_free(txq->tx_rndis); + rte_memzone_free(txq->tx_rndis_mz); rte_free(txq); return err; @@ -358,5 +363,5 @@ hn_dev_tx_queue_release(void *arg) rte_mempool_free(txq->txdesc_pool); - rte_free(txq->tx_rndis); + rte_memzone_free(txq->tx_rndis_mz); rte_free(txq); } @@ -1341,10 +1346,6 @@ static int hn_xmit_sg(struct hn_tx_queue *txq, /* pass IOVA of rndis header in first segment */ - addr = rte_malloc_virt2iova(txq->tx_rndis); - if (unlikely(addr == RTE_BAD_IOVA)) { - PMD_DRV_LOG(ERR, "RNDIS transmit can not get iova"); - return -EINVAL; - } - addr = addr + ((char *)txd->rndis_pkt - (char *)txq->tx_rndis); + addr = txq->tx_rndis_iova + + ((char *)txd->rndis_pkt - (char *)txq->tx_rndis); sg[0].page = addr / PAGE_SIZE; diff --git a/drivers/net/netvsc/hn_var.h b/drivers/net/netvsc/hn_var.h index fceb345099..a7e70aaa51 100644 --- a/drivers/net/netvsc/hn_var.h +++ b/drivers/net/netvsc/hn_var.h @@ -54,5 +54,7 @@ struct hn_tx_queue { uint32_t free_thresh; struct rte_mempool *txdesc_pool; + const struct rte_memzone *tx_rndis_mz; void *tx_rndis; + rte_iova_t tx_rndis_iova; /* Applied packet transmission aggregation limits. */ -- 2.26.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-11-18 16:33:39.097309833 +0000 +++ 0062-net-netvsc-allocate-contiguous-physical-memory-for-R.patch 2020-11-18 16:33:37.985215098 +0000 @@ -1 +1 @@ -From b8c3c628aff6defbabf677b4eea14c0529486357 Mon Sep 17 00:00:00 2001 +From dad2bfdf57b6d2dd3d9d7bb787f75de6fef6cf59 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit b8c3c628aff6defbabf677b4eea14c0529486357 ] + @@ -12,2 +13,0 @@ -Cc: stable@dpdk.org - @@ -21 +21 @@ -index 5d59db513c..d8aa0996e7 100644 +index 63b0f83f3a..38df13ce75 100644 @@ -48 +48 @@ -@@ -367,5 +372,5 @@ hn_dev_tx_queue_release(void *arg) +@@ -358,5 +363,5 @@ hn_dev_tx_queue_release(void *arg) @@ -55 +55 @@ -@@ -1446,10 +1451,6 @@ static int hn_xmit_sg(struct hn_tx_queue *txq, +@@ -1341,10 +1346,6 @@ static int hn_xmit_sg(struct hn_tx_queue *txq, @@ -69 +69 @@ -index 56bfa972d1..20bb3c38dc 100644 +index fceb345099..a7e70aaa51 100644 @@ -72 +72 @@ -@@ -55,5 +55,7 @@ struct hn_tx_queue { +@@ -54,5 +54,7 @@ struct hn_tx_queue {