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 D82A1A0093 for ; Tue, 19 May 2020 15:08:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D02AE1D603; Tue, 19 May 2020 15:08:11 +0200 (CEST) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id 937581D67B for ; Tue, 19 May 2020 15:08:09 +0200 (CEST) Received: by mail-wr1-f68.google.com with SMTP id e16so15826836wra.7 for ; Tue, 19 May 2020 06:08:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tlvVZz4a97V6bKLD8Dytho1EN6S/udcIoOhWr5eLOnw=; b=nGhPL4LTO4MtswlFlaQpq/3/jPb81Rf0BHiujksZue1uvAcuzoYBuL99ZGOy1FFnPC 0kw9geSRB928o5OvApL43+LetPvb9aBTeM9ILtUXQmgZ4ocu2yf/wfjh2bw9yFG1rJ2y pm1zYU9+pbGwADSZM4SQL9H2ZzY3B4uxxnEib0w3w3ojWdgvDVBScQVjCWRcdK5bLBKJ +4Stk+qbofM02o44e8j2kwro5kovHHM7y92+PKpZvpNJe92VwicYBxIEMZFgfZr7pafv sNU/Uix7/GQ805ExqUDwod8/HH7N4KoM1uDjwdTMTBbBKAx6jveGwgQ+YC3kV6iMvqie fdFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tlvVZz4a97V6bKLD8Dytho1EN6S/udcIoOhWr5eLOnw=; b=lSZS+CQsTnMvL3rlf18egO6cK5neoIuD/+CYZm2qR5HGOOtSI4YS+1tyC+n1j8123l y0dPOSvNFpi+aDC8ZLzoQT5aszGQTAyA2jeck5jdgEnkOR2XyNcyUY0d9dWOHX+YXIuy JwTHXs1SS+owMQOmjPuxAIaqggL6AJ2proKp5gElb9QsbpLMWel0RCL9ERnAVshpbB7M 5bKJeBhTHKT3cnchV5MTludZz2wW7FMjjdqrps6niCjthG0APWnjYHvuaJc84FrF//ki f2hxmOE0qBPRaWV5NAxdnX64FuFWe+RA0nyOb2LRzzIKyIjGTPt0y4jTdAbCexY9s3pp bubw== X-Gm-Message-State: AOAM530WdCuGv0+IGZHxt/JE/chXZ7NyrhYYEQ4JGgrc3bC1L5XS9yUB J+pR58zPJH3tWRnw7klMgWg= X-Google-Smtp-Source: ABdhPJx8QwbYCX1BuhUAKZ4XLHWU5p57rxalOmK+8f7C+SGfZiCUlCuEqa6Ve/IOt/rXFM73dMoqYA== X-Received: by 2002:a5d:43d1:: with SMTP id v17mr25143975wrr.282.1589893689269; Tue, 19 May 2020 06:08:09 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id u65sm3915429wmg.8.2020.05.19.06.08.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:08:08 -0700 (PDT) From: luca.boccassi@gmail.com To: Stephen Hemminger Cc: dpdk stable Date: Tue, 19 May 2020 14:03:00 +0100 Message-Id: <20200519130549.112823-45-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519130549.112823-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> <20200519130549.112823-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/netvsc: fix memory free on device close' has been queued to stable release 19.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 stable release 19.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 05/21/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. Thanks. Luca Boccassi --- >From 81441b4e4f4e65b722bd4cdb0d967e47244632f1 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 31 Mar 2020 10:14:00 -0700 Subject: [PATCH] net/netvsc: fix memory free on device close [ upstream commit 30408aab2d4e0fd9a5d2b4e2ef2a3a7b9e6c95bf ] The netvsc PMD was putting the mac address in private data but the core rte_ethdev doesn't allow that it. It has to be in rte_malloc'd memory or a message will be printed on shutdown/close. EAL: Invalid memory Fixes: f8279f47dd89 ("net/netvsc: fix crash in secondary process") Signed-off-by: Stephen Hemminger --- drivers/net/netvsc/hn_ethdev.c | 16 ++++++++++------ drivers/net/netvsc/hn_var.h | 2 -- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index ac66108380..05f1a25a1a 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -134,8 +134,6 @@ eth_dev_vmbus_allocate(struct rte_vmbus_device *dev, size_t private_data_size) static void eth_dev_vmbus_release(struct rte_eth_dev *eth_dev) { - /* mac_addrs must not be freed alone because part of dev_private */ - eth_dev->data->mac_addrs = NULL; /* free ether device */ rte_eth_dev_release_port(eth_dev); @@ -937,9 +935,6 @@ eth_hn_dev_init(struct rte_eth_dev *eth_dev) eth_dev->tx_pkt_burst = &hn_xmit_pkts; eth_dev->rx_pkt_burst = &hn_recv_pkts; - /* Since Hyper-V only supports one MAC address, just use local data */ - eth_dev->data->mac_addrs = &hv->mac_addr; - /* * for secondary processes, we don't initialize any further as primary * has already done this work. @@ -947,6 +942,15 @@ eth_hn_dev_init(struct rte_eth_dev *eth_dev) if (rte_eal_process_type() != RTE_PROC_PRIMARY) return 0; + /* Since Hyper-V only supports one MAC address */ + eth_dev->data->mac_addrs = rte_calloc("hv_mac", HN_MAX_MAC_ADDRS, + sizeof(struct rte_ether_addr), 0); + if (eth_dev->data->mac_addrs == NULL) { + PMD_INIT_LOG(ERR, + "Failed to allocate memory store MAC addresses"); + return -ENOMEM; + } + hv->vmbus = vmbus; hv->rxbuf_res = &vmbus->resource[HV_RECV_BUF_MAP]; hv->chim_res = &vmbus->resource[HV_SEND_BUF_MAP]; @@ -989,7 +993,7 @@ eth_hn_dev_init(struct rte_eth_dev *eth_dev) if (err) goto failed; - err = hn_rndis_get_eaddr(hv, hv->mac_addr.addr_bytes); + err = hn_rndis_get_eaddr(hv, eth_dev->data->mac_addrs->addr_bytes); if (err) goto failed; diff --git a/drivers/net/netvsc/hn_var.h b/drivers/net/netvsc/hn_var.h index 822d737bd3..b4c6171737 100644 --- a/drivers/net/netvsc/hn_var.h +++ b/drivers/net/netvsc/hn_var.h @@ -139,8 +139,6 @@ struct hn_data { uint8_t rss_key[40]; uint16_t rss_ind[128]; - struct rte_ether_addr mac_addr; - struct rte_eth_dev_owner owner; struct rte_intr_handle vf_intr; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 14:04:46.378461418 +0100 +++ 0045-net-netvsc-fix-memory-free-on-device-close.patch 2020-05-19 14:04:44.184647792 +0100 @@ -1,15 +1,16 @@ -From 30408aab2d4e0fd9a5d2b4e2ef2a3a7b9e6c95bf Mon Sep 17 00:00:00 2001 +From 81441b4e4f4e65b722bd4cdb0d967e47244632f1 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 31 Mar 2020 10:14:00 -0700 Subject: [PATCH] net/netvsc: fix memory free on device close +[ upstream commit 30408aab2d4e0fd9a5d2b4e2ef2a3a7b9e6c95bf ] + The netvsc PMD was putting the mac address in private data but the core rte_ethdev doesn't allow that it. It has to be in rte_malloc'd memory or a message will be printed on shutdown/close. EAL: Invalid memory Fixes: f8279f47dd89 ("net/netvsc: fix crash in secondary process") -Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- drivers/net/netvsc/hn_ethdev.c | 16 ++++++++++------