]> git.droids-corp.org - dpdk.git/commitdiff
ethdev: remove useless parameter in init functions
authorThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 5 Mar 2015 18:24:59 +0000 (19:24 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 9 Mar 2015 17:07:44 +0000 (18:07 +0100)
The pointer to struct eth_driver is not used and is already set
in struct rte_eth_dev.

It's a small cleanup in PMD API which probably needs more
attention to make clear what is a driver, a PCI driver, an
ethernet driver, etc.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
lib/librte_ether/rte_ethdev.c
lib/librte_ether/rte_ethdev.h
lib/librte_pmd_e1000/em_ethdev.c
lib/librte_pmd_e1000/igb_ethdev.c
lib/librte_pmd_enic/enic_ethdev.c
lib/librte_pmd_fm10k/fm10k_ethdev.c
lib/librte_pmd_i40e/i40e_ethdev.c
lib/librte_pmd_i40e/i40e_ethdev_vf.c
lib/librte_pmd_ixgbe/ixgbe_ethdev.c
lib/librte_pmd_virtio/virtio_ethdev.c
lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c

index 03e0af1cd5f83be5b3ec556d83fc08cb9e73fee0..833e2987ec8c825ade01ea85ed15a2321b6db8b6 100644 (file)
@@ -324,7 +324,7 @@ rte_eth_dev_init(struct rte_pci_driver *pci_drv,
        eth_dev->data->mtu = ETHER_MTU;
 
        /* Invoke PMD device initialization function */
-       diag = (*eth_drv->eth_dev_init)(eth_drv, eth_dev);
+       diag = (*eth_drv->eth_dev_init)(eth_dev);
        if (diag == 0)
                return (0);
 
@@ -362,7 +362,7 @@ rte_eth_dev_uninit(struct rte_pci_device *pci_dev)
 
        /* Invoke PMD device uninit function */
        if (*eth_drv->eth_dev_uninit) {
-               ret = (*eth_drv->eth_dev_uninit)(eth_drv, eth_dev);
+               ret = (*eth_drv->eth_dev_uninit)(eth_dev);
                if (ret)
                        return ret;
        }
index 8db31276a173288657241cea3f85140252b35a1c..21aa359abd9c5e4d880e5fc442418e7ffe934c6d 100644 (file)
@@ -1609,9 +1609,6 @@ struct eth_driver;
  * Initialization function of an Ethernet driver invoked for each matching
  * Ethernet PCI device detected during the PCI probing phase.
  *
- * @param eth_drv
- *   The pointer to the [matching] Ethernet driver structure supplied by
- *   the PMD when it registered itself.
  * @param eth_dev
  *   The *eth_dev* pointer is the address of the *rte_eth_dev* structure
  *   associated with the matching device and which have been [automatically]
@@ -1622,6 +1619,8 @@ struct eth_driver;
  *   - *pci_dev*: Holds the pointers to the *rte_pci_device* structure which
  *     contains the generic PCI information of the matching device.
  *
+ *   - *driver*: Holds the pointer to the *eth_driver* structure.
+ *
  *   - *dev_private*: Holds a pointer to the device private data structure.
  *
  *   - *mtu*: Contains the default Ethernet maximum frame length (1500).
@@ -1635,17 +1634,13 @@ struct eth_driver;
  *        of the *eth_dev* structure.
  *   - <0: Error code of the device initialization failure.
  */
-typedef int (*eth_dev_init_t)(struct eth_driver  *eth_drv,
-                             struct rte_eth_dev *eth_dev);
+typedef int (*eth_dev_init_t)(struct rte_eth_dev *eth_dev);
 
 /**
  * @internal
  * Finalization function of an Ethernet driver invoked for each matching
  * Ethernet PCI device detected during the PCI closing phase.
  *
- * @param eth_drv
- *   The pointer to the [matching] Ethernet driver structure supplied by
- *   the PMD when it registered itself.
  * @param eth_dev
  *   The *eth_dev* pointer is the address of the *rte_eth_dev* structure
  *   associated with the matching device and which have been [automatically]
@@ -1656,8 +1651,7 @@ typedef int (*eth_dev_init_t)(struct eth_driver  *eth_drv,
  *        of the *eth_dev* structure.
  *   - <0: Error code of the device initialization failure.
  */
-typedef int (*eth_dev_uninit_t)(const struct eth_driver  *eth_drv,
-                                 struct rte_eth_dev *eth_dev);
+typedef int (*eth_dev_uninit_t)(struct rte_eth_dev *eth_dev);
 
 /**
  * @internal
index 3f2897ee85d0b2123c2a266871f1f8510eae2faf..332c2e943b445467acc2a31a417b2a6e38c21661 100644 (file)
@@ -217,8 +217,7 @@ rte_em_dev_atomic_write_link_status(struct rte_eth_dev *dev,
 }
 
 static int
-eth_em_dev_init(__attribute__((unused)) struct eth_driver *eth_drv,
-               struct rte_eth_dev *eth_dev)
+eth_em_dev_init(struct rte_eth_dev *eth_dev)
 {
        struct rte_pci_device *pci_dev;
        struct e1000_hw *hw =
index 504ae74d2e1cbf9fd8bddacffcb4f3d5a0433451..4aaa6ecf486881305351946d382432870520f230 100644 (file)
@@ -453,8 +453,7 @@ igb_reset_swfw_lock(struct e1000_hw *hw)
 }
 
 static int
-eth_igb_dev_init(__attribute__((unused)) struct eth_driver *eth_drv,
-                  struct rte_eth_dev *eth_dev)
+eth_igb_dev_init(struct rte_eth_dev *eth_dev)
 {
        int error = 0;
        struct rte_pci_device *pci_dev;
@@ -614,8 +613,7 @@ err_late:
  * Virtual Function device init
  */
 static int
-eth_igbvf_dev_init(__attribute__((unused)) struct eth_driver *eth_drv,
-               struct rte_eth_dev *eth_dev)
+eth_igbvf_dev_init(struct rte_eth_dev *eth_dev)
 {
        struct rte_pci_device *pci_dev;
        struct e1000_hw *hw =
index 9cb6666b762275cdbad2532cc539b9b726c8605a..4950edeb16e1c21951466b63d679f35fcea06816 100644 (file)
@@ -555,9 +555,7 @@ struct enic *enicpmd_list_head = NULL;
 /* Initialize the driver
  * It returns 0 on success.
  */
-static int eth_enicpmd_dev_init(
-       __attribute__((unused))struct eth_driver *eth_drv,
-       struct rte_eth_dev *eth_dev)
+static int eth_enicpmd_dev_init(struct rte_eth_dev *eth_dev)
 {
        struct rte_pci_device *pdev;
        struct rte_pci_addr *addr;
index 07ea1e71f7363af3b5f764eb34ee3aa08128d66d..62c4a397c8f58940a8a32ec7da9e4c9e3896435d 100644 (file)
@@ -1668,8 +1668,7 @@ static struct eth_dev_ops fm10k_eth_dev_ops = {
 };
 
 static int
-eth_fm10k_dev_init(__rte_unused struct eth_driver *eth_drv,
-       struct rte_eth_dev *dev)
+eth_fm10k_dev_init(struct rte_eth_dev *dev)
 {
        struct fm10k_hw *hw = FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private);
        int diag;
index 5e502b65248af8e713504dbfe3775921dfef9ae9..6888072defbf1cae83acb3c99c1969c690c281a1 100644 (file)
        (1UL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER) | \
        (1UL << RTE_ETH_FLOW_L2_PAYLOAD))
 
-static int eth_i40e_dev_init(\
-                       __attribute__((unused)) struct eth_driver *eth_drv,
-                       struct rte_eth_dev *eth_dev);
+static int eth_i40e_dev_init(struct rte_eth_dev *eth_dev);
 static int i40e_dev_configure(struct rte_eth_dev *dev);
 static int i40e_dev_start(struct rte_eth_dev *dev);
 static void i40e_dev_stop(struct rte_eth_dev *dev);
@@ -364,8 +362,7 @@ static inline void i40e_flex_payload_reg_init(struct i40e_hw *hw)
 }
 
 static int
-eth_i40e_dev_init(__rte_unused struct eth_driver *eth_drv,
-                  struct rte_eth_dev *dev)
+eth_i40e_dev_init(struct rte_eth_dev *dev)
 {
        struct rte_pci_device *pci_dev;
        struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
index f031c1964bcaf543a7d42b3b43700155f420e406..70eefff9f4b877e9b7b5e7d17e65abbd8ec7929e 100644 (file)
@@ -1149,8 +1149,7 @@ err:
 }
 
 static int
-i40evf_dev_init(__rte_unused struct eth_driver *eth_drv,
-               struct rte_eth_dev *eth_dev)
+i40evf_dev_init(struct rte_eth_dev *eth_dev)
 {
        struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(\
                        eth_dev->data->dev_private);
index 9bdc0465a7eb64a29a162df5e09dc5ca8f2e21a2..6599ddb1e0f0171cb2951a4053a7a96eb4ca83bf 100644 (file)
 
 #define IXGBE_QUEUE_STAT_COUNTERS (sizeof(hw_stats->qprc) / sizeof(hw_stats->qprc[0]))
 
-static int eth_ixgbe_dev_init(struct eth_driver *eth_drv,
-               struct rte_eth_dev *eth_dev);
+static int eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev);
 static int  ixgbe_dev_configure(struct rte_eth_dev *dev);
 static int  ixgbe_dev_start(struct rte_eth_dev *dev);
 static void ixgbe_dev_stop(struct rte_eth_dev *dev);
@@ -184,8 +183,7 @@ static void ixgbe_remove_rar(struct rte_eth_dev *dev, uint32_t index);
 static void ixgbe_dcb_init(struct ixgbe_hw *hw,struct ixgbe_dcb_config *dcb_config);
 
 /* For Virtual Function support */
-static int eth_ixgbevf_dev_init(struct eth_driver *eth_drv,
-               struct rte_eth_dev *eth_dev);
+static int eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev);
 static int  ixgbevf_dev_configure(struct rte_eth_dev *dev);
 static int  ixgbevf_dev_start(struct rte_eth_dev *dev);
 static void ixgbevf_dev_stop(struct rte_eth_dev *dev);
@@ -718,8 +716,7 @@ ixgbe_swfw_lock_reset(struct ixgbe_hw *hw)
  * It returns 0 on success.
  */
 static int
-eth_ixgbe_dev_init(__attribute__((unused)) struct eth_driver *eth_drv,
-                    struct rte_eth_dev *eth_dev)
+eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev)
 {
        struct rte_pci_device *pci_dev;
        struct ixgbe_hw *hw =
@@ -967,8 +964,7 @@ generate_random_mac_addr(struct ether_addr *mac_addr)
  * Virtual Function device init
  */
 static int
-eth_ixgbevf_dev_init(__attribute__((unused)) struct eth_driver *eth_drv,
-                    struct rte_eth_dev *eth_dev)
+eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev)
 {
        int diag;
        uint32_t tc, tcs;
index c7a0d756a1765dd77b83b6a510b257c5f95e32b2..603be2d7d345e71070adb308f5127da7bd856f8f 100644 (file)
@@ -62,8 +62,7 @@
 #include "virtqueue.h"
 
 
-static int eth_virtio_dev_init(struct eth_driver *eth_drv,
-               struct rte_eth_dev *eth_dev);
+static int eth_virtio_dev_init(struct rte_eth_dev *eth_dev);
 static int  virtio_dev_configure(struct rte_eth_dev *dev);
 static int  virtio_dev_start(struct rte_eth_dev *dev);
 static void virtio_dev_stop(struct rte_eth_dev *dev);
@@ -1103,8 +1102,7 @@ virtio_interrupt_handler(__rte_unused struct rte_intr_handle *handle,
  * It returns 0 on success.
  */
 static int
-eth_virtio_dev_init(__rte_unused struct eth_driver *eth_drv,
-               struct rte_eth_dev *eth_dev)
+eth_virtio_dev_init(struct rte_eth_dev *eth_dev)
 {
        struct virtio_hw *hw = eth_dev->data->dev_private;
        struct virtio_net_config *config;
index 6068c609c7bd7f165857ce1bd2c4e6069863ccdf..a2a2aaaf103fc4e0b75a6455b5a23bcbdc43bd62 100644 (file)
@@ -70,8 +70,7 @@
 
 #define PROCESS_SYS_EVENTS 0
 
-static int eth_vmxnet3_dev_init(struct eth_driver *eth_drv,
-               struct rte_eth_dev *eth_dev);
+static int eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev);
 static int vmxnet3_dev_configure(struct rte_eth_dev *dev);
 static int vmxnet3_dev_start(struct rte_eth_dev *dev);
 static void vmxnet3_dev_stop(struct rte_eth_dev *dev);
@@ -182,8 +181,7 @@ vmxnet3_disable_intr(struct vmxnet3_hw *hw)
  * It returns 0 on success.
  */
 static int
-eth_vmxnet3_dev_init(__attribute__((unused)) struct eth_driver *eth_drv,
-                    struct rte_eth_dev *eth_dev)
+eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)
 {
        struct rte_pci_device *pci_dev;
        struct vmxnet3_hw *hw = eth_dev->data->dev_private;