* Re: [PATCH 2.6.25 0/8][BNX2X]: bugfixes and updates
From: David Miller @ 2008-02-20 21:17 UTC (permalink / raw)
To: eliezert; +Cc: jeff, netdev
In-Reply-To: <1203528827.8232.85.camel@lb-tlvb-eliezer.il.broadcom.com>
From: "Eliezer Tamir" <eliezert@broadcom.com>
Date: Wed, 20 Feb 2008 19:33:47 +0200
> This patch-set updates several sections of the bnx2x driver.
It is not appropriate to be adding features at this time
to the 2.6.25 tree.
Please wait for the opportunity to submit 2.6.26 bound
patches for new features.
I encourage you to split out just the bug fixes from this
series and resubmit, thank you.
^ permalink raw reply
* Re: [git patches] net driver fixes
From: J. Bruce Fields @ 2008-02-20 21:23 UTC (permalink / raw)
To: David Miller; +Cc: jeff, netdev, linux-kernel
In-Reply-To: <20080220.131530.18314167.davem@davemloft.net>
On Wed, Feb 20, 2008 at 01:15:30PM -0800, David Miller wrote:
> From: Jeff Garzik <jeff@garzik.org>
> Date: Wed, 20 Feb 2008 11:55:57 -0500
>
> >
> > Note: this is based off of Linus's latest commit
> > (5d9c4a7de64d398604a978d267a6987f1f4025b7), since all my previous
> > submissions are now upstream (thanks!).
>
> The whole point of my not rebasing net-2.6 is so that you can always
> use it as a base.
>
> With what you've giving me now I either have to:
>
> 1) Pull in Linus's tree to net-2.6, then pull from you.
>
> 2) Pull in directly from you to get it all.
Why are either of those a problem?
--b.
^ permalink raw reply
* Re: TG3 network data corruption regression 2.6.24/2.6.23.4
From: Tony Battersby @ 2008-02-20 21:29 UTC (permalink / raw)
To: Matt Carlson
Cc: Michael Chan, David Miller, herbert, netdev, gregkh, linux-kernel
In-Reply-To: <20080220013824.GA5416@localdomain>
Update:
Herbert's patch alters the arguments to alloc_skb_fclone() and
skb_reserve() from within sk_stream_alloc_pskb(). This changes the
skb_headroom() and skb_tailroom() of the returned skb. I decided to see
if I could detect the precise point at which data corruption started to
happen. The result is this table:
(sk_stream_alloc_pskb() called with size == 1448;
sk->sk_prot->max_header == 160)
skb_headroom skb_tailroom test result note
216 1448 fail [1]
344 1448 fail
340 1452 pass
336 1456 pass
332 1460 pass
328 1464 fail
324 1468 pass
320 1472 pass
316 1476 pass
312 1480 fail
308 1484 pass
304 1488 pass
300 1492 pass
296 1496 fail
292 1500 pass
288 1504 pass
284 1508 pass
280 1512 fail
276 1516 pass
272 1520 pass
268 1524 pass
264 1528 fail
260 1532 pass
256 1536 pass [2]
Notes:
[1] Kernels 2.6.23.4 - 2.6.23.16 and 2.6.24 - current with Herbert's patch
[2] Kernels 2.6.23.3 and before without Herbert's patch
Note that the first row has skb_headroom + skb_tailroom == 1664; the
remaining rows have skb_headroom + skb_tailroom == 1792.
>From these results, it looks like a data alignment issue. Herbert's
patch unfortunately just happened to change the alignment in a way that
made it break.
Tony
^ permalink raw reply
* Re: [git patches] net driver fixes
From: David Miller @ 2008-02-20 21:42 UTC (permalink / raw)
To: bfields; +Cc: jeff, netdev, linux-kernel
In-Reply-To: <20080220212302.GJ30160@fieldses.org>
From: "J. Bruce Fields" <bfields@fieldses.org>
Date: Wed, 20 Feb 2008 16:23:02 -0500
> On Wed, Feb 20, 2008 at 01:15:30PM -0800, David Miller wrote:
> > From: Jeff Garzik <jeff@garzik.org>
> > Date: Wed, 20 Feb 2008 11:55:57 -0500
> >
> > >
> > > Note: this is based off of Linus's latest commit
> > > (5d9c4a7de64d398604a978d267a6987f1f4025b7), since all my previous
> > > submissions are now upstream (thanks!).
> >
> > The whole point of my not rebasing net-2.6 is so that you can always
> > use it as a base.
> >
> > With what you've giving me now I either have to:
> >
> > 1) Pull in Linus's tree to net-2.6, then pull from you.
> >
> > 2) Pull in directly from you to get it all.
>
> Why are either of those a problem?
Because it forces me to pull Linus's upstream into net-2.6,
I don't have any choice in the matter.
^ permalink raw reply
* [PATCH 2.6.25 1/4]S2io: Multiqueue network device support implementation
From: Sreenivasa Honnur @ 2008-02-20 21:44 UTC (permalink / raw)
To: netdev, jeff; +Cc: support
- Resubmit #3
Multiqueue netwrok device support implementation.
- Added a loadable parameter "multiq" to enable/disable multiqueue support,
by default it is disabled.
- skb->queue_mapping is not used for queue/fifo selection. FIFO selection is
based on skb->priority.
- Added per FIFO flags FIFO_QUEUE_START and FIFO_QUEUE_STOP. Check this flag
for starting and stopping netif queue and update the flags accordingly.
- In tx_intr_handler added a check to ensure that we have free TXDs before wak-
ing up the queue.
- Added helper functions for queue manipulation(start/stop/wakeup) to invoke
appropriate netif_ functions.
- Calling netif_start/stop for link up/down case respectively.
- As per Andi kleen's review comments, using skb->priority field for FIFO
selection.
Signed-off-by: Surjit Reang <surjit.reang@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
---
diff -Nurp 2-0-26-15-2/drivers/net/s2io.c 2-0-26-18-1/drivers/net/s2io.c
--- 2-0-26-15-2/drivers/net/s2io.c 2008-02-15 04:16:23.000000000 +0530
+++ 2-0-26-18-1/drivers/net/s2io.c 2008-02-15 05:15:41.000000000 +0530
@@ -50,6 +50,8 @@
* Possible values '1' for enable , '0' for disable.
* Default is '2' - which means disable in promisc mode
* and enable in non-promiscuous mode.
+ * multiq: This parameter used to enable/disable MULTIQUEUE support.
+ * Possible values '1' for enable and '0' for disable. Default is '0'
************************************************************************/
#include <linux/module.h>
@@ -458,8 +460,7 @@ MODULE_VERSION(DRV_VERSION);
/* Module Loadable parameters. */
S2IO_PARM_INT(tx_fifo_num, 1);
S2IO_PARM_INT(rx_ring_num, 1);
-
-
+S2IO_PARM_INT(multiq, 0);
S2IO_PARM_INT(rx_ring_mode, 1);
S2IO_PARM_INT(use_continuous_tx_intrs, 1);
S2IO_PARM_INT(rmac_pause_time, 0x100);
@@ -533,6 +534,101 @@ static struct pci_driver s2io_driver = {
/* A simplifier macro used both by init and free shared_mem Fns(). */
#define TXD_MEM_PAGE_CNT(len, per_each) ((len+per_each - 1) / per_each)
+/* netqueue manipulation helper functions */
+static inline void s2io_stop_all_tx_queue(struct s2io_nic *sp)
+{
+ int i;
+#ifdef CONFIG_NETDEVICES_MULTIQUEUE
+ if (sp->config.multiq) {
+ for (i = 0; i < sp->config.tx_fifo_num; i++)
+ netif_stop_subqueue(sp->dev, i);
+ } else
+#endif
+ {
+ for (i = 0; i < sp->config.tx_fifo_num; i++)
+ sp->mac_control.fifos[i].queue_state = FIFO_QUEUE_STOP;
+ netif_stop_queue(sp->dev);
+ }
+}
+
+static inline void s2io_stop_tx_queue(struct s2io_nic *sp, int fifo_no)
+{
+#ifdef CONFIG_NETDEVICES_MULTIQUEUE
+ if (sp->config.multiq)
+ netif_stop_subqueue(sp->dev, fifo_no);
+ else
+#endif
+ {
+ sp->mac_control.fifos[fifo_no].queue_state =
+ FIFO_QUEUE_STOP;
+ netif_stop_queue(sp->dev);
+ }
+}
+
+static inline void s2io_start_all_tx_queue(struct s2io_nic *sp)
+{
+ int i;
+#ifdef CONFIG_NETDEVICES_MULTIQUEUE
+ if (sp->config.multiq) {
+ for (i = 0; i < sp->config.tx_fifo_num; i++)
+ netif_start_subqueue(sp->dev, i);
+ } else
+#endif
+ {
+ for (i = 0; i < sp->config.tx_fifo_num; i++)
+ sp->mac_control.fifos[i].queue_state = FIFO_QUEUE_START;
+ netif_start_queue(sp->dev);
+ }
+}
+
+static inline void s2io_start_tx_queue(struct s2io_nic *sp, int fifo_no)
+{
+#ifdef CONFIG_NETDEVICES_MULTIQUEUE
+ if (sp->config.multiq)
+ netif_start_subqueue(sp->dev, fifo_no);
+ else
+#endif
+ {
+ sp->mac_control.fifos[fifo_no].queue_state =
+ FIFO_QUEUE_START;
+ netif_start_queue(sp->dev);
+ }
+}
+
+static inline void s2io_wake_all_tx_queue(struct s2io_nic *sp)
+{
+ int i;
+#ifdef CONFIG_NETDEVICES_MULTIQUEUE
+ if (sp->config.multiq) {
+ for (i = 0; i < sp->config.tx_fifo_num; i++)
+ netif_wake_subqueue(sp->dev, i);
+ } else
+#endif
+ {
+ for (i = 0; i < sp->config.tx_fifo_num; i++)
+ sp->mac_control.fifos[i].queue_state = FIFO_QUEUE_START;
+ netif_wake_queue(sp->dev);
+ }
+}
+
+static inline void s2io_wake_tx_queue(
+ struct fifo_info *fifo, int cnt, u8 multiq)
+{
+
+#ifdef CONFIG_NETDEVICES_MULTIQUEUE
+ if (multiq) {
+ if (cnt && __netif_subqueue_stopped(fifo->dev, fifo->fifo_no))
+ netif_wake_subqueue(fifo->dev, fifo->fifo_no);
+ } else
+#endif
+ if (cnt && (fifo->queue_state == FIFO_QUEUE_STOP)) {
+ if (netif_queue_stopped(fifo->dev)) {
+ fifo->queue_state = FIFO_QUEUE_START;
+ netif_wake_queue(fifo->dev);
+ }
+ }
+}
+
/**
* init_shared_mem - Allocation and Initialization of Memory
* @nic: Device private variable.
@@ -614,6 +710,7 @@ static int init_shared_mem(struct s2io_n
mac_control->fifos[i].fifo_no = i;
mac_control->fifos[i].nic = nic;
mac_control->fifos[i].max_txds = MAX_SKB_FRAGS + 2;
+ mac_control->fifos[i].dev = dev;
for (j = 0; j < page_num; j++) {
int k = 0;
@@ -2972,10 +3069,10 @@ static void rx_intr_handler(struct ring_
static void tx_intr_handler(struct fifo_info *fifo_data)
{
struct s2io_nic *nic = fifo_data->nic;
- struct net_device *dev = (struct net_device *) nic->dev;
struct tx_curr_get_info get_info, put_info;
- struct sk_buff *skb;
+ struct sk_buff *skb = NULL;
struct TxD *txdlp;
+ int pkt_cnt = 0;
unsigned long flags = 0;
u8 err_mask;
@@ -3036,6 +3133,7 @@ static void tx_intr_handler(struct fifo_
DBG_PRINT(ERR_DBG, "in Tx Free Intr\n");
return;
}
+ pkt_cnt++;
/* Updating the statistics block */
nic->stats.tx_bytes += skb->len;
@@ -3051,8 +3149,7 @@ static void tx_intr_handler(struct fifo_
get_info.offset;
}
- if (netif_queue_stopped(dev))
- netif_wake_queue(dev);
+ s2io_wake_tx_queue(fifo_data, pkt_cnt, nic->config.multiq);
spin_unlock_irqrestore(&fifo_data->tx_lock, flags);
}
@@ -3933,8 +4030,7 @@ static int s2io_open(struct net_device *
err = -ENODEV;
goto hw_init_failed;
}
-
- netif_start_queue(dev);
+ s2io_start_all_tx_queue(sp);
return 0;
hw_init_failed:
@@ -3979,8 +4075,7 @@ static int s2io_close(struct net_device
if (!is_s2io_card_up(sp))
return 0;
- netif_stop_queue(dev);
-
+ s2io_stop_all_tx_queue(sp);
/* delete all populated mac entries */
for (offset = 1; offset < config->max_mc_addr; offset++) {
tmp64 = do_s2io_read_unicast_mc(sp, offset);
@@ -4016,7 +4111,6 @@ static int s2io_xmit(struct sk_buff *skb
struct TxFIFO_element __iomem *tx_fifo;
unsigned long flags = 0;
u16 vlan_tag = 0;
- int vlan_priority = 0;
struct fifo_info *fifo = NULL;
struct mac_info *mac_control;
struct config_param *config;
@@ -4043,14 +4137,29 @@ static int s2io_xmit(struct sk_buff *skb
queue = 0;
/* Get Fifo number to Transmit based on vlan priority */
- if (sp->vlgrp && vlan_tx_tag_present(skb)) {
+ if (sp->vlgrp && vlan_tx_tag_present(skb))
vlan_tag = vlan_tx_tag_get(skb);
- vlan_priority = vlan_tag >> 13;
- queue = config->fifo_mapping[vlan_priority];
- }
+
+ /* get fifo number based on skb->priority value */
+ queue = config->fifo_mapping[skb->priority & (MAX_TX_FIFOS - 1)];
fifo = &mac_control->fifos[queue];
spin_lock_irqsave(&fifo->tx_lock, flags);
+#ifdef CONFIG_NETDEVICES_MULTIQUEUE
+ if (sp->config.multiq) {
+ if (__netif_subqueue_stopped(dev, fifo->fifo_no)) {
+ spin_unlock_irqrestore(&fifo->tx_lock, flags);
+ return NETDEV_TX_BUSY;
+ }
+ } else
+#endif
+ if (unlikely(fifo->queue_state == FIFO_QUEUE_STOP)) {
+ if (netif_queue_stopped(dev)) {
+ spin_unlock_irqrestore(&fifo->tx_lock, flags);
+ return NETDEV_TX_BUSY;
+ }
+ }
+
put_off = (u16) fifo->tx_curr_put_info.offset;
get_off = (u16) fifo->tx_curr_get_info.offset;
txdp = (struct TxD *) fifo->list_info[put_off].list_virt_addr;
@@ -4060,7 +4169,7 @@ static int s2io_xmit(struct sk_buff *skb
if (txdp->Host_Control ||
((put_off+1) == queue_len ? 0 : (put_off+1)) == get_off) {
DBG_PRINT(TX_DBG, "Error in xmit, No free TXDs.\n");
- netif_stop_queue(dev);
+ s2io_stop_tx_queue(sp, fifo->fifo_no);
dev_kfree_skb(skb);
spin_unlock_irqrestore(&fifo->tx_lock, flags);
return 0;
@@ -4080,7 +4189,7 @@ static int s2io_xmit(struct sk_buff *skb
txdp->Control_1 |= TXD_LIST_OWN_XENA;
txdp->Control_2 |= TXD_INT_NUMBER(fifo->fifo_no);
- if (sp->vlgrp && vlan_tx_tag_present(skb)) {
+ if (vlan_tag) {
txdp->Control_2 |= TXD_VLAN_ENABLE;
txdp->Control_2 |= TXD_VLAN_TAG(vlan_tag);
}
@@ -4166,7 +4275,7 @@ static int s2io_xmit(struct sk_buff *skb
DBG_PRINT(TX_DBG,
"No free TxDs for xmit, Put: 0x%x Get:0x%x\n",
put_off, get_off);
- netif_stop_queue(dev);
+ s2io_stop_tx_queue(sp, fifo->fifo_no);
}
mac_control->stats_info->sw_stat.mem_allocated += skb->truesize;
dev->trans_start = jiffies;
@@ -4175,7 +4284,7 @@ static int s2io_xmit(struct sk_buff *skb
return 0;
pci_map_failed:
stats->pci_map_fail_cnt++;
- netif_stop_queue(dev);
+ s2io_stop_tx_queue(sp, fifo->fifo_no);
stats->mem_freed += skb->truesize;
dev_kfree_skb(skb);
spin_unlock_irqrestore(&fifo->tx_lock, flags);
@@ -4587,7 +4696,7 @@ static void s2io_handle_errors(void * de
return;
reset:
- netif_stop_queue(dev);
+ s2io_stop_all_tx_queue(sp);
schedule_work(&sp->rst_timer_task);
sw_stat->soft_reset_cnt++;
return;
@@ -6574,16 +6683,15 @@ static int s2io_change_mtu(struct net_de
dev->mtu = new_mtu;
if (netif_running(dev)) {
+ s2io_stop_all_tx_queue(sp);
s2io_card_down(sp);
- netif_stop_queue(dev);
ret = s2io_card_up(sp);
if (ret) {
DBG_PRINT(ERR_DBG, "%s: Device bring up failed\n",
__FUNCTION__);
return ret;
}
- if (netif_queue_stopped(dev))
- netif_wake_queue(dev);
+ s2io_wake_all_tx_queue(sp);
} else { /* Device is down */
struct XENA_dev_config __iomem *bar0 = sp->bar0;
u64 val64 = new_mtu;
@@ -6691,7 +6799,7 @@ static void s2io_set_link(struct work_st
} else {
DBG_PRINT(ERR_DBG, "%s: Error: ", dev->name);
DBG_PRINT(ERR_DBG, "device is not Quiescent\n");
- netif_stop_queue(dev);
+ s2io_stop_all_tx_queue(nic);
}
}
val64 = readq(&bar0->adapter_control);
@@ -7181,7 +7289,7 @@ static void s2io_restart_nic(struct work
DBG_PRINT(ERR_DBG, "%s: Device bring up failed\n",
dev->name);
}
- netif_wake_queue(dev);
+ s2io_wake_all_tx_queue(sp);
DBG_PRINT(ERR_DBG, "%s: was reset by Tx watchdog timer\n",
dev->name);
out_unlock:
@@ -7460,6 +7568,7 @@ static void s2io_link(struct s2io_nic *
init_tti(sp, link);
if (link == LINK_DOWN) {
DBG_PRINT(ERR_DBG, "%s: Link down\n", dev->name);
+ s2io_stop_all_tx_queue(sp);
netif_carrier_off(dev);
if(sp->mac_control.stats_info->sw_stat.link_up_cnt)
sp->mac_control.stats_info->sw_stat.link_up_time =
@@ -7472,6 +7581,7 @@ static void s2io_link(struct s2io_nic *
jiffies - sp->start_time;
sp->mac_control.stats_info->sw_stat.link_up_cnt++;
netif_carrier_on(dev);
+ s2io_wake_all_tx_queue(sp);
}
}
sp->last_link_state = link;
@@ -7508,7 +7618,8 @@ static void s2io_init_pci(struct s2io_ni
pci_read_config_word(sp->pdev, PCI_COMMAND, &pci_cmd);
}
-static int s2io_verify_parm(struct pci_dev *pdev, u8 *dev_intr_type)
+static int s2io_verify_parm(struct pci_dev *pdev, u8 *dev_intr_type,
+ u8 *dev_multiq)
{
if ((tx_fifo_num > MAX_TX_FIFOS) ||
(tx_fifo_num < FIFO_DEFAULT_NUM)) {
@@ -7522,6 +7633,18 @@ static int s2io_verify_parm(struct pci_d
DBG_PRINT(ERR_DBG, "tx fifos\n");
}
+#ifndef CONFIG_NETDEVICES_MULTIQUEUE
+ if (multiq) {
+ DBG_PRINT(ERR_DBG, "s2io: Multiqueue support not enabled\n");
+ multiq = 0;
+ }
+#endif
+ /* if multiqueue is enabled configure all fifos */
+ if (multiq) {
+ tx_fifo_num = MAX_TX_FIFOS;
+ *dev_multiq = multiq;
+ }
+
if ( rx_ring_num > 8) {
DBG_PRINT(ERR_DBG, "s2io: Requested number of Rx rings not "
"supported\n");
@@ -7613,9 +7736,11 @@ s2io_init_nic(struct pci_dev *pdev, cons
struct config_param *config;
int mode;
u8 dev_intr_type = intr_type;
+ u8 dev_multiq = 0;
DECLARE_MAC_BUF(mac);
- if ((ret = s2io_verify_parm(pdev, &dev_intr_type)))
+ ret = s2io_verify_parm(pdev, &dev_intr_type, &dev_multiq);
+ if (ret)
return ret;
if ((ret = pci_enable_device(pdev))) {
@@ -7646,7 +7771,11 @@ s2io_init_nic(struct pci_dev *pdev, cons
pci_disable_device(pdev);
return -ENODEV;
}
-
+#ifdef CONFIG_NETDEVICES_MULTIQUEUE
+ if (dev_multiq)
+ dev = alloc_etherdev_mq(sizeof(struct s2io_nic), MAX_TX_FIFOS);
+ else
+#endif
dev = alloc_etherdev(sizeof(struct s2io_nic));
if (dev == NULL) {
DBG_PRINT(ERR_DBG, "Device allocation failed\n");
@@ -7698,6 +7827,7 @@ s2io_init_nic(struct pci_dev *pdev, cons
/* Tx side parameters. */
config->tx_fifo_num = tx_fifo_num;
+ config->multiq = dev_multiq;
for (i = 0; i < MAX_TX_FIFOS; i++) {
config->tx_cfg[i].fifo_len = tx_fifo_len[i];
config->tx_cfg[i].fifo_priority = i;
@@ -7705,7 +7835,7 @@ s2io_init_nic(struct pci_dev *pdev, cons
/* mapping the QoS priority to the configured fifos */
for (i = 0; i < MAX_TX_FIFOS; i++)
- config->fifo_mapping[i] = fifo_map[config->tx_fifo_num][i];
+ config->fifo_mapping[i] = fifo_map[config->tx_fifo_num - 1][i];
config->tx_intr_type = TXD_INT_TYPE_UTILZ;
for (i = 0; i < config->tx_fifo_num; i++) {
@@ -7810,7 +7940,10 @@ s2io_init_nic(struct pci_dev *pdev, cons
dev->features |= NETIF_F_UFO;
dev->features |= NETIF_F_HW_CSUM;
}
-
+#ifdef CONFIG_NETDEVICES_MULTIQUEUE
+ if (config->multiq)
+ dev->features |= NETIF_F_MULTI_QUEUE;
+#endif
dev->tx_timeout = &s2io_tx_watchdog;
dev->watchdog_timeo = WATCH_DOG_TIMEOUT;
INIT_WORK(&sp->rst_timer_task, s2io_restart_nic);
@@ -7959,6 +8092,10 @@ s2io_init_nic(struct pci_dev *pdev, cons
if (napi)
DBG_PRINT(ERR_DBG, "%s: NAPI enabled\n", dev->name);
+
+ DBG_PRINT(ERR_DBG, "%s: Using %d Tx fifo(s)\n", dev->name,
+ sp->config.tx_fifo_num);
+
switch(sp->config.intr_type) {
case INTA:
DBG_PRINT(ERR_DBG, "%s: Interrupt type INTA\n", dev->name);
@@ -7967,6 +8104,15 @@ s2io_init_nic(struct pci_dev *pdev, cons
DBG_PRINT(ERR_DBG, "%s: Interrupt type MSI-X\n", dev->name);
break;
}
+ if (sp->config.multiq) {
+ for (i = 0; i < sp->config.tx_fifo_num; i++)
+ mac_control->fifos[i].multiq = config->multiq;
+ DBG_PRINT(ERR_DBG, "%s: Multiqueue support enabled\n",
+ dev->name);
+ } else
+ DBG_PRINT(ERR_DBG, "%s: Multiqueue support disabled\n",
+ dev->name);
+
if (sp->lro)
DBG_PRINT(ERR_DBG, "%s: Large receive offload enabled\n",
dev->name);
diff -Nurp 2-0-26-15-2/drivers/net/s2io.h 2-0-26-18-1/drivers/net/s2io.h
--- 2-0-26-15-2/drivers/net/s2io.h 2008-02-15 04:16:23.000000000 +0530
+++ 2-0-26-18-1/drivers/net/s2io.h 2008-02-15 05:15:49.000000000 +0530
@@ -464,6 +464,7 @@ struct config_param {
int max_mc_addr; /* xena=64 herc=256 */
int max_mac_addr; /* xena=16 herc=64 */
int mc_start_offset; /* xena=16 herc=64 */
+ u8 multiq;
};
/* Structure representing MAC Addrs */
@@ -720,6 +721,15 @@ struct fifo_info {
* the buffers
*/
struct tx_curr_get_info tx_curr_get_info;
+#define FIFO_QUEUE_START 0
+#define FIFO_QUEUE_STOP 1
+ int queue_state;
+
+ /* copy of sp->dev pointer */
+ struct net_device *dev;
+
+ /* copy of multiq status */
+ u8 multiq;
/* Per fifo lock */
spinlock_t tx_lock;
^ permalink raw reply
* Re: [PATCH] sungem: remove superfluous variable
From: Joe Perches @ 2008-02-20 21:47 UTC (permalink / raw)
To: Johannes Berg; +Cc: David S. Miller, netdev
In-Reply-To: <1203534567.7181.200.camel@localhost>
Make sungem.c checkpatch error clean
gem_rx: reuse dma_addr temporary
gem_clean_rings: remove an indentation level
80 columns (not function definitions)
Remove spaces before tabs
__inline__ to inline
labels in column 1
printk cleanup
begnign/benign typo
Signed-off-by: Joe Perches
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index 9721279..c7f9875 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -97,7 +97,7 @@
#define DRV_AUTHOR "David S. Miller (davem@redhat.com)"
static char version[] __devinitdata =
- DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " " DRV_AUTHOR "\n";
+ DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " " DRV_AUTHOR "\n";
MODULE_AUTHOR(DRV_AUTHOR);
MODULE_DESCRIPTION("Sun GEM Gbit ethernet driver");
@@ -258,7 +258,7 @@ static int gem_pcs_interrupt(struct net_device *dev, struct gem *gp, u32 gem_sta
if (netif_msg_intr(gp))
printk(KERN_DEBUG "%s: pcs interrupt, pcs_istat: 0x%x\n",
- gp->dev->name, pcs_istat);
+ gp->dev->name, pcs_istat);
if (!(pcs_istat & PCS_ISTAT_LSC)) {
printk(KERN_ERR "%s: PCS irq but no link status change???\n",
@@ -284,17 +284,15 @@ static int gem_pcs_interrupt(struct net_device *dev, struct gem *gp, u32 gem_sta
printk(KERN_INFO "%s: PCS AutoNEG complete, "
"RemoteFault\n", dev->name);
else
- printk(KERN_INFO "%s: PCS AutoNEG complete.\n",
+ printk(KERN_INFO "%s: PCS AutoNEG complete\n",
dev->name);
}
if (pcs_miistat & PCS_MIISTAT_LS) {
- printk(KERN_INFO "%s: PCS link is now up.\n",
- dev->name);
+ printk(KERN_INFO "%s: PCS link is now up\n", dev->name);
netif_carrier_on(gp->dev);
} else {
- printk(KERN_INFO "%s: PCS link is now down.\n",
- dev->name);
+ printk(KERN_INFO "%s: PCS link is now down\n", dev->name);
netif_carrier_off(gp->dev);
/* If this happens and the link timer is not running,
* reset so we re-negotiate.
@@ -312,7 +310,7 @@ static int gem_txmac_interrupt(struct net_device *dev, struct gem *gp, u32 gem_s
if (netif_msg_intr(gp))
printk(KERN_DEBUG "%s: txmac interrupt, txmac_stat: 0x%x\n",
- gp->dev->name, txmac_stat);
+ gp->dev->name, txmac_stat);
/* Defer timer expiration is quite normal,
* don't even log the event.
@@ -322,13 +320,12 @@ static int gem_txmac_interrupt(struct net_device *dev, struct gem *gp, u32 gem_s
return 0;
if (txmac_stat & MAC_TXSTAT_URUN) {
- printk(KERN_ERR "%s: TX MAC xmit underrun.\n",
- dev->name);
+ printk(KERN_ERR "%s: TX MAC xmit underrun\n", dev->name);
gp->net_stats.tx_fifo_errors++;
}
if (txmac_stat & MAC_TXSTAT_MPE) {
- printk(KERN_ERR "%s: TX MAC max packet size error.\n",
+ printk(KERN_ERR "%s: TX MAC max packet size error\n",
dev->name);
gp->net_stats.tx_errors++;
}
@@ -376,8 +373,8 @@ static int gem_rxmac_reset(struct gem *gp)
udelay(10);
}
if (limit == 5000) {
- printk(KERN_ERR "%s: RX MAC will not reset, resetting whole "
- "chip.\n", dev->name);
+ printk(KERN_ERR "%s: RX MAC will not reset, "
+ "resetting whole chip\n", dev->name);
return 1;
}
@@ -389,8 +386,8 @@ static int gem_rxmac_reset(struct gem *gp)
udelay(10);
}
if (limit == 5000) {
- printk(KERN_ERR "%s: RX MAC will not disable, resetting whole "
- "chip.\n", dev->name);
+ printk(KERN_ERR "%s: RX MAC will not disable, "
+ "resetting whole chip\n", dev->name);
return 1;
}
@@ -402,8 +399,8 @@ static int gem_rxmac_reset(struct gem *gp)
udelay(10);
}
if (limit == 5000) {
- printk(KERN_ERR "%s: RX DMA will not disable, resetting whole "
- "chip.\n", dev->name);
+ printk(KERN_ERR "%s: RX DMA will not disable, "
+ "resetting whole chip\n", dev->name);
return 1;
}
@@ -418,8 +415,8 @@ static int gem_rxmac_reset(struct gem *gp)
udelay(10);
}
if (limit == 5000) {
- printk(KERN_ERR "%s: RX reset command will not execute, resetting "
- "whole chip.\n", dev->name);
+ printk(KERN_ERR "%s: RX reset command will not execute, "
+ "resetting whole chip\n", dev->name);
return 1;
}
@@ -428,8 +425,8 @@ static int gem_rxmac_reset(struct gem *gp)
struct gem_rxd *rxd = &gp->init_block->rxd[i];
if (gp->rx_skbs[i] == NULL) {
- printk(KERN_ERR "%s: Parts of RX ring empty, resetting "
- "whole chip.\n", dev->name);
+ printk(KERN_ERR "%s: Parts of RX ring empty, "
+ "resetting whole chip\n", dev->name);
return 1;
}
@@ -473,13 +470,13 @@ static int gem_rxmac_interrupt(struct net_device *dev, struct gem *gp, u32 gem_s
if (netif_msg_intr(gp))
printk(KERN_DEBUG "%s: rxmac interrupt, rxmac_stat: 0x%x\n",
- gp->dev->name, rxmac_stat);
+ gp->dev->name, rxmac_stat);
if (rxmac_stat & MAC_RXSTAT_OFLW) {
u32 smac = readl(gp->regs + MAC_SMACHINE);
- printk(KERN_ERR "%s: RX MAC fifo overflow smac[%08x].\n",
- dev->name, smac);
+ printk(KERN_ERR "%s: RX MAC fifo overflow smac[%08x]\n",
+ dev->name, smac);
gp->net_stats.rx_over_errors++;
gp->net_stats.rx_fifo_errors++;
@@ -507,7 +504,7 @@ static int gem_mac_interrupt(struct net_device *dev, struct gem *gp, u32 gem_sta
if (netif_msg_intr(gp))
printk(KERN_DEBUG "%s: mac interrupt, mac_cstat: 0x%x\n",
- gp->dev->name, mac_cstat);
+ gp->dev->name, mac_cstat);
/* This interrupt is just for pause frame and pause
* tracking. It is useful for diagnostics and debug
@@ -541,16 +538,15 @@ static int gem_pci_interrupt(struct net_device *dev, struct gem *gp, u32 gem_sta
if (gp->pdev->vendor == PCI_VENDOR_ID_SUN &&
gp->pdev->device == PCI_DEVICE_ID_SUN_GEM) {
- printk(KERN_ERR "%s: PCI error [%04x] ",
- dev->name, pci_estat);
+ printk(KERN_ERR "%s: PCI error [%04x]", dev->name, pci_estat);
if (pci_estat & GREG_PCIESTAT_BADACK)
- printk("<No ACK64# during ABS64 cycle> ");
+ printk(KERN_CONT " <No ACK64# during ABS64 cycle>");
if (pci_estat & GREG_PCIESTAT_DTRTO)
- printk("<Delayed transaction timeout> ");
+ printk(KERN_CONT " <Delayed transaction timeout>");
if (pci_estat & GREG_PCIESTAT_OTHER)
- printk("<other>");
- printk("\n");
+ printk(KERN_CONT " <other>");
+ printk(KERN_CONT "\n");
} else {
pci_estat |= GREG_PCIESTAT_OTHER;
printk(KERN_ERR "%s: PCI error\n", dev->name);
@@ -567,22 +563,22 @@ static int gem_pci_interrupt(struct net_device *dev, struct gem *gp, u32 gem_sta
printk(KERN_ERR "%s: Read PCI cfg space status [%04x]\n",
dev->name, pci_cfg_stat);
if (pci_cfg_stat & PCI_STATUS_PARITY)
- printk(KERN_ERR "%s: PCI parity error detected.\n",
+ printk(KERN_ERR "%s: PCI parity error detected\n",
dev->name);
if (pci_cfg_stat & PCI_STATUS_SIG_TARGET_ABORT)
- printk(KERN_ERR "%s: PCI target abort.\n",
+ printk(KERN_ERR "%s: PCI target abort\n",
dev->name);
if (pci_cfg_stat & PCI_STATUS_REC_TARGET_ABORT)
- printk(KERN_ERR "%s: PCI master acks target abort.\n",
+ printk(KERN_ERR "%s: PCI master acks target abort\n",
dev->name);
if (pci_cfg_stat & PCI_STATUS_REC_MASTER_ABORT)
- printk(KERN_ERR "%s: PCI master abort.\n",
+ printk(KERN_ERR "%s: PCI master abort\n",
dev->name);
if (pci_cfg_stat & PCI_STATUS_SIG_SYSTEM_ERROR)
- printk(KERN_ERR "%s: PCI system error SERR#.\n",
+ printk(KERN_ERR "%s: PCI system error SERR#\n",
dev->name);
if (pci_cfg_stat & PCI_STATUS_DETECTED_PARITY)
- printk(KERN_ERR "%s: PCI parity error.\n",
+ printk(KERN_ERR "%s: PCI parity error\n",
dev->name);
/* Write the error bits back to clear them. */
@@ -611,7 +607,7 @@ static int gem_abnormal_irq(struct net_device *dev, struct gem *gp, u32 gem_stat
/* Frame arrived, no free RX buffers available. */
if (netif_msg_rx_err(gp))
printk(KERN_DEBUG "%s: no buffer for rx frame\n",
- gp->dev->name);
+ gp->dev->name);
gp->net_stats.rx_dropped++;
}
@@ -619,7 +615,7 @@ static int gem_abnormal_irq(struct net_device *dev, struct gem *gp, u32 gem_stat
/* corrupt RX tag framing */
if (netif_msg_rx_err(gp))
printk(KERN_DEBUG "%s: corrupt rx tag framing\n",
- gp->dev->name);
+ gp->dev->name);
gp->net_stats.rx_errors++;
goto do_reset;
@@ -664,13 +660,13 @@ do_reset:
return 1;
}
-static __inline__ void gem_tx(struct net_device *dev, struct gem *gp, u32 gem_status)
+static inline void gem_tx(struct net_device *dev, struct gem *gp, u32 gem_status)
{
int entry, limit;
if (netif_msg_intr(gp))
printk(KERN_DEBUG "%s: tx interrupt, gem_status: 0x%x\n",
- gp->dev->name, gem_status);
+ gp->dev->name, gem_status);
entry = gp->tx_old;
limit = ((gem_status & GREG_STAT_TXNR) >> GREG_STAT_TXNR_SHIFT);
@@ -683,7 +679,7 @@ static __inline__ void gem_tx(struct net_device *dev, struct gem *gp, u32 gem_st
if (netif_msg_tx_done(gp))
printk(KERN_DEBUG "%s: tx done, slot %d\n",
- gp->dev->name, entry);
+ gp->dev->name, entry);
skb = gp->tx_skbs[entry];
if (skb_shinfo(skb)->nr_frags) {
int last = entry + skb_shinfo(skb)->nr_frags;
@@ -708,9 +704,11 @@ static __inline__ void gem_tx(struct net_device *dev, struct gem *gp, u32 gem_st
txd = &gp->init_block->txd[entry];
dma_addr = le64_to_cpu(txd->buffer);
- dma_len = le64_to_cpu(txd->control_word) & TXDCTRL_BUFSZ;
+ dma_len = le64_to_cpu(txd->control_word) &
+ TXDCTRL_BUFSZ;
- pci_unmap_page(gp->pdev, dma_addr, dma_len, PCI_DMA_TODEVICE);
+ pci_unmap_page(gp->pdev, dma_addr, dma_len,
+ PCI_DMA_TODEVICE);
entry = NEXT_TX(entry);
}
@@ -724,7 +722,7 @@ static __inline__ void gem_tx(struct net_device *dev, struct gem *gp, u32 gem_st
netif_wake_queue(dev);
}
-static __inline__ void gem_post_rxds(struct gem *gp, int limit)
+static inline void gem_post_rxds(struct gem *gp, int limit)
{
int cluster_start, curr, count, kick;
@@ -738,7 +736,8 @@ static __inline__ void gem_post_rxds(struct gem *gp, int limit)
struct gem_rxd *rxd =
&gp->init_block->rxd[cluster_start];
for (;;) {
- rxd->status_word = cpu_to_le64(RXDCTRL_FRESH(gp));
+ rxd->status_word =
+ cpu_to_le64(RXDCTRL_FRESH(gp));
rxd++;
cluster_start = NEXT_RX(cluster_start);
if (cluster_start == curr)
@@ -762,7 +761,7 @@ static int gem_rx(struct gem *gp, int work_to_do)
if (netif_msg_rx_status(gp))
printk(KERN_DEBUG "%s: rx interrupt, done: %d, rx_new: %d\n",
- gp->dev->name, readl(gp->regs + RXDMA_DONE), gp->rx_new);
+ gp->dev->name, readl(gp->regs + RXDMA_DONE), gp->rx_new);
entry = gp->rx_new;
drops = 0;
@@ -807,7 +806,7 @@ static int gem_rx(struct gem *gp, int work_to_do)
gp->net_stats.rx_crc_errors++;
/* We'll just return it to GEM. */
- drop_it:
+drop_it:
gp->net_stats.rx_dropped++;
goto next;
}
@@ -815,8 +814,8 @@ static int gem_rx(struct gem *gp, int work_to_do)
dma_addr = le64_to_cpu(rxd->buffer);
if (len > RX_COPY_THRESHOLD) {
struct sk_buff *new_skb;
-
- new_skb = gem_alloc_skb(RX_BUF_ALLOC_SIZE(gp), GFP_ATOMIC);
+ new_skb = gem_alloc_skb(RX_BUF_ALLOC_SIZE(gp),
+ GFP_ATOMIC);
if (new_skb == NULL) {
drops++;
goto drop_it;
@@ -827,11 +826,12 @@ static int gem_rx(struct gem *gp, int work_to_do)
gp->rx_skbs[entry] = new_skb;
new_skb->dev = gp->dev;
skb_put(new_skb, (gp->rx_buf_sz + RX_OFFSET));
- rxd->buffer = cpu_to_le64(pci_map_page(gp->pdev,
- virt_to_page(new_skb->data),
- offset_in_page(new_skb->data),
- RX_BUF_ALLOC_SIZE(gp),
- PCI_DMA_FROMDEVICE));
+ dma_addr = pci_map_page(gp->pdev,
+ virt_to_page(new_skb->data),
+ offset_in_page(new_skb->data),
+ RX_BUF_ALLOC_SIZE(gp),
+ PCI_DMA_FROMDEVICE);
+ rxd->buffer = cpu_to_le64(dma_addr);
skb_reserve(new_skb, RX_OFFSET);
/* Trim the original skb for the netif. */
@@ -846,15 +846,18 @@ static int gem_rx(struct gem *gp, int work_to_do)
skb_reserve(copy_skb, 2);
skb_put(copy_skb, len);
- pci_dma_sync_single_for_cpu(gp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE);
+ pci_dma_sync_single_for_cpu(gp->pdev, dma_addr, len,
+ PCI_DMA_FROMDEVICE);
skb_copy_from_linear_data(skb, copy_skb->data, len);
- pci_dma_sync_single_for_device(gp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE);
+ pci_dma_sync_single_for_device(gp->pdev, dma_addr, len,
+ PCI_DMA_FROMDEVICE);
/* We'll reuse the original ring buffer. */
skb = copy_skb;
}
- csum = (__force __sum16)htons((status & RXDCTRL_TCPCSUM) ^ 0xffff);
+ csum = (__force __sum16)
+ htons((status & RXDCTRL_TCPCSUM) ^ 0xffff);
skb->csum = csum_unfold(csum);
skb->ip_summed = CHECKSUM_COMPLETE;
skb->protocol = eth_type_trans(skb, gp->dev);
@@ -865,7 +868,7 @@ static int gem_rx(struct gem *gp, int work_to_do)
gp->net_stats.rx_bytes += len;
gp->dev->last_rx = jiffies;
- next:
+next:
entry = NEXT_RX(entry);
}
@@ -874,7 +877,7 @@ static int gem_rx(struct gem *gp, int work_to_do)
gp->rx_new = entry;
if (drops)
- printk(KERN_INFO "%s: Memory squeeze, deferring packet.\n",
+ printk(KERN_INFO "%s: Memory squeeze, deferring packet\n",
gp->dev->name);
return work_done;
@@ -983,7 +986,7 @@ static void gem_tx_timeout(struct net_device *dev)
printk(KERN_ERR "%s: transmit timed out, resetting\n", dev->name);
if (!gp->running) {
- printk("%s: hrm.. hw not running !\n", dev->name);
+ printk(KERN_ERR "%s: hrm.. hw not running !\n", dev->name);
return;
}
printk(KERN_ERR "%s: TX_STATE[%08x:%08x:%08x]\n",
@@ -1007,7 +1010,7 @@ static void gem_tx_timeout(struct net_device *dev)
spin_unlock_irq(&gp->lock);
}
-static __inline__ int gem_intme(int entry)
+static inline int gem_intme(int entry)
{
/* Algorithm: IRQ every 1/2 of descriptors. */
if (!(entry & ((TX_RING_SIZE>>1)-1)))
@@ -1167,7 +1170,7 @@ static void gem_reset(struct gem *gp)
} while (val & (GREG_SWRST_TXRST | GREG_SWRST_RXRST));
if (limit <= 0)
- printk(KERN_ERR "%s: SW reset is ghetto.\n", gp->dev->name);
+ printk(KERN_ERR "%s: SW reset is ghetto\n", gp->dev->name);
}
/* Must be invoked under gp->lock and gp->tx_lock. */
@@ -1217,7 +1220,7 @@ static void gem_stop_dma(struct gem *gp)
/* Must be invoked under gp->lock and gp->tx_lock. */
-// XXX dbl check what that function should do when called on PCS PHY
+/* XXX dbl check what that function should do when called on PCS PHY */
static void gem_begin_auto_negotiation(struct gem *gp, struct ethtool_cmd *ep)
{
u32 advertise, features;
@@ -1226,8 +1229,8 @@ static void gem_begin_auto_negotiation(struct gem *gp, struct ethtool_cmd *ep)
int duplex;
if (gp->phy_type != phy_mii_mdio0 &&
- gp->phy_type != phy_mii_mdio1)
- goto non_mii;
+ gp->phy_type != phy_mii_mdio1)
+ goto non_mii;
/* Setup advertise */
if (found_mii_phy(gp))
@@ -1267,9 +1270,9 @@ start_aneg:
speed = SPEED_10;
if (duplex == DUPLEX_FULL &&
!(features & (SUPPORTED_1000baseT_Full |
- SUPPORTED_100baseT_Full |
- SUPPORTED_10baseT_Full)))
- duplex = DUPLEX_HALF;
+ SUPPORTED_100baseT_Full |
+ SUPPORTED_10baseT_Full)))
+ duplex = DUPLEX_HALF;
if (speed == 0)
speed = SPEED_10;
@@ -1287,11 +1290,13 @@ start_aneg:
gp->want_autoneg = autoneg;
if (autoneg) {
if (found_mii_phy(gp))
- gp->phy_mii.def->ops->setup_aneg(&gp->phy_mii, advertise);
+ gp->phy_mii.def->ops->setup_aneg(&gp->phy_mii,
+ advertise);
gp->lstate = link_aneg;
} else {
if (found_mii_phy(gp))
- gp->phy_mii.def->ops->setup_forced(&gp->phy_mii, speed, duplex);
+ gp->phy_mii.def->ops->setup_forced(&gp->phy_mii, speed,
+ duplex);
gp->lstate = link_force_ok;
}
@@ -1315,13 +1320,13 @@ static int gem_set_link_modes(struct gem *gp)
pause = 0;
if (found_mii_phy(gp)) {
- if (gp->phy_mii.def->ops->read_link(&gp->phy_mii))
- return 1;
+ if (gp->phy_mii.def->ops->read_link(&gp->phy_mii))
+ return 1;
full_duplex = (gp->phy_mii.duplex == DUPLEX_FULL);
speed = gp->phy_mii.speed;
pause = gp->phy_mii.pause;
} else if (gp->phy_type == phy_serialink ||
- gp->phy_type == phy_serdes) {
+ gp->phy_type == phy_serdes) {
u32 pcs_lpa = readl(gp->regs + PCS_MIILP);
if (pcs_lpa & PCS_MIIADV_FD)
@@ -1330,8 +1335,8 @@ static int gem_set_link_modes(struct gem *gp)
}
if (netif_msg_link(gp))
- printk(KERN_INFO "%s: Link is up at %d Mbps, %s-duplex.\n",
- gp->dev->name, speed, (full_duplex ? "full" : "half"));
+ printk(KERN_INFO "%s: Link is up at %d Mbps, %s-duplex\n",
+ gp->dev->name, speed, (full_duplex ? "full" : "half"));
if (!gp->running)
return 0;
@@ -1358,8 +1363,8 @@ static int gem_set_link_modes(struct gem *gp)
writel(val, gp->regs + MAC_XIFCFG);
- /* If gigabit and half-duplex, enable carrier extension
- * mode. Else, disable it.
+ /* If gigabit and half-duplex, enable carrier extension mode.
+ * Else, disable it.
*/
if (speed == SPEED_1000 && !full_duplex) {
val = readl(gp->regs + MAC_TXCFG);
@@ -1377,7 +1382,7 @@ static int gem_set_link_modes(struct gem *gp)
if (gp->phy_type == phy_serialink ||
gp->phy_type == phy_serdes) {
- u32 pcs_lpa = readl(gp->regs + PCS_MIILP);
+ u32 pcs_lpa = readl(gp->regs + PCS_MIILP);
if (pcs_lpa & (PCS_MIIADV_SP | PCS_MIIADV_AP))
pause = 1;
@@ -1419,26 +1424,28 @@ static int gem_mdio_link_not_up(struct gem *gp)
switch (gp->lstate) {
case link_force_ret:
if (netif_msg_link(gp))
- printk(KERN_INFO "%s: Autoneg failed again, keeping"
- " forced mode\n", gp->dev->name);
+ printk(KERN_INFO "%s: Autoneg failed again, "
+ "keeping forced mode\n", gp->dev->name);
gp->phy_mii.def->ops->setup_forced(&gp->phy_mii,
- gp->last_forced_speed, DUPLEX_HALF);
+ gp->last_forced_speed,
+ DUPLEX_HALF);
gp->timer_ticks = 5;
gp->lstate = link_force_ok;
return 0;
case link_aneg:
- /* We try forced modes after a failed aneg only on PHYs that don't
- * have "magic_aneg" bit set, which means they internally do the
- * while forced-mode thingy. On these, we just restart aneg
+ /* We try forced modes after a failed aneg only on PHYs
+ * that don't have "magic_aneg" bit set, which means they
+ * internally do the while forced-mode thingy.
+ * On these, we just restart aneg
*/
if (gp->phy_mii.def->magic_aneg)
return 1;
if (netif_msg_link(gp))
printk(KERN_INFO "%s: switching to forced 100bt\n",
- gp->dev->name);
+ gp->dev->name);
/* Try forced modes. */
gp->phy_mii.def->ops->setup_forced(&gp->phy_mii, SPEED_100,
- DUPLEX_HALF);
+ DUPLEX_HALF);
gp->timer_ticks = 5;
gp->lstate = link_force_try;
return 0;
@@ -1448,12 +1455,14 @@ static int gem_mdio_link_not_up(struct gem *gp)
* situation every 10 ticks.
*/
if (gp->phy_mii.speed == SPEED_100) {
- gp->phy_mii.def->ops->setup_forced(&gp->phy_mii, SPEED_10,
- DUPLEX_HALF);
+ gp->phy_mii.def->ops->setup_forced(&gp->phy_mii,
+ SPEED_10,
+ DUPLEX_HALF);
gp->timer_ticks = 5;
if (netif_msg_link(gp))
- printk(KERN_INFO "%s: switching to forced 10bt\n",
- gp->dev->name);
+ printk(KERN_INFO "%s: switching to "
+ "forced 10bt\n",
+ gp->dev->name);
return 0;
} else
return 1;
@@ -1494,7 +1503,8 @@ static void gem_link_timer(unsigned long data)
}
goto restart;
}
- if (found_mii_phy(gp) && gp->phy_mii.def->ops->poll_link(&gp->phy_mii)) {
+ if (found_mii_phy(gp) &&
+ gp->phy_mii.def->ops->poll_link(&gp->phy_mii)) {
/* Ok, here we got a link. If we had it due to a forced
* fallback, and we were configured for autoneg, we do
* retry a short autoneg pass. If you know your hub is
@@ -1505,9 +1515,12 @@ static void gem_link_timer(unsigned long data)
gp->last_forced_speed = gp->phy_mii.speed;
gp->timer_ticks = 5;
if (netif_msg_link(gp))
- printk(KERN_INFO "%s: Got link after fallback, retrying"
- " autoneg once...\n", gp->dev->name);
- gp->phy_mii.def->ops->setup_aneg(&gp->phy_mii, gp->phy_mii.advertising);
+ printk(KERN_INFO "%s: Got link after fallback, "
+ "retrying autoneg once..\n",
+ gp->dev->name);
+ gp->phy_mii.def->
+ ops->setup_aneg(&gp->phy_mii,
+ gp->phy_mii.advertising);
} else if (gp->lstate != link_up) {
gp->lstate = link_up;
netif_carrier_on(gp->dev);
@@ -1522,7 +1535,7 @@ static void gem_link_timer(unsigned long data)
gp->lstate = link_down;
if (netif_msg_link(gp))
printk(KERN_INFO "%s: Link down\n",
- gp->dev->name);
+ gp->dev->name);
netif_carrier_off(gp->dev);
gp->reset_task_pending = 1;
schedule_work(&gp->reset_task);
@@ -1573,27 +1586,27 @@ static void gem_clean_rings(struct gem *gp)
}
for (i = 0; i < TX_RING_SIZE; i++) {
- if (gp->tx_skbs[i] != NULL) {
- struct gem_txd *txd;
- int frag;
+ int frag;
- skb = gp->tx_skbs[i];
- gp->tx_skbs[i] = NULL;
+ if (!gp->tx_skbs[i])
+ continue;
- for (frag = 0; frag <= skb_shinfo(skb)->nr_frags; frag++) {
- int ent = i & (TX_RING_SIZE - 1);
+ skb = gp->tx_skbs[i];
+ gp->tx_skbs[i] = NULL;
- txd = &gb->txd[ent];
- dma_addr = le64_to_cpu(txd->buffer);
- pci_unmap_page(gp->pdev, dma_addr,
- le64_to_cpu(txd->control_word) &
- TXDCTRL_BUFSZ, PCI_DMA_TODEVICE);
+ for (frag = 0; frag <= skb_shinfo(skb)->nr_frags; frag++) {
+ int ent = i & (TX_RING_SIZE - 1);
+ struct gem_txd *txd = &gb->txd[ent];
- if (frag != skb_shinfo(skb)->nr_frags)
- i++;
- }
- dev_kfree_skb_any(skb);
+ dma_addr = le64_to_cpu(txd->buffer);
+ pci_unmap_page(gp->pdev, dma_addr,
+ le64_to_cpu(txd->control_word) &
+ TXDCTRL_BUFSZ, PCI_DMA_TODEVICE);
+
+ if (frag != skb_shinfo(skb)->nr_frags)
+ i++;
}
+ dev_kfree_skb_any(skb);
}
}
@@ -1666,19 +1679,20 @@ static void gem_init_phy(struct gem *gp)
*/
for (i = 0; i < 3; i++) {
#ifdef CONFIG_PPC_PMAC
- pmac_call_feature(PMAC_FTR_GMAC_PHY_RESET, gp->of_node, 0, 0);
+ pmac_call_feature(PMAC_FTR_GMAC_PHY_RESET,
+ gp->of_node, 0, 0);
msleep(20);
#endif
- /* Some PHYs used by apple have problem getting back to us,
- * we do an additional reset here
+ /* Some PHYs used by apple have a problem
+ * getting back to us, we do an additional reset here
*/
phy_write(gp, MII_BMCR, BMCR_RESET);
msleep(20);
if (phy_read(gp, MII_BMCR) != 0xffff)
break;
if (i == 2)
- printk(KERN_WARNING "%s: GMAC PHY not responding !\n",
- gp->dev->name);
+ printk(KERN_WARNING "%s: GMAC PHY "
+ "not responding !\n", gp->dev->name);
}
}
@@ -1701,7 +1715,7 @@ static void gem_init_phy(struct gem *gp)
if (gp->phy_type == phy_mii_mdio0 ||
gp->phy_type == phy_mii_mdio1) {
- // XXX check for errors
+ /* XXX check for errors */
mii_phy_probe(&gp->phy_mii, gp->mii_phy_addr);
/* Init PHY */
@@ -1723,8 +1737,8 @@ static void gem_init_phy(struct gem *gp)
break;
}
if (limit <= 0)
- printk(KERN_WARNING "%s: PCS reset bit would not clear.\n",
- gp->dev->name);
+ printk(KERN_WARNING "%s: PCS reset bit "
+ "would not clear\n", gp->dev->name);
/* Make sure PCS is disabled while changing advertisement
* configuration.
@@ -1733,16 +1747,15 @@ static void gem_init_phy(struct gem *gp)
val &= ~(PCS_CFG_ENABLE | PCS_CFG_TO);
writel(val, gp->regs + PCS_CFG);
- /* Advertise all capabilities except assymetric
- * pause.
+ /* Advertise all capabilities except assymetric pause.
*/
val = readl(gp->regs + PCS_MIIADV);
val |= (PCS_MIIADV_FD | PCS_MIIADV_HD |
PCS_MIIADV_SP | PCS_MIIADV_AP);
writel(val, gp->regs + PCS_MIIADV);
- /* Enable and restart auto-negotiation, disable wrapback/loopback,
- * and re-enable PCS.
+ /* Enable and restart auto-negotiation,
+ * disable wrapback/loopback, and re-enable PCS.
*/
val = readl(gp->regs + PCS_MIICTRL);
val |= (PCS_MIICTRL_RAN | PCS_MIICTRL_ANE);
@@ -1817,24 +1830,22 @@ static void gem_init_dma(struct gem *gp)
/* Must be invoked under gp->lock and gp->tx_lock. */
static u32 gem_setup_multicast(struct gem *gp)
{
- u32 rxcfg = 0;
+ u32 rxcfg;
int i;
if ((gp->dev->flags & IFF_ALLMULTI) ||
(gp->dev->mc_count > 256)) {
- for (i=0; i<16; i++)
+ for (i = 0; i < 16; i++)
writel(0xffff, gp->regs + MAC_HASH0 + (i << 2));
- rxcfg |= MAC_RXCFG_HFE;
+ rxcfg = MAC_RXCFG_HFE;
} else if (gp->dev->flags & IFF_PROMISC) {
- rxcfg |= MAC_RXCFG_PROM;
+ rxcfg = MAC_RXCFG_PROM;
} else {
u16 hash_table[16];
u32 crc;
struct dev_mc_list *dmi = gp->dev->mc_list;
- int i;
- for (i = 0; i < 16; i++)
- hash_table[i] = 0;
+ memset(hash_table, 0, sizeof(hash_table));
for (i = 0; i < gp->dev->mc_count; i++) {
char *addrs = dmi->dmi_addr;
@@ -1844,13 +1855,13 @@ static u32 gem_setup_multicast(struct gem *gp)
if (!(*addrs & 1))
continue;
- crc = ether_crc_le(6, addrs);
+ crc = ether_crc_le(6, addrs);
crc >>= 24;
hash_table[crc >> 4] |= 1 << (15 - (crc & 0xf));
}
- for (i=0; i<16; i++)
+ for (i = 0; i < ARRAY_SIZE(hash_table); i++)
writel(hash_table[i], gp->regs + MAC_HASH0 + (i << 2));
- rxcfg |= MAC_RXCFG_HFE;
+ rxcfg = MAC_RXCFG_HFE;
}
return rxcfg;
@@ -1942,7 +1953,7 @@ static void gem_init_mac(struct gem *gp)
/* Must be invoked under gp->lock and gp->tx_lock. */
static void gem_init_pause_thresholds(struct gem *gp)
{
- u32 cfg;
+ u32 cfg;
/* Calculate pause thresholds. Setting the OFF threshold to the
* full RX fifo size effectively disables PAUSE generation which
@@ -1964,15 +1975,15 @@ static void gem_init_pause_thresholds(struct gem *gp)
/* Configure the chip "burst" DMA mode & enable some
* HW bug fixes on Apple version
*/
- cfg = 0;
- if (gp->pdev->vendor == PCI_VENDOR_ID_APPLE)
+ cfg = 0;
+ if (gp->pdev->vendor == PCI_VENDOR_ID_APPLE)
cfg |= GREG_CFG_RONPAULBIT | GREG_CFG_ENBUG2FIX;
#if !defined(CONFIG_SPARC64) && !defined(CONFIG_ALPHA)
- cfg |= GREG_CFG_IBURST;
+ cfg |= GREG_CFG_IBURST;
#endif
- cfg |= ((31 << 1) & GREG_CFG_TXDMALIM);
- cfg |= ((31 << 6) & GREG_CFG_RXDMALIM);
- writel(cfg, gp->regs + GREG_CFG);
+ cfg |= ((31 << 1) & GREG_CFG_TXDMALIM);
+ cfg |= ((31 << 6) & GREG_CFG_RXDMALIM);
+ writel(cfg, gp->regs + GREG_CFG);
/* If Infinite Burst didn't stick, then use different
* thresholds (and Apple bug fixes don't exist)
@@ -2000,15 +2011,16 @@ static int gem_check_invariants(struct gem *gp)
gp->swrst_base = 0;
mif_cfg = readl(gp->regs + MIF_CFG);
- mif_cfg &= ~(MIF_CFG_PSELECT|MIF_CFG_POLL|MIF_CFG_BBMODE|MIF_CFG_MDI1);
+ mif_cfg &= ~(MIF_CFG_PSELECT | MIF_CFG_POLL |
+ MIF_CFG_BBMODE | MIF_CFG_MDI1);
mif_cfg |= MIF_CFG_MDI0;
writel(mif_cfg, gp->regs + MIF_CFG);
writel(PCS_DMODE_MGM, gp->regs + PCS_DMODE);
writel(MAC_XIFCFG_OE, gp->regs + MAC_XIFCFG);
- /* We hard-code the PHY address so we can properly bring it out of
- * reset later on, we can't really probe it at this point, though
- * that isn't an issue.
+ /* We hard-code the PHY address so we can properly bring it
+ * out of reset later on, we can't really probe it at this
+ * point, though that isn't an issue.
*/
if (gp->pdev->device == PCI_DEVICE_ID_APPLE_K2_GMAC)
gp->mii_phy_addr = 1;
@@ -2026,8 +2038,8 @@ static int gem_check_invariants(struct gem *gp)
* as this chip has no gigabit PHY.
*/
if ((mif_cfg & (MIF_CFG_MDI0 | MIF_CFG_MDI1)) == 0) {
- printk(KERN_ERR PFX "RIO GEM lacks MII phy, mif_cfg[%08x]\n",
- mif_cfg);
+ printk(KERN_ERR PFX "RIO GEM lacks MII phy, "
+ "mif_cfg[%08x]\n", mif_cfg);
return -1;
}
}
@@ -2058,7 +2070,8 @@ static int gem_check_invariants(struct gem *gp)
}
if (i == 32) {
if (pdev->device != PCI_DEVICE_ID_SUN_GEM) {
- printk(KERN_ERR PFX "RIO MII phy will not respond.\n");
+ printk(KERN_ERR PFX "RIO MII phy "
+ "will not respond\n");
return -1;
}
gp->phy_type = phy_serdes;
@@ -2073,7 +2086,8 @@ static int gem_check_invariants(struct gem *gp)
if (pdev->device == PCI_DEVICE_ID_SUN_GEM) {
if (gp->tx_fifo_sz != (9 * 1024) ||
gp->rx_fifo_sz != (20 * 1024)) {
- printk(KERN_ERR PFX "GEM has bogus fifo sizes tx(%d) rx(%d)\n",
+ printk(KERN_ERR PFX "GEM has bogus "
+ "fifo sizes tx(%d) rx(%d)\n",
gp->tx_fifo_sz, gp->rx_fifo_sz);
return -1;
}
@@ -2081,7 +2095,8 @@ static int gem_check_invariants(struct gem *gp)
} else {
if (gp->tx_fifo_sz != (2 * 1024) ||
gp->rx_fifo_sz != (2 * 1024)) {
- printk(KERN_ERR PFX "RIO GEM has bogus fifo sizes tx(%d) rx(%d)\n",
+ printk(KERN_ERR PFX "RIO GEM has bogus "
+ "fifo sizes tx(%d) rx(%d)\n",
gp->tx_fifo_sz, gp->rx_fifo_sz);
return -1;
}
@@ -2176,15 +2191,16 @@ static void gem_stop_phy(struct gem *gp, int wol)
if (found_mii_phy(gp) && gp->phy_mii.def->ops->suspend)
gp->phy_mii.def->ops->suspend(&gp->phy_mii);
- /* According to Apple, we must set the MDIO pins to this begnign
+ /* According to Apple, we must set the MDIO pins to this benign
* state or we may 1) eat more current, 2) damage some PHYs
*/
writel(mifcfg | MIF_CFG_BBMODE, gp->regs + MIF_CFG);
writel(0, gp->regs + MIF_BBCLK);
writel(0, gp->regs + MIF_BBDATA);
writel(0, gp->regs + MIF_BBOENAB);
- writel(MAC_XIFCFG_GMII | MAC_XIFCFG_LBCK, gp->regs + MAC_XIFCFG);
- (void) readl(gp->regs + MAC_XIFCFG);
+ writel(MAC_XIFCFG_GMII | MAC_XIFCFG_LBCK,
+ gp->regs + MAC_XIFCFG);
+ (void)readl(gp->regs + MAC_XIFCFG);
}
}
@@ -2216,7 +2232,7 @@ static int gem_do_start(struct net_device *dev)
spin_unlock_irqrestore(&gp->lock, flags);
if (request_irq(gp->pdev->irq, gem_interrupt,
- IRQF_SHARED, dev->name, (void *)dev)) {
+ IRQF_SHARED, dev->name, (void *)dev)) {
printk(KERN_ERR "%s: failed to request irq !\n", gp->dev->name);
spin_lock_irqsave(&gp->lock, flags);
@@ -2430,8 +2446,7 @@ static int gem_resume(struct pci_dev *pdev)
/* Make sure PCI access and bus master are enabled */
if (pci_enable_device(gp->pdev)) {
- printk(KERN_ERR "%s: Can't re-enable chip !\n",
- dev->name);
+ printk(KERN_ERR "%s: Can't re-enable chip !\n", dev->name);
/* Put cell and forget it for now, it will be considered as
* still asleep, a new sleep cycle may bring it back
*/
@@ -2587,7 +2602,7 @@ static void gem_set_multicast(struct net_device *dev)
netif_wake_queue(dev);
- bail:
+bail:
spin_unlock(&gp->tx_lock);
spin_unlock_irq(&gp->lock);
}
@@ -2671,7 +2686,7 @@ static int gem_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
if (cmd->advertising == 0)
cmd->advertising = cmd->supported;
spin_unlock_irq(&gp->lock);
- } else { // XXX PCS ?
+ } else { /* XXX PCS ? */
cmd->supported =
(SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full |
SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full |
@@ -2825,8 +2840,8 @@ static int gem_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
else if (!gp->running)
rc = -EAGAIN;
else {
- __phy_write(gp, data->phy_id & 0x1f, data->reg_num & 0x1f,
- data->val_in);
+ __phy_write(gp, data->phy_id & 0x1f,
+ data->reg_num & 0x1f, data->val_in);
rc = 0;
}
break;
@@ -2875,7 +2890,7 @@ static void get_gem_mac_nonobp(struct pci_dev *pdev, unsigned char *dev_addr)
void __iomem *p = pci_map_rom(pdev, &size);
if (p) {
- int found;
+ int found;
found = readb(p) == 0x55 &&
readb(p + 1) == 0xaa &&
@@ -2961,7 +2976,7 @@ static void gem_remove_one(struct pci_dev *pdev)
static int __devinit gem_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
- static int gem_version_printed = 0;
+ static int gem_version_printed;
unsigned long gemreg_base, gemreg_len;
struct net_device *dev;
struct gem *gp;
@@ -2979,8 +2994,7 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
*/
err = pci_enable_device(pdev);
if (err) {
- printk(KERN_ERR PFX "Cannot enable MMIO operation, "
- "aborting.\n");
+ printk(KERN_ERR PFX "Cannot enable MMIO operation, aborting\n");
return err;
}
pci_set_master(pdev);
@@ -3002,7 +3016,7 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
if (err) {
printk(KERN_ERR PFX "No usable DMA configuration, "
- "aborting.\n");
+ "aborting\n");
goto err_disable_device;
}
pci_using_dac = 0;
@@ -3013,14 +3027,14 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
if ((pci_resource_flags(pdev, 0) & IORESOURCE_IO) != 0) {
printk(KERN_ERR PFX "Cannot find proper PCI device "
- "base address, aborting.\n");
+ "base address, aborting\n");
err = -ENODEV;
goto err_disable_device;
}
dev = alloc_etherdev(sizeof(*gp));
if (!dev) {
- printk(KERN_ERR PFX "Etherdev alloc failed, aborting.\n");
+ printk(KERN_ERR PFX "Etherdev alloc failed, aborting\n");
err = -ENOMEM;
goto err_disable_device;
}
@@ -3030,8 +3044,7 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
err = pci_request_regions(pdev, DRV_NAME);
if (err) {
- printk(KERN_ERR PFX "Cannot obtain PCI resources, "
- "aborting.\n");
+ printk(KERN_ERR PFX "Cannot obtain PCI resources, aborting\n");
goto err_out_free_netdev;
}
@@ -3057,8 +3070,7 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
gp->regs = ioremap(gemreg_base, gemreg_len);
if (!gp->regs) {
- printk(KERN_ERR PFX "Cannot map device registers, "
- "aborting.\n");
+ printk(KERN_ERR PFX "Cannot map device registers, aborting\n");
err = -EIO;
goto err_out_free_res;
}
@@ -3103,8 +3115,7 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
pci_alloc_consistent(pdev, sizeof(struct gem_init_block),
&gp->gblock_dvma);
if (!gp->init_block) {
- printk(KERN_ERR PFX "Cannot allocate init block, "
- "aborting.\n");
+ printk(KERN_ERR PFX "Cannot allocate init block, aborting\n");
err = -ENOMEM;
goto err_out_iounmap;
}
@@ -3144,20 +3155,18 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
/* Register with kernel */
if (register_netdev(dev)) {
- printk(KERN_ERR PFX "Cannot register net device, "
- "aborting.\n");
+ printk(KERN_ERR PFX "Cannot register net device, aborting\n");
err = -ENOMEM;
goto err_out_free_consistent;
}
- printk(KERN_INFO "%s: Sun GEM (PCI) 10/100/1000BaseT Ethernet "
- "%s\n",
+ printk(KERN_INFO "%s: Sun GEM (PCI) 10/100/1000BaseT Ethernet %s\n",
dev->name, print_mac(mac, dev->dev_addr));
if (gp->phy_type == phy_mii_mdio0 ||
- gp->phy_type == phy_mii_mdio1)
+ gp->phy_type == phy_mii_mdio1)
printk(KERN_INFO "%s: Found %s PHY\n", dev->name,
- gp->phy_mii.def ? gp->phy_mii.def->name : "no");
+ gp->phy_mii.def ? gp->phy_mii.def->name : "no");
/* GEM can do it all... */
dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_LLTX;
^ permalink raw reply related
* Re: 2.6.25-rc2-mm1 - several bugs and a crash
From: Patrick McHardy @ 2008-02-20 21:50 UTC (permalink / raw)
To: Tilman Schmidt
Cc: Andrew Morton, linux-kernel, netdev, netfilter-devel, netfilter,
coreteam
In-Reply-To: <47BC982C.7050402@imap.cc>
Tilman Schmidt wrote:
> Still, X came up fine, I could log in (Gnome feeling subjectively
> a bit sluggish), call up a web page from the Internet in Firefox,
> and start perusing the logs, when the whole system froze: neither
> mouse nor keyboard would react anymore, and only the Wind^Wreset
> button would put me back in control. After rebooting into the
> previous, non-mm kernel I found this in the syslog:
>
> Feb 20 17:22:40 xenon kernel: [ 48.180297] BUG: using smp_processor_id() in preemptible [00000000] code: ntpdate/3562
> Feb 20 17:22:40 xenon kernel: [ 48.180297] caller is __nf_conntrack_find+0x9b/0xeb [nf_conntrack]
> Feb 20 17:22:40 xenon kernel: [ 48.180297] Pid: 3562, comm: ntpdate Not tainted 2.6.25-rc2-mm1-testing #1
> Feb 20 17:22:40 xenon kernel: [ 48.180297] [<c02015b9>] debug_smp_processor_id+0x99/0xb0
> Feb 20 17:22:40 xenon kernel: [ 48.180297] [<fac643a7>] __nf_conntrack_find+0x9b/0xeb [nf_conntrack]
I guess the cause for this is a combination of preemtible
RCU and conntrack using RCU since 2.6.25-rc. Using
NF_CT_STAT_INC_ATOMIC should fix it, but I'd prefer
to have a fix that doesn't increase overhead when regular
RCU is used.
I'll see if I can find a better way to fix this tommorrow.
^ permalink raw reply
* [PATCH 2.6.25 2/4]S2io: Multiqueue network device support - FIFO selection based on L4 ports
From: Sreenivasa Honnur @ 2008-02-20 22:07 UTC (permalink / raw)
To: netdev, jeff; +Cc: support
- Resubmit #2
- Transmit fifo selection based on TCP/UDP ports.
- Added tx_steering_type loadable parameter for transmit fifo selection.
0x0 NO_STEERING: Default FIFO is selected.
0x1 TX_PRIORITY_STEERING: FIFO is selected based on skb->priority.
0x2 TX_DEFAULT_STEERING: FIFO is selected based on L4 Ports.
Signed-off-by: Surjit Reang <surjit.reang@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
---
diff -Nurp 2-0-26-18-1/drivers/net/s2io.c 2-0-26-18-2/drivers/net/s2io.c
--- 2-0-26-18-1/drivers/net/s2io.c 2008-02-15 05:15:41.000000000 +0530
+++ 2-0-26-18-2/drivers/net/s2io.c 2008-02-15 05:16:36.000000000 +0530
@@ -458,7 +458,7 @@ MODULE_VERSION(DRV_VERSION);
/* Module Loadable parameters. */
-S2IO_PARM_INT(tx_fifo_num, 1);
+S2IO_PARM_INT(tx_fifo_num, FIFO_DEFAULT_NUM);
S2IO_PARM_INT(rx_ring_num, 1);
S2IO_PARM_INT(multiq, 0);
S2IO_PARM_INT(rx_ring_mode, 1);
@@ -470,6 +470,8 @@ S2IO_PARM_INT(shared_splits, 0);
S2IO_PARM_INT(tmac_util_period, 5);
S2IO_PARM_INT(rmac_util_period, 5);
S2IO_PARM_INT(l3l4hdr_size, 128);
+/* 0 is no steering, 1 is Priority steering, 2 is Default steering */
+S2IO_PARM_INT(tx_steering_type, TX_DEFAULT_STEERING);
/* Frequency of Rx desc syncs expressed as power of 2 */
S2IO_PARM_INT(rxsync_frequency, 3);
/* Interrupt type. Values can be 0(INTA), 2(MSI_X) */
@@ -4114,7 +4116,9 @@ static int s2io_xmit(struct sk_buff *skb
struct fifo_info *fifo = NULL;
struct mac_info *mac_control;
struct config_param *config;
+ int do_spin_lock = 1;
int offload_type;
+ int enable_per_list_interrupt = 0;
struct swStat *stats = &sp->mac_control.stats_info->sw_stat;
mac_control = &sp->mac_control;
@@ -4136,15 +4140,52 @@ static int s2io_xmit(struct sk_buff *skb
}
queue = 0;
- /* Get Fifo number to Transmit based on vlan priority */
if (sp->vlgrp && vlan_tx_tag_present(skb))
vlan_tag = vlan_tx_tag_get(skb);
+ if (sp->config.tx_steering_type == TX_DEFAULT_STEERING) {
+ if (skb->protocol == htons(ETH_P_IP)) {
+ struct iphdr *ip;
+ struct tcphdr *th;
+ ip = ip_hdr(skb);
+
+ if ((ip->frag_off & htons(IP_OFFSET|IP_MF)) == 0) {
+ th = (struct tcphdr *)(((unsigned char *)ip) +
+ ip->ihl*4);
+
+ if (ip->protocol == IPPROTO_TCP) {
+ queue_len = sp->total_tcp_fifos;
+ queue = (ntohs(th->source) +
+ ntohs(th->dest)) &
+ sp->fifo_selector[queue_len - 1];
+ if (queue >= queue_len)
+ queue = queue_len - 1;
+ } else if (ip->protocol == IPPROTO_UDP) {
+ queue_len = sp->total_udp_fifos;
+ queue = (ntohs(th->source) +
+ ntohs(th->dest)) &
+ sp->fifo_selector[queue_len - 1];
+ if (queue >= queue_len)
+ queue = queue_len - 1;
+ queue += sp->udp_fifo_idx;
+ if (skb->len > 1024)
+ enable_per_list_interrupt = 1;
+ do_spin_lock = 0;
+ }
+ }
+ }
+ } else if (sp->config.tx_steering_type == TX_PRIORITY_STEERING)
+ /* get fifo number based on skb->priority value */
+ queue = config->fifo_mapping
+ [skb->priority & (MAX_TX_FIFOS - 1)];
+ fifo = &mac_control->fifos[queue];
- /* get fifo number based on skb->priority value */
- queue = config->fifo_mapping[skb->priority & (MAX_TX_FIFOS - 1)];
+ if (do_spin_lock)
+ spin_lock_irqsave(&fifo->tx_lock, flags);
+ else {
+ if (unlikely(!spin_trylock_irqsave(&fifo->tx_lock, flags)))
+ return NETDEV_TX_LOCKED;
+ }
- fifo = &mac_control->fifos[queue];
- spin_lock_irqsave(&fifo->tx_lock, flags);
#ifdef CONFIG_NETDEVICES_MULTIQUEUE
if (sp->config.multiq) {
if (__netif_subqueue_stopped(dev, fifo->fifo_no)) {
@@ -4188,7 +4229,9 @@ static int s2io_xmit(struct sk_buff *skb
txdp->Control_1 |= TXD_GATHER_CODE_FIRST;
txdp->Control_1 |= TXD_LIST_OWN_XENA;
txdp->Control_2 |= TXD_INT_NUMBER(fifo->fifo_no);
-
+ if (enable_per_list_interrupt)
+ if (put_off & (queue_len >> 5))
+ txdp->Control_2 |= TXD_INT_TYPE_PER_LIST;
if (vlan_tag) {
txdp->Control_2 |= TXD_VLAN_ENABLE;
txdp->Control_2 |= TXD_VLAN_TAG(vlan_tag);
@@ -7622,13 +7665,15 @@ static int s2io_verify_parm(struct pci_d
u8 *dev_multiq)
{
if ((tx_fifo_num > MAX_TX_FIFOS) ||
- (tx_fifo_num < FIFO_DEFAULT_NUM)) {
+ (tx_fifo_num < 1)) {
DBG_PRINT(ERR_DBG, "s2io: Requested number of tx fifos "
"(%d) not supported\n", tx_fifo_num);
- tx_fifo_num =
- ((tx_fifo_num > MAX_TX_FIFOS)? MAX_TX_FIFOS :
- ((tx_fifo_num < FIFO_DEFAULT_NUM) ? FIFO_DEFAULT_NUM :
- tx_fifo_num));
+
+ if (tx_fifo_num < 1)
+ tx_fifo_num = 1;
+ else
+ tx_fifo_num = MAX_TX_FIFOS;
+
DBG_PRINT(ERR_DBG, "s2io: Default to %d ", tx_fifo_num);
DBG_PRINT(ERR_DBG, "tx fifos\n");
}
@@ -7639,10 +7684,23 @@ static int s2io_verify_parm(struct pci_d
multiq = 0;
}
#endif
- /* if multiqueue is enabled configure all fifos */
- if (multiq) {
- tx_fifo_num = MAX_TX_FIFOS;
+ if (multiq)
*dev_multiq = multiq;
+
+ if (tx_steering_type && (1 == tx_fifo_num)) {
+ if (tx_steering_type != TX_DEFAULT_STEERING)
+ DBG_PRINT(ERR_DBG,
+ "s2io: Tx steering is not supported with "
+ "one fifo. Disabling Tx steering.\n");
+ tx_steering_type = NO_STEERING;
+ }
+
+ if ((tx_steering_type < NO_STEERING) ||
+ (tx_steering_type > TX_DEFAULT_STEERING)) {
+ DBG_PRINT(ERR_DBG, "s2io: Requested transmit steering not "
+ "supported\n");
+ DBG_PRINT(ERR_DBG, "s2io: Disabling transmit steering\n");
+ tx_steering_type = NO_STEERING;
}
if ( rx_ring_num > 8) {
@@ -7773,7 +7831,7 @@ s2io_init_nic(struct pci_dev *pdev, cons
}
#ifdef CONFIG_NETDEVICES_MULTIQUEUE
if (dev_multiq)
- dev = alloc_etherdev_mq(sizeof(struct s2io_nic), MAX_TX_FIFOS);
+ dev = alloc_etherdev_mq(sizeof(struct s2io_nic), tx_fifo_num);
else
#endif
dev = alloc_etherdev(sizeof(struct s2io_nic));
@@ -7824,11 +7882,33 @@ s2io_init_nic(struct pci_dev *pdev, cons
config = &sp->config;
config->napi = napi;
+ config->tx_steering_type = tx_steering_type;
/* Tx side parameters. */
- config->tx_fifo_num = tx_fifo_num;
+ if (config->tx_steering_type == TX_PRIORITY_STEERING)
+ config->tx_fifo_num = MAX_TX_FIFOS;
+ else
+ config->tx_fifo_num = tx_fifo_num;
+
+ /* Initialize the fifos used for tx steering */
+ if (config->tx_fifo_num < 5) {
+ if (config->tx_fifo_num == 1)
+ sp->total_tcp_fifos = 1;
+ else
+ sp->total_tcp_fifos = config->tx_fifo_num - 1;
+ sp->udp_fifo_idx = config->tx_fifo_num - 1;
+ sp->total_udp_fifos = 1;
+ sp->other_fifo_idx = sp->total_tcp_fifos - 1;
+ } else {
+ sp->total_tcp_fifos = (tx_fifo_num - FIFO_UDP_MAX_NUM -
+ FIFO_OTHER_MAX_NUM);
+ sp->udp_fifo_idx = sp->total_tcp_fifos;
+ sp->total_udp_fifos = FIFO_UDP_MAX_NUM;
+ sp->other_fifo_idx = sp->udp_fifo_idx + FIFO_UDP_MAX_NUM;
+ }
+
config->multiq = dev_multiq;
- for (i = 0; i < MAX_TX_FIFOS; i++) {
+ for (i = 0; i < config->tx_fifo_num; i++) {
config->tx_cfg[i].fifo_len = tx_fifo_len[i];
config->tx_cfg[i].fifo_priority = i;
}
@@ -7837,6 +7917,11 @@ s2io_init_nic(struct pci_dev *pdev, cons
for (i = 0; i < MAX_TX_FIFOS; i++)
config->fifo_mapping[i] = fifo_map[config->tx_fifo_num - 1][i];
+ /* map the hashing selector table to the configured fifos */
+ for (i = 0; i < config->tx_fifo_num; i++)
+ sp->fifo_selector[i] = fifo_selector[i];
+
+
config->tx_intr_type = TXD_INT_TYPE_UTILZ;
for (i = 0; i < config->tx_fifo_num; i++) {
config->tx_cfg[i].f_no_snoop =
@@ -8113,6 +8198,20 @@ s2io_init_nic(struct pci_dev *pdev, cons
DBG_PRINT(ERR_DBG, "%s: Multiqueue support disabled\n",
dev->name);
+ switch (sp->config.tx_steering_type) {
+ case NO_STEERING:
+ DBG_PRINT(ERR_DBG, "%s: No steering enabled for"
+ " transmit\n", dev->name);
+ break;
+ case TX_PRIORITY_STEERING:
+ DBG_PRINT(ERR_DBG, "%s: Priority steering enabled for"
+ " transmit\n", dev->name);
+ break;
+ case TX_DEFAULT_STEERING:
+ DBG_PRINT(ERR_DBG, "%s: Default steering enabled for"
+ " transmit\n", dev->name);
+ }
+
if (sp->lro)
DBG_PRINT(ERR_DBG, "%s: Large receive offload enabled\n",
dev->name);
diff -Nurp 2-0-26-18-1/drivers/net/s2io.h 2-0-26-18-2/drivers/net/s2io.h
--- 2-0-26-18-1/drivers/net/s2io.h 2008-02-15 05:15:49.000000000 +0530
+++ 2-0-26-18-2/drivers/net/s2io.h 2008-02-15 05:16:45.000000000 +0530
@@ -360,7 +360,10 @@ struct stat_block {
#define MAX_TX_FIFOS 8
#define MAX_RX_RINGS 8
-#define FIFO_DEFAULT_NUM 1
+#define FIFO_DEFAULT_NUM 5
+#define FIFO_UDP_MAX_NUM 2 /* 0 - even, 1 -odd ports */
+#define FIFO_OTHER_MAX_NUM 1
+
#define MAX_RX_DESC_1 (MAX_RX_RINGS * MAX_RX_BLOCKS_PER_RING * 127 )
#define MAX_RX_DESC_2 (MAX_RX_RINGS * MAX_RX_BLOCKS_PER_RING * 85 )
@@ -379,6 +382,8 @@ static int fifo_map[][MAX_TX_FIFOS] = {
{0, 1, 2, 3, 4, 5, 6, 7},
};
+static u16 fifo_selector[MAX_TX_FIFOS] = {0, 1, 3, 3, 7, 7, 7, 7};
+
/* Maintains Per FIFO related information. */
struct tx_fifo_config {
#define MAX_AVAILABLE_TXDS 8192
@@ -431,6 +436,12 @@ struct config_param {
/* Tx Side */
u32 tx_fifo_num; /*Number of Tx FIFOs */
+ /* 0-No steering, 1-Priority steering, 2-Default fifo map */
+#define NO_STEERING 0
+#define TX_PRIORITY_STEERING 0x1
+#define TX_DEFAULT_STEERING 0x2
+ u8 tx_steering_type;
+
u8 fifo_mapping[MAX_TX_FIFOS];
struct tx_fifo_config tx_cfg[MAX_TX_FIFOS]; /*Per-Tx FIFO config */
u32 max_txds; /*Max no. of Tx buffer descriptor per TxDL */
@@ -895,6 +906,27 @@ struct s2io_nic {
*/
int rx_csum;
+ /* Below variables are used for fifo selection to transmit a packet */
+ u16 fifo_selector[MAX_TX_FIFOS];
+
+ /* Total fifos for tcp packets */
+ u8 total_tcp_fifos;
+
+ /*
+ * Beginning index of udp for udp packets
+ * Value will be equal to
+ * (tx_fifo_num - FIFO_UDP_MAX_NUM - FIFO_OTHER_MAX_NUM)
+ */
+ u8 udp_fifo_idx;
+
+ u8 total_udp_fifos;
+
+ /*
+ * Beginning index of fifo for all other packets
+ * Value will be equal to (tx_fifo_num - FIFO_OTHER_MAX_NUM)
+ */
+ u8 other_fifo_idx;
+
/* after blink, the adapter must be restored with original
* values.
*/
^ permalink raw reply
* [Patch 2.6.25 3/4]S2io: Support for vlan_rx_kill_vid entry point
From: Sreenivasa Honnur @ 2008-02-20 22:09 UTC (permalink / raw)
To: netdev, jeff; +Cc: support
- Resubmit #3
- Added s2io_vlan_rx_kill_vid entry point function for unregistering vlan.
- Fix to aggregate vlan packets. IP offset is incremented by
4 bytes if the packet contains vlan header.
Signed-off-by: Surjit Reang <surjit.reang@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
---
diff -Nurp 2-0-26-18-3/drivers/net/s2io.c 2-0-26-19-1/drivers/net/s2io.c
--- 2-0-26-18-3/drivers/net/s2io.c 2008-02-15 05:18:38.000000000 +0530
+++ 2-0-26-19-1/drivers/net/s2io.c 2008-02-15 07:03:10.000000000 +0530
@@ -388,6 +388,26 @@ static void s2io_vlan_rx_register(struct
/* A flag indicating whether 'RX_PA_CFG_STRIP_VLAN_TAG' bit is set or not */
static int vlan_strip_flag;
+/* Unregister the vlan */
+static void s2io_vlan_rx_kill_vid(struct net_device *dev, unsigned long vid)
+{
+ int i;
+ struct s2io_nic *nic = dev->priv;
+ unsigned long flags[MAX_TX_FIFOS];
+ struct mac_info *mac_control = &nic->mac_control;
+ struct config_param *config = &nic->config;
+
+ for (i = 0; i < config->tx_fifo_num; i++)
+ spin_lock_irqsave(&mac_control->fifos[i].tx_lock, flags[i]);
+
+ if (nic->vlgrp)
+ vlan_group_set_device(nic->vlgrp, vid, NULL);
+
+ for (i = config->tx_fifo_num - 1; i >= 0; i--)
+ spin_unlock_irqrestore(&mac_control->fifos[i].tx_lock,
+ flags[i]);
+}
+
/*
* Constants to be programmed into the Xena's registers, to configure
* the XAUI.
@@ -3047,7 +3067,7 @@ static void rx_intr_handler(struct ring_
struct lro *lro = &nic->lro0_n[i];
if (lro->in_use) {
update_L3L4_header(nic, lro);
- queue_rx_frame(lro->parent);
+ queue_rx_frame(lro->parent, lro->vlan_tag);
clear_lro_session(lro);
}
}
@@ -7522,7 +7542,8 @@ static int rx_osm_handler(struct ring_in
{
lro_append_pkt(sp, lro,
skb, tcp_len);
- queue_rx_frame(lro->parent);
+ queue_rx_frame(lro->parent,
+ lro->vlan_tag);
clear_lro_session(lro);
sp->mac_control.stats_info->
sw_stat.flush_max_pkts++;
@@ -7533,7 +7554,8 @@ static int rx_osm_handler(struct ring_in
lro->frags_len;
sp->mac_control.stats_info->
sw_stat.sending_both++;
- queue_rx_frame(lro->parent);
+ queue_rx_frame(lro->parent,
+ lro->vlan_tag);
clear_lro_session(lro);
goto send_up;
case 0: /* sessions exceeded */
@@ -7559,31 +7581,12 @@ static int rx_osm_handler(struct ring_in
*/
skb->ip_summed = CHECKSUM_NONE;
}
- } else {
+ } else
skb->ip_summed = CHECKSUM_NONE;
- }
+
sp->mac_control.stats_info->sw_stat.mem_freed += skb->truesize;
- if (!sp->lro) {
- skb->protocol = eth_type_trans(skb, dev);
- if ((sp->vlgrp && RXD_GET_VLAN_TAG(rxdp->Control_2) &&
- vlan_strip_flag)) {
- /* Queueing the vlan frame to the upper layer */
- if (napi)
- vlan_hwaccel_receive_skb(skb, sp->vlgrp,
- RXD_GET_VLAN_TAG(rxdp->Control_2));
- else
- vlan_hwaccel_rx(skb, sp->vlgrp,
- RXD_GET_VLAN_TAG(rxdp->Control_2));
- } else {
- if (napi)
- netif_receive_skb(skb);
- else
- netif_rx(skb);
- }
- } else {
send_up:
- queue_rx_frame(skb);
- }
+ queue_rx_frame(skb, RXD_GET_VLAN_TAG(rxdp->Control_2));
dev->last_rx = jiffies;
aggregate:
atomic_dec(&sp->rx_bufs_left[ring_no]);
@@ -8005,6 +8008,7 @@ s2io_init_nic(struct pci_dev *pdev, cons
SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
dev->vlan_rx_register = s2io_vlan_rx_register;
+ dev->vlan_rx_kill_vid = (void *)s2io_vlan_rx_kill_vid;
/*
* will use eth_mac_addr() for dev->set_mac_address
@@ -8306,7 +8310,8 @@ module_init(s2io_starter);
module_exit(s2io_closer);
static int check_L2_lro_capable(u8 *buffer, struct iphdr **ip,
- struct tcphdr **tcp, struct RxD_t *rxdp)
+ struct tcphdr **tcp, struct RxD_t *rxdp,
+ struct s2io_nic *sp)
{
int ip_off;
u8 l2_type = (u8)((rxdp->Control_1 >> 37) & 0x7), ip_len;
@@ -8317,19 +8322,20 @@ static int check_L2_lro_capable(u8 *buff
return -1;
}
- /* TODO:
- * By default the VLAN field in the MAC is stripped by the card, if this
- * feature is turned off in rx_pa_cfg register, then the ip_off field
- * has to be shifted by a further 2 bytes
- */
- switch (l2_type) {
- case 0: /* DIX type */
- case 4: /* DIX type with VLAN */
- ip_off = HEADER_ETHERNET_II_802_3_SIZE;
- break;
+ /* Checking for DIX type or DIX type with VLAN */
+ if ((l2_type == 0)
+ || (l2_type == 4)) {
+ ip_off = HEADER_ETHERNET_II_802_3_SIZE;
+ /*
+ * If vlan stripping is disabled and the frame is VLAN tagged,
+ * shift the offset by the VLAN header size bytes.
+ */
+ if ((!vlan_strip_flag) &&
+ (rxdp->Control_1 & RXD_FRAME_VLAN_TAG))
+ ip_off += HEADER_VLAN_SIZE;
+ } else {
/* LLC, SNAP etc are considered non-mergeable */
- default:
- return -1;
+ return -1;
}
*ip = (struct iphdr *)((u8 *)buffer + ip_off);
@@ -8356,7 +8362,7 @@ static inline int get_l4_pyld_length(str
}
static void initiate_new_session(struct lro *lro, u8 *l2h,
- struct iphdr *ip, struct tcphdr *tcp, u32 tcp_pyld_len)
+ struct iphdr *ip, struct tcphdr *tcp, u32 tcp_pyld_len, u16 vlan_tag)
{
DBG_PRINT(INFO_DBG,"%s: Been here...\n", __FUNCTION__);
lro->l2h = l2h;
@@ -8367,6 +8373,7 @@ static void initiate_new_session(struct
lro->sg_num = 1;
lro->total_len = ntohs(ip->tot_len);
lro->frags_len = 0;
+ lro->vlan_tag = vlan_tag;
/*
* check if we saw TCP timestamp. Other consistency checks have
* already been done.
@@ -8498,15 +8505,16 @@ s2io_club_tcp_session(u8 *buffer, u8 **t
struct iphdr *ip;
struct tcphdr *tcph;
int ret = 0, i;
+ u16 vlan_tag = 0;
if (!(ret = check_L2_lro_capable(buffer, &ip, (struct tcphdr **)tcp,
- rxdp))) {
+ rxdp, sp))) {
DBG_PRINT(INFO_DBG,"IP Saddr: %x Daddr: %x\n",
ip->saddr, ip->daddr);
- } else {
+ } else
return ret;
- }
+ vlan_tag = RXD_GET_VLAN_TAG(rxdp->Control_2);
tcph = (struct tcphdr *)*tcp;
*tcp_len = get_l4_pyld_length(ip, tcph);
for (i=0; i<MAX_LRO_SESSIONS; i++) {
@@ -8566,7 +8574,8 @@ s2io_club_tcp_session(u8 *buffer, u8 **t
switch (ret) {
case 3:
- initiate_new_session(*lro, buffer, ip, tcph, *tcp_len);
+ initiate_new_session(*lro, buffer, ip, tcph, *tcp_len,
+ vlan_tag);
break;
case 2:
update_L3L4_header(sp, *lro);
@@ -8594,15 +8603,25 @@ static void clear_lro_session(struct lro
memset(lro, 0, lro_struct_size);
}
-static void queue_rx_frame(struct sk_buff *skb)
+static void queue_rx_frame(struct sk_buff *skb, u16 vlan_tag)
{
struct net_device *dev = skb->dev;
+ struct s2io_nic *sp = dev->priv;
skb->protocol = eth_type_trans(skb, dev);
- if (napi)
- netif_receive_skb(skb);
- else
- netif_rx(skb);
+ if (sp->vlgrp && vlan_tag
+ && (vlan_strip_flag)) {
+ /* Queueing the vlan frame to the upper layer */
+ if (sp->config.napi)
+ vlan_hwaccel_receive_skb(skb, sp->vlgrp, vlan_tag);
+ else
+ vlan_hwaccel_rx(skb, sp->vlgrp, vlan_tag);
+ } else {
+ if (sp->config.napi)
+ netif_receive_skb(skb);
+ else
+ netif_rx(skb);
+ }
}
static void lro_append_pkt(struct s2io_nic *sp, struct lro *lro,
diff -Nurp 2-0-26-18-3/drivers/net/s2io.h 2-0-26-19-1/drivers/net/s2io.h
--- 2-0-26-18-3/drivers/net/s2io.h 2008-02-15 05:18:47.000000000 +0530
+++ 2-0-26-19-1/drivers/net/s2io.h 2008-02-15 07:03:16.000000000 +0530
@@ -546,6 +546,7 @@ struct RxD_t {
#define RXD_OWN_XENA s2BIT(7)
#define RXD_T_CODE (s2BIT(12)|s2BIT(13)|s2BIT(14)|s2BIT(15))
#define RXD_FRAME_PROTO vBIT(0xFFFF,24,8)
+#define RXD_FRAME_VLAN_TAG s2BIT(24)
#define RXD_FRAME_PROTO_IPV4 s2BIT(27)
#define RXD_FRAME_PROTO_IPV6 s2BIT(28)
#define RXD_FRAME_IP_FRAG s2BIT(29)
@@ -829,10 +830,11 @@ struct lro {
int sg_num;
int in_use;
__be16 window;
+ u16 vlan_tag;
u32 cur_tsval;
__be32 cur_tsecr;
u8 saw_ts;
-};
+} ____cacheline_aligned;
/* These flags represent the devices temporary state */
enum s2io_device_state_t
@@ -1129,7 +1131,7 @@ static int
s2io_club_tcp_session(u8 *buffer, u8 **tcp, u32 *tcp_len, struct lro **lro,
struct RxD_t *rxdp, struct s2io_nic *sp);
static void clear_lro_session(struct lro *lro);
-static void queue_rx_frame(struct sk_buff *skb);
+static void queue_rx_frame(struct sk_buff *skb, u16 vlan_tag);
static void update_L3L4_header(struct s2io_nic *sp, struct lro *lro);
static void lro_append_pkt(struct s2io_nic *sp, struct lro *lro,
struct sk_buff *skb, u32 tcp_len);
^ permalink raw reply
* [Patch 2.6.25 4/4]S2io: Version update for multiqueue and vlan patches
From: Sreenivasa Honnur @ 2008-02-20 22:10 UTC (permalink / raw)
To: netdev, jeff; +Cc: support
- Updated version number.
Signed-off-by: Surjit Reang <surjit.reang@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
---
diff -Nurp 2-0-26-19-1/drivers/net/s2io.c 2-0-26-19-2/drivers/net/s2io.c
--- 2-0-26-19-1/drivers/net/s2io.c 2008-02-15 07:03:10.000000000 +0530
+++ 2-0-26-19-2/drivers/net/s2io.c 2008-02-15 07:04:09.000000000 +0530
@@ -86,7 +86,7 @@
#include "s2io.h"
#include "s2io-regs.h"
-#define DRV_VERSION "2.0.26.15-2"
+#define DRV_VERSION "2.0.26.19"
/* S2io Driver name & version. */
static char s2io_driver_name[] = "Neterion";
^ permalink raw reply
* Re: [RFC PATCH 7/8] [SCTP]: uninline sctp_add_cmd_sf
From: Vlad Yasevich @ 2008-02-20 22:16 UTC (permalink / raw)
To: Ilpo Järvinen
Cc: netdev, linux-kernel, David Miller, Arnaldo Carvalho de Melo
In-Reply-To: <1203515238-22848-8-git-send-email-ilpo.jarvinen@helsinki.fi>
[-- Attachment #1: Type: text/plain, Size: 533 bytes --]
Ilpo Järvinen wrote:
> I added inline to sctp_add_cmd and appropriate comment there to
> avoid adding another call into the call chain. This works at least
> with "gcc (GCC) 4.1.2 20070626 (Red Hat 4.1.2-13)". Alternatively,
> __sctp_add_cmd could be introduced to .h.
>
My only concern was performance regressions, but it looks like it
doesn't effect anything from the few quick runs I've made.
Since we are putting sctp_add_cmd_sf() on the call stack, we might
as well get rid of sctp_add_cmd() and reduce it a bit more.
-vlad
[-- Attachment #2: p --]
[-- Type: text/plain, Size: 2831 bytes --]
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index 10ae2da..4263af8 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -205,12 +205,11 @@ typedef struct {
int sctp_init_cmd_seq(sctp_cmd_seq_t *seq);
/* Add a command to an sctp_cmd_seq_t.
- * Return 0 if the command sequence is full.
*
* Use the SCTP_* constructors defined by SCTP_ARG_CONSTRUCTOR() above
* to wrap data which goes in the obj argument.
*/
-int sctp_add_cmd(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_arg_t obj);
+void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_arg_t obj);
/* Return the next command structure in an sctp_cmd_seq.
* Return NULL at the end of the sequence.
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index ef9e7ed..2481173 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -385,14 +385,6 @@ static inline int ADDIP_SERIAL_gte(__u16 s, __u16 t)
return (((s) == (t)) || (((t) - (s)) & ADDIP_SERIAL_SIGN_BIT));
}
-
-/* Run sctp_add_cmd() generating a BUG() if there is a failure. */
-static inline void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_arg_t obj)
-{
- if (unlikely(!sctp_add_cmd(seq, verb, obj)))
- BUG();
-}
-
/* Check VTAG of the packet matches the sender's own tag. */
static inline int
sctp_vtag_verify(const struct sctp_chunk *chunk,
diff --git a/net/sctp/command.c b/net/sctp/command.c
index bb97733..3a06513 100644
--- a/net/sctp/command.c
+++ b/net/sctp/command.c
@@ -51,19 +51,16 @@ int sctp_init_cmd_seq(sctp_cmd_seq_t *seq)
/* Add a command to a sctp_cmd_seq_t.
* Return 0 if the command sequence is full.
+ *
+ * Inline here is not a mistake, this way sctp_add_cmd_sf doesn't need extra
+ * calls, size penalty is of insignificant magnitude here
*/
-int sctp_add_cmd(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_arg_t obj)
+void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_arg_t obj)
{
- if (seq->next_free_slot >= SCTP_MAX_NUM_COMMANDS)
- goto fail;
+ BUG_ON(seq->next_free_slot >= SCTP_MAX_NUM_COMMANDS);
seq->cmds[seq->next_free_slot].verb = verb;
seq->cmds[seq->next_free_slot++].obj = obj;
-
- return 1;
-
-fail:
- return 0;
}
/* Return the next command structure in a sctp_cmd_seq.
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index f2ed647..1475a29 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -3135,12 +3135,8 @@ sctp_disposition_t sctp_sf_operr_notify(const struct sctp_endpoint *ep,
if (!ev)
goto nomem;
- if (!sctp_add_cmd(commands, SCTP_CMD_EVENT_ULP,
- SCTP_ULPEVENT(ev))) {
- sctp_ulpevent_free(ev);
- goto nomem;
- }
-
+ sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP,
+ SCTP_ULPEVENT(ev));
sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_OPERR,
SCTP_CHUNK(chunk));
}
^ permalink raw reply related
* Re: [PATCH 2.6.25 2/4]S2io: Multiqueue network device support - FIFO selection based on L4 ports
From: Patrick McHardy @ 2008-02-20 22:16 UTC (permalink / raw)
To: Sreenivasa Honnur; +Cc: netdev, jeff, support
In-Reply-To: <Pine.GSO.4.10.10802201644130.11320-100000@guinness>
Sreenivasa Honnur wrote:
> - Resubmit #2
> - Transmit fifo selection based on TCP/UDP ports.
> - Added tx_steering_type loadable parameter for transmit fifo selection.
> 0x0 NO_STEERING: Default FIFO is selected.
> 0x1 TX_PRIORITY_STEERING: FIFO is selected based on skb->priority.
> 0x2 TX_DEFAULT_STEERING: FIFO is selected based on L4 Ports.
>
Why duplicate the generic multiqueue classification?
^ permalink raw reply
* Re: [RFC PATCH 3/8] [NET]: uninline dev_alloc_skb, de-bloats a lot
From: Ilpo Järvinen @ 2008-02-20 22:18 UTC (permalink / raw)
To: Jan Engelhardt
Cc: Patrick McHardy, Netdev, LKML, David Miller,
Arnaldo Carvalho de Melo
In-Reply-To: <Pine.LNX.4.64.0802201730240.26109@fbirervta.pbzchgretzou.qr>
On Wed, 20 Feb 2008, Jan Engelhardt wrote:
>
> On Feb 20 2008 17:27, Patrick McHardy wrote:
> >> Striking. How can this even happen? A callsite which calls
> >>
> >> dev_alloc_skb(n)
> >>
> >> is just equivalent to
> >>
> >> __dev_alloc_skb(n, GFP_ATOMIC);
> >>
> >> which means there's like 4 (or 8 if it's long) bytes more on the
> >> stack. For a worst case, count in another 8 bytes for push and pop or mov on
> >> the stack. But that still does not add up to 23 kb.
I think you misunderstood the results, if I uninlined dev_alloc_skb(), it
_alone_ was uninlined which basically means that __dev_alloc_skb() that is
inline as well is included inside that uninlined function.
When both were inlined, they add up to everywhere, and uninlining
dev_alloc_skb alone mitigates that for both(!) of them in every place
where dev_alloc_skb is being called. Because __dev_alloc_skb call sites
are few, most benefits show up already with dev_alloc_skb uninlining
alone. On the other hand, if __dev_alloc_skb is uninlined, the size
reasoning you used above applies to dev_alloc_skb callsites, and that
is definately less than 23kB.
> > __dev_alloc_skb() is also an inline function which performs
> > some extra work. Which raises the question - if dev_alloc_skb()
> > is uninlined, shouldn't __dev_alloc_skb() be uninline as well?
Of course that could be done as well, however, I wouldn't be too keen to
deepen callchain by both of them, ie., uninlined dev_alloc_skb would just
contain few bytes which perform the call to __dev_alloc_skb which has the
bit larger content due to that "extra work". IMHO the best solution would
duplicate the "extra work" to both of them on binary level (obviously
not on the source level), e.g., by adding static inline ___dev_alloc_skb()
to .h which is inlined to both of the variants. I'm not too sure if inline
to __dev_alloc_skb() alone is enough in .c file to result in inlining of
__dev_alloc_skb to dev_alloc_skb (with all gcc versions and relevant
optimization settings).
> I'd like to see the results when {__dev_alloc_skb is externed
> and dev_alloc_skb remains inlined}.
The results are right under your nose already... ;-)
See from the list of the series introduction:
http://marc.info/?l=linux-netdev&m=120351526210711&w=2
IMHO more interesting number (which I currently don't have) is the
_remaining_ benefits of uninlining __dev_alloc_skb after
dev_alloc_skb was first uninlined.
--
i.
^ permalink raw reply
* Re: [git patches] net driver fixes
From: J. Bruce Fields @ 2008-02-20 22:25 UTC (permalink / raw)
To: David Miller; +Cc: jeff, netdev, linux-kernel
In-Reply-To: <20080220.134257.41491836.davem@davemloft.net>
On Wed, Feb 20, 2008 at 01:42:57PM -0800, David Miller wrote:
> From: "J. Bruce Fields" <bfields@fieldses.org>
> Date: Wed, 20 Feb 2008 16:23:02 -0500
>
> > On Wed, Feb 20, 2008 at 01:15:30PM -0800, David Miller wrote:
> > > From: Jeff Garzik <jeff@garzik.org>
> > > Date: Wed, 20 Feb 2008 11:55:57 -0500
> > >
> > > >
> > > > Note: this is based off of Linus's latest commit
> > > > (5d9c4a7de64d398604a978d267a6987f1f4025b7), since all my previous
> > > > submissions are now upstream (thanks!).
> > >
> > > The whole point of my not rebasing net-2.6 is so that you can always
> > > use it as a base.
> > >
> > > With what you've giving me now I either have to:
> > >
> > > 1) Pull in Linus's tree to net-2.6, then pull from you.
> > >
> > > 2) Pull in directly from you to get it all.
> >
> > Why are either of those a problem?
>
> Because it forces me to pull Linus's upstream into net-2.6,
> I don't have any choice in the matter.
Right. I'm wondering what the problems are that you see with that.
The advantages include earlier warning of merge problems, and avoidance
of duplicate commits--if Jeff's done work that depends on patches that
already upstream, then he either does that work against upstream, or
includes backported patches in the branch he asks you to pull, and you
end up with both the original and the backported patch. Which isn't the
end of the world, but the resulting history seems messier than
necessary.
Or I guess you could both wait to do this merge until you're ready to
pull in Linus's latest?
For non-git-using testers there may be an advantage to always keeping a
tree based on the latest tagged release, as it may simplify providing
them with patches in some cases. But if the goal is to provide a basis
for other maintainer's work, I'd've thought the best policy would be
just to track the tip of every relevant branch (which includes Linus's
in this case).
--b.
^ permalink raw reply
* Re: [RFC PATCH 7/8] [SCTP]: uninline sctp_add_cmd_sf
From: Ilpo Järvinen @ 2008-02-20 22:34 UTC (permalink / raw)
To: Vlad Yasevich; +Cc: Netdev, LKML, David Miller, Arnaldo Carvalho de Melo
In-Reply-To: <47BCA6B8.5000904@hp.com>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1531 bytes --]
On Wed, 20 Feb 2008, Vlad Yasevich wrote:
> Ilpo Järvinen wrote:
> > I added inline to sctp_add_cmd and appropriate comment there to
> > avoid adding another call into the call chain. This works at least
> > with "gcc (GCC) 4.1.2 20070626 (Red Hat 4.1.2-13)". Alternatively,
> > __sctp_add_cmd could be introduced to .h.
> >
>
> My only concern was performance regressions, but it looks like it
> doesn't effect anything from the few quick runs I've made.
There was one call made anyway, it's a bit hard to see how it would hurt
to push that BUG() deeper down (in fact, this is one of the easiest case
in this respect, many other cases elsewhere that need uninlining don't
currently make any calls with inlines).
> Since we are putting sctp_add_cmd_sf() on the call stack, we might
> as well get rid of sctp_add_cmd() and reduce it a bit more.
IMHO it is definately better solution for archiving the size reduction,
I just didn't know before that the only sctp_add_cmd call could be
converted.
[...snip...]
> diff --git a/net/sctp/command.c b/net/sctp/command.c
> index bb97733..3a06513 100644
> --- a/net/sctp/command.c
> +++ b/net/sctp/command.c
> @@ -51,19 +51,16 @@ int sctp_init_cmd_seq(sctp_cmd_seq_t *seq)
>
> /* Add a command to a sctp_cmd_seq_t.
> * Return 0 if the command sequence is full.
> + *
> + * Inline here is not a mistake, this way sctp_add_cmd_sf doesn't need extra
> + * calls, size penalty is of insignificant magnitude here
This won't be a necessary note anymore. :-)
[...snip...]
--
i.
^ permalink raw reply
* Re: [PATCH][PPPOL2TP]: Fix SMP oops in pppol2tp driver
From: James Chapman @ 2008-02-20 22:37 UTC (permalink / raw)
To: Jarek Poplawski; +Cc: David Miller, Paul Mackerras, netdev
In-Reply-To: <20080220183837.GA2881@ami.dom.local>
[-- Attachment #1: Type: text/plain, Size: 1152 bytes --]
Jarek Poplawski wrote:
>>> (testing patch #1)
>
> But I hope you tested with the fixed (take 2) version of this patch...
Yes I did. :)
But I just got another lockdep error (attached).
> Since it's quite experimental (testing) this patch could be wrong
> as it is, but I hope it should show the proper way to solve this
> problem. Probably you did some of these, but here are a few of my
> suggestions for testing this:
>
> 1) try my patch with your full bh locking changing patch;
> 2) add while loops to these trylocks on failure, with e.g. __delay(1);
> this should work like full locks again, but there should be no (this
> kind of) lockdep reports;
Hmm, isn't this just bypassing the lockdep checks?
> 3) I send here another testing patch with this second way to do this:
> on the write side, but it's even more "experimental" and only a
> proof of concept (should be applied on vanilla ppp_generic).
I'll look over it. I think I need to take a step back and look at what's
happening in more detail though.
--
James Chapman
Katalix Systems Ltd
http://www.katalix.com
Catalysts for your Embedded Linux software development
[-- Attachment #2: lockdep.log --]
[-- Type: text/plain, Size: 8600 bytes --]
Feb 20 22:11:41 localhost kernel: =================================
Feb 20 22:11:43 localhost kernel: [ INFO: inconsistent lock state ]
Feb 20 22:11:44 localhost kernel: 2.6.24.2 #1
Feb 20 22:11:44 localhost kernel: ---------------------------------
Feb 20 22:11:44 localhost kernel: inconsistent {softirq-on-W} -> {in-softirq-R} usage.
Feb 20 22:11:44 localhost kernel: pppd/3744 [HC0[0]:SC1[5]:HE1:SE0] takes:
Feb 20 22:11:44 localhost kernel: (&sk->sk_dst_lock){---?}, at: [<f8bac857>] pppol2tp_xmit+0x320/0x3d9 [pppol2tp]
Feb 20 22:11:45 localhost kernel: {softirq-on-W} state was registered at:
Feb 20 22:11:45 localhost kernel: [<c0449046>] __lock_acquire+0x48b/0xbf1
Feb 20 22:11:45 localhost kernel: [<c0448594>] mark_held_locks+0x39/0x53
Feb 20 22:11:45 localhost kernel: [<c043083a>] local_bh_enable+0x10e/0x115
Feb 20 22:11:45 localhost kernel: [<c05da996>] inet_csk_get_port+0xc1/0x1cb
Feb 20 22:11:45 localhost kernel: [<c044981c>] lock_acquire+0x70/0x8a
Feb 20 22:11:45 localhost kernel: [<c05da85d>] inet_csk_listen_start+0x75/0xed
Feb 20 22:11:45 localhost kernel: [<c061b2c7>] _write_lock+0x29/0x34
Feb 20 22:11:45 localhost kernel: [<c05da85d>] inet_csk_listen_start+0x75/0xed
Feb 20 22:11:45 localhost kernel: [<c05da85d>] inet_csk_listen_start+0x75/0xed
Feb 20 22:11:45 localhost kernel: [<c05f66da>] inet_listen+0x3b/0x5e
Feb 20 22:11:45 localhost kernel: [<c05ab68f>] sys_listen+0x43/0x5f
Feb 20 22:11:45 localhost kernel: [<c05acba8>] sys_socketcall+0xbd/0x261
Feb 20 22:11:45 localhost kernel: [<c0404ead>] sysenter_past_esp+0x9a/0xa5
Feb 20 22:11:45 localhost kernel: [<c0448787>] trace_hardirqs_on+0x122/0x14c
Feb 20 22:11:45 localhost kernel: [<c0404e72>] sysenter_past_esp+0x5f/0xa5
Feb 20 22:11:45 localhost kernel: [<ffffffff>] 0xffffffff
Feb 20 22:11:45 localhost kernel: irq event stamp: 41702
Feb 20 22:11:45 localhost kernel: hardirqs last enabled at (41702): [<c047a1bd>] kfree+0x9f/0xa6
Feb 20 22:11:45 localhost kernel: hardirqs last disabled at (41701): [<c047a135>] kfree+0x17/0xa6
Feb 20 22:11:45 localhost kernel: softirqs last enabled at (41630): [<c05ceed4>] rt_run_flush+0x64/0x8b
Feb 20 22:11:45 localhost kernel: softirqs last disabled at (41631): [<c040709f>] do_softirq+0x5e/0xc7
Feb 20 22:11:45 localhost kernel:
Feb 20 22:11:45 localhost kernel: other info that might help us debug this:
Feb 20 22:11:45 localhost kernel: 10 locks held by pppd/3744:
Feb 20 22:11:45 localhost kernel: #0: (rtnl_mutex){--..}, at: [<c05f53bd>] devinet_ioctl+0xf4/0x539
Feb 20 22:11:45 localhost kernel: #1: ((inetaddr_chain).rwsem){..--}, at: [<c04411c9>] __blocking_notifier_call_chain+0x22/0x51
Feb 20 22:11:45 localhost kernel: #2: (rcu_read_lock){..--}, at: [<c05b7782>] net_rx_action+0x4e/0x1b3
Feb 20 22:11:45 localhost kernel: #3: (rcu_read_lock){..--}, at: [<c05b5402>] netif_receive_skb+0xf4/0x3d4
Feb 20 22:11:45 localhost kernel: #4: (rcu_read_lock){..--}, at: [<c05d2b3a>] ip_local_deliver_finish+0x2e/0x1f8
Feb 20 22:11:45 localhost kernel: #5: (slock-AF_INET){-+..}, at: [<c05f2d21>] icmp_reply+0x52/0x1a4
Feb 20 22:11:45 localhost kernel: #6: (rcu_read_lock){..--}, at: [<c05b7e60>] dev_queue_xmit+0x125/0x2e9
Feb 20 22:11:45 localhost kernel: #7: (_xmit_PPP){-+..}, at: [<c05c4cb1>] __qdisc_run+0x5b/0x156
Feb 20 22:11:45 localhost kernel: #8: (&ppp->wlock){-+..}, at: [<f8b9ef10>] ppp_xmit_process+0x15/0x5a1 [ppp_generic]
Feb 20 22:11:45 localhost kernel: #9: (&pch->downl){-+..}, at: [<f8b9e6db>] ppp_push+0x63/0x50d [ppp_generic]
Feb 20 22:11:45 localhost kernel:
Feb 20 22:11:45 localhost kernel: stack backtrace:
Feb 20 22:11:45 localhost kernel: Pid: 3744, comm: pppd Not tainted 2.6.24.2 #1
Feb 20 22:11:45 localhost kernel: [<c0447933>] print_usage_bug+0x139/0x143
Feb 20 22:11:45 localhost kernel: [<c04482d2>] mark_lock+0x1cb/0x454
Feb 20 22:11:45 localhost kernel: [<c04480a2>] find_usage_forwards+0x67/0x8b
Feb 20 22:11:45 localhost kernel: [<c0448fdf>] __lock_acquire+0x424/0xbf1
Feb 20 22:11:46 localhost kernel: [<c0448b8e>] check_noncircular+0x66/0x93
Feb 20 22:11:46 localhost kernel: [<c0448594>] mark_held_locks+0x39/0x53
Feb 20 22:11:46 localhost kernel: [<c047a1bd>] kfree+0x9f/0xa6
Feb 20 22:11:46 localhost kernel: [<c0448771>] trace_hardirqs_on+0x10c/0x14c
Feb 20 22:11:46 localhost kernel: [<c044981c>] lock_acquire+0x70/0x8a
Feb 20 22:11:46 localhost kernel: [<f8bac857>] pppol2tp_xmit+0x320/0x3d9 [pppol2tp]
Feb 20 22:11:46 localhost kernel: [<c061b3a7>] _read_lock+0x29/0x34
Feb 20 22:11:46 localhost kernel: [<f8bac857>] pppol2tp_xmit+0x320/0x3d9 [pppol2tp]
Feb 20 22:11:46 localhost kernel: [<f8bac857>] pppol2tp_xmit+0x320/0x3d9 [pppol2tp]
Feb 20 22:11:46 localhost kernel: [<f8b9e6db>] ppp_push+0x63/0x50d [ppp_generic]
Feb 20 22:11:46 localhost kernel: [<c061b293>] _spin_lock_bh+0x2e/0x39
Feb 20 22:11:46 localhost kernel: [<f8b9e6ee>] ppp_push+0x76/0x50d [ppp_generic]
Feb 20 22:11:46 localhost kernel: [<c061b622>] _spin_unlock_irqrestore+0x34/0x39
Feb 20 22:11:46 localhost kernel: [<c0448771>] trace_hardirqs_on+0x10c/0x14c
Feb 20 22:11:46 localhost kernel: [<f8b9f3f1>] ppp_xmit_process+0x4f6/0x5a1 [ppp_generic]
Feb 20 22:11:46 localhost kernel: [<c0448771>] trace_hardirqs_on+0x10c/0x14c
Feb 20 22:11:46 localhost kernel: [<f8b9f5d2>] ppp_start_xmit+0x136/0x167 [ppp_generic]
Feb 20 22:11:46 localhost kernel: [<c05b5d29>] dev_hard_start_xmit+0x245/0x29f
Feb 20 22:11:46 localhost kernel: [<c061b25a>] _spin_lock+0x29/0x34
Feb 20 22:11:46 localhost kernel: [<c05c4cc0>] __qdisc_run+0x6a/0x156
Feb 20 22:11:46 localhost kernel: [<c05b7ee0>] dev_queue_xmit+0x1a5/0x2e9
Feb 20 22:11:46 localhost kernel: [<c05b7e60>] dev_queue_xmit+0x125/0x2e9
Feb 20 22:11:46 localhost kernel: [<c05d62f5>] ip_finish_output+0x1f4/0x21e
Feb 20 22:11:46 localhost kernel: [<c05d4f78>] ip_push_pending_frames+0x2dc/0x33b
Feb 20 22:11:46 localhost kernel: [<c05f2de5>] icmp_reply+0x116/0x1a4
Feb 20 22:11:46 localhost kernel: [<c05f32b6>] icmp_echo+0x49/0x4d
Feb 20 22:11:46 localhost kernel: [<c05d2b3a>] ip_local_deliver_finish+0x2e/0x1f8
Feb 20 22:11:46 localhost kernel: [<c05f2f67>] icmp_rcv+0xf4/0x116
Feb 20 22:11:46 localhost kernel: [<c05d2c4b>] ip_local_deliver_finish+0x13f/0x1f8
Feb 20 22:11:46 localhost kernel: [<c05d2b3a>] ip_local_deliver_finish+0x2e/0x1f8
Feb 20 22:11:46 localhost kernel: [<c05d2ad2>] ip_rcv_finish+0x2fe/0x338
Feb 20 22:11:46 localhost kernel: [<c05b5402>] netif_receive_skb+0xf4/0x3d4
Feb 20 22:11:46 localhost kernel: [<c05d2dc6>] ip_rcv+0x0/0x237
Feb 20 22:11:46 localhost kernel: [<c05b5681>] netif_receive_skb+0x373/0x3d4
Feb 20 22:11:46 localhost kernel: [<c05b5402>] netif_receive_skb+0xf4/0x3d4
Feb 20 22:11:46 localhost kernel: [<c05b7c53>] process_backlog+0x6c/0xb9
Feb 20 22:11:46 localhost kernel: [<c05b77f0>] net_rx_action+0xbc/0x1b3
Feb 20 22:11:46 localhost kernel: [<c05b7782>] net_rx_action+0x4e/0x1b3
Feb 20 22:11:46 localhost kernel: [<c0430a9a>] __do_softirq+0x69/0xde
Feb 20 22:11:46 localhost kernel: [<c040709f>] do_softirq+0x5e/0xc7
Feb 20 22:11:47 localhost kernel: [<c05ceed4>] rt_run_flush+0x64/0x8b
Feb 20 22:11:47 localhost kernel: [<c05ceed4>] rt_run_flush+0x64/0x8b
Feb 20 22:11:47 localhost kernel: [<c04308ee>] local_bh_enable_ip+0xad/0xd5
Feb 20 22:11:47 localhost kernel: [<c05ceed4>] rt_run_flush+0x64/0x8b
Feb 20 22:11:47 localhost kernel: [<c05fa7e7>] fib_disable_ip+0x1e/0x26
Feb 20 22:11:47 localhost kernel: [<c05faf99>] fib_inetaddr_event+0x19c/0x1b0
Feb 20 22:11:47 localhost kernel: [<c061d06c>] notifier_call_chain+0x2a/0x47
Feb 20 22:11:47 localhost kernel: [<c04411e5>] __blocking_notifier_call_chain+0x3e/0x51
Feb 20 22:11:47 localhost kernel: [<c044120f>] blocking_notifier_call_chain+0x17/0x1a
Feb 20 22:11:47 localhost kernel: [<c05f450b>] __inet_del_ifa+0x12f/0x1f0
Feb 20 22:11:47 localhost kernel: [<c05f45e3>] inet_del_ifa+0x17/0x1a
Feb 20 22:11:47 localhost kernel: [<c05f5716>] devinet_ioctl+0x44d/0x539
Feb 20 22:11:47 localhost kernel: [<c05b7188>] dev_ioctl+0x46f/0x5e0
Feb 20 22:11:47 localhost kernel: [<c05ab078>] sock_ioctl+0x1bb/0x1e0
Feb 20 22:11:47 localhost kernel: [<c05aaebd>] sock_ioctl+0x0/0x1e0
Feb 20 22:11:47 localhost kernel: [<c0488827>] do_ioctl+0x1f/0x62
Feb 20 22:11:47 localhost kernel: [<c0458df0>] audit_syscall_entry+0x10d/0x137
Feb 20 22:11:47 localhost kernel: [<c0488aa1>] vfs_ioctl+0x237/0x249
Feb 20 22:11:47 localhost kernel: [<c0488af8>] sys_ioctl+0x45/0x5d
Feb 20 22:11:47 localhost kernel: [<c0404efa>] syscall_call+0x7/0xb
Feb 20 22:11:47 localhost kernel: =======================
^ permalink raw reply
* Re: [git patches] net driver fixes
From: David Miller @ 2008-02-20 22:57 UTC (permalink / raw)
To: bfields; +Cc: jeff, netdev, linux-kernel
In-Reply-To: <20080220222530.GK30160@fieldses.org>
From: "J. Bruce Fields" <bfields@fieldses.org>
Date: Wed, 20 Feb 2008 17:25:30 -0500
> The advantages include earlier warning of merge problems, and avoidance
> of duplicate commits--if Jeff's done work that depends on patches that
> already upstream, then he either does that work against upstream, or
> includes backported patches in the branch he asks you to pull, and you
> end up with both the original and the backported patch. Which isn't the
> end of the world, but the resulting history seems messier than
> necessary.
>
> Or I guess you could both wait to do this merge until you're ready to
> pull in Linus's latest?
I do a test pull and build of net-2.6 into Linus's current tree
before I send Linus a pull request.
If any non-trivial merges are necessary, which hasn't happened yet at
all, I would then do a merge into my net-2.6 tree and resolve the
conflicts.
There is no reason for someone downstream of net-2.6 to do this.
^ permalink raw reply
* Re: [git patches] net driver fixes
From: Francois Romieu @ 2008-02-20 22:40 UTC (permalink / raw)
To: David Miller; +Cc: bfields, jeff, netdev, linux-kernel
In-Reply-To: <20080220.134257.41491836.davem@davemloft.net>
David Miller <davem@davemloft.net> :
[...]
> Because it forces me to pull Linus's upstream into net-2.6,
> I don't have any choice in the matter.
Jeff's choice is a bit surprizing. That being said, it would had been nice
to fast-forward net-2.6 from a442585952f137bd4cdb1f2f3166e4157d383b82
to Linus's upstream before applying the content of
12aa343add3eced38a44bdb612b35fdf634d918c in order to keep the drift
with Linus's branch to a minimum during the bugfix cycle.
--
Ueimor
^ permalink raw reply
* RE: [PATCH 2.6.25 2/4]S2io: Multiqueue network device support - FIFO selection based on L4 ports
From: Ramkrishna Vepa @ 2008-02-20 22:57 UTC (permalink / raw)
To: Patrick McHardy, Sreenivasa Honnur; +Cc: netdev, jeff, support
In-Reply-To: <47BCA6C5.1070805@trash.net>
> Sreenivasa Honnur wrote:
> > - Resubmit #2
> > - Transmit fifo selection based on TCP/UDP ports.
> > - Added tx_steering_type loadable parameter for transmit fifo
selection.
> > 0x0 NO_STEERING: Default FIFO is selected.
> > 0x1 TX_PRIORITY_STEERING: FIFO is selected based on skb->priority.
> > 0x2 TX_DEFAULT_STEERING: FIFO is selected based on L4 Ports.
> >
>
> Why duplicate the generic multiqueue classification?
[Ram] Could you be more specific?
Ram
>
^ permalink raw reply
* Re: TG3 network data corruption regression 2.6.24/2.6.23.4
From: Tony Battersby @ 2008-02-20 23:04 UTC (permalink / raw)
To: Matt Carlson
Cc: Michael Chan, David Miller, herbert, netdev, gregkh, linux-kernel
In-Reply-To: <20080220013824.GA5416@localdomain>
The following patch fixes the problem for me. Do we want to accept this
patch and call it a day or continue investigating the source of the problem?
Patch applies to 2.6.24.2, but doesn't apply to 2.6.25-rc. If everyone
agrees that this is the right solution, I will resubmit with a proper
subject line and description.
Tony
--- linux-2.6.24.2/include/net/sock.h.orig 2008-02-20 17:19:20.000000000 -0500
+++ linux-2.6.24.2/include/net/sock.h 2008-02-20 17:25:55.000000000 -0500
@@ -1236,8 +1236,10 @@ static inline struct sk_buff *sk_stream_
{
struct sk_buff *skb;
- /* The TCP header must be at least 32-bit aligned. */
- size = ALIGN(size, 4);
+ /* The TCP header must be at least 32-bit aligned, but some chipsets
+ * such as Broadcom BCM5701 require at least 16-byte alignment.
+ */
+ size = ALIGN(size, 16);
skb = alloc_skb_fclone(size + sk->sk_prot->max_header, gfp);
if (skb) {
^ permalink raw reply
* Re: [git patches] net driver fixes
From: David Miller @ 2008-02-20 23:07 UTC (permalink / raw)
To: romieu; +Cc: bfields, jeff, netdev, linux-kernel
In-Reply-To: <20080220224053.GA8500@electric-eye.fr.zoreil.com>
From: Francois Romieu <romieu@fr.zoreil.com>
Date: Wed, 20 Feb 2008 23:40:53 +0100
> David Miller <davem@davemloft.net> :
> [...]
> > Because it forces me to pull Linus's upstream into net-2.6,
> > I don't have any choice in the matter.
>
> Jeff's choice is a bit surprizing. That being said, it would had been nice
> to fast-forward net-2.6 from a442585952f137bd4cdb1f2f3166e4157d383b82
> to Linus's upstream before applying the content of
> 12aa343add3eced38a44bdb612b35fdf634d918c in order to keep the drift
> with Linus's branch to a minimum during the bugfix cycle.
Keep in mind there are also pending fixes in my net-2.6 tree which
Linus hasn't pulled in yet as well.
I watch Linus's tree closely, and I'll see any potential merge issue
long before it matters, and I always double check before pushing
stuff out to him.
My job as tree master is to deal with all the merge hassles, should
they occur. But up until now everything networking has gone through
my tree and everything is fine.
The net-2.6 tree isn't even a week old. I planned to pull Linus's
tree in right before I leave for a short trip tomorrow afternoon.
I'm really not being allowed to make that choice by how these
changes are being merged to me.
Heck, Jeff even thanked me for making my net-2.6 tree stable and not
rebasing, so his method of merging this stuff is doubly surprising for
me.
Jeff, I really don't want to pull that tree in. Please trust me as
your upstream to handle merging issues, as needed.
Thanks!
^ permalink raw reply
* Re: TG3 network data corruption regression 2.6.24/2.6.23.4
From: David Miller @ 2008-02-20 23:08 UTC (permalink / raw)
To: tonyb; +Cc: mcarlson, mchan, herbert, netdev, gregkh, linux-kernel
In-Reply-To: <47BCB1E9.8020102@cybernetics.com>
From: Tony Battersby <tonyb@cybernetics.com>
Date: Wed, 20 Feb 2008 18:04:09 -0500
> The following patch fixes the problem for me. Do we want to accept this
> patch and call it a day or continue investigating the source of the problem?
>
> Patch applies to 2.6.24.2, but doesn't apply to 2.6.25-rc. If everyone
> agrees that this is the right solution, I will resubmit with a proper
> subject line and description.
A chipset bug, if it even exists, should be worked around in the
driver for that hardware. We shouldn't make every other piece
of hardware in the world suffer too.
^ permalink raw reply
* Re: [PATCH 2.6.25 2/4]S2io: Multiqueue network device support - FIFO selection based on L4 ports
From: Patrick McHardy @ 2008-02-20 23:08 UTC (permalink / raw)
To: Ramkrishna Vepa; +Cc: Sreenivasa Honnur, netdev, jeff, support
In-Reply-To: <78C9135A3D2ECE4B8162EBDCE82CAD77030E30E5@nekter>
Ramkrishna Vepa wrote:
>> Sreenivasa Honnur wrote:
>>
>>> - Resubmit #2
>>> - Transmit fifo selection based on TCP/UDP ports.
>>> - Added tx_steering_type loadable parameter for transmit fifo
>>>
> selection.
>
>>> 0x0 NO_STEERING: Default FIFO is selected.
>>> 0x1 TX_PRIORITY_STEERING: FIFO is selected based on skb->priority.
>>> 0x2 TX_DEFAULT_STEERING: FIFO is selected based on L4 Ports.
>>>
>>>
>> Why duplicate the generic multiqueue classification?
>>
> [Ram] Could you be more specific?
>
The generic multiqueue support classifies packets by setting
skb->queue_mapping using qdisc classifiers, which is more
flexible and avoids using module parameters.
^ permalink raw reply
* Re: [PATCH 2.6.25 2/4]S2io: Multiqueue network device support - FIFO selection based on L4 ports
From: David Miller @ 2008-02-20 23:12 UTC (permalink / raw)
To: kaber; +Cc: Ramkrishna.Vepa, Sreenivasa.Honnur, netdev, jeff, support
In-Reply-To: <47BCB304.9050709@trash.net>
From: Patrick McHardy <kaber@trash.net>
Date: Thu, 21 Feb 2008 00:08:52 +0100
> Ramkrishna Vepa wrote:
> >> Sreenivasa Honnur wrote:
> >>
> >>> - Resubmit #2
> >>> - Transmit fifo selection based on TCP/UDP ports.
> >>> - Added tx_steering_type loadable parameter for transmit fifo
> >>>
> > selection.
> >
> >>> 0x0 NO_STEERING: Default FIFO is selected.
> >>> 0x1 TX_PRIORITY_STEERING: FIFO is selected based on skb->priority.
> >>> 0x2 TX_DEFAULT_STEERING: FIFO is selected based on L4 Ports.
> >>>
> >>>
> >> Why duplicate the generic multiqueue classification?
> >>
> > [Ram] Could you be more specific?
> >
>
> The generic multiqueue support classifies packets by setting
> skb->queue_mapping using qdisc classifiers, which is more
> flexible and avoids using module parameters.
But it doesn't do what these multiqueue TX queue hardware devices
want. These devices don't want packet scheduler "classification",
they want load balancing using some key (current cpu number,
hashing on the packet headers, etc.) And that's not what our
packet scheduler classifiers do or should do.
We don't want to have to tell people "you have to run 'tc' magic
foo to use all of the TX queues on your network card." That's
completely unreasonable and stupid.
We have to resolve this somehow, and there have been many discussions
about this a month or so ago.
^ permalink raw reply
* Re: [PATCH 2.6.25 2/4]S2io: Multiqueue network device support - FIFO selection based on L4 ports
From: Patrick McHardy @ 2008-02-20 23:15 UTC (permalink / raw)
To: David Miller; +Cc: Ramkrishna.Vepa, Sreenivasa.Honnur, netdev, jeff, support
In-Reply-To: <20080220.151244.79005114.davem@davemloft.net>
David Miller wrote:
> From: Patrick McHardy <kaber@trash.net>
> Date: Thu, 21 Feb 2008 00:08:52 +0100
>
>
>> Ramkrishna Vepa wrote:
>>
>>>> Sreenivasa Honnur wrote:
>>>>
>>>>
>>>>> - Resubmit #2
>>>>> - Transmit fifo selection based on TCP/UDP ports.
>>>>> - Added tx_steering_type loadable parameter for transmit fifo
>>>>>
>>>>>
>>> selection.
>>>
>>>
>>>>> 0x0 NO_STEERING: Default FIFO is selected.
>>>>> 0x1 TX_PRIORITY_STEERING: FIFO is selected based on skb->priority.
>>>>> 0x2 TX_DEFAULT_STEERING: FIFO is selected based on L4 Ports.
>>>>>
>>>>>
>>>>>
>>>> Why duplicate the generic multiqueue classification?
>>>>
>>>>
>>> [Ram] Could you be more specific?
>>>
>>>
>> The generic multiqueue support classifies packets by setting
>> skb->queue_mapping using qdisc classifiers, which is more
>> flexible and avoids using module parameters.
>>
>
> But it doesn't do what these multiqueue TX queue hardware devices
> want. These devices don't want packet scheduler "classification",
> they want load balancing using some key (current cpu number,
> hashing on the packet headers, etc.) And that's not what our
> packet scheduler classifiers do or should do.
>
Its what the flow classifier does :)
> We don't want to have to tell people "you have to run 'tc' magic
> foo to use all of the TX queues on your network card." That's
> completely unreasonable and stupid.
>
> We have to resolve this somehow, and there have been many discussions
> about this a month or so ago.
>
I see. I missed those discussions, but this has already been
agreed on, fine by me. It would still be preferable to use
queue_mapping instead of priority IMO, even if its activated
by a module parameter, since that leaves the option to use
classifiers.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox