liquidio: moved liquidio_msix_intr_handler to lio_core.c
authorIntiyaz Basha <intiyaz.basha@cavium.com>
Tue, 15 Aug 2017 19:46:05 +0000 (12:46 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Aug 2017 04:05:31 +0000 (21:05 -0700)
Moving common liquidio_msix_intr_handler to lio_core.c

Signed-off-by: Intiyaz Basha <intiyaz.basha@cavium.com>
Signed-off-by: Raghu Vatsavayi <raghu.vatsavayi@cavium.com>
Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cavium/liquidio/lio_core.c
drivers/net/ethernet/cavium/liquidio/lio_main.c
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
drivers/net/ethernet/cavium/liquidio/octeon_main.h
drivers/net/ethernet/cavium/liquidio/octeon_network.h

index d20d0eb..03746d8 100644 (file)
@@ -788,3 +788,44 @@ int liquidio_setup_io_queues(struct octeon_device *octeon_dev, int ifidx)
 
        return 0;
 }
+
+static
+int liquidio_schedule_msix_droq_pkt_handler(struct octeon_droq *droq, u64 ret)
+{
+       struct octeon_device *oct = droq->oct_dev;
+       struct octeon_device_priv *oct_priv =
+           (struct octeon_device_priv *)oct->priv;
+
+       if (droq->ops.poll_mode) {
+               droq->ops.napi_fn(droq);
+       } else {
+               if (ret & MSIX_PO_INT) {
+                       if (OCTEON_CN23XX_VF(oct))
+                               dev_err(&oct->pci_dev->dev,
+                                       "should not come here should not get rx when poll mode = 0 for vf\n");
+                       tasklet_schedule(&oct_priv->droq_tasklet);
+                       return 1;
+               }
+               /* this will be flushed periodically by check iq db */
+               if (ret & MSIX_PI_INT)
+                       return 0;
+       }
+
+       return 0;
+}
+
+irqreturn_t
+liquidio_msix_intr_handler(int irq __attribute__((unused)), void *dev)
+{
+       struct octeon_ioq_vector *ioq_vector = (struct octeon_ioq_vector *)dev;
+       struct octeon_device *oct = ioq_vector->oct_dev;
+       struct octeon_droq *droq = oct->droq[ioq_vector->droq_index];
+       u64 ret;
+
+       ret = oct->fn_list.msix_interrupt_handler(ioq_vector);
+
+       if (ret & MSIX_PO_INT || ret & MSIX_PI_INT)
+               liquidio_schedule_msix_droq_pkt_handler(droq, ret);
+
+       return IRQ_HANDLED;
+}
index 247f5de..96ba5ec 100644 (file)
@@ -175,12 +175,6 @@ struct handshake {
        int started_ok;
 };
 
-struct octeon_device_priv {
-       /** Tasklet structures for this device. */
-       struct tasklet_struct droq_tasklet;
-       unsigned long napi_mask;
-};
-
 #ifdef CONFIG_PCI_IOV
 static int liquidio_enable_sriov(struct pci_dev *dev, int num_vfs);
 #endif
@@ -907,27 +901,6 @@ static inline void update_link_status(struct net_device *netdev,
        }
 }
 
