[dpdk-dev] [PATCH 0/6] net/pcap: build on Windows

2021-02-13 Thread Dmitry Kozlyuk
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 prov

[dpdk-dev] [PATCH 1/6] eal: add internal API for current time

2021-02-13 Thread Dmitry Kozlyuk
Many PMDs use POSIX gettimeofday(). Add rte_time_get_us() function to obtain current time with microsecond precision on all platforms. Signed-off-by: Dmitry Kozlyuk --- lib/librte_eal/include/rte_time.h| 17 + lib/librte_eal/rte_eal_exports.def | 1 + lib/librte_eal/unix/e

[dpdk-dev] [PATCH 2/6] net/pcap: fix format string

2021-02-13 Thread Dmitry Kozlyuk
Use PRIu32 for uint32_t (found by -Wformat with Clang on Windows). Fixes: a3f5252e5cbd ("net/pcap: enable infinitely Rx a pcap file") Cc: sta...@dpdk.org Signed-off-by: Dmitry Kozlyuk --- drivers/net/pcap/rte_eth_pcap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[dpdk-dev] [PATCH 3/6] net/pcap: move OS-dependent code to separate files

2021-02-13 Thread Dmitry Kozlyuk
PCAP PMD queries interface information differently for Linux and FreeBSD, OS-specific code is guarded by #ifdef. In preparation to add Windows-specific part and libpcap wrapper, extract OS-independent interface and move implementations to separate files. Rename rte_eth_pcap.c to pcap_ethdev.c for c

[dpdk-dev] [PATCH 4/6] net/pcap: add libpcap wrappers

2021-02-13 Thread Dmitry Kozlyuk
libpcap headers can expose OS headers. On Windows, system networking headers are incompatible with DPDK ones, causing multiple name clashes. API of libpcap itself involves a non-standard u_char type. Add a limited set of trivial libpcap wrappers, so that libpcap headers are not included directly b

[dpdk-dev] [PATCH 5/6] config: discover libpcap on Windows

2021-02-13 Thread Dmitry Kozlyuk
WinPcap or Npcap, can be installed anywhere. Add a Meson option to specify SDK path. Signed-off-by: Dmitry Kozlyuk --- config/meson.build | 21 ++--- meson_options.txt | 6 -- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/config/meson.build b/config/meson.

[dpdk-dev] [PATCH 6/6] net/pcap: build on Windows

2021-02-13 Thread Dmitry Kozlyuk
Implement OS-dependent functions and enable PMD build on Windows. Signed-off-by: Dmitry Kozlyuk --- drivers/net/pcap/meson.build | 11 ++- drivers/net/pcap/pcap_ethdev.c| 4 - drivers/net/pcap/pcap_osdep.h | 5 ++ drivers/net/pcap/pcap_osdep_windows.c | 118

[dpdk-dev] [PATCH v2 0/6] net/pcap: build on Windows

2021-02-13 Thread Dmitry Kozlyuk
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 prov

[dpdk-dev] [PATCH v2 1/6] eal: add internal API for current time

2021-02-13 Thread Dmitry Kozlyuk
Many PMDs use POSIX gettimeofday(). Add rte_time_get_us() function to obtain current time with microsecond precision on all platforms. Signed-off-by: Dmitry Kozlyuk --- lib/librte_eal/include/rte_time.h| 17 + lib/librte_eal/rte_eal_exports.def | 1 + lib/librte_eal/unix/e

[dpdk-dev] [PATCH v2 2/6] net/pcap: fix format string

2021-02-13 Thread Dmitry Kozlyuk
Use PRIu32 for uint32_t (found by -Wformat with Clang on Windows). Fixes: a3f5252e5cbd ("net/pcap: enable infinitely Rx a pcap file") Cc: sta...@dpdk.org Signed-off-by: Dmitry Kozlyuk --- drivers/net/pcap/rte_eth_pcap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[dpdk-dev] [PATCH v2 3/6] net/pcap: move OS-dependent code to separate files

2021-02-13 Thread Dmitry Kozlyuk
PCAP PMD queries interface information differently for Linux and FreeBSD, OS-specific code is guarded by #ifdef. In preparation to add Windows-specific part and libpcap wrapper, extract OS-independent interface and move implementations to separate files. Rename rte_eth_pcap.c to pcap_ethdev.c for c

[dpdk-dev] [PATCH v2 4/6] net/pcap: add libpcap wrappers

2021-02-13 Thread Dmitry Kozlyuk
libpcap headers can expose OS headers. On Windows, system networking headers are incompatible with DPDK ones, causing multiple name clashes. API of libpcap itself involves a non-standard u_char type. Add a limited set of trivial libpcap wrappers, so that libpcap headers are not included directly b

