Commit f61e0a35 authored by Sreenivasa Honnur's avatar Sreenivasa Honnur Committed by Jeff Garzik

S2io: Added napi support when MSIX is enabled.

- Added napi support when MSIX is enabled.
- Moved test_msi function from s2io_open to probe function.
Signed-off-by: default avatarSreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: default avatarRamkrishna Vepa <ram.vepa@neterion.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent ac731ab6
...@@ -250,7 +250,7 @@ struct XENA_dev_config { ...@@ -250,7 +250,7 @@ struct XENA_dev_config {
u64 tx_mat0_n[0x8]; u64 tx_mat0_n[0x8];
#define TX_MAT_SET(fifo, msi) vBIT(msi, (8 * fifo), 8) #define TX_MAT_SET(fifo, msi) vBIT(msi, (8 * fifo), 8)
u8 unused_1[0x8]; u64 xmsi_mask_reg;
u64 stat_byte_cnt; u64 stat_byte_cnt;
#define STAT_BC(n) vBIT(n,4,12) #define STAT_BC(n) vBIT(n,4,12)
......
This diff is collapsed.
...@@ -706,7 +706,7 @@ struct ring_info { ...@@ -706,7 +706,7 @@ struct ring_info {
/* per-ring buffer counter */ /* per-ring buffer counter */
u32 rx_bufs_left; u32 rx_bufs_left;
#define MAX_LRO_SESSIONS 32 #define MAX_LRO_SESSIONS 32
struct lro lro0_n[MAX_LRO_SESSIONS]; struct lro lro0_n[MAX_LRO_SESSIONS];
u8 lro; u8 lro;
...@@ -725,6 +725,11 @@ struct ring_info { ...@@ -725,6 +725,11 @@ struct ring_info {
/* copy of sp->pdev pointer */ /* copy of sp->pdev pointer */
struct pci_dev *pdev; struct pci_dev *pdev;
/* Per ring napi struct */
struct napi_struct napi;
unsigned long interrupt_count;
/* /*
* Place holders for the virtual and physical addresses of * Place holders for the virtual and physical addresses of
* all the Rx Blocks * all the Rx Blocks
...@@ -841,7 +846,7 @@ struct usr_addr { ...@@ -841,7 +846,7 @@ struct usr_addr {
* Structure to keep track of the MSI-X vectors and the corresponding * Structure to keep track of the MSI-X vectors and the corresponding
* argument registered against each vector * argument registered against each vector
*/ */
#define MAX_REQUESTED_MSI_X 17 #define MAX_REQUESTED_MSI_X 9
struct s2io_msix_entry struct s2io_msix_entry
{ {
u16 vector; u16 vector;
...@@ -877,7 +882,6 @@ struct s2io_nic { ...@@ -877,7 +882,6 @@ struct s2io_nic {
*/ */
int pkts_to_process; int pkts_to_process;
struct net_device *dev; struct net_device *dev;
struct napi_struct napi;
struct mac_info mac_control; struct mac_info mac_control;
struct config_param config; struct config_param config;
struct pci_dev *pdev; struct pci_dev *pdev;
...@@ -948,6 +952,7 @@ struct s2io_nic { ...@@ -948,6 +952,7 @@ struct s2io_nic {
*/ */
u8 other_fifo_idx; u8 other_fifo_idx;
struct napi_struct napi;
/* after blink, the adapter must be restored with original /* after blink, the adapter must be restored with original
* values. * values.
*/ */
...@@ -962,6 +967,7 @@ struct s2io_nic { ...@@ -962,6 +967,7 @@ struct s2io_nic {
unsigned long long start_time; unsigned long long start_time;
struct vlan_group *vlgrp; struct vlan_group *vlgrp;
#define MSIX_FLG 0xA5 #define MSIX_FLG 0xA5
int num_entries;
struct msix_entry *entries; struct msix_entry *entries;
int msi_detected; int msi_detected;
wait_queue_head_t msi_wait; wait_queue_head_t msi_wait;
...@@ -1104,7 +1110,7 @@ static void __devexit s2io_rem_nic(struct pci_dev *pdev); ...@@ -1104,7 +1110,7 @@ static void __devexit s2io_rem_nic(struct pci_dev *pdev);
static int init_shared_mem(struct s2io_nic *sp); static int init_shared_mem(struct s2io_nic *sp);
static void free_shared_mem(struct s2io_nic *sp); static void free_shared_mem(struct s2io_nic *sp);
static int init_nic(struct s2io_nic *nic); static int init_nic(struct s2io_nic *nic);
static void rx_intr_handler(struct ring_info *ring_data); static int rx_intr_handler(struct ring_info *ring_data, int budget);
static void tx_intr_handler(struct fifo_info *fifo_data); static void tx_intr_handler(struct fifo_info *fifo_data);
static void s2io_handle_errors(void * dev_id); static void s2io_handle_errors(void * dev_id);
...@@ -1115,7 +1121,8 @@ static void s2io_set_multicast(struct net_device *dev); ...@@ -1115,7 +1121,8 @@ static void s2io_set_multicast(struct net_device *dev);
static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp); static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp);
static void s2io_link(struct s2io_nic * sp, int link); static void s2io_link(struct s2io_nic * sp, int link);
static void s2io_reset(struct s2io_nic * sp); static void s2io_reset(struct s2io_nic * sp);
static int s2io_poll(struct napi_struct *napi, int budget); static int s2io_poll_msix(struct napi_struct *napi, int budget);
static int s2io_poll_inta(struct napi_struct *napi, int budget);
static void s2io_init_pci(struct s2io_nic * sp); static void s2io_init_pci(struct s2io_nic * sp);
static int do_s2io_prog_unicast(struct net_device *dev, u8 *addr); static int do_s2io_prog_unicast(struct net_device *dev, u8 *addr);
static void s2io_alarm_handle(unsigned long data); static void s2io_alarm_handle(unsigned long data);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment