From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B256C4360C for ; Thu, 26 Sep 2019 13:55:38 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 1D3BB207FF for ; Thu, 26 Sep 2019 13:55:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="TX4/q176" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D3BB207FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 36B881BDFD; Thu, 26 Sep 2019 15:55:37 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id 94AB9E07 for ; Thu, 26 Sep 2019 15:55:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1569506135; 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=sb2Yja/ObbqNi5fsGZWAzvCEF3D9nmMOHAG58+ytzII=; b=TX4/q176lI7T4fSYjbpf04s4yD8eZCECbSWJ4F+N9nDFh40nVHQ0ic+yC+bzpqz0HwL6wx 9rW1eYQDuiqUx1CjjzHnBtTeAwaTI/IcYm0Njn60UylxaapETXhJQI+EGJdQhSjDPL63F9 TKfPA2M7+idMbzdrippH5SxU9OtKuzQ= Received: from mail-vk1-f197.google.com (mail-vk1-f197.google.com [209.85.221.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-87-bjJHXuHBMOiFd9A0z99nhg-1; Thu, 26 Sep 2019 09:55:29 -0400 Received: by mail-vk1-f197.google.com with SMTP id f199so1053904vka.17 for ; Thu, 26 Sep 2019 06:55:25 -0700 (PDT) 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=yT/wN1W0RgnqkL03bB61aKBs4l/Cyph9K3zeJLwH98I=; b=YHPpCVrhf5qd6QFuQFUIutMfkqmYeE+Q8cdsIBK6GOequcqlju3DQD9JmWl47Lp7hC gALnbLguih9tzwH1OjkRr2tGeJ2uuIQRaCBXYaEw+CvQEFnE3X/EDHF/OwbEmOQ9vf8t mmM3Wpq51tSksFiCAZH/Kl5dD9ZKJltDbNNWs8N8Sde13eSKCSoxW+UmeFGQJJPa7jra A1gj85b+ZFtw5Y9sCQDwjKLf0pzfxkA8vLqWuLF69T9KizwOWr5U756r01YvZqyD7RwY 49XnkbSwS/cUhTVzPQoVS1A6bV1o93nnphL/ASObim35PSVwzbEehSOpUgKTyJfgo4LU XUSA== X-Gm-Message-State: APjAAAXrfPKIEcErGnq08jStsElOv8kNwkO0oa3Ao6eBpR+I/ccvlv1l 9chCZVs9/SDCRTdmpHb2bJScbSt/6ck4YK1py9Pb63qtjuMX0SJsFvga+37JenxAqU/cAKdKBST P35Mpoj40vdO2pzzlJF0= X-Received: by 2002:a67:be15:: with SMTP id x21mr1759092vsq.141.1569506122822; Thu, 26 Sep 2019 06:55:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxxUyvQtlXn14ov+RDuKpxI/kX4rrcdguvpBrxrMreu2TWpzYUhHC2iMVLijZa5RukjIwGR1WzJoSFU7cdCsmg= X-Received: by 2002:a67:be15:: with SMTP id x21mr1759071vsq.141.1569506122380; Thu, 26 Sep 2019 06:55:22 -0700 (PDT) MIME-Version: 1.0 References: <26384fad6f9afcba9d3311d1bf73e76f4577225d.1563276298.git.anatoly.burakov@intel.com> <9e3271a8-8f86-a2ea-35ee-2ed3d98c5f0f@intel.com> In-Reply-To: <9e3271a8-8f86-a2ea-35ee-2ed3d98c5f0f@intel.com> From: David Marchand Date: Thu, 26 Sep 2019 15:55:10 +0200 Message-ID: To: "Burakov, Anatoly" Cc: dev , John McNamara , Marko Kovacevic , Bruce Richardson X-MC-Unique: bjJHXuHBMOiFd9A0z99nhg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH] eal/freebsd: add support for base virtaddr option 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" Hello Anatoly, On Mon, Aug 12, 2019 at 3:38 PM Burakov, Anatoly wrote: > > On 12-Aug-19 11:19 AM, David Marchand wrote: > > On Tue, Jul 16, 2019 at 1:25 PM Anatoly Burakov > > wrote: > >> > >> According to our docs, only Linuxapp supports base-virtaddr option. > >> That is, strictly speaking, not true because most of the things > >> that are attempting to respect base-virtaddr are in common files, > >> so FreeBSD already *mostly* supports this option in practice. > >> > >> This commit fixes the remaining bits to explicitly support > >> base-virtaddr option, and moves the arg parsing from EAL to common > >> options parsing code. Documentation is also updated to reflect > >> that all platforms now support base-virtaddr. > >> > >> Signed-off-by: Anatoly Burakov > >> --- > >> doc/guides/linux_gsg/eal_args.include.rst | 6 +++ > >> doc/guides/linux_gsg/linux_eal_parameters.rst | 6 --- > >> doc/guides/rel_notes/release_19_08.rst | 5 +++ > >> lib/librte_eal/common/eal_common_options.c | 38 +++++++++++++++++= + > >> lib/librte_eal/freebsd/eal/eal.c | 13 ++++++- > >> lib/librte_eal/linux/eal/eal.c | 39 -----------------= -- > >> 6 files changed, 60 insertions(+), 47 deletions(-) > >> > >> diff --git a/doc/guides/linux_gsg/eal_args.include.rst b/doc/guides/li= nux_gsg/eal_args.include.rst > >> index cf421a56e..ed8b0e35b 100644 > >> --- a/doc/guides/linux_gsg/eal_args.include.rst > >> +++ b/doc/guides/linux_gsg/eal_args.include.rst > >> @@ -86,6 +86,12 @@ Multiprocessing-related options > >> > >> Set the type of the current process. > >> > >> +* ``--base-virtaddr
`` > >> + > >> + Attempt to use a different starting address for all memory maps o= f the > >> + primary DPDK process. This can be helpful if secondary processes = cannot > >> + start due to conflicts in address map. > >> + > > > > doc/guides/freebsd_gsg/freebsd_eal_parameters.rst:.. include:: > > ../linux_gsg/eal_args.include.rst > > > > Ok, a bit misleading to put in linux_gsg/, so writing this here if > > someone else looks at this :-) > > This was agreed upon when this file was first introduced. We don't have > a "common" section and there's no real way to create it without > triggering a bunch of errors in doxygen, so it was decided that putting > this in a Linux GSG is the best way to do this. > > > > > > >> Memory-related options > >> ~~~~~~~~~~~~~~~~~~~~~~ > >> > >> diff --git a/doc/guides/linux_gsg/linux_eal_parameters.rst b/doc/guide= s/linux_gsg/linux_eal_parameters.rst > >> index c63f0f49a..b2cc60e44 100644 > >> --- a/doc/guides/linux_gsg/linux_eal_parameters.rst > >> +++ b/doc/guides/linux_gsg/linux_eal_parameters.rst > >> @@ -49,12 +49,6 @@ Multiprocessing-related options > >> allows running multiple independent DPDK primary/secondary proce= sses under > >> different prefixes. > >> > >> -* ``--base-virtaddr
`` > >> - > >> - Attempt to use a different starting address for all memory maps o= f the > >> - primary DPDK process. This can be helpful if secondary processes = cannot > >> - start due to conflicts in address map. > >> - > >> Memory-related options > >> ~~~~~~~~~~~~~~~~~~~~~~ > >> > >> diff --git a/doc/guides/rel_notes/release_19_08.rst b/doc/guides/rel_n= otes/release_19_08.rst > >> index 4a1fd8dd8..1b58d9282 100644 > >> --- a/doc/guides/rel_notes/release_19_08.rst > >> +++ b/doc/guides/rel_notes/release_19_08.rst > >> @@ -56,6 +56,11 @@ New Features > >> Also, make sure to start the actual text at the margin. > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > >> > >> +* **FreeBSD now supports `--base-virtaddr` EAL option.** > >> + > >> + FreeBSD version now also supports setting base virtual address for = mapping > >> + pages and resources into its address space. > >> + > >> * **Added MCS lock.** > >> > >> MCS lock provides scalability by spinning on a CPU/thread local va= riable > > > > Well, obviously, this needs some rebase on 19.11-rc0 :-) > > Yes, will do. > > > > >> diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_e= al/common/eal_common_options.c > >> index 512d5088e..156e48e19 100644 > >> --- a/lib/librte_eal/common/eal_common_options.c > >> +++ b/lib/librte_eal/common/eal_common_options.c > >> @@ -20,6 +20,7 @@ > >> #include > >> #include > > > > >> - rte_mem_cfg_addr =3D mmap(NULL, sizeof(*rte_config.mem_config)= , > >> - PROT_READ | PROT_WRITE, MAP_SHARED, me= m_cfg_fd, 0); > >> + rte_mem_cfg_addr =3D mmap(rte_mem_cfg_addr, > >> + sizeof(*rte_config.mem_config), PROT_READ | PR= OT_WRITE, > >> + MAP_SHARED, mem_cfg_fd, 0); > >> > >> if (rte_mem_cfg_addr =3D=3D MAP_FAILED){ > >> RTE_LOG(ERR, EAL, "Cannot mmap memory for rte_config\= n"); > > > > Nit: when compared to Linux implementation, the reattach step does not > > recommend using the --base-virtaddr in case the remmapping failed. > > > > Good catch, will fix. Can you prepare a v2? Thanks. --=20 David Marchand