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 C8A81A0C41; Thu, 24 Jun 2021 03:57:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B6FB441151; Thu, 24 Jun 2021 03:57:34 +0200 (CEST) Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) by mails.dpdk.org (Postfix) with ESMTP id 31F8940141 for ; Thu, 24 Jun 2021 03:57:33 +0200 (CEST) Received: by mail-qk1-f178.google.com with SMTP id x1so6513702qkp.7 for ; Wed, 23 Jun 2021 18:57:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=t+k28cPlV8VygLt/dkv4Lp9MdGyfDbRGs7EyUeDKNfU=; b=Vq6Tjox+lpolbu/+Y1wdQh3FHvyrtL1Me+kapzepyCBGmakhP53cOVxEvLzxCzhi0F UPrF9mdchTu0YzBOmP/u3dktelu77Y+UrUT1vJQ1hEP56dw0gXSYwVd7SlLBZQrvDt+J yxSbxY/TmhPKFvOQMP4dEsGNAArtdUAhnFNIo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=t+k28cPlV8VygLt/dkv4Lp9MdGyfDbRGs7EyUeDKNfU=; b=kVVEQT7ujw+9nG0SSMsXL+BFRewbMKL+dVNai37yYY/FD3UFMzE4m4zqT/+Yu8fX5c zlSDq5aW1jLeOjO0nkHTymfoc1V8QK8IFamkNrvJh+N9/P6GryrdV0hq1mhsBvkfe1Ud v8X1E+RUB7TOau7pZ6Ww/OVSHfsgvgOxh2BUUtaNc999pX0ZUGdkungWdaRGUcePVgoQ DCN+qTM0fy9zfsGXOllbbaSxH4C7bhTD0ai0/MvmvIkbrShuSvwL6m7Y1hkR2Jf1sbjH dhIFTYRslFaVhUes98nTVk4Ozt6mMTPQLUIFIOJpTI1jat1+niRoo98iim1/8+fhiiB0 QDCg== X-Gm-Message-State: AOAM530OJHJzHTAfpZ1aPxhGu0JmF2vpo2g4SupZuP6eGb50k7hPO2Bg 69F77d9MaCyoakygpxZ+aMCQaBxUFqhSHAUZTcT8DQ== X-Google-Smtp-Source: ABdhPJyrRNGX9X6aGve9N6XcIG2Rf3+4v0Y18MaSCaoyeVwQiUA+bqZYRd2m83iluf/xJdVyLP4DhtFBWdJFZraxT4o= X-Received: by 2002:a37:bce:: with SMTP id 197mr3215276qkl.423.1624499852520; Wed, 23 Jun 2021 18:57:32 -0700 (PDT) MIME-Version: 1.0 References: <20210622122956.3130231-1-ferruh.yigit@intel.com> In-Reply-To: <20210622122956.3130231-1-ferruh.yigit@intel.com> From: Ajit Khaparde Date: Wed, 23 Jun 2021 18:57:15 -0700 Message-ID: To: Ferruh Yigit Cc: Jerin Jacob , Kiran Kumar K , Vamsi Attunuru , dpdk-dev , dpdk stable Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="000000000000aaa33d05c57958e8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [dpdk-dev] [PATCH] kni: fix crash on userspace VA for segmented packets X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" --000000000000aaa33d05c57958e8 Content-Type: text/plain; charset="UTF-8" On Tue, Jun 22, 2021 at 5:39 AM Ferruh Yigit wrote: > > 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 Acked-by: Ajit Khaparde > --- > 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 > --000000000000aaa33d05c57958e8--