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

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

Pull networking changes from David Miller:
"The most important bit in here is the fix for input route caching from
Eric Dumazet, it's a shame we couldn't fully analyze this in time for
3.6 as it's a 3.6 regression introduced by the routing cache removal.

Anyways, will send quickly to -stable after you pull this in.

Other changes of note:

1) Fix lockdep splats in team and bonding, from Eric Dumazet.

2) IPV6 adds link local route even when there is no link local
address, from Nicolas Dichtel.

3) Fix ixgbe PTP implementation, from Jacob Keller.

4) Fix excessive stack usage in cxgb4 driver, from Vipul Pandya.

5) MAC length computed improperly in VLAN demux, from Antonio
Quartulli."

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (26 commits)
ipv6: release reference of ip6_null_entry's dst entry in __ip6_del_rt
Remove noisy printks from llcp_sock_connect
tipc: prevent dropped connections due to rcvbuf overflow
silence some noisy printks in irda
team: set qdisc_tx_busylock to avoid LOCKDEP splat
bonding: set qdisc_tx_busylock to avoid LOCKDEP splat
sctp: check src addr when processing SACK to update transport state
sctp: fix a typo in prototype of __sctp_rcv_lookup()
ipv4: add a fib_type to fib_info
can: mpc5xxx_can: fix section type conflict
can: peak_pcmcia: fix error return code
can: peak_pci: fix error return code
cxgb4: Fix build error due to missing linux/vmalloc.h include.
bnx2x: fix ring size for 10G functions
cxgb4: Dynamically allocate memory in t4_memory_rw() and get_vpd_params()
ixgbe: add support for X540-AT1
ixgbe: fix poll loop for FDIRCTRL.INIT_DONE bit
ixgbe: fix PTP ethtool timestamping function
ixgbe: (PTP) Fix PPS interrupt code
ixgbe: Fix PTP X540 SDP alignment code for PPS signal
...

