Skip to content

Commit 1ff3926

Browse files
Intiyaz Bashadavem330
authored andcommitted
liquidio: moved liquidio_msix_intr_handler to lio_core.c
Moving common liquidio_msix_intr_handler to lio_core.c Signed-off-by: Intiyaz Basha <[email protected]> Signed-off-by: Raghu Vatsavayi <[email protected]> Signed-off-by: Felix Manlunas <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 463910e commit 1ff3926

File tree

5 files changed

+50
-88
lines changed

5 files changed

+50
-88
lines changed

drivers/net/ethernet/cavium/liquidio/lio_core.c

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,3 +788,44 @@ int liquidio_setup_io_queues(struct octeon_device *octeon_dev, int ifidx)
788788

789789
return 0;
790790
}
791+
792+
static
793+
int liquidio_schedule_msix_droq_pkt_handler(struct octeon_droq *droq, u64 ret)
794+
{
795+
struct octeon_device *oct = droq->oct_dev;
796+
struct octeon_device_priv *oct_priv =
797+
(struct octeon_device_priv *)oct->priv;
798+
799+
if (droq->ops.poll_mode) {
800+
droq->ops.napi_fn(droq);
801+
} else {
802+
if (ret & MSIX_PO_INT) {
803+
if (OCTEON_CN23XX_VF(oct))
804+
dev_err(&oct->pci_dev->dev,
805+
"should not come here should not get rx when poll mode = 0 for vf\n");
806+
tasklet_schedule(&oct_priv->droq_tasklet);
807+
return 1;
808+
}
809+
/* this will be flushed periodically by check iq db */
810+
if (ret & MSIX_PI_INT)
811+
return 0;
812+
}
813+
814+
return 0;
815+
}
816+
817+
irqreturn_t
818+
liquidio_msix_intr_handler(int irq __attribute__((unused)), void *dev)
819+
{
820+
struct octeon_ioq_vector *ioq_vector = (struct octeon_ioq_vector *)dev;
821+
struct octeon_device *oct = ioq_vector->oct_dev;
822+
struct octeon_droq *droq = oct->droq[ioq_vector->droq_index];
823+
u64 ret;
824+
825+
ret = oct->fn_list.msix_interrupt_handler(ioq_vector);
826+
827+
if (ret & MSIX_PO_INT || ret & MSIX_PI_INT)
828+
liquidio_schedule_msix_droq_pkt_handler(droq, ret);
829+
830+
return IRQ_HANDLED;
831+
}

drivers/net/ethernet/cavium/liquidio/lio_main.c

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,6 @@ struct handshake {
175175
int started_ok;
176176
};
177177

178-
struct octeon_device_priv {
179-
/** Tasklet structures for this device. */
180-
struct tasklet_struct droq_tasklet;
181-
unsigned long napi_mask;
182-
};
183-
184178
#ifdef CONFIG_PCI_IOV
185179
static int liquidio_enable_sriov(struct pci_dev *dev, int num_vfs);
186180
#endif
@@ -907,27 +901,6 @@ static inline void update_link_status(struct net_device *netdev,
907901
}
908902
}
909903

