Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/76291/?format=api
http://patches.dpdk.org/api/patches/76291/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200902063802.102428-2-qiming.yang@intel.com/", "project": { "id": 1, "url": "http://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": "<20200902063802.102428-2-qiming.yang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200902063802.102428-2-qiming.yang@intel.com", "date": "2020-09-02T06:38:01", "name": "[1/2] net/ice: add dcf port representor infrastructure", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "9ad791b8383216a1114bb13e486537a557288545", "submitter": { "id": 522, "url": "http://patches.dpdk.org/api/people/522/?format=api", "name": "Qiming Yang", "email": "qiming.yang@intel.com" }, "delegate": { "id": 1540, "url": "http://patches.dpdk.org/api/users/1540/?format=api", "username": "qzhan15", "first_name": "Qi", "last_name": "Zhang", "email": "qi.z.zhang@intel.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200902063802.102428-2-qiming.yang@intel.com/mbox/", "series": [ { "id": 11891, "url": "http://patches.dpdk.org/api/series/11891/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11891", "date": "2020-09-02T06:38:01", "name": "enable VLAN offload in DCF", "version": 1, "mbox": "http://patches.dpdk.org/series/11891/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/76291/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/76291/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id E73F1A04B5;\n\tWed, 2 Sep 2020 08:59:30 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 0F1411C069;\n\tWed, 2 Sep 2020 08:59:30 +0200 (CEST)", "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n by dpdk.org (Postfix) with ESMTP id BE0F0CF3\n for <dev@dpdk.org>; Wed, 2 Sep 2020 08:59:28 +0200 (CEST)", "from fmsmga004.fm.intel.com ([10.253.24.48])\n by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 01 Sep 2020 23:59:26 -0700", "from dpdk-qiming1.sh.intel.com ([10.67.119.9])\n by fmsmga004.fm.intel.com with ESMTP; 01 Sep 2020 23:59:25 -0700" ], "IronPort-SDR": [ "\n kjAS0o5qdC/juQUKu+d1jQYVPiWEiTa33eE0ioZqC1c8j4pygX73LA0Vy2N5veTJuRXU1SzEvo\n e+0RfHxJuiOg==", "\n tNZaHPw0Mfc4CL8ojvvmpy2cnuCgtK3uMTBME5cDZ4vbpoySopshDat88t/y7dIWlOsgah9gR2\n qG2bhtRf2Jsw==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9731\"; a=\"156593269\"", "E=Sophos;i=\"5.76,381,1592895600\"; d=\"scan'208\";a=\"156593269\"", "E=Sophos;i=\"5.76,381,1592895600\"; d=\"scan'208\";a=\"325664230\"" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "From": "Qiming Yang <qiming.yang@intel.com>", "To": "dev@dpdk.org", "Cc": "qi.z.zhang@intel.com,\n\tQiming Yang <qiming.yang@intel.com>", "Date": "Wed, 2 Sep 2020 14:38:01 +0800", "Message-Id": "<20200902063802.102428-2-qiming.yang@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20200902063802.102428-1-qiming.yang@intel.com>", "References": "<20200902063802.102428-1-qiming.yang@intel.com>", "Subject": "[dpdk-dev] [PATCH 1/2] net/ice: add dcf port representor\n\tinfrastructure", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Defines data structures and code to init/uninit\nVF representors during pci_probe and pci_remove\nrespectively.\nMost of the dev_ops for the VF representor are just\nstubs for now and will be will be filled out in next patch\n\nSigned-off-by: Qiming Yang <qiming.yang@intel.com>\n---\n drivers/net/ice/Makefile | 1 +\n drivers/net/ice/ice_dcf_ethdev.c | 66 +++++-\n drivers/net/ice/ice_dcf_ethdev.h | 11 +\n drivers/net/ice/ice_dcf_vf_representor.c | 245 +++++++++++++++++++++++\n 4 files changed, 321 insertions(+), 2 deletions(-)\n create mode 100644 drivers/net/ice/ice_dcf_vf_representor.c", "diff": "diff --git a/drivers/net/ice/Makefile b/drivers/net/ice/Makefile\nindex 34cd4024b..f9eb34a87 100644\n--- a/drivers/net/ice/Makefile\n+++ b/drivers/net/ice/Makefile\n@@ -88,6 +88,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_generic_flow.c\n \n SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_dcf.c\n SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_dcf_ethdev.c\n+SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_dcf_vf_representor.c\n SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_dcf_parent.c\n \n # install this header file\ndiff --git a/drivers/net/ice/ice_dcf_ethdev.c b/drivers/net/ice/ice_dcf_ethdev.c\nindex 2faed3cc7..73af87785 100644\n--- a/drivers/net/ice/ice_dcf_ethdev.c\n+++ b/drivers/net/ice/ice_dcf_ethdev.c\n@@ -973,17 +973,79 @@ ice_dcf_cap_selected(struct rte_devargs *devargs)\n static int eth_ice_dcf_pci_probe(__rte_unused struct rte_pci_driver *pci_drv,\n \t\t\t struct rte_pci_device *pci_dev)\n {\n+\tstruct rte_eth_devargs eth_da = { .nb_representor_ports = 0 };\n+\tchar name[RTE_ETH_NAME_MAX_LEN];\n+\tint i, retval;\n+\n \tif (!ice_dcf_cap_selected(pci_dev->device.devargs))\n \t\treturn 1;\n \n-\treturn rte_eth_dev_pci_generic_probe(pci_dev,\n+\tif (pci_dev->device.devargs) {\n+\t\tretval = rte_eth_devargs_parse(pci_dev->device.devargs->args,\n+\t\t\t\t\t ð_da);\n+\t\tif (retval)\n+\t\t\treturn retval;\n+\t}\n+\n+\tretval = rte_eth_dev_pci_generic_probe(pci_dev,\n \t\t\t\t\t sizeof(struct ice_dcf_adapter),\n \t\t\t\t\t ice_dcf_dev_init);\n+\tif (retval)\n+\t\treturn retval;\n+\n+\t/* probe VF representor ports */\n+\tstruct rte_eth_dev *dcf_ethdev =\n+\t\trte_eth_dev_allocated(pci_dev->device.name);\n+\n+\tif (dcf_ethdev == NULL) {\n+\t\tPMD_DRV_LOG(ERR, \"failed to allocate ethdev.\\n\");\n+\t\treturn -ENODEV;\n+\t}\n+\n+\tfor (i = 0; i < eth_da.nb_representor_ports; i++) {\n+\t\tif (eth_da.representor_ports[i] == 0) {\n+\t\t\tPMD_DRV_LOG(ERR, \"vf 0 can't be a vf representor.\\n\");\n+\t\t\tcontinue;\n+\t\t}\n+\n+\t\tstruct ice_dcf_vf_representor representor = {\n+\t\t\t.vf_id = eth_da.representor_ports[i],\n+\t\t\t.switch_domain_id = 0,\n+\t\t\t.adapter = (struct ice_dcf_adapter *)\n+\t\t\t\t dcf_ethdev->data->dev_private\n+\t\t};\n+\n+\t\tsnprintf(name, sizeof(name), \"net_%s_representor_%d\",\n+\t\t\tpci_dev->device.name, eth_da.representor_ports[i]);\n+\n+\t\tretval = rte_eth_dev_create(&pci_dev->device, name,\n+\t\t\t\tsizeof(struct ice_dcf_vf_representor),\n+\t\t\t\tNULL, NULL, ice_dcf_vf_representor_init,\n+\t\t\t\t&representor);\n+\n+\t\tif (retval)\n+\t\t\tPMD_DRV_LOG(ERR,\n+\t\t\t\"failed to create dcf vf representor %s.\\n\",\n+\t\t\tname);\n+\t}\n+\n+\treturn 0;\n }\n \n static int eth_ice_dcf_pci_remove(struct rte_pci_device *pci_dev)\n {\n-\treturn rte_eth_dev_pci_generic_remove(pci_dev, ice_dcf_dev_uninit);\n+\tstruct rte_eth_dev *ethdev;\n+\n+\tethdev = rte_eth_dev_allocated(pci_dev->device.name);\n+\tif (!ethdev)\n+\t\treturn 0;\n+\n+\tif (ethdev->data->dev_flags & RTE_ETH_DEV_REPRESENTOR)\n+\t\treturn rte_eth_dev_pci_generic_remove(pci_dev,\n+\t\t\t\t\t\tice_dcf_dev_uninit);\n+\telse\n+\t\treturn rte_eth_dev_pci_generic_remove(pci_dev,\n+\t\t\t\t\t\tice_dcf_vf_representor_uninit);\n }\n \n static const struct rte_pci_id pci_id_ice_dcf_map[] = {\ndiff --git a/drivers/net/ice/ice_dcf_ethdev.h b/drivers/net/ice/ice_dcf_ethdev.h\nindex b54528bea..bf6e6982f 100644\n--- a/drivers/net/ice/ice_dcf_ethdev.h\n+++ b/drivers/net/ice/ice_dcf_ethdev.h\n@@ -22,9 +22,20 @@ struct ice_dcf_adapter {\n \tstruct ice_dcf_hw real_hw;\n };\n \n+/**\n+ * Struct to store private data for each VF representor instance\n+ */\n+struct ice_dcf_vf_representor {\n+\tstruct ice_dcf_adapter *adapter;\n+\tuint16_t switch_domain_id;\n+\tuint16_t vf_id;\n+};\n+\n void ice_dcf_handle_pf_event_msg(struct ice_dcf_hw *dcf_hw,\n \t\t\t\t uint8_t *msg, uint16_t msglen);\n int ice_dcf_init_parent_adapter(struct rte_eth_dev *eth_dev);\n void ice_dcf_uninit_parent_adapter(struct rte_eth_dev *eth_dev);\n+int ice_dcf_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params);\n+int ice_dcf_vf_representor_uninit(struct rte_eth_dev *ethdev);\n \n #endif /* _ICE_DCF_ETHDEV_H_ */\ndiff --git a/drivers/net/ice/ice_dcf_vf_representor.c b/drivers/net/ice/ice_dcf_vf_representor.c\nnew file mode 100644\nindex 000000000..ceb54ab15\n--- /dev/null\n+++ b/drivers/net/ice/ice_dcf_vf_representor.c\n@@ -0,0 +1,245 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2020 Intel Corporation\n+ */\n+\n+#include <errno.h>\n+#include <stdbool.h>\n+#include <sys/types.h>\n+#include <sys/ioctl.h>\n+#include <unistd.h>\n+\n+#include <rte_interrupts.h>\n+#include <rte_debug.h>\n+#include <rte_pci.h>\n+#include <rte_atomic.h>\n+#include <rte_eal.h>\n+#include <rte_ether.h>\n+#include <rte_ethdev_pci.h>\n+#include <rte_kvargs.h>\n+#include <rte_malloc.h>\n+#include <rte_memzone.h>\n+#include <rte_dev.h>\n+\n+#include <iavf_devids.h>\n+\n+#include \"ice_generic_flow.h\"\n+#include \"ice_dcf_ethdev.h\"\n+#include \"ice_rxtx.h\"\n+\n+static uint16_t\n+ice_dcf_representor_rx_burst(__rte_unused void *rxq,\n+\t\t\t __rte_unused struct rte_mbuf **rx_pkts,\n+\t\t\t __rte_unused uint16_t nb_pkts)\n+{\n+\treturn 0;\n+}\n+\n+static uint16_t\n+ice_dcf_representor_tx_burst(__rte_unused void *txq,\n+\t\t\t __rte_unused struct rte_mbuf **tx_pkts,\n+\t\t\t __rte_unused uint16_t nb_pkts)\n+{\n+\treturn 0;\n+}\n+\n+static int\n+ice_dcf_representor_dev_configure(__rte_unused struct rte_eth_dev *dev)\n+{\n+\treturn 0;\n+}\n+\n+static int\n+ice_dcf_representor_dev_start(struct rte_eth_dev *dev)\n+{\n+\tdev->data->dev_link.link_status = ETH_LINK_UP;\n+\n+\treturn 0;\n+}\n+\n+static void\n+ice_dcf_representor_dev_stop(struct rte_eth_dev *dev)\n+{\n+\tdev->data->dev_link.link_status = ETH_LINK_DOWN;\n+}\n+\n+static int\n+ice_dcf_representor_rx_queue_setup(__rte_unused struct rte_eth_dev *dev,\n+\t\t\t__rte_unused uint16_t rx_queue_id,\n+\t\t\t__rte_unused uint16_t nb_rx_desc,\n+\t\t\t__rte_unused unsigned int socket_id,\n+\t\t\t__rte_unused const struct rte_eth_rxconf *rx_conf,\n+\t\t\t__rte_unused struct rte_mempool *mb_pool)\n+{\n+\treturn 0;\n+}\n+\n+static int\n+ice_dcf_representor_tx_queue_setup(__rte_unused struct rte_eth_dev *dev,\n+\t\t\t__rte_unused uint16_t rx_queue_id,\n+\t\t\t__rte_unused uint16_t nb_rx_desc,\n+\t\t\t__rte_unused unsigned int socket_id,\n+\t\t\t__rte_unused const struct rte_eth_txconf *tx_conf)\n+{\n+\treturn 0;\n+}\n+\n+static int\n+ice_dcf_representor_promiscuous_enable(__rte_unused struct rte_eth_dev *ethdev)\n+{\n+\treturn 0;\n+}\n+\n+static int\n+ice_dcf_representor_promiscuous_disable(__rte_unused struct rte_eth_dev *ethdev)\n+{\n+\treturn 0;\n+}\n+\n+static int\n+ice_dcf_representor_link_update(__rte_unused struct rte_eth_dev *ethdev,\n+\t\t\t\t__rte_unused int wait_to_complete)\n+{\n+\treturn 0;\n+}\n+\n+static int\n+ice_dcf_representor_dev_info_get(struct rte_eth_dev *dev,\n+\t\t\t\t struct rte_eth_dev_info *dev_info)\n+{\n+\tstruct ice_dcf_vf_representor *representor = dev->data->dev_private;\n+\tstruct ice_dcf_hw *hw = &representor->adapter->real_hw;\n+\n+\tdev_info->device = dev->device;\n+\tdev_info->max_mac_addrs = 1;\n+\tdev_info->max_rx_queues = hw->vsi_res->num_queue_pairs;\n+\tdev_info->max_tx_queues = hw->vsi_res->num_queue_pairs;\n+\tdev_info->min_rx_bufsize = ICE_BUF_SIZE_MIN;\n+\tdev_info->max_rx_pktlen = ICE_FRAME_SIZE_MAX;\n+\tdev_info->hash_key_size = hw->vf_res->rss_key_size;\n+\tdev_info->reta_size = hw->vf_res->rss_lut_size;\n+\tdev_info->flow_type_rss_offloads = ICE_RSS_OFFLOAD_ALL;\n+\n+\tdev_info->rx_offload_capa =\n+\t\tDEV_RX_OFFLOAD_VLAN_STRIP |\n+\t\tDEV_RX_OFFLOAD_IPV4_CKSUM |\n+\t\tDEV_RX_OFFLOAD_UDP_CKSUM |\n+\t\tDEV_RX_OFFLOAD_TCP_CKSUM |\n+\t\tDEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |\n+\t\tDEV_RX_OFFLOAD_SCATTER |\n+\t\tDEV_RX_OFFLOAD_JUMBO_FRAME |\n+\t\tDEV_RX_OFFLOAD_VLAN_FILTER |\n+\t\tDEV_RX_OFFLOAD_RSS_HASH;\n+\tdev_info->tx_offload_capa =\n+\t\tDEV_TX_OFFLOAD_VLAN_INSERT |\n+\t\tDEV_TX_OFFLOAD_IPV4_CKSUM |\n+\t\tDEV_TX_OFFLOAD_UDP_CKSUM |\n+\t\tDEV_TX_OFFLOAD_TCP_CKSUM |\n+\t\tDEV_TX_OFFLOAD_SCTP_CKSUM |\n+\t\tDEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |\n+\t\tDEV_TX_OFFLOAD_TCP_TSO |\n+\t\tDEV_TX_OFFLOAD_VXLAN_TNL_TSO |\n+\t\tDEV_TX_OFFLOAD_GRE_TNL_TSO |\n+\t\tDEV_TX_OFFLOAD_IPIP_TNL_TSO |\n+\t\tDEV_TX_OFFLOAD_GENEVE_TNL_TSO |\n+\t\tDEV_TX_OFFLOAD_MULTI_SEGS;\n+\n+\tdev_info->default_rxconf = (struct rte_eth_rxconf) {\n+\t\t.rx_thresh = {\n+\t\t\t.pthresh = ICE_DEFAULT_RX_PTHRESH,\n+\t\t\t.hthresh = ICE_DEFAULT_RX_HTHRESH,\n+\t\t\t.wthresh = ICE_DEFAULT_RX_WTHRESH,\n+\t\t},\n+\t\t.rx_free_thresh = ICE_DEFAULT_RX_FREE_THRESH,\n+\t\t.rx_drop_en = 0,\n+\t\t.offloads = 0,\n+\t};\n+\n+\tdev_info->default_txconf = (struct rte_eth_txconf) {\n+\t\t.tx_thresh = {\n+\t\t\t.pthresh = ICE_DEFAULT_TX_PTHRESH,\n+\t\t\t.hthresh = ICE_DEFAULT_TX_HTHRESH,\n+\t\t\t.wthresh = ICE_DEFAULT_TX_WTHRESH,\n+\t\t},\n+\t\t.tx_free_thresh = ICE_DEFAULT_TX_FREE_THRESH,\n+\t\t.tx_rs_thresh = ICE_DEFAULT_TX_RSBIT_THRESH,\n+\t\t.offloads = 0,\n+\t};\n+\n+\tdev_info->rx_desc_lim = (struct rte_eth_desc_lim) {\n+\t\t.nb_max = ICE_MAX_RING_DESC,\n+\t\t.nb_min = ICE_MIN_RING_DESC,\n+\t\t.nb_align = ICE_ALIGN_RING_DESC,\n+\t};\n+\n+\tdev_info->tx_desc_lim = (struct rte_eth_desc_lim) {\n+\t\t.nb_max = ICE_MAX_RING_DESC,\n+\t\t.nb_min = ICE_MIN_RING_DESC,\n+\t\t.nb_align = ICE_ALIGN_RING_DESC,\n+\t};\n+\n+\tdev_info->switch_info.name =\n+\t\trepresentor->adapter->real_hw.eth_dev->device->name;\n+\tdev_info->switch_info.domain_id = representor->switch_domain_id;\n+\tdev_info->switch_info.port_id = representor->vf_id;\n+\n+\treturn 0;\n+}\n+\n+static const struct eth_dev_ops ice_dcf_representor_dev_ops = {\n+\t.dev_configure = ice_dcf_representor_dev_configure,\n+\t.dev_start = ice_dcf_representor_dev_start,\n+\t.dev_stop = ice_dcf_representor_dev_stop,\n+\t.dev_infos_get = ice_dcf_representor_dev_info_get,\n+\t.rx_queue_setup = ice_dcf_representor_rx_queue_setup,\n+\t.tx_queue_setup = ice_dcf_representor_tx_queue_setup,\n+\t.promiscuous_enable = ice_dcf_representor_promiscuous_enable,\n+\t.promiscuous_disable = ice_dcf_representor_promiscuous_disable,\n+\t.link_update = ice_dcf_representor_link_update,\n+};\n+\n+int\n+ice_dcf_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params)\n+{\n+\tstruct ice_dcf_vf_representor *representor = ethdev->data->dev_private;\n+\tstruct ice_dcf_hw *real_hw;\n+\n+\trepresentor->adapter =\n+\t\t((struct ice_dcf_vf_representor *)init_params)->adapter;\n+\trepresentor->switch_domain_id =\n+\t\t((struct ice_dcf_vf_representor *)\n+\t\t init_params)->switch_domain_id;\n+\trepresentor->vf_id =\n+\t\t((struct ice_dcf_vf_representor *)init_params)->vf_id;\n+\n+\treal_hw = &representor->adapter->real_hw;\n+\n+\tif (representor->vf_id >= real_hw->num_vfs)\n+\t\treturn -ENODEV;\n+\n+\tethdev->dev_ops = &ice_dcf_representor_dev_ops;\n+\n+\t/* No data-path, but need stub Rx/Tx functions to avoid crash\n+\t * when testing with the likes of testpmd.\n+\t */\n+\tethdev->rx_pkt_burst = ice_dcf_representor_rx_burst;\n+\tethdev->tx_pkt_burst = ice_dcf_representor_tx_burst;\n+\n+\tethdev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR;\n+\tethdev->data->representor_id = representor->vf_id;\n+\n+\tstruct rte_ether_addr mac_addr;\n+\n+\tmemset(&mac_addr, 0, sizeof(mac_addr));\n+\tethdev->data->mac_addrs = &mac_addr;\n+\n+\treturn 0;\n+}\n+\n+int\n+ice_dcf_vf_representor_uninit(struct rte_eth_dev *ethdev)\n+{\n+\tethdev->data->mac_addrs = NULL;\n+\n+\treturn 0;\n+}\n+\n", "prefixes": [ "1/2" ] }{ "id": 76291, "url": "