Skip to content

Commit 8df54d6

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
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 ...
2 parents 612b850 + 70620c4 commit 8df54d6

File tree

116 files changed

+518
-400
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+518
-400
lines changed

drivers/bcma/main.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,8 @@ int bcma_bus_register(struct bcma_bus *bus)
169169
err = bcma_sprom_get(bus);
170170
if (err == -ENOENT) {
171171
pr_err("No SPROM available\n");
172-
} else if (err) {
172+
} else if (err)
173173
pr_err("Failed to get SPROM: %d\n", err);
174-
return -ENOENT;
175-
}
176174

177175
/* Register found cores */
178176
bcma_register_cores(bus);

drivers/bcma/scan.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -399,15 +399,18 @@ int bcma_bus_scan(struct bcma_bus *bus)
399399
core->bus = bus;
400400

401401
err = bcma_get_next_core(bus, &eromptr, NULL, core_num, core);
402-
if (err == -ENODEV) {
403-
core_num++;
404-
continue;
405-
} else if (err == -ENXIO)
406-
continue;
407-
else if (err == -ESPIPE)
408-
break;
409-
else if (err < 0)
402+
if (err < 0) {
403+
kfree(core);
404+
if (err == -ENODEV) {
405+
core_num++;
406+
continue;
407+
} else if (err == -ENXIO) {
408+
continue;
409+
} else if (err == -ESPIPE) {
410+
break;
411+
}
410412
return err;
413+
}
411414

412415
core->core_index = core_num++;
413416
bus->nr_cores++;

drivers/infiniband/ulp/ipoib/ipoib.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include <linux/mutex.h>
4545

4646
#include <net/neighbour.h>
47+
#include <net/sch_generic.h>
4748

4849
#include <linux/atomic.h>
4950

@@ -117,8 +118,9 @@ struct ipoib_header {
117118
u16 reserved;
118119
};
119120

