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 08341424DA for ; Wed, 12 Jun 2024 08:21:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 925B740B9C; Wed, 12 Jun 2024 08:21:07 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 3099B402AB for ; Wed, 12 Jun 2024 08:21:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718173265; 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=eMOmGARlmPUYk4+depjDfgfpS1bFdf+qIuxReT4h1C4=; b=Vp41zQAlFjEcTh3+mPDutzHSC86iXkiCLWI0g48zaplHloRY9WcZVuCHO50KMo6QxgLWqE 6HUC6vQFTcfMRJOEiDGac2c1xBu8L2SVOFXI8yF2rSiUElWtD04HF/OsbBrfWAXJSro3rC cEZROW84PXblVFrjPUay3nEtxFaXyDU= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-613-5zvfEsIHMfqm99z4jGpOGw-1; Wed, 12 Jun 2024 02:21:04 -0400 X-MC-Unique: 5zvfEsIHMfqm99z4jGpOGw-1 Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-52c978dbd31so791729e87.3 for ; Tue, 11 Jun 2024 23:21:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718173262; x=1718778062; 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=eMOmGARlmPUYk4+depjDfgfpS1bFdf+qIuxReT4h1C4=; b=XdMhFyyTctWbKyvPiPD+Ga3aaCbwywfEORgQerE8x8nmovuWl7TIDqArJN89e+1xZN EDMpBXA6VgfDWD5e7gqeinUGrYthIweJBGVDc5xWFZ0a0oMIh52EcjJfH98mygOYO1lv f8Pj/9um0KVusBsRWqgiXPaUH32qup9dlyce9RXrYTsT8M9QvfojgwG+WJBGiihcf8aE V0hxbMv+xXp67IO3YLje0Sok7W8jMRlXqMOS37lPj7rR661m00w4jCw05miwrJAXFiEU xs9NOQ5NlIS6gCQCo+nFJKKUpGpIPdvfJMwp3i/NiV2wzlvqqetayxB4ud5UlOj39A96 5agg== X-Gm-Message-State: AOJu0YxIKt2nJMZ2NwKNySSF+8+S8kXU8YEw3w5M4jx6R9en/155htGe adluFcOluvU+HPNER8eEwI3/dpJFMCa2+P4tqAz2zXSOxRzmxGFLr21l4+Wfmk3VBKJnE9MsKGa isNBbqyz3hQQyfP+G0U3CDrUxBFSVSx0ToEmAeudEOUWi/QZc20YZrZqsUF6SagOyzdduVWCCI0 KG8xo7rRAXUgxSdtTvaH/T7X1UW6kf X-Received: by 2002:a05:6512:39c4:b0:52c:9db6:b414 with SMTP id 2adb3069b0e04-52c9db6b4aamr239740e87.8.1718173262622; Tue, 11 Jun 2024 23:21:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGZUNeWQnT/3NVfS6eu3PBrFAZsiGp6NTVBApWfg72OVFop9V6CISZKc1TzFYj7o8os8o6r8l6H2qYENcW71u4= X-Received: by 2002:a05:6512:39c4:b0:52c:9db6:b414 with SMTP id 2adb3069b0e04-52c9db6b4aamr239731e87.8.1718173262206; Tue, 11 Jun 2024 23:21:02 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: David Marchand Date: Wed, 12 Jun 2024 08:20:50 +0200 Message-ID: Subject: Re: Compiling testpmd with DPDK netvsc PMD To: Nandini Rangaswamy Cc: users@dpdk.org, Stephen Hemminger X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org On Tue, Jun 11, 2024 at 7:10=E2=80=AFPM Nandini Rangaswamy wrote: > > Hi David, > It was a misunderstanding on my part. I had assumed that since the librar= ies were not dynamically linked and not showing up in ldd output, testpmd w= as probably not using netvsc. > After looking at the comments in config/meson.build " NOTE: DPDK always b= uilds both shared and static libraries. Please set "default_library" to ei= ther "static" or "shared" to select default linkage > for apps and any examples.''')", I inferred that the libraries were bein= g linked statically. > > Following this, i changed the default options in meson.build default_libr= ary=3Dshared from static and added deps in testpmd/meson.build file as belo= w: > > +if dpdk_conf.has('RTE_NET_NETVSC') > + deps +=3D 'net_netvsc' > +endif > Now ldd dpdk-testpmd shows netvsc pmd being linked dynamically and also = functional at run time. This change is unneeded. DPDK installs libraries in RTE_EAL_PMD_PATH, iow ${prefix}/${libdir}/dpdk/pmds-${VERSION} (where prefix and libdir are meson options). All drivers in this directory are then automatically picked by EAL during rte_eal_init. So the next questions are: did you install DPDK? or are you running testpmd from a build directory only? If you installed DPDK system-wide, adding --log-level=3Dlib.eal:debug should display all loaded drivers. But I suspect you are in the "latter" case. If so, you'll need to pass -d /path/to/drivers/dir/ (some tweaking of LD_LIBRARY_PATH may be necessary, depending on drivers). Note that this latter case is for *dev* or quick tests. In general, installing DPDK should be preferred (ninja -C install). A last note, if you don't want to load all drivers, you can pick which driver you are interested in at compilation time with enable/disable_drivers meson options. Or you can prune drivers in the installed drivers directory. Example with net_null: # DPDK compiled in $HOME/builds/main/build-gcc-shared/, no -d option $ $HOME/builds/main/build-gcc-shared/app/dpdk-testpmd -c 3 --no-huge -m 40 --log-level=3Dlib.eal:debug -a 0:0.0 --vdev net_null1 --vdev net_null2 -- --no-mlockall --total-num-mbufs=3D2048 -ia EAL: lib.eal log level changed from info to debug EAL: Detected lcore 0 as core 0 on socket 0 EAL: Detected lcore 1 as core 1 on socket 0 EAL: Detected lcore 2 as core 2 on socket 0 EAL: Detected lcore 3 as core 3 on socket 0 EAL: Detected lcore 4 as core 4 on socket 0 EAL: Detected lcore 5 as core 5 on socket 0 EAL: Detected lcore 6 as core 6 on socket 0 EAL: Detected lcore 7 as core 7 on socket 0 EAL: Detected lcore 8 as core 0 on socket 0 EAL: Detected lcore 9 as core 1 on socket 0 EAL: Detected lcore 10 as core 2 on socket 0 EAL: Detected lcore 11 as core 3 on socket 0 EAL: Detected lcore 12 as core 4 on socket 0 EAL: Detected lcore 13 as core 5 on socket 0 EAL: Detected lcore 14 as core 6 on socket 0 EAL: Detected lcore 15 as core 7 on socket 0 EAL: Maximum logical cores by configuration: 128 EAL: Detected CPU lcores: 16 EAL: Detected NUMA nodes: 1 EAL: Checking presence of .so 'librte_eal.so.24.2' EAL: Detected shared linkage of DPDK EAL: failed to parse device "net_null1" EAL: Unable to parse device 'net_null1' EAL: Error - exiting with code: 1 Cause: Cannot init EAL: No such device # DPDK compiled in $HOME/builds/main/build-gcc-shared/, and setting -d opti= on $ $HOME/builds/main/build-gcc-shared/app/dpdk-testpmd -c 3 --no-huge -m 40 --log-level=3Dlib.eal:debug -d $HOME/builds/main/build-gcc-shared/drivers -a 0:0.0 --vdev net_null1 --vdev net_null2 -- --no-mlockall --total-num-mbufs=3D2048 -ia EAL: lib.eal log level changed from info to debug EAL: Detected lcore 0 as core 0 on socket 0 EAL: Detected lcore 1 as core 1 on socket 0 EAL: Detected lcore 2 as core 2 on socket 0 EAL: Detected lcore 3 as core 3 on socket 0 EAL: Detected lcore 4 as core 4 on socket 0 EAL: Detected lcore 5 as core 5 on socket 0 EAL: Detected lcore 6 as core 6 on socket 0 EAL: Detected lcore 7 as core 7 on socket 0 EAL: Detected lcore 8 as core 0 on socket 0 EAL: Detected lcore 9 as core 1 on socket 0 EAL: Detected lcore 10 as core 2 on socket 0 EAL: Detected lcore 11 as core 3 on socket 0 EAL: Detected lcore 12 as core 4 on socket 0 EAL: Detected lcore 13 as core 5 on socket 0 EAL: Detected lcore 14 as core 6 on socket 0 EAL: Detected lcore 15 as core 7 on socket 0 EAL: Maximum logical cores by configuration: 128 EAL: Detected CPU lcores: 16 EAL: Detected NUMA nodes: 1 EAL: Checking presence of .so 'librte_eal.so.24.2' EAL: Detected shared linkage of DPDK EAL: open shared lib /home/dmarchan/builds/main/build-gcc-shared/drivers/librte_common_dpaax.so.= 24.2 EAL: open shared lib /home/dmarchan/builds/main/build-gcc-shared/drivers/librte_common_iavf.so.2= 4.2 EAL: open shared lib /home/dmarchan/builds/main/build-gcc-shared/drivers/librte_common_ionic.so.= 24.2 EAL: open shared lib /home/dmarchan/builds/main/build-gcc-shared/drivers/librte_common_octeontx.= so.24.2 [ snip ] EAL: open shared lib /home/dmarchan/builds/main/build-gcc-shared/drivers/librte_net_netvsc.so.24= .2 EAL: pmd.net.netvsc.init log level changed from disabled to notice EAL: pmd.net.netvsc.driver log level changed from disabled to notice EAL: open shared lib /home/dmarchan/builds/main/build-gcc-shared/drivers/librte_net_null.so.24.2 EAL: pmd.net.null log level changed from disabled to notice [ snip ] --=20 David Marchand