Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/3885/?format=api
https://patches.dpdk.org/api/patches/3885/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1425580845-13462-1-git-send-email-thomas.monjalon@6wind.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": "<1425580845-13462-1-git-send-email-thomas.monjalon@6wind.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1425580845-13462-1-git-send-email-thomas.monjalon@6wind.com", "date": "2015-03-05T18:40:45", "name": "[dpdk-dev] ethdev: remove useless parameter in init functions", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "5253a567cbc6083d411c6cbc0eec938706af0794", "submitter": { "id": 1, "url": "https://patches.dpdk.org/api/people/1/?format=api", "name": "Thomas Monjalon", "email": "thomas.monjalon@6wind.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1425580845-13462-1-git-send-email-thomas.monjalon@6wind.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/3885/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/3885/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 74AD65A6A;\n\tThu, 5 Mar 2015 19:41:28 +0100 (CET)", "from mail-we0-f179.google.com (mail-we0-f179.google.com\n\t[74.125.82.179]) by dpdk.org (Postfix) with ESMTP id BEA85A6A\n\tfor <dev@dpdk.org>; Thu, 5 Mar 2015 19:41:26 +0100 (CET)", "by wevm14 with SMTP id m14so54798382wev.8\n\tfor <dev@dpdk.org>; Thu, 05 Mar 2015 10:41:26 -0800 (PST)", "from localhost.localdomain (136-92-190-109.dsl.ovh.fr.\n\t[109.190.92.136]) by mx.google.com with ESMTPSA id\n\tdq1sm9570325wib.20.2015.03.05.10.41.24 for <dev@dpdk.org>\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tThu, 05 Mar 2015 10:41:24 -0800 (PST)" ], "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:subject:date:message-id;\n\tbh=GkYrejXL+U+NsacqOBOZvp+2V+BIbj8+JKN3pgneJI4=;\n\tb=kqiiUmz2qQaWD6Cmdes+aoA2YkXxaJ2vpTDnUj42StfzQd/BZldEDGzNv6+wnNuG4O\n\tprhKC3z1E52k01sExqj+P8dLDi2nGFjkRl5fx7piZ8z1dNYAI1rWHIvspq3v0V6zK2OX\n\tECf9mczUTYeUJ3BI+QFaD9I3Db6KvGBojY5JhQCAieFB5w6+Goo6oP4BIzq50J3Rwhkt\n\taKhumvcsmISeBT9WDEegnM1OpGfJi3R6b8Z3ghZ+nmft/3Fc72yyOk5LnYf64K0X5CmA\n\tpvsiB/+MnlB0hYkAQfp3ri6ilOYoImNA9I2zZBDfynRtNlndrh+GQ06vwM3kbuYtH8e4\n\tVx0g==", "X-Gm-Message-State": "ALoCoQkAr3cqBgR4TrDZqsDVLR5ywvi8l1fie+KbltkDVSXBfQZQAM/DJdYxUnwSCiHMyZcZr3bv", "X-Received": "by 10.180.206.98 with SMTP id ln2mr67839607wic.94.1425580885503; \n\tThu, 05 Mar 2015 10:41:25 -0800 (PST)", "From": "Thomas Monjalon <thomas.monjalon@6wind.com>", "To": "dev@dpdk.org", "Date": "Thu, 5 Mar 2015 19:40:45 +0100", "Message-Id": "<1425580845-13462-1-git-send-email-thomas.monjalon@6wind.com>", "X-Mailer": "git-send-email 2.2.2", "Subject": "[dpdk-dev] [PATCH] ethdev: remove useless parameter in init\n\tfunctions", "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": "The pointer to struct eth_driver is not used and is already set\nin struct rte_eth_dev.\n\nIt's a small cleanup in PMD API which probably needs more\nattention to make clear what is a driver, a PCI driver, an\nethernet driver, etc.\n\nSigned-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>\n---\n lib/librte_ether/rte_ethdev.c | 4 ++--\n lib/librte_ether/rte_ethdev.h | 14 ++++----------\n lib/librte_pmd_e1000/em_ethdev.c | 3 +--\n lib/librte_pmd_e1000/igb_ethdev.c | 6 ++----\n lib/librte_pmd_enic/enic_ethdev.c | 4 +---\n lib/librte_pmd_fm10k/fm10k_ethdev.c | 3 +--\n lib/librte_pmd_i40e/i40e_ethdev.c | 7 ++-----\n lib/librte_pmd_i40e/i40e_ethdev_vf.c | 3 +--\n lib/librte_pmd_ixgbe/ixgbe_ethdev.c | 12 ++++--------\n lib/librte_pmd_virtio/virtio_ethdev.c | 6 ++----\n lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c | 6 ++----\n 11 files changed, 22 insertions(+), 46 deletions(-)", "diff": "diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c\nindex 6ea7a17..c5e1dec 100644\n--- a/lib/librte_ether/rte_ethdev.c\n+++ b/lib/librte_ether/rte_ethdev.c\n@@ -324,7 +324,7 @@ rte_eth_dev_init(struct rte_pci_driver *pci_drv,\n \teth_dev->data->mtu = ETHER_MTU;\n \n \t/* Invoke PMD device initialization function */\n-\tdiag = (*eth_drv->eth_dev_init)(eth_drv, eth_dev);\n+\tdiag = (*eth_drv->eth_dev_init)(eth_dev);\n \tif (diag == 0)\n \t\treturn (0);\n \n@@ -362,7 +362,7 @@ rte_eth_dev_uninit(struct rte_pci_device *pci_dev)\n \n \t/* Invoke PMD device uninit function */\n \tif (*eth_drv->eth_dev_uninit) {\n-\t\tret = (*eth_drv->eth_dev_uninit)(eth_drv, eth_dev);\n+\t\tret = (*eth_drv->eth_dev_uninit)(eth_dev);\n \t\tif (ret)\n \t\t\treturn ret;\n \t}\ndiff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h\nindex 8db3127..21aa359 100644\n--- a/lib/librte_ether/rte_ethdev.h\n+++ b/lib/librte_ether/rte_ethdev.h\n@@ -1609,9 +1609,6 @@ struct eth_driver;\n * Initialization function of an Ethernet driver invoked for each matching\n * Ethernet PCI device detected during the PCI probing phase.\n *\n- * @param eth_drv\n- * The pointer to the [matching] Ethernet driver structure supplied by\n- * the PMD when it registered itself.\n * @param eth_dev\n * The *eth_dev* pointer is the address of the *rte_eth_dev* structure\n * associated with the matching device and which have been [automatically]\n@@ -1622,6 +1619,8 @@ struct eth_driver;\n * - *pci_dev*: Holds the pointers to the *rte_pci_device* structure which\n * contains the generic PCI information of the matching device.\n *\n+ * - *driver*: Holds the pointer to the *eth_driver* structure.\n+ *\n * - *dev_private*: Holds a pointer to the device private data structure.\n *\n * - *mtu*: Contains the default Ethernet maximum frame length (1500).\n@@ -1635,17 +1634,13 @@ struct eth_driver;\n * of the *eth_dev* structure.\n * - <0: Error code of the device initialization failure.\n */\n-typedef int (*eth_dev_init_t)(struct eth_driver *eth_drv,\n-\t\t\t struct rte_eth_dev *eth_dev);\n+typedef int (*eth_dev_init_t)(struct rte_eth_dev *eth_dev);\n \n /**\n * @internal\n * Finalization function of an Ethernet driver invoked for each matching\n * Ethernet PCI device detected during the PCI closing phase.\n *\n- * @param eth_drv\n- * The pointer to the [matching] Ethernet driver structure supplied by\n- * the PMD when it registered itself.\n * @param eth_dev\n * The *eth_dev* pointer is the address of the *rte_eth_dev* structure\n * associated with the matching device and which have been [automatically]\n@@ -1656,8 +1651,7 @@ typedef int (*eth_dev_init_t)(struct eth_driver *eth_drv,\n * of the *eth_dev* structure.\n * - <0: Error code of the device initialization failure.\n */\n-typedef int (*eth_dev_uninit_t)(const struct eth_driver *eth_drv,\n-\t\t\t\t struct rte_eth_dev *eth_dev);\n+typedef int (*eth_dev_uninit_t)(struct rte_eth_dev *eth_dev);\n \n /**\n * @internal\ndiff --git a/lib/librte_pmd_e1000/em_ethdev.c b/lib/librte_pmd_e1000/em_ethdev.c\nindex 3f2897e..332c2e9 100644\n--- a/lib/librte_pmd_e1000/em_ethdev.c\n+++ b/lib/librte_pmd_e1000/em_ethdev.c\n@@ -217,8 +217,7 @@ rte_em_dev_atomic_write_link_status(struct rte_eth_dev *dev,\n }\n \n static int\n-eth_em_dev_init(__attribute__((unused)) struct eth_driver *eth_drv,\n-\t\tstruct rte_eth_dev *eth_dev)\n+eth_em_dev_init(struct rte_eth_dev *eth_dev)\n {\n \tstruct rte_pci_device *pci_dev;\n \tstruct e1000_hw *hw =\ndiff --git a/lib/librte_pmd_e1000/igb_ethdev.c b/lib/librte_pmd_e1000/igb_ethdev.c\nindex 504ae74..4aaa6ec 100644\n--- a/lib/librte_pmd_e1000/igb_ethdev.c\n+++ b/lib/librte_pmd_e1000/igb_ethdev.c\n@@ -453,8 +453,7 @@ igb_reset_swfw_lock(struct e1000_hw *hw)\n }\n \n static int\n-eth_igb_dev_init(__attribute__((unused)) struct eth_driver *eth_drv,\n-\t\t struct rte_eth_dev *eth_dev)\n+eth_igb_dev_init(struct rte_eth_dev *eth_dev)\n {\n \tint error = 0;\n \tstruct rte_pci_device *pci_dev;\n@@ -614,8 +613,7 @@ err_late:\n * Virtual Function device init\n */\n static int\n-eth_igbvf_dev_init(__attribute__((unused)) struct eth_driver *eth_drv,\n-\t\tstruct rte_eth_dev *eth_dev)\n+eth_igbvf_dev_init(struct rte_eth_dev *eth_dev)\n {\n \tstruct rte_pci_device *pci_dev;\n \tstruct e1000_hw *hw =\ndiff --git a/lib/librte_pmd_enic/enic_ethdev.c b/lib/librte_pmd_enic/enic_ethdev.c\nindex 9cb6666..4950ede 100644\n--- a/lib/librte_pmd_enic/enic_ethdev.c\n+++ b/lib/librte_pmd_enic/enic_ethdev.c\n@@ -555,9 +555,7 @@ struct enic *enicpmd_list_head = NULL;\n /* Initialize the driver\n * It returns 0 on success.\n */\n-static int eth_enicpmd_dev_init(\n-\t__attribute__((unused))struct eth_driver *eth_drv,\n-\tstruct rte_eth_dev *eth_dev)\n+static int eth_enicpmd_dev_init(struct rte_eth_dev *eth_dev)\n {\n \tstruct rte_pci_device *pdev;\n \tstruct rte_pci_addr *addr;\ndiff --git a/lib/librte_pmd_fm10k/fm10k_ethdev.c b/lib/librte_pmd_fm10k/fm10k_ethdev.c\nindex 07ea1e7..62c4a39 100644\n--- a/lib/librte_pmd_fm10k/fm10k_ethdev.c\n+++ b/lib/librte_pmd_fm10k/fm10k_ethdev.c\n@@ -1668,8 +1668,7 @@ static struct eth_dev_ops fm10k_eth_dev_ops = {\n };\n \n static int\n-eth_fm10k_dev_init(__rte_unused struct eth_driver *eth_drv,\n-\tstruct rte_eth_dev *dev)\n+eth_fm10k_dev_init(struct rte_eth_dev *dev)\n {\n \tstruct fm10k_hw *hw = FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n \tint diag;\ndiff --git a/lib/librte_pmd_i40e/i40e_ethdev.c b/lib/librte_pmd_i40e/i40e_ethdev.c\nindex 5e502b6..6888072 100644\n--- a/lib/librte_pmd_i40e/i40e_ethdev.c\n+++ b/lib/librte_pmd_i40e/i40e_ethdev.c\n@@ -106,9 +106,7 @@\n \t(1UL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER) | \\\n \t(1UL << RTE_ETH_FLOW_L2_PAYLOAD))\n \n-static int eth_i40e_dev_init(\\\n-\t\t\t__attribute__((unused)) struct eth_driver *eth_drv,\n-\t\t\tstruct rte_eth_dev *eth_dev);\n+static int eth_i40e_dev_init(struct rte_eth_dev *eth_dev);\n static int i40e_dev_configure(struct rte_eth_dev *dev);\n static int i40e_dev_start(struct rte_eth_dev *dev);\n static void i40e_dev_stop(struct rte_eth_dev *dev);\n@@ -364,8 +362,7 @@ static inline void i40e_flex_payload_reg_init(struct i40e_hw *hw)\n }\n \n static int\n-eth_i40e_dev_init(__rte_unused struct eth_driver *eth_drv,\n- struct rte_eth_dev *dev)\n+eth_i40e_dev_init(struct rte_eth_dev *dev)\n {\n \tstruct rte_pci_device *pci_dev;\n \tstruct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);\ndiff --git a/lib/librte_pmd_i40e/i40e_ethdev_vf.c b/lib/librte_pmd_i40e/i40e_ethdev_vf.c\nindex f031c19..70eefff 100644\n--- a/lib/librte_pmd_i40e/i40e_ethdev_vf.c\n+++ b/lib/librte_pmd_i40e/i40e_ethdev_vf.c\n@@ -1149,8 +1149,7 @@ err:\n }\n \n static int\n-i40evf_dev_init(__rte_unused struct eth_driver *eth_drv,\n-\t\tstruct rte_eth_dev *eth_dev)\n+i40evf_dev_init(struct rte_eth_dev *eth_dev)\n {\n \tstruct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(\\\n \t\t\teth_dev->data->dev_private);\ndiff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c\nindex 9bdc046..6599ddb 100644\n--- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c\n+++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c\n@@ -117,8 +117,7 @@\n \n #define IXGBE_QUEUE_STAT_COUNTERS (sizeof(hw_stats->qprc) / sizeof(hw_stats->qprc[0]))\n \n-static int eth_ixgbe_dev_init(struct eth_driver *eth_drv,\n-\t\tstruct rte_eth_dev *eth_dev);\n+static int eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev);\n static int ixgbe_dev_configure(struct rte_eth_dev *dev);\n static int ixgbe_dev_start(struct rte_eth_dev *dev);\n static void ixgbe_dev_stop(struct rte_eth_dev *dev);\n@@ -184,8 +183,7 @@ static void ixgbe_remove_rar(struct rte_eth_dev *dev, uint32_t index);\n static void ixgbe_dcb_init(struct ixgbe_hw *hw,struct ixgbe_dcb_config *dcb_config);\n \n /* For Virtual Function support */\n-static int eth_ixgbevf_dev_init(struct eth_driver *eth_drv,\n-\t\tstruct rte_eth_dev *eth_dev);\n+static int eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev);\n static int ixgbevf_dev_configure(struct rte_eth_dev *dev);\n static int ixgbevf_dev_start(struct rte_eth_dev *dev);\n static void ixgbevf_dev_stop(struct rte_eth_dev *dev);\n@@ -718,8 +716,7 @@ ixgbe_swfw_lock_reset(struct ixgbe_hw *hw)\n * It returns 0 on success.\n */\n static int\n-eth_ixgbe_dev_init(__attribute__((unused)) struct eth_driver *eth_drv,\n-\t\t struct rte_eth_dev *eth_dev)\n+eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev)\n {\n \tstruct rte_pci_device *pci_dev;\n \tstruct ixgbe_hw *hw =\n@@ -967,8 +964,7 @@ generate_random_mac_addr(struct ether_addr *mac_addr)\n * Virtual Function device init\n */\n static int\n-eth_ixgbevf_dev_init(__attribute__((unused)) struct eth_driver *eth_drv,\n-\t\t struct rte_eth_dev *eth_dev)\n+eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev)\n {\n \tint diag;\n \tuint32_t tc, tcs;\ndiff --git a/lib/librte_pmd_virtio/virtio_ethdev.c b/lib/librte_pmd_virtio/virtio_ethdev.c\nindex d239083..12158e7 100644\n--- a/lib/librte_pmd_virtio/virtio_ethdev.c\n+++ b/lib/librte_pmd_virtio/virtio_ethdev.c\n@@ -62,8 +62,7 @@\n #include \"virtqueue.h\"\n \n \n-static int eth_virtio_dev_init(struct eth_driver *eth_drv,\n-\t\tstruct rte_eth_dev *eth_dev);\n+static int eth_virtio_dev_init(struct rte_eth_dev *eth_dev);\n static int virtio_dev_configure(struct rte_eth_dev *dev);\n static int virtio_dev_start(struct rte_eth_dev *dev);\n static void virtio_dev_stop(struct rte_eth_dev *dev);\n@@ -1103,8 +1102,7 @@ virtio_interrupt_handler(__rte_unused struct rte_intr_handle *handle,\n * It returns 0 on success.\n */\n static int\n-eth_virtio_dev_init(__rte_unused struct eth_driver *eth_drv,\n-\t\tstruct rte_eth_dev *eth_dev)\n+eth_virtio_dev_init(struct rte_eth_dev *eth_dev)\n {\n \tstruct virtio_hw *hw = eth_dev->data->dev_private;\n \tstruct virtio_net_config *config;\ndiff --git a/lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c b/lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c\nindex 6068c60..a2a2aaa 100644\n--- a/lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c\n+++ b/lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c\n@@ -70,8 +70,7 @@\n \n #define PROCESS_SYS_EVENTS 0\n \n-static int eth_vmxnet3_dev_init(struct eth_driver *eth_drv,\n-\t\tstruct rte_eth_dev *eth_dev);\n+static int eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev);\n static int vmxnet3_dev_configure(struct rte_eth_dev *dev);\n static int vmxnet3_dev_start(struct rte_eth_dev *dev);\n static void vmxnet3_dev_stop(struct rte_eth_dev *dev);\n@@ -182,8 +181,7 @@ vmxnet3_disable_intr(struct vmxnet3_hw *hw)\n * It returns 0 on success.\n */\n static int\n-eth_vmxnet3_dev_init(__attribute__((unused)) struct eth_driver *eth_drv,\n-\t\t struct rte_eth_dev *eth_dev)\n+eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)\n {\n \tstruct rte_pci_device *pci_dev;\n \tstruct vmxnet3_hw *hw = eth_dev->data->dev_private;\n", "prefixes": [ "dpdk-dev" ] }{ "id": 3885, "url": "