From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 9B9762B96 for ; Wed, 9 Mar 2016 12:41:35 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 09 Mar 2016 03:41:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,311,1455004800"; d="scan'208";a="905937930" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga001.jf.intel.com with ESMTP; 09 Mar 2016 03:41:33 -0800 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id u29BfW9X024355; Wed, 9 Mar 2016 11:41:32 GMT Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id u29BfWtf006257; Wed, 9 Mar 2016 11:41:32 GMT Received: (from fyigit@localhost) by sivswdev02.ir.intel.com with id u29BfV9b006253; Wed, 9 Mar 2016 11:41:31 GMT From: Ferruh Yigit To: dev@dpdk.org Date: Wed, 9 Mar 2016 11:41:25 +0000 Message-Id: <1457523689-6223-1-git-send-email-ferruh.yigit@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1456846920-28770-1-git-send-email-ferruh.yigit@intel.com> References: <1456846920-28770-1-git-send-email-ferruh.yigit@intel.com> Subject: [dpdk-dev] [PATCH v5 0/4] Use common Linux tools to control DPDK ports X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Mar 2016 11:41:36 -0000 This patch sent to keep record of latest status of the work. This work is to make DPDK ports more visible and to enable using common Linux tools to configure DPDK ports. Patch is based on KNI but contains only control functionality of it, also this patch does not include any Linux kernel network driver as part of it. Basically with the help of a kernel module (KCP), virtual Linux network interfaces named as "dpdk$" are created per DPDK port, control messages sent to these virtual interfaces are forwarded to DPDK, and response sent back to Linux application. Virtual interfaces created when DPDK application started and destroyed automatically when DPDK application terminated. Communication between kernel-space and DPDK done using netlink socket. In long term this patch intends to replace the KNI and KNI will be depreciated. v5: * Use unsigned primitive types as possible v4: * Kernel side changes: * Remove logging helper macros, use pr_fmt * Seperate log msg for timeout and error * Control library changes: * Add ethtool_get_settings as dummy v3: * Kernel side changes: * Devices are not up by default * Add enable/disable promisc, allmulti support * Increase timeout to 500ms and print log when a command timedout * Control library changes: * Use librte_ethtool * Don't create interfaces for virtual PMDs * Add a new API ...msg_exist() to support port based locking * Add enable/disable promisc, allmulti support * Example changes: * Use blocking mode control interface processing, instead of poll mode v2: * Use rtnetlink to create interfaces * Add more ethtool support: get/set ringparam, set pauseparam. * fix ethtool get/set eeprom * lots of minor updates, enhancements in the code Samples: $ ifconfig dpdk0: flags=4163 mtu 1500 inet6 fe80::92e2:baff:fe0e:49b8 prefixlen 64 scopeid 0x20 ether 90:e2:ba:0e:49:b8 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 dpdk1: flags=4163 mtu 1500 inet6 fe80::21b:21ff:fe76:fa20 prefixlen 64 scopeid 0x20 ether 00:1b:21:76:fa:20 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 After some traffic on port 0: $ ifconfig dpdk0: flags=4163 mtu 1500 inet6 fe80::92e2:baff:fe0e:49b8 prefixlen 64 scopeid 0x20 ether 90:e2:ba:0e:49:b8 txqueuelen 1000 (Ethernet) RX packets 26117404 bytes 1671514264 (1.5 GiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 27897889 bytes 1785463944 (1.6 GiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 $ ethtool -i dpdk0 driver: rte_ixgbe_pmd version: DPDK 16.04.0-rc0 firmware-version: expansion-rom-version: bus-info: 0000:08:00.0 supports-statistics: no supports-test: no supports-eeprom-access: yes supports-register-dump: yes supports-priv-flags: no $ ethtool -e dpdk0 offset 20 length 10 Offset Values ------ ------ 0x0014: b7 01 bf 01 c7 01 cf 01 09 02 $ ip l show dpdk0 44: dpdk0: mtu 1500 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 1000 link/ether 90:e2:ba:0e:49:b8 brd ff:ff:ff:ff:ff:ff $ ip l set dpdk0 addr 90:e2:ba:0e:49:b9 $ ip l show dpdk0 44: dpdk0: mtu 1500 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 1000 link/ether 90:e2:ba:0e:49:b9 brd ff:ff:ff:ff:ff:ff Ferruh Yigit (4): lib/librte_ethtool: move librte_ethtool form examples to lib folder kcp: add kernel control path kernel module rte_ctrl_if: add control interface library examples/ethtool: add control interface support to the application MAINTAINERS | 5 + config/common_base | 12 + config/common_linuxapp | 3 + doc/api/doxy-api-index.md | 4 +- doc/api/doxy-api.conf | 2 + doc/api/examples.dox | 5 +- doc/guides/prog_guide/ctrl_if_lib.rst | 52 ++ doc/guides/prog_guide/ethtool_lib.rst | 62 ++ doc/guides/prog_guide/index.rst | 4 +- doc/guides/rel_notes/release_16_04.rst | 9 + doc/guides/sample_app_ug/ethtool.rst | 77 +- examples/ethtool/Makefile | 24 +- examples/ethtool/ethapp.c | 873 +++++++++++++++++++++ examples/ethtool/ethapp.h | 41 + examples/ethtool/ethtool-app/Makefile | 54 -- examples/ethtool/ethtool-app/ethapp.c | 873 --------------------- examples/ethtool/ethtool-app/ethapp.h | 41 - examples/ethtool/ethtool-app/main.c | 305 ------- examples/ethtool/lib/Makefile | 57 -- examples/ethtool/lib/rte_ethtool.c | 423 ---------- examples/ethtool/lib/rte_ethtool.h | 410 ---------- examples/ethtool/main.c | 332 ++++++++ lib/Makefile | 4 +- lib/librte_ctrl_if/Makefile | 58 ++ lib/librte_ctrl_if/rte_ctrl_ethtool.c | 391 +++++++++ lib/librte_ctrl_if/rte_ctrl_ethtool.h | 54 ++ lib/librte_ctrl_if/rte_ctrl_if.c | 395 ++++++++++ lib/librte_ctrl_if/rte_ctrl_if.h | 129 +++ lib/librte_ctrl_if/rte_ctrl_if_version.map | 10 + lib/librte_ctrl_if/rte_nl.c | 313 ++++++++ lib/librte_ctrl_if/rte_nl.h | 50 ++ lib/librte_eal/common/include/rte_log.h | 3 +- lib/librte_eal/linuxapp/Makefile | 3 +- lib/librte_eal/linuxapp/eal/Makefile | 3 +- .../linuxapp/eal/include/exec-env/rte_kcp_common.h | 109 +++ lib/librte_eal/linuxapp/kcp/Makefile | 57 ++ lib/librte_eal/linuxapp/kcp/kcp_dev.h | 56 ++ lib/librte_eal/linuxapp/kcp/kcp_ethtool.c | 293 +++++++ lib/librte_eal/linuxapp/kcp/kcp_net.c | 219 ++++++ lib/librte_eal/linuxapp/kcp/kcp_nl.c | 220 ++++++ lib/librte_ethtool/Makefile | 57 ++ lib/librte_ethtool/rte_ethtool.c | 423 ++++++++++ lib/librte_ethtool/rte_ethtool.h | 413 ++++++++++ lib/librte_ethtool/rte_ethtool_version.map | 28 + mk/rte.app.mk | 4 +- 45 files changed, 4746 insertions(+), 2214 deletions(-) create mode 100644 doc/guides/prog_guide/ctrl_if_lib.rst create mode 100644 doc/guides/prog_guide/ethtool_lib.rst create mode 100644 examples/ethtool/ethapp.c create mode 100644 examples/ethtool/ethapp.h delete mode 100644 examples/ethtool/ethtool-app/Makefile delete mode 100644 examples/ethtool/ethtool-app/ethapp.c delete mode 100644 examples/ethtool/ethtool-app/ethapp.h delete mode 100644 examples/ethtool/ethtool-app/main.c delete mode 100644 examples/ethtool/lib/Makefile delete mode 100644 examples/ethtool/lib/rte_ethtool.c delete mode 100644 examples/ethtool/lib/rte_ethtool.h create mode 100644 examples/ethtool/main.c create mode 100644 lib/librte_ctrl_if/Makefile create mode 100644 lib/librte_ctrl_if/rte_ctrl_ethtool.c create mode 100644 lib/librte_ctrl_if/rte_ctrl_ethtool.h create mode 100644 lib/librte_ctrl_if/rte_ctrl_if.c create mode 100644 lib/librte_ctrl_if/rte_ctrl_if.h create mode 100644 lib/librte_ctrl_if/rte_ctrl_if_version.map create mode 100644 lib/librte_ctrl_if/rte_nl.c create mode 100644 lib/librte_ctrl_if/rte_nl.h create mode 100644 lib/librte_eal/linuxapp/eal/include/exec-env/rte_kcp_common.h create mode 100644 lib/librte_eal/linuxapp/kcp/Makefile create mode 100644 lib/librte_eal/linuxapp/kcp/kcp_dev.h create mode 100644 lib/librte_eal/linuxapp/kcp/kcp_ethtool.c create mode 100644 lib/librte_eal/linuxapp/kcp/kcp_net.c create mode 100644 lib/librte_eal/linuxapp/kcp/kcp_nl.c create mode 100644 lib/librte_ethtool/Makefile create mode 100644 lib/librte_ethtool/rte_ethtool.c create mode 100644 lib/librte_ethtool/rte_ethtool.h create mode 100644 lib/librte_ethtool/rte_ethtool_version.map -- 2.5.0