+209 -185
+2
drivers/net/bonding/bond_main.c
··· 4826 4826 4827 4827 static struct lock_class_key bonding_netdev_xmit_lock_key; 4828 4828 static struct lock_class_key bonding_netdev_addr_lock_key; 4829 + static struct lock_class_key bonding_tx_busylock_key; 4829 4830 4830 4831 static void bond_set_lockdep_class_one(struct net_device *dev, 4831 4832 struct netdev_queue *txq, ··· 4841 4840 lockdep_set_class(&dev->addr_list_lock, 4842 4841 &bonding_netdev_addr_lock_key); 4843 4842 netdev_for_each_tx_queue(dev, bond_set_lockdep_class_one, NULL); 4843 + dev->qdisc_tx_busylock = &bonding_tx_busylock_key; 4844 4844 } 4845 4845 4846 4846 /*
+4 -4
drivers/net/can/mscan/mpc5xxx_can.c
··· 247 247 } 248 248 #endif /* CONFIG_PPC_MPC512x */ 249 249 250 - static struct of_device_id mpc5xxx_can_table[]; 250 + static const struct of_device_id mpc5xxx_can_table[]; 251 251 static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev) 252 252 { 253 253 const struct of_device_id *match; ··· 380 380 } 381 381 #endif 382 382 383 - static const struct mpc5xxx_can_data __devinitdata mpc5200_can_data = { 383 + static const struct mpc5xxx_can_data __devinitconst mpc5200_can_data = { 384 384 .type = MSCAN_TYPE_MPC5200, 385 385 .get_clock = mpc52xx_can_get_clock, 386 386 }; 387 387 388 - static const struct mpc5xxx_can_data __devinitdata mpc5121_can_data = { 388 + static const struct mpc5xxx_can_data __devinitconst mpc5121_can_data = { 389 389 .type = MSCAN_TYPE_MPC5121, 390 390 .get_clock = mpc512x_can_get_clock, 391 391 }; 392 392 393 - static struct of_device_id __devinitdata mpc5xxx_can_table[] = { 393 + static const struct of_device_id __devinitconst mpc5xxx_can_table[] = { 394 394 { .compatible = "fsl,mpc5200-mscan", .data = &mpc5200_can_data, }, 395 395 /* Note that only MPC5121 Rev. 2 (and later) is supported */ 396 396 { .compatible = "fsl,mpc5121-mscan", .data = &mpc5121_can_data, },
+2
drivers/net/can/sja1000/peak_pci.c
··· 583 583 cfg_base = pci_iomap(pdev, 0, PEAK_PCI_CFG_SIZE); 584 584 if (!cfg_base) { 585 585 dev_err(&pdev->dev, "failed to map PCI resource #0\n"); 586 + err = -ENOMEM; 586 587 goto failure_release_regions; 587 588 } 588 589 589 590 reg_base = pci_iomap(pdev, 1, PEAK_PCI_CHAN_SIZE * channels); 590 591 if (!reg_base) { 591 592 dev_err(&pdev->dev, "failed to map PCI resource #1\n"); 593 + err = -ENOMEM; 592 594 goto failure_unmap_cfg_base; 593 595 } 594 596
+3 -1
drivers/net/can/sja1000/peak_pcmcia.c
··· 686 686 687 687 /* detect available channels */ 688 688 pcan_add_channels(card); 689 - if (!card->chan_count) 689 + if (!card->chan_count) { 690 + err = -ENOMEM; 690 691 goto probe_err_4; 692 + } 691 693 692 694 /* init the timer which controls the leds */ 693 695 init_timer(&card->led_timer);
+10 -7
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
··· 3523 3523 } else 3524 3524 #endif 3525 3525 if (!bp->rx_ring_size) { 3526 - u32 cfg = SHMEM_RD(bp, 3527 - dev_info.port_hw_config[BP_PORT(bp)].default_cfg); 3528 - 3529 3526 rx_ring_size = MAX_RX_AVAIL/BNX2X_NUM_RX_QUEUES(bp); 3530 3527 3531 - /* Dercease ring size for 1G functions */ 3532 - if ((cfg & PORT_HW_CFG_NET_SERDES_IF_MASK) == 3533 - PORT_HW_CFG_NET_SERDES_IF_SGMII) 3534 - rx_ring_size /= 10; 3528 + if (CHIP_IS_E3(bp)) { 3529 + u32 cfg = SHMEM_RD(bp, 3530 + dev_info.port_hw_config[BP_PORT(bp)]. 3531 + default_cfg); 3532 + 3533 + /* Decrease ring size for 1G functions */ 3534 + if ((cfg & PORT_HW_CFG_NET_SERDES_IF_MASK) == 3535 + PORT_HW_CFG_NET_SERDES_IF_SGMII) 3536 + rx_ring_size /= 10; 3537 + } 3535 3538 3536 3539 /* allocate at least number of buffers required by FW */ 3537 3540 rx_ring_size = max_t(int, bp->disable_tpa ? MIN_RX_SIZE_NONTPA :
+2 -3
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
··· 3052 3052 struct eth_stats_info *ether_stat = 3053 3053 &bp->slowpath->drv_info_to_mcp.ether_stat; 3054 3054 3055 - /* leave last char as NULL */ 3056 - memcpy(ether_stat->version, DRV_MODULE_VERSION, 3057 - ETH_STAT_INFO_VERSION_LEN - 1); 3055 + strlcpy(ether_stat->version, DRV_MODULE_VERSION, 3056 + ETH_STAT_INFO_VERSION_LEN); 3058 3057 3059 3058 bp->sp_objs[0].mac_obj.get_n_elements(bp, &bp->sp_objs[0].mac_obj, 3060 3059 DRV_INFO_ETH_STAT_NUM_MACS_REQUIRED,
+6 -5
drivers/net/ethernet/broadcom/tg3.c
··· 782 782 return i == timeout_us / 10; 783 783 } 784 784 785 - int tg3_ape_scratchpad_read(struct tg3 *tp, u32 *data, u32 base_off, u32 len) 785 + static int tg3_ape_scratchpad_read(struct tg3 *tp, u32 *data, u32 base_off, 786 + u32 len) 786 787 { 787 788 int err; 788 789 u32 i, bufoff, msgoff, maxlen, apedata; ··· 7764 7763 sblk = tnapi->hw_status; 7765 7764 7766 7765 if (tg3_flag(tp, ENABLE_RSS)) { 7767 - u16 *prodptr = 0; 7766 + u16 *prodptr = NULL; 7768 7767 7769 7768 /* 7770 7769 * When RSS is enabled, the status block format changes ··· 8104 8103 u16 val16; 8105 8104 8106 8105 if (tp->pci_chip_rev_id == CHIPREV_ID_5750_A0) { 8107 - int i; 8106 + int j; 8108 8107 u32 cfg_val; 8109 8108 8110 8109 /* Wait for link training to complete. */ 8111 - for (i = 0; i < 5000; i++) 8110 + for (j = 0; j < 5000; j++) 8112 8111 udelay(100); 8113 8112 8114 8113 pci_read_config_dword(tp->pdev, 0xc4, &cfg_val); ··· 10207 10206 static bool tg3_enable_msix(struct tg3 *tp) 10208 10207 { 10209 10208 int i, rc; 10210 - struct msix_entry msix_ent[tp->irq_max]; 10209 + struct msix_entry msix_ent[TG3_IRQ_MAX_VECS]; 10211 10210 10212 10211 tp->txq_cnt = tp->txq_req; 10213 10212 tp->rxq_cnt = tp->rxq_req;
+1
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
··· 43 43 #include <linux/pci.h> 44 44 #include <linux/spinlock.h> 45 45 #include <linux/timer.h> 46 + #include <linux/vmalloc.h> 46 47 #include <asm/io.h> 47 48 #include "cxgb4_uld.h" 48 49 #include "t4_hw.h"
+30 -13
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
··· 408 408 __be32 *buf, int dir) 409 409 { 410 410 u32 pos, start, end, offset, memoffset; 411 - int ret; 411 + int ret = 0; 412 + __be32 *data; 412 413 413 414 /* 414 415 * Argument sanity checks ... 415 416 */ 416 417 if ((addr & 0x3) || (len & 0x3)) 417 418 return -EINVAL; 419 + 420 + data = vmalloc(MEMWIN0_APERTURE/sizeof(__be32)); 421 + if (!data) 422 + return -ENOMEM; 418 423 419 424 /* 420 425 * Offset into the region of memory which is being accessed ··· 443 438 offset = (addr - start)/sizeof(__be32); 444 439 445 440 for (pos = start; pos < end; pos += MEMWIN0_APERTURE, offset = 0) { 446 - __be32 data[MEMWIN0_APERTURE/sizeof(__be32)]; 447 441 448 442 /* 449 443 * If we're writing, copy the data from the caller's memory ··· 456 452 if (offset || len < MEMWIN0_APERTURE) { 457 453 ret = t4_mem_win_rw(adap, pos, data, 1); 458 454 if (ret) 459 - return ret; 455 + break; 460 456 } 461 457 while (offset < (MEMWIN0_APERTURE/sizeof(__be32)) && 462 458 len > 0) { ··· 470 466 */ 471 467 ret = t4_mem_win_rw(adap, pos, data, dir); 472 468 if (ret) 473 - return ret; 469 + break; 474 470 475 471 /* 476 472 * If we're reading, copy the data into the caller's memory ··· 484 480 } 485 481 } 486 482 487 - return 0; 483 + vfree(data); 484 + return ret; 488 485 } 489 486 490 487 int t4_memory_write(struct adapter *adap, int mtype, u32 addr, u32 len, ··· 524 519 u32 cclk_param, cclk_val; 525 520 int i, ret; 526 521 int ec, sn; 527 - u8 vpd[VPD_LEN], csum; 522 + u8 *vpd, csum; 528 523 unsigned int vpdr_len, kw_offset, id_len; 529 524 530 - ret = pci_read_vpd(adapter->pdev, VPD_BASE, sizeof(vpd), vpd); 525 + vpd = vmalloc(VPD_LEN); 526 + if (!vpd) 527 + return -ENOMEM; 528 + 529 + ret = pci_read_vpd(adapter->pdev, VPD_BASE, VPD_LEN, vpd); 531 530 if (ret < 0) 532 - return ret; 531 + goto out; 533 532 534 533 if (vpd[0] != PCI_VPD_LRDT_ID_STRING) { 535 534 dev_err(adapter->pdev_dev, "missing VPD ID string\n"); 536 - return -EINVAL; 535 + ret = -EINVAL; 536 + goto out; 537 537 } 538 538 539 539 id_len = pci_vpd_lrdt_size(vpd); ··· 548 538 i = pci_vpd_find_tag(vpd, 0, VPD_LEN, PCI_VPD_LRDT_RO_DATA); 549 539 if (i < 0) { 550 540 dev_err(adapter->pdev_dev, "missing VPD-R section\n"); 551 - return -EINVAL; 541 + ret = -EINVAL; 542 + goto out; 552 543 } 553 544 554 545 vpdr_len = pci_vpd_lrdt_size(&vpd[i]); 555 546 kw_offset = i + PCI_VPD_LRDT_TAG_SIZE; 556 547 if (vpdr_len + kw_offset > VPD_LEN) { 557 548 dev_err(adapter->pdev_dev, "bad VPD-R length %u\n", vpdr_len); 558 - return -EINVAL; 549 + ret = -EINVAL; 550 + goto out; 559 551 } 560 552 561 553 #define FIND_VPD_KW(var, name) do { \ 562 554 var = pci_vpd_find_info_keyword(vpd, kw_offset, vpdr_len, name); \ 563 555 if (var < 0) { \ 564 556 dev_err(adapter->pdev_dev, "missing VPD keyword " name "\n"); \ 565 - return -EINVAL; \ 557 + ret = -EINVAL; \ 558 + goto out; \ 566 559 } \ 567 560 var += PCI_VPD_INFO_FLD_HDR_SIZE; \ 568 561 } while (0) ··· 577 564 if (csum) { 578 565 dev_err(adapter->pdev_dev, 579 566 "corrupted VPD EEPROM, actual csum %u\n", csum); 580 - return -EINVAL; 567 + ret = -EINVAL; 568 + goto out; 581 569 } 582 570 583 571 FIND_VPD_KW(ec, "EC"); ··· 601 587 FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_CCLK)); 602 588 ret = t4_query_params(adapter, adapter->mbox, 0, 0, 603 589 1, &cclk_param, &cclk_val); 590 + 591 + out: 592 + vfree(vpd); 604 593 if (ret) 605 594 return ret; 606 595 p->cclk = cclk_val;
+1 -1
drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
··· 1099 1099 if (IXGBE_READ_REG(hw, IXGBE_FDIRCTRL) & 1100 1100 IXGBE_FDIRCTRL_INIT_DONE) 1101 1101 break; 1102 - udelay(10); 1102 + usleep_range(1000, 2000); 1103 1103 } 1104 1104 if (i >= IXGBE_FDIR_INIT_DONE_POLL) { 1105 1105 hw_dbg(hw, "Flow Director Signature poll time exceeded!\n");
+1
drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
··· 70 70 71 71 switch (hw->device_id) { 72 72 case IXGBE_DEV_ID_X540T: 73 + case IXGBE_DEV_ID_X540T1: 73 74 return 0; 74 75 case IXGBE_DEV_ID_82599_T3_LOM: 75 76 return 0;
+1 -4
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
··· 2690 2690 (1 << HWTSTAMP_FILTER_NONE) | 2691 2691 (1 << HWTSTAMP_FILTER_PTP_V1_L4_SYNC) | 2692 2692 (1 << HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ) | 2693 - (1 << HWTSTAMP_FILTER_PTP_V2_SYNC) | 2694 - (1 << HWTSTAMP_FILTER_PTP_V2_DELAY_REQ) | 2695 - (1 << HWTSTAMP_FILTER_PTP_V2_EVENT) | 2696 - (1 << HWTSTAMP_FILTER_SOME); 2693 + (1 << HWTSTAMP_FILTER_PTP_V2_EVENT); 2697 2694 break; 2698 2695 #endif /* CONFIG_IXGBE_PTP */ 2699 2696 default:
+13 -2
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
··· 114 114 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_LS), board_82599 }, 115 115 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599EN_SFP), board_82599 }, 116 116 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_SFP_SF_QP), board_82599 }, 117 + {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X540T1), board_X540 }, 117 118 /* required last entry */ 118 119 {0, } 119 120 }; ··· 2323 2322 default: 2324 2323 break; 2325 2324 } 2325 + 2326 + #ifdef CONFIG_IXGBE_PTP 2327 + if (adapter->hw.mac.type == ixgbe_mac_X540) 2328 + mask |= IXGBE_EIMS_TIMESYNC; 2329 + #endif 2330 + 2326 2331 if ((adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) && 2327 2332 !(adapter->flags2 & IXGBE_FLAG2_FDIR_REQUIRES_REINIT)) 2328 2333 mask |= IXGBE_EIMS_FLOW_DIR; ··· 2392 2385 } 2393 2386 2394 2387 ixgbe_check_fan_failure(adapter, eicr); 2388 + 2395 2389 #ifdef CONFIG_IXGBE_PTP 2396 - ixgbe_ptp_check_pps_event(adapter, eicr); 2390 + if (unlikely(eicr & IXGBE_EICR_TIMESYNC)) 2391 + ixgbe_ptp_check_pps_event(adapter, eicr); 2397 2392 #endif 2398 2393 2399 2394 /* re-enable the original interrupt state, no lsc, no queues */ ··· 2589 2580 2590 2581 ixgbe_check_fan_failure(adapter, eicr); 2591 2582 #ifdef CONFIG_IXGBE_PTP 2592 - ixgbe_ptp_check_pps_event(adapter, eicr); 2583 + if (unlikely(eicr & IXGBE_EICR_TIMESYNC)) 2584 + ixgbe_ptp_check_pps_event(adapter, eicr); 2593 2585 #endif 2594 2586 2595 2587 /* would disable interrupts here but EIAM disabled it */ ··· 7055 7045 is_wol_supported = 1; 7056 7046 break; 7057 7047 case IXGBE_DEV_ID_X540T: 7048 + case IXGBE_DEV_ID_X540T1: 7058 7049 /* check eeprom to see if enabled wol */ 7059 7050 if ((wol_cap == IXGBE_DEVICE_CAPS_WOL_PORT0_1) || 7060 7051 ((wol_cap == IXGBE_DEVICE_CAPS_WOL_PORT0) &&
+95 -107
drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
··· 106 106 }; 107 107 108 108 /** 109 + * ixgbe_ptp_setup_sdp 110 + * @hw: the hardware private structure 111 + * 112 + * this function enables or disables the clock out feature on SDP0 for 113 + * the X540 device. It will create a 1second periodic output that can 114 + * be used as the PPS (via an interrupt). 115 + * 116 + * It calculates when the systime will be on an exact second, and then 117 + * aligns the start of the PPS signal to that value. The shift is 118 + * necessary because it can change based on the link speed. 119 + */ 120 + static void ixgbe_ptp_setup_sdp(struct ixgbe_adapter *adapter) 121 + { 122 + struct ixgbe_hw *hw = &adapter->hw; 123 + int shift = adapter->cc.shift; 124 + u32 esdp, tsauxc, clktiml, clktimh, trgttiml, trgttimh, rem; 125 + u64 ns = 0, clock_edge = 0; 126 + 127 + if ((adapter->flags2 & IXGBE_FLAG2_PTP_PPS_ENABLED) && 128 + (hw->mac.type == ixgbe_mac_X540)) { 129 + 130 + /* disable the pin first */ 131 + IXGBE_WRITE_REG(hw, IXGBE_TSAUXC, 0x0); 132 + IXGBE_WRITE_FLUSH(hw); 133 + 134 + esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); 135 + 136 + /* 137 + * enable the SDP0 pin as output, and connected to the 138 + * native function for Timesync (ClockOut) 139 + */ 140 + esdp |= (IXGBE_ESDP_SDP0_DIR | 141 + IXGBE_ESDP_SDP0_NATIVE); 142 + 143 + /* 144 + * enable the Clock Out feature on SDP0, and allow 145 + * interrupts to occur when the pin changes 146 + */ 147 + tsauxc = (IXGBE_TSAUXC_EN_CLK | 148 + IXGBE_TSAUXC_SYNCLK | 149 + IXGBE_TSAUXC_SDP0_INT); 150 + 151 + /* clock period (or pulse length) */ 152 + clktiml = (u32)(NSECS_PER_SEC << shift); 153 + clktimh = (u32)((NSECS_PER_SEC << shift) >> 32); 154 + 155 + /* 156 + * Account for the cyclecounter wrap-around value by 157 + * using the converted ns value of the current time to 158 + * check for when the next aligned second would occur. 159 + */ 160 + clock_edge |= (u64)IXGBE_READ_REG(hw, IXGBE_SYSTIML); 161 + clock_edge |= (u64)IXGBE_READ_REG(hw, IXGBE_SYSTIMH) << 32; 162 + ns = timecounter_cyc2time(&adapter->tc, clock_edge); 163 + 164 + div_u64_rem(ns, NSECS_PER_SEC, &rem); 165 + clock_edge += ((NSECS_PER_SEC - (u64)rem) << shift); 166 + 167 + /* specify the initial clock start time */ 168 + trgttiml = (u32)clock_edge; 169 + trgttimh = (u32)(clock_edge >> 32); 170 + 171 + IXGBE_WRITE_REG(hw, IXGBE_CLKTIML, clktiml); 172 + IXGBE_WRITE_REG(hw, IXGBE_CLKTIMH, clktimh); 173 + IXGBE_WRITE_REG(hw, IXGBE_TRGTTIML0, trgttiml); 174 + IXGBE_WRITE_REG(hw, IXGBE_TRGTTIMH0, trgttimh); 175 + 176 + IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp); 177 + IXGBE_WRITE_REG(hw, IXGBE_TSAUXC, tsauxc); 178 + } else { 179 + IXGBE_WRITE_REG(hw, IXGBE_TSAUXC, 0x0); 180 + } 181 + 182 + IXGBE_WRITE_FLUSH(hw); 183 + } 184 + 185 + /** 109 186 * ixgbe_ptp_read - read raw cycle counter (to be used by time counter) 110 187 * @cc: the cyclecounter structure 111 188 * ··· 275 198 now); 276 199 277 200 spin_unlock_irqrestore(&adapter->tmreg_lock, flags); 201 + 202 + ixgbe_ptp_setup_sdp(adapter); 203 + 278 204 return 0; 279 205 } 280 206 ··· 331 251 timecounter_init(&adapter->tc, &adapter->cc, ns); 332 252 spin_unlock_irqrestore(&adapter->tmreg_lock, flags); 333 253 254 + ixgbe_ptp_setup_sdp(adapter); 334 255 return 0; 335 256 } 336 257 ··· 362 281 if (on) 363 282 adapter->flags2 |= IXGBE_FLAG2_PTP_PPS_ENABLED; 364 283 else 365 - adapter->flags2 &= 366 - ~IXGBE_FLAG2_PTP_PPS_ENABLED; 284 + adapter->flags2 &= ~IXGBE_FLAG2_PTP_PPS_ENABLED; 285 + 286 + ixgbe_ptp_setup_sdp(adapter); 367 287 return 0; 368 288 default: 369 289 break; ··· 387 305 struct ixgbe_hw *hw = &adapter->hw; 388 306 struct ptp_clock_event event; 389 307 390 - event.type = PTP_CLOCK_PPS; 391 - 392 - /* Make sure ptp clock is valid, and PPS event enabled */ 393 - if (!adapter->ptp_clock || 394 - !(adapter->flags2 & IXGBE_FLAG2_PTP_PPS_ENABLED)) 395 - return; 396 - 397 - if (unlikely(eicr & IXGBE_EICR_TIMESYNC)) { 398 - switch (hw->mac.type) { 399 - case ixgbe_mac_X540: 400 - ptp_clock_event(adapter->ptp_clock, &event); 401 - break; 402 - default: 403 - break; 404 - } 405 - } 406 - } 407 - 408 - /** 409 - * ixgbe_ptp_enable_sdp 410 - * @hw: the hardware private structure 411 - * @shift: the clock shift for calculating nanoseconds 412 - * 413 - * this function enables the clock out feature on the sdp0 for the 414 - * X540 device. It will create a 1second periodic output that can be 415 - * used as the PPS (via an interrupt). 416 - * 417 - * It calculates when the systime will be on an exact second, and then 418 - * aligns the start of the PPS signal to that value. The shift is 419 - * necessary because it can change based on the link speed. 420 - */ 421 - static void ixgbe_ptp_enable_sdp(struct ixgbe_hw *hw, int shift) 422 - { 423 - u32 esdp, tsauxc, clktiml, clktimh, trgttiml, trgttimh; 424 - u64 clock_edge = 0; 425 - u32 rem; 426 - 427 308 switch (hw->mac.type) { 428 309 case ixgbe_mac_X540: 429 - esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); 430 - 431 - /* 432 - * enable the SDP0 pin as output, and connected to the native 433 - * function for Timesync (ClockOut) 434 - */ 435 - esdp |= (IXGBE_ESDP_SDP0_DIR | 436 - IXGBE_ESDP_SDP0_NATIVE); 437 - 438 - /* 439 - * enable the Clock Out feature on SDP0, and allow interrupts 440 - * to occur when the pin changes 441 - */ 442 - tsauxc = (IXGBE_TSAUXC_EN_CLK | 443 - IXGBE_TSAUXC_SYNCLK | 444 - IXGBE_TSAUXC_SDP0_INT); 445 - 446 - /* clock period (or pulse length) */ 447 - clktiml = (u32)(NSECS_PER_SEC << shift); 448 - clktimh = (u32)((NSECS_PER_SEC << shift) >> 32); 449 - 450 - clock_edge |= (u64)IXGBE_READ_REG(hw, IXGBE_SYSTIML); 451 - clock_edge |= (u64)IXGBE_READ_REG(hw, IXGBE_SYSTIMH) << 32; 452 - 453 - /* 454 - * account for the fact that we can't do u64 division 455 - * with remainder, by converting the clock values into 456 - * nanoseconds first 457 - */ 458 - clock_edge >>= shift; 459 - div_u64_rem(clock_edge, NSECS_PER_SEC, &rem); 460 - clock_edge += (NSECS_PER_SEC - rem); 461 - clock_edge <<= shift; 462 - 463 - /* specify the initial clock start time */ 464 - trgttiml = (u32)clock_edge; 465 - trgttimh = (u32)(clock_edge >> 32); 466 - 467 - IXGBE_WRITE_REG(hw, IXGBE_CLKTIML, clktiml); 468 - IXGBE_WRITE_REG(hw, IXGBE_CLKTIMH, clktimh); 469 - IXGBE_WRITE_REG(hw, IXGBE_TRGTTIML0, trgttiml); 470 - IXGBE_WRITE_REG(hw, IXGBE_TRGTTIMH0, trgttimh); 471 - 472 - IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp); 473 - IXGBE_WRITE_REG(hw, IXGBE_TSAUXC, tsauxc); 474 - 475 - IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EICR_TIMESYNC); 310 + ptp_clock_event(adapter->ptp_clock, &event); 476 311 break; 477 312 default: 478 313 break; 479 314 } 480 315 } 481 316 482 - /** 483 - * ixgbe_ptp_disable_sdp 484 - * @hw: the private hardware structure 485 - * 486 - * this function disables the auxiliary SDP clock out feature 487 - */ 488 - static void ixgbe_ptp_disable_sdp(struct ixgbe_hw *hw) 489 - { 490 - IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_EICR_TIMESYNC); 491 - IXGBE_WRITE_REG(hw, IXGBE_TSAUXC, 0); 492 - } 493 317 494 318 /** 495 319 * ixgbe_ptp_overflow_check - delayed work to detect SYSTIME overflow ··· 810 822 if (adapter->cycle_speed == cycle_speed && timinca) 811 823 return; 812 824 813 - /* disable the SDP clock out */ 814 - ixgbe_ptp_disable_sdp(hw); 815 - 816 825 /** 817 826 * Scale the NIC cycle counter by a large factor so that 818 827 * relatively small corrections to the frequency can be added ··· 862 877 IXGBE_WRITE_REG(hw, IXGBE_SYSTIMH, 0x00000000); 863 878 IXGBE_WRITE_FLUSH(hw); 864 879 865 - /* now that the shift has been calculated and the systime 866 - * registers reset, (re-)enable the Clock out feature*/ 867 - ixgbe_ptp_enable_sdp(hw, shift); 868 - 869 880 /* store the new cycle speed */ 870 881 adapter->cycle_speed = cycle_speed; 871 882 ··· 882 901 ktime_to_ns(ktime_get_real())); 883 902 884 903 spin_unlock_irqrestore(&adapter->tmreg_lock, flags); 904 + 905 + /* 906 + * Now that the shift has been calculated and the systime 907 + * registers reset, (re-)enable the Clock out feature 908 + */ 909 + ixgbe_ptp_setup_sdp(adapter); 885 910 } 886 911 887 912 /** ··· 966 979 */ 967 980 void ixgbe_ptp_stop(struct ixgbe_adapter *adapter) 968 981 { 969 - ixgbe_ptp_disable_sdp(&adapter->hw); 970 - 971 982 /* stop the overflow check task */ 972 - adapter->flags2 &= ~IXGBE_FLAG2_OVERFLOW_CHECK_ENABLED; 983 + adapter->flags2 &= ~(IXGBE_FLAG2_OVERFLOW_CHECK_ENABLED | 984 + IXGBE_FLAG2_PTP_PPS_ENABLED); 985 + 986 + ixgbe_ptp_setup_sdp(adapter); 973 987 974 988 if (adapter->ptp_clock) { 975 989 ptp_clock_unregister(adapter->ptp_clock);
+1
drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
··· 65 65 #define IXGBE_DEV_ID_82599_LS 0x154F 66 66 #define IXGBE_DEV_ID_X540T 0x1528 67 67 #define IXGBE_DEV_ID_82599_SFP_SF_QP 0x154A 68 + #define IXGBE_DEV_ID_X540T1 0x1560 68 69 69 70 /* VF Device IDs */ 70 71 #define IXGBE_DEV_ID_82599_VF 0x10ED
+1 -1
drivers/net/ethernet/oki-semi/pch_gbe/Kconfig
··· 26 26 config PCH_PTP 27 27 bool "PCH PTP clock support" 28 28 default n 29 - depends on PTP_1588_CLOCK_PCH 29 + select PTP_1588_CLOCK_PCH 30 30 ---help--- 31 31 Say Y here if you want to use Precision Time Protocol (PTP) in the 32 32 driver. PTP is a method to precisely synchronize distributed clocks
+1
drivers/net/ethernet/ti/davinci_cpdma.c
··· 863 863 864 864 next_dma = desc_read(desc, hw_next); 865 865 chan->head = desc_from_phys(pool, next_dma); 866 + chan->count--; 866 867 chan->stats.teardown_dequeue++; 867 868 868 869 /* issue callback without locks held */
+2
drivers/net/team/team.c
··· 1315 1315 1316 1316 static struct lock_class_key team_netdev_xmit_lock_key; 1317 1317 static struct lock_class_key team_netdev_addr_lock_key; 1318 + static struct lock_class_key team_tx_busylock_key; 1318 1319 1319 1320 static void team_set_lockdep_class_one(struct net_device *dev, 1320 1321 struct netdev_queue *txq, ··· 1328 1327 { 1329 1328 lockdep_set_class(&dev->addr_list_lock, &team_netdev_addr_lock_key); 1330 1329 netdev_for_each_tx_queue(dev, team_set_lockdep_class_one, NULL); 1330 + dev->qdisc_tx_busylock = &team_tx_busylock_key; 1331 1331 } 1332 1332 1333 1333 static int team_init(struct net_device *dev)
+1
include/net/ip_fib.h
··· 102 102 unsigned char fib_dead; 103 103 unsigned char fib_protocol; 104 104 unsigned char fib_scope; 105 + unsigned char fib_type; 105 106 __be32 fib_prefsrc; 106 107 u32 fib_priority; 107 108 u32 *fib_metrics;
+1 -1
include/net/sctp/structs.h
··· 1068 1068 void sctp_outq_teardown(struct sctp_outq *); 1069 1069 void sctp_outq_free(struct sctp_outq*); 1070 1070 int sctp_outq_tail(struct sctp_outq *, struct sctp_chunk *chunk); 1071 - int sctp_outq_sack(struct sctp_outq *, struct sctp_sackhdr *); 1071 + int sctp_outq_sack(struct sctp_outq *, struct sctp_chunk *); 1072 1072 int sctp_outq_is_empty(const struct sctp_outq *); 1073 1073 void sctp_outq_restart(struct sctp_outq *); 1074 1074
+2 -1
net/8021q/vlan_core.c
··· 105 105 return NULL; 106 106 memmove(skb->data - ETH_HLEN, skb->data - VLAN_ETH_HLEN, 2 * ETH_ALEN); 107 107 skb->mac_header += VLAN_HLEN; 108 - skb_reset_mac_len(skb); 109 108 return skb; 110 109 } 111 110 ··· 138 139 139 140 skb_reset_network_header(skb); 140 141 skb_reset_transport_header(skb); 142 + skb_reset_mac_len(skb); 143 + 141 144 return skb; 142 145 143 146 err_free:
+2
net/ipv4/fib_semantics.c
··· 314 314 nfi->fib_scope == fi->fib_scope && 315 315 nfi->fib_prefsrc == fi->fib_prefsrc && 316 316 nfi->fib_priority == fi->fib_priority && 317 + nfi->fib_type == fi->fib_type && 317 318 memcmp(nfi->fib_metrics, fi->fib_metrics, 318 319 sizeof(u32) * RTAX_MAX) == 0 && 319 320 ((nfi->fib_flags ^ fi->fib_flags) & ~RTNH_F_DEAD) == 0 && ··· 834 833 fi->fib_flags = cfg->fc_flags; 835 834 fi->fib_priority = cfg->fc_priority; 836 835 fi->fib_prefsrc = cfg->fc_prefsrc; 836 + fi->fib_type = cfg->fc_type; 837 837 838 838 fi->fib_nhs = nhs; 839 839 change_nexthops(fi) {
+2 -13
net/ipv6/addrconf.c
··· 1769 1769 } 1770 1770 #endif 1771 1771 1772 - static void addrconf_add_lroute(struct net_device *dev) 1773 - { 1774 - struct in6_addr addr; 1775 - 1776 - ipv6_addr_set(&addr, htonl(0xFE800000), 0, 0, 0); 1777 - addrconf_prefix_route(&addr, 64, dev, 0, 0); 1778 - } 1779 - 1780 1772 static struct inet6_dev *addrconf_add_dev(struct net_device *dev) 1781 1773 { 1782 1774 struct inet6_dev *idev; ··· 1786 1794 if (!(dev->flags & IFF_LOOPBACK)) 1787 1795 addrconf_add_mroute(dev); 1788 1796 1789 - /* Add link local route */ 1790 - addrconf_add_lroute(dev); 1791 1797 return idev; 1792 1798 } 1793 1799 ··· 2464 2474 2465 2475 sit_add_v4_addrs(idev); 2466 2476 2467 - if (dev->flags&IFF_POINTOPOINT) { 2477 + if (dev->flags&IFF_POINTOPOINT) 2468 2478 addrconf_add_mroute(dev); 2469 - addrconf_add_lroute(dev); 2470 - } else 2479 + else 2471 2480 sit_route_add(dev); 2472 2481 } 2473 2482 #endif
+6 -5
net/ipv6/route.c
··· 1593 1593 struct fib6_table *table; 1594 1594 struct net *net = dev_net(rt->dst.dev); 1595 1595 1596 - if (rt == net->ipv6.ip6_null_entry) 1597 - return -ENOENT; 1596 + if (rt == net->ipv6.ip6_null_entry) { 1597 + err = -ENOENT; 1598 + goto out; 1599 + } 1598 1600 1599 1601 table = rt->rt6i_table; 1600 1602 write_lock_bh(&table->tb6_lock); 1601 - 1602 1603 err = fib6_del(rt, info); 1603 - dst_release(&rt->dst); 1604 - 1605 1604 write_unlock_bh(&table->tb6_lock); 1606 1605 1606 + out: 1607 + dst_release(&rt->dst); 1607 1608 return err; 1608 1609 } 1609 1610
+1 -1
net/irda/af_irda.c
··· 468 468 notify_t notify; 469 469 470 470 if (self->tsap) { 471 - IRDA_WARNING("%s: busy!\n", __func__); 471 + IRDA_DEBUG(0, "%s: busy!\n", __func__); 472 472 return -EBUSY; 473 473 } 474 474
+1 -1
net/irda/irttp.c
··· 440 440 */ 441 441 lsap = irlmp_open_lsap(stsap_sel, &ttp_notify, 0); 442 442 if (lsap == NULL) { 443 - IRDA_WARNING("%s: unable to allocate LSAP!!\n", __func__); 443 + IRDA_DEBUG(0, "%s: unable to allocate LSAP!!\n", __func__); 444 444 return NULL; 445 445 } 446 446
+2 -6
net/nfc/llcp/sock.c
··· 497 497 pr_debug("sock %p sk %p flags 0x%x\n", sock, sk, flags); 498 498 499 499 if (!addr || len < sizeof(struct sockaddr_nfc) || 500 - addr->sa_family != AF_NFC) { 501 - pr_err("Invalid socket\n"); 500 + addr->sa_family != AF_NFC) 502 501 return -EINVAL; 503 - } 504 502 505 - if (addr->service_name_len == 0 && addr->dsap == 0) { 506 - pr_err("Missing service name or dsap\n"); 503 + if (addr->service_name_len == 0 && addr->dsap == 0) 507 504 return -EINVAL; 508 - } 509 505 510 506 pr_debug("addr dev_idx=%u target_idx=%u protocol=%u\n", addr->dev_idx, 511 507 addr->target_idx, addr->nfc_protocol);
+1 -1
net/sctp/input.c
··· 68 68 static int sctp_rcv_ootb(struct sk_buff *); 69 69 static struct sctp_association *__sctp_rcv_lookup(struct net *net, 70 70 struct sk_buff *skb, 71 - const union sctp_addr *laddr, 72 71 const union sctp_addr *paddr, 72 + const union sctp_addr *laddr, 73 73 struct sctp_transport **transportp); 74 74 static struct sctp_endpoint *__sctp_rcv_lookup_endpoint(struct net *net, 75 75 const union sctp_addr *laddr);
+10 -5
net/sctp/outqueue.c
··· 63 63 static void sctp_check_transmitted(struct sctp_outq *q, 64 64 struct list_head *transmitted_queue, 65 65 struct sctp_transport *transport, 66 + union sctp_addr *saddr, 66 67 struct sctp_sackhdr *sack, 67 68 __u32 *highest_new_tsn); 68 69 ··· 1140 1139 * Process the SACK against the outqueue. Mostly, this just frees 1141 1140 * things off the transmitted queue. 1142 1141 */ 1143 - int sctp_outq_sack(struct sctp_outq *q, struct sctp_sackhdr *sack) 1142 + int sctp_outq_sack(struct sctp_outq *q, struct sctp_chunk *chunk) 1144 1143 { 1145 1144 struct sctp_association *asoc = q->asoc; 1145 + struct sctp_sackhdr *sack = chunk->subh.sack_hdr; 1146 1146 struct sctp_transport *transport; 1147 1147 struct sctp_chunk *tchunk = NULL; 1148 1148 struct list_head *lchunk, *transport_list, *temp; ··· 1212 1210 /* Run through the retransmit queue. Credit bytes received 1213 1211 * and free those chunks that we can. 1214 1212 */ 1215 - sctp_check_transmitted(q, &q->retransmit, NULL, sack, &highest_new_tsn); 1213 + sctp_check_transmitted(q, &q->retransmit, NULL, NULL, sack, &highest_new_tsn); 1216 1214 1217 1215 /* Run through the transmitted queue. 1218 1216 * Credit bytes received and free those chunks which we can. ··· 1221 1219 */ 1222 1220 list_for_each_entry(transport, transport_list, transports) { 1223 1221 sctp_check_transmitted(q, &transport->transmitted, 1224 - transport, sack, &highest_new_tsn); 1222 + transport, &chunk->source, sack, 1223 + &highest_new_tsn); 1225 1224 /* 1226 1225 * SFR-CACC algorithm: 1227 1226 * C) Let count_of_newacks be the number of ··· 1329 1326 static void sctp_check_transmitted(struct sctp_outq *q, 1330 1327 struct list_head *transmitted_queue, 1331 1328 struct sctp_transport *transport, 1329 + union sctp_addr *saddr, 1332 1330 struct sctp_sackhdr *sack, 1333 1331 __u32 *highest_new_tsn_in_sack) 1334 1332 { ··· 1637 1633 /* Mark the destination transport address as 1638 1634 * active if it is not so marked. 1639 1635 */ 1640 - if ((transport->state == SCTP_INACTIVE) || 1641 - (transport->state == SCTP_UNCONFIRMED)) { 1636 + if ((transport->state == SCTP_INACTIVE || 1637 + transport->state == SCTP_UNCONFIRMED) && 1638 + sctp_cmp_addr_exact(&transport->ipaddr, saddr)) { 1642 1639 sctp_assoc_control_transport( 1643 1640 transport->asoc, 1644 1641 transport,
+2 -2
net/sctp/sm_sideeffect.c
··· 752 752 /* Helper function to process the process SACK command. */ 753 753 static int sctp_cmd_process_sack(sctp_cmd_seq_t *cmds, 754 754 struct sctp_association *asoc, 755 - struct sctp_sackhdr *sackh) 755 + struct sctp_chunk *chunk) 756 756 { 757 757 int err = 0; 758 758 759 - if (sctp_outq_sack(&asoc->outqueue, sackh)) { 759 + if (sctp_outq_sack(&asoc->outqueue, chunk)) { 760 760 struct net *net = sock_net(asoc->base.sk); 761 761 762 762 /* There are no more TSNs awaiting SACK. */
+1 -1
net/sctp/sm_statefuns.c
··· 3179 3179 return sctp_sf_violation_ctsn(net, ep, asoc, type, arg, commands); 3180 3180 3181 3181 /* Return this SACK for further processing. */ 3182 - sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_SACK, SCTP_SACKH(sackh)); 3182 + sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_SACK, SCTP_CHUNK(chunk)); 3183 3183 3184 3184 /* Note: We do the rest of the work on the PROCESS_SACK 3185 3185 * sideeffect.
+1
net/tipc/socket.c
··· 220 220 221 221 sock_init_data(sock, sk); 222 222 sk->sk_backlog_rcv = backlog_rcv; 223 + sk->sk_rcvbuf = TIPC_FLOW_CONTROL_WIN * 2 * TIPC_MAX_USER_MSG_SIZE * 2; 223 224 tipc_sk(sk)->p = tp_ptr; 224 225 tipc_sk(sk)->conn_timeout = CONN_TIMEOUT_DEFAULT; 225 226