-static
-int liquidio_schedule_msix_droq_pkt_handler(struct octeon_droq *droq, u64 ret)
-{
-       struct octeon_device *oct = droq->oct_dev;
-       struct octeon_device_priv *oct_priv =
-           (struct octeon_device_priv *)oct->priv;
-
-       if (droq->ops.poll_mode) {
-               droq->ops.napi_fn(droq);
-       } else {
-               if (ret & MSIX_PO_INT) {
-                       tasklet_schedule(&oct_priv->droq_tasklet);
-                       return 1;
-               }
-               /* this will be flushed periodically by check iq db */
-               if (ret & MSIX_PI_INT)
-                       return 0;
-       }
-       return 0;
-}
-
 /**
  * \brief Droq packet processor sceduler
  * @param oct octeon device
@@ -957,22 +930,6 @@ static void liquidio_schedule_droq_pkt_handlers(struct octeon_device *oct)
        }
 }
 
-static irqreturn_t
-liquidio_msix_intr_handler(int irq __attribute__((unused)), void *dev)
-{
-       u64 ret;
-       struct octeon_ioq_vector *ioq_vector = (struct octeon_ioq_vector *)dev;
-       struct octeon_device *oct = ioq_vector->oct_dev;
-       struct octeon_droq *droq = oct->droq[ioq_vector->droq_index];
-
-       ret = oct->fn_list.msix_interrupt_handler(ioq_vector);
-
-       if ((ret & MSIX_PO_INT) || (ret & MSIX_PI_INT))
-               liquidio_schedule_msix_droq_pkt_handler(droq, ret);
-
-       return IRQ_HANDLED;
-}
-
 /**
  * \brief Interrupt handler for octeon
  * @param irq unused
index 2fc2da3..688b438 100644 (file)
@@ -107,12 +107,6 @@ struct octnic_gather {
        dma_addr_t sg_dma_ptr;
 };
 
-struct octeon_device_priv {
-       /* Tasklet structures for this device. */
-       struct tasklet_struct droq_tasklet;
-       unsigned long napi_mask;
-};
-
 static int
 liquidio_vf_probe(struct pci_dev *pdev, const struct pci_device_id *ent);
 static void liquidio_vf_remove(struct pci_dev *pdev);
@@ -648,45 +642,6 @@ static void update_link_status(struct net_device *netdev,
        }
 }
 
-static
-int liquidio_schedule_msix_droq_pkt_handler(struct octeon_droq *droq, u64 ret)
-{
-       struct octeon_device *oct = droq->oct_dev;
-       struct octeon_device_priv *oct_priv =
-           (struct octeon_device_priv *)oct->priv;
-
-       if (droq->ops.poll_mode) {
-               droq->ops.napi_fn(droq);
-       } else {
-               if (ret & MSIX_PO_INT) {
-                       dev_err(&oct->pci_dev->dev,
-                               "should not come here should not get rx when poll mode = 0 for vf\n");
-                       tasklet_schedule(&oct_priv->droq_tasklet);
-                       return 1;
-               }
-               /* this will be flushed periodically by check iq db */
-               if (ret & MSIX_PI_INT)
-                       return 0;
-       }
-       return 0;
-}
-
-static irqreturn_t
-liquidio_msix_intr_handler(int irq __attribute__((unused)), void *dev)
-{
-       struct octeon_ioq_vector *ioq_vector = (struct octeon_ioq_vector *)dev;
-       struct octeon_device *oct = ioq_vector->oct_dev;
-       struct octeon_droq *droq = oct->droq[ioq_vector->droq_index];
-       u64 ret;
-
-       ret = oct->fn_list.msix_interrupt_handler(ioq_vector);
-
-       if ((ret & MSIX_PO_INT) || (ret & MSIX_PI_INT))
-               liquidio_schedule_msix_droq_pkt_handler(droq, ret);
-
-       return IRQ_HANDLED;
-}
-
 /**
  * \brief Setup interrupt for octeon device
  * @param oct octeon device
index 7ccffbb..32ef3a7 100644 (file)
 
 #define DRV_NAME "LiquidIO"
 
+struct octeon_device_priv {
+       /** Tasklet structures for this device. */
+       struct tasklet_struct droq_tasklet;
+       unsigned long napi_mask;
+};
+
 /** This structure is used by NIC driver to store information required
  * to free the sk_buff when the packet has been fetched by Octeon.
  * Bytes offset below assume worst-case of a 64-bit system.
index d4b3930..7454d71 100644 (file)
@@ -169,6 +169,9 @@ void liquidio_link_ctrl_cmd_completion(void *nctrl_ptr);
 
 int liquidio_setup_io_queues(struct octeon_device *octeon_dev, int ifidx);
 
+irqreturn_t liquidio_msix_intr_handler(int irq __attribute__((unused)),
+                                      void *dev);
+
 /**
  * \brief Register ethtool operations
  * @param netdev    pointer to network device