liquidio: moved liquidio_napi_drv_callback to lio_core.c
authorIntiyaz Basha <intiyaz.basha@cavium.com>
Mon, 14 Aug 2017 19:01:48 +0000 (12:01 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 15 Aug 2017 05:21:40 +0000 (22:21 -0700)
Moving common liquidio_napi_drv_callback 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 b0b246e654cd9495bcf77491ff4d19f2a4acfc8d..8cba9278c274f8faa603b5fef5fa83f7ec2a7c01 100644 (file)
@@ -581,3 +581,42 @@ liquidio_push_packet(u32 octeon_id __attribute__((unused)),
                recv_buffer_free(skb);
        }
 }
+
+/**
+ * \brief wrapper for calling napi_schedule
+ * @param param parameters to pass to napi_schedule
+ *
+ * Used when scheduling on different CPUs
+ */
+static void napi_schedule_wrapper(void *param)
+{
+       struct napi_struct *napi = param;
+
+       napi_schedule(napi);
+}
+
+/**
+ * \brief callback when receive interrupt occurs and we are in NAPI mode
+ * @param arg pointer to octeon output queue
+ */
+void liquidio_napi_drv_callback(void *arg)
+{
+       struct octeon_device *oct;
+       struct octeon_droq *droq = arg;
+       int this_cpu = smp_processor_id();
+
+       oct = droq->oct_dev;
+
+       if (OCTEON_CN23XX_PF(oct) || OCTEON_CN23XX_VF(oct) ||
+           droq->cpu_id == this_cpu) {
+               napi_schedule_irqoff(&droq->napi);
+       } else {
+               struct call_single_data *csd = &droq->csd;
+
+               csd->func = napi_schedule_wrapper;
+               csd->info = &droq->napi;
+               csd->flags = 0;
+
+               smp_call_function_single_async(droq->cpu_id, csd);
+       }
+}
index 48a178ea30a62308e218636b16c2a254950d7740..e72618f6b2eb7d0d54e9a21c8da2cd26ee9a5e15 100644 (file)
@@ -2231,44 +2231,6 @@ static void if_cfg_callback(struct octeon_device *oct,
        wake_up_interruptible(&ctx->wc);
 }
 
-/**
- * \brief wrapper for calling napi_schedule
- * @param param parameters to pass to napi_schedule
- *
- * Used when scheduling on different CPUs
- */
-static void napi_schedule_wrapper(void *param)
-{
-       struct napi_struct *napi = param;
-
-       napi_schedule(napi);
-}
-
-/**
- * \brief callback when receive interrupt occurs and we are in NAPI mode
- * @param arg pointer to octeon output queue
- */
-static void liquidio_napi_drv_callback(void *arg)
-{
-       struct octeon_device *oct;
-       struct octeon_droq *droq = arg;
-       int this_cpu = smp_processor_id();
-
-       oct = droq->oct_dev;
-
-       if (OCTEON_CN23XX_PF(oct) || droq->cpu_id == this_cpu) {
-               napi_schedule_irqoff(&droq->napi);
-       } else {
-               struct call_single_data *csd = &droq->csd;
-
-               csd->func = napi_schedule_wrapper;
-               csd->info = &droq->napi;
-               csd->flags = 0;
-
-               smp_call_function_single_async(droq->cpu_id, csd);
-       }
-}
-
 /**
  * \brief Entry point for NAPI polling
  * @param napi NAPI structure
index 013a8613d4de79ef10829901457adf7fa821acc3..2663bd60e5d261b0e71d085d3af488f31e8c73e1 100644 (file)
@@ -1376,17 +1376,6 @@ static void if_cfg_callback(struct octeon_device *oct,
        wake_up_interruptible(&ctx->wc);
 }
 
-/**
- * \brief callback when receive interrupt occurs and we are in NAPI mode
- * @param arg pointer to octeon output queue
- */
-static void liquidio_vf_napi_drv_callback(void *arg)
-{
-       struct octeon_droq *droq = arg;
-
-       napi_schedule_irqoff(&droq->napi);
-}
-
 /**
  * \brief Entry point for NAPI polling
  * @param napi NAPI structure
@@ -1473,7 +1462,7 @@ static int setup_io_queues(struct octeon_device *octeon_dev, int ifidx)
        droq_ops.farg = netdev;
 
        droq_ops.poll_mode = 1;
-       droq_ops.napi_fn = liquidio_vf_napi_drv_callback;
+       droq_ops.napi_fn = liquidio_napi_drv_callback;
        cpu_id = 0;
        cpu_id_modulus = num_present_cpus();
 
index 5d78fd6ad3cd9acb53881a884e97e721c0ae78c9..076fdfcdd103b2a4ac5356e228e884dc766b9d96 100644 (file)
@@ -484,4 +484,5 @@ liquidio_push_packet(u32 octeon_id __attribute__((unused)),
                     union octeon_rh *rh,
                     void *param,
                     void *arg);
+void liquidio_napi_drv_callback(void *arg);
 #endif