Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Pull networking fixes from David Miller:

1) OpenVswitch's lookup_datapath() returns error pointers, so don't
check against NULL. From Jiri Pirko.

2) pfkey_compile_policy() code path tries to do a GFP_KERNEL allocation
under RCU locks, fix by using GFP_ATOMIC when necessary. From
Nikolay Aleksandrov.

3) phy_suspend() indirectly passes uninitialized data into the ethtool
get wake-on-land implementations. Fix from Sebastian Hesselbarth.

4) CPSW driver unregisters CPTS twice, fix from Benedikt Spranger.

5) If SKB allocation of reply packet fails, vxlan's arp_reduce() defers
a NULL pointer. Fix from David Stevens.

6) IPV6 neigh handling in vxlan doesn't validate the destination
address properly, and it builds a packet with the src and dst
reversed. Fix also from David Stevens.

7) Fix spinlock recursion during subscription failures in TIPC stack,
from Erik Hugne.

8) Revert buggy conversion of davinci_emac to devm_request_irq, from
Chrstian Riesch.

9) Wrong flags passed into forwarding database netlink notifications,
from Nicolas Dichtel.

10) The netpoll neighbour soliciation handler checks wrong ethertype,
needs to be ETH_P_IPV6 rather than ETH_P_ARP. Fix from Li RongQing.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (34 commits)
tipc: fix spinlock recursion bug for failed subscriptions
vxlan: fix nonfunctional neigh_reduce()
net: davinci_emac: Fix rollback of emac_dev_open()
net: davinci_emac: Replace devm_request_irq with request_irq
netpoll: fix the skb check in pkt_is_ns
net: micrel : ks8851-ml: add vdd-supply support
ip6mr: fix mfc notification flags
ipmr: fix mfc notification flags
rtnetlink: fix fdb notification flags
tcp: syncookies: do not use getnstimeofday()
netlink: fix setsockopt in mmap examples in documentation
openvswitch: Correctly report flow used times for first 5 minutes after boot.
via-rhine: Disable device in error path
ATHEROS-ATL1E: Convert iounmap to pci_iounmap
vxlan: fix potential NULL dereference in arp_reduce()
cnic: Update version to 2.5.20 and copyright year.
cnic,bnx2i,bnx2fc: Fix inconsistent use of page size
cnic: Use proper ulp_ops for per device operations.
net: cdc_ncm: fix control message ordering
ipv6: ip6_append_data_mtu do not handle the mtu of the second fragment properly
...