910-
static
911-
int liquidio_schedule_msix_droq_pkt_handler(struct octeon_droq *droq, u64 ret)
912-
{
913-
struct octeon_device *oct = droq->oct_dev;
914-
struct octeon_device_priv *oct_priv =
915-
(struct octeon_device_priv *)oct->priv;
916-
917-
if (droq->ops.poll_mode) {
918-
droq->ops.napi_fn(droq);
919-
} else {
920-
if (ret & MSIX_PO_INT) {
921-
tasklet_schedule(&oct_priv->droq_tasklet);
922-
return 1;
923-
}
924-
/* this will be flushed periodically by check iq db */
925-
if (ret & MSIX_PI_INT)
926-
return 0;
927-
}
928-
return 0;
929-
}
930-
931904
/**
932905
* \brief Droq packet processor sceduler
933906
* @param oct octeon device
@@ -957,22 +930,6 @@ static void liquidio_schedule_droq_pkt_handlers(struct octeon_device *oct)
957930
}
958931
}
959932

960-
static irqreturn_t
961-
liquidio_msix_intr_handler(int irq __attribute__((unused)), void *dev)
962-
{
963-
u64 ret;
964-
struct octeon_ioq_vector *ioq_vector = (struct octeon_ioq_vector *)dev;
965-
struct octeon_device *oct = ioq_vector->oct_dev;
966-
struct octeon_droq *droq = oct->droq[ioq_vector->droq_index];
967-
968-
ret = oct->fn_list.msix_interrupt_handler(ioq_vector);
969-
970-
if ((ret & MSIX_PO_INT) || (ret & MSIX_PI_INT))
971-
liquidio_schedule_msix_droq_pkt_handler(droq, ret);
972-
973-
return IRQ_HANDLED;
974-
}
975-
976933
/**
977934
* \brief Interrupt handler for octeon
978935
* @param irq unused

drivers/net/ethernet/cavium/liquidio/lio_vf_main.c

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,6 @@ struct octnic_gather {
107107
dma_addr_t sg_dma_ptr;
108108
};
109109

110-
struct octeon_device_priv {
111-
/* Tasklet structures for this device. */
112-
struct tasklet_struct droq_tasklet;
113-
unsigned long napi_mask;
114-
};
115-
116110
static int
117111
liquidio_vf_probe(struct pci_dev *pdev, const struct pci_device_id *ent);
118112
static void liquidio_vf_remove(struct pci_dev *pdev);
@@ -648,45 +642,6 @@ static void update_link_status(struct net_device *netdev,
648642
}
649643
}
650644

651-
static
652-
int liquidio_schedule_msix_droq_pkt_handler(struct octeon_droq *droq, u64 ret)
653-
{
654-
struct octeon_device *oct = droq->oct_dev;
655-
struct octeon_device_priv *oct_priv =
656-
(struct octeon_device_priv *)oct->priv;
657-
658-
if (droq->ops.poll_mode) {
659-
droq->ops.napi_fn(droq);
660-
} else {
661-
if (ret & MSIX_PO_INT) {
662-
dev_err(&oct->pci_dev->dev,
663-
"should not come here should not get rx when poll mode = 0 for vf\n");
664-
tasklet_schedule(&oct_priv->droq_tasklet);
665-
return 1;
666-
}
667-
/* this will be flushed periodically by check iq db */
668-
if (ret & MSIX_PI_INT)
669-
return 0;
670-
}
671-
return 0;
672-
}
673-
674-
static irqreturn_t
675-
liquidio_msix_intr_handler(int irq __attribute__((unused)), void *dev)
676-
{
677-
struct octeon_ioq_vector *ioq_vector = (struct octeon_ioq_vector *)dev;
678-
struct octeon_device *oct = ioq_vector->oct_dev;
679-
struct octeon_droq *droq = oct->droq[ioq_vector->droq_index];
680-
u64 ret;
681-
682-
ret = oct->fn_list.msix_interrupt_handler(ioq_vector);
683-
684-
if ((ret & MSIX_PO_INT) || (ret & MSIX_PI_INT))
685-
liquidio_schedule_msix_droq_pkt_handler(droq, ret);
686-
687-
return IRQ_HANDLED;
688-
}
689-
690645
/**
691646
* \brief Setup interrupt for octeon device
692647
* @param oct octeon device

drivers/net/ethernet/cavium/liquidio/octeon_main.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@
3535

3636
#define DRV_NAME "LiquidIO"
3737

38+
struct octeon_device_priv {
39+
/** Tasklet structures for this device. */
40+
struct tasklet_struct droq_tasklet;
41+
unsigned long napi_mask;
42+
};
43+
3844
/** This structure is used by NIC driver to store information required
3945
* to free the sk_buff when the packet has been fetched by Octeon.
4046
* Bytes offset below assume worst-case of a 64-bit system.

drivers/net/ethernet/cavium/liquidio/octeon_network.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ void liquidio_link_ctrl_cmd_completion(void *nctrl_ptr);
169169

170170
int liquidio_setup_io_queues(struct octeon_device *octeon_dev, int ifidx);
171171

172+
irqreturn_t liquidio_msix_intr_handler(int irq __attribute__((unused)),
173+
void *dev);
174+
172175
/**
173176
* \brief Register ethtool operations
174177
* @param netdev pointer to network device

0 commit comments

Comments
 (0)