[dpdk-dev] [PATCH v2 5/6] config: discover libpcap on Windows

2021-02-13 Thread Dmitry Kozlyuk
WinPcap or Npcap, can be installed anywhere. Add a Meson option to specify SDK path. Signed-off-by: Dmitry Kozlyuk --- config/meson.build | 21 ++--- meson_options.txt | 6 -- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/config/meson.build b/config/meson.

[dpdk-dev] [PATCH v2 6/6] net/pcap: build on Windows

2021-02-13 Thread Dmitry Kozlyuk
Implement OS-dependent functions and enable PMD build on Windows. Signed-off-by: Dmitry Kozlyuk --- drivers/net/pcap/meson.build | 11 ++- drivers/net/pcap/pcap_ethdev.c| 4 - drivers/net/pcap/pcap_osdep.h | 5 ++ drivers/net/pcap/pcap_osdep_windows.c | 118

[dpdk-dev] [PATCH v6 0/9] ethdev: support SubFunction representor

2021-02-13 Thread Xueming Li
SubFunction [1] is a portion of the PCI device, a SF netdev has its own dedicated queues(txq, rxq). A SF netdev supports E-Switch representation offload similar to existing PF and VF representors. A SF shares PCI level resources with other SFs and/or with its parent PCI function. >From SmartNIC pe

[dpdk-dev] [PATCH v6 1/9] ethdev: introduce representor type

2021-02-13 Thread Xueming Li
To support more representor type, this patch introduces representor type enum. The enum is subject to be extended to support new representor in patches upcoming. For each devarg structure, only one type supported. Signed-off-by: Xueming Li Acked-by: Viacheslav Ovsiienko Acked-by: Thomas Monjalo

[dpdk-dev] [PATCH v6 2/9] ethdev: support representor port list

2021-02-13 Thread Xueming Li
To support extended representor syntax, this patch extends the representor list parsing to support for representor port range in devargs, examples: representor=[1,2,3] - single list representor=[1,3-5,7,9-11] - list with singles and ranges Signed-off-by: Xueming Li Acked-by: Viache

[dpdk-dev] [PATCH v6 3/9] ethdev: support new VF representor syntax

2021-02-13 Thread Xueming Li
Current VF representor syntax: representor=2 - single representor representor=[0-3] - single range To prepare for more representor types, this patch adds compatible VF representor devargs syntax: vf#: representor=vf2 - single representor representor=vf[1,3,5]- singl

[dpdk-dev] [PATCH v6 4/9] ethdev: support sub function representor

2021-02-13 Thread Xueming Li
SubFunction is a portion of the PCI device, created on demand, a SF netdev has its own dedicated queues(txq, rxq). A SF netdev supports eswitch representation offload similar to existing PF and VF representors. To support SF representor, this patch introduces new devargs syntax, examples: represe

[dpdk-dev] [PATCH v6 5/9] ethdev: support PF index in representor

2021-02-13 Thread Xueming Li
With Kernel bonding, multiple underlying PFs are bonded, VFs come from different PF, need to identify representor of VFs unambiguously by adding PF index. This patch introduces optional 'pf' section to representor devargs syntax, examples: representor=pf0vf0 - single VF representor r

[dpdk-dev] [PATCH v6 6/9] ethdev: support multi-host in representor

2021-02-13 Thread Xueming Li
The NIC can have multiple PCIe links and can be attached to the multiple hosts, for example the same single NIC can be shared for multiple server units in the rack. On each PCIe link NIC can provide multiple PFs and VFs/SFs based on these ones. To provide the unambiguous identification of the PCIe

[dpdk-dev] [PATCH v6 7/9] ethdev: new API to get representor info

2021-02-13 Thread Xueming Li
The NIC can have multiple PCIe links and can be attached to multiple hosts, for example the same single NIC can be shared for multiple server units in the rack. On each PCIe link NIC can provide multiple PFs and VFs/SFs based on these ones. The full representor identifier consists of three indices

[dpdk-dev] [PATCH v6 8/9] ethdev: representor iterator compare complete info

2021-02-13 Thread Xueming Li
The NIC can have multiple PCIe links and can be attached to multiple hosts, for example the same single NIC can be shared for multiple server units in the rack. On each PCIe link NIC can provide multiple PFs and VFs/SFs based on these ones. The full representor identifier consists of three indices

[dpdk-dev] [PATCH v6 9/9] kvargs: update parser to support lists

2021-02-13 Thread Xueming Li
This patch updates kvargs parser to support lists on top of range, allow multiple lists or range: k1=a[1,2]b[3-5] Signed-off-by: Xueming Li Acked-by: Viacheslav Ovsiienko Acked-by: Thomas Monjalon --- app/test/test_kvargs.c | 46 +-- lib/librte_kvargs/rte_kvargs.c | 101