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 B6CE0427E1; Mon, 20 Mar 2023 13:10:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9251640A7F; Mon, 20 Mar 2023 13:10:21 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 4FF70406BC for ; Mon, 20 Mar 2023 13:10:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679314219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=50OR2eZ145Mlpbzvu6jcX8JD6n3CveUoK4bzvMoI+KA=; b=W2/2C7lbpQSykNx7/UyXb2hEAL/YtYbaPhJjEAfwZExt9cG8od/+NyHLnDH2nk7D58f45K g0hBBy/Y4pbJSef4x+zPin72NLQdn8O9CCuGTM706h1RGI83mcZCVmwV+2mGLXX9iioCKP /mR4zUuRwqTCSUdyaTx7SXPxpGTuGvo= Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-318-3vdEXbDrPwuhIyywz5xJxQ-1; Mon, 20 Mar 2023 08:10:18 -0400 X-MC-Unique: 3vdEXbDrPwuhIyywz5xJxQ-1 Received: by mail-pl1-f200.google.com with SMTP id i6-20020a170902c94600b0019d16e4ac0bso7023213pla.5 for ; Mon, 20 Mar 2023 05:10:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679314217; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=50OR2eZ145Mlpbzvu6jcX8JD6n3CveUoK4bzvMoI+KA=; b=sBw2d7vUQUHUtvWX0JPRozDlaldNDJIYNf/NEyYvsheCXwmNtEgg3z4tcPD+/1jDkc fjiUAPopM9pp6NTfvi7hy7DqY5qpqURgnDkWO18Sohong966MWayEs5dh/YhyFxATU2E jSFCjrF9I1TYwoV+BybsrYaFpleeUE++GBMA0LmcoT9M9pZGnbpk7vuh0mJrt1Wa/OsF KZISTIKQN+OJxnBLW8TU9h+RlfyyOUPuyngyC2AP7ukkJi6RAhPepeJWObPkqQK8TU+y iNUqR88dwARAdqLUh+WaSsxmeBCNwsUbBaCTNPxSTo9/U+2D0jGjAlYBLcj6Nal8HDBu 8TPw== X-Gm-Message-State: AO0yUKV4xSdYESCVQODQKho+xBOs1+3lC73RX9jnX7bRwYIA+4TdGVnj Gp3klYcbYJBvO6GSt0blwjsqIV8EwAyS4e1NW+bfmBLVy4PCyAnOSWfuoxSRMYbGgMTaweHCM1B 4R6TtE41gTZ23X0ZPZtI= X-Received: by 2002:a17:902:db09:b0:1a0:4be5:ccea with SMTP id m9-20020a170902db0900b001a04be5cceamr6359906plx.9.1679314217607; Mon, 20 Mar 2023 05:10:17 -0700 (PDT) X-Google-Smtp-Source: AK7set8EN4HAPNsBo3lbboRMzXuJtIi8J6NV1Q6X1R9AxGOqEVvV3Oz9o+uf3hqL76+Wb5ru7WrvNnK7PMAjTxelSvI= X-Received: by 2002:a17:902:db09:b0:1a0:4be5:ccea with SMTP id m9-20020a170902db0900b001a04be5cceamr6359894plx.9.1679314217329; Mon, 20 Mar 2023 05:10:17 -0700 (PDT) MIME-Version: 1.0 References: <20230228172909.2054386-1-ferruh.yigit@amd.com> In-Reply-To: From: David Marchand Date: Mon, 20 Mar 2023 13:10:06 +0100 Message-ID: Subject: Re: [PATCH] kni: fix build with Linux 6.3 To: Ferruh Yigit , Vamsi Attunuru , Kiran Kumar Kokkilagadda , Jerin Jacob Kollanukkaran Cc: dev@dpdk.org, Thomas Monjalon X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Tue, Feb 28, 2023 at 9:45=E2=80=AFPM David Marchand wrote: > > On Tue, Feb 28, 2023 at 6:29 PM Ferruh Yigit wrote= : > > > > KNI calls `get_user_pages_remote()` API which is using `FOLL_TOUCH` > > flag, but `FOLL_TOUCH` is no more in public headers since v6.3, > > causing a build error. > > Something looks strange with what kni was doing. > > Looking at get_user_pages_remote implementation, I see it internally > passes FOLL_TOUCH in addition to passed gup_flags. > And looking at FOLL_TOUCH definition, it seems natural (to me) that > this flag would be handled internally. > > Maybe it changed over time... but then the question is when did > passing FOLL_TOUCH become unneeded? Here is some more info. get_user_pages_remote() was added in kernel commit 1e9877902dc7 ("mm/gup: Introduce get_user_pages_remote()"). At this time, it was passing the FOLL_TOUCH flag internally. +long get_user_pages_remote(struct task_struct *tsk, struct mm_struct *mm, + unsigned long start, unsigned long nr_pages, + int write, int force, struct page **pages, + struct vm_area_struct **vmas) { return __get_user_pages_locked(tsk, mm, start, nr_pages, write, for= ce, - pages, vmas, NULL, false, FOLL_TOUCH= ); + pages, vmas, NULL, false, + FOLL_TOUCH | FOLL_REMOTE); +} +EXPORT_SYMBOL(get_user_pages_remote); get_user_pages_remote() later gained the ability to pass gup flags in kernel commit 9beae1ea8930 ("mm: replace get_user_pages_remote() write/force parameters with gup_flags"). But FOLL_TOUCH was still added internally. long get_user_pages_remote(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, unsigned long nr_pages, - int write, int force, struct page **pages, + unsigned int gup_flags, struct page **pages, struct vm_area_struct **vmas) { - unsigned int flags =3D FOLL_TOUCH | FOLL_REMOTE; - - if (write) - flags |=3D FOLL_WRITE; - if (force) - flags |=3D FOLL_FORCE; - return __get_user_pages_locked(tsk, mm, start, nr_pages, pages, vma= s, - NULL, false, flags); + NULL, false, + gup_flags | FOLL_TOUCH | FOLL_REMOTE= ); } There were other changes in this area of the kernel code, but I did not notice a change in relation with FOLL_TOUCH. So I think the dpdk commit e73831dc6c26 ("kni: support userspace VA") uselessly introduced call to this flag and we can remove it. Adding author and reviewers of this change. --=20 David Marchand