From patchwork Sun Feb 14 02:16:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Kozlyuk X-Patchwork-Id: 87901 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F09C7A0546; Sun, 14 Feb 2021 03:16:27 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B0B61406A3; Sun, 14 Feb 2021 03:16:27 +0100 (CET) Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) by mails.dpdk.org (Postfix) with ESMTP id 3196C406A2 for ; Sun, 14 Feb 2021 03:16:27 +0100 (CET) Received: by mail-lf1-f54.google.com with SMTP id u25so5228001lfc.2 for ; Sat, 13 Feb 2021 18:16:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=In0To6+jd0JIb6bio2NXII4kfNPeo5P/xaMZl6ytHJg=; b=X3KtgIQJgKlBJLFxobJVOu6HIJ7JlM6fX/eXUbHUiCa/k4Xou/7j1Oqcritjijobx9 mW5PVZnH3VgR7C2+dH7X8CaqqppYAxmA8FGq1tl+Jcn/eBnfXkJxHfut+XsKC/oH+QTa 9wDcxpHcDwFps9Q9OfyT/DD6nBzEkKKze/Pr3ubm3JEn5xyfPbAnqzyk0F2UAGF3682H Mt6Bok0IN+hsX8DBt6FIIyTiGhxWnbVGko1sq1dxC0UuG+0UsLRdTLQ8JhkA8RXleTM+ 8L+m/qYEpLsPqdbGZqiuIdyTAdwTbqMkjqesb9Oyld7zyxu5lACpY0jaaEN8ELtogYkf oiVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=In0To6+jd0JIb6bio2NXII4kfNPeo5P/xaMZl6ytHJg=; b=sYS4dhD+FAs5UWydTIuMZSppk402UsR2EBj4pXUO3nYp44paLEZP4SIKDW8n9sdheT xEnsMZRUPhghQife0wJQU/WJ9g6TZ9LIDkoRwEGY6vS+FGQNguiAA47UKfSRMTQgJJDl 3Cbk/a3L1jbdjFwhbt44O5Iaovm5wVjFgGpV6ejfD8weipeNU1h19DJXo/Ds2faCtHkR SMjabOsKhMJI2ZZzB8Ts63lVvRAvaPO1pE7kY0TXnGRrYIaPjV5YyIcntsmWZj/vafyG 0WB9QnVA77bYDe5hV4BTE+Ps+JCGbeepf87X9zPTJJ16rW2SArHJf3Ph8HxksIwi3IZf 9LBw== X-Gm-Message-State: AOAM530WVMJ3m+rsK4Lk4jS8zvakPLiK/qQZCyRIyPrsNUiXdccKiy6H rvsys+zxRFCwMgcCxfHmwFXxTi8qp4mZ3Q== X-Google-Smtp-Source: ABdhPJxKUASXn/99UhF5O3YwTFJFgJZte0McyaArdn7RZS7xMjgb4FoWnX6P+ed5T0U23RLNwKexew== X-Received: by 2002:a05:6512:6c6:: with SMTP id u6mr5231533lff.347.1613268986517; Sat, 13 Feb 2021 18:16:26 -0800 (PST) Received: from localhost.localdomain (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id l19sm3017158lji.53.2021.02.13.18.16.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Feb 2021 18:16:25 -0800 (PST) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Tyler Retzlaff , Mike Wells , Dmitry Kozlyuk Date: Sun, 14 Feb 2021 05:16:10 +0300 Message-Id: <20210214021616.26970-1-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210214012013.23165-1-dmitry.kozliuk@gmail.com> References: <20210214012013.23165-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 0/6] net/pcap: build on Windows 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 Sender: "dev" Most modern and actively maintained distribution of libpcap for Windows is Npcap (https://nmap.org/npcap). It is free (as in "free beer") and open-source, but Npcap redistribution with commercial products may be limited by its license. Npcap can be installed anywhere, so a new Meson option is provided to find it: meson -Dpcap_sdk=C:\Npcap -Dexamples=skeleton build 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" 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. There are no release notes for 21.05 yet, will send update after they appear. v2: fix microsecond calculation on Windows in patch 1/6. Dmitry Kozlyuk (6): eal: add internal API for current time net/pcap: fix format string net/pcap: move OS-dependent code to separate files net/pcap: add libpcap wrappers config: discover libpcap on Windows net/pcap: build on Windows config/meson.build | 21 +- drivers/net/pcap/meson.build | 17 +- .../pcap/{rte_eth_pcap.c => pcap_ethdev.c} | 251 ++++++------------ drivers/net/pcap/pcap_osdep.c | 122 +++++++++ drivers/net/pcap/pcap_osdep.h | 72 +++++ 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/include/rte_time.h | 17 ++ lib/librte_eal/rte_eal_exports.def | 1 + lib/librte_eal/unix/eal_unix_timer.c | 13 + lib/librte_eal/version.map | 1 + lib/librte_eal/windows/eal_timer.c | 21 +- meson_options.txt | 6 +- 14 files changed, 585 insertions(+), 176 deletions(-) rename drivers/net/pcap/{rte_eth_pcap.c => pcap_ethdev.c} (88%) create mode 100644 drivers/net/pcap/pcap_osdep.c 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