Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue with per-vhost kthread
From: Tejun Heo @ 2010-07-28 12:00 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Oleg Nesterov, Sridhar Samudrala, netdev, lkml,
	kvm@vger.kernel.org, Andrew Morton, Dmitri Vorobiev, Jiri Kosina,
	Thomas Gleixner, Ingo Molnar, Andi Kleen
In-Reply-To: <20100728104858.GB30643@redhat.com>

Hello,

On 07/28/2010 12:48 PM, Michael S. Tsirkin wrote:
> I'm unsure how flush_work operates under these conditions.  E.g. in
> workqueue.c, this seems to work by keeping a pointer to current
> workqueue in the work.  But what prevents us from destroying the
> workqueue when work might not be running?

In cmwq, work points to the gcwq it was on, which keeps track of all
the works in progress, so flushing work which is on a destroyed
workqueue should be fine, but in the original implementation, it would
end up accessing freed memory.

> Is this currently broken if you use multiple workqueues
> for the same work? If yes, I propose we do as I did,
> making flush_work get worker pointer, and only flushing
> on that worker.

The original semantics of workqueue is that flush_work() guarantees
that the work has finished executing on the workqueue it was last
queued on.  Adding @worker to flush_work() is okay, I think.

Thanks.

-- 
tejun

^ permalink raw reply

* Re: [BUG] bridge leaks 3 references on lo per up&down
From: David Lamparter @ 2010-07-28 12:03 UTC (permalink / raw)
  To: netdev; +Cc: Herbert Xu, Stephen Hemminger, bridge
In-Reply-To: <20100728095825.GC13413@jupiter.n2.diac24.net>

On Wed, Jul 28, 2010 at 11:58:25AM +0200, David Lamparter wrote:
> unshare -n -- /bin/bash -c 'ip link add link lo veth0 type veth peer
>       name veth3 netns 1; brctl addbr br0; \
>       ip l s br0 up; sleep 8; ip l s br0 down; sleep 1;
>       ip l s br0 up; sleep 8;'
>
> I get "usage count = 7" on lo; when I add another up & down, I get
> "usage count = 10". 4 times makes it a merry 13 refs...

It only happens with BRIDGE_IGMP_SNOOPING. As we don't need that, our
"fix" is just to run with it disabled... works pretty fine.

Herbert, you implemented bridge multicast support, maybe you can figure
out where these references are taken?


-David


^ permalink raw reply

* RE: [PATCH net-next] drivers/net/bfin_mac.c: Use pr_fmt, netdev_<level>
From: Hennerich, Michael @ 2010-07-28 13:23 UTC (permalink / raw)
  To: Joe Perches; +Cc: uclinux-dist-devel, netdev, LKML
In-Reply-To: <1280258531.24054.10.camel@Joe-Laptop.home>

Joe Perches wrote on 2010-07-27:
> And some assorted neatening for checkpatch:
>
>       80 column reformatting (mostly comments)
>       argument alignment
>       couple of spelling/grammar typos corrected
>
> Added bfin_alloc_skb to centralize allocation/dcache invalidation
> Added get_mac_addr for symmetry
>
> $ ./scripts/checkpatch.pl -f drivers/net/bfin_mac.c | grep "^total:"
> total: 2 errors, 25 warnings, 1723 lines checked $
> ./scripts/checkpatch.pl -f drivers/net/bfin_mac.c | grep "^total:"
> total: 0 errors, 0 warnings, 1743 lines checked
>
> Uncompiled, untested.

One little thing -

drivers/net/bfin_mac.c: In function ‘bfin_alloc_skb’:
drivers/net/bfin_mac.c:89: error: ‘PKT_BUF_SIZE’ undeclared (first use in this function)

If you change the define PKT_BUF_SZ to match what is being used in this patch
- then everything compiles and works cleanly.

Acked-by: Michael Hennerich <michael.hennerich@analog.com>

