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 A2E50A0C41 for ; 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 8CAF74003C; Thu, 24 Jun 2021 03:57:34 +0200 (CEST) Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) by mails.dpdk.org (Postfix) with ESMTP id 30F3B4003C for ; Thu, 24 Jun 2021 03:57:33 +0200 (CEST) Received: by mail-qk1-f176.google.com with SMTP id g4so10498092qkl.1 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=SniMdUgVJrzZbSudfHUIAEJnRkN3u3k4bnLAN0ON80c=; b=YTGaSUzibAJRwmmyQGWJXi42nDd39CayWJRAILEhrXQPULfsCi+FXp2+M3OPvY1Atj PvgDwkLHbznduhgKWgYthSQipXMY7dla+/ahdnwU67E+lQDV4ls0aMrfK3p+hyz5ECJL PYK+2ct85Q3tR8yIAwEQV7DRKUF6By45NNgfE= 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=SniMdUgVJrzZbSudfHUIAEJnRkN3u3k4bnLAN0ON80c=; b=H+VGUhaZeSru+it1WDrlbCFBq9QnfxBGOYsgZ0yGwBV9cglxz5BWFhLx1Bl+DC//b1 RDS140xfqVymfCa10c8E0DM+TVMRICIFAO2JbCrlHXIhb2+JkQcAbRDmZcIyDmCHAel0 GQOFwqBiO9ivlqJhCijBUqv1WfhbJUeL0aZ6RxkDkxJ/E/UNF43eSZkNcaYcyN33IGC2 rSECMmew2bTYIiS8/ZGyk1WQBTR72EMnr23W8TPBvn6AE6ObOJpGpXM7PtAGit9dbZbc kKmMBYEqEjfUzEunKh2u5to5HSgX6STG+ylz9taTlFzpw3Po5c8PTXA/ykN4oRAO+ksj gFPA== X-Gm-Message-State: AOAM533Y/R6KeK19fspIpRF6TEPCF20pohqhGtEHoDy3LojhfplKbrzu Pp/CvI57pvPFJ4Opo5Q+aK4JN5zpS6bhMKPbgIubQg== 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="000000000000aaa1e905c57958df" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [dpdk-stable] [dpdk-dev] [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" --000000000000aaa1e905c57958df 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 > --000000000000aaa1e905c57958df--