* Re: [PATCH net-next 1/4] tulip: xircom_cb: Convert #ifdef DEBUG blocks and enter/leave uses
From: Grant Grundler @ 2011-05-12 3:36 UTC (permalink / raw)
To: Joe Perches; +Cc: netdev, linux-kernel
In-Reply-To: <aae1da5aca13af94b621ffe64634435c26c88465.1304733889.git.joe@perches.com>
On Fri, May 06, 2011 at 07:08:42PM -0700, Joe Perches wrote:
> Change the blocks that are guarded by #if DEBUG to
> be #if defined DEBUG && DEBUG > 1 so that pr_debug
> can be used later.
>
> Rename enter/leave macros to func_enter and func_exit.
>
> Signed-off-by: Joe Perches <joe@perches.com>
Good cleanups. :)
Acked-by: Grant Grundler <grundler@parisc-linux.org>
thanks!
grant
> ---
> drivers/net/tulip/xircom_cb.c | 152 ++++++++++++++++++++--------------------
> 1 files changed, 76 insertions(+), 76 deletions(-)
>
> diff --git a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c
> index 5a73752..4436865 100644
> --- a/drivers/net/tulip/xircom_cb.c
> +++ b/drivers/net/tulip/xircom_cb.c
> @@ -37,12 +37,12 @@
> #include <asm/irq.h>
> #endif
>
> -#ifdef DEBUG
> -#define enter(x) printk("Enter: %s, %s line %i\n",x,__FILE__,__LINE__)
> -#define leave(x) printk("Leave: %s, %s line %i\n",x,__FILE__,__LINE__)
> +#if defined DEBUG && DEBUG > 1
> +#define func_enter(x) pr_debug("Enter: %s\n", __func__)
> +#define func_exit(x) pr_debug("Exit: %s\n", __func__)
> #else
> -#define enter(x) do {} while (0)
> -#define leave(x) do {} while (0)
> +#define func_enter(x) no_printk(KERN_DEBUG "Enter: %s\n", __func__)
> +#define func_exit(x) no_printk(KERN_DEBUG "Exit: %s\n", __func__)
> #endif
>
>
> @@ -161,7 +161,7 @@ static struct pci_driver xircom_ops = {
> };
>
>
> -#ifdef DEBUG
> +#if defined DEBUG && DEBUG > 1
> static void print_binary(unsigned int number)
> {
> int i,i2;
> @@ -176,7 +176,7 @@ static void print_binary(unsigned int number)
> if ((i&3)==0)
> buffer[i2++]=' ';
> }
> - printk("%s\n",buffer);
> + pr_debug("%s\n",buffer);
> }
> #endif
>
> @@ -205,7 +205,7 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
> struct xircom_private *private;
> unsigned long flags;
> unsigned short tmp16;
> - enter("xircom_probe");
> + func_enter();
>
> /* First do the PCI initialisation */
>
> @@ -285,7 +285,7 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
>
> trigger_receive(private);
>
> - leave("xircom_probe");
> + func_exit();
> return 0;
>
> reg_fail:
> @@ -310,7 +310,7 @@ static void __devexit xircom_remove(struct pci_dev *pdev)
> struct net_device *dev = pci_get_drvdata(pdev);
> struct xircom_private *card = netdev_priv(dev);
>
> - enter("xircom_remove");
> + func_enter();
> pci_free_consistent(pdev,8192,card->rx_buffer,card->rx_dma_handle);
> pci_free_consistent(pdev,8192,card->tx_buffer,card->tx_dma_handle);
>
> @@ -318,7 +318,7 @@ static void __devexit xircom_remove(struct pci_dev *pdev)
> unregister_netdev(dev);
> free_netdev(dev);
> pci_set_drvdata(pdev, NULL);
> - leave("xircom_remove");
> + func_exit();
> }
>
> static irqreturn_t xircom_interrupt(int irq, void *dev_instance)
> @@ -328,17 +328,17 @@ static irqreturn_t xircom_interrupt(int irq, void *dev_instance)
> unsigned int status;
> int i;
>
> - enter("xircom_interrupt\n");
> + func_enter();
>
> spin_lock(&card->lock);
> status = inl(card->io_port+CSR5);
>
> -#ifdef DEBUG
> +#if defined DEBUG && DEBUG > 1
> print_binary(status);
> - printk("tx status 0x%08x 0x%08x\n",
> - card->tx_buffer[0], card->tx_buffer[4]);
> - printk("rx status 0x%08x 0x%08x\n",
> - card->rx_buffer[0], card->rx_buffer[4]);
> + pr_debug("tx status 0x%08x 0x%08x\n",
> + card->tx_buffer[0], card->tx_buffer[4]);
> + pr_debug("rx status 0x%08x 0x%08x\n",
> + card->rx_buffer[0], card->rx_buffer[4]);
> #endif
> /* Handle shared irq and hotplug */
> if (status == 0 || status == 0xffffffff) {
> @@ -371,7 +371,7 @@ static irqreturn_t xircom_interrupt(int irq, void *dev_instance)
>
>
> spin_unlock(&card->lock);
> - leave("xircom_interrupt");
> + func_exit();
> return IRQ_HANDLED;
> }
>
> @@ -382,7 +382,7 @@ static netdev_tx_t xircom_start_xmit(struct sk_buff *skb,
> unsigned long flags;
> int nextdescriptor;
> int desc;
> - enter("xircom_start_xmit");
> + func_enter();
>
> card = netdev_priv(dev);
> spin_lock_irqsave(&card->lock,flags);
> @@ -424,7 +424,7 @@ static netdev_tx_t xircom_start_xmit(struct sk_buff *skb,
> netif_stop_queue(dev);
> }
> card->transmit_used = nextdescriptor;
> - leave("xircom-start_xmit - sent");
> + func_exit();
> spin_unlock_irqrestore(&card->lock,flags);
> return NETDEV_TX_OK;
> }
> @@ -446,18 +446,18 @@ static int xircom_open(struct net_device *dev)
> {
> struct xircom_private *xp = netdev_priv(dev);
> int retval;
> - enter("xircom_open");
> + func_enter();
> pr_info("xircom cardbus adaptor found, registering as %s, using irq %i\n",
> dev->name, dev->irq);
> retval = request_irq(dev->irq, xircom_interrupt, IRQF_SHARED, dev->name, dev);
> if (retval) {
> - leave("xircom_open - No IRQ");
> + func_exit();
> return retval;
> }
>
> xircom_up(xp);
> xp->open = 1;
> - leave("xircom_open");
> + func_exit();
> return 0;
> }
>
> @@ -466,7 +466,7 @@ static int xircom_close(struct net_device *dev)
> struct xircom_private *card;
> unsigned long flags;
>
> - enter("xircom_close");
> + func_enter();
> card = netdev_priv(dev);
> netif_stop_queue(dev); /* we don't want new packets */
>
> @@ -486,7 +486,7 @@ static int xircom_close(struct net_device *dev)
> card->open = 0;
> free_irq(dev->irq,dev);
>
> - leave("xircom_close");
> + func_exit();
>
> return 0;
>
> @@ -507,7 +507,7 @@ static void initialize_card(struct xircom_private *card)
> {
> unsigned int val;
> unsigned long flags;
> - enter("initialize_card");
> + func_enter();
>
>
> spin_lock_irqsave(&card->lock, flags);
> @@ -535,7 +535,7 @@ static void initialize_card(struct xircom_private *card)
>
> spin_unlock_irqrestore(&card->lock, flags);
>
> - leave("initialize_card");
> + func_exit();
> }
>
> /*
> @@ -547,12 +547,12 @@ ignored; I chose zero.
> static void trigger_transmit(struct xircom_private *card)
> {
> unsigned int val;
> - enter("trigger_transmit");
> + func_enter();
>
> val = 0;
> outl(val, card->io_port + CSR1);
>
> - leave("trigger_transmit");
> + func_exit();
> }
>
> /*
> @@ -565,12 +565,12 @@ ignored; I chose zero.
> static void trigger_receive(struct xircom_private *card)
> {
> unsigned int val;
> - enter("trigger_receive");
> + func_enter();
>
> val = 0;
> outl(val, card->io_port + CSR2);
>
> - leave("trigger_receive");
> + func_exit();
> }
>
> /*
> @@ -581,7 +581,7 @@ static void setup_descriptors(struct xircom_private *card)
> {
> u32 address;
> int i;
> - enter("setup_descriptors");
> + func_enter();
>
>
> BUG_ON(card->rx_buffer == NULL);
> @@ -637,7 +637,7 @@ static void setup_descriptors(struct xircom_private *card)
> address = card->tx_dma_handle;
> outl(address, card->io_port + CSR4); /* xmit descr list address */
>
> - leave("setup_descriptors");
> + func_exit();
> }
>
> /*
> @@ -647,13 +647,13 @@ valid by setting the address in the card to 0x00.
> static void remove_descriptors(struct xircom_private *card)
> {
> unsigned int val;
> - enter("remove_descriptors");
> + func_enter();
>
> val = 0;
> outl(val, card->io_port + CSR3); /* Receive descriptor address */
> outl(val, card->io_port + CSR4); /* Send descriptor address */
>
> - leave("remove_descriptors");
> + func_exit();
> }
>
> /*
> @@ -665,12 +665,12 @@ This function also clears the status-bit.
> static int link_status_changed(struct xircom_private *card)
> {
> unsigned int val;
> - enter("link_status_changed");
> + func_enter();
>
> val = inl(card->io_port + CSR5); /* Status register */
>
> if ((val & (1 << 27)) == 0) { /* no change */
> - leave("link_status_changed - nochange");
> + func_exit();
> return 0;
> }
>
> @@ -679,7 +679,7 @@ static int link_status_changed(struct xircom_private *card)
> val = (1 << 27);
> outl(val, card->io_port + CSR5);
>
> - leave("link_status_changed - changed");
> + func_exit();
> return 1;
> }
>
> @@ -691,16 +691,16 @@ in a non-stopped state.
> static int transmit_active(struct xircom_private *card)
> {
> unsigned int val;
> - enter("transmit_active");
> + func_enter();
>
> val = inl(card->io_port + CSR5); /* Status register */
>
> if ((val & (7 << 20)) == 0) { /* transmitter disabled */
> - leave("transmit_active - inactive");
> + func_exit();
> return 0;
> }
>
> - leave("transmit_active - active");
> + func_exit();
> return 1;
> }
>
> @@ -711,17 +711,17 @@ in a non-stopped state.
> static int receive_active(struct xircom_private *card)
> {
> unsigned int val;
> - enter("receive_active");
> + func_enter();
>
>
> val = inl(card->io_port + CSR5); /* Status register */
>
> if ((val & (7 << 17)) == 0) { /* receiver disabled */
> - leave("receive_active - inactive");
> + func_exit();
> return 0;
> }
>
> - leave("receive_active - active");
> + func_exit();
> return 1;
> }
>
> @@ -739,7 +739,7 @@ static void activate_receiver(struct xircom_private *card)
> {
> unsigned int val;
> int counter;
> - enter("activate_receiver");
> + func_enter();
>
>
> val = inl(card->io_port + CSR6); /* Operation mode */
> @@ -781,7 +781,7 @@ static void activate_receiver(struct xircom_private *card)
> pr_err("Receiver failed to re-activate\n");
> }
>
> - leave("activate_receiver");
> + func_exit();
> }
>
> /*
> @@ -795,7 +795,7 @@ static void deactivate_receiver(struct xircom_private *card)
> {
> unsigned int val;
> int counter;
> - enter("deactivate_receiver");
> + func_enter();
>
> val = inl(card->io_port + CSR6); /* Operation mode */
> val = val & ~2; /* disable the receiver */
> @@ -813,7 +813,7 @@ static void deactivate_receiver(struct xircom_private *card)
> }
>
>
> - leave("deactivate_receiver");
> + func_exit();
> }
>
>
> @@ -831,7 +831,7 @@ static void activate_transmitter(struct xircom_private *card)
> {
> unsigned int val;
> int counter;
> - enter("activate_transmitter");
> + func_enter();
>
>
> val = inl(card->io_port + CSR6); /* Operation mode */
> @@ -872,7 +872,7 @@ static void activate_transmitter(struct xircom_private *card)
> pr_err("Transmitter failed to re-activate\n");
> }
>
> - leave("activate_transmitter");
> + func_exit();
> }
>
> /*
> @@ -886,7 +886,7 @@ static void deactivate_transmitter(struct xircom_private *card)
> {
> unsigned int val;
> int counter;
> - enter("deactivate_transmitter");
> + func_enter();
>
> val = inl(card->io_port + CSR6); /* Operation mode */
> val = val & ~2; /* disable the transmitter */
> @@ -904,7 +904,7 @@ static void deactivate_transmitter(struct xircom_private *card)
> }
>
>
> - leave("deactivate_transmitter");
> + func_exit();
> }
>
>
> @@ -916,13 +916,13 @@ must be called with the lock held and interrupts disabled.
> static void enable_transmit_interrupt(struct xircom_private *card)
> {
> unsigned int val;
> - enter("enable_transmit_interrupt");
> + func_enter();
>
> val = inl(card->io_port + CSR7); /* Interrupt enable register */
> val |= 1; /* enable the transmit interrupt */
> outl(val, card->io_port + CSR7);
>
> - leave("enable_transmit_interrupt");
> + func_exit();
> }
>
>
> @@ -934,13 +934,13 @@ must be called with the lock held and interrupts disabled.
> static void enable_receive_interrupt(struct xircom_private *card)
> {
> unsigned int val;
> - enter("enable_receive_interrupt");
> + func_enter();
>
> val = inl(card->io_port + CSR7); /* Interrupt enable register */
> val = val | (1 << 6); /* enable the receive interrupt */
> outl(val, card->io_port + CSR7);
>
> - leave("enable_receive_interrupt");
> + func_exit();
> }
>
> /*
> @@ -951,13 +951,13 @@ must be called with the lock held and interrupts disabled.
> static void enable_link_interrupt(struct xircom_private *card)
> {
> unsigned int val;
> - enter("enable_link_interrupt");
> + func_enter();
>
> val = inl(card->io_port + CSR7); /* Interrupt enable register */
> val = val | (1 << 27); /* enable the link status chage interrupt */
> outl(val, card->io_port + CSR7);
>
> - leave("enable_link_interrupt");
> + func_exit();
> }
>
>
> @@ -970,12 +970,12 @@ must be called with the lock held and interrupts disabled.
> static void disable_all_interrupts(struct xircom_private *card)
> {
> unsigned int val;
> - enter("enable_all_interrupts");
> + func_enter();
>
> val = 0; /* disable all interrupts */
> outl(val, card->io_port + CSR7);
>
> - leave("disable_all_interrupts");
> + func_exit();
> }
>
> /*
> @@ -986,7 +986,7 @@ must be called with the lock held and interrupts disabled.
> static void enable_common_interrupts(struct xircom_private *card)
> {
> unsigned int val;
> - enter("enable_link_interrupt");
> + func_enter();
>
> val = inl(card->io_port + CSR7); /* Interrupt enable register */
> val |= (1<<16); /* Normal Interrupt Summary */
> @@ -999,7 +999,7 @@ static void enable_common_interrupts(struct xircom_private *card)
> val |= (1<<1); /* Transmit Process Stopped */
> outl(val, card->io_port + CSR7);
>
> - leave("enable_link_interrupt");
> + func_exit();
> }
>
> /*
> @@ -1010,13 +1010,13 @@ must be called with the lock held and interrupts disabled.
> static int enable_promisc(struct xircom_private *card)
> {
> unsigned int val;
> - enter("enable_promisc");
> + func_enter();
>
> val = inl(card->io_port + CSR6);
> val = val | (1 << 6);
> outl(val, card->io_port + CSR6);
>
> - leave("enable_promisc");
> + func_exit();
> return 1;
> }
>
> @@ -1031,7 +1031,7 @@ Must be called in locked state with interrupts disabled
> static int link_status(struct xircom_private *card)
> {
> unsigned int val;
> - enter("link_status");
> + func_enter();
>
> val = inb(card->io_port + CSR12);
>
> @@ -1042,7 +1042,7 @@ static int link_status(struct xircom_private *card)
>
> /* If we get here -> no link at all */
>
> - leave("link_status");
> + func_exit();
> return 0;
> }
>
> @@ -1061,7 +1061,7 @@ static void read_mac_address(struct xircom_private *card)
> unsigned long flags;
> int i;
>
> - enter("read_mac_address");
> + func_enter();
>
> spin_lock_irqsave(&card->lock, flags);
>
> @@ -1090,7 +1090,7 @@ static void read_mac_address(struct xircom_private *card)
> }
> spin_unlock_irqrestore(&card->lock, flags);
> pr_debug(" %pM\n", card->dev->dev_addr);
> - leave("read_mac_address");
> + func_exit();
> }
>
>
> @@ -1103,7 +1103,7 @@ static void transceiver_voodoo(struct xircom_private *card)
> {
> unsigned long flags;
>
> - enter("transceiver_voodoo");
> + func_enter();
>
> /* disable all powermanagement */
> pci_write_config_dword(card->pdev, PCI_POWERMGMT, 0x0000);
> @@ -1122,7 +1122,7 @@ static void transceiver_voodoo(struct xircom_private *card)
> spin_unlock_irqrestore(&card->lock, flags);
>
> netif_start_queue(card->dev);
> - leave("transceiver_voodoo");
> + func_exit();
> }
>
>
> @@ -1131,7 +1131,7 @@ static void xircom_up(struct xircom_private *card)
> unsigned long flags;
> int i;
>
> - enter("xircom_up");
> + func_enter();
>
> /* disable all powermanagement */
> pci_write_config_dword(card->pdev, PCI_POWERMGMT, 0x0000);
> @@ -1156,7 +1156,7 @@ static void xircom_up(struct xircom_private *card)
> trigger_receive(card);
> trigger_transmit(card);
> netif_start_queue(card->dev);
> - leave("xircom_up");
> + func_exit();
> }
>
> /* Bufferoffset is in BYTES */
> @@ -1164,7 +1164,7 @@ static void investigate_read_descriptor(struct net_device *dev,struct xircom_pri
> {
> int status;
>
> - enter("investigate_read_descriptor");
> + func_enter();
> status = le32_to_cpu(card->rx_buffer[4*descnr]);
>
> if ((status > 0)) { /* packet received */
> @@ -1198,7 +1198,7 @@ static void investigate_read_descriptor(struct net_device *dev,struct xircom_pri
> trigger_receive(card);
> }
>
> - leave("investigate_read_descriptor");
> + func_exit();
>
> }
>
> @@ -1208,7 +1208,7 @@ static void investigate_write_descriptor(struct net_device *dev, struct xircom_p
> {
> int status;
>
> - enter("investigate_write_descriptor");
> + func_enter();
>
> status = le32_to_cpu(card->tx_buffer[4*descnr]);
> #if 0
> @@ -1232,7 +1232,7 @@ static void investigate_write_descriptor(struct net_device *dev, struct xircom_p
> dev->stats.tx_packets++;
> }
>
> - leave("investigate_write_descriptor");
> + func_exit();
>
> }
>
> --
> 1.7.5.rc3.dirty
^ permalink raw reply
* Re: [PATCH] iproute2: use IFLA_TXQLEN when it is available
From: Eric Dumazet @ 2011-05-12 3:28 UTC (permalink / raw)
To: Changli Gao; +Cc: shemminger, netdev, kuznet
In-Reply-To: <1305168451-14491-1-git-send-email-xiaosuo@gmail.com>
Le jeudi 12 mai 2011 à 10:47 +0800, Changli Gao a écrit :
> Use IFLA_TXQLEN when it is available, to avoid additional system calls.
>
> Signed-off-by: Changli Gao <xiaosuo@gmail.com>
> ---
> ip/ipaddress.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
> diff --git a/ip/ipaddress.c b/ip/ipaddress.c
> index a1f78b9..59afafd 100644
> --- a/ip/ipaddress.c
> +++ b/ip/ipaddress.c
> @@ -285,8 +285,16 @@ int print_linkinfo(const struct sockaddr_nl *who,
> if (tb[IFLA_OPERSTATE])
> print_operstate(fp, *(__u8 *)RTA_DATA(tb[IFLA_OPERSTATE]));
>
> - if (filter.showqueue)
> - print_queuelen(fp, (char*)RTA_DATA(tb[IFLA_IFNAME]));
> + if (filter.showqueue) {
> + if (tb[IFLA_TXQLEN]) {
> + __u32 txqlen = *(__u32 *)RTA_DATA(tb[IFLA_TXQLEN]);
> +
> + if (txqlen)
> + fprintf(fp, "qlen %u", txqlen);
> + } else {
> + print_queuelen(fp, (char*)RTA_DATA(tb[IFLA_IFNAME]));
> + }
> + }
>
> if (!filter.family || filter.family == AF_PACKET) {
> SPRINT_BUF(b1);
Hmm, what iproute2 version do you use ???
commit 62a5e0668e2920b7f09896abd884753255712a46
Author: Eric Dumazet <dada1@cosmosbay.com>
Date: Fri Oct 23 06:25:53 2009 +0200
ip: Support IFLA_TXQLEN in ip link show command
We currently use an expensive ioctl() to get device txqueuelen, while
rtnetlink gave it to us for free. This patch speeds up ip link operation
when many devices are registered.
^ permalink raw reply
* Re: [PATCH 15/15] ehea: Remove unused tcp_end field in send WQ
From: Joe Perches @ 2011-05-12 3:12 UTC (permalink / raw)
To: David Miller; +Cc: anton, leitao, michael, jesse, bhutchings, netdev
In-Reply-To: <20110511.230603.1390935245880337663.davem@davemloft.net>
On Wed, 2011-05-11 at 23:06 -0400, David Miller wrote:
> From: Joe Perches <joe@perches.com>
> Date: Wed, 11 May 2011 19:31:13 -0700
> > On Thu, 2011-05-12 at 10:52 +1000, Anton Blanchard wrote:
> >> plain text document attachment (ehea_22.patch)
> >> The tcp_end field is not actually used by the hardware, so there
> >> is no need to set it.
> >> +++ linux-net/drivers/net/ehea/ehea_qmr.h 2011-05-12 07:48:06.380382084 +1000
> >> @@ -106,7 +106,7 @@ struct ehea_swqe {
> >> u8 immediate_data_length;
> >> u8 tcp_offset;
> >> u8 reserved2;
> >> - u16 tcp_end;
> >> + u16 reserved2b;
> >> u8 wrap_tag;
> >> u8 descriptors; /* number of valid descriptors in WQE */
> >> u16 reserved3;
> > struct ehea_swqe isn't __packed. Shouldn't it be?
> Please don't mark it __packed unless absolutely necessary :-)
Isn't it read from hardware.
If not, why reserve anything?
^ permalink raw reply
* Re: [PATCH] Add libertas_disablemesh module parameter to disable mesh interface
From: Dan Williams @ 2011-05-12 3:11 UTC (permalink / raw)
To: Sascha Silbe
Cc: linux-wireless, devel, John W. Linville, libertas-dev, netdev,
linux-kernel
In-Reply-To: <1305118354-17337-1-git-send-email-silbe@activitycentral.com>
On Wed, 2011-05-11 at 14:52 +0200, Sascha Silbe wrote:
> This allows individual users and deployments to disable mesh support at
> runtime, i.e. without having to build and maintain a custom kernel.
Does the mesh interface somehow cause problems, even when nothing is
using it? I'd expect that if the mesh interface was simply left alone,
there would be no need to disable it.
Dan
> Based on a patch by Paul Fox <pgf@laptop.org>.
> Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
> ---
> drivers/net/wireless/libertas/main.c | 9 ++++++++-
> 1 files changed, 8 insertions(+), 1 deletions(-)
>
> The patch is based on the OLPC 2.6.35 kernel tree, but applies cleanly to
> wireless-next.
>
> diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
> index 8445473..62069e2 100644
> --- a/drivers/net/wireless/libertas/main.c
> +++ b/drivers/net/wireless/libertas/main.c
> @@ -41,6 +41,10 @@ unsigned int lbs_debug;
> EXPORT_SYMBOL_GPL(lbs_debug);
> module_param_named(libertas_debug, lbs_debug, int, 0644);
>
> +unsigned int lbs_disablemesh;
> +EXPORT_SYMBOL_GPL(lbs_disablemesh);
> +module_param_named(libertas_disablemesh, lbs_disablemesh, int, 0644);
> +
>
> /* This global structure is used to send the confirm_sleep command as
> * fast as possible down to the firmware. */
> @@ -1086,7 +1090,10 @@ int lbs_start_card(struct lbs_private *priv)
>
> lbs_update_channel(priv);
>
> - lbs_init_mesh(priv);
> + if (!lbs_disablemesh)
> + lbs_init_mesh(priv);
> + else
> + lbs_pr_info("%s: mesh disabled\n", dev->name);
>
> /*
> * While rtap isn't related to mesh, only mesh-enabled
> --
> 1.7.4.1
>
^ permalink raw reply
* Re: [PATCH 03/15] ehea: Remove force_irq logic in napi poll routine
From: David Miller @ 2011-05-12 3:06 UTC (permalink / raw)
To: joe; +Cc: anton, leitao, michael, jesse, bhutchings, netdev
In-Reply-To: <1305167470.6124.10.camel@Joe-Laptop>
From: Joe Perches <joe@perches.com>
Date: Wed, 11 May 2011 19:31:10 -0700
> On Thu, 2011-05-12 at 10:52 +1000, Anton Blanchard wrote:
>> commit 18604c548545 (ehea: NAPI multi queue TX/RX path for SMP) added
>> driver specific logic for exiting napi mode. I'm not sure what it was
>> trying to solve and it should be up to the network stack to decide when
>> we are done polling so remove it.
>> Signed-off-by: Anton Blanchard <anton@samba.org>
>
>> +++ linux-net/drivers/net/ehea/ehea_main.c 2011-05-12 07:47:51.960153456 +1000
>> @@ -937,18 +936,13 @@ static int ehea_poll(struct napi_struct
> []
>> + while ((rx != budget)) {
>
> one level of parentheses is enough.
Agreed.
^ permalink raw reply
* Re: [PATCH 15/15] ehea: Remove unused tcp_end field in send WQ
From: David Miller @ 2011-05-12 3:06 UTC (permalink / raw)
To: joe; +Cc: anton, leitao, michael, jesse, bhutchings, netdev
In-Reply-To: <1305167473.6124.11.camel@Joe-Laptop>
From: Joe Perches <joe@perches.com>
Date: Wed, 11 May 2011 19:31:13 -0700
> On Thu, 2011-05-12 at 10:52 +1000, Anton Blanchard wrote:
>> plain text document attachment (ehea_22.patch)
>> The tcp_end field is not actually used by the hardware, so there
>> is no need to set it.
>> +++ linux-net/drivers/net/ehea/ehea_qmr.h 2011-05-12 07:48:06.380382084 +1000
>> @@ -106,7 +106,7 @@ struct ehea_swqe {
>> u8 immediate_data_length;
>> u8 tcp_offset;
>> u8 reserved2;
>> - u16 tcp_end;
>> + u16 reserved2b;
>> u8 wrap_tag;
>> u8 descriptors; /* number of valid descriptors in WQE */
>> u16 reserved3;
>
> struct ehea_swqe isn't __packed. Shouldn't it be?
Please don't mark it __packed unless absolutely necessary :-)
^ permalink raw reply
* can: hardware vs. software filter
From: Kurt Van Dijck @ 2011-05-12 3:03 UTC (permalink / raw)
To: Alan Cox
Cc: sachi-EvXpCiN+lbve9wHmmfpqLFaTQe2KTcn/,
davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/,
Arnd Bergmann, Subhasish Ghosh, nsekhar-l0cyMroinI0, open list,
CAN NETWORK DRIVERS, Marc Kleine-Budde, Wolfgang Grandegger,
Netdev-u79uwXL29TY76Z2rM5mHXA, m-watkins-l0cyMroinI0,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
In-Reply-To: <20110511235652.7ccddb3b-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
On Wed, May 11, 2011 at 11:56:52PM +0100, Alan Cox wrote:
> > I'm not sure if reprogramming hardware filters on the fly works on evey
> > can core. The more conservative solution would be to configure the
> > filter list globally (+when the interface is down) via netlink.
>
> For anything that isn't so braindead it ought to be done on the fly and
> behind the users back to avoid having to make app code specially aware.
> If the lists are fixed either in firmware or in software the stack needs
> to error attempts to use anything else
That is the best guarantee to let users never use this.
A tool like 'candump' should not know about any pre-configured
filter that is in place. It's the responsibility of the root user
to put proper preconfigured filters.
A lot of code would be spent to allow an application to request
software filters that fit in the preconfigured ones.
IMHO its the root users job to judge about a proper preconfigured
filter that suits the applications that run. The applications should
then be able to request any software filter they like, the root user
decided on limiting traffic.
This poses a problem in that an application may depend on these filters
for its proper operation. That exactly is the responsibility of the
root user who restricts the preconfigured filter.
Kurt
^ permalink raw reply
* Re: [PATCH 02/15] ehea: Update multiqueue support
From: Ben Hutchings @ 2011-05-12 2:57 UTC (permalink / raw)
To: Anton Blanchard; +Cc: leitao, michael, jesse, netdev
In-Reply-To: <20110512005622.681433781@samba.org>
On Thu, 2011-05-12 at 10:52 +1000, Anton Blanchard wrote:
> The ehea driver had some multiqueue support but was missing the last
> few years of networking stack improvements:
[...]
> --- linux-net.orig/drivers/net/ehea/ehea_main.c 2011-05-12 07:47:48.840103988 +1000
> +++ linux-net/drivers/net/ehea/ehea_main.c 2011-05-12 07:47:49.640116670 +1000
> @@ -60,7 +60,7 @@ static int rq1_entries = EHEA_DEF_ENTRIE
> static int rq2_entries = EHEA_DEF_ENTRIES_RQ2;
> static int rq3_entries = EHEA_DEF_ENTRIES_RQ3;
> static int sq_entries = EHEA_DEF_ENTRIES_SQ;
> -static int use_mcs;
> +static int use_mcs = 1;
> static int use_lro;
> static int lro_max_aggr = EHEA_LRO_MAX_AGGR;
> static int num_tx_qps = EHEA_NUM_TX_QP;
> @@ -93,7 +93,7 @@ MODULE_PARM_DESC(rq1_entries, "Number of
> MODULE_PARM_DESC(sq_entries, " Number of entries for the Send Queue "
> "[2^x - 1], x = [6..14]. Default = "
> __MODULE_STRING(EHEA_DEF_ENTRIES_SQ) ")");
> -MODULE_PARM_DESC(use_mcs, " 0:NAPI, 1:Multiple receive queues, Default = 0 ");
> +MODULE_PARM_DESC(use_mcs, " 0:NAPI, 1:Multiple receive queues, Default = 1 ");
[...]
You're using NAPI whether or not there are multiple receive queues, so
this description is wrong.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH 07/15] ehea: Allocate large enough skbs to avoid partial cacheline DMA writes
From: Ben Hutchings @ 2011-05-12 2:52 UTC (permalink / raw)
To: Anton Blanchard; +Cc: leitao, michael, jesse, netdev
In-Reply-To: <20110512005623.100278010@samba.org>
On Thu, 2011-05-12 at 10:52 +1000, Anton Blanchard wrote:
> plain text document attachment (ehea_8.patch)
> The ehea adapter has a mode where it will avoid partial cacheline DMA
> writes on receive by always padding packets to fall on a cacheline
> boundary.
>
> Unfortunately we currently aren't allocating enough space for a full
> ethernet MTU packet to be rounded up, so this optimisation doesn't hit.
>
> It's unfortunate that the next largest packet size exposed by the
> hypervisor interface is 2kB, meaning our skb allocation comes out of a
> 4kB SLAB. However the performance increase due to this optimisation is
> quite large and my TCP stream numbers increase from 900MB to 1000MB/sec.
You can allocate page buffers and then split them into exactly 2K
segments. If you switch from inet_lro to GRO then GRO will handle the
eventual skb allocation for you (even for non-mergeable packets).
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* [PATCH] iproute2: use IFLA_TXQLEN when it is available
From: Changli Gao @ 2011-05-12 2:47 UTC (permalink / raw)
To: shemminger; +Cc: netdev, kuznet, Changli Gao
Use IFLA_TXQLEN when it is available, to avoid additional system calls.
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
---
ip/ipaddress.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index a1f78b9..59afafd 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -285,8 +285,16 @@ int print_linkinfo(const struct sockaddr_nl *who,
if (tb[IFLA_OPERSTATE])
print_operstate(fp, *(__u8 *)RTA_DATA(tb[IFLA_OPERSTATE]));
- if (filter.showqueue)
- print_queuelen(fp, (char*)RTA_DATA(tb[IFLA_IFNAME]));
+ if (filter.showqueue) {
+ if (tb[IFLA_TXQLEN]) {
+ __u32 txqlen = *(__u32 *)RTA_DATA(tb[IFLA_TXQLEN]);
+
+ if (txqlen)
+ fprintf(fp, "qlen %u", txqlen);
+ } else {
+ print_queuelen(fp, (char*)RTA_DATA(tb[IFLA_IFNAME]));
+ }
+ }
if (!filter.family || filter.family == AF_PACKET) {
SPRINT_BUF(b1);
^ permalink raw reply related
* Re: [PATCH 03/15] ehea: Remove force_irq logic in napi poll routine
From: Ben Hutchings @ 2011-05-12 2:47 UTC (permalink / raw)
To: Anton Blanchard; +Cc: leitao, michael, jesse, netdev
In-Reply-To: <20110512005622.766206152@samba.org>
On Thu, 2011-05-12 at 10:52 +1000, Anton Blanchard wrote:
> commit 18604c548545 (ehea: NAPI multi queue TX/RX path for SMP) added
> driver specific logic for exiting napi mode. I'm not sure what it was
> trying to solve and it should be up to the network stack to decide when
> we are done polling so remove it.
[...]
I don't know. But I'd really like to know why you are calling
napi_reschedule() and napi_complete() in a loop, inside the poll
function.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH 15/15] ehea: Remove unused tcp_end field in send WQ
From: Joe Perches @ 2011-05-12 2:31 UTC (permalink / raw)
To: Anton Blanchard; +Cc: leitao, michael, jesse, bhutchings, netdev
In-Reply-To: <20110512005623.854973618@samba.org>
On Thu, 2011-05-12 at 10:52 +1000, Anton Blanchard wrote:
> plain text document attachment (ehea_22.patch)
> The tcp_end field is not actually used by the hardware, so there
> is no need to set it.
> +++ linux-net/drivers/net/ehea/ehea_qmr.h 2011-05-12 07:48:06.380382084 +1000
> @@ -106,7 +106,7 @@ struct ehea_swqe {
> u8 immediate_data_length;
> u8 tcp_offset;
> u8 reserved2;
> - u16 tcp_end;
> + u16 reserved2b;
> u8 wrap_tag;
> u8 descriptors; /* number of valid descriptors in WQE */
> u16 reserved3;
struct ehea_swqe isn't __packed. Shouldn't it be?
^ permalink raw reply
* Re: [PATCH 03/15] ehea: Remove force_irq logic in napi poll routine
From: Joe Perches @ 2011-05-12 2:31 UTC (permalink / raw)
To: Anton Blanchard; +Cc: leitao, michael, jesse, bhutchings, netdev
In-Reply-To: <20110512005622.766206152@samba.org>
On Thu, 2011-05-12 at 10:52 +1000, Anton Blanchard wrote:
> commit 18604c548545 (ehea: NAPI multi queue TX/RX path for SMP) added
> driver specific logic for exiting napi mode. I'm not sure what it was
> trying to solve and it should be up to the network stack to decide when
> we are done polling so remove it.
> Signed-off-by: Anton Blanchard <anton@samba.org>
> +++ linux-net/drivers/net/ehea/ehea_main.c 2011-05-12 07:47:51.960153456 +1000
> @@ -937,18 +936,13 @@ static int ehea_poll(struct napi_struct
[]
> + while ((rx != budget)) {
one level of parentheses is enough.
^ permalink raw reply
* Re: [PATCH 02/15] ehea: Update multiqueue support
From: Joe Perches @ 2011-05-12 2:31 UTC (permalink / raw)
To: Anton Blanchard; +Cc: leitao, michael, jesse, bhutchings, netdev
In-Reply-To: <20110512005622.681433781@samba.org>
On Thu, 2011-05-12 at 10:52 +1000, Anton Blanchard wrote:
> The ehea driver had some multiqueue support but was missing the last
> few years of networking stack improvements:
Hi Anton, all comments to follow on all patches are trivia only...
[]
> Signed-off-by: Anton Blanchard <anton@samba.org>
[]
> +++ linux-net/drivers/net/ehea/ehea_main.c 2011-05-12 07:47:49.640116670 +1000
[]
> @@ -93,7 +93,7 @@ MODULE_PARM_DESC(rq1_entries, "Number of
> MODULE_PARM_DESC(sq_entries, " Number of entries for the Send Queue "
> "[2^x - 1], x = [6..14]. Default = "
> __MODULE_STRING(EHEA_DEF_ENTRIES_SQ) ")");
> -MODULE_PARM_DESC(use_mcs, " 0:NAPI, 1:Multiple receive queues, Default = 0 ");
> +MODULE_PARM_DESC(use_mcs, " 0:NAPI, 1:Multiple receive queues, Default = 1 ");
trailing space
> +++ linux-net/drivers/net/ehea/ehea_ethtool.c 2011-05-12 07:47:49.640116670 +1000
> @@ -189,7 +189,6 @@ static char ehea_ethtool_stats_keys[][ET
static const?
^ permalink raw reply
* [PATCH 11/15] ehea: Remove some unused definitions
From: Anton Blanchard @ 2011-05-12 0:52 UTC (permalink / raw)
To: leitao, michael, jesse, bhutchings; +Cc: netdev
In-Reply-To: <20110512005213.897432612@samba.org>
[-- Attachment #1: ehea_15.patch --]
[-- Type: text/plain, Size: 1728 bytes --]
The queue macros are many levels deep and it makes it harder to
work your way through them when many of the versions are unused.
Remove the unused versions.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-net/drivers/net/ehea/ehea_hw.h
===================================================================
--- linux-net.orig/drivers/net/ehea/ehea_hw.h 2011-05-12 07:47:05.769421104 +1000
+++ linux-net/drivers/net/ehea/ehea_hw.h 2011-05-12 07:48:01.630306772 +1000
@@ -210,36 +210,11 @@ static inline void epa_store_acc(struct
__raw_writeq(value, (void __iomem *)(epa.addr + offset));
}
-#define epa_store_eq(epa, offset, value)\
- epa_store(epa, EQTEMM_OFFSET(offset), value)
-#define epa_load_eq(epa, offset)\
- epa_load(epa, EQTEMM_OFFSET(offset))
-
#define epa_store_cq(epa, offset, value)\
epa_store(epa, CQTEMM_OFFSET(offset), value)
#define epa_load_cq(epa, offset)\
epa_load(epa, CQTEMM_OFFSET(offset))
-#define epa_store_qp(epa, offset, value)\
- epa_store(epa, QPTEMM_OFFSET(offset), value)
-#define epa_load_qp(epa, offset)\
- epa_load(epa, QPTEMM_OFFSET(offset))
-
-#define epa_store_qped(epa, offset, value)\
- epa_store(epa, QPEDMM_OFFSET(offset), value)
-#define epa_load_qped(epa, offset)\
- epa_load(epa, QPEDMM_OFFSET(offset))
-
-#define epa_store_mrmw(epa, offset, value)\
- epa_store(epa, MRMWMM_OFFSET(offset), value)
-#define epa_load_mrmw(epa, offset)\
- epa_load(epa, MRMWMM_OFFSET(offset))
-
-#define epa_store_base(epa, offset, value)\
- epa_store(epa, HCAGR_OFFSET(offset), value)
-#define epa_load_base(epa, offset)\
- epa_load(epa, HCAGR_OFFSET(offset))
-
static inline void ehea_update_sqa(struct ehea_qp *qp, u16 nr_wqes)
{
struct h_epa epa = qp->epas.kernel;
^ permalink raw reply
* [PATCH 06/15] ehea: Add vlan_features
From: Anton Blanchard @ 2011-05-12 0:52 UTC (permalink / raw)
To: leitao, michael, jesse, bhutchings; +Cc: netdev
In-Reply-To: <20110512005213.897432612@samba.org>
[-- Attachment #1: ehea_7.patch --]
[-- Type: text/plain, Size: 813 bytes --]
We weren't enabling any VLAN features so we missed out on checksum
offload and TSO when using VLANs. Enable them.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-net/drivers/net/ehea/ehea_main.c
===================================================================
--- linux-net.orig/drivers/net/ehea/ehea_main.c 2011-05-12 07:47:54.730197374 +1000
+++ linux-net/drivers/net/ehea/ehea_main.c 2011-05-12 07:47:55.870215448 +1000
@@ -3223,6 +3223,8 @@ struct ehea_port *ehea_setup_single_port
| NETIF_F_HIGHDMA | NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_TX
| NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER
| NETIF_F_RXCSUM;
+ dev->vlan_features = NETIF_F_SG | NETIF_F_TSO | NETIF_F_HIGHDMA |
+ NETIF_F_IP_CSUM;
dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT;
if (use_lro)
^ permalink raw reply
* [PATCH 09/15] ehea: Merge swqe2 TSO and non TSO paths
From: Anton Blanchard @ 2011-05-12 0:52 UTC (permalink / raw)
To: leitao, michael, jesse, bhutchings; +Cc: netdev
In-Reply-To: <20110512005213.897432612@samba.org>
[-- Attachment #1: ehea_12.patch --]
[-- Type: text/plain, Size: 3766 bytes --]
write_swqe2_TSO and write_swqe2_nonTSO are almost identical.
For TSO we have to set the TSO and mss bits in the wqe and we only
put the header in the immediate area, no data. Collapse both
functions into write_swqe2_immediate.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-net/drivers/net/ehea/ehea_main.c
===================================================================
--- linux-net.orig/drivers/net/ehea/ehea_main.c 2011-05-12 07:47:58.020249537 +1000
+++ linux-net/drivers/net/ehea/ehea_main.c 2011-05-12 07:47:59.140267294 +1000
@@ -1677,65 +1677,35 @@ static int ehea_clean_portres(struct ehe
return ret;
}
-static void write_swqe2_TSO(struct sk_buff *skb,
- struct ehea_swqe *swqe, u32 lkey)
-{
- struct ehea_vsgentry *sg1entry = &swqe->u.immdata_desc.sg_entry;
- u8 *imm_data = &swqe->u.immdata_desc.immediate_data[0];
- int skb_data_size = skb_headlen(skb);
- int headersize;
-
- /* Packet is TCP with TSO enabled */
- swqe->tx_control |= EHEA_SWQE_TSO;
- swqe->mss = skb_shinfo(skb)->gso_size;
- /* copy only eth/ip/tcp headers to immediate data and
- * the rest of skb->data to sg1entry
- */
- headersize = ETH_HLEN + ip_hdrlen(skb) + tcp_hdrlen(skb);
-
- skb_data_size = skb_headlen(skb);
-
- if (skb_data_size >= headersize) {
- /* copy immediate data */
- skb_copy_from_linear_data(skb, imm_data, headersize);
- swqe->immediate_data_length = headersize;
-
- if (skb_data_size > headersize) {
- /* set sg1entry data */
- sg1entry->l_key = lkey;
- sg1entry->len = skb_data_size - headersize;
- sg1entry->vaddr =
- ehea_map_vaddr(skb->data + headersize);
- swqe->descriptors++;
- }
- } else
- pr_err("cannot handle fragmented headers\n");
-}
-
-static void write_swqe2_nonTSO(struct sk_buff *skb,
- struct ehea_swqe *swqe, u32 lkey)
+static void write_swqe2_immediate(struct sk_buff *skb, struct ehea_swqe *swqe,
+ u32 lkey)
{
int skb_data_size = skb_headlen(skb);
u8 *imm_data = &swqe->u.immdata_desc.immediate_data[0];
struct ehea_vsgentry *sg1entry = &swqe->u.immdata_desc.sg_entry;
+ unsigned int immediate_len = SWQE2_MAX_IMM;
- /* Packet is any nonTSO type
- *
- * Copy as much as possible skb->data to immediate data and
- * the rest to sg1entry
- */
- if (skb_data_size >= SWQE2_MAX_IMM) {
- /* copy immediate data */
- skb_copy_from_linear_data(skb, imm_data, SWQE2_MAX_IMM);
+ swqe->descriptors = 0;
+
+ if (skb_is_gso(skb)) {
+ swqe->tx_control |= EHEA_SWQE_TSO;
+ swqe->mss = skb_shinfo(skb)->gso_size;
+ /*
+ * For TSO packets we only copy the headers into the
+ * immediate area.
+ */
+ immediate_len = ETH_HLEN + ip_hdrlen(skb) + tcp_hdrlen(skb);
+ }
- swqe->immediate_data_length = SWQE2_MAX_IMM;
+ if (skb_is_gso(skb) || skb_data_size >= SWQE2_MAX_IMM) {
+ skb_copy_from_linear_data(skb, imm_data, immediate_len);
+ swqe->immediate_data_length = immediate_len;
- if (skb_data_size > SWQE2_MAX_IMM) {
- /* copy sg1entry data */
+ if (skb_data_size > immediate_len) {
sg1entry->l_key = lkey;
- sg1entry->len = skb_data_size - SWQE2_MAX_IMM;
+ sg1entry->len = skb_data_size - immediate_len;
sg1entry->vaddr =
- ehea_map_vaddr(skb->data + SWQE2_MAX_IMM);
+ ehea_map_vaddr(skb->data + immediate_len);
swqe->descriptors++;
}
} else {
@@ -1754,13 +1724,9 @@ static inline void write_swqe2_data(stru
nfrags = skb_shinfo(skb)->nr_frags;
sg1entry = &swqe->u.immdata_desc.sg_entry;
sg_list = (struct ehea_vsgentry *)&swqe->u.immdata_desc.sg_list;
- swqe->descriptors = 0;
sg1entry_contains_frag_data = 0;
- if (skb_is_gso(skb))
- write_swqe2_TSO(skb, swqe, lkey);
- else
- write_swqe2_nonTSO(skb, swqe, lkey);
+ write_swqe2_immediate(skb, swqe, lkey);
/* write descriptors */
if (nfrags > 0) {
^ permalink raw reply
* [PATCH 12/15] ehea: Add 64bit statistics
From: Anton Blanchard @ 2011-05-12 0:52 UTC (permalink / raw)
To: leitao, michael, jesse, bhutchings; +Cc: netdev
In-Reply-To: <20110512005213.897432612@samba.org>
[-- Attachment #1: ehea_17.patch --]
[-- Type: text/plain, Size: 1226 bytes --]
Switch to using ndo_get_stats64 to get 64bit statistics.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-net/drivers/net/ehea/ehea_main.c
===================================================================
--- linux-net.orig/drivers/net/ehea/ehea_main.c 2011-05-12 07:48:00.220284417 +1000
+++ linux-net/drivers/net/ehea/ehea_main.c 2011-05-12 07:48:02.700323737 +1000
@@ -321,10 +321,10 @@ out:
spin_unlock_irqrestore(&ehea_bcmc_regs.lock, flags);
}
-static struct net_device_stats *ehea_get_stats(struct net_device *dev)
+static struct rtnl_link_stats64 *ehea_get_stats64(struct net_device *dev,
+ struct rtnl_link_stats64 *stats)
{
struct ehea_port *port = netdev_priv(dev);
- struct net_device_stats *stats = &port->stats;
struct hcp_ehea_port_cb2 *cb2;
u64 hret, rx_packets, tx_packets, rx_bytes = 0, tx_bytes = 0;
int i;
@@ -3034,7 +3034,7 @@ static const struct net_device_ops ehea_
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = ehea_netpoll,
#endif
- .ndo_get_stats = ehea_get_stats,
+ .ndo_get_stats64 = ehea_get_stats64,
.ndo_set_mac_address = ehea_set_mac_addr,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_multicast_list = ehea_set_multicast_list,
^ permalink raw reply
* [PATCH 01/15] ehea: Remove NETIF_F_LLTX
From: Anton Blanchard @ 2011-05-12 0:52 UTC (permalink / raw)
To: leitao, michael, jesse, bhutchings; +Cc: netdev
In-Reply-To: <20110512005213.897432612@samba.org>
[-- Attachment #1: ehea_1.patch --]
[-- Type: text/plain, Size: 2365 bytes --]
Remove the deprecated NETIF_F_LLTX feature. Since the network stack
now provides the locking we can remove the driver specific
pr->xmit_lock.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-net/drivers/net/ehea/ehea_main.c
===================================================================
--- linux-net.orig/drivers/net/ehea/ehea_main.c 2011-05-11 14:39:08.443817605 +1000
+++ linux-net/drivers/net/ehea/ehea_main.c 2011-05-11 14:39:10.113846069 +1000
@@ -1536,7 +1536,6 @@ static int ehea_init_port_res(struct ehe
pr->rx_packets = rx_packets;
pr->port = port;
- spin_lock_init(&pr->xmit_lock);
spin_lock_init(&pr->netif_queue);
pr->eq = ehea_create_eq(adapter, eq_type, EHEA_MAX_ENTRIES_EQ, 0);
@@ -2261,14 +2260,9 @@ static int ehea_start_xmit(struct sk_buf
pr = &port->port_res[ehea_hash_skb(skb, port->num_tx_qps)];
- if (!spin_trylock(&pr->xmit_lock))
+ if (pr->queue_stopped)
return NETDEV_TX_BUSY;
- if (pr->queue_stopped) {
- spin_unlock(&pr->xmit_lock);
- return NETDEV_TX_BUSY;
- }
-
swqe = ehea_get_swqe(pr->qp, &swqe_index);
memset(swqe, 0, SWQE_HEADER_SIZE);
atomic_dec(&pr->swqe_avail);
@@ -2332,8 +2326,6 @@ static int ehea_start_xmit(struct sk_buf
}
spin_unlock_irqrestore(&pr->netif_queue, flags);
}
- dev->trans_start = jiffies; /* NETIF_F_LLTX driver :( */
- spin_unlock(&pr->xmit_lock);
return NETDEV_TX_OK;
}
@@ -3267,7 +3259,7 @@ struct ehea_port *ehea_setup_single_port
dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO
| NETIF_F_HIGHDMA | NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_TX
| NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER
- | NETIF_F_LLTX | NETIF_F_RXCSUM;
+ | NETIF_F_RXCSUM;
dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT;
if (use_lro)
Index: linux-net/drivers/net/ehea/ehea.h
===================================================================
--- linux-net.orig/drivers/net/ehea/ehea.h 2011-05-11 14:39:08.433817435 +1000
+++ linux-net/drivers/net/ehea/ehea.h 2011-05-11 14:39:10.113846069 +1000
@@ -363,7 +363,6 @@ struct ehea_port_res {
struct port_stats p_stats;
struct ehea_mr send_mr; /* send memory region */
struct ehea_mr recv_mr; /* receive memory region */
- spinlock_t xmit_lock;
struct ehea_port *port;
char int_recv_name[EHEA_IRQ_NAME_SIZE];
char int_send_name[EHEA_IRQ_NAME_SIZE];
^ permalink raw reply
* [PATCH 10/15] ehea: Simplify type 3 transmit routine
From: Anton Blanchard @ 2011-05-12 0:52 UTC (permalink / raw)
To: leitao, michael, jesse, bhutchings; +Cc: netdev
In-Reply-To: <20110512005213.897432612@samba.org>
[-- Attachment #1: ehea_13.patch --]
[-- Type: text/plain, Size: 1366 bytes --]
If a nonlinear skb fits within the immediate area, use skb_copy_bits
instead of copying the frags by hand.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-net/drivers/net/ehea/ehea_main.c
===================================================================
--- linux-net.orig/drivers/net/ehea/ehea_main.c 2011-05-12 07:47:59.140267294 +1000
+++ linux-net/drivers/net/ehea/ehea_main.c 2011-05-12 07:48:00.220284417 +1000
@@ -2091,29 +2091,14 @@ static void ehea_xmit2(struct sk_buff *s
static void ehea_xmit3(struct sk_buff *skb, struct net_device *dev,
struct ehea_swqe *swqe)
{
- int nfrags = skb_shinfo(skb)->nr_frags;
u8 *imm_data = &swqe->u.immdata_nodesc.immediate_data[0];
- skb_frag_t *frag;
- int i;
xmit_common(skb, swqe);
- if (nfrags == 0) {
+ if (!skb->data_len)
skb_copy_from_linear_data(skb, imm_data, skb->len);
- } else {
- skb_copy_from_linear_data(skb, imm_data,
- skb_headlen(skb));
- imm_data += skb_headlen(skb);
-
- /* ... then copy data from the fragments */
- for (i = 0; i < nfrags; i++) {
- frag = &skb_shinfo(skb)->frags[i];
- memcpy(imm_data,
- page_address(frag->page) + frag->page_offset,
- frag->size);
- imm_data += frag->size;
- }
- }
+ else
+ skb_copy_bits(skb, 0, imm_data, skb->len);
swqe->immediate_data_length = skb->len;
dev_kfree_skb(skb);
^ permalink raw reply
* [PATCH 08/15] ehea: Simplify ehea_xmit2 and ehea_xmit3
From: Anton Blanchard @ 2011-05-12 0:52 UTC (permalink / raw)
To: leitao, michael, jesse, bhutchings; +Cc: netdev
In-Reply-To: <20110512005213.897432612@samba.org>
[-- Attachment #1: ehea_11.patch --]
[-- Type: text/plain, Size: 6028 bytes --]
Based on a patch from Michael Ellerman, clean up a significant
portion of the transmit path. There was a lot of duplication here.
Even worse, we were always checksumming tx packets and ignoring the
skb->ip_summed field.
Also remove NETIF_F_FRAGLIST from dev->features, I'm not sure why
it was enabled.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-net/drivers/net/ehea/ehea_main.c
===================================================================
--- linux-net.orig/drivers/net/ehea/ehea_main.c 2011-05-12 07:47:55.870215448 +1000
+++ linux-net/drivers/net/ehea/ehea_main.c 2011-05-12 07:47:58.020249537 +1000
@@ -1677,37 +1677,6 @@ static int ehea_clean_portres(struct ehe
return ret;
}
-/*
- * The write_* functions store information in swqe which is used by
- * the hardware to calculate the ip/tcp/udp checksum
- */
-
-static inline void write_ip_start_end(struct ehea_swqe *swqe,
- const struct sk_buff *skb)
-{
- swqe->ip_start = skb_network_offset(skb);
- swqe->ip_end = (u8)(swqe->ip_start + ip_hdrlen(skb) - 1);
-}
-
-static inline void write_tcp_offset_end(struct ehea_swqe *swqe,
- const struct sk_buff *skb)
-{
- swqe->tcp_offset =
- (u8)(swqe->ip_end + 1 + offsetof(struct tcphdr, check));
-
- swqe->tcp_end = (u16)skb->len - 1;
-}
-
-static inline void write_udp_offset_end(struct ehea_swqe *swqe,
- const struct sk_buff *skb)
-{
- swqe->tcp_offset =
- (u8)(swqe->ip_end + 1 + offsetof(struct udphdr, check));
-
- swqe->tcp_end = (u16)skb->len - 1;
-}
-
-
static void write_swqe2_TSO(struct sk_buff *skb,
struct ehea_swqe *swqe, u32 lkey)
{
@@ -2109,41 +2078,46 @@ static int ehea_change_mtu(struct net_de
return 0;
}
-static void ehea_xmit2(struct sk_buff *skb, struct net_device *dev,
- struct ehea_swqe *swqe, u32 lkey)
+static void xmit_common(struct sk_buff *skb, struct ehea_swqe *swqe)
{
- if (skb->protocol == htons(ETH_P_IP)) {
- const struct iphdr *iph = ip_hdr(skb);
+ swqe->tx_control |= EHEA_SWQE_IMM_DATA_PRESENT | EHEA_SWQE_CRC;
- /* IPv4 */
- swqe->tx_control |= EHEA_SWQE_CRC
- | EHEA_SWQE_IP_CHECKSUM
- | EHEA_SWQE_TCP_CHECKSUM
- | EHEA_SWQE_IMM_DATA_PRESENT
- | EHEA_SWQE_DESCRIPTORS_PRESENT;
-
- write_ip_start_end(swqe, skb);
-
- if (iph->protocol == IPPROTO_UDP) {
- if ((iph->frag_off & IP_MF) ||
- (iph->frag_off & IP_OFFSET))
- /* IP fragment, so don't change cs */
- swqe->tx_control &= ~EHEA_SWQE_TCP_CHECKSUM;
- else
- write_udp_offset_end(swqe, skb);
- } else if (iph->protocol == IPPROTO_TCP) {
- write_tcp_offset_end(swqe, skb);
- }
+ if (skb->protocol != htons(ETH_P_IP))
+ return;
- /* icmp (big data) and ip segmentation packets (all other ip
- packets) do not require any special handling */
+ if (skb->ip_summed == CHECKSUM_PARTIAL)
+ swqe->tx_control |= EHEA_SWQE_IP_CHECKSUM;
- } else {
- /* Other Ethernet Protocol */
- swqe->tx_control |= EHEA_SWQE_CRC
- | EHEA_SWQE_IMM_DATA_PRESENT
- | EHEA_SWQE_DESCRIPTORS_PRESENT;
+ swqe->ip_start = skb_network_offset(skb);
+ swqe->ip_end = swqe->ip_start + ip_hdrlen(skb) - 1;
+
+ switch (ip_hdr(skb)->protocol) {
+ case IPPROTO_UDP:
+ if (skb->ip_summed == CHECKSUM_PARTIAL)
+ swqe->tx_control |= EHEA_SWQE_TCP_CHECKSUM;
+
+ swqe->tcp_offset = swqe->ip_end + 1 +
+ offsetof(struct udphdr, check);
+ swqe->tcp_end = skb->len - 1;
+ break;
+
+ case IPPROTO_TCP:
+ if (skb->ip_summed == CHECKSUM_PARTIAL)
+ swqe->tx_control |= EHEA_SWQE_TCP_CHECKSUM;
+
+ swqe->tcp_offset = swqe->ip_end + 1 +
+ offsetof(struct tcphdr, check);
+ swqe->tcp_end = skb->len - 1;
+ break;
}
+}
+
+static void ehea_xmit2(struct sk_buff *skb, struct net_device *dev,
+ struct ehea_swqe *swqe, u32 lkey)
+{
+ swqe->tx_control |= EHEA_SWQE_DESCRIPTORS_PRESENT;
+
+ xmit_common(skb, swqe);
write_swqe2_data(skb, dev, swqe, lkey);
}
@@ -2156,51 +2130,11 @@ static void ehea_xmit3(struct sk_buff *s
skb_frag_t *frag;
int i;
- if (skb->protocol == htons(ETH_P_IP)) {
- const struct iphdr *iph = ip_hdr(skb);
-
- /* IPv4 */
- write_ip_start_end(swqe, skb);
+ xmit_common(skb, swqe);
- if (iph->protocol == IPPROTO_TCP) {
- swqe->tx_control |= EHEA_SWQE_CRC
- | EHEA_SWQE_IP_CHECKSUM
- | EHEA_SWQE_TCP_CHECKSUM
- | EHEA_SWQE_IMM_DATA_PRESENT;
-
- write_tcp_offset_end(swqe, skb);
-
- } else if (iph->protocol == IPPROTO_UDP) {
- if ((iph->frag_off & IP_MF) ||
- (iph->frag_off & IP_OFFSET))
- /* IP fragment, so don't change cs */
- swqe->tx_control |= EHEA_SWQE_CRC
- | EHEA_SWQE_IMM_DATA_PRESENT;
- else {
- swqe->tx_control |= EHEA_SWQE_CRC
- | EHEA_SWQE_IP_CHECKSUM
- | EHEA_SWQE_TCP_CHECKSUM
- | EHEA_SWQE_IMM_DATA_PRESENT;
-
- write_udp_offset_end(swqe, skb);
- }
- } else {
- /* icmp (big data) and
- ip segmentation packets (all other ip packets) */
- swqe->tx_control |= EHEA_SWQE_CRC
- | EHEA_SWQE_IP_CHECKSUM
- | EHEA_SWQE_IMM_DATA_PRESENT;
- }
- } else {
- /* Other Ethernet Protocol */
- swqe->tx_control |= EHEA_SWQE_CRC | EHEA_SWQE_IMM_DATA_PRESENT;
- }
- /* copy (immediate) data */
if (nfrags == 0) {
- /* data is in a single piece */
skb_copy_from_linear_data(skb, imm_data, skb->len);
} else {
- /* first copy data from the skb->data buffer ... */
skb_copy_from_linear_data(skb, imm_data,
skb_headlen(skb));
imm_data += skb_headlen(skb);
@@ -2214,6 +2148,7 @@ static void ehea_xmit3(struct sk_buff *s
imm_data += frag->size;
}
}
+
swqe->immediate_data_length = skb->len;
dev_kfree_skb(skb);
}
@@ -3217,7 +3152,7 @@ struct ehea_port *ehea_setup_single_port
dev->netdev_ops = &ehea_netdev_ops;
ehea_set_ethtool_ops(dev);
- dev->hw_features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO
+ dev->hw_features = NETIF_F_SG | NETIF_F_TSO
| NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_TX | NETIF_F_LRO;
dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO
| NETIF_F_HIGHDMA | NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_TX
^ permalink raw reply
* [PATCH 13/15] ehea: Remove LRO support
From: Anton Blanchard @ 2011-05-12 0:52 UTC (permalink / raw)
To: leitao, michael, jesse, bhutchings; +Cc: netdev
In-Reply-To: <20110512005213.897432612@samba.org>
[-- Attachment #1: ehea_20.patch --]
[-- Type: text/plain, Size: 6743 bytes --]
In preparation for adding GRO to ehea, remove LRO.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-net/drivers/net/ehea/ehea_main.c
===================================================================
--- linux-net.orig/drivers/net/ehea/ehea_main.c 2011-05-12 07:48:02.700323737 +1000
+++ linux-net/drivers/net/ehea/ehea_main.c 2011-05-12 07:48:03.810341336 +1000
@@ -61,8 +61,6 @@ static int rq2_entries = EHEA_DEF_ENTRIE
static int rq3_entries = EHEA_DEF_ENTRIES_RQ3;
static int sq_entries = EHEA_DEF_ENTRIES_SQ;
static int use_mcs = 1;
-static int use_lro;
-static int lro_max_aggr = EHEA_LRO_MAX_AGGR;
static int prop_carrier_state;
module_param(msg_level, int, 0);
@@ -72,8 +70,6 @@ module_param(rq3_entries, int, 0);
module_param(sq_entries, int, 0);
module_param(prop_carrier_state, int, 0);
module_param(use_mcs, int, 0);
-module_param(use_lro, int, 0);
-module_param(lro_max_aggr, int, 0);
MODULE_PARM_DESC(msg_level, "msg_level");
MODULE_PARM_DESC(prop_carrier_state, "Propagate carrier state of physical "
@@ -92,11 +88,6 @@ MODULE_PARM_DESC(sq_entries, " Number of
__MODULE_STRING(EHEA_DEF_ENTRIES_SQ) ")");
MODULE_PARM_DESC(use_mcs, " 0:NAPI, 1:Multiple receive queues, Default = 1 ");
-MODULE_PARM_DESC(lro_max_aggr, " LRO: Max packets to be aggregated. Default = "
- __MODULE_STRING(EHEA_LRO_MAX_AGGR));
-MODULE_PARM_DESC(use_lro, " Large Receive Offload, 1: enable, 0: disable, "
- "Default = 0");
-
static int port_name_cnt;
static LIST_HEAD(adapter_list);
static unsigned long ehea_driver_flags;
@@ -646,58 +637,16 @@ static int ehea_treat_poll_error(struct
return 0;
}
-static int get_skb_hdr(struct sk_buff *skb, void **iphdr,
- void **tcph, u64 *hdr_flags, void *priv)
-{
- struct ehea_cqe *cqe = priv;
- unsigned int ip_len;
- struct iphdr *iph;
-
- /* non tcp/udp packets */
- if (!cqe->header_length)
- return -1;
-
- /* non tcp packet */
- skb_reset_network_header(skb);
- iph = ip_hdr(skb);
- if (iph->protocol != IPPROTO_TCP)
- return -1;
-
- ip_len = ip_hdrlen(skb);
- skb_set_transport_header(skb, ip_len);
- *tcph = tcp_hdr(skb);
-
- /* check if ip header and tcp header are complete */
- if (ntohs(iph->tot_len) < ip_len + tcp_hdrlen(skb))
- return -1;
-
- *hdr_flags = LRO_IPV4 | LRO_TCP;
- *iphdr = iph;
-
- return 0;
-}
-
static void ehea_proc_skb(struct ehea_port_res *pr, struct ehea_cqe *cqe,
struct sk_buff *skb)
{
int vlan_extracted = ((cqe->status & EHEA_CQE_VLAN_TAG_XTRACT) &&
pr->port->vgrp);
- if (skb->dev->features & NETIF_F_LRO) {
- if (vlan_extracted)
- lro_vlan_hwaccel_receive_skb(&pr->lro_mgr, skb,
- pr->port->vgrp,
- cqe->vlan_tag,
- cqe);
- else
- lro_receive_skb(&pr->lro_mgr, skb, cqe);
- } else {
- if (vlan_extracted)
- vlan_hwaccel_receive_skb(skb, pr->port->vgrp,
- cqe->vlan_tag);
- else
- netif_receive_skb(skb);
- }
+ if (vlan_extracted)
+ vlan_hwaccel_receive_skb(skb, pr->port->vgrp, cqe->vlan_tag);
+ else
+ netif_receive_skb(skb);
}
static int ehea_proc_rwqes(struct net_device *dev,
@@ -787,8 +736,6 @@ static int ehea_proc_rwqes(struct net_de
}
cqe = ehea_poll_rq1(qp, &wqe_index);
}
- if (dev->features & NETIF_F_LRO)
- lro_flush_all(&pr->lro_mgr);
pr->rx_packets += processed;
pr->rx_bytes += processed_bytes;
@@ -1612,15 +1559,6 @@ static int ehea_init_port_res(struct ehe
netif_napi_add(pr->port->netdev, &pr->napi, ehea_poll, 64);
- pr->lro_mgr.max_aggr = pr->port->lro_max_aggr;
- pr->lro_mgr.max_desc = MAX_LRO_DESCRIPTORS;
- pr->lro_mgr.lro_arr = pr->lro_desc;
- pr->lro_mgr.get_skb_header = get_skb_hdr;
- pr->lro_mgr.features = LRO_F_NAPI | LRO_F_EXTRACT_VLAN_ID;
- pr->lro_mgr.dev = port->netdev;
- pr->lro_mgr.ip_summed = CHECKSUM_UNNECESSARY;
- pr->lro_mgr.ip_summed_aggr = CHECKSUM_UNNECESSARY;
-
ret = 0;
goto out;
@@ -3113,9 +3051,6 @@ struct ehea_port *ehea_setup_single_port
NETIF_F_IP_CSUM;
dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT;
- if (use_lro)
- dev->features |= NETIF_F_LRO;
-
INIT_WORK(&port->reset_task, ehea_reset_port);
init_waitqueue_head(&port->swqe_avail_wq);
@@ -3127,8 +3062,6 @@ struct ehea_port *ehea_setup_single_port
goto out_unreg_port;
}
- port->lro_max_aggr = lro_max_aggr;
-
ret = ehea_get_jumboframe_status(port, &jumbo);
if (ret)
netdev_err(dev, "failed determining jumbo frame status\n");
Index: linux-net/drivers/net/ehea/ehea.h
===================================================================
--- linux-net.orig/drivers/net/ehea/ehea.h 2011-05-12 07:47:56.980233047 +1000
+++ linux-net/drivers/net/ehea/ehea.h 2011-05-12 07:48:03.810341336 +1000
@@ -33,7 +33,6 @@
#include <linux/ethtool.h>
#include <linux/vmalloc.h>
#include <linux/if_vlan.h>
-#include <linux/inet_lro.h>
#include <asm/ibmebus.h>
#include <asm/abs_addr.h>
@@ -58,7 +57,6 @@
#define EHEA_MIN_ENTRIES_QP 127
#define EHEA_SMALL_QUEUES
-#define EHEA_LRO_MAX_AGGR 64
#ifdef EHEA_SMALL_QUEUES
#define EHEA_MAX_CQE_COUNT 1023
@@ -85,8 +83,6 @@
#define EHEA_RQ2_PKT_SIZE 2048
#define EHEA_L_PKT_SIZE 256 /* low latency */
-#define MAX_LRO_DESCRIPTORS 8
-
/* Send completion signaling */
/* Protection Domain Identifier */
@@ -382,8 +378,6 @@ struct ehea_port_res {
u64 tx_bytes;
u64 rx_packets;
u64 rx_bytes;
- struct net_lro_mgr lro_mgr;
- struct net_lro_desc lro_desc[MAX_LRO_DESCRIPTORS];
int sq_restart_flag;
};
@@ -468,7 +462,6 @@ struct ehea_port {
u32 msg_enable;
u32 sig_comp_iv;
u32 state;
- u32 lro_max_aggr;
u8 phy_link;
u8 full_duplex;
u8 autoneg;
Index: linux-net/drivers/net/ehea/ehea_ethtool.c
===================================================================
--- linux-net.orig/drivers/net/ehea/ehea_ethtool.c 2011-05-12 07:47:49.640116670 +1000
+++ linux-net/drivers/net/ehea/ehea_ethtool.c 2011-05-12 07:48:03.810341336 +1000
@@ -205,9 +205,6 @@ static char ehea_ethtool_stats_keys[][ET
{"PR13 free_swqes"},
{"PR14 free_swqes"},
{"PR15 free_swqes"},
- {"LRO aggregated"},
- {"LRO flushed"},
- {"LRO no_desc"},
};
static void ehea_get_strings(struct net_device *dev, u32 stringset, u8 *data)
@@ -264,19 +261,6 @@ static void ehea_get_ethtool_stats(struc
for (k = 0; k < 16; k++)
data[i++] = atomic_read(&port->port_res[k].swqe_avail);
-
- for (k = 0, tmp = 0; k < EHEA_MAX_PORT_RES; k++)
- tmp |= port->port_res[k].lro_mgr.stats.aggregated;
- data[i++] = tmp;
-
- for (k = 0, tmp = 0; k < EHEA_MAX_PORT_RES; k++)
- tmp |= port->port_res[k].lro_mgr.stats.flushed;
- data[i++] = tmp;
-
- for (k = 0, tmp = 0; k < EHEA_MAX_PORT_RES; k++)
- tmp |= port->port_res[k].lro_mgr.stats.no_desc;
- data[i++] = tmp;
-
}
const struct ethtool_ops ehea_ethtool_ops = {
^ permalink raw reply
* [PATCH 03/15] ehea: Remove force_irq logic in napi poll routine
From: Anton Blanchard @ 2011-05-12 0:52 UTC (permalink / raw)
To: leitao, michael, jesse, bhutchings; +Cc: netdev
In-Reply-To: <20110512005213.897432612@samba.org>
[-- Attachment #1: ehea_3.patch --]
[-- Type: text/plain, Size: 2097 bytes --]
commit 18604c548545 (ehea: NAPI multi queue TX/RX path for SMP) added
driver specific logic for exiting napi mode. I'm not sure what it was
trying to solve and it should be up to the network stack to decide when
we are done polling so remove it.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-net/drivers/net/ehea/ehea_main.c
===================================================================
--- linux-net.orig/drivers/net/ehea/ehea_main.c 2011-05-12 07:47:49.640116670 +1000
+++ linux-net/drivers/net/ehea/ehea_main.c 2011-05-12 07:47:51.960153456 +1000
@@ -927,7 +927,6 @@ static struct ehea_cqe *ehea_proc_cqes(s
return cqe;
}
-#define EHEA_NAPI_POLL_NUM_BEFORE_IRQ 16
#define EHEA_POLL_MAX_CQES 65535
static int ehea_poll(struct napi_struct *napi, int budget)
@@ -937,18 +936,13 @@ static int ehea_poll(struct napi_struct
struct net_device *dev = pr->port->netdev;
struct ehea_cqe *cqe;
struct ehea_cqe *cqe_skb = NULL;
- int force_irq, wqe_index;
+ int wqe_index;
int rx = 0;
- force_irq = (pr->poll_counter > EHEA_NAPI_POLL_NUM_BEFORE_IRQ);
cqe_skb = ehea_proc_cqes(pr, EHEA_POLL_MAX_CQES);
+ rx += ehea_proc_rwqes(dev, pr, budget - rx);
- if (!force_irq)
- rx += ehea_proc_rwqes(dev, pr, budget - rx);
-
- while ((rx != budget) || force_irq) {
- pr->poll_counter = 0;
- force_irq = 0;
+ while ((rx != budget)) {
napi_complete(napi);
ehea_reset_cq_ep(pr->recv_cq);
ehea_reset_cq_ep(pr->send_cq);
@@ -968,7 +962,6 @@ static int ehea_poll(struct napi_struct
rx += ehea_proc_rwqes(dev, pr, budget - rx);
}
- pr->poll_counter++;
return rx;
}
Index: linux-net/drivers/net/ehea/ehea.h
===================================================================
--- linux-net.orig/drivers/net/ehea/ehea.h 2011-05-12 07:47:49.640116670 +1000
+++ linux-net/drivers/net/ehea/ehea.h 2011-05-12 07:47:51.960153456 +1000
@@ -383,7 +383,6 @@ struct ehea_port_res {
u64 tx_bytes;
u64 rx_packets;
u64 rx_bytes;
- u32 poll_counter;
struct net_lro_mgr lro_mgr;
struct net_lro_desc lro_desc[MAX_LRO_DESCRIPTORS];
int sq_restart_flag;
^ permalink raw reply
* [PATCH 04/15] ehea: Remove num_tx_qps module option
From: Anton Blanchard @ 2011-05-12 0:52 UTC (permalink / raw)
To: leitao, michael, jesse, bhutchings; +Cc: netdev
In-Reply-To: <20110512005213.897432612@samba.org>
[-- Attachment #1: ehea_5.patch --]
[-- Type: text/plain, Size: 7457 bytes --]
The num_tx_qps module option allows a user to configure a different
number of tx and rx queues. Now the networking stack is multiqueue
aware it makes little sense just to enable the tx queues and not the
rx queues so remove the option.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-net/drivers/net/ehea/ehea.h
===================================================================
--- linux-net.orig/drivers/net/ehea/ehea.h 2011-05-12 07:47:51.960153456 +1000
+++ linux-net/drivers/net/ehea/ehea.h 2011-05-12 07:47:53.490177714 +1000
@@ -58,7 +58,6 @@
#define EHEA_MIN_ENTRIES_QP 127
#define EHEA_SMALL_QUEUES
-#define EHEA_NUM_TX_QP 1
#define EHEA_LRO_MAX_AGGR 64
#ifdef EHEA_SMALL_QUEUES
@@ -460,8 +459,6 @@ struct ehea_port {
char int_aff_name[EHEA_IRQ_NAME_SIZE];
int allmulti; /* Indicates IFF_ALLMULTI state */
int promisc; /* Indicates IFF_PROMISC state */
- int num_tx_qps;
- int num_add_tx_qps;
int num_mcs;
int resets;
unsigned long flags;
Index: linux-net/drivers/net/ehea/ehea_main.c
===================================================================
--- linux-net.orig/drivers/net/ehea/ehea_main.c 2011-05-12 07:47:51.960153456 +1000
+++ linux-net/drivers/net/ehea/ehea_main.c 2011-05-12 07:47:53.490177714 +1000
@@ -63,7 +63,6 @@ static int sq_entries = EHEA_DEF_ENTRIES
static int use_mcs = 1;
static int use_lro;
static int lro_max_aggr = EHEA_LRO_MAX_AGGR;
-static int num_tx_qps = EHEA_NUM_TX_QP;
static int prop_carrier_state;
module_param(msg_level, int, 0);
@@ -75,9 +74,7 @@ module_param(prop_carrier_state, int, 0)
module_param(use_mcs, int, 0);
module_param(use_lro, int, 0);
module_param(lro_max_aggr, int, 0);
-module_param(num_tx_qps, int, 0);
-MODULE_PARM_DESC(num_tx_qps, "Number of TX-QPS");
MODULE_PARM_DESC(msg_level, "msg_level");
MODULE_PARM_DESC(prop_carrier_state, "Propagate carrier state of physical "
"port to stack. 1:yes, 0:no. Default = 0 ");
@@ -172,7 +169,7 @@ static void ehea_update_firmware_handles
continue;
num_ports++;
- num_portres += port->num_def_qps + port->num_add_tx_qps;
+ num_portres += port->num_def_qps;
}
}
@@ -198,9 +195,7 @@ static void ehea_update_firmware_handles
(num_ports == 0))
continue;
- for (l = 0;
- l < port->num_def_qps + port->num_add_tx_qps;
- l++) {
+ for (l = 0; l < port->num_def_qps; l++) {
struct ehea_port_res *pr = &port->port_res[l];
arr[i].adh = adapter->handle;
@@ -360,7 +355,7 @@ static struct net_device_stats *ehea_get
}
tx_packets = 0;
- for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
+ for (i = 0; i < port->num_def_qps; i++) {
tx_packets += port->port_res[i].tx_packets;
tx_bytes += port->port_res[i].tx_bytes;
}
@@ -811,7 +806,7 @@ static void reset_sq_restart_flag(struct
{
int i;
- for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
+ for (i = 0; i < port->num_def_qps; i++) {
struct ehea_port_res *pr = &port->port_res[i];
pr->sq_restart_flag = 0;
}
@@ -824,7 +819,7 @@ static void check_sqs(struct ehea_port *
int swqe_index;
int i, k;
- for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
+ for (i = 0; i < port->num_def_qps; i++) {
struct ehea_port_res *pr = &port->port_res[i];
int ret;
k = 0;
@@ -1113,13 +1108,6 @@ int ehea_sense_port_attr(struct ehea_por
goto out_free;
}
- port->num_tx_qps = num_tx_qps;
-
- if (port->num_def_qps >= port->num_tx_qps)
- port->num_add_tx_qps = 0;
- else
- port->num_add_tx_qps = port->num_tx_qps - port->num_def_qps;
-
ret = 0;
out_free:
if (ret || netif_msg_probe(port))
@@ -1360,7 +1348,7 @@ static int ehea_reg_interrupts(struct ne
port->qp_eq->attr.ist1);
- for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
+ for (i = 0; i < port->num_def_qps; i++) {
pr = &port->port_res[i];
snprintf(pr->int_send_name, EHEA_IRQ_NAME_SIZE - 1,
"%s-queue%d", dev->name, i);
@@ -1403,7 +1391,7 @@ static void ehea_free_interrupts(struct
/* send */
- for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
+ for (i = 0; i < port->num_def_qps; i++) {
pr = &port->port_res[i];
ibmebus_free_irq(pr->eq->attr.ist1, pr);
netif_info(port, intr, dev,
@@ -2472,8 +2460,7 @@ out:
return ret;
}
-static int ehea_port_res_setup(struct ehea_port *port, int def_qps,
- int add_tx_qps)
+static int ehea_port_res_setup(struct ehea_port *port, int def_qps)
{
int ret, i;
struct port_res_cfg pr_cfg, pr_cfg_small_rx;
@@ -2506,7 +2493,7 @@ static int ehea_port_res_setup(struct eh
if (ret)
goto out_clean_pr;
}
- for (i = def_qps; i < def_qps + add_tx_qps; i++) {
+ for (i = def_qps; i < def_qps; i++) {
ret = ehea_init_port_res(port, &port->port_res[i],
&pr_cfg_small_rx, i);
if (ret)
@@ -2529,7 +2516,7 @@ static int ehea_clean_all_portres(struct
int ret = 0;
int i;
- for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++)
+ for (i = 0; i < port->num_def_qps; i++)
ret |= ehea_clean_portres(port, &port->port_res[i]);
ret |= ehea_destroy_eq(port->qp_eq);
@@ -2561,8 +2548,7 @@ static int ehea_up(struct net_device *de
if (port->state == EHEA_PORT_UP)
return 0;
- ret = ehea_port_res_setup(port, port->num_def_qps,
- port->num_add_tx_qps);
+ ret = ehea_port_res_setup(port, port->num_def_qps);
if (ret) {
netdev_err(dev, "port_res_failed\n");
goto out;
@@ -2581,7 +2567,7 @@ static int ehea_up(struct net_device *de
goto out_clean_pr;
}
- for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
+ for (i = 0; i < port->num_def_qps; i++) {
ret = ehea_activate_qp(port->adapter, port->port_res[i].qp);
if (ret) {
netdev_err(dev, "activate_qp failed\n");
@@ -2627,7 +2613,7 @@ static void port_napi_disable(struct ehe
{
int i;
- for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++)
+ for (i = 0; i < port->num_def_qps; i++)
napi_disable(&port->port_res[i].napi);
}
@@ -2635,7 +2621,7 @@ static void port_napi_enable(struct ehea
{
int i;
- for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++)
+ for (i = 0; i < port->num_def_qps; i++)
napi_enable(&port->port_res[i].napi);
}
@@ -2721,7 +2707,7 @@ static void ehea_flush_sq(struct ehea_po
{
int i;
- for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
+ for (i = 0; i < port->num_def_qps; i++) {
struct ehea_port_res *pr = &port->port_res[i];
int swqe_max = pr->sq_skba_size - 2 - pr->swqe_ll_count;
int ret;
@@ -2755,7 +2741,7 @@ int ehea_stop_qps(struct net_device *dev
goto out;
}
- for (i = 0; i < (port->num_def_qps + port->num_add_tx_qps); i++) {
+ for (i = 0; i < (port->num_def_qps); i++) {
struct ehea_port_res *pr = &port->port_res[i];
struct ehea_qp *qp = pr->qp;
@@ -2857,7 +2843,7 @@ int ehea_restart_qps(struct net_device *
goto out;
}
- for (i = 0; i < (port->num_def_qps + port->num_add_tx_qps); i++) {
+ for (i = 0; i < (port->num_def_qps); i++) {
struct ehea_port_res *pr = &port->port_res[i];
struct ehea_qp *qp = pr->qp;
@@ -3217,8 +3203,7 @@ struct ehea_port *ehea_setup_single_port
goto out_free_mc_list;
netif_set_real_num_rx_queues(dev, port->num_def_qps);
- netif_set_real_num_tx_queues(dev, port->num_def_qps +
- port->num_add_tx_qps);
+ netif_set_real_num_tx_queues(dev, port->num_def_qps);
port_dev = ehea_register_port(port, dn);
if (!port_dev)
^ permalink raw reply
* [PATCH 15/15] ehea: Remove unused tcp_end field in send WQ
From: Anton Blanchard @ 2011-05-12 0:52 UTC (permalink / raw)
To: leitao, michael, jesse, bhutchings; +Cc: netdev
In-Reply-To: <20110512005213.897432612@samba.org>
[-- Attachment #1: ehea_22.patch --]
[-- Type: text/plain, Size: 1328 bytes --]
The tcp_end field is not actually used by the hardware, so there
is no need to set it.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-net/drivers/net/ehea/ehea_main.c
===================================================================
--- linux-net.orig/drivers/net/ehea/ehea_main.c 2011-05-12 07:48:05.100361788 +1000
+++ linux-net/drivers/net/ehea/ehea_main.c 2011-05-12 07:48:06.380382084 +1000
@@ -1995,7 +1995,6 @@ static void xmit_common(struct sk_buff *
swqe->tcp_offset = swqe->ip_end + 1 +
offsetof(struct udphdr, check);
- swqe->tcp_end = skb->len - 1;
break;
case IPPROTO_TCP:
@@ -2004,7 +2003,6 @@ static void xmit_common(struct sk_buff *
swqe->tcp_offset = swqe->ip_end + 1 +
offsetof(struct tcphdr, check);
- swqe->tcp_end = skb->len - 1;
break;
}
}
Index: linux-net/drivers/net/ehea/ehea_qmr.h
===================================================================
--- linux-net.orig/drivers/net/ehea/ehea_qmr.h 2011-05-12 07:47:05.399415238 +1000
+++ linux-net/drivers/net/ehea/ehea_qmr.h 2011-05-12 07:48:06.380382084 +1000
@@ -106,7 +106,7 @@ struct ehea_swqe {
u8 immediate_data_length;
u8 tcp_offset;
u8 reserved2;
- u16 tcp_end;
+ u16 reserved2b;
u8 wrap_tag;
u8 descriptors; /* number of valid descriptors in WQE */
u16 reserved3;
^ 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