Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2223498/?format=api
{ "id": 2223498, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2223498/?format=api", "web_url": "http://patchwork.ozlabs.org/project/openvswitch/patch/b6568807e6a46620947e210b3bef4e97d4162fe3.1776253354.git.echaudro@redhat.com/", "project": { "id": 47, "url": "http://patchwork.ozlabs.org/api/1.2/projects/47/?format=api", "name": "Open vSwitch", "link_name": "openvswitch", "list_id": "ovs-dev.openvswitch.org", "list_email": "ovs-dev@openvswitch.org", "web_url": "http://openvswitch.org/", "scm_url": "git@github.com:openvswitch/ovs.git", "webscm_url": "https://github.com/openvswitch/ovs", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<b6568807e6a46620947e210b3bef4e97d4162fe3.1776253354.git.echaudro@redhat.com>", "list_archive_url": null, "date": "2026-04-15T11:42:34", "name": "[ovs-dev,v3] tests: Rework DPDK offload tests to use a simpler interface argument.", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "424e56bd379bb1e8749c6db43108cf79f0482c29", "submitter": { "id": 70613, "url": "http://patchwork.ozlabs.org/api/1.2/people/70613/?format=api", "name": "Eelco Chaudron", "email": "echaudro@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/openvswitch/patch/b6568807e6a46620947e210b3bef4e97d4162fe3.1776253354.git.echaudro@redhat.com/mbox/", "series": [ { "id": 499980, "url": "http://patchwork.ozlabs.org/api/1.2/series/499980/?format=api", "web_url": "http://patchwork.ozlabs.org/project/openvswitch/list/?series=499980", "date": "2026-04-15T11:42:34", "name": "[ovs-dev,v3] tests: Rework DPDK offload tests to use a simpler interface argument.", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/499980/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2223498/comments/", "check": "success", "checks": "http://patchwork.ozlabs.org/api/patches/2223498/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<ovs-dev-bounces@openvswitch.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "dev@openvswitch.org" ], "Delivered-To": [ "patchwork-incoming@legolas.ozlabs.org", "ovs-dev@lists.linuxfoundation.org" ], "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=ZmkIz0AC;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org\n (client-ip=140.211.166.137; helo=smtp4.osuosl.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org)", "smtp4.osuosl.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key)\n header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=ZmkIz0AC", "smtp4.osuosl.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com" ], "Received": [ "from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fwfVP0S5Rz1yDF\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2026 21:46:04 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby smtp4.osuosl.org (Postfix) with ESMTP id E37BE48BB1;\n\tWed, 15 Apr 2026 11:46:01 +0000 (UTC)", "from smtp4.osuosl.org ([127.0.0.1])\n by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id 8dCcbDEWRvvc; Wed, 15 Apr 2026 11:46:00 +0000 (UTC)", "from lists.linuxfoundation.org (lf-lists.osuosl.org\n [IPv6:2605:bc80:3010:104::8cd3:938])\n\tby smtp4.osuosl.org (Postfix) with ESMTPS id 628F14891C;\n\tWed, 15 Apr 2026 11:46:00 +0000 (UTC)", "from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id 4665DC054A;\n\tWed, 15 Apr 2026 11:46:00 +0000 (UTC)", "from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137])\n by lists.linuxfoundation.org (Postfix) with ESMTP id 2752CC0549\n for <dev@openvswitch.org>; Wed, 15 Apr 2026 11:45:59 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n by smtp4.osuosl.org (Postfix) with ESMTP id 075164891C\n for <dev@openvswitch.org>; Wed, 15 Apr 2026 11:45:59 +0000 (UTC)", "from smtp4.osuosl.org ([127.0.0.1])\n by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id x3L3jejJ6Aen for <dev@openvswitch.org>;\n Wed, 15 Apr 2026 11:45:58 +0000 (UTC)", "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by smtp4.osuosl.org (Postfix) with ESMTPS id F19C54645A\n for <dev@openvswitch.org>; Wed, 15 Apr 2026 11:45:57 +0000 (UTC)", "from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-172-jFs5TqnjNgiIAw-FiRS8Uw-1; Wed,\n 15 Apr 2026 07:45:53 -0400", "from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 2A1C31956056; Wed, 15 Apr 2026 11:45:52 +0000 (UTC)", "from wsfd-advnetlab224.anl.eng.rdu2.dc.redhat.com\n (wsfd-advnetlab224.anl.eng.rdu2.dc.redhat.com [10.6.42.15])\n by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id C147E19560B1; Wed, 15 Apr 2026 11:45:51 +0000 (UTC)" ], "X-Virus-Scanned": [ "amavis at osuosl.org", "amavis at osuosl.org" ], "X-Comment": "SPF check N/A for local connections -\n client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN> ", "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 smtp4.osuosl.org 628F14891C", "OpenDKIM Filter v2.11.0 smtp4.osuosl.org F19C54645A" ], "Received-SPF": "Pass (mailfrom) identity=mailfrom; client-ip=170.10.133.124;\n helo=us-smtp-delivery-124.mimecast.com; envelope-from=echaudro@redhat.com;\n receiver=<UNKNOWN>", "DMARC-Filter": "OpenDMARC Filter v1.4.2 smtp4.osuosl.org F19C54645A", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1776253556;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding;\n bh=QT7xP1bjsSdsxcTUJ5X9ypQBTzkVl0yZFdq4YwNxOF8=;\n b=ZmkIz0AC7NQW4nmW4yCBoUF0UqGraVXDIoep4BippnKfjsRk+/wdFW/4iWbOapjvMbU4QH\n eiCQoeuG4OgdDofX+0NM5kyk0eJ/onYA67g2GK8hUTJ9lz+T6Ftl3jqARZMu2ZBs9tTGM/\n IgDKHVRHLu09MaKqG0gPeWDEwzW5JQA=", "X-MC-Unique": "jFs5TqnjNgiIAw-FiRS8Uw-1", "X-Mimecast-MFC-AGG-ID": "jFs5TqnjNgiIAw-FiRS8Uw_1776253552", "To": "dev@openvswitch.org", "Cc": "elibr@nvidia.com", "Date": "Wed, 15 Apr 2026 13:42:34 +0200", "Message-ID": "\n <b6568807e6a46620947e210b3bef4e97d4162fe3.1776253354.git.echaudro@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.0 on 10.30.177.12", "X-Mimecast-Spam-Score": "0", "X-Mimecast-MFC-PROC-ID": "RxMp4OpsV9_FIdwFlvZO-WdxTM5SEXnJs2lxnTFGylQ_1776253552", "X-Mimecast-Originator": "redhat.com", "Subject": "[ovs-dev] [PATCH v3] tests: Rework DPDK offload tests to use a\n simpler interface argument.", "X-BeenThere": "ovs-dev@openvswitch.org", "X-Mailman-Version": "2.1.30", "Precedence": "list", "List-Id": "<ovs-dev.openvswitch.org>", "List-Unsubscribe": "<https://mail.openvswitch.org/mailman/options/ovs-dev>,\n <mailto:ovs-dev-request@openvswitch.org?subject=unsubscribe>", "List-Archive": "<http://mail.openvswitch.org/pipermail/ovs-dev/>", "List-Post": "<mailto:ovs-dev@openvswitch.org>", "List-Help": "<mailto:ovs-dev-request@openvswitch.org?subject=help>", "List-Subscribe": "<https://mail.openvswitch.org/mailman/listinfo/ovs-dev>,\n <mailto:ovs-dev-request@openvswitch.org?subject=subscribe>", "From": "Eelco Chaudron via dev <ovs-dev@openvswitch.org>", "Reply-To": "Eelco Chaudron <echaudro@redhat.com>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "ovs-dev-bounces@openvswitch.org", "Sender": "\"dev\" <ovs-dev-bounces@openvswitch.org>" }, "content": "This patch refactors the DPDK offload test infrastructure to simplify\nthe interface configuration. Instead of using OVS_DPDK_VF_PCI_ADDRS\nwith a space-separated list of PCI addresses and VF indices (e.g.,\n\"0000:17:00.0,0 0000:17:00.0,1\"), the tests now use OVS_PF_PCI\nwith a single PF address (e.g., \"0000:17:00.0\") and derive VF\ninformation from sysfs.\n\nSigned-off-by: Eelco Chaudron <echaudro@redhat.com>\n---\nChanges to v3:\n- Fixed documentation.\n- Changed test macro names from xxxx_netdev() to xxx_port().\n- Use local variables in shell macros.\nChanges to v2:\n- Use PCI address rather than port name, so other blades might\n be supported.\n- Moved/renamed shell helpers.\n- Updated documentation.\n---\n Documentation/topics/testing.rst | 24 +++---\n tests/system-common-macros.at | 90 ++++++++++++++++++++++\n tests/system-dpdk-offloads-macros.at | 108 ++++-----------------------\n 3 files changed, 120 insertions(+), 102 deletions(-)", "diff": "diff --git a/Documentation/topics/testing.rst b/Documentation/topics/testing.rst\nindex deb6088d7..abe670b8b 100644\n--- a/Documentation/topics/testing.rst\n+++ b/Documentation/topics/testing.rst\n@@ -306,19 +306,25 @@ Userspace datapath with DPDK offload\n \n To invoke the userspace datapath tests with DPDK and its rte_flow offload,\n the same prerequisites apply as above. In addition, six Virtual Function (VF)\n-interfaces must be preconfigured and capable of hardware offloading traffic\n-between each other.\n+interfaces must be preconfigured on a single Physical Function (PF) that\n+supports rte_flow hardware offload.\n \n-These six VFs need to be passed as a list of PF PCI addresses with their\n-corresponding VF indexes in the OVS_DPDK_VF_PCI_ADDRS variable.\n-For example::\n+This is an example on how to set this up for an NVIDIA blade on port\n+``ens2f0np0``::\n \n- OVS_DPDK_VF_PCI_ADDRS=\"0000:17:00.0,0 0000:17:00.0,1 0000:17:00.0,2 0000:17:00.0,3 0000:17:00.0,4 0000:17:00.0,5\"\n+ OVS_PF_PCI=$(basename $(readlink /sys/class/net/ens2f0np0/device))\n+ echo 0 > /sys/bus/pci/devices/$OVS_PF_PCI/sriov_numvfs\n+ devlink dev eswitch set pci/$OVS_PF_PCI mode switchdev\n+ echo 6 > /sys/bus/pci/devices/$OVS_PF_PCI/sriov_numvfs\n \n-To invoke the dpdk offloads testsuite with the userspace datapath, run::\n+This PF's PCI ID needs to be passed with the OVS_PF_PCI variable.\n+To invoke the DPDK offloads testsuite with the userspace datapath, run::\n \n- make check-dpdk-offloads \\\n- OVS_DPDK_VF_PCI_ADDRS=\"0000:17:00.0,0 0000:17:00.0,1 0000:17:00.0,2 0000:17:00.0,3 0000:17:00.0,4 0000:17:00.0,5\"\n+ make check-dpdk-offloads OVS_PF_PCI=0000:17:00.0\n+\n+.. note::\n+ This has only been tested on NVIDIA blades due to the limited availability\n+ of other blades that support rte_flow.\n \n Userspace datapath: Testing and Validation of CPU-specific Optimizations\n ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\ndiff --git a/tests/system-common-macros.at b/tests/system-common-macros.at\nindex e4862231a..97b80405b 100644\n--- a/tests/system-common-macros.at\n+++ b/tests/system-common-macros.at\n@@ -409,3 +409,93 @@ m4_define([OVS_CHECK_PSAMPLE],\n # OVS_CHECK_XT()\n m4_define([OVS_CHECK_XT],\n [AT_SKIP_IF([test $HAVE_IPTABLES = no && test $HAVE_NFT = no])])\n+\n+OVS_START_SHELL_HELPERS\n+\n+# ovs_get_vf_port(<PF_PORT_PCI>, <VF_INDEX>)\n+#\n+# This function tries to find the VF's netdev for the given PF's VF index.\n+#\n+ovs_get_vf_port() {\n+ local PF_PCI=$1\n+ local VF_IDX=$2\n+\n+ local vf_net_dir=\"/sys/bus/pci/devices/$PF_PCI/virtfn$VF_IDX/net\"\n+ if test ! -d \"$vf_net_dir\"; then\n+ return 1\n+ fi\n+\n+ local vf_name=$(ls \"$vf_net_dir\" 2>/dev/null | head -1)\n+ if test -z \"$vf_name\"; then\n+ return 2\n+ fi\n+\n+ echo \"$vf_name\"\n+ return 0\n+}\n+\n+# ovs_get_representor_port(<PF_PORT_PCI>, <VF_INDEX>)\n+#\n+# This function tries to find the representor's netdev for the given PF's VF\n+# index.\n+#\n+ovs_get_representor_port() {\n+ local PF_PCI=$1\n+ local VF_IDX=$2\n+\n+ local representor=$(grep -l \"vf$VF_IDX$\" \\\n+ /sys/bus/pci/devices/$PF_PCI/net/*/phys_port_name \\\n+ 2>/dev/null | head -1)\n+ if test -z \"$representor\"; then\n+ return 2\n+ fi\n+\n+ basename $(dirname \"$representor\")\n+ return 0\n+}\n+\n+# ovs_verify_pf_cfg(<PF_PORT_PCI>)\n+#\n+# Verify that the given PF port exists and that the required VFs are properly\n+# configured, i.e. have representor ports.\n+#\n+ovs_verify_pf_cfg() {\n+ local PF_PCI=$1\n+ local VF_NAMES=()\n+ local REPRESENTOR_NAMES=()\n+ local PCI_REGEX=[[0-9a-fA-F]]{4}:[[0-9a-fA-F]]{2}:[[0-9a-fA-F]]{2}\\.[[0-7]]\n+ local vf_net_dir vf_name representor i\n+\n+ echo \"$PF_PCI\" | grep -E -q \"^$PCI_REGEX$\" || return 1\n+\n+ for i in {0..5}; do\n+ # Get VF netdev using PCI path\n+ vf_net_dir=\"/sys/bus/pci/devices/$PF_PCI/virtfn$i/net\"\n+ if test ! -d \"$vf_net_dir\"; then\n+ return 2\n+ fi\n+\n+ vf_name=$(ls \"$vf_net_dir\" 2>/dev/null | head -1)\n+ if test -z \"$vf_name\"; then\n+ return 3\n+ fi\n+ VF_NAMES+=($vf_name)\n+\n+ # Find representor port for this VF\n+ representor=$(grep -l \"vf$i$\" \\\n+ /sys/bus/pci/devices/$PF_PCI/net/*/phys_port_name \\\n+ 2>/dev/null | head -1)\n+ if test -z \"$representor\"; then\n+ return 4\n+ fi\n+ REPRESENTOR_NAMES+=($(basename $(dirname \"$representor\")))\n+ done\n+\n+ if test \"${#VF_NAMES[*]}\" -lt 6 -o \"${#REPRESENTOR_NAMES[*]}\" -lt 6; then\n+ return 5\n+ fi\n+\n+ return 0\n+}\n+\n+OVS_END_SHELL_HELPERS\ndiff --git a/tests/system-dpdk-offloads-macros.at b/tests/system-dpdk-offloads-macros.at\nindex ff7a6e095..5aa19112a 100644\n--- a/tests/system-dpdk-offloads-macros.at\n+++ b/tests/system-dpdk-offloads-macros.at\n@@ -54,10 +54,8 @@ m4_define([CHECK_NO_DPDK_OFFLOAD],\n #\n m4_define([OVS_DPDK_OFFLOAD_PRE_CHECK], [\n OVS_DPDK_PRE_CHECK()\n- AT_SKIP_IF(\n- [test \"$(printf '%s' \"$OVS_DPDK_VF_PCI_ADDRS\" | wc -w)\" -ne 6])\n-\n- AT_SKIP_IF([! ovs_dpdk_verify_vf_cfg \"$OVS_DPDK_VF_PCI_ADDRS\"])\n+ AT_SKIP_IF([test -z \"$OVS_PF_PCI\"])\n+ AT_SKIP_IF([! ovs_verify_pf_cfg \"$OVS_PF_PCI\"])\n ])\n \n # OVS_TRAFFIC_VSWITCHD_START([vsctl-args], [vsctl-output], [dbinit-aux-args])\n@@ -114,39 +112,38 @@ $1\";/mlx5_net: Failed to update link status: /d\"])\n m4_define([ADD_VF],\n [ USER_PORT=$1\n case \"$USER_PORT\" in\n- client) PORT_NO=0 ;;\n- server) PORT_NO=1 ;;\n- *) PORT_NO=${USER_PORT##*[!0-9]} ;;\n+ client) VF_IDX=0 ;;\n+ server) VF_IDX=1 ;;\n+ *) VF_IDX=${USER_PORT##*[!0-9]} ;;\n esac\n \n- AT_CHECK([[[ \"$PORT_NO\" -ge 0 ]] && [[ \"$PORT_NO\" -le 6 ]] || return 66])\n- PORT_CFG=$(echo $OVS_DPDK_VF_PCI_ADDRS | cut -d' ' -f$((PORT_NO+1)))\n- PF_PCI=$(ovs_dpdk_get_pci_id \"$PORT_CFG\")\n- VF_IDX=$(ovs_dpdk_get_vf_idx \"$PORT_CFG\")\n- REP=$(ovs_dpdk_get_representor_netdev $PF_PCI $VF_IDX)\n- AT_CHECK([test $? -eq 0])\n+ AT_CHECK([[[ \"$VF_IDX\" -ge 0 ]] && [[ \"$VF_IDX\" -le 5 ]] || return 66])\n+\n+ VF=$(ovs_get_vf_port $OVS_PF_PCI $VF_IDX)\n+ AT_CHECK([test -n \"$VF\"])\n \n- AT_CHECK([ip link set $REP name $1])\n+ AT_CHECK([ip link set $VF down])\n+ AT_CHECK([ip link set $VF name $1])\n AT_CHECK([ip link set $1 netns $2])\n AT_CHECK([ovs-vsctl add-port $3 ovs-$1 -- \\\n set interface ovs-$1 external-ids:iface-id=\"$1\" -- \\\n set interface ovs-$1 type=dpdk -- \\\n set interface ovs-$1 \\\n- options:dpdk-devargs=$PF_PCI,representor=vf$VF_IDX])\n+ options:dpdk-devargs=$OVS_PF_PCI,representor=vf$VF_IDX])\n NS_CHECK_EXEC([$2], [ip addr add $4 dev $1 $7])\n NS_CHECK_EXEC([$2], [ip link set dev $1 up])\n if test -n \"$5\"; then\n NS_CHECK_EXEC([$2], [ip link set dev $1 address $5])\n else\n NS_CHECK_EXEC([$2],\n- [ip link set dev $1 address 02:00:00:00:EC:0$PORT_NO])\n+ [ip link set dev $1 address 02:00:00:00:EC:0$VF_IDX])\n fi\n if test -n \"$6\"; then\n NS_CHECK_EXEC([$2], [ip route add default via $6])\n fi\n on_exit \"ip netns exec $2 ip link set $1 netns 1; \\\n- ip link property del dev $1 altname $REP; \\\n- ip link set $1 name $REP\"\n+ ip link property del dev $1 altname $VF; \\\n+ ip link set $1 name $VF\"\n ]\n )\n m4_define([ADD_VETH], [ADD_VF($@)])\n@@ -159,78 +156,3 @@ m4_define([DUMP_DP_IP_CLEAN_SORTED], [dnl\n grep 'eth_type(0x0800)' \\\n | sed -e 's/eth(src=[[a-z0-9:]]*,dst=[[a-z0-9:]]*)/eth(macs)/;s/recirc_id(0),//' \\\n | strip_used | strip_ptype | sort])\n-\n-OVS_START_SHELL_HELPERS\n-\n-# ovs_dpdk_is_valid_pci_vf_addr()\n-#\n-# Check if the given PF PCI address and the VF number are valid.\n-#\n-ovs_dpdk_is_valid_pci_vf_addr() {\n- PCI_ID='[[0-9a-fA-F]]{4}:[[0-9a-fA-F]]{2}:[[0-9a-fA-F]]{2}\\.[[0-7]]'\n- echo \"$1\" | grep -E -q \"^$PCI_ID,[[0-9]]+$\" && return 0 || return 1\n-}\n-\n-# ovs_dpdk_get_pci_id()\n-#\n-ovs_dpdk_get_pci_id() {\n- printf '%s\\n' \"${1%%,*}\"\n-}\n-\n-# ovs_dpdk_get_vf_idx()\n-#\n-ovs_dpdk_get_vf_idx() {\n- printf '%s\\n' \"${1##*,}\"\n-}\n-\n-# ovs_dpdk_get_representor_netdev(<PF_PCI>, <VF_INDEX>)\n-#\n-# This function tries to find the representor netdev for the given PF's VF.\n-#\n-ovs_dpdk_get_representor_netdev() {\n- PF_PCI=$1\n- VF_IDX=$2\n-\n- VF_NET_DIR=\"/sys/bus/pci/devices/$PF_PCI/virtfn$VF_IDX/net\"\n-\n- if [[ ! -d \"$VF_NET_DIR\" ]]; then\n- echo \"ERROR: VF $VF_IDX for PF $PF_PCI does not exist\" >&2\n- return 1\n- fi\n-\n- for iface in \"$VF_NET_DIR\"/*; do\n- if [[ -e \"$iface\" ]]; then\n- basename \"$iface\"\n- return 0\n- fi\n- done\n-\n- echo \"ERROR: No representor netdev found for VF $VF_IDX on PF $PF_PCI\" >&2\n- return 1\n-}\n-\n-# ovs_dpdk_verify_vf_cfg()\n-#\n-# Verify that the given PF PCI addresses and corresponding VF IDs in\n-# OVS_DPDK_VF_PCI_ADDRS are valid, exist, and have corresponding\n-# representor ports.\n-#\n-ovs_dpdk_verify_vf_cfg() {\n- i=0\n-\n- for addr in $1; do\n- ovs_dpdk_is_valid_pci_vf_addr \"$addr\" || return 1\n-\n- PCI_ID=$(ovs_dpdk_get_pci_id \"$addr\")\n- VF_IDX=$(ovs_dpdk_get_vf_idx \"$addr\")\n-\n- REP=$(ovs_dpdk_get_representor_netdev $PCI_ID $VF_IDX) || return 1\n-\n- echo \"ovs-p$i: PF PCI $PCI_ID with VF $VF_IDX has representor $REP\"\n- i=$((i + 1))\n- done\n-\n- return 0\n-}\n-\n-OVS_END_SHELL_HELPERS\n", "prefixes": [ "ovs-dev", "v3" ] }