From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A943DA0C40 for ; Tue, 22 Jun 2021 14:39:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9567140DF5; Tue, 22 Jun 2021 14:39:35 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id E1BD04003C; Tue, 22 Jun 2021 14:39:32 +0200 (CEST) IronPort-SDR: zimeZVhcwmfSNG10mPUGW4Nyhy9m+kSWgXZ57bjITf1v0790njbAGfXsPRqnTEp5uhnBRH33o7 9p/nifO5M6OQ== X-IronPort-AV: E=McAfee;i="6200,9189,10022"; a="292672774" X-IronPort-AV: E=Sophos;i="5.83,291,1616482800"; d="scan'208";a="292672774" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2021 05:39:28 -0700 IronPort-SDR: 3U7EZIupPzLSPQvx+kVSvBogz4vEGVclYV44hHOkZMR/3GBH1IN+eqxk8fY5+Zpj2+fZA8gt89 MV6FAKPsqpeQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,291,1616482800"; d="scan'208";a="556602447" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.27]) by fmsmga001.fm.intel.com with ESMTP; 22 Jun 2021 05:29:58 -0700 From: Ferruh Yigit To: Jerin Jacob , Kiran Kumar K , Vamsi Attunuru Cc: Ferruh Yigit , dev@dpdk.org, stable@dpdk.org Date: Tue, 22 Jun 2021 13:29:56 +0100 Message-Id: <20210622122956.3130231-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH] kni: fix crash on userspace VA for segmented packets X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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" When IOVA=VA, address translation for segmented packets is wrong, it assumes the address in the mbuf->next is physical address, not VA address. Fixing the address translation to work both PA & VA mode. Fixes: e73831dc6c26 ("kni: support userspace VA") Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit --- Cc: vattunuru@marvell.com --- kernel/linux/kni/kni_net.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c index f259327954b2..611719b5ee27 100644 --- a/kernel/linux/kni/kni_net.c +++ b/kernel/linux/kni/kni_net.c @@ -245,7 +245,7 @@ kni_fifo_trans_pa2va(struct kni_dev *kni, break; prev_kva = kva; - kva = pa2kva(kva->next); + kva = get_kva(kni, kva->next); /* Convert physical address to virtual address */ prev_kva->next = pa2va(prev_kva->next, kva); } @@ -422,7 +422,7 @@ kni_net_rx_normal(struct kni_dev *kni) break; prev_kva = kva; - kva = pa2kva(kva->next); + kva = get_kva(kni, kva->next); data_kva = kva2data_kva(kva); /* Convert physical address to virtual address */ prev_kva->next = pa2va(prev_kva->next, kva); @@ -501,7 +501,7 @@ kni_net_rx_lo_fifo(struct kni_dev *kni) kni->va[i] = pa2va(kni->pa[i], kva); while (kva->next) { - next_kva = pa2kva(kva->next); + next_kva = get_kva(kni, kva->next); /* Convert physical address to virtual address */ kva->next = pa2va(kva->next, next_kva); kva = next_kva; -- 2.31.1