120-
struct ipoib_pseudoheader {
121-
u8 hwaddr[INFINIBAND_ALEN];
121+
struct ipoib_cb {
122+
struct qdisc_skb_cb qdisc_cb;
123+
u8 hwaddr[INFINIBAND_ALEN];
122124
};
123125

124126
/* Used for all multicast joins (broadcast, IPv4 mcast and IPv6 mcast) */

drivers/infiniband/ulp/ipoib/ipoib_main.c

Lines changed: 19 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -653,25 +653,23 @@ static void ipoib_path_lookup(struct sk_buff *skb, struct neighbour *n, struct n
653653
}
654654

655655
static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev,
656-
struct ipoib_pseudoheader *phdr)
656+
struct ipoib_cb *cb)
657657
{
658658
struct ipoib_dev_priv *priv = netdev_priv(dev);
659659
struct ipoib_path *path;
660660
unsigned long flags;
661661

662662
spin_lock_irqsave(&priv->lock, flags);
663663

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

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

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

697695
spin_unlock_irqrestore(&priv->lock, flags);
698-
ipoib_send(dev, skb, path->ah, IPOIB_QPN(phdr->hwaddr));
696+
ipoib_send(dev, skb, path->ah, IPOIB_QPN(cb->hwaddr));
699697
return;
700698
} else if ((path->query || !path_rec_start(dev, path)) &&
701699
skb_queue_len(&path->queue) < IPOIB_MAX_PATH_REC_QUEUE) {
702-
/* put pseudoheader back on for next time */
703-
skb_push(skb, sizeof *phdr);
704700
__skb_queue_tail(&path->queue, skb);
705701
} else {
706702
++dev->stats.tx_dropped;
@@ -774,16 +770,14 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
774770
dev_kfree_skb_any(skb);
775771
}
776772
} else {
777-
struct ipoib_pseudoheader *phdr =
778-
(struct ipoib_pseudoheader *) skb->data;
779-
skb_pull(skb, sizeof *phdr);
773+
struct ipoib_cb *cb = (struct ipoib_cb *) skb->cb;
780774

781-
if (phdr->hwaddr[4] == 0xff) {
775+
if (cb->hwaddr[4] == 0xff) {
782776
/* Add in the P_Key for multicast*/
783-
phdr->hwaddr[8] = (priv->pkey >> 8) & 0xff;
784-
phdr->hwaddr[9] = priv->pkey & 0xff;
777+
cb->hwaddr[8] = (priv->pkey >> 8) & 0xff;
778+
cb->hwaddr[9] = priv->pkey & 0xff;
785779

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

@@ -792,14 +786,14 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
792786
ipoib_warn(priv, "Unicast, no %s: type %04x, QPN %06x %pI6\n",
793787
skb_dst(skb) ? "neigh" : "dst",
794788
be16_to_cpup((__be16 *) skb->data),
795-
IPOIB_QPN(phdr->hwaddr),
796-
phdr->hwaddr + 4);
789+
IPOIB_QPN(cb->hwaddr),
790+
cb->hwaddr + 4);
797791
dev_kfree_skb_any(skb);
798792
++dev->stats.tx_dropped;
799793
goto unlock;
800794
}
801795

802-
unicast_arp_send(skb, dev, phdr);
796+
unicast_arp_send(skb, dev, cb);
803797
}
804798
}
805799
unlock:
@@ -825,27 +819,20 @@ static int ipoib_hard_header(struct sk_buff *skb,
825819
const void *daddr, const void *saddr, unsigned len)
826820
{
827821
struct ipoib_header *header;
828-
struct dst_entry *dst;
829-
struct neighbour *n;
830822

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

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

836828
/*
837-
* If we don't have a neighbour structure, stuff the
838-
* destination address onto the front of the skb so we can
839-
* figure out where to send the packet later.
829+
* If we don't have a dst_entry structure, stuff the
830+
* destination address into skb->cb so we can figure out where
831+
* to send the packet later.
840832
*/
841-
dst = skb_dst(skb);
842-
n = NULL;
843-
if (dst)
844-
n = dst_get_neighbour_noref_raw(dst);
845-
if ((!dst || !n) && daddr) {
846-
struct ipoib_pseudoheader *phdr =
847-
(struct ipoib_pseudoheader *) skb_push(skb, sizeof *phdr);
848-
memcpy(phdr->hwaddr, daddr, INFINIBAND_ALEN);
833+
if (!skb_dst(skb)) {
834+
struct ipoib_cb *cb = (struct ipoib_cb *) skb->cb;
835+
memcpy(cb->hwaddr, daddr, INFINIBAND_ALEN);
849836
}
850837

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

10221009
dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
10231010

1024-
/*
1025-
* We add in INFINIBAND_ALEN to allow for the destination
1026-
* address "pseudoheader" for skbs without neighbour struct.
1027-
*/
1028-
dev->hard_header_len = IPOIB_ENCAP_LEN + INFINIBAND_ALEN;
1011+
dev->hard_header_len = IPOIB_ENCAP_LEN;
10291012
dev->addr_len = INFINIBAND_ALEN;
10301013
dev->type = ARPHRD_INFINIBAND;
10311014
dev->tx_queue_len = ipoib_sendq_size * 2;

drivers/infiniband/ulp/ipoib/ipoib_multicast.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -262,21 +262,13 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast,
262262
netif_tx_lock_bh(dev);
263263
while (!skb_queue_empty(&mcast->pkt_queue)) {
264264
struct sk_buff *skb = skb_dequeue(&mcast->pkt_queue);
265-
struct dst_entry *dst = skb_dst(skb);
266-
struct neighbour *n = NULL;
267265

268266
netif_tx_unlock_bh(dev);
269267

270268
skb->dev = dev;
271-
if (dst)
272-
n = dst_get_neighbour_noref_raw(dst);
273-
if (!dst || !n) {
274-
/* put pseudoheader back on for next time */
275-
skb_push(skb, sizeof (struct ipoib_pseudoheader));
276-
}
277-
278269
if (dev_queue_xmit(skb))
279270
ipoib_warn(priv, "dev_queue_xmit failed to requeue packet\n");
271+
280272
netif_tx_lock_bh(dev);
281273
}
282274
netif_tx_unlock_bh(dev);

drivers/isdn/i4l/isdn_net.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1901,7 +1901,7 @@ static int isdn_net_header(struct sk_buff *skb, struct net_device *dev,
19011901
{
19021902
isdn_net_local *lp = netdev_priv(dev);
19031903
unsigned char *p;
1904-
ushort len = 0;
1904+
int len = 0;
19051905

19061906
switch (lp->p_encap) {
19071907
case ISDN_NET_ENCAP_ETHER:

drivers/net/can/cc770/cc770.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,12 +440,14 @@ static netdev_tx_t cc770_start_xmit(struct sk_buff *skb, struct net_device *dev)
440440
for (i = 0; i < dlc; i++)
441441
cc770_write_reg(priv, msgobj[mo].data[i], cf->data[i]);
442442

443+
/* Store echo skb before starting the transfer */
444+
can_put_echo_skb(skb, dev, 0);
445+
443446
cc770_write_reg(priv, msgobj[mo].ctrl1,
444447
RMTPND_RES | TXRQST_SET | CPUUPD_RES | NEWDAT_UNC);
445448

446449
stats->tx_bytes += dlc;
447450

448-
can_put_echo_skb(skb, dev, 0);
449451

450452
/*
451453
* HM: We had some cases of repeated IRQs so make sure the

drivers/net/can/cc770/cc770_isa.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ MODULE_PARM_DESC(bcr, "Bus configuration register (default=0x40 [CBY])");
110110
#define CC770_IOSIZE 0x20
111111
#define CC770_IOSIZE_INDIRECT 0x02
112112

113+
/* Spinlock for cc770_isa_port_write_reg_indirect
114+
* and cc770_isa_port_read_reg_indirect
115+
*/
116+
static DEFINE_SPINLOCK(cc770_isa_port_lock);
117+
113118
static struct platform_device *cc770_isa_devs[MAXDEV];
114119

115120
static u8 cc770_isa_mem_read_reg(const struct cc770_priv *priv, int reg)
@@ -138,18 +143,27 @@ static u8 cc770_isa_port_read_reg_indirect(const struct cc770_priv *priv,
138143
int reg)
139144
{
140145
unsigned long base = (unsigned long)priv->reg_base;
146+
unsigned long flags;
147+
u8 val;
141148

149+
spin_lock_irqsave(&cc770_isa_port_lock, flags);
142150
outb(reg, base);
143-
return inb(base + 1);
151+
val = inb(base + 1);
152+
spin_unlock_irqrestore(&cc770_isa_port_lock, flags);
153+
154+
return val;
144155
}
145156

146157
static void cc770_isa_port_write_reg_indirect(const struct cc770_priv *priv,
147158
int reg, u8 val)
148159
{
149160
unsigned long base = (unsigned long)priv->reg_base;
161+
unsigned long flags;
150162

163+
spin_lock_irqsave(&cc770_isa_port_lock, flags);
151164
outb(reg, base);
152165
outb(val, base + 1);
166+
spin_unlock_irqrestore(&cc770_isa_port_lock, flags);
153167
}
154168

155169
static int __devinit cc770_isa_probe(struct platform_device *pdev)

drivers/net/can/flexcan.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@
118118
(FLEXCAN_ESR_TWRN_INT | FLEXCAN_ESR_RWRN_INT | FLEXCAN_ESR_BOFF_INT)
119119
#define FLEXCAN_ESR_ERR_ALL \
120120
(FLEXCAN_ESR_ERR_BUS | FLEXCAN_ESR_ERR_STATE)
121+
#define FLEXCAN_ESR_ALL_INT \
122+
(FLEXCAN_ESR_TWRN_INT | FLEXCAN_ESR_RWRN_INT | \
123+
FLEXCAN_ESR_BOFF_INT | FLEXCAN_ESR_ERR_INT)
121124

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

578581
reg_iflag1 = flexcan_read(&regs->iflag1);
579582
reg_esr = flexcan_read(&regs->esr);
580-
flexcan_write(FLEXCAN_ESR_ERR_INT, &regs->esr); /* ACK err IRQ */
583+
/* ACK all bus error and state change IRQ sources */
584+
if (reg_esr & FLEXCAN_ESR_ALL_INT)
585+
flexcan_write(reg_esr & FLEXCAN_ESR_ALL_INT, &regs->esr);
581586

582587
/*
583588
* schedule NAPI in case of:

drivers/net/can/pch_can.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
#define PCH_IF_CREQ_BUSY BIT(15)
6767

6868
#define PCH_STATUS_INT 0x8000
69+
#define PCH_RP 0x00008000
6970
#define PCH_REC 0x00007f00
7071
#define PCH_TEC 0x000000ff
7172

@@ -527,7 +528,7 @@ static void pch_can_error(struct net_device *ndev, u32 status)
527528
priv->can.can_stats.error_passive++;
528529
state = CAN_STATE_ERROR_PASSIVE;
529530
cf->can_id |= CAN_ERR_CRTL;
530-
if (((errc & PCH_REC) >> 8) > 127)
531+
if (errc & PCH_RP)
531532
cf->data[1] |= CAN_ERR_CRTL_RX_PASSIVE;
532533
if ((errc & PCH_TEC) > 127)
533534
cf->data[1] |= CAN_ERR_CRTL_TX_PASSIVE;

drivers/net/can/sja1000/peak_pci.c

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ MODULE_LICENSE("GPL v2");
3939
#define DRV_NAME "peak_pci"
4040

4141
struct peak_pci_chan {
42-
void __iomem *cfg_base; /* Common for all channels */
43-
struct net_device *next_dev; /* Chain of network devices */
44-
u16 icr_mask; /* Interrupt mask for fast ack */
42+
void __iomem *cfg_base; /* Common for all channels */
43+
struct net_device *prev_dev; /* Chain of network devices */
44+
u16 icr_mask; /* Interrupt mask for fast ack */
4545
};
4646

4747
#define PEAK_PCI_CAN_CLOCK (16000000 / 2)
@@ -98,7 +98,7 @@ static int __devinit peak_pci_probe(struct pci_dev *pdev,
9898
{
9999
struct sja1000_priv *priv;
100100
struct peak_pci_chan *chan;
101-
struct net_device *dev, *dev0 = NULL;
101+
struct net_device *dev;
102102
void __iomem *cfg_base, *reg_base;
103103
u16 sub_sys_id, icr;
104104
int i, err, channels;
@@ -196,18 +196,14 @@ static int __devinit peak_pci_probe(struct pci_dev *pdev,
196196
}
197197

198198
/* Create chain of SJA1000 devices */
199-
if (i == 0)
200-
dev0 = dev;
201-
else
202-
chan->next_dev = dev;
199+
chan->prev_dev = pci_get_drvdata(pdev);
200+
pci_set_drvdata(pdev, dev);
203201

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

209-
pci_set_drvdata(pdev, dev0);
210-
211207
/* Enable interrupts */
212208
writew(icr, cfg_base + PITA_ICR + 2);
213209

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

220-
for (dev = dev0; dev; dev = chan->next_dev) {
216+
for (dev = pci_get_drvdata(pdev); dev; dev = chan->prev_dev) {
221217
unregister_sja1000dev(dev);
222218
free_sja1000dev(dev);
223219
priv = netdev_priv(dev);
224220
chan = priv->priv;
225-
dev = chan->next_dev;
226221
}
227222

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

242237
static void __devexit peak_pci_remove(struct pci_dev *pdev)
243238
{
244-
struct net_device *dev = pci_get_drvdata(pdev); /* First device */
239+
struct net_device *dev = pci_get_drvdata(pdev); /* Last device */
245240
struct sja1000_priv *priv = netdev_priv(dev);
246241
struct peak_pci_chan *chan = priv->priv;
247242
void __iomem *cfg_base = chan->cfg_base;
@@ -255,7 +250,7 @@ static void __devexit peak_pci_remove(struct pci_dev *pdev)
255250
dev_info(&pdev->dev, "removing device %s\n", dev->name);
256251
unregister_sja1000dev(dev);
257252
free_sja1000dev(dev);
258-
dev = chan->next_dev;
253+
dev = chan->prev_dev;
259254
if (!dev)
260255
break;
261256
priv = netdev_priv(dev);

0 commit comments

Comments
 (0)