Skip to content

Commit 9457b24

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (66 commits) can-bcm: fix minor heap overflow gianfar: Do not call device_set_wakeup_enable() under a spinlock ipv6: Warn users if maximum number of routes is reached. docs: Add neigh/gc_thresh3 and route/max_size documentation. axnet_cs: fix resume problem for some Ax88790 chip ipv6: addrconf: don't remove address state on ifdown if the address is being kept tcp: Don't change unlocked socket state in tcp_v4_err(). x25: Prevent crashing when parsing bad X.25 facilities cxgb4vf: add call to Firmware to reset VF State. cxgb4vf: Fail open if link_start() fails. cxgb4vf: flesh out PCI Device ID Table ... cxgb4vf: fix some errors in Gather List to skb conversion cxgb4vf: fix bug in Generic Receive Offload cxgb4vf: don't implement trivial (and incorrect) ndo_select_queue() ixgbe: Look inside vlan when determining offload protocol. bnx2x: Look inside vlan when determining checksum proto. vlan: Add function to retrieve EtherType from vlan packets. virtio-net: init link state correctly ucc_geth: Fix deadlock ucc_geth: Do not bring the whole IF down when TX failure. ...
2 parents 80ef913 + 0597d1b commit 9457b24

74 files changed

Lines changed: 507 additions & 331 deletions

Some content is hidden

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

‎Documentation/networking/ip-sysctl.txt‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ ip_no_pmtu_disc - BOOLEAN
2020
min_pmtu - INTEGER
2121
default 562 - minimum discovered Path MTU
2222

23+
route/max_size - INTEGER
24+
Maximum number of routes allowed in the kernel. Increase
25+
this when using large numbers of interfaces and/or routes.
26+
27+
neigh/default/gc_thresh3 - INTEGER
28+
Maximum number of neighbor entries allowed. Increase this
29+
when using large numbers of interfaces and when communicating
30+
with large numbers of directly-connected peers.
31+
2332
mtu_expires - INTEGER
2433
Time, in seconds, that cached PMTU information is kept.
2534

‎drivers/atm/solos-attrlist.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
SOLOS_ATTR_RO(DriverVersion)
22
SOLOS_ATTR_RO(APIVersion)
33
SOLOS_ATTR_RO(FirmwareVersion)
4+
SOLOS_ATTR_RO(Version)
45
// SOLOS_ATTR_RO(DspVersion)
56
// SOLOS_ATTR_RO(CommonHandshake)
67
SOLOS_ATTR_RO(Connected)

‎drivers/atm/solos-pci.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,6 +1161,14 @@ static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id)
11611161
dev_info(&dev->dev, "Solos FPGA Version %d.%02d svn-%d\n",
11621162
major_ver, minor_ver, fpga_ver);
11631163

