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 A372CA04C8; Fri, 18 Sep 2020 20:53:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 765991DB28; Fri, 18 Sep 2020 20:53:58 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by dpdk.org (Postfix) with ESMTP id 7093B1DB27; Fri, 18 Sep 2020 20:53:57 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1004) id AAE3420B7178; Fri, 18 Sep 2020 11:53:56 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com AAE3420B7178 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1600455236; bh=TrYYjkZVDpZ6bqRi90mJhuL8YpTXQaJe1s0Ri1vTkRg=; h=From:To:Cc:Subject:Date:From; b=U3hOtotdWoeMJmHJRnMD4iyWmyOuapjITnkhHUpSLrQm2icCPh42J+ko61EMerYFo PqXpGzReRNGHUeciu+gzJC7p537aR5BJM1EvZh/Q1Yi5Kaa0gQnhZ13t+7XGV2e3CP O8K8RQF7E7mAxn5/0x/GzNihhV97qC0x+5nNAwQc= From: Long Li To: Stephen Hemminger Cc: dev@dpdk.org, Long Li , stable@dpdk.org Date: Fri, 18 Sep 2020 11:53:47 -0700 Message-Id: <1600455227-3709-1-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] net/netvsc: fix rndis packet addresses 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 The address should be calculated before type cast, not after. Fixes: cc02518 ("net/netvsc: split send buffers from Tx descriptors") Cc: stable@dpdk.org Reported-by: Souvik Dey Signed-off-by: Long Li --- drivers/net/netvsc/hn_rxtx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c index 813f8c3cc..70f8b8332 100644 --- a/drivers/net/netvsc/hn_rxtx.c +++ b/drivers/net/netvsc/hn_rxtx.c @@ -160,8 +160,8 @@ static void hn_txd_init(struct rte_mempool *mp __rte_unused, txd->queue_id = txq->queue_id; txd->chim_index = NVS_CHIM_IDX_INVALID; - txd->rndis_pkt = (struct rndis_packet_msg *)(char *)txq->tx_rndis - + idx * HN_RNDIS_PKT_ALIGNED; + txd->rndis_pkt = (struct rndis_packet_msg *)((char *)txq->tx_rndis + + idx * HN_RNDIS_PKT_ALIGNED); } int -- 2.25.1