Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Browse files Browse the repository at this point in the history
Quoth David:

1) GRO MAC header comparisons were ethernet specific, breaking other
   link types.  This required a multi-faceted fix to cure the originally
   noted case (Infiniband), because IPoIB was lying about it's actual
   hard header length.  Thanks to Eric Dumazet, Roland Dreier, and
   others.

2) Fix build failure when INET_UDP_DIAG is built in and ipv6 is modular.
   From Anisse Astier.

3) Off by ones and other bug fixes in netprio_cgroup from Neil Horman.

4) ipv4 TCP reset generation needs to respect any network interface
   binding from the socket, otherwise route lookups might give a
   different result than all the other segments received.  From Shawn
   Lu.

5) Fix unintended regression in ipv4 proxy ARP responses, from Thomas
   Graf.

6) Fix SKB under-allocation bug in sh_eth, from Yoshihiro Shimoda.

7) Revert skge PCI mapping changes that are causing crashes for some
   folks, from Stephen Hemminger.

8) IPV4 route lookups fill in the wildcarded fields of the given flow
   lookup key passed in, which is fine most of the time as this is
   exactly what the caller's want.  However there are a few cases that
   want to retain the original flow key values afterwards, so handle
   those cases properly.  Fix from Julian Anastasov.

9) IGB/IXGBE VF lookup bug fixes from Greg Rose.

10) Properly null terminate filename passed to ethtool flash device
    method, from Ben Hutchings.

11) S3 resume fix in via-velocity from David Lv.

12) Fix double SKB free during xmit failure in CAIF, from Dmitry
    Tarnyagin.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (72 commits)
  net: Don't proxy arp respond if iif == rt->dst.dev if private VLAN is disabled
  ipv4: Fix wrong order of ip_rt_get_source() and update iph->daddr.
  netprio_cgroup: fix wrong memory access when NETPRIO_CGROUP=m
  netprio_cgroup: don't allocate prio table when a device is registered
  netprio_cgroup: fix an off-by-one bug
  bna: fix error handling of bnad_get_flash_partition_by_offset()
  isdn: type bug in isdn_net_header()
  net: Make qdisc_skb_cb upper size bound explicit.
  ixgbe: ethtool: stats user buffer overrun
  ixgbe: dcb: up2tc mapping lost on disable/enable CEE DCB state
  ixgbe: do not update real num queues when netdev is going away
  ixgbe: Fix broken dependency on MAX_SKB_FRAGS being related to page size
  ixgbe: Fix case of Tx Hang in PF with 32 VFs
  ixgbe: fix vf lookup
  igb: fix vf lookup
  e1000: add dropped DMA receive enable back in for WoL
  gro: more generic L2 header check
  IPoIB: Stop lying about hard_header_len and use skb->cb to stash LL addresses
  zd1211rw: firmware needs duration_id set to zero for non-pspoll frames
  net: enable TC35815 for MIPS again
  ...
  • Loading branch information
Linus Torvalds committed Feb 10, 2012
2 parents 612b850 + 70620c4 commit 8df54d6
Show file tree
Hide file tree
Showing 116 changed files with 518 additions and 400 deletions.
4 changes: 1 addition & 3 deletions drivers/bcma/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,8 @@ int bcma_bus_register(struct bcma_bus *bus)
err = bcma_sprom_get(bus);
if (err == -ENOENT) {
pr_err("No SPROM available\n");
} else if (err) {
} else if (err)
pr_err("Failed to get SPROM: %d\n", err);
return -ENOENT;
}

/* Register found cores */
bcma_register_cores(bus);
Expand Down
19 changes: 11 additions & 8 deletions drivers/bcma/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,15 +399,18 @@ int bcma_bus_scan(struct bcma_bus *bus)
core->bus = bus;