+510 -308
+1
Documentation/devicetree/bindings/net/micrel-ks8851.txt
··· 7 7 8 8 Optional properties: 9 9 - local-mac-address : Ethernet mac address to use 10 + - vdd-supply: supply for Ethernet mac
+1
MAINTAINERS
··· 4545 4545 M: Alex Duyck <alexander.h.duyck@intel.com> 4546 4546 M: John Ronciak <john.ronciak@intel.com> 4547 4547 M: Mitch Williams <mitch.a.williams@intel.com> 4548 + M: Linux NICS <linux.nics@intel.com> 4548 4549 L: e1000-devel@lists.sourceforge.net 4549 4550 W: http://www.intel.com/support/feedback.htm 4550 4551 W: http://e1000.sourceforge.net/
+10 -10
drivers/isdn/capi/Kconfig
··· 16 16 This will increase the size of the kernelcapi module by 20 KB. 17 17 If unsure, say Y. 18 18 19 - config ISDN_CAPI_MIDDLEWARE 20 - bool "CAPI2.0 Middleware support" 21 - depends on TTY 22 - help 23 - This option will enhance the capabilities of the /dev/capi20 24 - interface. It will provide a means of moving a data connection, 25 - established via the usual /dev/capi20 interface to a special tty 26 - device. If you want to use pppd with pppdcapiplugin to dial up to 27 - your ISP, say Y here. 28 - 29 19 config ISDN_CAPI_CAPI20 30 20 tristate "CAPI2.0 /dev/capi support" 31 21 help ··· 23 33 applications via /dev/capi20. Applications should use the 24 34 standardized libcapi20 to access this functionality. You should say 25 35 Y/M here. 36 + 37 + config ISDN_CAPI_MIDDLEWARE 38 + bool "CAPI2.0 Middleware support" 39 + depends on ISDN_CAPI_CAPI20 && TTY 40 + help 41 + This option will enhance the capabilities of the /dev/capi20 42 + interface. It will provide a means of moving a data connection, 43 + established via the usual /dev/capi20 interface to a special tty 44 + device. If you want to use pppd with pppdcapiplugin to dial up to 45 + your ISP, say Y here. 26 46 27 47 config ISDN_CAPI_CAPIDRV 28 48 tristate "CAPI2.0 capidrv interface support"
+4 -10
drivers/net/ethernet/atheros/alx/main.c
··· 1248 1248 * shared register for the high 32 bits, so only a single, aligned, 1249 1249 * 4 GB physical address range can be used for descriptors. 1250 1250 */ 1251 - if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)) && 1252 - !dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64))) { 1251 + if (!dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64))) { 1253 1252 dev_dbg(&pdev->dev, "DMA to 64-BIT addresses\n"); 1254 1253 } else { 1255 - err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)); 1254 + err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); 1256 1255 if (err) { 1257 - err = dma_set_coherent_mask(&pdev->dev, 1258 - DMA_BIT_MASK(32)); 1259 - if (err) { 1260 - dev_err(&pdev->dev, 1261 - "No usable DMA config, aborting\n"); 1262 - goto out_pci_disable; 1263 - } 1256 + dev_err(&pdev->dev, "No usable DMA config, aborting\n"); 1257 + goto out_pci_disable; 1264 1258 } 1265 1259 } 1266 1260
+2 -2
drivers/net/ethernet/atheros/atl1e/atl1e_main.c
··· 2436 2436 err_register: 2437 2437 err_sw_init: 2438 2438 err_eeprom: 2439 - iounmap(adapter->hw.hw_addr); 2439 + pci_iounmap(pdev, adapter->hw.hw_addr); 2440 2440 err_init_netdev: 2441 2441 err_ioremap: 2442 2442 free_netdev(netdev); ··· 2474 2474 unregister_netdev(netdev); 2475 2475 atl1e_free_ring_resources(adapter); 2476 2476 atl1e_force_ps(&adapter->hw); 2477 - iounmap(adapter->hw.hw_addr); 2477 + pci_iounmap(pdev, adapter->hw.hw_addr); 2478 2478 pci_release_regions(pdev); 2479 2479 free_netdev(netdev); 2480 2480 pci_disable_device(pdev);
+56 -55
drivers/net/ethernet/broadcom/cnic.c
··· 1 1 /* cnic.c: Broadcom CNIC core network driver. 2 2 * 3 - * Copyright (c) 2006-2013 Broadcom Corporation 3 + * Copyright (c) 2006-2014 Broadcom Corporation 4 4 * 5 5 * This program is free software; you can redistribute it and/or modify 6 6 * it under the terms of the GNU General Public License as published by ··· 342 342 while (retry < 3) { 343 343 rc = 0; 344 344 rcu_read_lock(); 345 - ulp_ops = rcu_dereference(cnic_ulp_tbl[CNIC_ULP_ISCSI]); 345 + ulp_ops = rcu_dereference(cp->ulp_ops[CNIC_ULP_ISCSI]); 346 346 if (ulp_ops) 347 347 rc = ulp_ops->iscsi_nl_send_msg( 348 348 cp->ulp_handle[CNIC_ULP_ISCSI], ··· 726 726 727 727 for (i = 0; i < dma->num_pages; i++) { 728 728 if (dma->pg_arr[i]) { 729 - dma_free_coherent(&dev->pcidev->dev, BNX2_PAGE_SIZE, 729 + dma_free_coherent(&dev->pcidev->dev, CNIC_PAGE_SIZE, 730 730 dma->pg_arr[i], dma->pg_map_arr[i]); 731 731 dma->pg_arr[i] = NULL; 732 732 } ··· 785 785 786 786 for (i = 0; i < pages; i++) { 787 787 dma->pg_arr[i] = dma_alloc_coherent(&dev->pcidev->dev, 788 - BNX2_PAGE_SIZE, 788 + CNIC_PAGE_SIZE, 789 789 &dma->pg_map_arr[i], 790 790 GFP_ATOMIC); 791 791 if (dma->pg_arr[i] == NULL) ··· 794 794 if (!use_pg_tbl) 795 795 return 0; 796 796 797 - dma->pgtbl_size = ((pages * 8) + BNX2_PAGE_SIZE - 1) & 798 - ~(BNX2_PAGE_SIZE - 1); 797 + dma->pgtbl_size = ((pages * 8) + CNIC_PAGE_SIZE - 1) & 798 + ~(CNIC_PAGE_SIZE - 1); 799 799 dma->pgtbl = dma_alloc_coherent(&dev->pcidev->dev, dma->pgtbl_size, 800 800 &dma->pgtbl_map, GFP_ATOMIC); 801 801 if (dma->pgtbl == NULL) ··· 900 900 if (BNX2_CHIP(cp) == BNX2_CHIP_5709) { 901 901 int i, k, arr_size; 902 902 903 - cp->ctx_blk_size = BNX2_PAGE_SIZE; 904 - cp->cids_per_blk = BNX2_PAGE_SIZE / 128; 903 + cp->ctx_blk_size = CNIC_PAGE_SIZE; 904 + cp->cids_per_blk = CNIC_PAGE_SIZE / 128; 905 905 arr_size = BNX2_MAX_CID / cp->cids_per_blk * 906 906 sizeof(struct cnic_ctx); 907 907 cp->ctx_arr = kzalloc(arr_size, GFP_KERNEL); ··· 933 933 for (i = 0; i < cp->ctx_blks; i++) { 934 934 cp->ctx_arr[i].ctx = 935 935 dma_alloc_coherent(&dev->pcidev->dev, 936 - BNX2_PAGE_SIZE, 936 + CNIC_PAGE_SIZE, 937 937 &cp->ctx_arr[i].mapping, 938 938 GFP_KERNEL); 939 939 if (cp->ctx_arr[i].ctx == NULL) ··· 1013 1013 if (udev->l2_ring) 1014 1014 return 0; 1015 1015 1016 - udev->l2_ring_size = pages * BNX2_PAGE_SIZE; 1016 + udev->l2_ring_size = pages * CNIC_PAGE_SIZE; 1017 1017 udev->l2_ring = dma_alloc_coherent(&udev->pdev->dev, udev->l2_ring_size, 1018 1018 &udev->l2_ring_map, 1019 1019 GFP_KERNEL | __GFP_COMP); ··· 1021 1021 return -ENOMEM; 1022 1022 1023 1023 udev->l2_buf_size = (cp->l2_rx_ring_size + 1) * cp->l2_single_buf_size; 1024 - udev->l2_buf_size = PAGE_ALIGN(udev->l2_buf_size); 1024 + udev->l2_buf_size = CNIC_PAGE_ALIGN(udev->l2_buf_size); 1025 1025 udev->l2_buf = dma_alloc_coherent(&udev->pdev->dev, udev->l2_buf_size, 1026 1026 &udev->l2_buf_map, 1027 1027 GFP_KERNEL | __GFP_COMP); ··· 1102 1102 uinfo->mem[0].size = MB_GET_CID_ADDR(TX_TSS_CID + 1103 1103 TX_MAX_TSS_RINGS + 1); 1104 1104 uinfo->mem[1].addr = (unsigned long) cp->status_blk.gen & 1105 - PAGE_MASK; 1105 + CNIC_PAGE_MASK; 1106 1106 if (cp->ethdev->drv_state & CNIC_DRV_STATE_USING_MSIX) 1107 1107 uinfo->mem[1].size = BNX2_SBLK_MSIX_ALIGN_SIZE * 9; 1108 1108 else ··· 1113 1113 uinfo->mem[0].size = pci_resource_len(dev->pcidev, 0); 1114 1114 1115 1115 uinfo->mem[1].addr = (unsigned long) cp->bnx2x_def_status_blk & 1116 - PAGE_MASK; 1116 + CNIC_PAGE_MASK; 1117 1117 uinfo->mem[1].size = sizeof(*cp->bnx2x_def_status_blk); 1118 1118 1119 1119 uinfo->name = "bnx2x_cnic"; ··· 1267 1267 for (i = MAX_ISCSI_TBL_SZ; i < cp->max_cid_space; i++) 1268 1268 cp->ctx_tbl[i].ulp_proto_id = CNIC_ULP_FCOE; 1269 1269 1270 - pages = PAGE_ALIGN(cp->max_cid_space * CNIC_KWQ16_DATA_SIZE) / 1271 - PAGE_SIZE; 1270 + pages = CNIC_PAGE_ALIGN(cp->max_cid_space * CNIC_KWQ16_DATA_SIZE) / 1271 + CNIC_PAGE_SIZE; 1272 1272 1273 1273 ret = cnic_alloc_dma(dev, kwq_16_dma, pages, 0); 1274 1274 if (ret) 1275 1275 return -ENOMEM; 1276 1276 1277 - n = PAGE_SIZE / CNIC_KWQ16_DATA_SIZE; 1277 + n = CNIC_PAGE_SIZE / CNIC_KWQ16_DATA_SIZE; 1278 1278 for (i = 0, j = 0; i < cp->max_cid_space; i++) { 1279 1279 long off = CNIC_KWQ16_DATA_SIZE * (i % n); 1280 1280 ··· 1296 1296 goto error; 1297 1297 } 1298 1298 1299 - pages = PAGE_ALIGN(BNX2X_ISCSI_GLB_BUF_SIZE) / PAGE_SIZE; 1299 + pages = CNIC_PAGE_ALIGN(BNX2X_ISCSI_GLB_BUF_SIZE) / CNIC_PAGE_SIZE; 1300 1300 ret = cnic_alloc_dma(dev, &cp->gbl_buf_info, pages, 0); 1301 1301 if (ret) 1302 1302 goto error; ··· 1466 1466 cp->r2tq_size = cp->num_iscsi_tasks * BNX2X_ISCSI_MAX_PENDING_R2TS * 1467 1467 BNX2X_ISCSI_R2TQE_SIZE; 1468 1468 cp->hq_size = cp->num_ccells * BNX2X_ISCSI_HQ_BD_SIZE; 1469 - pages = PAGE_ALIGN(cp->hq_size) / PAGE_SIZE; 1470 - hq_bds = pages * (PAGE_SIZE / BNX2X_ISCSI_HQ_BD_SIZE); 1469 + pages = CNIC_PAGE_ALIGN(cp->hq_size) / CNIC_PAGE_SIZE; 1470 + hq_bds = pages * (CNIC_PAGE_SIZE / BNX2X_ISCSI_HQ_BD_SIZE); 1471 1471 cp->num_cqs = req1->num_cqs; 1472 1472 1473 1473 if (!dev->max_iscsi_conn) ··· 1477 1477 CNIC_WR16(dev, BAR_TSTRORM_INTMEM + TSTORM_ISCSI_RQ_SIZE_OFFSET(pfid), 1478 1478 req1->rq_num_wqes); 1479 1479 CNIC_WR16(dev, BAR_TSTRORM_INTMEM + TSTORM_ISCSI_PAGE_SIZE_OFFSET(pfid), 1480 - PAGE_SIZE); 1480 + CNIC_PAGE_SIZE); 1481 1481 CNIC_WR8(dev, BAR_TSTRORM_INTMEM + 1482 - TSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfid), PAGE_SHIFT); 1482 + TSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfid), CNIC_PAGE_BITS); 1483 1483 CNIC_WR16(dev, BAR_TSTRORM_INTMEM + 1484 1484 TSTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfid), 1485 1485 req1->num_tasks_per_conn); ··· 1489 1489 USTORM_ISCSI_RQ_BUFFER_SIZE_OFFSET(pfid), 1490 1490 req1->rq_buffer_size); 1491 1491 CNIC_WR16(dev, BAR_USTRORM_INTMEM + USTORM_ISCSI_PAGE_SIZE_OFFSET(pfid), 1492 - PAGE_SIZE); 1492 + CNIC_PAGE_SIZE); 1493 1493 CNIC_WR8(dev, BAR_USTRORM_INTMEM + 1494 - USTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfid), PAGE_SHIFT); 1494 + USTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfid), CNIC_PAGE_BITS); 1495 1495 CNIC_WR16(dev, BAR_USTRORM_INTMEM + 1496 1496 USTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfid), 1497 1497 req1->num_tasks_per_conn); ··· 1504 1504 1505 1505 /* init Xstorm RAM */ 1506 1506 CNIC_WR16(dev, BAR_XSTRORM_INTMEM + XSTORM_ISCSI_PAGE_SIZE_OFFSET(pfid), 1507 - PAGE_SIZE); 1507 + CNIC_PAGE_SIZE); 1508 1508 CNIC_WR8(dev, BAR_XSTRORM_INTMEM + 1509 - XSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfid), PAGE_SHIFT); 1509 + XSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfid), CNIC_PAGE_BITS); 1510 1510 CNIC_WR16(dev, BAR_XSTRORM_INTMEM + 1511 1511 XSTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfid), 1512 1512 req1->num_tasks_per_conn); ··· 1519 1519 1520 1520 /* init Cstorm RAM */ 1521 1521 CNIC_WR16(dev, BAR_CSTRORM_INTMEM + CSTORM_ISCSI_PAGE_SIZE_OFFSET(pfid), 1522 - PAGE_SIZE); 1522 + CNIC_PAGE_SIZE); 1523 1523 CNIC_WR8(dev, BAR_CSTRORM_INTMEM + 1524 - CSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfid), PAGE_SHIFT); 1524 + CSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfid), CNIC_PAGE_BITS); 1525 1525 CNIC_WR16(dev, BAR_CSTRORM_INTMEM + 1526 1526 CSTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfid), 1527 1527 req1->num_tasks_per_conn); ··· 1623 1623 } 1624 1624 1625 1625 ctx->cid = cid; 1626 - pages = PAGE_ALIGN(cp->task_array_size) / PAGE_SIZE; 1626 + pages = CNIC_PAGE_ALIGN(cp->task_array_size) / CNIC_PAGE_SIZE; 1627 1627 1628 1628 ret = cnic_alloc_dma(dev, &iscsi->task_array_info, pages, 1); 1629 1629 if (ret) 1630 1630 goto error; 1631 1631 1632 - pages = PAGE_ALIGN(cp->r2tq_size) / PAGE_SIZE; 1632 + pages = CNIC_PAGE_ALIGN(cp->r2tq_size) / CNIC_PAGE_SIZE; 1633 1633 ret = cnic_alloc_dma(dev, &iscsi->r2tq_info, pages, 1); 1634 1634 if (ret) 1635 1635 goto error; 1636 1636 1637 - pages = PAGE_ALIGN(cp->hq_size) / PAGE_SIZE; 1637 + pages = CNIC_PAGE_ALIGN(cp->hq_size) / CNIC_PAGE_SIZE; 1638 1638 ret = cnic_alloc_dma(dev, &iscsi->hq_info, pages, 1); 1639 1639 if (ret) 1640 1640 goto error; ··· 1760 1760 ictx->tstorm_st_context.iscsi.hdr_bytes_2_fetch = ISCSI_HEADER_SIZE; 1761 1761 /* TSTORM requires the base address of RQ DB & not PTE */ 1762 1762 ictx->tstorm_st_context.iscsi.rq_db_phy_addr.lo = 1763 - req2->rq_page_table_addr_lo & PAGE_MASK; 1763 + req2->rq_page_table_addr_lo & CNIC_PAGE_MASK; 1764 1764 ictx->tstorm_st_context.iscsi.rq_db_phy_addr.hi = 1765 1765 req2->rq_page_table_addr_hi; 1766 1766 ictx->tstorm_st_context.iscsi.iscsi_conn_id = req1->iscsi_conn_id; ··· 1842 1842 /* CSTORM and USTORM initialization is different, CSTORM requires 1843 1843 * CQ DB base & not PTE addr */ 1844 1844 ictx->cstorm_st_context.cq_db_base.lo = 1845 - req1->cq_page_table_addr_lo & PAGE_MASK; 1845 + req1->cq_page_table_addr_lo & CNIC_PAGE_MASK; 1846 1846 ictx->cstorm_st_context.cq_db_base.hi = req1->cq_page_table_addr_hi; 1847 1847 ictx->cstorm_st_context.iscsi_conn_id = req1->iscsi_conn_id; 1848 1848 ictx->cstorm_st_context.cq_proc_en_bit_map = (1 << cp->num_cqs) - 1; ··· 2911 2911 u16 hw_cons, sw_cons; 2912 2912 struct cnic_uio_dev *udev = cp->udev; 2913 2913 union eth_rx_cqe *cqe, *cqe_ring = (union eth_rx_cqe *) 2914 - (udev->l2_ring + (2 * BNX2_PAGE_SIZE)); 2914 + (udev->l2_ring + (2 * CNIC_PAGE_SIZE)); 2915 2915 u32 cmd; 2916 2916 int comp = 0; 2917 2917 ··· 3244 3244 int rc; 3245 3245 3246 3246 mutex_lock(&cnic_lock); 3247 - ulp_ops = cnic_ulp_tbl_prot(ulp_type); 3247 + ulp_ops = rcu_dereference_protected(cp->ulp_ops[ulp_type], 3248 + lockdep_is_held(&cnic_lock)); 3248 3249 if (ulp_ops && ulp_ops->cnic_get_stats) 3249 3250 rc = ulp_ops->cnic_get_stats(cp->ulp_handle[ulp_type]); 3250 3251 else ··· 4385 4384 u32 idx = cp->ctx_arr[i].cid / cp->cids_per_blk; 4386 4385 u32 val; 4387 4386 4388 - memset(cp->ctx_arr[i].ctx, 0, BNX2_PAGE_SIZE); 4387 + memset(cp->ctx_arr[i].ctx, 0, CNIC_PAGE_SIZE); 4389 4388 4390 4389 CNIC_WR(dev, BNX2_CTX_HOST_PAGE_TBL_DATA0, 4391 4390 (cp->ctx_arr[i].mapping & 0xffffffff) | valid_bit); ··· 4629 4628 val = BNX2_L2CTX_L2_STATUSB_NUM(sb_id); 4630 4629 cnic_ctx_wr(dev, cid_addr, BNX2_L2CTX_HOST_BDIDX, val); 4631 4630 4632 - rxbd = udev->l2_ring + BNX2_PAGE_SIZE; 4631 + rxbd = udev->l2_ring + CNIC_PAGE_SIZE; 4633 4632 for (i = 0; i < BNX2_MAX_RX_DESC_CNT; i++, rxbd++) { 4634 4633 dma_addr_t buf_map; 4635 4634 int n = (i % cp->l2_rx_ring_size) + 1; ··· 4640 4639 rxbd->rx_bd_haddr_hi = (u64) buf_map >> 32; 4641 4640 rxbd->rx_bd_haddr_lo = (u64) buf_map & 0xffffffff; 4642 4641 } 4643 - val = (u64) (ring_map + BNX2_PAGE_SIZE) >> 32; 4642 + val = (u64) (ring_map + CNIC_PAGE_SIZE) >> 32; 4644 4643 cnic_ctx_wr(dev, cid_addr, BNX2_L2CTX_NX_BDHADDR_HI, val); 4645 4644 rxbd->rx_bd_haddr_hi = val; 4646 4645 4647 - val = (u64) (ring_map + BNX2_PAGE_SIZE) & 0xffffffff; 4646 + val = (u64) (ring_map + CNIC_PAGE_SIZE) & 0xffffffff; 4648 4647 cnic_ctx_wr(dev, cid_addr, BNX2_L2CTX_NX_BDHADDR_LO, val); 4649 4648 rxbd->rx_bd_haddr_lo = val; 4650 4649 ··· 4710 4709 4711 4710 val = CNIC_RD(dev, BNX2_MQ_CONFIG); 4712 4711 val &= ~BNX2_MQ_CONFIG_KNL_BYP_BLK_SIZE; 4713 - if (BNX2_PAGE_BITS > 12) 4712 + if (CNIC_PAGE_BITS > 12) 4714 4713 val |= (12 - 8) << 4; 4715 4714 else 4716 - val |= (BNX2_PAGE_BITS - 8) << 4; 4715 + val |= (CNIC_PAGE_BITS - 8) << 4; 4717 4716 4718 4717 CNIC_WR(dev, BNX2_MQ_CONFIG, val); 4719 4718 ··· 4743 4742 4744 4743 /* Initialize the kernel work queue context. */ 4745 4744 val = KRNLQ_TYPE_TYPE_KRNLQ | KRNLQ_SIZE_TYPE_SIZE | 4746 - (BNX2_PAGE_BITS - 8) | KRNLQ_FLAGS_QE_SELF_SEQ; 4745 + (CNIC_PAGE_BITS - 8) | KRNLQ_FLAGS_QE_SELF_SEQ; 4747 4746 cnic_ctx_wr(dev, kwq_cid_addr, L5_KRNLQ_TYPE, val); 4748 4747 4749 - val = (BNX2_PAGE_SIZE / sizeof(struct kwqe) - 1) << 16; 4748 + val = (CNIC_PAGE_SIZE / sizeof(struct kwqe) - 1) << 16; 4750 4749 cnic_ctx_wr(dev, kwq_cid_addr, L5_KRNLQ_QE_SELF_SEQ_MAX, val); 4751 4750 4752 - val = ((BNX2_PAGE_SIZE / sizeof(struct kwqe)) << 16) | KWQ_PAGE_CNT; 4751 + val = ((CNIC_PAGE_SIZE / sizeof(struct kwqe)) << 16) | KWQ_PAGE_CNT; 4753 4752 cnic_ctx_wr(dev, kwq_cid_addr, L5_KRNLQ_PGTBL_NPAGES, val); 4754 4753 4755 4754 val = (u32) ((u64) cp->kwq_info.pgtbl_map >> 32); ··· 4769 4768 4770 4769 /* Initialize the kernel complete queue context. */ 4771 4770 val = KRNLQ_TYPE_TYPE_KRNLQ | KRNLQ_SIZE_TYPE_SIZE | 4772 - (BNX2_PAGE_BITS - 8) | KRNLQ_FLAGS_QE_SELF_SEQ; 4771 + (CNIC_PAGE_BITS - 8) | KRNLQ_FLAGS_QE_SELF_SEQ; 4773 4772 cnic_ctx_wr(dev, kcq_cid_addr, L5_KRNLQ_TYPE, val); 4774 4773 4775 - val = (BNX2_PAGE_SIZE / sizeof(struct kcqe) - 1) << 16; 4774 + val = (CNIC_PAGE_SIZE / sizeof(struct kcqe) - 1) << 16; 4776 4775 cnic_ctx_wr(dev, kcq_cid_addr, L5_KRNLQ_QE_SELF_SEQ_MAX, val); 4777 4776 4778 - val = ((BNX2_PAGE_SIZE / sizeof(struct kcqe)) << 16) | KCQ_PAGE_CNT; 4777 + val = ((CNIC_PAGE_SIZE / sizeof(struct kcqe)) << 16) | KCQ_PAGE_CNT; 4779 4778 cnic_ctx_wr(dev, kcq_cid_addr, L5_KRNLQ_PGTBL_NPAGES, val); 4780 4779 4781 4780 val = (u32) ((u64) cp->kcq1.dma.pgtbl_map >> 32); ··· 4919 4918 u32 cli = cp->ethdev->iscsi_l2_client_id; 4920 4919 u32 val; 4921 4920 4922 - memset(txbd, 0, BNX2_PAGE_SIZE); 4921 + memset(txbd, 0, CNIC_PAGE_SIZE); 4923 4922 4924 4923 buf_map = udev->l2_buf_map; 4925 4924 for (i = 0; i < BNX2_MAX_TX_DESC_CNT; i += 3, txbd += 3) { ··· 4979 4978 struct bnx2x *bp = netdev_priv(dev->netdev); 4980 4979 struct cnic_uio_dev *udev = cp->udev; 4981 4980 struct eth_rx_bd *rxbd = (struct eth_rx_bd *) (udev->l2_ring + 4982 - BNX2_PAGE_SIZE); 4981 + CNIC_PAGE_SIZE); 4983 4982 struct eth_rx_cqe_next_page *rxcqe = (struct eth_rx_cqe_next_page *) 4984 - (udev->l2_ring + (2 * BNX2_PAGE_SIZE)); 4983 + (udev->l2_ring + (2 * CNIC_PAGE_SIZE)); 4985 4984 struct host_sp_status_block *sb = cp->bnx2x_def_status_blk; 4986 4985 int i; 4987 4986 u32 cli = cp->ethdev->iscsi_l2_client_id; ··· 5005 5004 rxbd->addr_lo = cpu_to_le32(buf_map & 0xffffffff); 5006 5005 } 5007 5006 5008 - val = (u64) (ring_map + BNX2_PAGE_SIZE) >> 32; 5007 + val = (u64) (ring_map + CNIC_PAGE_SIZE) >> 32; 5009 5008 rxbd->addr_hi = cpu_to_le32(val); 5010 5009 data->rx.bd_page_base.hi = cpu_to_le32(val); 5011 5010 5012 - val = (u64) (ring_map + BNX2_PAGE_SIZE) & 0xffffffff; 5011 + val = (u64) (ring_map + CNIC_PAGE_SIZE) & 0xffffffff; 5013 5012 rxbd->addr_lo = cpu_to_le32(val); 5014 5013 data->rx.bd_page_base.lo = cpu_to_le32(val); 5015 5014 5016 5015 rxcqe += BNX2X_MAX_RCQ_DESC_CNT; 5017 - val = (u64) (ring_map + (2 * BNX2_PAGE_SIZE)) >> 32; 5016 + val = (u64) (ring_map + (2 * CNIC_PAGE_SIZE)) >> 32; 5018 5017 rxcqe->addr_hi = cpu_to_le32(val); 5019 5018 data->rx.cqe_page_base.hi = cpu_to_le32(val); 5020 5019 5021 - val = (u64) (ring_map + (2 * BNX2_PAGE_SIZE)) & 0xffffffff; 5020 + val = (u64) (ring_map + (2 * CNIC_PAGE_SIZE)) & 0xffffffff; 5022 5021 rxcqe->addr_lo = cpu_to_le32(val); 5023 5022 data->rx.cqe_page_base.lo = cpu_to_le32(val); 5024 5023 ··· 5266 5265 msleep(10); 5267 5266 } 5268 5267 clear_bit(CNIC_LCL_FL_RINGS_INITED, &cp->cnic_local_flags); 5269 - rx_ring = udev->l2_ring + BNX2_PAGE_SIZE; 5270 - memset(rx_ring, 0, BNX2_PAGE_SIZE); 5268 + rx_ring = udev->l2_ring + CNIC_PAGE_SIZE; 5269 + memset(rx_ring, 0, CNIC_PAGE_SIZE); 5271 5270 } 5272 5271 5273 5272 static int cnic_register_netdev(struct cnic_dev *dev)
+1 -1
drivers/net/ethernet/broadcom/cnic.h
··· 1 1 /* cnic.h: Broadcom CNIC core network driver. 2 2 * 3 - * Copyright (c) 2006-2013 Broadcom Corporation 3 + * Copyright (c) 2006-2014 Broadcom Corporation 4 4 * 5 5 * This program is free software; you can redistribute it and/or modify 6 6 * it under the terms of the GNU General Public License as published by
+1 -1
drivers/net/ethernet/broadcom/cnic_defs.h
··· 1 1 2 2 /* cnic.c: Broadcom CNIC core network driver. 3 3 * 4 - * Copyright (c) 2006-2013 Broadcom Corporation 4 + * Copyright (c) 2006-2014 Broadcom Corporation 5 5 * 6 6 * This program is free software; you can redistribute it and/or modify 7 7 * it under the terms of the GNU General Public License as published by
+13 -3
drivers/net/ethernet/broadcom/cnic_if.h
··· 1 1 /* cnic_if.h: Broadcom CNIC core network driver. 2 2 * 3 - * Copyright (c) 2006-2013 Broadcom Corporation 3 + * Copyright (c) 2006-2014 Broadcom Corporation 4 4 * 5 5 * This program is free software; you can redistribute it and/or modify 6 6 * it under the terms of the GNU General Public License as published by ··· 14 14 15 15 #include "bnx2x/bnx2x_mfw_req.h" 16 16 17 - #define CNIC_MODULE_VERSION "2.5.19" 18 - #define CNIC_MODULE_RELDATE "December 19, 2013" 17 + #define CNIC_MODULE_VERSION "2.5.20" 18 + #define CNIC_MODULE_RELDATE "March 14, 2014" 19 19 20 20 #define CNIC_ULP_RDMA 0 21 21 #define CNIC_ULP_ISCSI 1 ··· 23 23 #define CNIC_ULP_L4 3 24 24 #define MAX_CNIC_ULP_TYPE_EXT 3 25 25 #define MAX_CNIC_ULP_TYPE 4 26 + 27 + /* Use CPU native page size up to 16K for cnic ring sizes. */ 28 + #if (PAGE_SHIFT > 14) 29 + #define CNIC_PAGE_BITS 14 30 + #else 31 + #define CNIC_PAGE_BITS PAGE_SHIFT 32 + #endif 33 + #define CNIC_PAGE_SIZE (1 << (CNIC_PAGE_BITS)) 34 + #define CNIC_PAGE_ALIGN(addr) ALIGN(addr, CNIC_PAGE_SIZE) 35 + #define CNIC_PAGE_MASK (~((CNIC_PAGE_SIZE) - 1)) 26 36 27 37 struct kwqe { 28 38 u32 kwqe_op_flag;
+29 -1
drivers/net/ethernet/micrel/ks8851.c
··· 23 23 #include <linux/crc32.h> 24 24 #include <linux/mii.h> 25 25 #include <linux/eeprom_93cx6.h> 26 + #include <linux/regulator/consumer.h> 26 27 27 28 #include <linux/spi/spi.h> 28 29 ··· 84 83 * @rc_rxqcr: Cached copy of KS_RXQCR. 85 84 * @eeprom_size: Companion eeprom size in Bytes, 0 if no eeprom 86 85 * @eeprom: 93CX6 EEPROM state for accessing on-board EEPROM. 86 + * @vdd_reg: Optional regulator supplying the chip 87 87 * 88 88 * The @lock ensures that the chip is protected when certain operations are 89 89 * in progress. When the read or write packet transfer is in progress, most ··· 132 130 struct spi_transfer spi_xfer2[2]; 133 131 134 132 struct eeprom_93cx6 eeprom; 133 + struct regulator *vdd_reg; 135 134 }; 136 135 137 136 static int msg_enable; ··· 1417 1414 ks->spidev = spi; 1418 1415 ks->tx_space = 6144; 1419 1416 1417 + ks->vdd_reg = regulator_get_optional(&spi->dev, "vdd"); 1418 + if (IS_ERR(ks->vdd_reg)) { 1419 + ret = PTR_ERR(ks->vdd_reg); 1420 + if (ret == -EPROBE_DEFER) 1421 + goto err_reg; 1422 + } else { 1423 + ret = regulator_enable(ks->vdd_reg); 1424 + if (ret) { 1425 + dev_err(&spi->dev, "regulator enable fail: %d\n", 1426 + ret); 1427 + goto err_reg_en; 1428 + } 1429 + } 1430 + 1431 + 1420 1432 mutex_init(&ks->lock); 1421 1433 spin_lock_init(&ks->statelock); 1422 1434 ··· 1526 1508 err_netdev: 1527 1509 free_irq(ndev->irq, ks); 1528 1510 1529 - err_id: 1530 1511 err_irq: 1512 + err_id: 1513 + if (!IS_ERR(ks->vdd_reg)) 1514 + regulator_disable(ks->vdd_reg); 1515 + err_reg_en: 1516 + if (!IS_ERR(ks->vdd_reg)) 1517 + regulator_put(ks->vdd_reg); 1518 + err_reg: 1531 1519 free_netdev(ndev); 1532 1520 return ret; 1533 1521 } ··· 1547 1523 1548 1524 unregister_netdev(priv->netdev); 1549 1525 free_irq(spi->irq, priv); 1526 + if (!IS_ERR(priv->vdd_reg)) { 1527 + regulator_disable(priv->vdd_reg); 1528 + regulator_put(priv->vdd_reg); 1529 + } 1550 1530 free_netdev(priv->netdev); 1551 1531 1552 1532 return 0;
-4
drivers/net/ethernet/ti/cpsw.c
··· 2229 2229 goto clean_ale_ret; 2230 2230 } 2231 2231 2232 - if (cpts_register(&pdev->dev, priv->cpts, 2233 - data->cpts_clock_mult, data->cpts_clock_shift)) 2234 - dev_err(priv->dev, "error registering cpts device\n"); 2235 - 2236 2232 cpsw_notice(priv, probe, "initialized device (regs %pa, irq %d)\n", 2237 2233 &ss_res->start, ndev->irq); 2238 2234
+2 -2
drivers/net/ethernet/ti/davinci_cpdma.c
··· 355 355 int i; 356 356 357 357 spin_lock_irqsave(&ctlr->lock, flags); 358 - if (ctlr->state != CPDMA_STATE_ACTIVE) { 358 + if (ctlr->state == CPDMA_STATE_TEARDOWN) { 359 359 spin_unlock_irqrestore(&ctlr->lock, flags); 360 360 return -EINVAL; 361 361 } ··· 891 891 unsigned timeout; 892 892 893 893 spin_lock_irqsave(&chan->lock, flags); 894 - if (chan->state != CPDMA_STATE_ACTIVE) { 894 + if (chan->state == CPDMA_STATE_TEARDOWN) { 895 895 spin_unlock_irqrestore(&chan->lock, flags); 896 896 return -EINVAL; 897 897 }
+42 -11
drivers/net/ethernet/ti/davinci_emac.c
··· 1532 1532 struct device *emac_dev = &ndev->dev; 1533 1533 u32 cnt; 1534 1534 struct resource *res; 1535 - int ret; 1535 + int q, m, ret; 1536 + int res_num = 0, irq_num = 0; 1536 1537 int i = 0; 1537 - int k = 0; 1538 1538 struct emac_priv *priv = netdev_priv(ndev); 1539 1539 1540 1540 pm_runtime_get(&priv->pdev->dev); ··· 1564 1564 } 1565 1565 1566 1566 /* Request IRQ */ 1567 + while ((res = platform_get_resource(priv->pdev, IORESOURCE_IRQ, 1568 + res_num))) { 1569 + for (irq_num = res->start; irq_num <= res->end; irq_num++) { 1570 + dev_err(emac_dev, "Request IRQ %d\n", irq_num); 1571 + if (request_irq(irq_num, emac_irq, 0, ndev->name, 1572 + ndev)) { 1573 + dev_err(emac_dev, 1574 + "DaVinci EMAC: request_irq() failed\n"); 1575 + ret = -EBUSY; 1567 1576 1568 - while ((res = platform_get_resource(priv->pdev, IORESOURCE_IRQ, k))) { 1569 - for (i = res->start; i <= res->end; i++) { 1570 - if (devm_request_irq(&priv->pdev->dev, i, emac_irq, 1571 - 0, ndev->name, ndev)) 1572 1577 goto rollback; 1578 + } 1573 1579 } 1574 - k++; 1580 + res_num++; 1575 1581 } 1582 + /* prepare counters for rollback in case of an error */ 1583 + res_num--; 1584 + irq_num--; 1576 1585 1577 1586 /* Start/Enable EMAC hardware */ 1578 1587 emac_hw_enable(priv); ··· 1648 1639 1649 1640 return 0; 1650 1641 1651 - rollback: 1652 - 1653 - dev_err(emac_dev, "DaVinci EMAC: devm_request_irq() failed"); 1654 - ret = -EBUSY; 1655 1642 err: 1643 + emac_int_disable(priv); 1644 + napi_disable(&priv->napi); 1645 + 1646 + rollback: 1647 + for (q = res_num; q >= 0; q--) { 1648 + res = platform_get_resource(priv->pdev, IORESOURCE_IRQ, q); 1649 + /* at the first iteration, irq_num is already set to the 1650 + * right value 1651 + */ 1652 + if (q != res_num) 1653 + irq_num = res->end; 1654 + 1655 + for (m = irq_num; m >= res->start; m--) 1656 + free_irq(m, ndev); 1657 + } 1658 + cpdma_ctlr_stop(priv->dma); 1656 1659 pm_runtime_put(&priv->pdev->dev); 1657 1660 return ret; 1658 1661 } ··· 1680 1659 */ 1681 1660 static int emac_dev_stop(struct net_device *ndev) 1682 1661 { 1662 + struct resource *res; 1663 + int i = 0; 1664 + int irq_num; 1683 1665 struct emac_priv *priv = netdev_priv(ndev); 1684 1666 struct device *emac_dev = &ndev->dev; 1685 1667 ··· 1697 1673 1698 1674 if (priv->phydev) 1699 1675 phy_disconnect(priv->phydev); 1676 + 1677 + /* Free IRQ */ 1678 + while ((res = platform_get_resource(priv->pdev, IORESOURCE_IRQ, i))) { 1679 + for (irq_num = res->start; irq_num <= res->end; irq_num++) 1680 + free_irq(irq_num, priv->ndev); 1681 + i++; 1682 + } 1700 1683 1701 1684 if (netif_msg_drv(priv)) 1702 1685 dev_notice(emac_dev, "DaVinci EMAC: %s stopped\n", ndev->name);
+5 -3
drivers/net/ethernet/via/via-rhine.c
··· 923 923 if (rc) { 924 924 dev_err(&pdev->dev, 925 925 "32-bit PCI DMA addresses not supported by the card!?\n"); 926 - goto err_out; 926 + goto err_out_pci_disable; 927 927 } 928 928 929 929 /* sanity check */ ··· 931 931 (pci_resource_len(pdev, 1) < io_size)) { 932 932 rc = -EIO; 933 933 dev_err(&pdev->dev, "Insufficient PCI resources, aborting\n"); 934 - goto err_out; 934 + goto err_out_pci_disable; 935 935 } 936 936 937 937 pioaddr = pci_resource_start(pdev, 0); ··· 942 942 dev = alloc_etherdev(sizeof(struct rhine_private)); 943 943 if (!dev) { 944 944 rc = -ENOMEM; 945 - goto err_out; 945 + goto err_out_pci_disable; 946 946 } 947 947 SET_NETDEV_DEV(dev, &pdev->dev); 948 948 ··· 1084 1084 pci_release_regions(pdev); 1085 1085 err_out_free_netdev: 1086 1086 free_netdev(dev); 1087 + err_out_pci_disable: 1088 + pci_disable_device(pdev); 1087 1089 err_out: 1088 1090 return rc; 1089 1091 }
+1 -2
drivers/net/phy/phy_device.c
··· 683 683 int phy_suspend(struct phy_device *phydev) 684 684 { 685 685 struct phy_driver *phydrv = to_phy_driver(phydev->dev.driver); 686 - struct ethtool_wolinfo wol; 686 + struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL }; 687 687 688 688 /* If the device has WOL enabled, we cannot suspend the PHY */ 689 - wol.cmd = ETHTOOL_GWOL; 690 689 phy_ethtool_get_wol(phydev, &wol); 691 690 if (wol.wolopts) 692 691 return -EBUSY;
+23 -25
drivers/net/usb/cdc_ncm.c
··· 68 68 static int cdc_ncm_setup(struct usbnet *dev) 69 69 { 70 70 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; 71 - struct usb_cdc_ncm_ntb_parameters ncm_parm; 72 71 u32 val; 73 72 u8 flags; 74 73 u8 iface_no; ··· 81 82 err = usbnet_read_cmd(dev, USB_CDC_GET_NTB_PARAMETERS, 82 83 USB_TYPE_CLASS | USB_DIR_IN 83 84 |USB_RECIP_INTERFACE, 84 - 0, iface_no, &ncm_parm, 85 - sizeof(ncm_parm)); 85 + 0, iface_no, &ctx->ncm_parm, 86 + sizeof(ctx->ncm_parm)); 86 87 if (err < 0) { 87 88 dev_err(&dev->intf->dev, "failed GET_NTB_PARAMETERS\n"); 88 89 return err; /* GET_NTB_PARAMETERS is required */ 89 90 } 90 91 91 92 /* read correct set of parameters according to device mode */ 92 - ctx->rx_max = le32_to_cpu(ncm_parm.dwNtbInMaxSize); 93 - ctx->tx_max = le32_to_cpu(ncm_parm.dwNtbOutMaxSize); 94 - ctx->tx_remainder = le16_to_cpu(ncm_parm.wNdpOutPayloadRemainder); 95 - ctx->tx_modulus = le16_to_cpu(ncm_parm.wNdpOutDivisor); 96 - ctx->tx_ndp_modulus = le16_to_cpu(ncm_parm.wNdpOutAlignment); 93 + ctx->rx_max = le32_to_cpu(ctx->ncm_parm.dwNtbInMaxSize); 94 + ctx->tx_max = le32_to_cpu(ctx->ncm_parm.dwNtbOutMaxSize); 95 + ctx->tx_remainder = le16_to_cpu(ctx->ncm_parm.wNdpOutPayloadRemainder); 96 + ctx->tx_modulus = le16_to_cpu(ctx->ncm_parm.wNdpOutDivisor); 97 + ctx->tx_ndp_modulus = le16_to_cpu(ctx->ncm_parm.wNdpOutAlignment); 97 98 /* devices prior to NCM Errata shall set this field to zero */ 98 - ctx->tx_max_datagrams = le16_to_cpu(ncm_parm.wNtbOutMaxDatagrams); 99 - ntb_fmt_supported = le16_to_cpu(ncm_parm.bmNtbFormatsSupported); 99 + ctx->tx_max_datagrams = le16_to_cpu(ctx->ncm_parm.wNtbOutMaxDatagrams); 100 + ntb_fmt_supported = le16_to_cpu(ctx->ncm_parm.bmNtbFormatsSupported); 100 101 101 102 /* there are some minor differences in NCM and MBIM defaults */ 102 103 if (cdc_ncm_comm_intf_is_mbim(ctx->control->cur_altsetting)) { ··· 145 146 } 146 147 147 148 /* inform device about NTB input size changes */ 148 - if (ctx->rx_max != le32_to_cpu(ncm_parm.dwNtbInMaxSize)) { 149 + if (ctx->rx_max != le32_to_cpu(ctx->ncm_parm.dwNtbInMaxSize)) { 149 150 __le32 dwNtbInMaxSize = cpu_to_le32(ctx->rx_max); 150 151 151 152 err = usbnet_write_cmd(dev, USB_CDC_SET_NTB_INPUT_SIZE, ··· 161 162 dev_dbg(&dev->intf->dev, "Using default maximum transmit length=%d\n", 162 163 CDC_NCM_NTB_MAX_SIZE_TX); 163 164 ctx->tx_max = CDC_NCM_NTB_MAX_SIZE_TX; 164 - 165 - /* Adding a pad byte here simplifies the handling in 166 - * cdc_ncm_fill_tx_frame, by making tx_max always 167 - * represent the real skb max size. 168 - */ 169 - if (ctx->tx_max % usb_maxpacket(dev->udev, dev->out, 1) == 0) 170 - ctx->tx_max++; 171 - 172 165 } 173 166 174 167 /* ··· 430 439 goto error2; 431 440 } 432 441 442 + /* initialize data interface */ 443 + if (cdc_ncm_setup(dev)) 444 + goto error2; 445 + 433 446 /* configure data interface */ 434 447 temp = usb_set_interface(dev->udev, iface_no, data_altsetting); 435 448 if (temp) { ··· 445 450 cdc_ncm_find_endpoints(dev, ctx->control); 446 451 if (!dev->in || !dev->out || !dev->status) { 447 452 dev_dbg(&intf->dev, "failed to collect endpoints\n"); 448 - goto error2; 449 - } 450 - 451 - /* initialize data interface */ 452 - if (cdc_ncm_setup(dev)) { 453 - dev_dbg(&intf->dev, "cdc_ncm_setup() failed\n"); 454 453 goto error2; 455 454 } 456 455 ··· 463 474 /* usbnet use these values for sizing tx/rx queues */ 464 475 dev->hard_mtu = ctx->tx_max; 465 476 dev->rx_urb_size = ctx->rx_max; 477 + 478 + /* cdc_ncm_setup will override dwNtbOutMaxSize if it is 479 + * outside the sane range. Adding a pad byte here if necessary 480 + * simplifies the handling in cdc_ncm_fill_tx_frame, making 481 + * tx_max always represent the real skb max size. 482 + */ 483 + if (ctx->tx_max != le32_to_cpu(ctx->ncm_parm.dwNtbOutMaxSize) && 484 + ctx->tx_max % usb_maxpacket(dev->udev, dev->out, 1) == 0) 485 + ctx->tx_max++; 466 486 467 487 return 0; 468 488
+116 -14
drivers/net/vxlan.c
··· 1318 1318 1319 1319 neigh_release(n); 1320 1320 1321 + if (reply == NULL) 1322 + goto out; 1323 + 1321 1324 skb_reset_mac_header(reply); 1322 1325 __skb_pull(reply, skb_network_offset(reply)); 1323 1326 reply->ip_summed = CHECKSUM_UNNECESSARY; ··· 1342 1339 } 1343 1340 1344 1341 #if IS_ENABLED(CONFIG_IPV6) 1342 + 1343 + static struct sk_buff *vxlan_na_create(struct sk_buff *request, 1344 + struct neighbour *n, bool isrouter) 1345 + { 1346 + struct net_device *dev = request->dev; 1347 + struct sk_buff *reply; 1348 + struct nd_msg *ns, *na; 1349 + struct ipv6hdr *pip6; 1350 + u8 *daddr; 1351 + int na_olen = 8; /* opt hdr + ETH_ALEN for target */ 1352 + int ns_olen; 1353 + int i, len; 1354 + 1355 + if (dev == NULL) 1356 + return NULL; 1357 + 1358 + len = LL_RESERVED_SPACE(dev) + sizeof(struct ipv6hdr) + 1359 + sizeof(*na) + na_olen + dev->needed_tailroom; 1360 + reply = alloc_skb(len, GFP_ATOMIC); 1361 + if (reply == NULL) 1362 + return NULL; 1363 + 1364 + reply->protocol = htons(ETH_P_IPV6); 1365 + reply->dev = dev; 1366 + skb_reserve(reply, LL_RESERVED_SPACE(request->dev)); 1367 + skb_push(reply, sizeof(struct ethhdr)); 1368 + skb_set_mac_header(reply, 0); 1369 + 1370 + ns = (struct nd_msg *)skb_transport_header(request); 1371 + 1372 + daddr = eth_hdr(request)->h_source; 1373 + ns_olen = request->len - skb_transport_offset(request) - sizeof(*ns); 1374 + for (i = 0; i < ns_olen-1; i += (ns->opt[i+1]<<3)) { 1375 + if (ns->opt[i] == ND_OPT_SOURCE_LL_ADDR) { 1376 + daddr = ns->opt + i + sizeof(struct nd_opt_hdr); 1377 + break; 1378 + } 1379 + } 1380 + 1381 + /* Ethernet header */ 1382 + ether_addr_copy(eth_hdr(reply)->h_dest, daddr); 1383 + ether_addr_copy(eth_hdr(reply)->h_source, n->ha); 1384 + eth_hdr(reply)->h_proto = htons(ETH_P_IPV6); 1385 + reply->protocol = htons(ETH_P_IPV6); 1386 + 1387 + skb_pull(reply, sizeof(struct ethhdr)); 1388 + skb_set_network_header(reply, 0); 1389 + skb_put(reply, sizeof(struct ipv6hdr)); 1390 + 1391 + /* IPv6 header */ 1392 + 1393 + pip6 = ipv6_hdr(reply); 1394 + memset(pip6, 0, sizeof(struct ipv6hdr)); 1395 + pip6->version = 6; 1396 + pip6->priority = ipv6_hdr(request)->priority; 1397 + pip6->nexthdr = IPPROTO_ICMPV6; 1398 + pip6->hop_limit = 255; 1399 + pip6->daddr = ipv6_hdr(request)->saddr; 1400 + pip6->saddr = *(struct in6_addr *)n->primary_key; 1401 + 1402 + skb_pull(reply, sizeof(struct ipv6hdr)); 1403 + skb_set_transport_header(reply, 0); 1404 + 1405 + na = (struct nd_msg *)skb_put(reply, sizeof(*na) + na_olen); 1406 + 1407 + /* Neighbor Advertisement */ 1408 + memset(na, 0, sizeof(*na)+na_olen); 1409 + na->icmph.icmp6_type = NDISC_NEIGHBOUR_ADVERTISEMENT; 1410 + na->icmph.icmp6_router = isrouter; 1411 + na->icmph.icmp6_override = 1; 1412 + na->icmph.icmp6_solicited = 1; 1413 + na->target = ns->target; 1414 + ether_addr_copy(&na->opt[2], n->ha); 1415 + na->opt[0] = ND_OPT_TARGET_LL_ADDR; 1416 + na->opt[1] = na_olen >> 3; 1417 + 1418 + na->icmph.icmp6_cksum = csum_ipv6_magic(&pip6->saddr, 1419 + &pip6->daddr, sizeof(*na)+na_olen, IPPROTO_ICMPV6, 1420 + csum_partial(na, sizeof(*na)+na_olen, 0)); 1421 + 1422 + pip6->payload_len = htons(sizeof(*na)+na_olen); 1423 + 1424 + skb_push(reply, sizeof(struct ipv6hdr)); 1425 + 1426 + reply->ip_summed = CHECKSUM_UNNECESSARY; 1427 + 1428 + return reply; 1429 + } 1430 + 1345 1431 static int neigh_reduce(struct net_device *dev, struct sk_buff *skb) 1346 1432 { 1347 1433 struct vxlan_dev *vxlan = netdev_priv(dev); 1348 - struct neighbour *n; 1349 - union vxlan_addr ipa; 1434 + struct nd_msg *msg; 1350 1435 const struct ipv6hdr *iphdr; 1351 1436 const struct in6_addr *saddr, *daddr; 1352 - struct nd_msg *msg; 1353 - struct inet6_dev *in6_dev = NULL; 1437 + struct neighbour *n; 1438 + struct inet6_dev *in6_dev; 1354 1439 1355 1440 in6_dev = __in6_dev_get(dev); 1356 1441 if (!in6_dev) ··· 1451 1360 saddr = &iphdr->saddr; 1452 1361 daddr = &iphdr->daddr; 1453 1362 1454 - if (ipv6_addr_loopback(daddr) || 1455 - ipv6_addr_is_multicast(daddr)) 1456 - goto out; 1457 - 1458 1363 msg = (struct nd_msg *)skb_transport_header(skb); 1459 1364 if (msg->icmph.icmp6_code != 0 || 1460 1365 msg->icmph.icmp6_type != NDISC_NEIGHBOUR_SOLICITATION) 1461 1366 goto out; 1462 1367 1463 - n = neigh_lookup(ipv6_stub->nd_tbl, daddr, dev); 1368 + if (ipv6_addr_loopback(daddr) || 1369 + ipv6_addr_is_multicast(&msg->target)) 1370 + goto out; 1371 + 1372 + n = neigh_lookup(ipv6_stub->nd_tbl, &msg->target, dev); 1464 1373 1465 1374 if (n) { 1466 1375 struct vxlan_fdb *f; 1376 + struct sk_buff *reply; 1467 1377 1468 1378 if (!(n->nud_state & NUD_CONNECTED)) { 1469 1379 neigh_release(n); ··· 1478 1386 goto out; 1479 1387 } 1480 1388 1481 - ipv6_stub->ndisc_send_na(dev, n, saddr, &msg->target, 1482 - !!in6_dev->cnf.forwarding, 1483 - true, false, false); 1389 + reply = vxlan_na_create(skb, n, 1390 + !!(f ? f->flags & NTF_ROUTER : 0)); 1391 + 1484 1392 neigh_release(n); 1393 + 1394 + if (reply == NULL) 1395 + goto out; 1396 + 1397 + if (netif_rx_ni(reply) == NET_RX_DROP) 1398 + dev->stats.rx_dropped++; 1399 + 1485 1400 } else if (vxlan->flags & VXLAN_F_L3MISS) { 1486 - ipa.sin6.sin6_addr = *daddr; 1487 - ipa.sa.sa_family = AF_INET6; 1401 + union vxlan_addr ipa = { 1402 + .sin6.sin6_addr = msg->target, 1403 + .sa.sa_family = AF_INET6, 1404 + }; 1405 + 1488 1406 vxlan_ip_miss(dev, &ipa); 1489 1407 } 1490 1408
+1 -2
drivers/net/wireless/ath/ath9k/hw.c
··· 1548 1548 if (reg != last_val) 1549 1549 return true; 1550 1550 1551 + udelay(1); 1551 1552 last_val = reg; 1552 1553 if ((reg & 0x7E7FFFEF) == 0x00702400) 1553 1554 continue; ··· 1561 1560 default: 1562 1561 return true; 1563 1562 } 1564 - 1565 - udelay(1); 1566 1563 } while (count-- > 0); 1567 1564 1568 1565 return false;
+2 -2
drivers/net/wireless/ath/ath9k/xmit.c
··· 2063 2063 2064 2064 ATH_TXBUF_RESET(bf); 2065 2065 2066 - if (tid) { 2066 + if (tid && ieee80211_is_data_present(hdr->frame_control)) { 2067 2067 fragno = le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG; 2068 2068 seqno = tid->seq_next; 2069 2069 hdr->seq_ctrl = cpu_to_le16(tid->seq_next << IEEE80211_SEQ_SEQ_SHIFT); ··· 2186 2186 txq->stopped = true; 2187 2187 } 2188 2188 2189 - if (txctl->an) 2189 + if (txctl->an && ieee80211_is_data_present(hdr->frame_control)) 2190 2190 tid = ath_get_skb_tid(sc, txctl->an, skb); 2191 2191 2192 2192 if (info->flags & IEEE80211_TX_CTL_PS_RESPONSE) {
+3 -1
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
··· 1948 1948 if (pkt_pad == NULL) 1949 1949 return -ENOMEM; 1950 1950 ret = brcmf_sdio_txpkt_hdalign(bus, pkt_pad); 1951 - if (unlikely(ret < 0)) 1951 + if (unlikely(ret < 0)) { 1952 + kfree_skb(pkt_pad); 1952 1953 return ret; 1954 + } 1953 1955 memcpy(pkt_pad->data, 1954 1956 pkt->data + pkt->len - tail_chop, 1955 1957 tail_chop);
+3 -3
drivers/net/wireless/rt2x00/rt2800lib.c
··· 5460 5460 5461 5461 rt2800_bbp_write(rt2x00dev, 68, 0x0b); 5462 5462 5463 - rt2800_bbp_write(rt2x00dev, 69, 0x0d); 5464 - rt2800_bbp_write(rt2x00dev, 70, 0x06); 5463 + rt2800_bbp_write(rt2x00dev, 69, 0x12); 5465 5464 rt2800_bbp_write(rt2x00dev, 73, 0x13); 5466 5465 rt2800_bbp_write(rt2x00dev, 75, 0x46); 5467 5466 rt2800_bbp_write(rt2x00dev, 76, 0x28); 5468 5467 5469 5468 rt2800_bbp_write(rt2x00dev, 77, 0x59); 5469 + 5470 + rt2800_bbp_write(rt2x00dev, 70, 0x0a); 5470 5471 5471 5472 rt2800_bbp_write(rt2x00dev, 79, 0x13); 5472 5473 rt2800_bbp_write(rt2x00dev, 80, 0x05); ··· 5511 5510 if (rt2x00_rt(rt2x00dev, RT5392)) { 5512 5511 rt2800_bbp_write(rt2x00dev, 134, 0xd0); 5513 5512 rt2800_bbp_write(rt2x00dev, 135, 0xf6); 5514 - rt2800_bbp_write(rt2x00dev, 148, 0x84); 5515 5513 } 5516 5514 5517 5515 rt2800_disable_unused_dac_adc(rt2x00dev);
+8 -8
drivers/scsi/bnx2fc/bnx2fc_io.c
··· 594 594 mp_req->mp_resp_bd = NULL; 595 595 } 596 596 if (mp_req->req_buf) { 597 - dma_free_coherent(&hba->pcidev->dev, PAGE_SIZE, 597 + dma_free_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE, 598 598 mp_req->req_buf, 599 599 mp_req->req_buf_dma); 600 600 mp_req->req_buf = NULL; 601 601 } 602 602 if (mp_req->resp_buf) { 603 - dma_free_coherent(&hba->pcidev->dev, PAGE_SIZE, 603 + dma_free_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE, 604 604 mp_req->resp_buf, 605 605 mp_req->resp_buf_dma); 606 606 mp_req->resp_buf = NULL; ··· 622 622 623 623 mp_req->req_len = sizeof(struct fcp_cmnd); 624 624 io_req->data_xfer_len = mp_req->req_len; 625 - mp_req->req_buf = dma_alloc_coherent(&hba->pcidev->dev, PAGE_SIZE, 625 + mp_req->req_buf = dma_alloc_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE, 626 626 &mp_req->req_buf_dma, 627 627 GFP_ATOMIC); 628 628 if (!mp_req->req_buf) { ··· 631 631 return FAILED; 632 632 } 633 633 634 - mp_req->resp_buf = dma_alloc_coherent(&hba->pcidev->dev, PAGE_SIZE, 634 + mp_req->resp_buf = dma_alloc_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE, 635 635 &mp_req->resp_buf_dma, 636 636 GFP_ATOMIC); 637 637 if (!mp_req->resp_buf) { ··· 639 639 bnx2fc_free_mp_resc(io_req); 640 640 return FAILED; 641 641 } 642 - memset(mp_req->req_buf, 0, PAGE_SIZE); 643 - memset(mp_req->resp_buf, 0, PAGE_SIZE); 642 + memset(mp_req->req_buf, 0, CNIC_PAGE_SIZE); 643 + memset(mp_req->resp_buf, 0, CNIC_PAGE_SIZE); 644 644 645 645 /* Allocate and map mp_req_bd and mp_resp_bd */ 646 646 sz = sizeof(struct fcoe_bd_ctx); ··· 665 665 mp_req_bd = mp_req->mp_req_bd; 666 666 mp_req_bd->buf_addr_lo = (u32)addr & 0xffffffff; 667 667 mp_req_bd->buf_addr_hi = (u32)((u64)addr >> 32); 668 - mp_req_bd->buf_len = PAGE_SIZE; 668 + mp_req_bd->buf_len = CNIC_PAGE_SIZE; 669 669 mp_req_bd->flags = 0; 670 670 671 671 /* ··· 677 677 addr = mp_req->resp_buf_dma; 678 678 mp_resp_bd->buf_addr_lo = (u32)addr & 0xffffffff; 679 679 mp_resp_bd->buf_addr_hi = (u32)((u64)addr >> 32); 680 - mp_resp_bd->buf_len = PAGE_SIZE; 680 + mp_resp_bd->buf_len = CNIC_PAGE_SIZE; 681 681 mp_resp_bd->flags = 0; 682 682 683 683 return SUCCESS;
+21 -17
drivers/scsi/bnx2fc/bnx2fc_tgt.c
··· 673 673 674 674 /* Allocate and map SQ */ 675 675 tgt->sq_mem_size = tgt->max_sqes * BNX2FC_SQ_WQE_SIZE; 676 - tgt->sq_mem_size = (tgt->sq_mem_size + (PAGE_SIZE - 1)) & PAGE_MASK; 676 + tgt->sq_mem_size = (tgt->sq_mem_size + (CNIC_PAGE_SIZE - 1)) & 677 + CNIC_PAGE_MASK; 677 678 678 679 tgt->sq = dma_alloc_coherent(&hba->pcidev->dev, tgt->sq_mem_size, 679 680 &tgt->sq_dma, GFP_KERNEL); ··· 687 686 688 687 /* Allocate and map CQ */ 689 688 tgt->cq_mem_size = tgt->max_cqes * BNX2FC_CQ_WQE_SIZE; 690 - tgt->cq_mem_size = (tgt->cq_mem_size + (PAGE_SIZE - 1)) & PAGE_MASK; 689 + tgt->cq_mem_size = (tgt->cq_mem_size + (CNIC_PAGE_SIZE - 1)) & 690 + CNIC_PAGE_MASK; 691 691 692 692 tgt->cq = dma_alloc_coherent(&hba->pcidev->dev, tgt->cq_mem_size, 693 693 &tgt->cq_dma, GFP_KERNEL); ··· 701 699 702 700 /* Allocate and map RQ and RQ PBL */ 703 701 tgt->rq_mem_size = tgt->max_rqes * BNX2FC_RQ_WQE_SIZE; 704 - tgt->rq_mem_size = (tgt->rq_mem_size + (PAGE_SIZE - 1)) & PAGE_MASK; 702 + tgt->rq_mem_size = (tgt->rq_mem_size + (CNIC_PAGE_SIZE - 1)) & 703 + CNIC_PAGE_MASK; 705 704 706 705 tgt->rq = dma_alloc_coherent(&hba->pcidev->dev, tgt->rq_mem_size, 707 706 &tgt->rq_dma, GFP_KERNEL); ··· 713 710 } 714 711 memset(tgt->rq, 0, tgt->rq_mem_size); 715 712 716 - tgt->rq_pbl_size = (tgt->rq_mem_size / PAGE_SIZE) * sizeof(void *); 717 - tgt->rq_pbl_size = (tgt->rq_pbl_size + (PAGE_SIZE - 1)) & PAGE_MASK; 713 + tgt->rq_pbl_size = (tgt->rq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *); 714 + tgt->rq_pbl_size = (tgt->rq_pbl_size + (CNIC_PAGE_SIZE - 1)) & 715 + CNIC_PAGE_MASK; 718 716 719 717 tgt->rq_pbl = dma_alloc_coherent(&hba->pcidev->dev, tgt->rq_pbl_size, 720 718 &tgt->rq_pbl_dma, GFP_KERNEL); ··· 726 722 } 727 723 728 724 memset(tgt->rq_pbl, 0, tgt->rq_pbl_size); 729 - num_pages = tgt->rq_mem_size / PAGE_SIZE; 725 + num_pages = tgt->rq_mem_size / CNIC_PAGE_SIZE; 730 726 page = tgt->rq_dma; 731 727 pbl = (u32 *)tgt->rq_pbl; 732 728 ··· 735 731 pbl++; 736 732 *pbl = (u32)((u64)page >> 32); 737 733 pbl++; 738 - page += PAGE_SIZE; 734 + page += CNIC_PAGE_SIZE; 739 735 } 740 736 741 737 /* Allocate and map XFERQ */ 742 738 tgt->xferq_mem_size = tgt->max_sqes * BNX2FC_XFERQ_WQE_SIZE; 743 - tgt->xferq_mem_size = (tgt->xferq_mem_size + (PAGE_SIZE - 1)) & 744 - PAGE_MASK; 739 + tgt->xferq_mem_size = (tgt->xferq_mem_size + (CNIC_PAGE_SIZE - 1)) & 740 + CNIC_PAGE_MASK; 745 741 746 742 tgt->xferq = dma_alloc_coherent(&hba->pcidev->dev, tgt->xferq_mem_size, 747 743 &tgt->xferq_dma, GFP_KERNEL); ··· 754 750 755 751 /* Allocate and map CONFQ & CONFQ PBL */ 756 752 tgt->confq_mem_size = tgt->max_sqes * BNX2FC_CONFQ_WQE_SIZE; 757 - tgt->confq_mem_size = (tgt->confq_mem_size + (PAGE_SIZE - 1)) & 758 - PAGE_MASK; 753 + tgt->confq_mem_size = (tgt->confq_mem_size + (CNIC_PAGE_SIZE - 1)) & 754 + CNIC_PAGE_MASK; 759 755 760 756 tgt->confq = dma_alloc_coherent(&hba->pcidev->dev, tgt->confq_mem_size, 761 757 &tgt->confq_dma, GFP_KERNEL); ··· 767 763 memset(tgt->confq, 0, tgt->confq_mem_size); 768 764 769 765 tgt->confq_pbl_size = 770 - (tgt->confq_mem_size / PAGE_SIZE) * sizeof(void *); 766 + (tgt->confq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *); 771 767 tgt->confq_pbl_size = 772 - (tgt->confq_pbl_size + (PAGE_SIZE - 1)) & PAGE_MASK; 768 + (tgt->confq_pbl_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; 773 769 774 770 tgt->confq_pbl = dma_alloc_coherent(&hba->pcidev->dev, 775 771 tgt->confq_pbl_size, ··· 781 777 } 782 778 783 779 memset(tgt->confq_pbl, 0, tgt->confq_pbl_size); 784 - num_pages = tgt->confq_mem_size / PAGE_SIZE; 780 + num_pages = tgt->confq_mem_size / CNIC_PAGE_SIZE; 785 781 page = tgt->confq_dma; 786 782 pbl = (u32 *)tgt->confq_pbl; 787 783 ··· 790 786 pbl++; 791 787 *pbl = (u32)((u64)page >> 32); 792 788 pbl++; 793 - page += PAGE_SIZE; 789 + page += CNIC_PAGE_SIZE; 794 790 } 795 791 796 792 /* Allocate and map ConnDB */ ··· 809 805 810 806 /* Allocate and map LCQ */ 811 807 tgt->lcq_mem_size = (tgt->max_sqes + 8) * BNX2FC_SQ_WQE_SIZE; 812 - tgt->lcq_mem_size = (tgt->lcq_mem_size + (PAGE_SIZE - 1)) & 813 - PAGE_MASK; 808 + tgt->lcq_mem_size = (tgt->lcq_mem_size + (CNIC_PAGE_SIZE - 1)) & 809 + CNIC_PAGE_MASK; 814 810 815 811 tgt->lcq = dma_alloc_coherent(&hba->pcidev->dev, tgt->lcq_mem_size, 816 812 &tgt->lcq_dma, GFP_KERNEL);
+26 -26
drivers/scsi/bnx2i/bnx2i_hwi.c
··· 61 61 * yield integral num of page buffers 62 62 */ 63 63 /* adjust SQ */ 64 - num_elements_per_pg = PAGE_SIZE / BNX2I_SQ_WQE_SIZE; 64 + num_elements_per_pg = CNIC_PAGE_SIZE / BNX2I_SQ_WQE_SIZE; 65 65 if (hba->max_sqes < num_elements_per_pg) 66 66 hba->max_sqes = num_elements_per_pg; 67 67 else if (hba->max_sqes % num_elements_per_pg) ··· 69 69 ~(num_elements_per_pg - 1); 70 70 71 71 /* adjust CQ */ 72 - num_elements_per_pg = PAGE_SIZE / BNX2I_CQE_SIZE; 72 + num_elements_per_pg = CNIC_PAGE_SIZE / BNX2I_CQE_SIZE; 73 73 if (hba->max_cqes < num_elements_per_pg) 74 74 hba->max_cqes = num_elements_per_pg; 75 75 else if (hba->max_cqes % num_elements_per_pg) ··· 77 77 ~(num_elements_per_pg - 1); 78 78 79 79 /* adjust RQ */ 80 - num_elements_per_pg = PAGE_SIZE / BNX2I_RQ_WQE_SIZE; 80 + num_elements_per_pg = CNIC_PAGE_SIZE / BNX2I_RQ_WQE_SIZE; 81 81 if (hba->max_rqes < num_elements_per_pg) 82 82 hba->max_rqes = num_elements_per_pg; 83 83 else if (hba->max_rqes % num_elements_per_pg) ··· 959 959 960 960 /* SQ page table */ 961 961 memset(ep->qp.sq_pgtbl_virt, 0, ep->qp.sq_pgtbl_size); 962 - num_pages = ep->qp.sq_mem_size / PAGE_SIZE; 962 + num_pages = ep->qp.sq_mem_size / CNIC_PAGE_SIZE; 963 963 page = ep->qp.sq_phys; 964 964 965 965 if (cnic_dev_10g) ··· 973 973 ptbl++; 974 974 *ptbl = (u32) ((u64) page >> 32); 975 975 ptbl++; 976 - page += PAGE_SIZE; 976 + page += CNIC_PAGE_SIZE; 977 977 } else { 978 978 /* PTE is written in big endian format for 979 979 * 5706/5708/5709 devices */ ··· 981 981 ptbl++; 982 982 *ptbl = (u32) page; 983 983 ptbl++; 984 - page += PAGE_SIZE; 984 + page += CNIC_PAGE_SIZE; 985 985 } 986 986 } 987 987 988 988 /* RQ page table */ 989 989 memset(ep->qp.rq_pgtbl_virt, 0, ep->qp.rq_pgtbl_size); 990 - num_pages = ep->qp.rq_mem_size / PAGE_SIZE; 990 + num_pages = ep->qp.rq_mem_size / CNIC_PAGE_SIZE; 991 991 page = ep->qp.rq_phys; 992 992 993 993 if (cnic_dev_10g) ··· 1001 1001 ptbl++; 1002 1002 *ptbl = (u32) ((u64) page >> 32); 1003 1003 ptbl++; 1004 - page += PAGE_SIZE; 1004 + page += CNIC_PAGE_SIZE; 1005 1005 } else { 1006 1006 /* PTE is written in big endian format for 1007 1007 * 5706/5708/5709 devices */ ··· 1009 1009 ptbl++; 1010 1010 *ptbl = (u32) page; 1011 1011 ptbl++; 1012 - page += PAGE_SIZE; 1012 + page += CNIC_PAGE_SIZE; 1013 1013 } 1014 1014 } 1015 1015 1016 1016 /* CQ page table */ 1017 1017 memset(ep->qp.cq_pgtbl_virt, 0, ep->qp.cq_pgtbl_size); 1018 - num_pages = ep->qp.cq_mem_size / PAGE_SIZE; 1018 + num_pages = ep->qp.cq_mem_size / CNIC_PAGE_SIZE; 1019 1019 page = ep->qp.cq_phys; 1020 1020 1021 1021 if (cnic_dev_10g) ··· 1029 1029 ptbl++; 1030 1030 *ptbl = (u32) ((u64) page >> 32); 1031 1031 ptbl++; 1032 - page += PAGE_SIZE; 1032 + page += CNIC_PAGE_SIZE; 1033 1033 } else { 1034 1034 /* PTE is written in big endian format for 1035 1035 * 5706/5708/5709 devices */ ··· 1037 1037 ptbl++; 1038 1038 *ptbl = (u32) page; 1039 1039 ptbl++; 1040 - page += PAGE_SIZE; 1040 + page += CNIC_PAGE_SIZE; 1041 1041 } 1042 1042 } 1043 1043 } ··· 1064 1064 /* Allocate page table memory for SQ which is page aligned */ 1065 1065 ep->qp.sq_mem_size = hba->max_sqes * BNX2I_SQ_WQE_SIZE; 1066 1066 ep->qp.sq_mem_size = 1067 - (ep->qp.sq_mem_size + (PAGE_SIZE - 1)) & PAGE_MASK; 1067 + (ep->qp.sq_mem_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; 1068 1068 ep->qp.sq_pgtbl_size = 1069 - (ep->qp.sq_mem_size / PAGE_SIZE) * sizeof(void *); 1069 + (ep->qp.sq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *); 1070 1070 ep->qp.sq_pgtbl_size = 1071 - (ep->qp.sq_pgtbl_size + (PAGE_SIZE - 1)) & PAGE_MASK; 1071 + (ep->qp.sq_pgtbl_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; 1072 1072 1073 1073 ep->qp.sq_pgtbl_virt = 1074 1074 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.sq_pgtbl_size, ··· 1101 1101 /* Allocate page table memory for CQ which is page aligned */ 1102 1102 ep->qp.cq_mem_size = hba->max_cqes * BNX2I_CQE_SIZE; 1103 1103 ep->qp.cq_mem_size = 1104 - (ep->qp.cq_mem_size + (PAGE_SIZE - 1)) & PAGE_MASK; 1104 + (ep->qp.cq_mem_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; 1105 1105 ep->qp.cq_pgtbl_size = 1106 - (ep->qp.cq_mem_size / PAGE_SIZE) * sizeof(void *); 1106 + (ep->qp.cq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *); 1107 1107 ep->qp.cq_pgtbl_size = 1108 - (ep->qp.cq_pgtbl_size + (PAGE_SIZE - 1)) & PAGE_MASK; 1108 + (ep->qp.cq_pgtbl_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; 1109 1109 1110 1110 ep->qp.cq_pgtbl_virt = 1111 1111 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.cq_pgtbl_size, ··· 1144 1144 /* Allocate page table memory for RQ which is page aligned */ 1145 1145 ep->qp.rq_mem_size = hba->max_rqes * BNX2I_RQ_WQE_SIZE; 1146 1146 ep->qp.rq_mem_size = 1147 - (ep->qp.rq_mem_size + (PAGE_SIZE - 1)) & PAGE_MASK; 1147 + (ep->qp.rq_mem_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; 1148 1148 ep->qp.rq_pgtbl_size = 1149 - (ep->qp.rq_mem_size / PAGE_SIZE) * sizeof(void *); 1149 + (ep->qp.rq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *); 1150 1150 ep->qp.rq_pgtbl_size = 1151 - (ep->qp.rq_pgtbl_size + (PAGE_SIZE - 1)) & PAGE_MASK; 1151 + (ep->qp.rq_pgtbl_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; 1152 1152 1153 1153 ep->qp.rq_pgtbl_virt = 1154 1154 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.rq_pgtbl_size, ··· 1270 1270 bnx2i_adjust_qp_size(hba); 1271 1271 1272 1272 iscsi_init.flags = 1273 - ISCSI_PAGE_SIZE_4K << ISCSI_KWQE_INIT1_PAGE_SIZE_SHIFT; 1273 + (CNIC_PAGE_BITS - 8) << ISCSI_KWQE_INIT1_PAGE_SIZE_SHIFT; 1274 1274 if (en_tcp_dack) 1275 1275 iscsi_init.flags |= ISCSI_KWQE_INIT1_DELAYED_ACK_ENABLE; 1276 1276 iscsi_init.reserved0 = 0; ··· 1288 1288 ((hba->num_ccell & 0xFFFF) | (hba->max_sqes << 16)); 1289 1289 iscsi_init.num_ccells_per_conn = hba->num_ccell; 1290 1290 iscsi_init.num_tasks_per_conn = hba->max_sqes; 1291 - iscsi_init.sq_wqes_per_page = PAGE_SIZE / BNX2I_SQ_WQE_SIZE; 1291 + iscsi_init.sq_wqes_per_page = CNIC_PAGE_SIZE / BNX2I_SQ_WQE_SIZE; 1292 1292 iscsi_init.sq_num_wqes = hba->max_sqes; 1293 1293 iscsi_init.cq_log_wqes_per_page = 1294 - (u8) bnx2i_power_of2(PAGE_SIZE / BNX2I_CQE_SIZE); 1294 + (u8) bnx2i_power_of2(CNIC_PAGE_SIZE / BNX2I_CQE_SIZE); 1295 1295 iscsi_init.cq_num_wqes = hba->max_cqes; 1296 1296 iscsi_init.cq_num_pages = (hba->max_cqes * BNX2I_CQE_SIZE + 1297 - (PAGE_SIZE - 1)) / PAGE_SIZE; 1297 + (CNIC_PAGE_SIZE - 1)) / CNIC_PAGE_SIZE; 1298 1298 iscsi_init.sq_num_pages = (hba->max_sqes * BNX2I_SQ_WQE_SIZE + 1299 - (PAGE_SIZE - 1)) / PAGE_SIZE; 1299 + (CNIC_PAGE_SIZE - 1)) / CNIC_PAGE_SIZE; 1300 1300 iscsi_init.rq_buffer_size = BNX2I_RQ_WQE_SIZE; 1301 1301 iscsi_init.rq_num_wqes = hba->max_rqes; 1302 1302
+12 -11
drivers/scsi/bnx2i/bnx2i_iscsi.c
··· 525 525 struct iscsi_bd *mp_bdt; 526 526 u64 addr; 527 527 528 - hba->mp_bd_tbl = dma_alloc_coherent(&hba->pcidev->dev, PAGE_SIZE, 528 + hba->mp_bd_tbl = dma_alloc_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE, 529 529 &hba->mp_bd_dma, GFP_KERNEL); 530 530 if (!hba->mp_bd_tbl) { 531 531 printk(KERN_ERR "unable to allocate Middle Path BDT\n"); ··· 533 533 goto out; 534 534 } 535 535 536 - hba->dummy_buffer = dma_alloc_coherent(&hba->pcidev->dev, PAGE_SIZE, 536 + hba->dummy_buffer = dma_alloc_coherent(&hba->pcidev->dev, 537 + CNIC_PAGE_SIZE, 537 538 &hba->dummy_buf_dma, GFP_KERNEL); 538 539 if (!hba->dummy_buffer) { 539 540 printk(KERN_ERR "unable to alloc Middle Path Dummy Buffer\n"); 540 - dma_free_coherent(&hba->pcidev->dev, PAGE_SIZE, 541 + dma_free_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE, 541 542 hba->mp_bd_tbl, hba->mp_bd_dma); 542 543 hba->mp_bd_tbl = NULL; 543 544 rc = -1; ··· 549 548 addr = (unsigned long) hba->dummy_buf_dma; 550 549 mp_bdt->buffer_addr_lo = addr & 0xffffffff; 551 550 mp_bdt->buffer_addr_hi = addr >> 32; 552 - mp_bdt->buffer_length = PAGE_SIZE; 551 + mp_bdt->buffer_length = CNIC_PAGE_SIZE; 553 552 mp_bdt->flags = ISCSI_BD_LAST_IN_BD_CHAIN | 554 553 ISCSI_BD_FIRST_IN_BD_CHAIN; 555 554 out: ··· 566 565 static void bnx2i_free_mp_bdt(struct bnx2i_hba *hba) 567 566 { 568 567 if (hba->mp_bd_tbl) { 569 - dma_free_coherent(&hba->pcidev->dev, PAGE_SIZE, 568 + dma_free_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE, 570 569 hba->mp_bd_tbl, hba->mp_bd_dma); 571 570 hba->mp_bd_tbl = NULL; 572 571 } 573 572 if (hba->dummy_buffer) { 574 - dma_free_coherent(&hba->pcidev->dev, PAGE_SIZE, 573 + dma_free_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE, 575 574 hba->dummy_buffer, hba->dummy_buf_dma); 576 575 hba->dummy_buffer = NULL; 577 576 } ··· 935 934 struct bnx2i_conn *bnx2i_conn) 936 935 { 937 936 if (bnx2i_conn->gen_pdu.resp_bd_tbl) { 938 - dma_free_coherent(&hba->pcidev->dev, PAGE_SIZE, 937 + dma_free_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE, 939 938 bnx2i_conn->gen_pdu.resp_bd_tbl, 940 939 bnx2i_conn->gen_pdu.resp_bd_dma); 941 940 bnx2i_conn->gen_pdu.resp_bd_tbl = NULL; 942 941 } 943 942 944 943 if (bnx2i_conn->gen_pdu.req_bd_tbl) { 945 - dma_free_coherent(&hba->pcidev->dev, PAGE_SIZE, 944 + dma_free_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE, 946 945 bnx2i_conn->gen_pdu.req_bd_tbl, 947 946 bnx2i_conn->gen_pdu.req_bd_dma); 948 947 bnx2i_conn->gen_pdu.req_bd_tbl = NULL; ··· 999 998 bnx2i_conn->gen_pdu.resp_wr_ptr = bnx2i_conn->gen_pdu.resp_buf; 1000 999 1001 1000 bnx2i_conn->gen_pdu.req_bd_tbl = 1002 - dma_alloc_coherent(&hba->pcidev->dev, PAGE_SIZE, 1001 + dma_alloc_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE, 1003 1002 &bnx2i_conn->gen_pdu.req_bd_dma, GFP_KERNEL); 1004 1003 if (bnx2i_conn->gen_pdu.req_bd_tbl == NULL) 1005 1004 goto login_req_bd_tbl_failure; 1006 1005 1007 1006 bnx2i_conn->gen_pdu.resp_bd_tbl = 1008 - dma_alloc_coherent(&hba->pcidev->dev, PAGE_SIZE, 1007 + dma_alloc_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE, 1009 1008 &bnx2i_conn->gen_pdu.resp_bd_dma, 1010 1009 GFP_KERNEL); 1011 1010 if (bnx2i_conn->gen_pdu.resp_bd_tbl == NULL) ··· 1014 1013 return 0; 1015 1014 1016 1015 login_resp_bd_tbl_failure: 1017 - dma_free_coherent(&hba->pcidev->dev, PAGE_SIZE, 1016 + dma_free_coherent(&hba->pcidev->dev, CNIC_PAGE_SIZE, 1018 1017 bnx2i_conn->gen_pdu.req_bd_tbl, 1019 1018 bnx2i_conn->gen_pdu.req_bd_dma); 1020 1019 bnx2i_conn->gen_pdu.req_bd_tbl = NULL;
+7 -3
include/linux/security.h
··· 1040 1040 * Allocate a security structure to the xp->security field; the security 1041 1041 * field is initialized to NULL when the xfrm_policy is allocated. 1042 1042 * Return 0 if operation was successful (memory to allocate, legal context) 1043 + * @gfp is to specify the context for the allocation 1043 1044 * @xfrm_policy_clone_security: 1044 1045 * @old_ctx contains an existing xfrm_sec_ctx. 1045 1046 * @new_ctxp contains a new xfrm_sec_ctx being cloned from old. ··· 1684 1683 1685 1684 #ifdef CONFIG_SECURITY_NETWORK_XFRM 1686 1685 int (*xfrm_policy_alloc_security) (struct xfrm_sec_ctx **ctxp, 1687 - struct xfrm_user_sec_ctx *sec_ctx); 1686 + struct xfrm_user_sec_ctx *sec_ctx, gfp_t gfp); 1688 1687 int (*xfrm_policy_clone_security) (struct xfrm_sec_ctx *old_ctx, struct xfrm_sec_ctx **new_ctx); 1689 1688 void (*xfrm_policy_free_security) (struct xfrm_sec_ctx *ctx); 1690 1689 int (*xfrm_policy_delete_security) (struct xfrm_sec_ctx *ctx); ··· 2860 2859 2861 2860 #ifdef CONFIG_SECURITY_NETWORK_XFRM 2862 2861 2863 - int security_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp, struct xfrm_user_sec_ctx *sec_ctx); 2862 + int security_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp, 2863 + struct xfrm_user_sec_ctx *sec_ctx, gfp_t gfp); 2864 2864 int security_xfrm_policy_clone(struct xfrm_sec_ctx *old_ctx, struct xfrm_sec_ctx **new_ctxp); 2865 2865 void security_xfrm_policy_free(struct xfrm_sec_ctx *ctx); 2866 2866 int security_xfrm_policy_delete(struct xfrm_sec_ctx *ctx); ··· 2879 2877 2880 2878 #else /* CONFIG_SECURITY_NETWORK_XFRM */ 2881 2879 2882 - static inline int security_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp, struct xfrm_user_sec_ctx *sec_ctx) 2880 + static inline int security_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp, 2881 + struct xfrm_user_sec_ctx *sec_ctx, 2882 + gfp_t gfp) 2883 2883 { 2884 2884 return 0; 2885 2885 }
+1
include/linux/usb/cdc_ncm.h
··· 88 88 #define cdc_ncm_data_intf_is_mbim(x) ((x)->desc.bInterfaceProtocol == USB_CDC_MBIM_PROTO_NTB) 89 89 90 90 struct cdc_ncm_ctx { 91 + struct usb_cdc_ncm_ntb_parameters ncm_parm; 91 92 struct hrtimer tx_timer; 92 93 struct tasklet_struct bh; 93 94
+6 -5
include/net/tcp.h
··· 480 480 #ifdef CONFIG_SYN_COOKIES 481 481 #include <linux/ktime.h> 482 482 483 - /* Syncookies use a monotonic timer which increments every 64 seconds. 483 + /* Syncookies use a monotonic timer which increments every 60 seconds. 484 484 * This counter is used both as a hash input and partially encoded into 485 485 * the cookie value. A cookie is only validated further if the delta 486 486 * between the current counter value and the encoded one is less than this, 487 - * i.e. a sent cookie is valid only at most for 128 seconds (or less if 487 + * i.e. a sent cookie is valid only at most for 2*60 seconds (or less if 488 488 * the counter advances immediately after a cookie is generated). 489 489 */ 490 490 #define MAX_SYNCOOKIE_AGE 2 491 491 492 492 static inline u32 tcp_cookie_time(void) 493 493 { 494 - struct timespec now; 495 - getnstimeofday(&now); 496 - return now.tv_sec >> 6; /* 64 seconds granularity */ 494 + u64 val = get_jiffies_64(); 495 + 496 + do_div(val, 60 * HZ); 497 + return val; 497 498 } 498 499 499 500 u32 __cookie_v4_init_sequence(const struct iphdr *iph, const struct tcphdr *th,
+1 -1
net/core/netpoll.c
··· 742 742 struct nd_msg *msg; 743 743 struct ipv6hdr *hdr; 744 744 745 - if (skb->protocol != htons(ETH_P_ARP)) 745 + if (skb->protocol != htons(ETH_P_IPV6)) 746 746 return false; 747 747 if (!pskb_may_pull(skb, sizeof(struct ipv6hdr) + sizeof(struct nd_msg))) 748 748 return false;
+6 -4
net/core/rtnetlink.c
··· 2121 2121 static int nlmsg_populate_fdb_fill(struct sk_buff *skb, 2122 2122 struct net_device *dev, 2123 2123 u8 *addr, u32 pid, u32 seq, 2124 - int type, unsigned int flags) 2124 + int type, unsigned int flags, 2125 + int nlflags) 2125 2126 { 2126 2127 struct nlmsghdr *nlh; 2127 2128 struct ndmsg *ndm; 2128 2129 2129 - nlh = nlmsg_put(skb, pid, seq, type, sizeof(*ndm), NLM_F_MULTI); 2130 + nlh = nlmsg_put(skb, pid, seq, type, sizeof(*ndm), nlflags); 2130 2131 if (!nlh) 2131 2132 return -EMSGSIZE; 2132 2133 ··· 2165 2164 if (!skb) 2166 2165 goto errout; 2167 2166 2168 - err = nlmsg_populate_fdb_fill(skb, dev, addr, 0, 0, type, NTF_SELF); 2167 + err = nlmsg_populate_fdb_fill(skb, dev, addr, 0, 0, type, NTF_SELF, 0); 2169 2168 if (err < 0) { 2170 2169 kfree_skb(skb); 2171 2170 goto errout; ··· 2390 2389 2391 2390 err = nlmsg_populate_fdb_fill(skb, dev, ha->addr, 2392 2391 portid, seq, 2393 - RTM_NEWNEIGH, NTF_SELF); 2392 + RTM_NEWNEIGH, NTF_SELF, 2393 + NLM_F_MULTI); 2394 2394 if (err < 0) 2395 2395 return err; 2396 2396 skip:
+8 -5
net/ipv4/ipmr.c
··· 2255 2255 } 2256 2256 2257 2257 static int ipmr_fill_mroute(struct mr_table *mrt, struct sk_buff *skb, 2258 - u32 portid, u32 seq, struct mfc_cache *c, int cmd) 2258 + u32 portid, u32 seq, struct mfc_cache *c, int cmd, 2259 + int flags) 2259 2260 { 2260 2261 struct nlmsghdr *nlh; 2261 2262 struct rtmsg *rtm; 2262 2263 int err; 2263 2264 2264 - nlh = nlmsg_put(skb, portid, seq, cmd, sizeof(*rtm), NLM_F_MULTI); 2265 + nlh = nlmsg_put(skb, portid, seq, cmd, sizeof(*rtm), flags); 2265 2266 if (nlh == NULL) 2266 2267 return -EMSGSIZE; 2267 2268 ··· 2330 2329 if (skb == NULL) 2331 2330 goto errout; 2332 2331 2333 - err = ipmr_fill_mroute(mrt, skb, 0, 0, mfc, cmd); 2332 + err = ipmr_fill_mroute(mrt, skb, 0, 0, mfc, cmd, 0); 2334 2333 if (err < 0) 2335 2334 goto errout; 2336 2335 ··· 2369 2368 if (ipmr_fill_mroute(mrt, skb, 2370 2369 NETLINK_CB(cb->skb).portid, 2371 2370 cb->nlh->nlmsg_seq, 2372 - mfc, RTM_NEWROUTE) < 0) 2371 + mfc, RTM_NEWROUTE, 2372 + NLM_F_MULTI) < 0) 2373 2373 goto done; 2374 2374 next_entry: 2375 2375 e++; ··· 2384 2382 if (ipmr_fill_mroute(mrt, skb, 2385 2383 NETLINK_CB(cb->skb).portid, 2386 2384 cb->nlh->nlmsg_seq, 2387 - mfc, RTM_NEWROUTE) < 0) { 2385 + mfc, RTM_NEWROUTE, 2386 + NLM_F_MULTI) < 0) { 2388 2387 spin_unlock_bh(&mfc_unres_lock); 2389 2388 goto done; 2390 2389 }
+6 -8
net/ipv6/ip6_output.c
··· 1101 1101 unsigned int fragheaderlen, 1102 1102 struct sk_buff *skb, 1103 1103 struct rt6_info *rt, 1104 - bool pmtuprobe) 1104 + unsigned int orig_mtu) 1105 1105 { 1106 1106 if (!(rt->dst.flags & DST_XFRM_TUNNEL)) { 1107 1107 if (skb == NULL) { 1108 1108 /* first fragment, reserve header_len */ 1109 - *mtu = *mtu - rt->dst.header_len; 1109 + *mtu = orig_mtu - rt->dst.header_len; 1110 1110 1111 1111 } else { 1112 1112 /* 1113 1113 * this fragment is not first, the headers 1114 1114 * space is regarded as data space. 1115 1115 */ 1116 - *mtu = min(*mtu, pmtuprobe ? 1117 - rt->dst.dev->mtu : 1118 - dst_mtu(rt->dst.path)); 1116 + *mtu = orig_mtu; 1119 1117 } 1120 1118 *maxfraglen = ((*mtu - fragheaderlen) & ~7) 1121 1119 + fragheaderlen - sizeof(struct frag_hdr); ··· 1130 1132 struct ipv6_pinfo *np = inet6_sk(sk); 1131 1133 struct inet_cork *cork; 1132 1134 struct sk_buff *skb, *skb_prev = NULL; 1133 - unsigned int maxfraglen, fragheaderlen, mtu; 1135 + unsigned int maxfraglen, fragheaderlen, mtu, orig_mtu; 1134 1136 int exthdrlen; 1135 1137 int dst_exthdrlen; 1136 1138 int hh_len; ··· 1212 1214 dst_exthdrlen = 0; 1213 1215 mtu = cork->fragsize; 1214 1216 } 1217 + orig_mtu = mtu; 1215 1218 1216 1219 hh_len = LL_RESERVED_SPACE(rt->dst.dev); 1217 1220 ··· 1310 1311 if (skb == NULL || skb_prev == NULL) 1311 1312 ip6_append_data_mtu(&mtu, &maxfraglen, 1312 1313 fragheaderlen, skb, rt, 1313 - np->pmtudisc >= 1314 - IPV6_PMTUDISC_PROBE); 1314 + orig_mtu); 1315 1315 1316 1316 skb_prev = skb; 1317 1317
+8 -5
net/ipv6/ip6mr.c
··· 2349 2349 } 2350 2350 2351 2351 static int ip6mr_fill_mroute(struct mr6_table *mrt, struct sk_buff *skb, 2352 - u32 portid, u32 seq, struct mfc6_cache *c, int cmd) 2352 + u32 portid, u32 seq, struct mfc6_cache *c, int cmd, 2353 + int flags) 2353 2354 { 2354 2355 struct nlmsghdr *nlh; 2355 2356 struct rtmsg *rtm; 2356 2357 int err; 2357 2358 2358 - nlh = nlmsg_put(skb, portid, seq, cmd, sizeof(*rtm), NLM_F_MULTI); 2359 + nlh = nlmsg_put(skb, portid, seq, cmd, sizeof(*rtm), flags); 2359 2360 if (nlh == NULL) 2360 2361 return -EMSGSIZE; 2361 2362 ··· 2424 2423 if (skb == NULL) 2425 2424 goto errout; 2426 2425 2427 - err = ip6mr_fill_mroute(mrt, skb, 0, 0, mfc, cmd); 2426 + err = ip6mr_fill_mroute(mrt, skb, 0, 0, mfc, cmd, 0); 2428 2427 if (err < 0) 2429 2428 goto errout; 2430 2429 ··· 2463 2462 if (ip6mr_fill_mroute(mrt, skb, 2464 2463 NETLINK_CB(cb->skb).portid, 2465 2464 cb->nlh->nlmsg_seq, 2466 - mfc, RTM_NEWROUTE) < 0) 2465 + mfc, RTM_NEWROUTE, 2466 + NLM_F_MULTI) < 0) 2467 2467 goto done; 2468 2468 next_entry: 2469 2469 e++; ··· 2478 2476 if (ip6mr_fill_mroute(mrt, skb, 2479 2477 NETLINK_CB(cb->skb).portid, 2480 2478 cb->nlh->nlmsg_seq, 2481 - mfc, RTM_NEWROUTE) < 0) { 2479 + mfc, RTM_NEWROUTE, 2480 + NLM_F_MULTI) < 0) { 2482 2481 spin_unlock_bh(&mfc_unres_lock); 2483 2482 goto done; 2484 2483 }
+10 -9
net/key/af_key.c
··· 433 433 return 0; 434 434 } 435 435 436 - static inline struct xfrm_user_sec_ctx *pfkey_sadb2xfrm_user_sec_ctx(const struct sadb_x_sec_ctx *sec_ctx) 436 + static inline struct xfrm_user_sec_ctx *pfkey_sadb2xfrm_user_sec_ctx(const struct sadb_x_sec_ctx *sec_ctx, 437 + gfp_t gfp) 437 438 { 438 439 struct xfrm_user_sec_ctx *uctx = NULL; 439 440 int ctx_size = sec_ctx->sadb_x_ctx_len; 440 441 441 - uctx = kmalloc((sizeof(*uctx)+ctx_size), GFP_KERNEL); 442 + uctx = kmalloc((sizeof(*uctx)+ctx_size), gfp); 442 443 443 444 if (!uctx) 444 445 return NULL; ··· 1125 1124 1126 1125 sec_ctx = ext_hdrs[SADB_X_EXT_SEC_CTX - 1]; 1127 1126 if (sec_ctx != NULL) { 1128 - struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); 1127 + struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx, GFP_KERNEL); 1129 1128 1130 1129 if (!uctx) 1131 1130 goto out; ··· 2232 2231 2233 2232 sec_ctx = ext_hdrs[SADB_X_EXT_SEC_CTX - 1]; 2234 2233 if (sec_ctx != NULL) { 2235 - struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); 2234 + struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx, GFP_KERNEL); 2236 2235 2237 2236 if (!uctx) { 2238 2237 err = -ENOBUFS; 2239 2238 goto out; 2240 2239 } 2241 2240 2242 - err = security_xfrm_policy_alloc(&xp->security, uctx); 2241 + err = security_xfrm_policy_alloc(&xp->security, uctx, GFP_KERNEL); 2243 2242 kfree(uctx); 2244 2243 2245 2244 if (err) ··· 2336 2335 2337 2336 sec_ctx = ext_hdrs[SADB_X_EXT_SEC_CTX - 1]; 2338 2337 if (sec_ctx != NULL) { 2339 - struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); 2338 + struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx, GFP_KERNEL); 2340 2339 2341 2340 if (!uctx) 2342 2341 return -ENOMEM; 2343 2342 2344 - err = security_xfrm_policy_alloc(&pol_ctx, uctx); 2343 + err = security_xfrm_policy_alloc(&pol_ctx, uctx, GFP_KERNEL); 2345 2344 kfree(uctx); 2346 2345 if (err) 2347 2346 return err; ··· 3240 3239 } 3241 3240 if ((*dir = verify_sec_ctx_len(p))) 3242 3241 goto out; 3243 - uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx); 3244 - *dir = security_xfrm_policy_alloc(&xp->security, uctx); 3242 + uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx, GFP_ATOMIC); 3243 + *dir = security_xfrm_policy_alloc(&xp->security, uctx, GFP_ATOMIC); 3245 3244 kfree(uctx); 3246 3245 3247 3246 if (*dir)
+6 -5
net/openvswitch/datapath.c
··· 1174 1174 struct datapath *dp; 1175 1175 1176 1176 dp = lookup_datapath(sock_net(skb->sk), info->userhdr, info->attrs); 1177 - if (!dp) 1177 + if (IS_ERR(dp)) 1178 1178 return; 1179 1179 1180 1180 WARN(dp->user_features, "Dropping previously announced user features\n"); ··· 1762 1762 int bucket = cb->args[0], skip = cb->args[1]; 1763 1763 int i, j = 0; 1764 1764 1765 - dp = get_dp(sock_net(skb->sk), ovs_header->dp_ifindex); 1766 - if (!dp) 1767 - return -ENODEV; 1768 - 1769 1765 rcu_read_lock(); 1766 + dp = get_dp(sock_net(skb->sk), ovs_header->dp_ifindex); 1767 + if (!dp) { 1768 + rcu_read_unlock(); 1769 + return -ENODEV; 1770 + } 1770 1771 for (i = bucket; i < DP_VPORT_HASH_BUCKETS; i++) { 1771 1772 struct vport *vport; 1772 1773
+2 -1
net/openvswitch/flow.c
··· 73 73 74 74 if ((flow->key.eth.type == htons(ETH_P_IP) || 75 75 flow->key.eth.type == htons(ETH_P_IPV6)) && 76 + flow->key.ip.frag != OVS_FRAG_TYPE_LATER && 76 77 flow->key.ip.proto == IPPROTO_TCP && 77 78 likely(skb->len >= skb_transport_offset(skb) + sizeof(struct tcphdr))) { 78 79 tcp_flags = TCP_FLAGS_BE16(tcp_hdr(skb)); ··· 92 91 unsigned long *used, __be16 *tcp_flags) 93 92 { 94 93 spin_lock(&stats->lock); 95 - if (time_after(stats->used, *used)) 94 + if (!*used || time_after(stats->used, *used)) 96 95 *used = stats->used; 97 96 *tcp_flags |= stats->tcp_flags; 98 97 ovs_stats->n_packets += stats->packet_count;
+15 -14
net/tipc/subscr.c
··· 263 263 * 264 264 * Called with subscriber lock held. 265 265 */ 266 - static struct tipc_subscription *subscr_subscribe(struct tipc_subscr *s, 267 - struct tipc_subscriber *subscriber) 268 - { 266 + static int subscr_subscribe(struct tipc_subscr *s, 267 + struct tipc_subscriber *subscriber, 268 + struct tipc_subscription **sub_p) { 269 269 struct tipc_subscription *sub; 270 270 int swap; 271 271 ··· 276 276 if (s->filter & htohl(TIPC_SUB_CANCEL, swap)) { 277 277 s->filter &= ~htohl(TIPC_SUB_CANCEL, swap); 278 278 subscr_cancel(s, subscriber); 279 - return NULL; 279 + return 0; 280 280 } 281 281 282 282 /* Refuse subscription if global limit exceeded */ 283 283 if (atomic_read(&subscription_count) >= TIPC_MAX_SUBSCRIPTIONS) { 284 284 pr_warn("Subscription rejected, limit reached (%u)\n", 285 285 TIPC_MAX_SUBSCRIPTIONS); 286 - subscr_terminate(subscriber); 287 - return NULL; 286 + return -EINVAL; 288 287 } 289 288 290 289 /* Allocate subscription object */ 291 290 sub = kmalloc(sizeof(*sub), GFP_ATOMIC); 292 291 if (!sub) { 293 292 pr_warn("Subscription rejected, no memory\n"); 294 - subscr_terminate(subscriber); 295 - return NULL; 293 + return -ENOMEM; 296 294 } 297 295 298 296 /* Initialize subscription object */ ··· 304 306 (sub->seq.lower > sub->seq.upper)) { 305 307 pr_warn("Subscription rejected, illegal request\n"); 306 308 kfree(sub); 307 - subscr_terminate(subscriber); 308 - return NULL; 309 + return -EINVAL; 309 310 } 310 311 INIT_LIST_HEAD(&sub->nameseq_list); 311 312 list_add(&sub->subscription_list, &subscriber->subscription_list); ··· 317 320 (Handler)subscr_timeout, (unsigned long)sub); 318 321 k_start_timer(&sub->timer, sub->timeout); 319 322 } 320 - 321 - return sub; 323 + *sub_p = sub; 324 + return 0; 322 325 } 323 326 324 327 /* Handle one termination request for the subscriber */ ··· 332 335 void *usr_data, void *buf, size_t len) 333 336 { 334 337 struct tipc_subscriber *subscriber = usr_data; 335 - struct tipc_subscription *sub; 338 + struct tipc_subscription *sub = NULL; 336 339 337 340 spin_lock_bh(&subscriber->lock); 338 - sub = subscr_subscribe((struct tipc_subscr *)buf, subscriber); 341 + if (subscr_subscribe((struct tipc_subscr *)buf, subscriber, &sub) < 0) { 342 + spin_unlock_bh(&subscriber->lock); 343 + subscr_terminate(subscriber); 344 + return; 345 + } 339 346 if (sub) 340 347 tipc_nametbl_subscribe(sub); 341 348 spin_unlock_bh(&subscriber->lock);
+3 -3
net/xfrm/xfrm_user.c
··· 1221 1221 return 0; 1222 1222 1223 1223 uctx = nla_data(rt); 1224 - return security_xfrm_policy_alloc(&pol->security, uctx); 1224 + return security_xfrm_policy_alloc(&pol->security, uctx, GFP_KERNEL); 1225 1225 } 1226 1226 1227 1227 static void copy_templates(struct xfrm_policy *xp, struct xfrm_user_tmpl *ut, ··· 1626 1626 if (rt) { 1627 1627 struct xfrm_user_sec_ctx *uctx = nla_data(rt); 1628 1628 1629 - err = security_xfrm_policy_alloc(&ctx, uctx); 1629 + err = security_xfrm_policy_alloc(&ctx, uctx, GFP_KERNEL); 1630 1630 if (err) 1631 1631 return err; 1632 1632 } ··· 1928 1928 if (rt) { 1929 1929 struct xfrm_user_sec_ctx *uctx = nla_data(rt); 1930 1930 1931 - err = security_xfrm_policy_alloc(&ctx, uctx); 1931 + err = security_xfrm_policy_alloc(&ctx, uctx, GFP_KERNEL); 1932 1932 if (err) 1933 1933 return err; 1934 1934 }
+2 -1
security/capability.c
··· 757 757 758 758 #ifdef CONFIG_SECURITY_NETWORK_XFRM 759 759 static int cap_xfrm_policy_alloc_security(struct xfrm_sec_ctx **ctxp, 760 - struct xfrm_user_sec_ctx *sec_ctx) 760 + struct xfrm_user_sec_ctx *sec_ctx, 761 + gfp_t gfp) 761 762 { 762 763 return 0; 763 764 }
+4 -2
security/security.c
··· 1317 1317 1318 1318 #ifdef CONFIG_SECURITY_NETWORK_XFRM 1319 1319 1320 - int security_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp, struct xfrm_user_sec_ctx *sec_ctx) 1320 + int security_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp, 1321 + struct xfrm_user_sec_ctx *sec_ctx, 1322 + gfp_t gfp) 1321 1323 { 1322 - return security_ops->xfrm_policy_alloc_security(ctxp, sec_ctx); 1324 + return security_ops->xfrm_policy_alloc_security(ctxp, sec_ctx, gfp); 1323 1325 } 1324 1326 EXPORT_SYMBOL(security_xfrm_policy_alloc); 1325 1327
+7 -6
security/selinux/hooks.c
··· 668 668 if (flags[i] == SBLABEL_MNT) 669 669 continue; 670 670 rc = security_context_to_sid(mount_options[i], 671 - strlen(mount_options[i]), &sid); 671 + strlen(mount_options[i]), &sid, GFP_KERNEL); 672 672 if (rc) { 673 673 printk(KERN_WARNING "SELinux: security_context_to_sid" 674 674 "(%s) failed for (dev %s, type %s) errno=%d\n", ··· 2489 2489 if (flags[i] == SBLABEL_MNT) 2490 2490 continue; 2491 2491 len = strlen(mount_options[i]); 2492 - rc = security_context_to_sid(mount_options[i], len, &sid); 2492 + rc = security_context_to_sid(mount_options[i], len, &sid, 2493 + GFP_KERNEL); 2493 2494 if (rc) { 2494 2495 printk(KERN_WARNING "SELinux: security_context_to_sid" 2495 2496 "(%s) failed for (dev %s, type %s) errno=%d\n", ··· 2894 2893 if (rc) 2895 2894 return rc; 2896 2895 2897 - rc = security_context_to_sid(value, size, &newsid); 2896 + rc = security_context_to_sid(value, size, &newsid, GFP_KERNEL); 2898 2897 if (rc == -EINVAL) { 2899 2898 if (!capable(CAP_MAC_ADMIN)) { 2900 2899 struct audit_buffer *ab; ··· 3051 3050 if (!value || !size) 3052 3051 return -EACCES; 3053 3052 3054 - rc = security_context_to_sid((void *)value, size, &newsid); 3053 + rc = security_context_to_sid((void *)value, size, &newsid, GFP_KERNEL); 3055 3054 if (rc) 3056 3055 return rc; 3057 3056 ··· 5530 5529 str[size-1] = 0; 5531 5530 size--; 5532 5531 } 5533 - error = security_context_to_sid(value, size, &sid); 5532 + error = security_context_to_sid(value, size, &sid, GFP_KERNEL); 5534 5533 if (error == -EINVAL && !strcmp(name, "fscreate")) { 5535 5534 if (!capable(CAP_MAC_ADMIN)) { 5536 5535 struct audit_buffer *ab; ··· 5639 5638 5640 5639 static int selinux_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid) 5641 5640 { 5642 - return security_context_to_sid(secdata, seclen, secid); 5641 + return security_context_to_sid(secdata, seclen, secid, GFP_KERNEL); 5643 5642 } 5644 5643 5645 5644 static void selinux_release_secctx(char *secdata, u32 seclen)
+1 -1
security/selinux/include/security.h
··· 134 134 int security_sid_to_context_force(u32 sid, char **scontext, u32 *scontext_len); 135 135 136 136 int security_context_to_sid(const char *scontext, u32 scontext_len, 137 - u32 *out_sid); 137 + u32 *out_sid, gfp_t gfp); 138 138 139 139 int security_context_to_sid_default(const char *scontext, u32 scontext_len, 140 140 u32 *out_sid, u32 def_sid, gfp_t gfp_flags);
+2 -1
security/selinux/include/xfrm.h
··· 10 10 #include <net/flow.h> 11 11 12 12 int selinux_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp, 13 - struct xfrm_user_sec_ctx *uctx); 13 + struct xfrm_user_sec_ctx *uctx, 14 + gfp_t gfp); 14 15 int selinux_xfrm_policy_clone(struct xfrm_sec_ctx *old_ctx, 15 16 struct xfrm_sec_ctx **new_ctxp); 16 17 void selinux_xfrm_policy_free(struct xfrm_sec_ctx *ctx);
+18 -10
security/selinux/selinuxfs.c
··· 576 576 if (length) 577 577 goto out; 578 578 579 - length = security_context_to_sid(buf, size, &sid); 579 + length = security_context_to_sid(buf, size, &sid, GFP_KERNEL); 580 580 if (length) 581 581 goto out; 582 582 ··· 731 731 if (sscanf(buf, "%s %s %hu", scon, tcon, &tclass) != 3) 732 732 goto out; 733 733 734 - length = security_context_to_sid(scon, strlen(scon) + 1, &ssid); 734 + length = security_context_to_sid(scon, strlen(scon) + 1, &ssid, 735 + GFP_KERNEL); 735 736 if (length) 736 737 goto out; 737 738 738 - length = security_context_to_sid(tcon, strlen(tcon) + 1, &tsid); 739 + length = security_context_to_sid(tcon, strlen(tcon) + 1, &tsid, 740 + GFP_KERNEL); 739 741 if (length) 740 742 goto out; 741 743 ··· 819 817 objname = namebuf; 820 818 } 821 819 822 - length = security_context_to_sid(scon, strlen(scon) + 1, &ssid); 820 + length = security_context_to_sid(scon, strlen(scon) + 1, &ssid, 821 + GFP_KERNEL); 823 822 if (length) 824 823 goto out; 825 824 826 - length = security_context_to_sid(tcon, strlen(tcon) + 1, &tsid); 825 + length = security_context_to_sid(tcon, strlen(tcon) + 1, &tsid, 826 + GFP_KERNEL); 827 827 if (length) 828 828 goto out; 829 829 ··· 882 878 if (sscanf(buf, "%s %s %hu", scon, tcon, &tclass) != 3) 883 879 goto out; 884 880 885 - length = security_context_to_sid(scon, strlen(scon) + 1, &ssid); 881 + length = security_context_to_sid(scon, strlen(scon) + 1, &ssid, 882 + GFP_KERNEL); 886 883 if (length) 887 884 goto out; 888 885 889 - length = security_context_to_sid(tcon, strlen(tcon) + 1, &tsid); 886 + length = security_context_to_sid(tcon, strlen(tcon) + 1, &tsid, 887 + GFP_KERNEL); 890 888 if (length) 891 889 goto out; 892 890 ··· 940 934 if (sscanf(buf, "%s %s", con, user) != 2) 941 935 goto out; 942 936 943 - length = security_context_to_sid(con, strlen(con) + 1, &sid); 937 + length = security_context_to_sid(con, strlen(con) + 1, &sid, GFP_KERNEL); 944 938 if (length) 945 939 goto out; 946 940 ··· 1000 994 if (sscanf(buf, "%s %s %hu", scon, tcon, &tclass) != 3) 1001 995 goto out; 1002 996 1003 - length = security_context_to_sid(scon, strlen(scon) + 1, &ssid); 997 + length = security_context_to_sid(scon, strlen(scon) + 1, &ssid, 998 + GFP_KERNEL); 1004 999 if (length) 1005 1000 goto out; 1006 1001 1007 - length = security_context_to_sid(tcon, strlen(tcon) + 1, &tsid); 1002 + length = security_context_to_sid(tcon, strlen(tcon) + 1, &tsid, 1003 + GFP_KERNEL); 1008 1004 if (length) 1009 1005 goto out; 1010 1006
+4 -2
security/selinux/ss/services.c
··· 1289 1289 * @scontext: security context 1290 1290 * @scontext_len: length in bytes 1291 1291 * @sid: security identifier, SID 1292 + * @gfp: context for the allocation 1292 1293 * 1293 1294 * Obtains a SID associated with the security context that 1294 1295 * has the string representation specified by @scontext. 1295 1296 * Returns -%EINVAL if the context is invalid, -%ENOMEM if insufficient 1296 1297 * memory is available, or 0 on success. 1297 1298 */ 1298 - int security_context_to_sid(const char *scontext, u32 scontext_len, u32 *sid) 1299 + int security_context_to_sid(const char *scontext, u32 scontext_len, u32 *sid, 1300 + gfp_t gfp) 1299 1301 { 1300 1302 return security_context_to_sid_core(scontext, scontext_len, 1301 - sid, SECSID_NULL, GFP_KERNEL, 0); 1303 + sid, SECSID_NULL, gfp, 0); 1302 1304 } 1303 1305 1304 1306 /**
+8 -6
security/selinux/xfrm.c
··· 78 78 * xfrm_user_sec_ctx context. 79 79 */ 80 80 static int selinux_xfrm_alloc_user(struct xfrm_sec_ctx **ctxp, 81 - struct xfrm_user_sec_ctx *uctx) 81 + struct xfrm_user_sec_ctx *uctx, 82 + gfp_t gfp) 82 83 { 83 84 int rc; 84 85 const struct task_security_struct *tsec = current_security(); ··· 95 94 if (str_len >= PAGE_SIZE) 96 95 return -ENOMEM; 97 96 98 - ctx = kmalloc(sizeof(*ctx) + str_len + 1, GFP_KERNEL); 97 + ctx = kmalloc(sizeof(*ctx) + str_len + 1, gfp); 99 98 if (!ctx) 100 99 return -ENOMEM; 101 100 ··· 104 103 ctx->ctx_len = str_len; 105 104 memcpy(ctx->ctx_str, &uctx[1], str_len); 106 105 ctx->ctx_str[str_len] = '\0'; 107 - rc = security_context_to_sid(ctx->ctx_str, str_len, &ctx->ctx_sid); 106 + rc = security_context_to_sid(ctx->ctx_str, str_len, &ctx->ctx_sid, gfp); 108 107 if (rc) 109 108 goto err; 110 109 ··· 283 282 * LSM hook implementation that allocs and transfers uctx spec to xfrm_policy. 284 283 */ 285 284 int selinux_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp, 286 - struct xfrm_user_sec_ctx *uctx) 285 + struct xfrm_user_sec_ctx *uctx, 286 + gfp_t gfp) 287 287 { 288 - return selinux_xfrm_alloc_user(ctxp, uctx); 288 + return selinux_xfrm_alloc_user(ctxp, uctx, gfp); 289 289 } 290 290 291 291 /* ··· 334 332 int selinux_xfrm_state_alloc(struct xfrm_state *x, 335 333 struct xfrm_user_sec_ctx *uctx) 336 334 { 337 - return selinux_xfrm_alloc_user(&x->security, uctx); 335 + return selinux_xfrm_alloc_user(&x->security, uctx, GFP_KERNEL); 338 336 } 339 337 340 338 /*