Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/21034/?format=api
https://patches.dpdk.org/api/patches/21034/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1488414008-162839-10-git-send-email-allain.legacy@windriver.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": "<1488414008-162839-10-git-send-email-allain.legacy@windriver.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1488414008-162839-10-git-send-email-allain.legacy@windriver.com", "date": "2017-03-02T00:20:01", "name": "[dpdk-dev,v3,09/16] net/avp: device configuration", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "b19a4eab93ba2be71e09d50fbddd173923ada3c7", "submitter": { "id": 679, "url": "https://patches.dpdk.org/api/people/679/?format=api", "name": "Allain Legacy", "email": "allain.legacy@windriver.com" }, "delegate": { "id": 319, "url": "https://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1488414008-162839-10-git-send-email-allain.legacy@windriver.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/21034/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/21034/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 480EAF954;\n\tThu, 2 Mar 2017 01:21:44 +0100 (CET)", "from mail.windriver.com (mail.windriver.com [147.11.1.11])\n\tby dpdk.org (Postfix) with ESMTP id A2B7F2B9D\n\tfor <dev@dpdk.org>; Thu, 2 Mar 2017 01:20:39 +0100 (CET)", "from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com\n\t[147.11.189.40])\n\tby mail.windriver.com (8.15.2/8.15.1) with ESMTPS id v220KXdd016378\n\t(version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL);\n\tWed, 1 Mar 2017 16:20:33 -0800 (PST)", "from yow-cgts4-lx.wrs.com (128.224.145.137) by\n\tALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server\n\t(TLS) id 14.3.294.0; Wed, 1 Mar 2017 16:20:32 -0800" ], "From": "Allain Legacy <allain.legacy@windriver.com>", "To": "<ferruh.yigit@intel.com>", "CC": "<ian.jolliffe@windriver.com>, <jerin.jacob@caviumnetworks.com>,\n\t<stephen@networkplumber.org>, <thomas.monjalon@6wind.com>, <dev@dpdk.org>", "Date": "Wed, 1 Mar 2017 19:20:01 -0500", "Message-ID": "<1488414008-162839-10-git-send-email-allain.legacy@windriver.com>", "X-Mailer": "git-send-email 1.8.3.1", "In-Reply-To": "<1488414008-162839-1-git-send-email-allain.legacy@windriver.com>", "References": "<1488136143-116389-1-git-send-email-allain.legacy@windriver.com>\n\t<1488414008-162839-1-git-send-email-allain.legacy@windriver.com>", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Originating-IP": "[128.224.145.137]", "Subject": "[dpdk-dev] [PATCH v3 09/16] net/avp: device configuration", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <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": "Adds support for \"dev_configure\" operations to allow an application to\nconfigure the device.\n\nSigned-off-by: Allain Legacy <allain.legacy@windriver.com>\nSigned-off-by: Matt Peters <matt.peters@windriver.com>\n---\n drivers/net/avp/avp_ethdev.c | 131 +++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 131 insertions(+)", "diff": "diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c\nindex 467cec8..e9c67ce 100644\n--- a/drivers/net/avp/avp_ethdev.c\n+++ b/drivers/net/avp/avp_ethdev.c\n@@ -67,6 +67,12 @@ static int avp_dev_create(struct rte_pci_device *pci_dev,\n static int eth_avp_dev_init(struct rte_eth_dev *eth_dev);\n static int eth_avp_dev_uninit(struct rte_eth_dev *eth_dev);\n \n+static int avp_dev_configure(struct rte_eth_dev *dev);\n+static void avp_dev_info_get(struct rte_eth_dev *dev,\n+\t\t\t struct rte_eth_dev_info *dev_info);\n+static void avp_vlan_offload_set(struct rte_eth_dev *dev, int mask);\n+static int avp_dev_link_update(struct rte_eth_dev *dev,\n+\t\t\t __rte_unused int wait_to_complete);\n \n #define AVP_DEV_TO_PCI(eth_dev) RTE_DEV_TO_PCI((eth_dev)->device)\n \n@@ -105,6 +111,15 @@ static int avp_dev_create(struct rte_pci_device *pci_dev,\n \t},\n };\n \n+/*\n+ * dev_ops for avp, bare necessities for basic operation\n+ */\n+static const struct eth_dev_ops avp_eth_dev_ops = {\n+\t.dev_configure = avp_dev_configure,\n+\t.dev_infos_get = avp_dev_info_get,\n+\t.vlan_offload_set = avp_vlan_offload_set,\n+\t.link_update = avp_dev_link_update,\n+};\n \n /**@{ AVP device flags */\n #define AVP_F_PROMISC (1 << 1)\n@@ -870,6 +885,7 @@ struct avp_queue {\n \tint ret;\n \n \tpci_dev = AVP_DEV_TO_PCI(eth_dev);\n+\teth_dev->dev_ops = &avp_eth_dev_ops;\n \n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY) {\n \t\t/*\n@@ -958,6 +974,121 @@ struct avp_queue {\n };\n \n \n+static int\n+avp_dev_configure(struct rte_eth_dev *eth_dev)\n+{\n+\tstruct rte_pci_device *pci_dev = AVP_DEV_TO_PCI(eth_dev);\n+\tstruct avp_dev *avp = AVP_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);\n+\tstruct rte_avp_device_info *host_info;\n+\tstruct rte_avp_device_config config;\n+\tint mask = 0;\n+\tvoid *addr;\n+\tint ret;\n+\n+\trte_spinlock_lock(&avp->lock);\n+\tif (avp->flags & AVP_F_DETACHED) {\n+\t\tPMD_DRV_LOG(ERR, \"Operation not supported during VM live migration\\n\");\n+\t\tret = -ENOTSUP;\n+\t\tgoto unlock;\n+\t}\n+\n+\taddr = pci_dev->mem_resource[RTE_AVP_PCI_DEVICE_BAR].addr;\n+\thost_info = (struct rte_avp_device_info *)addr;\n+\n+\t/* Setup required number of queues */\n+\t_avp_set_queue_counts(eth_dev);\n+\n+\tmask = (ETH_VLAN_STRIP_MASK |\n+\t\tETH_VLAN_FILTER_MASK |\n+\t\tETH_VLAN_EXTEND_MASK);\n+\tavp_vlan_offload_set(eth_dev, mask);\n+\n+\t/* update device config */\n+\tmemset(&config, 0, sizeof(config));\n+\tconfig.device_id = host_info->device_id;\n+\tconfig.driver_type = RTE_AVP_DRIVER_TYPE_DPDK;\n+\tconfig.driver_version = AVP_DPDK_DRIVER_VERSION;\n+\tconfig.features = avp->features;\n+\tconfig.num_tx_queues = avp->num_tx_queues;\n+\tconfig.num_rx_queues = avp->num_rx_queues;\n+\n+\tret = avp_dev_ctrl_set_config(eth_dev, &config);\n+\tif (ret < 0) {\n+\t\tPMD_DRV_LOG(ERR, \"Config request failed by host, ret=%d\\n\",\n+\t\t\t ret);\n+\t\tgoto unlock;\n+\t}\n+\n+\tavp->flags |= AVP_F_CONFIGURED;\n+\tret = 0;\n+\n+unlock:\n+\trte_spinlock_unlock(&avp->lock);\n+\treturn ret;\n+}\n+\n+\n+static int\n+avp_dev_link_update(struct rte_eth_dev *eth_dev,\n+\t\t\t\t\t__rte_unused int wait_to_complete)\n+{\n+\tstruct avp_dev *avp = AVP_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);\n+\tstruct rte_eth_link *link = ð_dev->data->dev_link;\n+\n+\tlink->link_speed = ETH_SPEED_NUM_10G;\n+\tlink->link_duplex = ETH_LINK_FULL_DUPLEX;\n+\tlink->link_status = !!(avp->flags & AVP_F_LINKUP);\n+\n+\treturn -1;\n+}\n+\n+\n+static void\n+avp_dev_info_get(struct rte_eth_dev *eth_dev,\n+\t\t struct rte_eth_dev_info *dev_info)\n+{\n+\tstruct avp_dev *avp = AVP_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);\n+\n+\tdev_info->driver_name = \"rte_avp_pmd\";\n+\tdev_info->pci_dev = RTE_DEV_TO_PCI(eth_dev->device);\n+\tdev_info->max_rx_queues = avp->max_rx_queues;\n+\tdev_info->max_tx_queues = avp->max_tx_queues;\n+\tdev_info->min_rx_bufsize = AVP_MIN_RX_BUFSIZE;\n+\tdev_info->max_rx_pktlen = avp->max_rx_pkt_len;\n+\tdev_info->max_mac_addrs = AVP_MAX_MAC_ADDRS;\n+\tif (avp->host_features & RTE_AVP_FEATURE_VLAN_OFFLOAD) {\n+\t\tdev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP;\n+\t\tdev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT;\n+\t}\n+}\n+\n+static void\n+avp_vlan_offload_set(struct rte_eth_dev *eth_dev, int mask)\n+{\n+\tstruct avp_dev *avp = AVP_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);\n+\n+\tif (mask & ETH_VLAN_STRIP_MASK) {\n+\t\tif (avp->host_features & RTE_AVP_FEATURE_VLAN_OFFLOAD) {\n+\t\t\tif (eth_dev->data->dev_conf.rxmode.hw_vlan_strip)\n+\t\t\t\tavp->features |= RTE_AVP_FEATURE_VLAN_OFFLOAD;\n+\t\t\telse\n+\t\t\t\tavp->features &= ~RTE_AVP_FEATURE_VLAN_OFFLOAD;\n+\t\t} else {\n+\t\t\tPMD_DRV_LOG(ERR, \"VLAN strip offload not supported\\n\");\n+\t\t}\n+\t}\n+\n+\tif (mask & ETH_VLAN_FILTER_MASK) {\n+\t\tif (eth_dev->data->dev_conf.rxmode.hw_vlan_filter)\n+\t\t\tPMD_DRV_LOG(ERR, \"VLAN filter offload not supported\\n\");\n+\t}\n+\n+\tif (mask & ETH_VLAN_EXTEND_MASK) {\n+\t\tif (eth_dev->data->dev_conf.rxmode.hw_vlan_extend)\n+\t\t\tPMD_DRV_LOG(ERR, \"VLAN extend offload not supported\\n\");\n+\t}\n+}\n+\n \n RTE_PMD_REGISTER_PCI(rte_avp, rte_avp_pmd.pci_drv);\n RTE_PMD_REGISTER_PCI_TABLE(rte_avp, pci_id_avp_map);\n", "prefixes": [ "dpdk-dev", "v3", "09/16" ] }{ "id": 21034, "url": "