err = bcma_get_next_core(bus, &eromptr, NULL, core_num, core);
if (err == -ENODEV) {
core_num++;
continue;
} else if (err == -ENXIO)
continue;
else if (err == -ESPIPE)
break;
else if (err < 0)
if (err < 0) {
kfree(core);
if (err == -ENODEV) {
core_num++;
continue;
} else if (err == -ENXIO) {
continue;
} else if (err == -ESPIPE) {
break;
}
return err;
}

core->core_index = core_num++;
bus->nr_cores++;
Expand Down
6 changes: 4 additions & 2 deletions drivers/infiniband/ulp/ipoib/ipoib.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include <linux/mutex.h>

#include <net/neighbour.h>
#include <net/sch_generic.h>

#include <linux/atomic.h>

Expand Down Expand Up @@ -117,8 +118,9 @@ struct ipoib_header {
u16 reserved;
};

struct ipoib_pseudoheader {
u8 hwaddr[INFINIBAND_ALEN];
struct ipoib_cb {
struct qdisc_skb_cb qdisc_cb;
u8 hwaddr[INFINIBAND_ALEN];
};

/* Used for all multicast joins (broadcast, IPv4 mcast and IPv6 mcast) */
Expand Down
55 changes: 19 additions & 36 deletions drivers/infiniband/ulp/ipoib/ipoib_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,25 +653,23 @@ static void ipoib_path_lookup(struct sk_buff *skb, struct neighbour *n, struct n
}

static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev,
struct ipoib_pseudoheader *phdr)
struct ipoib_cb *cb)
{
struct ipoib_dev_priv *priv = netdev_priv(dev);
struct ipoib_path *path;
unsigned long flags;

spin_lock_irqsave(&priv->lock, flags);

path = __path_find(dev, phdr->hwaddr + 4);
path = __path_find(dev, cb->hwaddr + 4);
if (!path || !path->valid) {
int new_path = 0;

if (!path) {
path = path_rec_create(dev, phdr->hwaddr + 4);
path = path_rec_create(dev, cb->hwaddr + 4);
new_path = 1;
}
if (path) {
/* put pseudoheader back on for next time */
skb_push(skb, sizeof *phdr);
__skb_queue_tail(&path->queue, skb);

if (!path->query && path_rec_start(dev, path)) {
Expand All @@ -695,12 +693,10 @@ static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev,
be16_to_cpu(path->pathrec.dlid));

spin_unlock_irqrestore(&priv->lock, flags);
ipoib_send(dev, skb, path->ah, IPOIB_QPN(phdr->hwaddr));
ipoib_send(dev, skb, path->ah, IPOIB_QPN(cb->hwaddr));
return;
} else if ((path->query || !path_rec_start(dev, path)) &&
skb_queue_len(&path->queue) < IPOIB_MAX_PATH_REC_QUEUE) {
/* put pseudoheader back on for next time */
skb_push(skb, sizeof *phdr);
__skb_queue_tail(&path->queue, skb);
} else {
++dev->stats.tx_dropped;
Expand Down Expand Up @@ -774,16 +770,14 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
dev_kfree_skb_any(skb);
}
} else {
struct ipoib_pseudoheader *phdr =
(struct ipoib_pseudoheader *) skb->data;
skb_pull(skb, sizeof *phdr);
struct ipoib_cb *cb = (struct ipoib_cb *) skb->cb;

if (phdr->hwaddr[4] == 0xff) {
if (cb->hwaddr[4] == 0xff) {
/* Add in the P_Key for multicast*/
phdr->hwaddr[8] = (priv->pkey >> 8) & 0xff;
phdr->hwaddr[9] = priv->pkey & 0xff;
cb->hwaddr[8] = (priv->pkey >> 8) & 0xff;
cb->hwaddr[9] = priv->pkey & 0xff;

ipoib_mcast_send(dev, phdr->hwaddr + 4, skb);
ipoib_mcast_send(dev, cb->hwaddr + 4, skb);
} else {
/* unicast GID -- should be ARP or RARP reply */

Expand All @@ -792,14 +786,14 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
ipoib_warn(priv, "Unicast, no %s: type %04x, QPN %06x %pI6\n",
skb_dst(skb) ? "neigh" : "dst",
be16_to_cpup((__be16 *) skb->data),
IPOIB_QPN(phdr->hwaddr),
phdr->hwaddr + 4);
IPOIB_QPN(cb->hwaddr),
cb->hwaddr + 4);
dev_kfree_skb_any(skb);
++dev->stats.tx_dropped;
goto unlock;
}

unicast_arp_send(skb, dev, phdr);
unicast_arp_send(skb, dev, cb);
}
}
unlock:
Expand All @@ -825,27 +819,20 @@ static int ipoib_hard_header(struct sk_buff *skb,
const void *daddr, const void *saddr, unsigned len)
{
struct ipoib_header *header;
struct dst_entry *dst;
struct neighbour *n;

header = (struct ipoib_header *) skb_push(skb, sizeof *header);

header->proto = htons(type);
header->reserved = 0;

/*
* If we don't have a neighbour structure, stuff the
* destination address onto the front of the skb so we can
* figure out where to send the packet later.
* If we don't have a dst_entry structure, stuff the
* destination address into skb->cb so we can figure out where
* to send the packet later.
*/
dst = skb_dst(skb);
n = NULL;
if (dst)
n = dst_get_neighbour_noref_raw(dst);
if ((!dst || !n) && daddr) {
struct ipoib_pseudoheader *phdr =
(struct ipoib_pseudoheader *) skb_push(skb, sizeof *phdr);
memcpy(phdr->hwaddr, daddr, INFINIBAND_ALEN);
if (!skb_dst(skb)) {
struct ipoib_cb *cb = (struct ipoib_cb *) skb->cb;
memcpy(cb->hwaddr, daddr, INFINIBAND_ALEN);
}

return 0;
Expand Down Expand Up @@ -1021,11 +1008,7 @@ static void ipoib_setup(struct net_device *dev)

dev->flags |= IFF_BROADCAST | IFF_MULTICAST;

/*
* We add in INFINIBAND_ALEN to allow for the destination
* address "pseudoheader" for skbs without neighbour struct.
*/
dev->hard_header_len = IPOIB_ENCAP_LEN + INFINIBAND_ALEN;
dev->hard_header_len = IPOIB_ENCAP_LEN;
dev->addr_len = INFINIBAND_ALEN;
dev->type = ARPHRD_INFINIBAND;
dev->tx_queue_len = ipoib_sendq_size * 2;
Expand Down
10 changes: 1 addition & 9 deletions drivers/infiniband/ulp/ipoib/ipoib_multicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,21 +262,13 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast,
netif_tx_lock_bh(dev);
while (!skb_queue_empty(&mcast->pkt_queue)) {
struct sk_buff *skb = skb_dequeue(&mcast->pkt_queue);
struct dst_entry *dst = skb_dst(skb);
struct neighbour *n = NULL;

netif_tx_unlock_bh(dev);

skb->dev = dev;
if (dst)
n = dst_get_neighbour_noref_raw(dst);
if (!dst || !n) {
/* put pseudoheader back on for next time */
skb_push(skb, sizeof (struct ipoib_pseudoheader));
}

if (dev_queue_xmit(skb))
ipoib_warn(priv, "dev_queue_xmit failed to requeue packet\n");

netif_tx_lock_bh(dev);
}
netif_tx_unlock_bh(dev);
Expand Down
2 changes: 1 addition & 1 deletion drivers/isdn/i4l/isdn_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -1901,7 +1901,7 @@ static int isdn_net_header(struct sk_buff *skb, struct net_device *dev,
{
isdn_net_local *lp = netdev_priv(dev);
unsigned char *p;
ushort len = 0;
int len = 0;

switch (lp->p_encap) {
case ISDN_NET_ENCAP_ETHER:
Expand Down
4 changes: 3 additions & 1 deletion drivers/net/can/cc770/cc770.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,12 +440,14 @@ static netdev_tx_t cc770_start_xmit(struct sk_buff *skb, struct net_device *dev)
for (i = 0; i < dlc; i++)
cc770_write_reg(priv, msgobj[mo].data[i], cf->data[i]);

/* Store echo skb before starting the transfer */
can_put_echo_skb(skb, dev, 0);

cc770_write_reg(priv, msgobj[mo].ctrl1,
RMTPND_RES | TXRQST_SET | CPUUPD_RES | NEWDAT_UNC);

stats->tx_bytes += dlc;

can_put_echo_skb(skb, dev, 0);

/*
* HM: We had some cases of repeated IRQs so make sure the
Expand Down
16 changes: 15 additions & 1 deletion drivers/net/can/cc770/cc770_isa.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ MODULE_PARM_DESC(bcr, "Bus configuration register (default=0x40 [CBY])");
#define CC770_IOSIZE 0x20
#define CC770_IOSIZE_INDIRECT 0x02

/* Spinlock for cc770_isa_port_write_reg_indirect
* and cc770_isa_port_read_reg_indirect
*/
static DEFINE_SPINLOCK(cc770_isa_port_lock);

static struct platform_device *cc770_isa_devs[MAXDEV];

static u8 cc770_isa_mem_read_reg(const struct cc770_priv *priv, int reg)
Expand Down Expand Up @@ -138,18 +143,27 @@ static u8 cc770_isa_port_read_reg_indirect(const struct cc770_priv *priv,
int reg)
{
unsigned long base = (unsigned long)priv->reg_base;
unsigned long flags;
u8 val;

spin_lock_irqsave(&cc770_isa_port_lock, flags);
outb(reg, base);
return inb(base + 1);
val = inb(base + 1);
spin_unlock_irqrestore(&cc770_isa_port_lock, flags);

return val;
}

static void cc770_isa_port_write_reg_indirect(const struct cc770_priv *priv,
int reg, u8 val)
{
unsigned long base = (unsigned long)priv->reg_base;
unsigned long flags;

spin_lock_irqsave(&cc770_isa_port_lock, flags);
outb(reg, base);
outb(val, base + 1);
spin_unlock_irqrestore(&cc770_isa_port_lock, flags);
}

static int __devinit cc770_isa_probe(struct platform_device *pdev)
Expand Down
7 changes: 6 additions & 1 deletion drivers/net/can/flexcan.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@
(FLEXCAN_ESR_TWRN_INT | FLEXCAN_ESR_RWRN_INT | FLEXCAN_ESR_BOFF_INT)
#define FLEXCAN_ESR_ERR_ALL \
(FLEXCAN_ESR_ERR_BUS | FLEXCAN_ESR_ERR_STATE)
#define FLEXCAN_ESR_ALL_INT \
(FLEXCAN_ESR_TWRN_INT | FLEXCAN_ESR_RWRN_INT | \
FLEXCAN_ESR_BOFF_INT | FLEXCAN_ESR_ERR_INT)

/* FLEXCAN interrupt flag register (IFLAG) bits */
#define FLEXCAN_TX_BUF_ID 8
Expand Down Expand Up @@ -577,7 +580,9 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id)

reg_iflag1 = flexcan_read(&regs->iflag1);
reg_esr = flexcan_read(&regs->esr);
flexcan_write(FLEXCAN_ESR_ERR_INT, &regs->esr); /* ACK err IRQ */
/* ACK all bus error and state change IRQ sources */
if (reg_esr & FLEXCAN_ESR_ALL_INT)
flexcan_write(reg_esr & FLEXCAN_ESR_ALL_INT, &regs->esr);

/*
* schedule NAPI in case of:
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/can/pch_can.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
#define PCH_IF_CREQ_BUSY BIT(15)

#define PCH_STATUS_INT 0x8000
#define PCH_RP 0x00008000
#define PCH_REC 0x00007f00
#define PCH_TEC 0x000000ff

Expand Down Expand Up @@ -527,7 +528,7 @@ static void pch_can_error(struct net_device *ndev, u32 status)
priv->can.can_stats.error_passive++;
state = CAN_STATE_ERROR_PASSIVE;
cf->can_id |= CAN_ERR_CRTL;
if (((errc & PCH_REC) >> 8) > 127)
if (errc & PCH_RP)
cf->data[1] |= CAN_ERR_CRTL_RX_PASSIVE;
if ((errc & PCH_TEC) > 127)
cf->data[1] |= CAN_ERR_CRTL_TX_PASSIVE;
Expand Down
23 changes: 9 additions & 14 deletions drivers/net/can/sja1000/peak_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ MODULE_LICENSE("GPL v2");
#define DRV_NAME "peak_pci"

struct peak_pci_chan {
void __iomem *cfg_base; /* Common for all channels */
struct net_device *next_dev; /* Chain of network devices */
u16 icr_mask; /* Interrupt mask for fast ack */
void __iomem *cfg_base; /* Common for all channels */
struct net_device *prev_dev; /* Chain of network devices */
u16 icr_mask; /* Interrupt mask for fast ack */
};

#define PEAK_PCI_CAN_CLOCK (16000000 / 2)
Expand Down Expand Up @@ -98,7 +98,7 @@ static int __devinit peak_pci_probe(struct pci_dev *pdev,
{
struct sja1000_priv *priv;
struct peak_pci_chan *chan;
struct net_device *dev, *dev0 = NULL;
struct net_device *dev;
void __iomem *cfg_base, *reg_base;
u16 sub_sys_id, icr;
int i, err, channels;
Expand Down Expand Up @@ -196,18 +196,14 @@ static int __devinit peak_pci_probe(struct pci_dev *pdev,
}

/* Create chain of SJA1000 devices */
if (i == 0)
dev0 = dev;
else
chan->next_dev = dev;
chan->prev_dev = pci_get_drvdata(pdev);
pci_set_drvdata(pdev, dev);

dev_info(&pdev->dev,
"%s at reg_base=0x%p cfg_base=0x%p irq=%d\n",
dev->name, priv->reg_base, chan->cfg_base, dev->irq);
}

pci_set_drvdata(pdev, dev0);

/* Enable interrupts */
writew(icr, cfg_base + PITA_ICR + 2);

Expand All @@ -217,12 +213,11 @@ static int __devinit peak_pci_probe(struct pci_dev *pdev,
/* Disable interrupts */
writew(0x0, cfg_base + PITA_ICR + 2);

for (dev = dev0; dev; dev = chan->next_dev) {
for (dev = pci_get_drvdata(pdev); dev; dev = chan->prev_dev) {
unregister_sja1000dev(dev);
free_sja1000dev(dev);
priv = netdev_priv(dev);
chan = priv->priv;
dev = chan->next_dev;
}

pci_iounmap(pdev, reg_base);
Expand All @@ -241,7 +236,7 @@ static int __devinit peak_pci_probe(struct pci_dev *pdev,

static void __devexit peak_pci_remove(struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev); /* First device */
struct net_device *dev = pci_get_drvdata(pdev); /* Last device */
struct sja1000_priv *priv = netdev_priv(dev);
struct peak_pci_chan *chan = priv->priv;
void __iomem *cfg_base = chan->cfg_base;
Expand All @@ -255,7 +250,7 @@ static void __devexit peak_pci_remove(struct pci_dev *pdev)
dev_info(&pdev->dev, "removing device %s\n", dev->name);
unregister_sja1000dev(dev);
free_sja1000dev(dev);
dev = chan->next_dev;
dev = chan->prev_dev;
if (!dev)
break;
priv = netdev_priv(dev);
Expand Down
Loading

0 comments on commit 8df54d6

Please sign in to comment.