Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/7367/?format=api
https://patches.dpdk.org/api/patches/7367/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1443785140-8706-4-git-send-email-alejandro.lucero@netronome.com/", "project": { "id": 1, "url": "https://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<1443785140-8706-4-git-send-email-alejandro.lucero@netronome.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1443785140-8706-4-git-send-email-alejandro.lucero@netronome.com", "date": "2015-10-02T11:25:40", "name": "[dpdk-dev,3/3] Modifying configuration scripts for Netronome's nfp_uio driver.", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "1d8c67e9804a6ca9452cc72d69841d41909d1e85", "submitter": { "id": 270, "url": "https://patches.dpdk.org/api/people/270/?format=api", "name": "Alejandro Lucero", "email": "alejandro.lucero@netronome.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1443785140-8706-4-git-send-email-alejandro.lucero@netronome.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/7367/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/7367/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id B7A3A8E71;\n\tFri, 2 Oct 2015 13:25:42 +0200 (CEST)", "from ubuntu (host217-39-174-19.in-addr.btopenworld.com\n\t[217.39.174.19]) by dpdk.org (Postfix) with SMTP id D4A308E62\n\tfor <dev@dpdk.org>; Fri, 2 Oct 2015 13:25:40 +0200 (CEST)", "by ubuntu (Postfix, from userid 5466)\n\tid D3087E1120; Fri, 2 Oct 2015 12:25:40 +0100 (BST)" ], "From": "\"Alejandro.Lucero\" <alejandro.lucero@netronome.com>", "To": "dev@dpdk.org", "Date": "Fri, 2 Oct 2015 12:25:40 +0100", "Message-Id": "<1443785140-8706-4-git-send-email-alejandro.lucero@netronome.com>", "X-Mailer": "git-send-email 1.7.9.5", "In-Reply-To": "<1443785140-8706-1-git-send-email-alejandro.lucero@netronome.com>", "References": "<1443785140-8706-1-git-send-email-alejandro.lucero@netronome.com>", "Subject": "[dpdk-dev] [PATCH 3/3] Modifying configuration scripts for\n\tNetronome's nfp_uio driver.", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "patches and discussions about DPDK <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "From: \"Alejandro.Lucero\" <alejandro.lucero@netronome.com>\n\nSigned-off-by: Alejandro.Lucero <alejandro.lucero@netronome.com>\nSigned-off-by: Rolf.Neugebauer <rolf.neugebauer@netronome.com>\n---\n tools/dpdk_nic_bind.py | 8 ++--\n tools/setup.sh | 122 ++++++++++++++++++++++++++++++++++++++----------\n 2 files changed, 101 insertions(+), 29 deletions(-)", "diff": "diff --git a/tools/dpdk_nic_bind.py b/tools/dpdk_nic_bind.py\nindex b7bd877..f7f8a39 100755\n--- a/tools/dpdk_nic_bind.py\n+++ b/tools/dpdk_nic_bind.py\n@@ -43,7 +43,7 @@ ETHERNET_CLASS = \"0200\"\n # Each device within this is itself a dictionary of device properties\n devices = {}\n # list of supported DPDK drivers\n-dpdk_drivers = [ \"igb_uio\", \"vfio-pci\", \"uio_pci_generic\" ]\n+dpdk_drivers = [ \"igb_uio\", \"vfio-pci\", \"uio_pci_generic\", \"nfp_uio\" ]\n \n # command-line arg flags\n b_flag = None\n@@ -153,7 +153,7 @@ def find_module(mod):\n return path\n \n def check_modules():\n- '''Checks that igb_uio is loaded'''\n+ '''Checks that at least one dpdk module is loaded'''\n global dpdk_drivers\n \n fd = file(\"/proc/modules\")\n@@ -261,7 +261,7 @@ def get_nic_details():\n devices[d][\"Active\"] = \"*Active*\"\n break;\n \n- # add igb_uio to list of supporting modules if needed\n+ # add module to list of supporting modules if needed\n if \"Module_str\" in devices[d]:\n for driver in dpdk_drivers:\n if driver not in devices[d][\"Module_str\"]:\n@@ -440,7 +440,7 @@ def display_devices(title, dev_list, extra_params = None):\n \n def show_status():\n '''Function called when the script is passed the \"--status\" option. Displays\n- to the user what devices are bound to the igb_uio driver, the kernel driver\n+ to the user what devices are bound to a dpdk driver, the kernel driver\n or to no driver'''\n global dpdk_drivers\n kernel_drv = []\ndiff --git a/tools/setup.sh b/tools/setup.sh\nindex 5a8b2f3..e434ddb 100755\n--- a/tools/setup.sh\n+++ b/tools/setup.sh\n@@ -236,6 +236,52 @@ load_vfio_module()\n }\n \n #\n+# Unloads nfp_uio.ko.\n+#\n+remove_nfp_uio_module()\n+{\n+\techo \"Unloading any existing DPDK UIO module\"\n+\t/sbin/lsmod | grep -s nfp_uio > /dev/null\n+\tif [ $? -eq 0 ] ; then\n+\t\tsudo /sbin/rmmod nfp_uio\n+\tfi\n+}\n+\n+#\n+# Loads new nfp_uio.ko (and uio module if needed).\n+#\n+load_nfp_uio_module()\n+{\n+\techo \"Using RTE_SDK=$RTE_SDK and RTE_TARGET=$RTE_TARGET\"\n+\tif [ ! -f $RTE_SDK/$RTE_TARGET/kmod/nfp_uio.ko ];then\n+\t\techo \"## ERROR: Target does not have the DPDK UIO Kernel Module.\"\n+\t\techo \" To fix, please try to rebuild target.\"\n+\t\treturn\n+\tfi\n+\n+\tremove_nfp_uio_module\n+\n+\t/sbin/lsmod | grep -s uio > /dev/null\n+\tif [ $? -ne 0 ] ; then\n+\t\tmodinfo uio > /dev/null\n+\t\tif [ $? -eq 0 ]; then\n+\t\t\techo \"Loading uio module\"\n+\t\t\tsudo /sbin/modprobe uio\n+\t\tfi\n+\tfi\n+\n+\t# UIO may be compiled into kernel, so it may not be an error if it can't\n+\t# be loaded.\n+\n+\techo \"Loading DPDK UIO module\"\n+\tsudo /sbin/insmod $RTE_SDK/$RTE_TARGET/kmod/nfp_uio.ko\n+\tif [ $? -ne 0 ] ; then\n+\t\techo \"## ERROR: Could not load kmod/nfp_uio.ko.\"\n+\t\tquit\n+\tfi\n+}\n+\n+#\n # Unloads the rte_kni.ko module.\n #\n remove_kni_module()\n@@ -427,10 +473,10 @@ grep_meminfo()\n #\n show_nics()\n {\n-\tif /sbin/lsmod | grep -q -e igb_uio -e vfio_pci; then\n+\tif /sbin/lsmod | grep -q -e igb_uio -e vfio_pci -e nfp_uio; then\n \t\t${RTE_SDK}/tools/dpdk_nic_bind.py --status\n \telse\n-\t\techo \"# Please load the 'igb_uio' or 'vfio-pci' kernel module before \"\n+\t\techo \"# Please load the 'igb_uio', 'vfio-pci' or 'nfp_uio' kernel module before \"\n \t\techo \"# querying or adjusting NIC device bindings\"\n \tfi\n }\n@@ -471,6 +517,23 @@ bind_nics_to_igb_uio()\n }\n \n #\n+# Uses dpdk_nic_bind.py to move devices to work with nfp_uio\n+#\n+bind_nics_to_nfp_uio()\n+{\n+\tif /sbin/lsmod | grep -q nfp_uio ; then\n+\t\t${RTE_SDK}/tools/dpdk_nic_bind.py --status\n+\t\techo \"\"\n+\t\techo -n \"Enter PCI address of device to bind to NFP UIO driver: \"\n+\t\tread PCI_PATH\n+\t\tsudo ${RTE_SDK}/tools/dpdk_nic_bind.py -b nfp_uio $PCI_PATH && echo \"OK\"\n+\telse\n+\t\techo \"# Please load the 'nfp_uio' kernel module before querying or \"\n+\t\techo \"# adjusting NIC device bindings\"\n+\tfi\n+}\n+\n+#\n # Uses dpdk_nic_bind.py to move devices to work with kernel drivers again\n #\n unbind_nics()\n@@ -513,29 +576,35 @@ step2_func()\n \tTEXT[1]=\"Insert IGB UIO module\"\n \tFUNC[1]=\"load_igb_uio_module\"\n \n-\tTEXT[2]=\"Insert VFIO module\"\n-\tFUNC[2]=\"load_vfio_module\"\n+\tTEXT[2]=\"Insert NFP UIO module\"\n+\tFUNC[2]=\"load_nfp_uio_module\"\n \n-\tTEXT[3]=\"Insert KNI module\"\n-\tFUNC[3]=\"load_kni_module\"\n+\tTEXT[3]=\"Insert VFIO module\"\n+\tFUNC[3]=\"load_vfio_module\"\n \n-\tTEXT[4]=\"Setup hugepage mappings for non-NUMA systems\"\n-\tFUNC[4]=\"set_non_numa_pages\"\n+\tTEXT[4]=\"Insert KNI module\"\n+\tFUNC[4]=\"load_kni_module\"\n \n-\tTEXT[5]=\"Setup hugepage mappings for NUMA systems\"\n-\tFUNC[5]=\"set_numa_pages\"\n+\tTEXT[5]=\"Setup hugepage mappings for non-NUMA systems\"\n+\tFUNC[5]=\"set_non_numa_pages\"\n \n-\tTEXT[6]=\"Display current Ethernet device settings\"\n-\tFUNC[6]=\"show_nics\"\n+\tTEXT[6]=\"Setup hugepage mappings for NUMA systems\"\n+\tFUNC[6]=\"set_numa_pages\"\n \n-\tTEXT[7]=\"Bind Ethernet device to IGB UIO module\"\n-\tFUNC[7]=\"bind_nics_to_igb_uio\"\n+\tTEXT[7]=\"Display current Ethernet device settings\"\n+\tFUNC[7]=\"show_nics\"\n \n-\tTEXT[8]=\"Bind Ethernet device to VFIO module\"\n-\tFUNC[8]=\"bind_nics_to_vfio\"\n+\tTEXT[8]=\"Bind Ethernet device to IGB UIO module\"\n+\tFUNC[8]=\"bind_nics_to_igb_uio\"\n \n-\tTEXT[9]=\"Setup VFIO permissions\"\n-\tFUNC[9]=\"set_vfio_permissions\"\n+\tTEXT[9]=\"Bind Ethernet device to NFP UIO module\"\n+\tFUNC[9]=\"bind_nics_to_nfp_uio\"\n+\n+\tTEXT[10]=\"Bind Ethernet device to VFIO module\"\n+\tFUNC[10]=\"bind_nics_to_vfio\"\n+\n+\tTEXT[11]=\"Setup VFIO permissions\"\n+\tFUNC[11]=\"set_vfio_permissions\"\n }\n \n #\n@@ -574,20 +643,23 @@ step5_func()\n \tTEXT[1]=\"Uninstall all targets\"\n \tFUNC[1]=\"uninstall_targets\"\n \n-\tTEXT[2]=\"Unbind NICs from IGB UIO or VFIO driver\"\n+\tTEXT[2]=\"Unbind NICs from IGB UIO, VFIO or NFP UIO driver\"\n \tFUNC[2]=\"unbind_nics\"\n \n \tTEXT[3]=\"Remove IGB UIO module\"\n \tFUNC[3]=\"remove_igb_uio_module\"\n \n-\tTEXT[4]=\"Remove VFIO module\"\n-\tFUNC[4]=\"remove_vfio_module\"\n+\tTEXT[4]=\"Remove NFP UIO module\"\n+\tFUNC[4]=\"remove_nfp_uio_module\"\n+\n+\tTEXT[5]=\"Remove VFIO module\"\n+\tFUNC[5]=\"remove_vfio_module\"\n \n-\tTEXT[5]=\"Remove KNI module\"\n-\tFUNC[5]=\"remove_kni_module\"\n+\tTEXT[6]=\"Remove KNI module\"\n+\tFUNC[6]=\"remove_kni_module\"\n \n-\tTEXT[6]=\"Remove hugepage mappings\"\n-\tFUNC[6]=\"clear_huge_pages\"\n+\tTEXT[7]=\"Remove hugepage mappings\"\n+\tFUNC[7]=\"clear_huge_pages\"\n }\n \n STEPS[1]=\"step1_func\"\n", "prefixes": [ "dpdk-dev", "3/3" ] }{ "id": 7367, "url": "