From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 1C21FA0C41;
	Fri, 16 Apr 2021 19:22:14 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id E3C30161AD4;
	Fri, 16 Apr 2021 19:22:13 +0200 (CEST)
Received: from mga05.intel.com (mga05.intel.com [192.55.52.43])
 by mails.dpdk.org (Postfix) with ESMTP id D11ED161AC6
 for <dev@dpdk.org>; Fri, 16 Apr 2021 19:22:11 +0200 (CEST)
IronPort-SDR: osyTSsE3B3lt4bi1nzApnpLPshj+jlO1z5XjLfDzWmHjmmpcR2619uxZomjAQvHhchipEFemIC
 1kS3C9O67ATg==
X-IronPort-AV: E=McAfee;i="6200,9189,9956"; a="280391332"
X-IronPort-AV: E=Sophos;i="5.82,226,1613462400"; d="scan'208";a="280391332"
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
 by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 16 Apr 2021 10:22:09 -0700
IronPort-SDR: X6H5sdxMHWW40kFzHMNM4FlqfxGht0uWdxDn8v2qTIhw3rYwusyeXi5jHbakLBodrPKv3XDoe8
 +JLemQUDtmZw==
X-IronPort-AV: E=Sophos;i="5.82,226,1613462400"; d="scan'208";a="453412158"
Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.207.150])
 ([10.213.207.150])
 by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 16 Apr 2021 10:22:08 -0700
To: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>, dev@dpdk.org
References: <20210324005008.24705-1-dmitry.kozliuk@gmail.com>
 <20210415221055.1575-1-dmitry.kozliuk@gmail.com>
From: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: Thomas Monjalon <thomas@monjalon.net>,
 David Marchand <david.marchand@redhat.com>
X-User: ferruhy
Message-ID: <b3c127a9-e1c6-3320-5c2f-9cd320f63811@intel.com>
Date: Fri, 16 Apr 2021 18:22:04 +0100
MIME-Version: 1.0
In-Reply-To: <20210415221055.1575-1-dmitry.kozliuk@gmail.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
Subject: Re: [dpdk-dev] [PATCH v4 0/3] net/pcap: build on Windows
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On 4/15/2021 11:10 PM, Dmitry Kozlyuk wrote:
> Most modern and actively maintained distribution of libpcap for Windows
> is Npcap [1]. It currently doesn't provide a pkg-config file [2].
> By default it is installed to C:\Program Files\Npcap and can be located
> using standard environment variables [3]:
> 
>      $env:C_INCLUDE_PATH += ";C:\Program Files\Npcap"
>      $env:LIBRARY_PATH += ";C:\Program Files\Npcap\Lib\x64"     # MinGW
>      $env:LINK += ' /LIBPATH:"C:\Program Files\Npcap\Lib\x64"'  # Clang
> 
> The following libpcap.pc also works if placed in PKG_CONFIG_PATH:
> 
>      prefix="C:/Program Files/Npcap"
>      Name: libpcap
>      Version: 1.10
>      Description: Platform-independent network traffic capture library
>      Cflags: -I${prefix}/Include
>      Libs: -L${prefix}/Lib/x64 -lwpcap
> 
> Example of collecting packets from an interface to a file:
> 
>      .\build\examples\dpdk-skeleton.exe `
>          --vdev "eth_pcap0,iface=\Device\NPF_{DDD48985-A77C-4FC9-AF48-61E547C8797E}" `
>          --vdev "eth_pcap1,tx_pcap=capture.pcap"
> 
> Interface name can be obtained as follows, with Wireshark installed:
> 
>      & "C:\Program Files\Wireshark\tshark.exe" -D
> 
> Implementation in "pcap_osdep_windows.c" does some guesswork to convert
> between variants of an interface name. Microsoft experts and interested
> users, please take a look and/or give it a try in your environment.
> 
> [1]: https://nmap.org/npcap
> [2]: https://github.com/nmap/npcap/issues/299
> [3]: https://mesonbuild.com/Reference-manual.html#compiler-object
> 
> v4:
>      * Change libpcap discovery to work without dependent patch.
>      * Fix memory leak in osdep_iface_mac_get (in v3, actually).
>      * rte_os_internal.h -> rte_os_shim.h in patch 3/3.
> 
> Dmitry Kozlyuk (3):
>    eal/windows: add timespec_get shim for MinGW
>    net/pcap: move OS-dependent code to separate files
>    net/pcap: build on Windows
> 


Hi Dmitry,

Since the dependent patches merged, I checked/tested the set and it looks good 
to me, pcap patch already has my review tag.

But not able to test the pcap on Windows. Because if Windows & eal part of the 
patch, I am delegating it to Thomas in patchwork.

>   config/meson.build                            |   5 +-
>   doc/guides/rel_notes/release_21_05.rst        |   4 +
>   drivers/net/pcap/meson.build                  |  16 +--
>   .../pcap/{rte_eth_pcap.c => pcap_ethdev.c}    | 109 +++-------------
>   drivers/net/pcap/pcap_osdep.h                 |  18 +++
>   drivers/net/pcap/pcap_osdep_freebsd.c         |  59 +++++++++
>   drivers/net/pcap/pcap_osdep_linux.c           |  42 +++++++
>   drivers/net/pcap/pcap_osdep_windows.c         | 118 ++++++++++++++++++
>   lib/librte_eal/windows/include/rte_os_shim.h  |  32 +++++
>   9 files changed, 304 insertions(+), 99 deletions(-)
>   rename drivers/net/pcap/{rte_eth_pcap.c => pcap_ethdev.c} (95%)
>   create mode 100644 drivers/net/pcap/pcap_osdep.h
>   create mode 100644 drivers/net/pcap/pcap_osdep_freebsd.c
>   create mode 100644 drivers/net/pcap/pcap_osdep_linux.c
>   create mode 100644 drivers/net/pcap/pcap_osdep_windows.c
>