1164+
if (fpga_ver < 37 && (fpga_upgrade || firmware_upgrade ||
1165+
db_fpga_upgrade || db_firmware_upgrade)) {
1166+
dev_warn(&dev->dev,
1167+
"FPGA too old; cannot upgrade flash. Use JTAG.\n");
1168+
fpga_upgrade = firmware_upgrade = 0;
1169+
db_fpga_upgrade = db_firmware_upgrade = 0;
1170+
}
1171+
11641172
if (card->fpga_version >= DMA_SUPPORTED){
11651173
card->using_dma = 1;
11661174
} else {

‎drivers/bluetooth/btusb.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ static struct usb_device_id btusb_table[] = {
6868
/* Apple MacBookPro6,2 */
6969
{ USB_DEVICE(0x05ac, 0x8218) },
7070

71+
/* Apple MacBookAir3,1, MacBookAir3,2 */
72+
{ USB_DEVICE(0x05ac, 0x821b) },
73+
7174
/* AVM BlueFRITZ! USB v2.0 */
7275
{ USB_DEVICE(0x057c, 0x3800) },
7376

@@ -1029,6 +1032,8 @@ static int btusb_probe(struct usb_interface *intf,
10291032

10301033
usb_set_intfdata(intf, data);
10311034

1035+
usb_enable_autosuspend(interface_to_usbdev(intf));
1036+
10321037
return 0;
10331038
}
10341039

‎drivers/net/bnx2x/bnx2x_cmn.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1680,7 +1680,7 @@ static inline u32 bnx2x_xmit_type(struct bnx2x *bp, struct sk_buff *skb)
16801680
rc = XMIT_PLAIN;
16811681

16821682
else {
1683-
if (skb->protocol == htons(ETH_P_IPV6)) {
1683+
if (vlan_get_protocol(skb) == htons(ETH_P_IPV6)) {
16841684
rc = XMIT_CSUM_V6;
16851685
if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP)
16861686
rc |= XMIT_CSUM_TCP;

‎drivers/net/cxgb4vf/cxgb4vf_main.c‎

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,9 @@ static int cxgb4vf_open(struct net_device *dev)
753753
if (err)
754754
return err;
755755
set_bit(pi->port_id, &adapter->open_device_map);
756-
link_start(dev);
756+
err = link_start(dev);
757+
if (err)
758+
return err;
757759
netif_tx_start_all_queues(dev);
758760
return 0;
759761
}
@@ -1103,18 +1105,6 @@ static int cxgb4vf_set_mac_addr(struct net_device *dev, void *_addr)
11031105
return 0;
11041106
}
11051107

1106-
/*
1107-
* Return a TX Queue on which to send the specified skb.
1108-
*/
1109-
static u16 cxgb4vf_select_queue(struct net_device *dev, struct sk_buff *skb)
1110-
{
1111-
/*
1112-
* XXX For now just use the default hash but we probably want to
1113-
* XXX look at other possibilities ...
1114-
*/
1115-
return skb_tx_hash(dev, skb);
1116-
}
1117-
11181108
#ifdef CONFIG_NET_POLL_CONTROLLER
11191109
/*
11201110
* Poll all of our receive queues. This is called outside of normal interrupt
@@ -2074,6 +2064,22 @@ static int adap_init0(struct adapter *adapter)
20742064
return err;
20752065
}
20762066

2067+
/*
2068+
* Some environments do not properly handle PCIE FLRs -- e.g. in Linux
2069+
* 2.6.31 and later we can't call pci_reset_function() in order to
2070+
* issue an FLR because of a self- deadlock on the device semaphore.
2071+
* Meanwhile, the OS infrastructure doesn't issue FLRs in all the
2072+
* cases where they're needed -- for instance, some versions of KVM
2073+
* fail to reset "Assigned Devices" when the VM reboots. Therefore we
2074+
* use the firmware based reset in order to reset any per function
2075+
* state.
2076+
*/
2077+
err = t4vf_fw_reset(adapter);
2078+
if (err < 0) {
2079+
dev_err(adapter->pdev_dev, "FW reset failed: err=%d\n", err);
2080+
return err;
2081+
}
2082+
20772083
/*
20782084
* Grab basic operational parameters. These will predominantly have
20792085
* been set up by the Physical Function Driver or will be hard coded
@@ -2417,7 +2423,6 @@ static const struct net_device_ops cxgb4vf_netdev_ops = {
24172423
.ndo_get_stats = cxgb4vf_get_stats,
24182424
.ndo_set_rx_mode = cxgb4vf_set_rxmode,
24192425
.ndo_set_mac_address = cxgb4vf_set_mac_addr,
2420-
.ndo_select_queue = cxgb4vf_select_queue,
24212426
.ndo_validate_addr = eth_validate_addr,
24222427
.ndo_do_ioctl = cxgb4vf_do_ioctl,
24232428
.ndo_change_mtu = cxgb4vf_change_mtu,
@@ -2624,7 +2629,6 @@ static int __devinit cxgb4vf_pci_probe(struct pci_dev *pdev,
26242629
netdev->do_ioctl = cxgb4vf_do_ioctl;
26252630
netdev->change_mtu = cxgb4vf_change_mtu;
26262631
netdev->set_mac_address = cxgb4vf_set_mac_addr;
2627-
netdev->select_queue = cxgb4vf_select_queue;
26282632
#ifdef CONFIG_NET_POLL_CONTROLLER
26292633
netdev->poll_controller = cxgb4vf_poll_controller;
26302634
#endif
@@ -2843,6 +2847,14 @@ static struct pci_device_id cxgb4vf_pci_tbl[] = {
28432847
CH_DEVICE(0x4800, 0), /* T440-dbg */
28442848
CH_DEVICE(0x4801, 0), /* T420-cr */
28452849
CH_DEVICE(0x4802, 0), /* T422-cr */
2850+
CH_DEVICE(0x4803, 0), /* T440-cr */
2851+
CH_DEVICE(0x4804, 0), /* T420-bch */
2852+
CH_DEVICE(0x4805, 0), /* T440-bch */
2853+
CH_DEVICE(0x4806, 0), /* T460-ch */
2854+
CH_DEVICE(0x4807, 0), /* T420-so */
2855+
CH_DEVICE(0x4808, 0), /* T420-cx */
2856+
CH_DEVICE(0x4809, 0), /* T420-bt */
2857+
CH_DEVICE(0x480a, 0), /* T404-bt */
28462858
{ 0, }
28472859
};
28482860

‎drivers/net/cxgb4vf/sge.c‎

Lines changed: 75 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,14 @@ enum {
154154
*/
155155
RX_COPY_THRES = 256,
156156
RX_PULL_LEN = 128,
157-
};
158157

159-
/*
160-
* Can't define this in the above enum because PKTSHIFT isn't a constant in
161-
* the VF Driver ...
162-
*/
163-
#define RX_PKT_PULL_LEN (RX_PULL_LEN + PKTSHIFT)
158+
/*
159+
* Main body length for sk_buffs used for RX Ethernet packets with
160+
* fragments. Should be >= RX_PULL_LEN but possibly bigger to give
161+
* pskb_may_pull() some room.
162+
*/
163+
RX_SKB_LEN = 512,
164+
};
164165

