liquidio: moved update_txq_status to lio_core.c
authorIntiyaz Basha <intiyaz.basha@cavium.com>
Mon, 14 Aug 2017 19:01:37 +0000 (12:01 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 15 Aug 2017 05:21:40 +0000 (22:21 -0700)
Moving common update_txq_status to lio_core.c

Signed-off-by: Intiyaz Basha <intiyaz.basha@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_network.h

index adde7745d069ca93bb1b36308c675cb6d7515cb4..b55ab75a7d9cfb0e0a0678f39fe210e071e74659 100644 (file)
@@ -364,3 +364,36 @@ void cleanup_rx_oom_poll_fn(struct net_device *netdev)
                destroy_workqueue(lio->rxq_status_wq.wq);
        }
 }
+
+/* Runs in interrupt context. */
+void lio_update_txq_status(struct octeon_device *oct, int iq_num)
+{
+       struct octeon_instr_queue *iq = oct->instr_queue[iq_num];
+       struct net_device *netdev;
+       struct lio *lio;
+
+       netdev = oct->props[iq->ifidx].netdev;
+
+       /* This is needed because the first IQ does not have
+        * a netdev associated with it.
+        */
+       if (!netdev)
+               return;
+
+       lio = GET_LIO(netdev);
+       if (netif_is_multiqueue(netdev)) {
+               if (__netif_subqueue_stopped(netdev, iq->q_index) &&
+                   lio->linfo.link.s.link_up &&
+                   (!octnet_iq_is_full(oct, iq_num))) {
+                       netif_wake_subqueue(netdev, iq->q_index);
+                       INCR_INSTRQUEUE_PKT_COUNT(lio->oct_dev, iq_num,
+                                                 tx_restart, 1);
+               }
+       } else if (netif_queue_stopped(netdev) &&
+                  lio->linfo.link.s.link_up &&
+                  (!octnet_iq_is_full(oct, lio->txq))) {
+               INCR_INSTRQUEUE_PKT_COUNT(lio->oct_dev, lio->txq,
+                                         tx_restart, 1);
+               netif_wake_queue(netdev);
+       }
+}
index 73b3547bf142c1eb88e2403ea98c82b57686206f..01c6985cff6d9d624a657e04d7a084029b76f3c0 100644 (file)
@@ -906,39 +906,6 @@ static inline void update_link_status(struct net_device *netdev,
        }
 }
 
-/* Runs in interrupt context. */
-static void update_txq_status(struct octeon_device *oct, int iq_num)
-{
-       struct net_device *netdev;
-       struct lio *lio;
-       struct octeon_instr_queue *iq = oct->instr_queue[iq_num];
-
-       netdev = oct->props[iq->ifidx].netdev;
-
-       /* This is needed because the first IQ does not have
-        * a netdev associated with it.
-        */
-       if (!netdev)
-               return;
-
-       lio = GET_LIO(netdev);
-       if (netif_is_multiqueue(netdev)) {
-               if (__netif_subqueue_stopped(netdev, iq->q_index) &&
-                   lio->linfo.link.s.link_up &&
-                   (!octnet_iq_is_full(oct, iq_num))) {
-                       INCR_INSTRQUEUE_PKT_COUNT(lio->oct_dev, iq_num,
-                                                 tx_restart, 1);
-                       netif_wake_subqueue(netdev, iq->q_index);
-               }
-       } else if (netif_queue_stopped(netdev) &&
-                  lio->linfo.link.s.link_up &&
-                  (!octnet_iq_is_full(oct, lio->txq))) {
-               INCR_INSTRQUEUE_PKT_COUNT(lio->oct_dev,
-                                         lio->txq, tx_restart, 1);
-               netif_wake_queue(netdev);
-       }
-}
-
 static
 int liquidio_schedule_msix_droq_pkt_handler(struct octeon_droq *droq, u64 ret)
 {
@@ -2518,7 +2485,7 @@ static int liquidio_napi_poll(struct napi_struct *napi, int budget)
                /* Update iq read-index rather than waiting for next interrupt.
                 * Return back if tx_done is false.
                 */
-               update_txq_status(oct, iq_no);
+               lio_update_txq_status(oct, iq_no);
        } else {
                dev_err(&oct->pci_dev->dev, "%s:  iq (%d) num invalid\n",
                        __func__, iq_no);
index 17623ed1f0faf6ae92dacb76e5a8487884bd7383..dd0265a52521b617dfe231a92ffab8c3bf21e807 100644 (file)
@@ -647,30 +647,6 @@ static void update_link_status(struct net_device *netdev,
        }
 }
 
-static void update_txq_status(struct octeon_device *oct, int iq_num)
-{
-       struct octeon_instr_queue *iq = oct->instr_queue[iq_num];
-       struct net_device *netdev;
-       struct lio *lio;
-
-       netdev = oct->props[iq->ifidx].netdev;
-       lio = GET_LIO(netdev);
-       if (netif_is_multiqueue(netdev)) {
-               if (__netif_subqueue_stopped(netdev, iq->q_index) &&
-                   lio->linfo.link.s.link_up &&
-                   (!octnet_iq_is_full(oct, iq_num))) {
-                       netif_wake_subqueue(netdev, iq->q_index);
-                       INCR_INSTRQUEUE_PKT_COUNT(lio->oct_dev, iq_num,
-                                                 tx_restart, 1);
-               }
-       } else if (netif_queue_stopped(netdev) && lio->linfo.link.s.link_up &&
-                  (!octnet_iq_is_full(oct, lio->txq))) {
-               INCR_INSTRQUEUE_PKT_COUNT(lio->oct_dev,
-                                         lio->txq, tx_restart, 1);
-               netif_wake_queue(netdev);
-       }
-}
-
 static
 int liquidio_schedule_msix_droq_pkt_handler(struct octeon_droq *droq, u64 ret)
 {
@@ -1608,7 +1584,7 @@ static int liquidio_napi_poll(struct napi_struct *napi, int budget)
                /* Update iq read-index rather than waiting for next interrupt.
                 * Return back if tx_done is false.
                 */
-               update_txq_status(oct, iq_no);
+               lio_update_txq_status(oct, iq_no);
        } else {
                dev_err(&oct->pci_dev->dev, "%s: iq (%d) num invalid\n",
                        __func__, iq_no);
index 043f6e6537316181c410be80973d2d555f06f6c8..0e44ee1d4cb211a7a15832ac875ea6598178afa3 100644 (file)
@@ -474,4 +474,5 @@ static inline int wait_for_pending_requests(struct octeon_device *oct)
        return 0;
 }
 
+void lio_update_txq_status(struct octeon_device *oct, int iq_num);
 #endif