Commit 6900d730 authored by Scott Feldman's avatar Scott Feldman Committed by Jeff Garzik

e100 1/4:

* Remove broken home-grown Rx polling mode (make way for NAPI)
parent fffc9057
...@@ -121,7 +121,6 @@ ...@@ -121,7 +121,6 @@
#define E100_DEFAULT_CPUSAVER_BUNDLE_MAX 6 #define E100_DEFAULT_CPUSAVER_BUNDLE_MAX 6
#define E100_DEFAULT_CPUSAVER_INTERRUPT_DELAY 0x600 #define E100_DEFAULT_CPUSAVER_INTERRUPT_DELAY 0x600
#define E100_DEFAULT_BUNDLE_SMALL_FR false #define E100_DEFAULT_BUNDLE_SMALL_FR false
#define E100_DEFAULT_RX_CONGESTION_CONTROL true
/* end of configurables */ /* end of configurables */
...@@ -146,8 +145,6 @@ struct driver_stats { ...@@ -146,8 +145,6 @@ struct driver_stats {
unsigned long xmt_tco_pkts; unsigned long xmt_tco_pkts;
unsigned long rcv_tco_pkts; unsigned long rcv_tco_pkts;
unsigned long rx_intr_pkts; unsigned long rx_intr_pkts;
unsigned long rx_tasklet_pkts;
unsigned long poll_intr_switch;
}; };
/* TODO: kill me when we can do C99 */ /* TODO: kill me when we can do C99 */
...@@ -838,7 +835,6 @@ typedef struct _bd_dma_able_t { ...@@ -838,7 +835,6 @@ typedef struct _bd_dma_able_t {
#define PRM_FC 0x00000004 #define PRM_FC 0x00000004
#define PRM_IFS 0x00000008 #define PRM_IFS 0x00000008
#define PRM_BUNDLE_SMALL 0x00000010 #define PRM_BUNDLE_SMALL 0x00000010
#define PRM_RX_CONG 0x00000020
struct cfg_params { struct cfg_params {
int e100_speed_duplex; int e100_speed_duplex;
...@@ -847,7 +843,6 @@ struct cfg_params { ...@@ -847,7 +843,6 @@ struct cfg_params {
int IntDelay; int IntDelay;
int BundleMax; int BundleMax;
int ber; int ber;
int PollingMaxWork;
u32 b_params; u32 b_params;
}; };
struct ethtool_lpbk_data{ struct ethtool_lpbk_data{
...@@ -949,8 +944,6 @@ struct e100_private { ...@@ -949,8 +944,6 @@ struct e100_private {
u32 speed_duplex_caps; /* adapter's speed/duplex capabilities */ u32 speed_duplex_caps; /* adapter's speed/duplex capabilities */
struct tasklet_struct polling_tasklet;
/* WOL params for ethtool */ /* WOL params for ethtool */
u32 wolsupported; u32 wolsupported;
u32 wolopts; u32 wolopts;
......
...@@ -349,9 +349,7 @@ e100_alloc_skbs(struct e100_private *bdp) ...@@ -349,9 +349,7 @@ e100_alloc_skbs(struct e100_private *bdp)
} }
void e100_tx_srv(struct e100_private *); void e100_tx_srv(struct e100_private *);
u32 e100_rx_srv(struct e100_private *, u32, int *); u32 e100_rx_srv(struct e100_private *);
void e100_polling_tasklet(unsigned long);
void e100_watchdog(struct net_device *); void e100_watchdog(struct net_device *);
static void e100_do_hwi(struct net_device *); static void e100_do_hwi(struct net_device *);
...@@ -379,9 +377,6 @@ E100_PARAM(IntDelay, "Value for CPU saver's interrupt delay"); ...@@ -379,9 +377,6 @@ E100_PARAM(IntDelay, "Value for CPU saver's interrupt delay");
E100_PARAM(BundleSmallFr, "Disable or enable interrupt bundling of small frames"); E100_PARAM(BundleSmallFr, "Disable or enable interrupt bundling of small frames");
E100_PARAM(BundleMax, "Maximum number for CPU saver's packet bundling"); E100_PARAM(BundleMax, "Maximum number for CPU saver's packet bundling");
E100_PARAM(IFS, "Disable or enable the adaptive IFS algorithm"); E100_PARAM(IFS, "Disable or enable the adaptive IFS algorithm");
E100_PARAM(RxCongestionControl, "Disable or enable switch to polling mode");
E100_PARAM(PollingMaxWork, "Max number of receive packets processed on single "
"polling call");
/** /**
* e100_exec_cmd - issue a comand * e100_exec_cmd - issue a comand
...@@ -856,14 +851,6 @@ e100_check_options(int board, struct e100_private *bdp) ...@@ -856,14 +851,6 @@ e100_check_options(int board, struct e100_private *bdp)
0xFFFF, E100_DEFAULT_CPUSAVER_BUNDLE_MAX, 0xFFFF, E100_DEFAULT_CPUSAVER_BUNDLE_MAX,
"CPU saver bundle max value"); "CPU saver bundle max value");
e100_set_bool_option(bdp, RxCongestionControl[board], PRM_RX_CONG,
E100_DEFAULT_RX_CONGESTION_CONTROL,
"Rx Congestion Control value");
e100_set_int_option(&(bdp->params.PollingMaxWork),
PollingMaxWork[board], 1, E100_MAX_RFD,
bdp->params.RxDescriptors,
"Polling Max Work value");
} }
/** /**
...@@ -991,11 +978,6 @@ e100_open(struct net_device *dev) ...@@ -991,11 +978,6 @@ e100_open(struct net_device *dev)
del_timer_sync(&bdp->watchdog_timer); del_timer_sync(&bdp->watchdog_timer);
goto err_exit; goto err_exit;
} }
if (bdp->params.b_params & PRM_RX_CONG) {
DECLARE_TASKLET(polling_tasklet,
e100_polling_tasklet, (unsigned long) bdp);
bdp->polling_tasklet = polling_tasklet;
}
bdp->intr_mask = 0; bdp->intr_mask = 0;
e100_set_intr_mask(bdp); e100_set_intr_mask(bdp);
...@@ -1024,10 +1006,6 @@ e100_close(struct net_device *dev) ...@@ -1024,10 +1006,6 @@ e100_close(struct net_device *dev)
free_irq(dev->irq, dev); free_irq(dev->irq, dev);
e100_clear_pools(bdp); e100_clear_pools(bdp);
if (bdp->params.b_params & PRM_RX_CONG) {
tasklet_kill(&(bdp->polling_tasklet));
}
/* set the isolate flag to false, so e100_open can be called */ /* set the isolate flag to false, so e100_open can be called */
bdp->driver_isolated = false; bdp->driver_isolated = false;
...@@ -1802,47 +1780,6 @@ e100_manage_adaptive_ifs(struct e100_private *bdp) ...@@ -1802,47 +1780,6 @@ e100_manage_adaptive_ifs(struct e100_private *bdp)
} }
} }
void
e100_polling_tasklet(unsigned long ptr)
{
struct e100_private *bdp = (struct e100_private *) ptr;
unsigned int rx_congestion = 0;
u32 skb_cnt;
/* the device is closed, don't continue or else bad things may happen. */
if (!netif_running(bdp->device)) {
return;
}
read_lock(&(bdp->isolate_lock));
if (bdp->driver_isolated) {
tasklet_schedule(&(bdp->polling_tasklet));
goto exit;
}
e100_alloc_skbs(bdp);
skb_cnt = e100_rx_srv(bdp, bdp->params.PollingMaxWork, &rx_congestion);
bdp->drv_stats.rx_tasklet_pkts += skb_cnt;
if (rx_congestion || skb_cnt) {
tasklet_schedule(&(bdp->polling_tasklet));
} else {
bdp->intr_mask &= ~SCB_INT_MASK;
bdp->drv_stats.poll_intr_switch++;
}
bdp->tx_count = 0; /* restart tx interrupt batch count */
e100_tx_srv(bdp);
e100_set_intr_mask(bdp);
exit:
read_unlock(&(bdp->isolate_lock));
}
/** /**
* e100intr - interrupt handler * e100intr - interrupt handler
* @irq: the IRQ number * @irq: the IRQ number
...@@ -1892,18 +1829,8 @@ e100intr(int irq, void *dev_inst, struct pt_regs *regs) ...@@ -1892,18 +1829,8 @@ e100intr(int irq, void *dev_inst, struct pt_regs *regs)
/* do recv work if any */ /* do recv work if any */
if (intr_status & if (intr_status &
(SCB_STATUS_ACK_FR | SCB_STATUS_ACK_RNR | SCB_STATUS_ACK_SWI)) { (SCB_STATUS_ACK_FR | SCB_STATUS_ACK_RNR | SCB_STATUS_ACK_SWI))
int rx_congestion; bdp->drv_stats.rx_intr_pkts += e100_rx_srv(bdp);
bdp->drv_stats.rx_intr_pkts +=
e100_rx_srv(bdp, 0, &rx_congestion);
if ((bdp->params.b_params & PRM_RX_CONG) && rx_congestion) {
bdp->intr_mask |= SCB_INT_MASK;
tasklet_schedule(&(bdp->polling_tasklet));
bdp->drv_stats.poll_intr_switch++;
}
}
/* clean up after tx'ed packets */ /* clean up after tx'ed packets */
if (intr_status & (SCB_STATUS_ACK_CNA | SCB_STATUS_ACK_CX)) { if (intr_status & (SCB_STATUS_ACK_CNA | SCB_STATUS_ACK_CX)) {
...@@ -1997,8 +1924,7 @@ e100_tx_srv(struct e100_private *bdp) ...@@ -1997,8 +1924,7 @@ e100_tx_srv(struct e100_private *bdp)
* It returns the number of serviced RFDs. * It returns the number of serviced RFDs.
*/ */
u32 u32
e100_rx_srv(struct e100_private *bdp, u32 max_number_of_rfds, e100_rx_srv(struct e100_private *bdp)
int *rx_congestion)
{ {
rfd_t *rfd; /* new rfd, received rfd */ rfd_t *rfd; /* new rfd, received rfd */
int i; int i;
...@@ -2009,10 +1935,6 @@ e100_rx_srv(struct e100_private *bdp, u32 max_number_of_rfds, ...@@ -2009,10 +1935,6 @@ e100_rx_srv(struct e100_private *bdp, u32 max_number_of_rfds,
struct rx_list_elem *rx_struct; struct rx_list_elem *rx_struct;
u32 rfd_cnt = 0; u32 rfd_cnt = 0;
if (rx_congestion) {
*rx_congestion = 0;
}
dev = bdp->device; dev = bdp->device;
/* current design of rx is as following: /* current design of rx is as following:
...@@ -2027,9 +1949,6 @@ e100_rx_srv(struct e100_private *bdp, u32 max_number_of_rfds, ...@@ -2027,9 +1949,6 @@ e100_rx_srv(struct e100_private *bdp, u32 max_number_of_rfds,
* (watchdog trigger SWI intr and isr should allocate new skbs) * (watchdog trigger SWI intr and isr should allocate new skbs)
*/ */
for (i = 0; i < bdp->params.RxDescriptors; i++) { for (i = 0; i < bdp->params.RxDescriptors; i++) {
if (max_number_of_rfds && (rfd_cnt >= max_number_of_rfds)) {
break;
}
if (list_empty(&(bdp->active_rx_list))) { if (list_empty(&(bdp->active_rx_list))) {
break; break;
} }
...@@ -2094,20 +2013,12 @@ e100_rx_srv(struct e100_private *bdp, u32 max_number_of_rfds, ...@@ -2094,20 +2013,12 @@ e100_rx_srv(struct e100_private *bdp, u32 max_number_of_rfds,
} else { } else {
skb->ip_summed = CHECKSUM_NONE; skb->ip_summed = CHECKSUM_NONE;
} }
switch (netif_rx(skb)) { switch (netif_rx(skb)) {
case NET_RX_BAD: case NET_RX_BAD:
break;
case NET_RX_DROP: case NET_RX_DROP:
case NET_RX_CN_MOD: case NET_RX_CN_MOD:
case NET_RX_CN_HIGH: case NET_RX_CN_HIGH:
if (bdp->params.b_params & PRM_RX_CONG) { break;
if (rx_congestion) {
*rx_congestion = 1;
}
}
/* FALL THROUGH TO STATISTICS UPDATE */
default: default:
bdp->drv_stats.net_stats.rx_bytes += skb->len; bdp->drv_stats.net_stats.rx_bytes += skb->len;
break; break;
......
...@@ -249,8 +249,6 @@ static e100_proc_entry e100_proc_list[] = { ...@@ -249,8 +249,6 @@ static e100_proc_entry e100_proc_list[] = {
{"Rx_TCO_Packets", read_gen_ulong, 0, bdp_drv_off(rcv_tco_pkts)}, {"Rx_TCO_Packets", read_gen_ulong, 0, bdp_drv_off(rcv_tco_pkts)},
{"\n",}, {"\n",},
{"Rx_Interrupt_Packets", read_gen_ulong, 0, bdp_drv_off(rx_intr_pkts)}, {"Rx_Interrupt_Packets", read_gen_ulong, 0, bdp_drv_off(rx_intr_pkts)},
{"Rx_Polling_Packets", read_gen_ulong, 0, bdp_drv_off(rx_tasklet_pkts)},
{"Polling_Interrupt_Switch", read_gen_ulong, 0, bdp_drv_off(poll_intr_switch)},
{"Identify_Adapter", 0, write_blink_led_timer, 0}, {"Identify_Adapter", 0, write_blink_led_timer, 0},
{"", 0, 0, 0} {"", 0, 0, 0}
}; };
......
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