165166
/*
166167
* Software state per TX descriptor.
@@ -1354,6 +1355,67 @@ int t4vf_eth_xmit(struct sk_buff *skb, struct net_device *dev)
13541355
return NETDEV_TX_OK;
13551356
}
13561357

1358+
/**
1359+
* t4vf_pktgl_to_skb - build an sk_buff from a packet gather list
1360+
* @gl: the gather list
1361+
* @skb_len: size of sk_buff main body if it carries fragments
1362+
* @pull_len: amount of data to move to the sk_buff's main body
1363+
*
1364+
* Builds an sk_buff from the given packet gather list. Returns the
1365+
* sk_buff or %NULL if sk_buff allocation failed.
1366+
*/
1367+
struct sk_buff *t4vf_pktgl_to_skb(const struct pkt_gl *gl,
1368+
unsigned int skb_len, unsigned int pull_len)
1369+
{
1370+
struct sk_buff *skb;
1371+
struct skb_shared_info *ssi;
1372+
1373+
/*
1374+
* If the ingress packet is small enough, allocate an skb large enough
1375+
* for all of the data and copy it inline. Otherwise, allocate an skb
1376+
* with enough room to pull in the header and reference the rest of
1377+
* the data via the skb fragment list.
1378+
*
1379+
* Below we rely on RX_COPY_THRES being less than the smallest Rx
1380+
* buff! size, which is expected since buffers are at least
1381+
* PAGE_SIZEd. In this case packets up to RX_COPY_THRES have only one
1382+
* fragment.
1383+
*/
1384+
if (gl->tot_len <= RX_COPY_THRES) {
1385+
/* small packets have only one fragment */
1386+
skb = alloc_skb(gl->tot_len, GFP_ATOMIC);
1387+
if (unlikely(!skb))
1388+
goto out;
1389+
__skb_put(skb, gl->tot_len);
1390+
skb_copy_to_linear_data(skb, gl->va, gl->tot_len);
1391+
} else {
1392+
skb = alloc_skb(skb_len, GFP_ATOMIC);
1393+
if (unlikely(!skb))
1394+
goto out;
1395+
__skb_put(skb, pull_len);
1396+
skb_copy_to_linear_data(skb, gl->va, pull_len);
1397+
1398+
ssi = skb_shinfo(skb);
1399+
ssi->frags[0].page = gl->frags[0].page;
1400+
ssi->frags[0].page_offset = gl->frags[0].page_offset + pull_len;
1401+
ssi->frags[0].size = gl->frags[0].size - pull_len;
1402+
if (gl->nfrags > 1)
1403+
memcpy(&ssi->frags[1], &gl->frags[1],
1404+
(gl->nfrags-1) * sizeof(skb_frag_t));
1405+
ssi->nr_frags = gl->nfrags;
1406+
1407+
skb->len = gl->tot_len;
1408+
skb->data_len = skb->len - pull_len;
1409+
skb->truesize += skb->data_len;
1410+
1411+
/* Get a reference for the last page, we don't own it */
1412+
get_page(gl->frags[gl->nfrags - 1].page);
1413+
}
1414+
1415+
out:
1416+
return skb;
1417+
}
1418+
13571419
/**
13581420
* t4vf_pktgl_free - free a packet gather list
13591421
* @gl: the gather list
@@ -1463,10 +1525,8 @@ int t4vf_ethrx_handler(struct sge_rspq *rspq, const __be64 *rsp,
14631525
{
14641526
struct sk_buff *skb;
14651527
struct port_info *pi;
1466-
struct skb_shared_info *ssi;
14671528
const struct cpl_rx_pkt *pkt = (void *)&rsp[1];
14681529
bool csum_ok = pkt->csum_calc && !pkt->err_vec;
1469-
unsigned int len = be16_to_cpu(pkt->len);
14701530
struct sge_eth_rxq *rxq = container_of(rspq, struct sge_eth_rxq, rspq);
14711531

14721532
/*
@@ -1481,42 +1541,14 @@ int t4vf_ethrx_handler(struct sge_rspq *rspq, const __be64 *rsp,
14811541
}
14821542

14831543
/*
1484-
* If the ingress packet is small enough, allocate an skb large enough
1485-
* for all of the data and copy it inline. Otherwise, allocate an skb
1486-
* with enough room to pull in the header and reference the rest of
1487-
* the data via the skb fragment list.
1544+
* Convert the Packet Gather List into an skb.
14881545
*/
1489-
if (len <= RX_COPY_THRES) {
1490-
/* small packets have only one fragment */
1491-
skb = alloc_skb(gl->frags[0].size, GFP_ATOMIC);
1492-
if (!skb)
1493-
goto nomem;
1494-
__skb_put(skb, gl->frags[0].size);
1495-
skb_copy_to_linear_data(skb, gl->va, gl->frags[0].size);
1496-
} else {
1497-
skb = alloc_skb(RX_PKT_PULL_LEN, GFP_ATOMIC);
1498-
if (!skb)
1499-
goto nomem;
1500-
__skb_put(skb, RX_PKT_PULL_LEN);
1501-
skb_copy_to_linear_data(skb, gl->va, RX_PKT_PULL_LEN);
1502-
1503-
ssi = skb_shinfo(skb);
1504-
ssi->frags[0].page = gl->frags[0].page;
1505-
ssi->frags[0].page_offset = (gl->frags[0].page_offset +
1506-
RX_PKT_PULL_LEN);
1507-
ssi->frags[0].size = gl->frags[0].size - RX_PKT_PULL_LEN;
1508-
if (gl->nfrags > 1)
1509-
memcpy(&ssi->frags[1], &gl->frags[1],
1510-
(gl->nfrags-1) * sizeof(skb_frag_t));
1511-
ssi->nr_frags = gl->nfrags;
1512-
skb->len = len + PKTSHIFT;
1513-
skb->data_len = skb->len - RX_PKT_PULL_LEN;
1514-
skb->truesize += skb->data_len;
1515-
1516-
/* Get a reference for the last page, we don't own it */
1517-
get_page(gl->frags[gl->nfrags - 1].page);
1546+
skb = t4vf_pktgl_to_skb(gl, RX_SKB_LEN, RX_PULL_LEN);
1547+
if (unlikely(!skb)) {
1548+
t4vf_pktgl_free(gl);
1549+
rxq->stats.rx_drops++;
1550+
return 0;
15181551
}
1519-
15201552
__skb_pull(skb, PKTSHIFT);
15211553
skb->protocol = eth_type_trans(skb, rspq->netdev);
15221554
skb_record_rx_queue(skb, rspq->idx);
@@ -1549,11 +1581,6 @@ int t4vf_ethrx_handler(struct sge_rspq *rspq, const __be64 *rsp,
15491581
netif_receive_skb(skb);
15501582

15511583
return 0;
1552-
1553-
nomem:
1554-
t4vf_pktgl_free(gl);
1555-
rxq->stats.rx_drops++;
1556-
return 0;
15571584
}
15581585

15591586
/**
@@ -1679,6 +1706,7 @@ int process_responses(struct sge_rspq *rspq, int budget)
16791706
}
16801707
len = RSPD_LEN(len);
16811708
}
1709+
gl.tot_len = len;
16821710

16831711
/*
16841712
* Gather packet fragments.

‎drivers/net/cxgb4vf/t4vf_common.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ static inline int t4vf_wr_mbox_ns(struct adapter *adapter, const void *cmd,
235235
int __devinit t4vf_wait_dev_ready(struct adapter *);
236236
int __devinit t4vf_port_init(struct adapter *, int);
237237

238+
int t4vf_fw_reset(struct adapter *);
238239
int t4vf_query_params(struct adapter *, unsigned int, const u32 *, u32 *);
239240
int t4vf_set_params(struct adapter *, unsigned int, const u32 *, const u32 *);
240241

‎drivers/net/cxgb4vf/t4vf_hw.c‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,25 @@ int __devinit t4vf_port_init(struct adapter *adapter, int pidx)
325325
return 0;
326326
}
327327

328+
/**
329+
* t4vf_fw_reset - issue a reset to FW
330+
* @adapter: the adapter
331+
*
332+
* Issues a reset command to FW. For a Physical Function this would
333+
* result in the Firmware reseting all of its state. For a Virtual
334+
* Function this just resets the state associated with the VF.
335+
*/
336+
int t4vf_fw_reset(struct adapter *adapter)
337+
{
338+
struct fw_reset_cmd cmd;
339+
340+
memset(&cmd, 0, sizeof(cmd));
341+
cmd.op_to_write = cpu_to_be32(FW_CMD_OP(FW_RESET_CMD) |
342+
FW_CMD_WRITE);
343+
cmd.retval_len16 = cpu_to_be32(FW_LEN16(cmd));
344+
return t4vf_wr_mbox(adapter, &cmd, sizeof(cmd), NULL);
345+
}
346+
328347
/**
329348
* t4vf_query_params - query FW or device parameters
330349
* @adapter: the adapter

‎drivers/net/gianfar_ethtool.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,9 +635,10 @@ static int gfar_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
635635
if (wol->wolopts & ~WAKE_MAGIC)
636636
return -EINVAL;
637637

638+
device_set_wakeup_enable(&dev->dev, wol->wolopts & WAKE_MAGIC);
639+
638640
spin_lock_irqsave(&priv->bflock, flags);
639-
priv->wol_en = wol->wolopts & WAKE_MAGIC ? 1 : 0;
640-
device_set_wakeup_enable(&dev->dev, priv->wol_en);
641+
priv->wol_en = !!device_may_wakeup(&dev->dev);
641642
spin_unlock_irqrestore(&priv->bflock, flags);
642643

643644
return 0;

0 commit comments

Comments
 (0)