-
Notifications
You must be signed in to change notification settings - Fork 218
[dpdk] add symmetric_mp test #3629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
93277e7
DPDK: symmetric_mp test
mcgov a5aeb0e
DPDK: allow arbitrary nics passed to init
mcgov c17d400
DPDK: allow rescind in symmetric_mp test
mcgov c3b5bb7
DPDK: add devname helper
mcgov 334097c
more symmetric_mp work
mcgov fbf2ede
dpdk/symmetric_mp: use installation path for examples
mcgov 52202fb
dpdk/symmetric_mp: undo replacement example app change
mcgov 099c9c2
dpdk/symmetric_mp: add assert at the end
mcgov 79468f4
symmetric_mp: rebase fix, remove nic index
mcgov f33cd44
dpdk/symmetric_mp: comments for run function
mcgov 308b48c
dpdk: fix isort ordering in dpdktestpmd.py
mcgov 5fa9a96
Update microsoft/testsuites/dpdk/dpdktestpmd.py
mcgov 32a7d60
Update microsoft/testsuites/dpdk/dpdkutil.py
mcgov 0f8d7e4
fix copilot commit line length
mcgov 03a1200
dpdk symmetric_mp: add patched version of main.c for old versions of …
mcgov 776a40c
fix symmetric_mp path
mcgov 1b7e71a
save patched main file for symmetric_mp
mcgov cd6dfd2
dpdk: remove commented line copilot missed
mcgov 7f51e42
dpdk: remove commented line that copilot didn't miss
mcgov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# Copyright(c) 2010-2014 Intel Corporation | ||
|
||
# binary name | ||
APP = devname | ||
|
||
# all source are stored in SRCS-y | ||
SRCS-y := main.c | ||
|
||
PKGCONF ?= pkg-config | ||
|
||
# Build using pkg-config variables if possible | ||
ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0) | ||
$(error "no installation of DPDK found") | ||
endif | ||
|
||
all: shared | ||
.PHONY: shared static | ||
shared: build/$(APP)-shared | ||
ln -sf $(APP)-shared build/$(APP) | ||
static: build/$(APP)-static | ||
ln -sf $(APP)-static build/$(APP) | ||
|
||
PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) | ||
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) | ||
LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) | ||
LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk) | ||
|
||
ifeq ($(MAKECMDGOALS),static) | ||
# check for broken pkg-config | ||
ifeq ($(shell echo $(LDFLAGS_STATIC) | grep 'whole-archive.*l:lib.*no-whole-archive'),) | ||
$(warning "pkg-config output list does not contain drivers between 'whole-archive'/'no-whole-archive' flags.") | ||
$(error "Cannot generate statically-linked binaries with this version of pkg-config") | ||
endif | ||
endif | ||
|
||
CFLAGS += -DALLOW_EXPERIMENTAL_API | ||
|
||
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build | ||
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) | ||
|
||
build/$(APP)-static: $(SRCS-y) Makefile $(PC_FILE) | build | ||
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_STATIC) | ||
|
||
build: | ||
@mkdir -p $@ | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared | ||
test -d build && rmdir -p build || true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# dpdk-devname | ||
|
||
Print info about DPDK ports on a system. | ||
|
||
## NOTE: This is a frozen copy from https://www.github.com/mcgov/devname | ||
|
||
## build | ||
clone into dpdk/examples | ||
``` bash | ||
git clone https://www.github.com/DPDK/dpdk.git | ||
cd ./dpdk/examples | ||
git clone https://github.com/mcgov/devname.git | ||
cd .. | ||
meson setup -Dexamples=devname [other options] build | ||
cd build && ninja && ninja install | ||
``` | ||
|
||
## usage: | ||
``` | ||
$ ./build/examples/dpdk-devname | ||
EAL: Detected CPU lcores: 32 | ||
EAL: Detected NUMA nodes: 1 | ||
EAL: Detected static linkage of DPDK | ||
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket | ||
EAL: Selected IOVA mode 'PA' | ||
EAL: Probe PCI driver: net_mana (1414:ba) device: 7870:00:00.0 (socket 0) | ||
mana_init_once(): MP INIT PRIMARY | ||
TELEMETRY: No legacy callbacks, legacy socket not created | ||
dpdk-devname found port=0 driver=net_mana eth_dev_info_name=7870:00:00.0 get_name_by_port_name=7870:00:00.0_port3 owner_id=0x0000000000000002 owner_name=f8615163-0002-1000-2000-6045bda6bbc0 macaddr=60:45:bd:a6:bb:c0 | ||
dpdk-devname found port=1 driver=net_mana eth_dev_info_name=7870:00:00.0 get_name_by_port_name=7870:00:00.0_port2 owner_id=0x0000000000000001 owner_name=f8615163-0001-1000-2000-6045bda6bd76 macaddr=60:45:bd:a6:bd:76 | ||
dpdk-devname found port=2 driver=net_netvsc eth_dev_info_name=f8615163-0001-1000-2000-6045bda6bd76 get_name_by_port_name=f8615163-0001-1000-2000-6045bda6bd76 owner_id=0x0000000000000000 owner_name=null macaddr=60:45:bd:a6:bd:76 | ||
dpdk-devname found port=3 driver=net_netvsc eth_dev_info_name=f8615163-0002-1000-2000-6045bda6bbc0 get_name_by_port_name=f8615163-0002-1000-2000-6045bda6bbc0 owner_id=0x0000000000000000 owner_name=null macaddr=60:45:bd:a6:bb:c0 | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
/* SPDX-License-Identifier: BSD-3-Clause | ||
* Copyright(c) 2010-2014 Intel Corporation | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <string.h> | ||
#include <stdint.h> | ||
#include <errno.h> | ||
#include <sys/queue.h> | ||
#include <rte_memory.h> | ||
#include <rte_launch.h> | ||
#include <rte_eal.h> | ||
#include <rte_per_lcore.h> | ||
#include <rte_lcore.h> | ||
#include <rte_debug.h> | ||
#include <rte_ethdev.h> | ||
#include <rte_dev.h> | ||
|
||
const char usage_info[] = "usage: dpdk-devname\n"; | ||
|
||
/*a tiny application to print dpdk device and port id info */ | ||
int main(int argc, char **argv) | ||
{ | ||
int ret; | ||
/* Initialization of Environment Abstraction Layer (EAL). */ | ||
ret = rte_eal_init(argc, argv); | ||
if (ret < 0) | ||
rte_panic("Cannot init EAL\n"); | ||
/* >8 End of initialization of Environment Abstraction Layer */ | ||
|
||
struct rte_eth_dev_info device_info; | ||
char device_name_by_port[RTE_ETH_NAME_MAX_LEN] = {0}; | ||
for (uint16_t portid = 0; portid < RTE_MAX_ETHPORTS; portid++) | ||
{ | ||
if (!rte_eth_dev_is_valid_port(portid)) | ||
continue; | ||
|
||
ret = rte_eth_dev_info_get(portid, &device_info); | ||
if (ret < 0) | ||
{ | ||
fprintf(stderr, | ||
"Invalid or no info for port %i, err: %s\n", | ||
portid, rte_strerror(ret)); | ||
continue; | ||
} | ||
ret = rte_eth_dev_get_name_by_port(portid, device_name_by_port); | ||
if (ret < 0) | ||
{ | ||
fprintf(stderr, | ||
"No name info returned for port %i, err: %s\n", | ||
portid, rte_strerror(ret)); | ||
continue; | ||
} | ||
struct rte_eth_dev_owner device_owner; | ||
ret = rte_eth_dev_owner_get(portid, &device_owner); | ||
if (ret < 0) | ||
{ | ||
fprintf(stderr, "Could not get ownership for port %i (%s)\n", | ||
portid, device_name_by_port); | ||
memset(&device_owner, 0, sizeof(struct rte_eth_dev_owner)); | ||
} | ||
|
||
if (!device_owner.name[0]) | ||
strcpy(device_owner.name, "null"); | ||
|
||
struct rte_ether_addr macaddr; | ||
ret = rte_eth_macaddr_get(portid, &macaddr); | ||
if (ret < 0) | ||
{ | ||
fprintf(stderr, "Could not get macaddr info for port %i (%s)\n", | ||
portid, device_name_by_port); | ||
memset(&macaddr, 0, sizeof(struct rte_ether_addr)); | ||
} | ||
printf("dpdk-devname found port=%i " | ||
"driver=%s " | ||
"get_name_by_port_name=%s " | ||
"owner_id=0x%016lx " | ||
"owner_name=%s " | ||
"macaddr=%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx\n", | ||
portid, | ||
device_info.driver_name, | ||
device_name_by_port, | ||
device_owner.id, | ||
device_owner.name, | ||
macaddr.addr_bytes[0], | ||
macaddr.addr_bytes[1], | ||
macaddr.addr_bytes[2], | ||
macaddr.addr_bytes[3], | ||
macaddr.addr_bytes[4], | ||
macaddr.addr_bytes[5] | ||
); | ||
} | ||
|
||
/* clean up the EAL */ | ||
rte_eal_cleanup(); | ||
|
||
return 0; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# Copyright(c) 2017 Intel Corporation | ||
|
||
# meson file, for building this example as part of a main DPDK build. | ||
# | ||
# To build this example as a standalone application with an already-installed | ||
# DPDK instance, use 'make' | ||
|
||
allow_experimental_apis = true | ||
sources = files( | ||
'main.c', | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.