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 625A0A04D6; Tue, 11 Aug 2020 04:33:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1BAAA1C027; Tue, 11 Aug 2020 04:33:39 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by dpdk.org (Postfix) with ESMTP id C2A6F1C026 for ; Tue, 11 Aug 2020 04:33:37 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1004) id 28B4220B4908; Mon, 10 Aug 2020 19:33:37 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 28B4220B4908 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1597113217; bh=C3asb8SKv5wCSRAQeO5F6ErXXHEjPgz9MbvEdV9Bg2o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CTaFYDQLXrVmJT/olNm4dK+MCl0bioBzMMqSyESFdTWq4ukReXqB/mmVt1l/TxYkB Ne1VC6aS560IP6haSkz/fLB+OeZEA9E6PWiRU/QkqAIwX8yHyUaQ+vdw7fAin5VJFe TusTmwTq1paQaHSjaMMpWSLT0JtZGyfdWDNOAIIo= From: longli@linuxonhyperv.com To: "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger Cc: dev@dpdk.org, Long Li Date: Mon, 10 Aug 2020 19:33:13 -0700 Message-Id: <1597113194-90208-3-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1597113194-90208-1-git-send-email-longli@linuxonhyperv.com> References: <1597113194-90208-1-git-send-email-longli@linuxonhyperv.com> Subject: [dpdk-dev] [PATCH 3/4] net/netvsc: mark chim_index as NVS_CHIM_IDX_INVALID after freeing it X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Long Li chim_index could potentially be used in other hn_txdesc when re-allocated. Mark it as invalid to prevent stale value being used. Signed-off-by: Long Li --- drivers/net/netvsc/hn_rxtx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c index c8c4ee10c..a388ff258 100644 --- a/drivers/net/netvsc/hn_rxtx.c +++ b/drivers/net/netvsc/hn_rxtx.c @@ -419,8 +419,10 @@ hn_nvs_send_completed(struct rte_eth_dev *dev, uint16_t queue_id, ++txq->stats.errors; } - if (txd->chim_index != NVS_CHIM_IDX_INVALID) + if (txd->chim_index != NVS_CHIM_IDX_INVALID) { hn_chim_free(hv, txd->chim_index); + txd->chim_index = NVS_CHIM_IDX_INVALID; + } rte_pktmbuf_free(txd->m); hn_txd_put(txq, txd); -- 2.25.1