>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/net/bfin_mac.c |  284
> ++++++++++++++++++++++++++--------------
> --------
>  1 files changed, 152 insertions(+), 132 deletions(-)
> diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c index
> 012613f..46a4576 100644
> --- a/drivers/net/bfin_mac.c
> +++ b/drivers/net/bfin_mac.c
> @@ -8,6 +8,8 @@
>   * Licensed under the GPL-2 or later.
>   */
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
>  #include <linux/init.h>
>  #include <linux/module.h>
>  #include <linux/kernel.h>
> @@ -81,6 +83,24 @@ static u16 pin_req[] = P_RMII0;  static u16
> pin_req[] = P_MII0;  #endif
>
> +static struct sk_buff *bfin_alloc_skb(void) { +      /* allocate a new skb
> */ +  struct sk_buff *new_skb = dev_alloc_skb(PKT_BUF_SIZE +
> NET_IP_ALIGN); + +    if (!new_skb) +         return NULL; +
> +     skb_reserve(new_skb, NET_IP_ALIGN); +   /* Invalidate the data cache of
> skb->data range when it is write back +        * cache.  It will prevent
> overwriting the new data from DMA +    */
> +     blackfin_dcache_invalidate_range((unsigned long)new_skb->head, +
> (unsigned long)new_skb->end); + +     return new_skb; +} +
>  static void desc_list_free(void)
>  {
>       struct net_dma_desc_rx *r;
> @@ -132,14 +152,14 @@ static int desc_list_init(void)  #endif
>
>       tx_desc = bfin_mac_alloc(&dma_handle,
> -                             sizeof(struct net_dma_desc_tx) * -                              CONFIG_BFIN_TX_DESC_NUM);
> +                              sizeof(struct net_dma_desc_tx) * +                              CONFIG_BFIN_TX_DESC_NUM);
>       if (tx_desc == NULL)
>               goto init_error;
>
>       rx_desc = bfin_mac_alloc(&dma_handle,
> -                             sizeof(struct net_dma_desc_rx) * -                              CONFIG_BFIN_RX_DESC_NUM);
> +                              sizeof(struct net_dma_desc_rx) * +                              CONFIG_BFIN_RX_DESC_NUM);
>       if (rx_desc == NULL)
>               goto init_error;
> @@ -192,19 +212,11 @@ static int desc_list_init(void)
>               struct dma_descriptor *a = &(r->desc_a);
>               struct dma_descriptor *b = &(r->desc_b);
> -             /* allocate a new skb for next time receive */
> -             new_skb = dev_alloc_skb(PKT_BUF_SZ + NET_IP_ALIGN);
> +             new_skb = bfin_alloc_skb();
>               if (!new_skb) {
> -                     printk(KERN_NOTICE DRV_NAME
> -                            ": init: low on mem - packet dropped\n");
> +                     pr_notice("init: low on mem - packet dropped\n");
>                       goto init_error;
>               }
> -             skb_reserve(new_skb, NET_IP_ALIGN);
> -             /* Invidate the data cache of skb->data range when it is
> write back
> -              * cache. It will prevent overwritting the new data from
> DMA
> -              */
> -             blackfin_dcache_invalidate_range((unsigned long)new_skb-
>  head, -                                       (unsigned long)new_skb->end);          r->skb = new_skb;
>>
>               /* @@ -229,8 +241,8 @@ static int desc_list_init(void)           * 6 half
>  words is desc size            * large desc flow               */
> -             b->config = DMAEN | WNR | WDSIZE_32 | DI_EN |
> -                             NDSIZE_6 | DMAFLOW_LARGE;
> +             b->config = (DMAEN | WNR | WDSIZE_32 | DI_EN |
> +                          NDSIZE_6 | DMAFLOW_LARGE);
>               b->start_addr = (unsigned long)(&(r->status));
>               b->x_count = 0;
> @@ -246,7 +258,7 @@ static int desc_list_init(void)
>
>  init_error:
>       desc_list_free();
> -     printk(KERN_ERR DRV_NAME ": kmalloc failed\n");
> +     pr_err("kmalloc failed\n");
>       return -ENOMEM;
>  }
> @@ -263,12 +275,11 @@ static int bfin_mdio_poll(void)
>
>       /* poll the STABUSY bit */      while ((bfin_read_EMAC_STAADD()) &
>  STABUSY) { -         udelay(1);              if (timeout_cnt-- < 0) {
> -                     printk(KERN_ERR DRV_NAME
> -                     ": wait MDC/MDIO transaction to complete timeout\n");
> +                     pr_err("wait MDC/MDIO transaction to complete
> timeout\n");
>                       return -ETIMEDOUT;              } +             udelay(1);      }
>
>       return 0;
> @@ -284,15 +295,15 @@ static int bfin_mdiobus_read(struct mii_bus
> *bus, int phy_addr, int regnum)
>               return ret;
>
>       /* read mode */
> -     bfin_write_EMAC_STAADD(SET_PHYAD((u16) phy_addr) |
> +     bfin_write_EMAC_STAADD((SET_PHYAD((u16) phy_addr) |
>                               SET_REGAD((u16) regnum) |
> -                             STABUSY);
> +                             STABUSY));
>
>       ret = bfin_mdio_poll();
>       if (ret)
>               return ret;
> -     return (int) bfin_read_EMAC_STADAT();
> +     return (int)bfin_read_EMAC_STADAT();
>  }
>
>  /* Write an off-chip register in a PHY through the MDC/MDIO port */
> @@ -308,10 +319,10 @@ static int bfin_mdiobus_write(struct mii_bus
> *bus, int phy_addr, int regnum,
>       bfin_write_EMAC_STADAT((u32) value);
>
>       /* write mode */
> -     bfin_write_EMAC_STAADD(SET_PHYAD((u16) phy_addr) |
> +     bfin_write_EMAC_STAADD((SET_PHYAD((u16) phy_addr) |
>                               SET_REGAD((u16) regnum) |
>                               STAOP |
> -                             STABUSY);
> +                             STABUSY));
>
>       return bfin_mdio_poll();
>  }
> @@ -356,9 +367,9 @@ static void bfin_mac_adjust_link(struct net_device
> *dev)
>                               opmode &= ~(RMII_10);
>                               break;
>                       default:
> -                             printk(KERN_WARNING
> -                                     "%s: Ack!  Speed (%d) is not 10/100!\n",
> -                                     DRV_NAME, phydev->speed);
> +                             netdev_warn(dev,
> +                                         "Ack!  Speed (%d) is not 10/100!\n",
> +                                         phydev->speed);
>                               break;
>                       }
>                       bfin_write_EMAC_OPMODE(opmode);
> @@ -382,7 +393,7 @@ static void bfin_mac_adjust_link(struct net_device
> *dev)
>       if (new_state) {
>               u32 opmode = bfin_read_EMAC_OPMODE();
>               phy_print_status(phydev);
> -             pr_debug("EMAC_OPMODE = 0x%08x\n", opmode);
> +             netdev_dbg(dev, "EMAC_OPMODE = 0x%08x\n", opmode);
>       }
>
>       spin_unlock_irqrestore(&lp->lock, flags); @@ -421,35 +432,35 @@ static
>  int mii_probe(struct net_device *dev)                break; /* found it */   }
> -     /* now we are supposed to have a proper phydev, to attach to... */
> +     /* now we are supposed to have a proper phydev to attach to... */
>       if (!phydev) {
> -             printk(KERN_INFO "%s: Don't found any phy device at all\n",
> -                     dev->name); +           netdev_info(dev, "No PHY device found\n");
>               return -ENODEV;
>       }
>
>  #if defined(CONFIG_BFIN_MAC_RMII)
>       phydev = phy_connect(dev, dev_name(&phydev->dev),
> &bfin_mac_adjust_link,
> -                     0, PHY_INTERFACE_MODE_RMII);
> +                          0, PHY_INTERFACE_MODE_RMII);
>  #else
>       phydev = phy_connect(dev, dev_name(&phydev->dev),
> &bfin_mac_adjust_link,
> -                     0, PHY_INTERFACE_MODE_MII);
> +                          0, PHY_INTERFACE_MODE_MII);
>  #endif
>
>       if (IS_ERR(phydev)) { -         printk(KERN_ERR "%s: Could not attach to
>  PHY\n", dev- name); +                netdev_err(dev, "Could not attach to PHY\n");
>               return PTR_ERR(phydev);         }
>
>       /* mask with MAC supported features */
> -     phydev->supported &= (SUPPORTED_10baseT_Half
> -                           | SUPPORTED_10baseT_Full
> -                           | SUPPORTED_100baseT_Half
> -                           | SUPPORTED_100baseT_Full
> -                           | SUPPORTED_Autoneg
> -                           | SUPPORTED_Pause | SUPPORTED_Asym_Pause
> -                           | SUPPORTED_MII
> -                           | SUPPORTED_TP);
> +     phydev->supported &= (SUPPORTED_10baseT_Half |
> +                           SUPPORTED_10baseT_Full |
> +                           SUPPORTED_100baseT_Half |
> +                           SUPPORTED_100baseT_Full |
> +                           SUPPORTED_Autoneg |
> +                           SUPPORTED_Pause |
> +                           SUPPORTED_Asym_Pause |
> +                           SUPPORTED_MII |
> +                           SUPPORTED_TP);
>
>       phydev->advertising = phydev->supported;
> @@ -458,11 +469,11 @@ static int mii_probe(struct net_device *dev)
>       lp->old_duplex = -1;
>       lp->phydev = phydev;
> -     printk(KERN_INFO "%s: attached PHY driver [%s] " -
> "(mii_bus:phy_addr=%s, irq=%d, mdc_clk=%dHz(mdc_div=%d)" -
> "@sclk=%dMHz)\n", -          DRV_NAME, phydev->drv->name,
> dev_name(&phydev->dev), phydev->irq, -               MDC_CLK, mdc_div,
> sclk/1000000); +      netdev_info(dev, "attached PHY driver [%s] " +
> "(mii_bus:phy_addr=%s, irq=%d, mdc_clk=%dHz(mdc_div=%d)" +
> "@sclk=%dMHz)\n", +               phydev->drv->name, dev_name(&phydev->dev),
> phydev->irq, +                    MDC_CLK, mdc_div, sclk/1000000);
>
>       return 0;
>  }
> @@ -514,7 +525,7 @@ static void bfin_mac_ethtool_getdrvinfo(struct
> net_device *dev,  }
>
>  static void bfin_mac_ethtool_getwol(struct net_device *dev,
> -     struct ethtool_wolinfo *wolinfo)
> +                                 struct ethtool_wolinfo *wolinfo)
>  {
>       struct bfin_mac_local *lp = netdev_priv(dev);
> @@ -523,7 +534,7 @@ static void bfin_mac_ethtool_getwol(struct
> net_device *dev,  }
>
>  static int bfin_mac_ethtool_setwol(struct net_device *dev,
> -     struct ethtool_wolinfo *wolinfo)
> +                                struct ethtool_wolinfo *wolinfo)
>  {    struct bfin_mac_local *lp = netdev_priv(dev);   int rc; @@ -599,10
>  +610,20 @@ void setup_system_regs(struct net_device *dev)
>       bfin_write_DMA1_Y_MODIFY(0); }
> +/* Grab the MAC address in the MAC */ static void get_mac_addr(u8
> +*mac_addr) {
> +     __le32 addr_hi = cpu_to_le32(bfin_read_EMAC_ADDRLO());
> +     __le16 addr_low = cpu_to_le16((u16)bfin_read_EMAC_ADDRHI());
> +
> +     memcpy(mac_addr, &addr_hi, 4);
> +     memcpy(mac_addr + 4, &addr_low, 2);
> +}
> +
>  static void setup_mac_addr(u8 *mac_addr)  {
> -     u32 addr_low = le32_to_cpu(*(__le32 *) & mac_addr[0]);
> -     u16 addr_hi = le16_to_cpu(*(__le16 *) & mac_addr[4]);
> +     u32 addr_low = le32_to_cpu(*(__le32 *)&mac_addr[0]);
> +     u16 addr_hi = le16_to_cpu(*(__le16 *)&mac_addr[4]);
>
>       /* this depends on a little-endian machine */
>       bfin_write_EMAC_ADDRLO(addr_low);
> @@ -612,6 +633,7 @@ static void setup_mac_addr(u8 *mac_addr)  static
> int bfin_mac_set_mac_address(struct net_device *dev, void *p)  {
>       struct sockaddr *addr = p; +    if (netif_running(dev))                 return -EBUSY;
>       memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); @@ -623,7
> +645,7 @@ static int bfin_mac_set_mac_address(struct net_device *dev,
> void *p)  #define bfin_mac_hwtstamp_is_none(cfg) ((cfg) ==
> HWTSTAMP_FILTER_NONE)
>
>  static int bfin_mac_hwtstamp_ioctl(struct net_device *netdev,
> -             struct ifreq *ifr, int cmd)
> +                                struct ifreq *ifr, int cmd)
>  {
>       struct hwtstamp_config config;
>       struct bfin_mac_local *lp = netdev_priv(netdev); @@ -633,15
> +655,15 @@ static int bfin_mac_hwtstamp_ioctl(struct net_device
> *netdev,
>       if (copy_from_user(&config, ifr->ifr_data, sizeof(config)))
>               return -EFAULT;
> -     pr_debug("%s config flag:0x%x, tx_type:0x%x, rx_filter:0x%x\n",
> -                     __func__, config.flags, config.tx_type,
> config.rx_filter);
> +     netdev_dbg("%s config flag:0x%x, tx_type:0x%x, rx_filter:0x%x\n",
> +                __func__, config.flags, config.tx_type,
> config.rx_filter);
>
>       /* reserved for future extensions */
>       if (config.flags)
>               return -EINVAL;
>
>       if ((config.tx_type != HWTSTAMP_TX_OFF) &&
> -                     (config.tx_type != HWTSTAMP_TX_ON))
> +         (config.tx_type != HWTSTAMP_TX_ON))
>               return -ERANGE;
>
>       ptpctl = bfin_read_EMAC_PTP_CTL();
> @@ -658,7 +680,8 @@ static int bfin_mac_hwtstamp_ioctl(struct
> net_device *netdev,
>       case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
>       case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
>               /*
> -              * Clear the five comparison mask bits (bits[12:8]) in EMAC_PTP_CTL)
> +              * Clear the five comparison mask bits +                 * (bits[12:8] in
> EMAC_PTP_CTL)
>                * to enable all the field matches.
>                */
>               ptpctl &= ~0x1F00;
> @@ -694,8 +717,8 @@ static int bfin_mac_hwtstamp_ioctl(struct
> net_device *netdev,
>               ptpctl &= ~0x1F00;
>               bfin_write_EMAC_PTP_CTL(ptpctl);
>               /*
> -              * Keep the default values of the EMAC_PTP_FOFF register,
> except set
> -              * the PTPCOF field to 0x2A.
> +              * Keep the default values of the EMAC_PTP_FOFF register,
> +              * except set the PTPCOF field to 0x2A.
>                */
>               ptpfoff = 0x2A24170C;
>               bfin_write_EMAC_PTP_FOFF(ptpfoff);
> @@ -720,20 +743,20 @@ static int bfin_mac_hwtstamp_ioctl(struct
> net_device *netdev,
>       case HWTSTAMP_FILTER_PTP_V2_L2_SYNC:
>       case HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ:
>               /*
> -              * Clear bits 8 and 12 of the EMAC_PTP_CTL register to
> enable only the
> -              * EFTM and PTPCM field comparison.
> +              * Clear bits 8 and 12 of the EMAC_PTP_CTL register to
> enable
> +              * only the EFTM and PTPCM field comparison.
>                */
>               ptpctl &= ~0x1100;
>               bfin_write_EMAC_PTP_CTL(ptpctl);
>               /*
> -              * Keep the default values of all the fields of the EMAC_PTP_FOFF -
> * register, except set the PTPCOF field to 0x0E. +             * Keep the default
> values of all the fields of the +              * EMAC_PTP_FOFF register, except set
> the PTPCOF field to 0x0E.
>                */
>               ptpfoff = 0x0E24170C;
>               bfin_write_EMAC_PTP_FOFF(ptpfoff);
>               /*
> -              * Program bits [15:0] of the EMAC_PTP_FV1 register to 0x88F7, which
> -              * corresponds to PTP messages on the MAC layer. +               * Program bits
> [15:0] of the EMAC_PTP_FV1 register to 0x88F7, +               * which corresponds
> to PTP messages on the MAC layer.
>                */
>               ptpfv1 = 0x110488F7;
>               bfin_write_EMAC_PTP_FV1(ptpfv1);
> @@ -791,13 +814,17 @@ static int bfin_mac_hwtstamp_ioctl(struct
> net_device *netdev,
>               -EFAULT : 0;
>  }
> -static void bfin_dump_hwtamp(char *s, ktime_t *hw, ktime_t *ts,
> struct timecompare *cmp)
> +static void bfin_dump_hwtamp(char *s, ktime_t *hw, ktime_t *ts,
> +                          struct timecompare *cmp)
>  {
>       ktime_t sys = ktime_get_real();
>
>       pr_debug("%s %s hardware:%d,%d transform system:%d,%d system:%d,%d,
> cmp:%lld, %lld\n",
> -                     __func__, s, hw->tv.sec, hw->tv.nsec, ts->tv.sec, ts-
>> tv.nsec, sys.tv.sec,
> -                     sys.tv.nsec, cmp->offset, cmp->skew);
> +              __func__, s,
> +              hw->tv.sec, hw->tv.nsec,
> +              ts->tv.sec, ts->tv.nsec,
> +              sys.tv.sec, sys.tv.nsec,
> +              cmp->offset, cmp->skew);
>  }
>
>  static void bfin_tx_hwtstamp(struct net_device *netdev, struct
> sk_buff
> *skb) @@ -814,16 +841,17 @@ static void bfin_tx_hwtstamp(struct
> net_device *netdev, struct sk_buff *skb)
>               shtx->in_progress = 1;
>
>               /*
> -              * The timestamping is done at the EMAC module's MII/RMII interface
> -              * when the module sees the Start of Frame of an event message
> packet. This -                 * interface is the closest possible place to the
> physical Ethernet transmission +               * The timestamping is done at the
> EMAC module's MII/RMII +               * interface when the module sees the Start of
> Frame of an +          * event message packet. This interface is the closest
> +              * possible place to the physical Ethernet transmission
>                * medium, providing the best timing accuracy.
>                */
> -             while ((!(bfin_read_EMAC_PTP_ISTAT() & TXTL)) && (-- timeout_cnt))
> +             while ((!(bfin_read_EMAC_PTP_ISTAT() & TXTL)) && +
> (--timeout_cnt))
>                       udelay(1);
>               if (timeout_cnt == 0)
> -                     printk(KERN_ERR DRV_NAME
> -                                     ": fails to timestamp the TX packet\n");
> +                     netdev_err(dev, "failed to timestamp the TX
> packet\n");
>               else {
>                       struct skb_shared_hwtstamps shhwtstamps;
>                       u64 ns;
> @@ -832,15 +860,15 @@ static void bfin_tx_hwtstamp(struct net_device
> *netdev, struct sk_buff *skb)
>                       regval = bfin_read_EMAC_PTP_TXSNAPLO();
>                       regval |= (u64)bfin_read_EMAC_PTP_TXSNAPHI() << 32;
>                       memset(&shhwtstamps, 0, sizeof(shhwtstamps));
> -                     ns = timecounter_cyc2time(&lp->clock,
> -                                     regval);
> +                     ns = timecounter_cyc2time(&lp->clock, regval);
>                       timecompare_update(&lp->compare, ns);
>                       shhwtstamps.hwtstamp = ns_to_ktime(ns);
>                       shhwtstamps.syststamp =
>                               timecompare_transform(&lp->compare, ns);
>                       skb_tstamp_tx(skb, &shhwtstamps);
> -                     bfin_dump_hwtamp("TX", &shhwtstamps.hwtstamp,
> &shhwtstamps.syststamp, &lp->compare);
> +                     bfin_dump_hwtamp("TX", &shhwtstamps.hwtstamp,
> +                                      &shhwtstamps.syststamp, &lp->compare);
>               }
>       }
>  }
> @@ -869,7 +897,8 @@ static void bfin_rx_hwtstamp(struct net_device
> *netdev, struct sk_buff *skb)
>       shhwtstamps->hwtstamp = ns_to_ktime(ns);
>       shhwtstamps->syststamp = timecompare_transform(&lp->compare, ns);
> -     bfin_dump_hwtamp("RX", &shhwtstamps->hwtstamp, &shhwtstamps-
>> syststamp, &lp->compare);
> +     bfin_dump_hwtamp("RX", &shhwtstamps->hwtstamp,
> +                      &shhwtstamps->syststamp, &lp->compare);
>  }
>
>  /*
> @@ -879,8 +908,8 @@ static cycle_t bfin_read_clock(const struct
> cyclecounter *tc)  {
>       u64 stamp;
> -     stamp =  bfin_read_EMAC_PTP_TIMELO();
> -     stamp |= (u64)bfin_read_EMAC_PTP_TIMEHI() << 32ULL;
> +     stamp = bfin_read_EMAC_PTP_TIMELO();
> +     stamp |= ((u64)bfin_read_EMAC_PTP_TIMEHI()) << 32;
>
>       return stamp;
>  }
> @@ -961,7 +990,7 @@ static void tx_reclaim_skb(struct bfin_mac_local
> *lp)
>       }
>
>       if (current_tx_ptr->next != tx_list_head &&
> -             netif_queue_stopped(lp->ndev))
> +         netif_queue_stopped(lp->ndev))
>               netif_wake_queue(lp->ndev);
>
>       if (tx_list_head != current_tx_ptr) { @@ -974,7 +1003,7 @@ static
> void tx_reclaim_skb(struct bfin_mac_local
> *lp)
>                               jiffies + TX_RECLAIM_JIFFIES;
>
>               mod_timer(&lp->tx_reclaim_timer,
> -                     lp->tx_reclaim_timer.expires);
> +                       lp->tx_reclaim_timer.expires);
>       }
>
>       return;
> @@ -985,8 +1014,7 @@ static void tx_reclaim_skb_timeout(unsigned long
> lp)
>       tx_reclaim_skb((struct bfin_mac_local *)lp);  }
> -static int bfin_mac_hard_start_xmit(struct sk_buff *skb,
> -                             struct net_device *dev)
> +static int bfin_mac_hard_start_xmit(struct sk_buff *skb, struct
> +net_device *dev)
>  {
>       struct bfin_mac_local *lp = netdev_priv(dev);
>       u16 *data;
> @@ -1000,10 +1028,11 @@ static int bfin_mac_hard_start_xmit(struct
> sk_buff *skb,
>               data = (u16 *)(skb->data) - 1;
>               *data = (u16)(skb->len);
>               /*
> -              * When transmitting an Ethernet packet, the PTP_TSYNC module
> requires -             * a DMA_Length_Word field associated with the packet. The
> lower 12 bits -                * of this field are the length of the packet payload
> in bytes and the higher -              * 4 bits are the timestamping enable field.
> +              * When transmitting an Ethernet packet, the PTP_TSYNC module +          *
> requires a DMA_Length_Word field associated with the packet. +                 * The
> lower 12 bits of this field are the length of the packet +             * payload
> in bytes and the higher 4 bits are the timestamping +          * enable field.
>                */
>               if (shtx->hardware)
>                       *data |= 0x1000;
> @@ -1011,7 +1040,7 @@ static int bfin_mac_hard_start_xmit(struct
> sk_buff *skb,
>               current_tx_ptr->desc_a.start_addr = (u32)data;
>               /* this is important! */
>               blackfin_dcache_flush_range((u32)data,
> -                             (u32)((u8 *)data + skb->len + 4));
> +                                         (u32)((u8 *)data + skb->len + 4));
>       } else {
>               *((u16 *)(current_tx_ptr->packet)) = (u16)(skb->len);
>               /* enable timestamping for the sent packet */ @@ -1063,7
> +1092,8 @@ out:
>
>  #define IP_HEADER_OFF  0
>  #define RX_ERROR_MASK (RX_LONG | RX_ALIGN | RX_CRC | RX_LEN | \
> -     RX_FRAG | RX_ADDR | RX_DMAO | RX_PHY | RX_LATE | RX_RANGE)
> +                    RX_FRAG | RX_ADDR | RX_DMAO | RX_PHY | \
> +                    RX_LATE | RX_RANGE)
>
>  static void bfin_mac_rx(struct net_device *dev)  { @@ -1079,8 +1109,7
>  @@ static void bfin_mac_rx(struct net_device *dev)    * we which case we
>  simply drop the packet        */     if (current_rx_ptr->status.status_word &
>  RX_ERROR_MASK) {
> -             printk(KERN_NOTICE DRV_NAME
> -                    ": rx: receive error - packet dropped\n");
> +             netdev_notice(dev, "rx: receive error - packet dropped\n");
>               dev->stats.rx_dropped++;                goto out;       } @@ -1088,20 +1117,12 @@
>  static void bfin_mac_rx(struct net_device *dev)      /* allocate a new skb
>  for next time receive */     skb = current_rx_ptr->skb;
> -     new_skb = dev_alloc_skb(PKT_BUF_SZ + NET_IP_ALIGN);
> +     new_skb = bfin_alloc_skb();
>       if (!new_skb) {
> -             printk(KERN_NOTICE DRV_NAME
> -                    ": rx: low on mem - packet dropped\n");
> +             netdev_notice(dev, "rx: low on mem - packet dropped\n");
>               dev->stats.rx_dropped++;
>               goto out;
>       }
> -     /* reserve 2 bytes for RXDWA padding */ -       skb_reserve(new_skb,
> NET_IP_ALIGN); -      /* Invidate the data cache of skb->data range when it
> is write back -        * cache. It will prevent overwritting the new data from
> DMA -  */ -   blackfin_dcache_invalidate_range((unsigned
> long)new_skb->head, -                                  (unsigned long)new_skb->end);
>
>       current_rx_ptr->skb = new_skb;
>       current_rx_ptr->desc_a.start_addr = (unsigned long)new_skb->data
> - 2; @@ -1116,25 +1137,28 @@ static void bfin_mac_rx(struct net_device
> *dev)
>       bfin_rx_hwtstamp(dev, skb);
>
>  #if defined(BFIN_MAC_CSUM_OFFLOAD)
> -     /* Checksum offloading only works for IPv4 packets with the standard
> IP header -    * length of 20 bytes, because the blackfin MAC checksum
> calculation is -       * based on that assumption. We must NOT use the
> calculated checksum if our -   * IP version or header break that
> assumption. + /* Checksum offloading only works for IPv4 packets with
> the standard +         * IP header length of 20 bytes, because the blackfin MAC
> checksum +     * calculation is based on that assumption. We must NOT use
> the +  * calculated checksum if our IP version or header break that +  *
> assumption.
>        */
>       if (skb->data[IP_HEADER_OFF] == 0x45) {
>               skb->csum = current_rx_ptr->status.ip_payload_csum;
>               /*
> -              * Deduce Ethernet FCS from hardware generated IP payload checksum.
> -              * IP checksum is based on 16-bit one's complement algorithm. -          *
> To deduce a value from checksum is equal to add its inversion. -               * If
> the IP payload len is odd, the inversed FCS should also -              * begin from
> odd address and leave first byte zero. +               * Deduce Ethernet FCS from
> hardware generated IP payload +                * checksum.  IP checksum is based on
> 16-bit one's complement +              * algorithm.  To deduce a value from
> checksum is equal to +                 * add its inversion.  If the IP payload len is
> odd, the +             * inversed FCS should also begin from odd address and leave
> +              * first byte zero.
>>               */             if (skb->len % 2) {                     fcs[0] = 0;                     for (i = 0; i <
>> ETH_FCS_LEN; i++)                            fcs[i + 1] = ~skb->data[skb->len + i];
>> -                    skb->csum = csum_partial(fcs, ETH_FCS_LEN + 1, skb- csum);
> +                     skb->csum = csum_partial(fcs, ETH_FCS_LEN + 1,
> +                                              skb->csum);
>               } else {                        for (i = 0; i < ETH_FCS_LEN; i++)                               fcs[i] =
>  ~skb->data[skb->len + i]; @@ -1209,7 +1233,7 @@ static int
>  bfin_mac_enable(void)        int ret;        u32 opmode;
> -     pr_debug("%s: %s\n", DRV_NAME, __func__);
> +     pr_debug("%s\n", __func__);
>
>       /* Set RX DMA */
>       bfin_write_DMA1_NEXT_DESC_PTR(&(rx_list_head->desc_a));
> @@ -1251,7 +1275,7 @@ static void bfin_mac_timeout(struct net_device
> *dev)  {
>       struct bfin_mac_local *lp = netdev_priv(dev);
> -     pr_debug("%s: %s\n", dev->name, __func__);
> +     netdev_dbg(dev, "%s\n", __func__);
>
>       bfin_mac_disable();
> @@ -1318,7 +1342,7 @@ static void bfin_mac_set_multicast_list(struct
> net_device *dev)
>       u32 sysctl;
>
>       if (dev->flags & IFF_PROMISC) {
> -             printk(KERN_INFO "%s: set to promisc mode\n", dev->name);
> +             netdev_info(dev, "set to promisc mode\n");
>               sysctl = bfin_read_EMAC_OPMODE();
>               sysctl |= PR;
>               bfin_write_EMAC_OPMODE(sysctl);
> @@ -1372,7 +1396,7 @@ static int bfin_mac_open(struct net_device *dev)
> {
>       struct bfin_mac_local *lp = netdev_priv(dev);
>       int ret;
> -     pr_debug("%s: %s\n", dev->name, __func__);
> +     netdev_dbg(dev, "%s\n", __func__);
>
>       /*       * Check that the address is valid.  If its not, refuse @@ -
>  1380,7 +1404,7 @@ static int bfin_mac_open(struct net_device *dev)    *
>  address using ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx        */     if
>  (!is_valid_ether_addr(dev->dev_addr)) {
> -             printk(KERN_WARNING DRV_NAME ": no valid ethernet hw addr\n");
> +             netdev_warn(dev, "no valid ethernet hw addr\n");
>               return -EINVAL;
>       }
> @@ -1398,7 +1422,7 @@ static int bfin_mac_open(struct net_device *dev)
>       ret = bfin_mac_enable();
>       if (ret)
>               return ret;
> -     pr_debug("hardware init finished\n");
> +     netdev_dbg(dev, "hardware init finished\n");
>
>       netif_start_queue(dev);
>       netif_carrier_on(dev);
> @@ -1414,7 +1438,7 @@ static int bfin_mac_open(struct net_device *dev)
> static int bfin_mac_close(struct net_device *dev)  {
>       struct bfin_mac_local *lp = netdev_priv(dev);
> -     pr_debug("%s: %s\n", dev->name, __func__);
> +     netdev_dbg(dev, "%s\n", __func__);
>
>       netif_stop_queue(dev);
>       netif_carrier_off(dev);
> @@ -1464,9 +1488,7 @@ static int __devinit bfin_mac_probe(struct
> platform_device *pdev)
>       lp = netdev_priv(ndev);
>       lp->ndev = ndev;
> -     /* Grab the MAC address in the MAC */ - *(__le32 *)
> (&(ndev->dev_addr[0])) = cpu_to_le32(bfin_read_EMAC_ADDRLO());
> -     *(__le16 *) (&(ndev->dev_addr[4])) = cpu_to_le16((u16)
> bfin_read_EMAC_ADDRHI()); +   get_mac_addr(ndev->dev_addr);
>
>       /* probe mac */
>       /*todo: how to proble? which is revision_register */ @@ -1526,8
> +1548,8 @@ static int __devinit bfin_mac_probe(struct platform_device
> *pdev)
>
>       /* now, enable interrupts */
>       /* register irq handler */
> -     rc = request_irq(IRQ_MAC_RX, bfin_mac_interrupt,
> -                     IRQF_DISABLED, "EMAC_RX", ndev);
> +     rc = request_irq(IRQ_MAC_RX, bfin_mac_interrupt, IRQF_DISABLED,
> +                      "EMAC_RX", ndev);
>       if (rc) {
>               dev_err(&pdev->dev, "Cannot request Blackfin MAC RX IRQ!\n");
>               rc = -EBUSY;
> @@ -1647,7 +1669,7 @@ static int __devinit bfin_mii_bus_probe(struct
> platform_device *pdev)
>       miibus->parent = &pdev->dev;
>       miibus->name = "bfin_mii_bus";
>       snprintf(miibus->id, MII_BUS_ID_SIZE, "0");
> -     miibus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
> +     miibus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
>       if (miibus->irq == NULL)                goto out_err_alloc;     for (i = 0; i <
>  PHY_MAX_ADDR; ++i) @@ -1674,6 +1696,7 @@ out_err_alloc: static int
>  __devexit bfin_mii_bus_remove(struct platform_device *pdev) {        struct
>  mii_bus *miibus = platform_get_drvdata(pdev); +
>       platform_set_drvdata(pdev, NULL);       mdiobus_unregister(miibus);
>       kfree(miibus->irq);
> @@ -1698,17 +1721,15 @@ static struct platform_driver bfin_mac_driver
> = {
>       .suspend = bfin_mac_suspend,
>       .driver = {
>               .name = DRV_NAME,
> -             .owner  = THIS_MODULE,
> +             .owner = THIS_MODULE,
>       },
>  };
>
>  static int __init bfin_mac_init(void)  {
> -     int ret;
> -     ret = platform_driver_register(&bfin_mii_bus_driver);
> -     if (!ret)
> -             return platform_driver_register(&bfin_mac_driver);
> -     return -ENODEV;
> +     if (platform_driver_register(&bfin_mii_bus_driver))
> +             return -ENODEV;
> +     return platform_driver_register(&bfin_mac_driver);
>  }
>
>  module_init(bfin_mac_init);
> @@ -1720,4 +1741,3 @@ static void __exit bfin_mac_cleanup(void)  }
>
>  module_exit(bfin_mac_cleanup);
> -
>

Greetings,
Michael

Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 4036 Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif



^ permalink raw reply

* [GIT PULL net-next-2.6] vhost-net patchset for 2.6.36
From: Michael S. Tsirkin @ 2010-07-28 13:32 UTC (permalink / raw)
  To: David Miller; +Cc: kvm, virtualization, netdev, linux-kernel, krkumar2
In-Reply-To: <20100701164127.GA3199@redhat.com>

David,
The following tree includes the current vhost-net patchset.
Please merge it for 2.6.36.
Thanks!

The following changes since commit 4cfa580e7eebb8694b875d2caff3b989ada2efac:

  r6040: Fix args to phy_mii_ioctl(). (2010-07-21 21:10:49 -0700)

are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git vhost-net-next

David Stevens (1):
      vhost-net: mergeable buffers support

Michael S. Tsirkin (1):
      vhost: apply cgroup to vhost workers

Sridhar Samudrala (1):
      cgroups: Add an API to attach a task to current task's cgroup

Tejun Heo (1):
      vhost: replace vhost_workqueue with per-vhost kthread

 drivers/vhost/net.c    |  293 +++++++++++++++++++++++++++++++++++++++++-------
 drivers/vhost/vhost.c  |  228 ++++++++++++++++++++++++++++++++-----
 drivers/vhost/vhost.h  |   55 ++++++---
 include/linux/cgroup.h |    7 +
 kernel/cgroup.c        |   23 ++++
 5 files changed, 515 insertions(+), 91 deletions(-)


^ permalink raw reply

* Problem with rtl8192su staging driver
From: Jose Alberto Reguero @ 2010-07-28 15:02 UTC (permalink / raw)
  To: netdev

I have a problem with rtl8192su driver. When transmitting the rate is about 10 
Mbytes, but when receiving the rate is about 2 Mbytes. Also I noticed that the 
rx stats don't reflect the correct data. That is with kernel 2.6.34 and with a 
snapshot of rtl8192su driver taken from linux-next.
How I can debug that to find where is the problem?

Jose Alberto



^ permalink raw reply

* Re: [Uclinux-dist-devel] [PATCH net-next] drivers/net/bfin_mac.c: Use pr_fmt, netdev_<level>
From: Mike Frysinger @ 2010-07-28 15:36 UTC (permalink / raw)
  To: Joe Perches; +Cc: Michael Hennerich, uclinux-dist-devel, LKML, netdev
In-Reply-To: <1280311240.24054.103.camel@Joe-Laptop.home>

On Wed, Jul 28, 2010 at 06:00, Joe Perches wrote:
> On Wed, 2010-07-28 at 03:50 -0400, Mike Frysinger wrote:
>> On Tue, Jul 27, 2010 at 15:22, Joe Perches wrote:
>> > $ ./scripts/checkpatch.pl -f drivers/net/bfin_mac.c | grep "^total:"
>> > total: 2 errors, 25 warnings, 1723 lines checked
>> > $ ./scripts/checkpatch.pl -f drivers/net/bfin_mac.c | grep "^total:"
>> > total: 0 errors, 0 warnings, 1743 lines checked
>> i dislike the mixing of whitespace and useful changes
>> if they were split, and they worked, then i wouldnt have a problem with them
>
> Is that a nak or a dislike?

if you arent going to bother fixing things, then i guess it's a NAK ;)

> Also, is Michael Hennerich actually the maintainer for bfin_mac?
> He had been  listed as MAINTAINER for over a year but he hasn't
> ever written or acked a patch for this file.

i dont know what log you're reading, but i see Michael making plenty
of changes to this driver
-mike

^ permalink raw reply

* [PATCH] bridge: add rcu_read_lock
From: Stephen Hemminger @ 2010-07-28 16:57 UTC (permalink / raw)
  To: Johannes Berg, David Miller; +Cc: paulmck, netdev
In-Reply-To: <1280302431.3684.0.camel@jlt3.sipsolutions.net>

Long ago, when bridge was converted to RCU, rcu lock was equivalent
to having preempt disabled. RCU has changed a lot since then and
bridge code was still assuming the since transmit was called with
bottom half disabled, it was RCU safe.

In addition to fixing the code, update the comments about
locking to match current state as well.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>


---
 net/bridge/br_device.c   |    4 +++-
 net/bridge/br_fdb.c      |    2 +-
 net/bridge/br_input.c    |    7 +++----
 net/bridge/br_stp_bpdu.c |    2 +-
 4 files changed, 8 insertions(+), 7 deletions(-)

--- a/net/bridge/br_device.c	2010-07-27 08:57:43.169399349 -0700
+++ b/net/bridge/br_device.c	2010-07-27 13:57:20.278665500 -0700
@@ -22,7 +22,7 @@
 #include <asm/uaccess.h>
 #include "br_private.h"
 
-/* net device transmit always called with no BH (preempt_disabled) */
+/* net device transmit always called with BH disabled */
 netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	struct net_bridge *br = netdev_priv(dev);
@@ -48,6 +48,7 @@ netdev_tx_t br_dev_xmit(struct sk_buff *
 	skb_reset_mac_header(skb);
 	skb_pull(skb, ETH_HLEN);
 
+	rcu_read_lock();
 	if (is_multicast_ether_addr(dest)) {
 		if (unlikely(netpoll_tx_running(dev))) {
 			br_flood_deliver(br, skb);
@@ -67,6 +68,7 @@ netdev_tx_t br_dev_xmit(struct sk_buff *
 		br_flood_deliver(br, skb);
 
 out:
+	rcu_read_unlock();
 	return NETDEV_TX_OK;
 }
 
--- a/net/bridge/br_fdb.c	2010-07-27 11:18:30.815320981 -0700
+++ b/net/bridge/br_fdb.c	2010-07-27 11:18:59.597710975 -0700
@@ -214,7 +214,7 @@ void br_fdb_delete_by_port(struct net_br
 	spin_unlock_bh(&br->hash_lock);
 }
 
-/* No locking or refcounting, assumes caller has no preempt (rcu_read_lock) */
+/* No locking or refcounting, assumes caller has rcu_read_lock */
 struct net_bridge_fdb_entry *__br_fdb_get(struct net_bridge *br,
 					  const unsigned char *addr)
 {
--- a/net/bridge/br_input.c	2010-07-27 11:19:05.266181492 -0700
+++ b/net/bridge/br_input.c	2010-07-27 11:19:29.148163149 -0700
@@ -39,7 +39,7 @@ static int br_pass_frame_up(struct sk_bu
 		       netif_receive_skb);
 }
 
-/* note: already called with rcu_read_lock (preempt_disabled) */
+/* note: already called with rcu_read_lock */
 int br_handle_frame_finish(struct sk_buff *skb)
 {
 	const unsigned char *dest = eth_hdr(skb)->h_dest;
@@ -110,7 +110,7 @@ drop:
 	goto out;
 }
 
-/* note: already called with rcu_read_lock (preempt_disabled) */
+/* note: already called with rcu_read_lock */
 static int br_handle_local_finish(struct sk_buff *skb)
 {
 	struct net_bridge_port *p = br_port_get_rcu(skb->dev);
@@ -133,8 +133,7 @@ static inline int is_link_local(const un
 
 /*
  * Return NULL if skb is handled
- * note: already called with rcu_read_lock (preempt_disabled) from
- * netif_receive_skb
+ * note: already called with rcu_read_lock from netif_receive_skb
  */
 struct sk_buff *br_handle_frame(struct sk_buff *skb)
 {
--- a/net/bridge/br_stp_bpdu.c	2010-07-27 11:19:34.092573294 -0700
+++ b/net/bridge/br_stp_bpdu.c	2010-07-27 11:19:40.725123403 -0700
@@ -131,7 +131,7 @@ void br_send_tcn_bpdu(struct net_bridge_
 /*
  * Called from llc.
  *
- * NO locks, but rcu_read_lock (preempt_disabled)
+ * NO locks, but rcu_read_lock
  */
 void br_stp_rcv(const struct stp_proto *proto, struct sk_buff *skb,
 		struct net_device *dev)

^ permalink raw reply

* Re: nfs client hang
From: Chuck Lever @ 2010-07-28 17:37 UTC (permalink / raw)
  To: Andy Chittenden
  Cc: Eric Dumazet,
	Linux Kernel Mailing List (linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org),
	Trond Myklebust, netdev, Linux NFS Mailing List
In-Reply-To: <ABFC24E4C13D81489F7F624E14891C8607DDF8D3D0-yEvK6Dt055VEbG1eAH4Z+rwY7bzXMFrTPsgEledslx8@public.gmane.org>

On 07/28/10 03:24 AM, Andy Chittenden wrote:
> resending as it seems to have been corrupted on LKML!
>
>> The RPC client marks the socket closed. and the linger timeout is
>> cancelled.  At this point, sk_shutdown should be set to zero, correct?
>> I don't see an xs_error_report() call here, which would confirm that the
>> socket took a trip through tcp_disconnect().
>
> From my reading of tcp_disconnect(), it calls sk->sk_error_report(sk)
> unconditionally so as there's no xs_error_report(), that surely means
> the exact opposite: tcp_disconnect() wasn't called. If it's not
> called, sk_shutdown is not cleared. And my revised tracing confirmed
> that it was set to SEND_SHUTDOWN.

Sorry, that's what I meant above.

An xs_error_report() debugging message at that point in the log would 
confirm that the socket took a trip through tcp_disconnect().  But I 
don't see such a message.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: noqueue on bonding devices
From: Jay Vosburgh @ 2010-07-28 17:37 UTC (permalink / raw)
  To: Simon Horman; +Cc: netdev
In-Reply-To: <20100728083217.GB20227@verge.net.au>

Simon Horman <horms@verge.net.au> wrote:

>Hi Jay, Hi All,
>
>I would just to wonder out loud if it is intentional that bonding
>devices default to noqueue, whereas for instance ethernet devices
>default to a pfifo_fast with qlen 1000.

	Yes, it is.

>The reason that I ask, is that when setting up some bandwidth
>control using tc I encountered some strange behaviour which
>I eventually tracked down to the queue-length of the qdiscs being 1p -
>inherited from noqueue, as opposed to 1000p which would occur
>on an ethernet device.
>
>Its trivial to work around, by either altering the txqueuelen on
>the bonding device before adding the qdisc or by manually setting
>the qlen of the qdisc. But it did take us a while to determine the
>cause of the problem we were seeing. And as it seems inconsistent
>I'm interested to know why this is the case.

	Software-only virtual devices (loopback, bonding, bridge, vlan,
etc) typically have no transmit queue because, well, the device does no
queueing.  Meaning that there is no flow control infrastructure in the
software device; bonding, et al, won't ever flow control (call
netif_stop_queue to temporarily suspend transmit) or accumulate packets
on a transmit queue.

	Hardware ethernet devices set a queue length because it is
meaningful for them to do so.  When their hardware transmit ring fills
up, they will assert flow control, and stop accepting new packets for
transmit.  Packets then accumulate in the software transmit queue, and
when the device unblocks, those packets are ready to go.  When under
continuous load, hardware network devices typically free up ring entries
in blocks (not one at a time), so the software transmit queue helps to
smooth out the chunkiness of the hardware driver's processing, minimize
dropped packets, etc.

	It's certainly possible to add a queue and qdisc to a bonding
device, and is reasonable to do if you want to do packet scheduling with
tc and friends.  In this case, the queue is really just for the tc
actions to connect to; the queue won't accumulate packets on account of
the driver (but could if the scheduler, e.g., rate limits).

>On an unrelated note, MAINTANERS lists bonding-devel@lists.sourceforge.net
>but the (recent) archives seem to be entirely spam.  Is the MAINTAINERS
>file correct?

	Yah, I should probably change that; the spam is pretty heavy,
and there isn't much I can do to limit it.

	-J

---
	-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com

^ permalink raw reply

* Re: br_forward.c - rcu dereference warning
From: David Miller @ 2010-07-28 17:39 UTC (permalink / raw)
  To: johannes; +Cc: shemminger, paulmck, netdev
In-Reply-To: <1280302431.3684.0.camel@jlt3.sipsolutions.net>

From: Johannes Berg <johannes@sipsolutions.net>
Date: Wed, 28 Jul 2010 09:33:51 +0200

> On Tue, 2010-07-27 at 13:42 -0700, Stephen Hemminger wrote:
> 
>> > 
>> > Did you want me to test the patch?
>> 
>> Yes please, I can make sure it works, but not that it gets rid
>> of your error
> 
> Yes, it fixed it, thanks.

I fixed up the comment thinko Johannes noticed, added a tested-by tag,
and applied this to net-2.6

Thanks!

^ permalink raw reply

* Re: [PATCH] bridge: add rcu_read_lock
From: David Miller @ 2010-07-28 17:52 UTC (permalink / raw)
  To: shemminger; +Cc: johannes, paulmck, netdev
In-Reply-To: <20100728095730.11450561@nehalam>

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Wed, 28 Jul 2010 09:57:30 -0700

> Long ago, when bridge was converted to RCU, rcu lock was equivalent
> to having preempt disabled. RCU has changed a lot since then and
> bridge code was still assuming the since transmit was called with
> bottom half disabled, it was RCU safe.
> 
> In addition to fixing the code, update the comments about
> locking to match current state as well.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

As I stated in another email I added the original commit.

This version still didn't apply to net-2.6 and also you failed
to add a tested-by tag for Johannes to the commit message, which
I also did alongside backporting the original patch to net-2.6

^ permalink raw reply

* Re: [PATCH] bridge: add rcu_read_lock
From: Stephen Hemminger @ 2010-07-28 18:01 UTC (permalink / raw)
  To: David Miller; +Cc: johannes, paulmck, netdev
In-Reply-To: <20100728.105209.25114107.davem@davemloft.net>

On Wed, 28 Jul 2010 10:52:09 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:

> From: Stephen Hemminger <shemminger@vyatta.com>
> Date: Wed, 28 Jul 2010 09:57:30 -0700
> 
> > Long ago, when bridge was converted to RCU, rcu lock was equivalent
> > to having preempt disabled. RCU has changed a lot since then and
> > bridge code was still assuming the since transmit was called with
> > bottom half disabled, it was RCU safe.
> > 
> > In addition to fixing the code, update the comments about
> > locking to match current state as well.
> > 
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> 
> As I stated in another email I added the original commit.
> 
> This version still didn't apply to net-2.6 and also you failed
> to add a tested-by tag for Johannes to the commit message, which
> I also did alongside backporting the original patch to net-2.6

I didn't see yours, if you look at the date it was ships in the night.


-- 

^ permalink raw reply

* [PATCH] ucc_geth: fix UCC device number in debug message
From: Sergey Matyukevich @ 2010-07-28 18:05 UTC (permalink / raw)
  To: netdev; +Cc: Li Yang, Sergey Matyukevich

This patch contains a fix for UCC device number in verbose debug message.

Signed-off-by: Sergey Matyukevich <geomatsi@gmail.com>

---
 drivers/net/ucc_geth.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 807470e..ca1f36d 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -594,7 +594,7 @@ static void dump_regs(struct ucc_geth_private *ugeth)
 {
 	int i;
 
-	ugeth_info("UCC%d Geth registers:", ugeth->ug_info->uf_info.ucc_num);
+	ugeth_info("UCC%d Geth registers:", ugeth->ug_info->uf_info.ucc_num + 1);
 	ugeth_info("Base address: 0x%08x", (u32) ugeth->ug_regs);
 
 	ugeth_info("maccfg1    : addr - 0x%08x, val - 0x%08x",
-- 
1.6.2.5


^ permalink raw reply related

* [PATCH net-next] bonding: take rtnl in bond_loadbalance_arp_mon
From: Andy Gospodarek @ 2010-07-28 21:04 UTC (permalink / raw)
  To: netdev; +Cc: fubar

With the latest code in net-next-2.6 the following (and similar) are
spewed when using arp monitoring and balance-alb.

RTNL: assertion failed at drivers/net/bonding/bond_alb.c (1663)
Pid: 1653, comm: bond0 Tainted: G        W   2.6.35-rc1-net-next #9
Call Trace:
 [<ffffffffa0385bb3>] bond_alb_handle_active_change+0x10e/0x17f [bonding]
 [<ffffffffa037f2e4>] bond_change_active_slave+0x20c/0x42f [bonding]
 [<ffffffffa0380062>] ? bond_loadbalance_arp_mon+0x1d8/0x222 [bonding]
 [<ffffffffa037f95a>] bond_select_active_slave+0xe0/0x10e [bonding]
 [<ffffffffa038006a>] bond_loadbalance_arp_mon+0x1e0/0x222 [bonding]
 [<ffffffff81065f7d>] worker_thread+0x26a/0x363
 [<ffffffff81065f25>] ? worker_thread+0x212/0x363
 [<ffffffff81048b19>] ? finish_task_switch+0x70/0xe4
 [<ffffffff81048aa9>] ? finish_task_switch+0x0/0xe4
 [<ffffffffa037fe8a>] ? bond_loadbalance_arp_mon+0x0/0x222 [bonding]
 [<ffffffff8106a45a>] ? autoremove_wake_function+0x0/0x39
 [<ffffffff81065d13>] ? worker_thread+0x0/0x363
 [<ffffffff81069f98>] kthread+0x9a/0xa2
 [<ffffffff8107b4f7>] ? trace_hardirqs_on_caller+0x111/0x135
 [<ffffffff8100aa64>] kernel_thread_helper+0x4/0x10
 [<ffffffff81475e50>] ? restore_args+0x0/0x30
 [<ffffffff81069efe>] ? kthread+0x0/0xa2
 [<ffffffff8100aa60>] ? kernel_thread_helper+0x0/0x10

This is essentially the same thing done in bond_activebackup_arp_mon to
address not holding rtnl when needed.

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>

---
 drivers/net/bonding/bond_main.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 2cc4cfc..d624cf9 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2857,11 +2857,17 @@ void bond_loadbalance_arp_mon(struct work_struct *work)
 	}
 
 	if (do_failover) {
+		read_unlock(&bond->lock);
+		rtnl_lock();
+		read_lock(&bond->lock);
 		write_lock_bh(&bond->curr_slave_lock);
 
 		bond_select_active_slave(bond);
 
 		write_unlock_bh(&bond->curr_slave_lock);
+		read_unlock(&bond->lock);
+		rtnl_unlock();
+		read_lock(&bond->lock);
 	}
 
 re_arm:
-- 
1.7.0.1


^ permalink raw reply related

* Re: [PATCH net-next] bonding: take rtnl in bond_loadbalance_arp_mon
From: Jay Vosburgh @ 2010-07-28 21:39 UTC (permalink / raw)
  To: Andy Gospodarek; +Cc: netdev
In-Reply-To: <1280351076-19973-1-git-send-email-andy@greyhouse.net>

Andy Gospodarek <andy@greyhouse.net> wrote:

>With the latest code in net-next-2.6 the following (and similar) are
>spewed when using arp monitoring and balance-alb.

	Does the ARP monitor function correctly for balance-alb?  My
recollection is that the ARP monitor probes interfere with the tailored
ARP messages that balance-alb sends.  The bond_check_params function
disallows setting arp_interval (it forces miimon on).  I suspect this
nuance was missed when setting up the sysfs code, but if it does work,
then perhaps it is too strict.

	As I recall, I had deliberately left acquiring rtnl out of the
loadbalance_arp_mon function, since none of the modes that used it
required rtnl for failover.

	-J

>RTNL: assertion failed at drivers/net/bonding/bond_alb.c (1663)
>Pid: 1653, comm: bond0 Tainted: G        W   2.6.35-rc1-net-next #9
>Call Trace:
> [<ffffffffa0385bb3>] bond_alb_handle_active_change+0x10e/0x17f [bonding]
> [<ffffffffa037f2e4>] bond_change_active_slave+0x20c/0x42f [bonding]
> [<ffffffffa0380062>] ? bond_loadbalance_arp_mon+0x1d8/0x222 [bonding]
> [<ffffffffa037f95a>] bond_select_active_slave+0xe0/0x10e [bonding]
> [<ffffffffa038006a>] bond_loadbalance_arp_mon+0x1e0/0x222 [bonding]
> [<ffffffff81065f7d>] worker_thread+0x26a/0x363
> [<ffffffff81065f25>] ? worker_thread+0x212/0x363
> [<ffffffff81048b19>] ? finish_task_switch+0x70/0xe4
> [<ffffffff81048aa9>] ? finish_task_switch+0x0/0xe4
> [<ffffffffa037fe8a>] ? bond_loadbalance_arp_mon+0x0/0x222 [bonding]
> [<ffffffff8106a45a>] ? autoremove_wake_function+0x0/0x39
> [<ffffffff81065d13>] ? worker_thread+0x0/0x363
> [<ffffffff81069f98>] kthread+0x9a/0xa2
> [<ffffffff8107b4f7>] ? trace_hardirqs_on_caller+0x111/0x135
> [<ffffffff8100aa64>] kernel_thread_helper+0x4/0x10
> [<ffffffff81475e50>] ? restore_args+0x0/0x30
> [<ffffffff81069efe>] ? kthread+0x0/0xa2
> [<ffffffff8100aa60>] ? kernel_thread_helper+0x0/0x10
>
>This is essentially the same thing done in bond_activebackup_arp_mon to
>address not holding rtnl when needed.
>
>Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
>
>---
> drivers/net/bonding/bond_main.c |    6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index 2cc4cfc..d624cf9 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -2857,11 +2857,17 @@ void bond_loadbalance_arp_mon(struct work_struct *work)
> 	}
>
> 	if (do_failover) {
>+		read_unlock(&bond->lock);
>+		rtnl_lock();
>+		read_lock(&bond->lock);
> 		write_lock_bh(&bond->curr_slave_lock);
>
> 		bond_select_active_slave(bond);
>
> 		write_unlock_bh(&bond->curr_slave_lock);
>+		read_unlock(&bond->lock);
>+		rtnl_unlock();
>+		read_lock(&bond->lock);
> 	}
>
> re_arm:
>-- 
>1.7.0.1
>

---
	-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com

^ permalink raw reply

* Re: noqueue on bonding devices
From: Simon Horman @ 2010-07-28 23:42 UTC (permalink / raw)
  To: Jay Vosburgh; +Cc: netdev
In-Reply-To: <16360.1280338676@death>

On Wed, Jul 28, 2010 at 10:37:56AM -0700, Jay Vosburgh wrote:
> Simon Horman <horms@verge.net.au> wrote:
> 
> >Hi Jay, Hi All,
> >
> >I would just to wonder out loud if it is intentional that bonding
> >devices default to noqueue, whereas for instance ethernet devices
> >default to a pfifo_fast with qlen 1000.
> 
> 	Yes, it is.
> 
> >The reason that I ask, is that when setting up some bandwidth
> >control using tc I encountered some strange behaviour which
> >I eventually tracked down to the queue-length of the qdiscs being 1p -
> >inherited from noqueue, as opposed to 1000p which would occur
> >on an ethernet device.
> >
> >Its trivial to work around, by either altering the txqueuelen on
> >the bonding device before adding the qdisc or by manually setting
> >the qlen of the qdisc. But it did take us a while to determine the
> >cause of the problem we were seeing. And as it seems inconsistent
> >I'm interested to know why this is the case.
> 
> 	Software-only virtual devices (loopback, bonding, bridge, vlan,
> etc) typically have no transmit queue because, well, the device does no
> queueing.  Meaning that there is no flow control infrastructure in the
> software device; bonding, et al, won't ever flow control (call
> netif_stop_queue to temporarily suspend transmit) or accumulate packets
> on a transmit queue.
> 
> 	Hardware ethernet devices set a queue length because it is
> meaningful for them to do so.  When their hardware transmit ring fills
> up, they will assert flow control, and stop accepting new packets for
> transmit.  Packets then accumulate in the software transmit queue, and
> when the device unblocks, those packets are ready to go.  When under
> continuous load, hardware network devices typically free up ring entries
> in blocks (not one at a time), so the software transmit queue helps to
> smooth out the chunkiness of the hardware driver's processing, minimize
> dropped packets, etc.
> 
> 	It's certainly possible to add a queue and qdisc to a bonding
> device, and is reasonable to do if you want to do packet scheduling with
> tc and friends.  In this case, the queue is really just for the tc
> actions to connect to; the queue won't accumulate packets on account of
> the driver (but could if the scheduler, e.g., rate limits).

Thanks for the detailed explanation, much appreciated.

^ permalink raw reply

* linux-next: manual merge of the net tree with the net-current tree
From: Stephen Rothwell @ 2010-07-29  1:05 UTC (permalink / raw)
  To: David Miller, netdev
  Cc: linux-next, linux-kernel, stephen hemminger, Jiri Pirko

Hi all,

Today's linux-next merge of the net tree got a conflict in
net/bridge/br_input.c between commit
eeaf61d8891f9c9ed12c1a667e72bf83f0857954 ("bridge: add rcu_read_lock on
transmit") from the net-current tree and commit
ab95bfe01f9872459c8678572ccadbf646badad0 ("net: replace hooks in
__netif_receive_skb V5") from the net tree.

Just overlapping changes in a comment.  I fixed it up (see below) and can
carry the fix for a while.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc net/bridge/br_input.c
index 114365c,5fc1c5b..0000000
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@@ -108,13 -110,12 +110,12 @@@ drop
  	goto out;
  }
  
 -/* note: already called with rcu_read_lock (preempt_disabled) */
 +/* note: already called with rcu_read_lock */
  static int br_handle_local_finish(struct sk_buff *skb)
  {
- 	struct net_bridge_port *p = rcu_dereference(skb->dev->br_port);
+ 	struct net_bridge_port *p = br_port_get_rcu(skb->dev);
  
- 	if (p)
- 		br_fdb_update(p->br, p, eth_hdr(skb)->h_source);
+ 	br_fdb_update(p->br, p, eth_hdr(skb)->h_source);
  	return 0;	 /* process further */
  }
  
@@@ -131,12 -132,13 +132,12 @@@ static inline int is_link_local(const u
  }
  
  /*
-  * Called via br_handle_frame_hook.
   * Return NULL if skb is handled
-  * note: already called with rcu_read_lock
 - * note: already called with rcu_read_lock (preempt_disabled) from
 - * netif_receive_skb
++ * note: already called with rcu_read_lock from netif_receive_skb
   */
- struct sk_buff *br_handle_frame(struct net_bridge_port *p, struct sk_buff *skb)
+ struct sk_buff *br_handle_frame(struct sk_buff *skb)
  {
+ 	struct net_bridge_port *p;
  	const unsigned char *dest = eth_hdr(skb)->h_dest;
  	int (*rhook)(struct sk_buff *skb);
  

^ permalink raw reply

* Re: [REGRESSION] e1000e stopped working [MANUALLY BISECTED]
From: Jeff Kirsher @ 2010-07-29  1:10 UTC (permalink / raw)
  To: Maxim Levitsky
  Cc: Tantilov, Emil S, netdev@vger.kernel.org, Allan, Bruce W,
	Pieper, Jeffrey E
In-Reply-To: <1280300683.8250.2.camel@maxim-laptop>

On Wed, Jul 28, 2010 at 00:04, Maxim Levitsky <maximlevitsky@gmail.com> wrote:
> On Mon, 2010-07-26 at 03:25 +0300, Maxim Levitsky wrote:
>>
>> This commit, present in net-next, solves the problem:
>>
>> commit 1286950690f0f82ffa504e1e149ee3fdb4c51478
>> Author: Bruce Allan <bruce.w.allan@intel.com>
>> Date:   Mon Jul 26 03:19:38 2010 +0300
>>
>>     e1000e: cleanup e1000_sw_lcd_config_ich8lan()
>>
>>     Do not acquire and release the PHY unnecessarily for parts that return
>>     from this workaround without actually accessing the PHY registers.
>>
>>     Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
>>     Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
>>     Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>>     Signed-off-by: David S. Miller <davem@davemloft.net>
>>
>>
>>
>>
>> Also, the above patch is part of whole series of patches with scary descriptions (that is these fix bugs).
>> If I were you I would send them to Linus for 2.6.35 inclusion too.
>>
>> Best regards,
>>       Maxim Levitsky
>>
>>
>>
> ping
>

Sorry for the delayed response.  I am working on the issue.  Here is
the problem I am having, the patch that fixes the issue you are seeing
is fairly large and is a cleanup to the ich8 function, which as it
stands now, would not be accepted into net-2.6 tree this late into the
-rc cycle.  So, what I looking at is, what specifically fixed the
issue you are seeing that resides in that patch, and come up with a
smaller (acceptable) patch that I can submit to net-2.6 now to resolve
your issue.

I have dedicated most of this evening to finding a resolution to your
issue that will be acceptable for the net-2.6 tree.  As you noted,
there were several patches before this particular commit that may play
some part in the resolution as well, and that is what I will be
looking into.  I greatly appreciate the hard work you have done to
help us resolve this issue, and will make sure you get credit for any
solution I put together to resolve this issue.

-- 
Cheers,
Jeff

^ permalink raw reply

* Re: [PATCH net-next] bonding: take rtnl in bond_loadbalance_arp_mon
From: Andy Gospodarek @ 2010-07-29  1:13 UTC (permalink / raw)
  To: Jay Vosburgh; +Cc: netdev
In-Reply-To: <29111.1280353189@death>

On Wed, Jul 28, 2010 at 02:39:49PM -0700, Jay Vosburgh wrote:
> Andy Gospodarek <andy@greyhouse.net> wrote:
> 
> >With the latest code in net-next-2.6 the following (and similar) are
> >spewed when using arp monitoring and balance-alb.
> 
> 	Does the ARP monitor function correctly for balance-alb?  My
> recollection is that the ARP monitor probes interfere with the tailored
> ARP messages that balance-alb sends.

It seems to work fine here on a few tries (I only use sysfs for
configuration anymore), but it might be blind luck that the addresses
chosen are hashing out correctly to make arp monitoring work.

> The bond_check_params function
> disallows setting arp_interval (it forces miimon on).  I suspect this
> nuance was missed when setting up the sysfs code, but if it does work,
> then perhaps it is too strict.

You are correct, it does.  It is clear that some checks should be added
to the sysfs code and it also seems like some work should be done to
more clearly define what modes support which form of link monitoring (it
doesn't seem to me like balance-rr should support can monitoring in it's
current implementation, but there is no explicit code to check for it in
the sysfs-layer or bond_check_params).

> 	As I recall, I had deliberately left acquiring rtnl out of the
> loadbalance_arp_mon function, since none of the modes that used it
> required rtnl for failover.

Understood.

Based on your comments, at least something like the following should
probably be done.


[PATCH net-next] bonding: prevent sysfs from allowing arp monitoring with alb/tlb

When using module options arp monitoring and balance-alb/balance-tlb
are mutually exclusive options.  Anytime balance-alb/balance-tlb are
enabled mii monitoring is forced to 100ms if not set.  When configuring
via sysfs no checking is currently done.

Handling these cases with sysfs has to be done a bit differently because
we do not have all configuration information available at once.  This
patch will not allow a mode change to balance-alb/balance-tlb if
arp_interval is already non-zero.  It will also not allow the user to
set a non-zero arp_interval value if the mode is already set to
balance-alb/balance-tlb.  They are still mutually exclusive on a
first-come, first serve basis.

Tested with initscripts on Fedora and manual setting via sysfs.

Signed-off-by: Andy Gospodarek <gospo@redhat.com>

---
 drivers/net/bonding/bond_sysfs.c |   37 +++++++++++++++++++++++++------------
 1 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 1a99764..c311aed 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -313,19 +313,26 @@ static ssize_t bonding_store_mode(struct device *d,
 		       bond->dev->name, (int)strlen(buf) - 1, buf);
 		ret = -EINVAL;
 		goto out;
-	} else {
-		if (bond->params.mode == BOND_MODE_8023AD)
-			bond_unset_master_3ad_flags(bond);
+	}
+	if ((new_value == BOND_MODE_ALB ||
+	     new_value == BOND_MODE_TLB) &&
+	    bond->params.arp_interval) {
+		pr_err("%s: %s mode is incompatible with arp monitoring.\n",
+		       bond->dev->name, bond_mode_tbl[new_value].modename);
+		ret = -EINVAL;
+		goto out;
+	}
+	if (bond->params.mode == BOND_MODE_8023AD)
+		bond_unset_master_3ad_flags(bond);
 
-		if (bond->params.mode == BOND_MODE_ALB)
-			bond_unset_master_alb_flags(bond);
+	if (bond->params.mode == BOND_MODE_ALB)
+		bond_unset_master_alb_flags(bond);
 
-		bond->params.mode = new_value;
-		bond_set_mode_ops(bond, bond->params.mode);
-		pr_info("%s: setting mode to %s (%d).\n",
-			bond->dev->name, bond_mode_tbl[new_value].modename,
-		       new_value);
-	}
+	bond->params.mode = new_value;
+	bond_set_mode_ops(bond, bond->params.mode);
+	pr_info("%s: setting mode to %s (%d).\n",
+		bond->dev->name, bond_mode_tbl[new_value].modename,
+		new_value);
 out:
 	return ret;
 }
@@ -510,7 +517,13 @@ static ssize_t bonding_store_arp_interval(struct device *d,
 		ret = -EINVAL;
 		goto out;
 	}
-
+	if (bond->params.mode == BOND_MODE_ALB ||
+	    bond->params.mode == BOND_MODE_TLB) {
+		pr_info("%s: ARP monitoring cannot be used with ALB/TLB. Only MII monitoring is supported on %s.\n",
+			bond->dev->name, bond->dev->name);
+		ret = -EINVAL;
+		goto out;
+	}
 	pr_info("%s: Setting ARP monitoring interval to %d.\n",
 		bond->dev->name, new_value);
 	bond->params.arp_interval = new_value;
-- 
1.7.0.1


^ permalink raw reply related

* linux-next: manual merge of the net tree with the net-current tree
From: Stephen Rothwell @ 2010-07-29  1:19 UTC (permalink / raw)
  To: David Miller, netdev; +Cc: linux-next, linux-kernel, Bruce Allan, Jeff Kirsher

Hi all,

Today's linux-next merge of the net tree got a conflict in
drivers/net/e1000e/hw.h between commit
ff847ac2d3e90edd94674c28bade25ae1e6a2e49 ("") from the net-current tree
and commit d3738bb8203acf8552c3ec8b3447133fc0938ddd ("e1000e: initial
support for 82579 LOMs") from the net tree.

Just context changes. I fixed it up (see below) and can carry the fix for
a while.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/net/e1000e/hw.h
index 664ed58,0cd569a..0000000
--- a/drivers/net/e1000e/hw.h
+++ b/drivers/net/e1000e/hw.h
@@@ -308,8 -312,8 +312,8 @@@ enum e1e_registers 
  #define E1000_KMRNCTRLSTA_INBAND_PARAM	0x9    /* Kumeran InBand Parameters */
  #define E1000_KMRNCTRLSTA_DIAG_NELPBK	0x1000 /* Nearend Loopback mode */
  #define E1000_KMRNCTRLSTA_K1_CONFIG	0x7
 -#define E1000_KMRNCTRLSTA_K1_ENABLE	0x140E
 +#define E1000_KMRNCTRLSTA_K1_ENABLE	0x0002
- #define E1000_KMRNCTRLSTA_K1_DISABLE	0x1400
+ #define E1000_KMRNCTRLSTA_HD_CTRL	0x0002
  
  #define IFE_PHY_EXTENDED_STATUS_CONTROL	0x10
  #define IFE_PHY_SPECIAL_CONTROL		0x11 /* 100BaseTx PHY Special Control */

^ permalink raw reply

* Re: linux-next: manual merge of the net tree with the net-current tree
From: Jeff Kirsher @ 2010-07-29  1:26 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: David Miller, netdev, linux-next, linux-kernel, Bruce Allan
In-Reply-To: <20100729111904.90b148a6.sfr@canb.auug.org.au>

On Wed, Jul 28, 2010 at 18:19, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi all,
>
> Today's linux-next merge of the net tree got a conflict in
> drivers/net/e1000e/hw.h between commit
> ff847ac2d3e90edd94674c28bade25ae1e6a2e49 ("") from the net-current tree
> and commit d3738bb8203acf8552c3ec8b3447133fc0938ddd ("e1000e: initial
> support for 82579 LOMs") from the net tree.
>
> Just context changes. I fixed it up (see below) and can carry the fix for
> a while.
> --
> Cheers,
> Stephen Rothwell                    sfr@canb.auug.org.au
>
> diff --cc drivers/net/e1000e/hw.h
> index 664ed58,0cd569a..0000000
> --- a/drivers/net/e1000e/hw.h
> +++ b/drivers/net/e1000e/hw.h
> @@@ -308,8 -312,8 +312,8 @@@ enum e1e_registers
>  #define E1000_KMRNCTRLSTA_INBAND_PARAM        0x9    /* Kumeran InBand Parameters */
>  #define E1000_KMRNCTRLSTA_DIAG_NELPBK 0x1000 /* Nearend Loopback mode */
>  #define E1000_KMRNCTRLSTA_K1_CONFIG   0x7
>  -#define E1000_KMRNCTRLSTA_K1_ENABLE   0x140E
>  +#define E1000_KMRNCTRLSTA_K1_ENABLE   0x0002
> - #define E1000_KMRNCTRLSTA_K1_DISABLE  0x1400
> + #define E1000_KMRNCTRLSTA_HD_CTRL     0x0002
>
>  #define IFE_PHY_EXTENDED_STATUS_CONTROL       0x10
>  #define IFE_PHY_SPECIAL_CONTROL               0x11 /* 100BaseTx PHY Special Control */
> --

yes, that is fine and expected.  When Dave sync's up is net-next-2.6
tree with net-2.6 tree, this issue will be fixed up.

-- 
Cheers,
Jeff

^ permalink raw reply

* TAHI CN-6-4-1 failed on Linux 2.6.32 kernel
From: Steve Chen @ 2010-07-29  3:20 UTC (permalink / raw)
  To: usagi-users-ctl, netdev

Hello,

The TAHI correspondent node tests CN-6-4-1 (Processing in upper layer
- Echo Checksum) failed for me in the 2.6.32 kernel.  It appears that
the Linux kernel is replying the ICMP echo request in
icmpv6_echo_reply without much checking.  Is this an intentional
non-conformance to RFC3775 section 9.3.1?

Thanks,

Steve

^ permalink raw reply

* linux-next: build failure after merge of the final tree (net tree related)
From: Stephen Rothwell @ 2010-07-29  4:13 UTC (permalink / raw)
  To: David Miller, netdev
  Cc: linux-next, linux-kernel, Dmitry Kravkov, Eilon Greenstein

Hi Dave,

After merging the final tree, today's linux-next build (powerpc
allyesconfig) failed like this:

drivers/net/bnx2x/bnx2x_cmn.c: In function 'bnx2x_start_xmit':
drivers/net/bnx2x/bnx2x_cmn.c:2015: error: implicit declaration of function 'csum_ipv6_magic'

Caused by commit 9f6c925889ad9204c7d1f5ca116d2e5fd6036c72 ("bnx2x: Create
bnx2x_cmn.* files").  See Rule 1 in Documentation/SubmitChecklist. :-)

I applied the following patch for today:

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Thu, 29 Jul 2010 14:07:49 +1000
Subject: [PATCH] net: bnx2x_cmn.c needs net/ip6_checksum.h for csum_ipv6_magic

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/net/bnx2x/bnx2x_cmn.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c
index 30d20c7..02bf710 100644
--- a/drivers/net/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/bnx2x/bnx2x_cmn.c
@@ -19,6 +19,7 @@
 #include <linux/etherdevice.h>
 #include <linux/ip.h>
 #include <linux/ipv6.h>
+#include <net/ip6_checksum.h>
 #include "bnx2x_cmn.h"
 
 #ifdef BCM_VLAN
-- 
1.7.1

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

^ permalink raw reply related

* Re: linux-next: build failure after merge of the final tree (net tree related)
From: David Miller @ 2010-07-29  5:21 UTC (permalink / raw)
  To: sfr; +Cc: netdev, linux-next, linux-kernel, dmitry, eilong
In-Reply-To: <20100729141306.f27fad7a.sfr@canb.auug.org.au>

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Thu, 29 Jul 2010 14:13:06 +1000

> net: bnx2x_cmn.c needs net/ip6_checksum.h for csum_ipv6_magic
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>

Applied, thanks Stephen.

^ permalink raw reply

* Re: linux-next: manual merge of the net tree with the net-current tree
From: Jiri Pirko @ 2010-07-29  5:51 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: David Miller, netdev, linux-next, linux-kernel, stephen hemminger
In-Reply-To: <20100729110504.df0b5791.sfr@canb.auug.org.au>

Looks good to me.

Thu, Jul 29, 2010 at 03:05:04AM CEST, sfr@canb.auug.org.au wrote:
>Hi all,
>
>Today's linux-next merge of the net tree got a conflict in
>net/bridge/br_input.c between commit
>eeaf61d8891f9c9ed12c1a667e72bf83f0857954 ("bridge: add rcu_read_lock on
>transmit") from the net-current tree and commit
>ab95bfe01f9872459c8678572ccadbf646badad0 ("net: replace hooks in
>__netif_receive_skb V5") from the net tree.
>
>Just overlapping changes in a comment.  I fixed it up (see below) and can
>carry the fix for a while.
>-- 
>Cheers,
>Stephen Rothwell                    sfr@canb.auug.org.au
>
>diff --cc net/bridge/br_input.c
>index 114365c,5fc1c5b..0000000
>--- a/net/bridge/br_input.c
>+++ b/net/bridge/br_input.c
>@@@ -108,13 -110,12 +110,12 @@@ drop
>  	goto out;
>  }
>  
> -/* note: already called with rcu_read_lock (preempt_disabled) */
> +/* note: already called with rcu_read_lock */
>  static int br_handle_local_finish(struct sk_buff *skb)
>  {
>- 	struct net_bridge_port *p = rcu_dereference(skb->dev->br_port);
>+ 	struct net_bridge_port *p = br_port_get_rcu(skb->dev);
>  
>- 	if (p)
>- 		br_fdb_update(p->br, p, eth_hdr(skb)->h_source);
>+ 	br_fdb_update(p->br, p, eth_hdr(skb)->h_source);
>  	return 0;	 /* process further */
>  }
>  
>@@@ -131,12 -132,13 +132,12 @@@ static inline int is_link_local(const u
>  }
>  
>  /*
>-  * Called via br_handle_frame_hook.
>   * Return NULL if skb is handled
>-  * note: already called with rcu_read_lock
> - * note: already called with rcu_read_lock (preempt_disabled) from
> - * netif_receive_skb
>++ * note: already called with rcu_read_lock from netif_receive_skb
>   */
>- struct sk_buff *br_handle_frame(struct net_bridge_port *p, struct sk_buff *skb)
>+ struct sk_buff *br_handle_frame(struct sk_buff *skb)
>  {
>+ 	struct net_bridge_port *p;
>  	const unsigned char *dest = eth_hdr(skb)->h_dest;
>  	int (*rhook)(struct sk_buff *skb);
>  

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox