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 changes from David Miller:
"Most importantly this should cure the ipv4-mapped ipv6 socket TCP
crashes some people were seeing, otherwise:

1) Fix e1000e autonegotiation handling regression, from Tushar Dave.

2) Fix TX data corruption race on e1000e down, also from Tushar Dave.

3) Fix bfin_sir IRDA driver build, from Sonic Zhang.

4) AF_PACKET mmap() tests a flag in the TX ring shared between
userspace and the kernel for an internal consistency check. It
really shouldn't do this to validate the kernel's own behavior
because the user can corrupt it to be any value at all. From
Daniel Borkmann.

5) Fix TCP metrics leak on netns dismantle, from Eric Dumazet.

6) Orphan the anonymous TCP socket from the SKB in
ip_send_unicast_reply() so that the rest of the stack needn't see
it. Otherwise we get selinux problems of all sorts, from Eric
Dumazet.

This is the best way to fix this since the socket is just a place
holder for sending packets in a context where we have no real
socket at all.

7) Fix TUN detach crashes, from Stanislav Kinsbursky.

8) dev_set_alias() leaks memory on krealloc() failure, from Alexey
Khoroshilov.

9) FIB trie must use call_rcu() not call_rcu_bh(), because this code
is not universally invoked from software interrupts. From Eric
Dumazet.

10) PPTP looks up ipv4 routes with the wrong network namespace, fix
from Gao Feng."

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (33 commits)
bnx2x: Fix compiler warnings
af_packet: remove BUG statement in tpacket_destruct_skb
macvtap: rcu_dereference outside read-lock section
codel: refine one condition to avoid a nul rec_inv_sqrt
ixgbe: add missing braces
ipv4: fix ip_send_skb()
net: tcp: ipv6_mapped needs sk_rx_dst_set method
ipv4: tcp: unicast_sock should not land outside of TCP stack
bnx2x: Fix recovery flow cleanup during probe
bnx2x: fix unload previous driver flow when flr-capable
tun: don't zeroize sock->file on detach
igb: Fix register defines for all non-82575 hardware
e1000e: fix panic while dumping packets on Tx hang with IOMMU
igb: fix panic while dumping packets on Tx hang with IOMMU
tcp: must free metrics at net dismantle
net/stmmac: mark probe function as __devinit
lpc_eth: remove obsolete ifdefs
net/core: Fix potential memory leak in dev_set_alias()
cdc-phonet: Don't leak in usbpn_open
batman-adv: Fix mem leak in the batadv_tt_local_event() function
...

+233 -156
+1 -1
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
··· 1278 1278 #define BNX2X_FW_RX_ALIGN_START (1UL << BNX2X_RX_ALIGN_SHIFT) 1279 1279 1280 1280 #define BNX2X_FW_RX_ALIGN_END \ 1281 - max(1UL << BNX2X_RX_ALIGN_SHIFT, \ 1281 + max_t(u64, 1UL << BNX2X_RX_ALIGN_SHIFT, \ 1282 1282 SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) 1283 1283 1284 1284 #define BNX2X_PXP_DRAM_ALIGN (BNX2X_RX_ALIGN_SHIFT - 5)
+28 -44
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
··· 4041 4041 return val != 0; 4042 4042 } 4043 4043 4044 - /* 4045 - * Reset the load status for the current engine. 4046 - */ 4047 - static void bnx2x_clear_load_status(struct bnx2x *bp) 4048 - { 4049 - u32 val; 4050 - u32 mask = (BP_PATH(bp) ? BNX2X_PATH1_LOAD_CNT_MASK : 4051 - BNX2X_PATH0_LOAD_CNT_MASK); 4052 - bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_RECOVERY_REG); 4053 - val = REG_RD(bp, BNX2X_RECOVERY_GLOB_REG); 4054 - REG_WR(bp, BNX2X_RECOVERY_GLOB_REG, val & (~mask)); 4055 - bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_RECOVERY_REG); 4056 - } 4057 - 4058 4044 static void _print_next_block(int idx, const char *blk) 4059 4045 { 4060 4046 pr_cont("%s%s", idx ? ", " : "", blk); ··· 9370 9384 return rc; 9371 9385 } 9372 9386 9373 - static bool __devinit bnx2x_can_flr(struct bnx2x *bp) 9374 - { 9375 - int pos; 9376 - u32 cap; 9377 - struct pci_dev *dev = bp->pdev; 9378 - 9379 - pos = pci_pcie_cap(dev); 9380 - if (!pos) 9381 - return false; 9382 - 9383 - pci_read_config_dword(dev, pos + PCI_EXP_DEVCAP, &cap); 9384 - if (!(cap & PCI_EXP_DEVCAP_FLR)) 9385 - return false; 9386 - 9387 - return true; 9388 - } 9389 - 9390 9387 static int __devinit bnx2x_do_flr(struct bnx2x *bp) 9391 9388 { 9392 9389 int i, pos; 9393 9390 u16 status; 9394 9391 struct pci_dev *dev = bp->pdev; 9395 9392 9396 - /* probe the capability first */ 9397 - if (bnx2x_can_flr(bp)) 9398 - return -ENOTTY; 9393 + 9394 + if (CHIP_IS_E1x(bp)) { 9395 + BNX2X_DEV_INFO("FLR not supported in E1/E1H\n"); 9396 + return -EINVAL; 9397 + } 9398 + 9399 + /* only bootcode REQ_BC_VER_4_INITIATE_FLR and onwards support flr */ 9400 + if (bp->common.bc_ver < REQ_BC_VER_4_INITIATE_FLR) { 9401 + BNX2X_ERR("FLR not supported by BC_VER: 0x%x\n", 9402 + bp->common.bc_ver); 9403 + return -EINVAL; 9404 + } 9399 9405 9400 9406 pos = pci_pcie_cap(dev); 9401 9407 if (!pos) ··· 9407 9429 "transaction is not cleared; proceeding with reset anyway\n"); 9408 9430 9409 9431 clear: 9410 - if (bp->common.bc_ver < REQ_BC_VER_4_INITIATE_FLR) { 9411 - BNX2X_ERR("FLR not supported by BC_VER: 0x%x\n", 9412 - bp->common.bc_ver); 9413 - return -EINVAL; 9414 - } 9415 9432 9433 + BNX2X_DEV_INFO("Initiating FLR\n"); 9416 9434 bnx2x_fw_command(bp, DRV_MSG_CODE_INITIATE_FLR, 0); 9417 9435 9418 9436 return 0; ··· 9428 9454 * the one required, then FLR will be sufficient to clean any residue 9429 9455 * left by previous driver 9430 9456 */ 9431 - if (bnx2x_test_firmware_version(bp, false) && bnx2x_can_flr(bp)) 9432 - return bnx2x_do_flr(bp); 9457 + rc = bnx2x_test_firmware_version(bp, false); 9458 + 9459 + if (!rc) { 9460 + /* fw version is good */ 9461 + BNX2X_DEV_INFO("FW version matches our own. Attempting FLR\n"); 9462 + rc = bnx2x_do_flr(bp); 9463 + } 9464 + 9465 + if (!rc) { 9466 + /* FLR was performed */ 9467 + BNX2X_DEV_INFO("FLR successful\n"); 9468 + return 0; 9469 + } 9470 + 9471 + BNX2X_DEV_INFO("Could not FLR\n"); 9433 9472 9434 9473 /* Close the MCP request, return failure*/ 9435 9474 rc = bnx2x_prev_mcp_done(bp); ··· 11413 11426 */ 11414 11427 if (!chip_is_e1x) 11415 11428 REG_WR(bp, PGLUE_B_REG_INTERNAL_PFID_ENABLE_TARGET_READ, 1); 11416 - 11417 - /* Reset the load counter */ 11418 - bnx2x_clear_load_status(bp); 11419 11429 11420 11430 dev->watchdog_timeo = TX_TIMEOUT; 11421 11431
+5 -5
drivers/net/ethernet/intel/e1000e/82571.c
··· 999 999 **/ 1000 1000 static s32 e1000_reset_hw_82571(struct e1000_hw *hw) 1001 1001 { 1002 - u32 ctrl, ctrl_ext, eecd; 1002 + u32 ctrl, ctrl_ext, eecd, tctl; 1003 1003 s32 ret_val; 1004 1004 1005 1005 /* ··· 1014 1014 ew32(IMC, 0xffffffff); 1015 1015 1016 1016 ew32(RCTL, 0); 1017 - ew32(TCTL, E1000_TCTL_PSP); 1017 + tctl = er32(TCTL); 1018 + tctl &= ~E1000_TCTL_EN; 1019 + ew32(TCTL, tctl); 1018 1020 e1e_flush(); 1019 1021 1020 1022 usleep_range(10000, 20000); ··· 1603 1601 * auto-negotiation in the TXCW register and disable 1604 1602 * forced link in the Device Control register in an 1605 1603 * attempt to auto-negotiate with our link partner. 1606 - * If the partner code word is null, stop forcing 1607 - * and restart auto negotiation. 1608 1604 */ 1609 - if ((rxcw & E1000_RXCW_C) || !(rxcw & E1000_RXCW_CW)) { 1605 + if (rxcw & E1000_RXCW_C) { 1610 1606 /* Enable autoneg, and unforce link up */ 1611 1607 ew32(TXCW, mac->txcw); 1612 1608 ew32(CTRL, (ctrl & ~E1000_CTRL_SLU));
+26 -10
drivers/net/ethernet/intel/e1000e/netdev.c
··· 178 178 pr_info("%-15s %08x %08x\n", rname, regs[0], regs[1]); 179 179 } 180 180 181 + static void e1000e_dump_ps_pages(struct e1000_adapter *adapter, 182 + struct e1000_buffer *bi) 183 + { 184 + int i; 185 + struct e1000_ps_page *ps_page; 186 + 187 + for (i = 0; i < adapter->rx_ps_pages; i++) { 188 + ps_page = &bi->ps_pages[i]; 189 + 190 + if (ps_page->page) { 191 + pr_info("packet dump for ps_page %d:\n", i); 192 + print_hex_dump(KERN_INFO, "", DUMP_PREFIX_ADDRESS, 193 + 16, 1, page_address(ps_page->page), 194 + PAGE_SIZE, true); 195 + } 196 + } 197 + } 198 + 181 199 /* 182 200 * e1000e_dump - Print registers, Tx-ring and Rx-ring 183 201 */ ··· 317 299 (unsigned long long)buffer_info->time_stamp, 318 300 buffer_info->skb, next_desc); 319 301 320 - if (netif_msg_pktdata(adapter) && buffer_info->dma != 0) 302 + if (netif_msg_pktdata(adapter) && buffer_info->skb) 321 303 print_hex_dump(KERN_INFO, "", DUMP_PREFIX_ADDRESS, 322 - 16, 1, phys_to_virt(buffer_info->dma), 323 - buffer_info->length, true); 304 + 16, 1, buffer_info->skb->data, 305 + buffer_info->skb->len, true); 324 306 } 325 307 326 308 /* Print Rx Ring Summary */ ··· 399 381 buffer_info->skb, next_desc); 400 382 401 383 if (netif_msg_pktdata(adapter)) 402 - print_hex_dump(KERN_INFO, "", 403 - DUMP_PREFIX_ADDRESS, 16, 1, 404 - phys_to_virt(buffer_info->dma), 405 - adapter->rx_ps_bsize0, true); 384 + e1000e_dump_ps_pages(adapter, 385 + buffer_info); 406 386 } 407 387 } 408 388 break; ··· 460 444 (unsigned long long)buffer_info->dma, 461 445 buffer_info->skb, next_desc); 462 446 463 - if (netif_msg_pktdata(adapter)) 447 + if (netif_msg_pktdata(adapter) && 448 + buffer_info->skb) 464 449 print_hex_dump(KERN_INFO, "", 465 450 DUMP_PREFIX_ADDRESS, 16, 466 451 1, 467 - phys_to_virt 468 - (buffer_info->dma), 452 + buffer_info->skb->data, 469 453 adapter->rx_buffer_len, 470 454 true); 471 455 }
+6 -2
drivers/net/ethernet/intel/igb/e1000_regs.h
··· 156 156 : (0x0E018 + ((_n) * 0x40))) 157 157 #define E1000_TXDCTL(_n) ((_n) < 4 ? (0x03828 + ((_n) * 0x100)) \ 158 158 : (0x0E028 + ((_n) * 0x40))) 159 - #define E1000_DCA_TXCTRL(_n) (0x03814 + (_n << 8)) 160 - #define E1000_DCA_RXCTRL(_n) (0x02814 + (_n << 8)) 159 + #define E1000_RXCTL(_n) ((_n) < 4 ? (0x02814 + ((_n) * 0x100)) : \ 160 + (0x0C014 + ((_n) * 0x40))) 161 + #define E1000_DCA_RXCTRL(_n) E1000_RXCTL(_n) 162 + #define E1000_TXCTL(_n) ((_n) < 4 ? (0x03814 + ((_n) * 0x100)) : \ 163 + (0x0E014 + ((_n) * 0x40))) 164 + #define E1000_DCA_TXCTRL(_n) E1000_TXCTL(_n) 161 165 #define E1000_TDWBAL(_n) ((_n) < 4 ? (0x03838 + ((_n) * 0x100)) \ 162 166 : (0x0E038 + ((_n) * 0x40))) 163 167 #define E1000_TDWBAH(_n) ((_n) < 4 ? (0x0383C + ((_n) * 0x100)) \
+3
drivers/net/ethernet/intel/igb/igb_ethtool.c
··· 1498 1498 break; 1499 1499 } 1500 1500 1501 + /* add small delay to avoid loopback test failure */ 1502 + msleep(50); 1503 + 1501 1504 /* force 1000, set loopback */ 1502 1505 igb_write_phy_reg(hw, PHY_CONTROL, 0x4140); 1503 1506
+9 -10
drivers/net/ethernet/intel/igb/igb_main.c
··· 462 462 (u64)buffer_info->time_stamp, 463 463 buffer_info->skb, next_desc); 464 464 465 - if (netif_msg_pktdata(adapter) && buffer_info->dma != 0) 465 + if (netif_msg_pktdata(adapter) && buffer_info->skb) 466 466 print_hex_dump(KERN_INFO, "", 467 467 DUMP_PREFIX_ADDRESS, 468 - 16, 1, phys_to_virt(buffer_info->dma), 468 + 16, 1, buffer_info->skb->data, 469 469 buffer_info->length, true); 470 470 } 471 471 } ··· 547 547 (u64)buffer_info->dma, 548 548 buffer_info->skb, next_desc); 549 549 550 - if (netif_msg_pktdata(adapter)) { 550 + if (netif_msg_pktdata(adapter) && 551 + buffer_info->dma && buffer_info->skb) { 551 552 print_hex_dump(KERN_INFO, "", 552 - DUMP_PREFIX_ADDRESS, 553 - 16, 1, 554 - phys_to_virt(buffer_info->dma), 555 - IGB_RX_HDR_LEN, true); 553 + DUMP_PREFIX_ADDRESS, 554 + 16, 1, buffer_info->skb->data, 555 + IGB_RX_HDR_LEN, true); 556 556 print_hex_dump(KERN_INFO, "", 557 557 DUMP_PREFIX_ADDRESS, 558 558 16, 1, 559 - phys_to_virt( 560 - buffer_info->page_dma + 561 - buffer_info->page_offset), 559 + page_address(buffer_info->page) + 560 + buffer_info->page_offset, 562 561 PAGE_SIZE/2, true); 563 562 } 564 563 }
+2 -1
drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
··· 804 804 link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII) { 805 805 /* Set KX4/KX/KR support according to speed requested */ 806 806 autoc &= ~(IXGBE_AUTOC_KX4_KX_SUPP_MASK | IXGBE_AUTOC_KR_SUPP); 807 - if (speed & IXGBE_LINK_SPEED_10GB_FULL) 807 + if (speed & IXGBE_LINK_SPEED_10GB_FULL) { 808 808 if (orig_autoc & IXGBE_AUTOC_KX4_SUPP) 809 809 autoc |= IXGBE_AUTOC_KX4_SUPP; 810 810 if ((orig_autoc & IXGBE_AUTOC_KR_SUPP) && 811 811 (hw->phy.smart_speed_active == false)) 812 812 autoc |= IXGBE_AUTOC_KR_SUPP; 813 + } 813 814 if (speed & IXGBE_LINK_SPEED_1GB_FULL) 814 815 autoc |= IXGBE_AUTOC_KX_SUPP; 815 816 } else if ((pma_pmd_1g == IXGBE_AUTOC_1G_SFI) &&
-13
drivers/net/ethernet/nxp/lpc_eth.c
··· 346 346 "phy-mode", NULL); 347 347 if (mode && !strcmp(mode, "mii")) 348 348 return PHY_INTERFACE_MODE_MII; 349 - return PHY_INTERFACE_MODE_RMII; 350 349 } 351 - 352 - /* non-DT */ 353 - #ifdef CONFIG_ARCH_LPC32XX_MII_SUPPORT 354 - return PHY_INTERFACE_MODE_MII; 355 - #else 356 350 return PHY_INTERFACE_MODE_RMII; 357 - #endif 358 351 } 359 352 360 353 static bool use_iram_for_net(struct device *dev) 361 354 { 362 355 if (dev && dev->of_node) 363 356 return of_property_read_bool(dev->of_node, "use-iram"); 364 - 365 - /* non-DT */ 366 - #ifdef CONFIG_ARCH_LPC32XX_IRAM_FOR_NET 367 - return true; 368 - #else 369 357 return false; 370 - #endif 371 358 } 372 359 373 360 /* Receive Status information word */
+1 -1
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
··· 74 74 * the necessary resources and invokes the main to init 75 75 * the net device, register the mdio bus etc. 76 76 */ 77 - static int stmmac_pltfr_probe(struct platform_device *pdev) 77 + static int __devinit stmmac_pltfr_probe(struct platform_device *pdev) 78 78 { 79 79 int ret = 0; 80 80 struct resource *res;
+4 -4
drivers/net/irda/bfin_sir.c
··· 158 158 /* If not add the 'RPOLC', we can't catch the receive interrupt. 159 159 * It's related with the HW layout and the IR transiver. 160 160 */ 161 - val |= IREN | RPOLC; 161 + val |= UMOD_IRDA | RPOLC; 162 162 UART_PUT_GCTL(port, val); 163 163 return ret; 164 164 } ··· 432 432 bfin_sir_stop_rx(port); 433 433 434 434 val = UART_GET_GCTL(port); 435 - val &= ~(UCEN | IREN | RPOLC); 435 + val &= ~(UCEN | UMOD_MASK | RPOLC); 436 436 UART_PUT_GCTL(port, val); 437 437 438 438 #ifdef CONFIG_SIR_BFIN_DMA ··· 518 518 * reset all the UART. 519 519 */ 520 520 val = UART_GET_GCTL(port); 521 - val &= ~(IREN | RPOLC); 521 + val &= ~(UMOD_MASK | RPOLC); 522 522 UART_PUT_GCTL(port, val); 523 523 SSYNC(); 524 - val |= IREN | RPOLC; 524 + val |= UMOD_IRDA | RPOLC; 525 525 UART_PUT_GCTL(port, val); 526 526 SSYNC(); 527 527 /* bfin_sir_set_speed(port, self->speed); */
+2 -1
drivers/net/macvtap.c
··· 94 94 int i; 95 95 96 96 for (i = 0; i < MAX_MACVTAP_QUEUES; i++) { 97 - if (rcu_dereference(vlan->taps[i]) == q) 97 + if (rcu_dereference_protected(vlan->taps[i], 98 + lockdep_is_held(&macvtap_lock)) == q) 98 99 return i; 99 100 } 100 101
+2 -2
drivers/net/ppp/pptp.c
··· 189 189 if (sk_pppox(po)->sk_state & PPPOX_DEAD) 190 190 goto tx_error; 191 191 192 - rt = ip_route_output_ports(&init_net, &fl4, NULL, 192 + rt = ip_route_output_ports(sock_net(sk), &fl4, NULL, 193 193 opt->dst_addr.sin_addr.s_addr, 194 194 opt->src_addr.sin_addr.s_addr, 195 195 0, 0, IPPROTO_GRE, ··· 468 468 po->chan.private = sk; 469 469 po->chan.ops = &pptp_chan_ops; 470 470 471 - rt = ip_route_output_ports(&init_net, &fl4, sk, 471 + rt = ip_route_output_ports(sock_net(sk), &fl4, sk, 472 472 opt->dst_addr.sin_addr.s_addr, 473 473 opt->src_addr.sin_addr.s_addr, 474 474 0, 0,
-1
drivers/net/tun.c
··· 187 187 netif_tx_lock_bh(tun->dev); 188 188 netif_carrier_off(tun->dev); 189 189 tun->tfile = NULL; 190 - tun->socket.file = NULL; 191 190 netif_tx_unlock_bh(tun->dev); 192 191 193 192 /* Drop read queue */
+1
drivers/net/usb/cdc-phonet.c
··· 232 232 struct urb *req = usb_alloc_urb(0, GFP_KERNEL); 233 233 234 234 if (!req || rx_submit(pnd, req, GFP_KERNEL | __GFP_COLD)) { 235 + usb_free_urb(req); 235 236 usbpn_close(dev); 236 237 return -ENOMEM; 237 238 }
+8 -5
drivers/net/wireless/iwlwifi/dvm/rs.c
··· 707 707 */ 708 708 static bool rs_use_green(struct ieee80211_sta *sta) 709 709 { 710 - struct iwl_station_priv *sta_priv = (void *)sta->drv_priv; 711 - struct iwl_rxon_context *ctx = sta_priv->ctx; 712 - 713 - return (sta->ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD) && 714 - !(ctx->ht.non_gf_sta_present); 710 + /* 711 + * There's a bug somewhere in this code that causes the 712 + * scaling to get stuck because GF+SGI can't be combined 713 + * in SISO rates. Until we find that bug, disable GF, it 714 + * has only limited benefit and we still interoperate with 715 + * GF APs since we can always receive GF transmissions. 716 + */ 717 + return false; 715 718 } 716 719 717 720 /**
+1 -2
drivers/net/wireless/rt2x00/rt61pci.c
··· 2243 2243 2244 2244 static void rt61pci_wakeup(struct rt2x00_dev *rt2x00dev) 2245 2245 { 2246 - struct ieee80211_conf conf = { .flags = 0 }; 2247 - struct rt2x00lib_conf libconf = { .conf = &conf }; 2246 + struct rt2x00lib_conf libconf = { .conf = &rt2x00dev->hw->conf }; 2248 2247 2249 2248 rt61pci_config(rt2x00dev, &libconf, IEEE80211_CONF_CHANGE_PS); 2250 2249 }
+13 -12
include/linux/can.h
··· 74 74 /* 75 75 * defined bits for canfd_frame.flags 76 76 * 77 - * As the default for CAN FD should be to support the high data rate in the 78 - * payload section of the frame (HDR) and to support up to 64 byte in the 79 - * data section (EDL) the bits are only set in the non-default case. 80 - * Btw. as long as there's no real implementation for CAN FD network driver 81 - * these bits are only preliminary. 77 + * The use of struct canfd_frame implies the Extended Data Length (EDL) bit to 78 + * be set in the CAN frame bitstream on the wire. The EDL bit switch turns 79 + * the CAN controllers bitstream processor into the CAN FD mode which creates 80 + * two new options within the CAN FD frame specification: 82 81 * 83 - * RX: NOHDR/NOEDL - info about received CAN FD frame 84 - * ESI - bit from originating CAN controller 85 - * TX: NOHDR/NOEDL - control per-frame settings if supported by CAN controller 86 - * ESI - bit is set by local CAN controller 82 + * Bit Rate Switch - to indicate a second bitrate is/was used for the payload 83 + * Error State Indicator - represents the error state of the transmitting node 84 + * 85 + * As the CANFD_ESI bit is internally generated by the transmitting CAN 86 + * controller only the CANFD_BRS bit is relevant for real CAN controllers when 87 + * building a CAN FD frame for transmission. Setting the CANFD_ESI bit can make 88 + * sense for virtual CAN interfaces to test applications with echoed frames. 87 89 */ 88 - #define CANFD_NOHDR 0x01 /* frame without high data rate */ 89 - #define CANFD_NOEDL 0x02 /* frame without extended data length */ 90 - #define CANFD_ESI 0x04 /* error state indicator */ 90 + #define CANFD_BRS 0x01 /* bit rate switch (second bitrate for payload data) */ 91 + #define CANFD_ESI 0x02 /* error state indicator of the transmitting node */ 91 92 92 93 /** 93 94 * struct canfd_frame - CAN flexible data rate frame structure
+6 -2
include/net/codel.h
··· 305 305 } 306 306 } 307 307 } else if (drop) { 308 + u32 delta; 309 + 308 310 if (params->ecn && INET_ECN_set_ce(skb)) { 309 311 stats->ecn_mark++; 310 312 } else { ··· 322 320 * assume that the drop rate that controlled the queue on the 323 321 * last cycle is a good starting point to control it now. 324 322 */ 325 - if (codel_time_before(now - vars->drop_next, 323 + delta = vars->count - vars->lastcount; 324 + if (delta > 1 && 325 + codel_time_before(now - vars->drop_next, 326 326 16 * params->interval)) { 327 - vars->count = (vars->count - vars->lastcount) | 1; 327 + vars->count = delta; 328 328 /* we dont care if rec_inv_sqrt approximation 329 329 * is not very precise : 330 330 * Next Newton steps will correct it quadratically.
+1 -1
include/net/dst.h
··· 110 110 }; 111 111 112 112 extern u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old); 113 - extern const u32 dst_default_metrics[RTAX_MAX]; 113 + extern const u32 dst_default_metrics[]; 114 114 115 115 #define DST_METRICS_READ_ONLY 0x1UL 116 116 #define __DST_METRICS_PTR(Y) \
+1 -1
include/net/ip.h
··· 120 120 struct flowi4 *fl4, 121 121 struct sk_buff_head *queue, 122 122 struct inet_cork *cork); 123 - extern int ip_send_skb(struct sk_buff *skb); 123 + extern int ip_send_skb(struct net *net, struct sk_buff *skb); 124 124 extern int ip_push_pending_frames(struct sock *sk, struct flowi4 *fl4); 125 125 extern void ip_flush_pending_frames(struct sock *sk); 126 126 extern struct sk_buff *ip_make_skb(struct sock *sk,
+1
include/net/tcp.h
··· 464 464 void tcp_connect_init(struct sock *sk); 465 465 void tcp_finish_connect(struct sock *sk, struct sk_buff *skb); 466 466 int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size); 467 + void inet_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb); 467 468 468 469 /* From syncookies.c */ 469 470 extern __u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS];
+1
net/batman-adv/translation-table.c
··· 197 197 del: 198 198 list_del(&entry->list); 199 199 kfree(entry); 200 + kfree(tt_change_node); 200 201 event_removed = true; 201 202 goto unlock; 202 203 }
+5 -2
net/core/dev.c
··· 1055 1055 */ 1056 1056 int dev_set_alias(struct net_device *dev, const char *alias, size_t len) 1057 1057 { 1058 + char *new_ifalias; 1059 + 1058 1060 ASSERT_RTNL(); 1059 1061 1060 1062 if (len >= IFALIASZ) ··· 1070 1068 return 0; 1071 1069 } 1072 1070 1073 - dev->ifalias = krealloc(dev->ifalias, len + 1, GFP_KERNEL); 1074 - if (!dev->ifalias) 1071 + new_ifalias = krealloc(dev->ifalias, len + 1, GFP_KERNEL); 1072 + if (!new_ifalias) 1075 1073 return -ENOMEM; 1074 + dev->ifalias = new_ifalias; 1076 1075 1077 1076 strlcpy(dev->ifalias, alias, len+1); 1078 1077 return len;
+9 -1
net/core/dst.c
··· 149 149 } 150 150 EXPORT_SYMBOL(dst_discard); 151 151 152 - const u32 dst_default_metrics[RTAX_MAX]; 152 + const u32 dst_default_metrics[RTAX_MAX + 1] = { 153 + /* This initializer is needed to force linker to place this variable 154 + * into const section. Otherwise it might end into bss section. 155 + * We really want to avoid false sharing on this variable, and catch 156 + * any writes on it. 157 + */ 158 + [RTAX_MAX] = 0xdeadbeef, 159 + }; 160 + 153 161 154 162 void *dst_alloc(struct dst_ops *ops, struct net_device *dev, 155 163 int initial_ref, int initial_obsolete, unsigned short flags)
+1 -1
net/ipv4/fib_trie.c
··· 367 367 368 368 static inline void free_leaf(struct leaf *l) 369 369 { 370 - call_rcu_bh(&l->rcu, __leaf_free_rcu); 370 + call_rcu(&l->rcu, __leaf_free_rcu); 371 371 } 372 372 373 373 static inline void free_leaf_info(struct leaf_info *leaf)
+3 -3
net/ipv4/ip_output.c
··· 1366 1366 return skb; 1367 1367 } 1368 1368 1369 - int ip_send_skb(struct sk_buff *skb) 1369 + int ip_send_skb(struct net *net, struct sk_buff *skb) 1370 1370 { 1371 - struct net *net = sock_net(skb->sk); 1372 1371 int err; 1373 1372 1374 1373 err = ip_local_out(skb); ··· 1390 1391 return 0; 1391 1392 1392 1393 /* Netfilter gets whole the not fragmented skb. */ 1393 - return ip_send_skb(skb); 1394 + return ip_send_skb(sock_net(sk), skb); 1394 1395 } 1395 1396 1396 1397 /* ··· 1535 1536 arg->csumoffset) = csum_fold(csum_add(nskb->csum, 1536 1537 arg->csum)); 1537 1538 nskb->ip_summed = CHECKSUM_NONE; 1539 + skb_orphan(nskb); 1538 1540 skb_set_queue_mapping(nskb, skb_get_queue_mapping(skb)); 1539 1541 ip_push_pending_frames(sk, &fl4); 1540 1542 }
+2 -1
net/ipv4/tcp_ipv4.c
··· 1869 1869 .twsk_destructor= tcp_twsk_destructor, 1870 1870 }; 1871 1871 1872 - static void inet_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb) 1872 + void inet_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb) 1873 1873 { 1874 1874 struct dst_entry *dst = skb_dst(skb); 1875 1875 ··· 1877 1877 sk->sk_rx_dst = dst; 1878 1878 inet_sk(sk)->rx_dst_ifindex = skb->skb_iif; 1879 1879 } 1880 + EXPORT_SYMBOL(inet_sk_rx_dst_set); 1880 1881 1881 1882 const struct inet_connection_sock_af_ops ipv4_specific = { 1882 1883 .queue_xmit = ip_queue_xmit,
+12
net/ipv4/tcp_metrics.c
··· 731 731 732 732 static void __net_exit tcp_net_metrics_exit(struct net *net) 733 733 { 734 + unsigned int i; 735 + 736 + for (i = 0; i < (1U << net->ipv4.tcp_metrics_hash_log) ; i++) { 737 + struct tcp_metrics_block *tm, *next; 738 + 739 + tm = rcu_dereference_protected(net->ipv4.tcp_metrics_hash[i].chain, 1); 740 + while (tm) { 741 + next = rcu_dereference_protected(tm->tcpm_next, 1); 742 + kfree(tm); 743 + tm = next; 744 + } 745 + } 734 746 kfree(net->ipv4.tcp_metrics_hash); 735 747 } 736 748
+1 -1
net/ipv4/udp.c
··· 758 758 uh->check = CSUM_MANGLED_0; 759 759 760 760 send: 761 - err = ip_send_skb(skb); 761 + err = ip_send_skb(sock_net(sk), skb); 762 762 if (err) { 763 763 if (err == -ENOBUFS && !inet->recverr) { 764 764 UDP_INC_STATS_USER(sock_net(sk),
+1
net/ipv6/tcp_ipv6.c
··· 1777 1777 .queue_xmit = ip_queue_xmit, 1778 1778 .send_check = tcp_v4_send_check, 1779 1779 .rebuild_header = inet_sk_rebuild_header, 1780 + .sk_rx_dst_set = inet_sk_rx_dst_set, 1780 1781 .conn_request = tcp_v6_conn_request, 1781 1782 .syn_recv_sock = tcp_v6_syn_recv_sock, 1782 1783 .net_header_len = sizeof(struct iphdr),
+1 -2
net/packet/af_packet.c
··· 1079 1079 default: 1080 1080 WARN(1, "TPACKET version not supported\n"); 1081 1081 BUG(); 1082 - return 0; 1082 + return NULL; 1083 1083 } 1084 1084 } 1085 1085 ··· 1936 1936 1937 1937 if (likely(po->tx_ring.pg_vec)) { 1938 1938 ph = skb_shinfo(skb)->destructor_arg; 1939 - BUG_ON(__packet_get_status(po, ph) != TP_STATUS_SENDING); 1940 1939 BUG_ON(atomic_read(&po->tx_ring.pending) == 0); 1941 1940 atomic_dec(&po->tx_ring.pending); 1942 1941 __packet_set_status(po, ph, TP_STATUS_AVAILABLE);
+69 -26
net/sched/sch_qfq.c
··· 203 203 return index; 204 204 } 205 205 206 + /* Length of the next packet (0 if the queue is empty). */ 207 + static unsigned int qdisc_peek_len(struct Qdisc *sch) 208 + { 209 + struct sk_buff *skb; 210 + 211 + skb = sch->ops->peek(sch); 212 + return skb ? qdisc_pkt_len(skb) : 0; 213 + } 214 + 215 + static void qfq_deactivate_class(struct qfq_sched *, struct qfq_class *); 216 + static void qfq_activate_class(struct qfq_sched *q, struct qfq_class *cl, 217 + unsigned int len); 218 + 219 + static void qfq_update_class_params(struct qfq_sched *q, struct qfq_class *cl, 220 + u32 lmax, u32 inv_w, int delta_w) 221 + { 222 + int i; 223 + 224 + /* update qfq-specific data */ 225 + cl->lmax = lmax; 226 + cl->inv_w = inv_w; 227 + i = qfq_calc_index(cl->inv_w, cl->lmax); 228 + 229 + cl->grp = &q->groups[i]; 230 + 231 + q->wsum += delta_w; 232 + } 233 + 206 234 static int qfq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, 207 235 struct nlattr **tca, unsigned long *arg) 208 236 { ··· 278 250 lmax = 1UL << QFQ_MTU_SHIFT; 279 251 280 252 if (cl != NULL) { 253 + bool need_reactivation = false; 254 + 281 255 if (tca[TCA_RATE]) { 282 256 err = gen_replace_estimator(&cl->bstats, &cl->rate_est, 283 257 qdisc_root_sleeping_lock(sch), ··· 288 258 return err; 289 259 } 290 260 291 - if (inv_w != cl->inv_w) { 292 - sch_tree_lock(sch); 293 - q->wsum += delta_w; 294 - cl->inv_w = inv_w; 295 - sch_tree_unlock(sch); 261 + if (lmax == cl->lmax && inv_w == cl->inv_w) 262 + return 0; /* nothing to update */ 263 + 264 + i = qfq_calc_index(inv_w, lmax); 265 + sch_tree_lock(sch); 266 + if (&q->groups[i] != cl->grp && cl->qdisc->q.qlen > 0) { 267 + /* 268 + * shift cl->F back, to not charge the 269 + * class for the not-yet-served head 270 + * packet 271 + */ 272 + cl->F = cl->S; 273 + /* remove class from its slot in the old group */ 274 + qfq_deactivate_class(q, cl); 275 + need_reactivation = true; 296 276 } 277 + 278 + qfq_update_class_params(q, cl, lmax, inv_w, delta_w); 279 + 280 + if (need_reactivation) /* activate in new group */ 281 + qfq_activate_class(q, cl, qdisc_peek_len(cl->qdisc)); 282 + sch_tree_unlock(sch); 283 + 297 284 return 0; 298 285 } 299 286 ··· 320 273 321 274 cl->refcnt = 1; 322 275 cl->common.classid = classid; 323 - cl->lmax = lmax; 324 - cl->inv_w = inv_w; 325 - i = qfq_calc_index(cl->inv_w, cl->lmax); 326 276 327 - cl->grp = &q->groups[i]; 277 + qfq_update_class_params(q, cl, lmax, inv_w, delta_w); 328 278 329 279 cl->qdisc = qdisc_create_dflt(sch->dev_queue, 330 280 &pfifo_qdisc_ops, classid); ··· 338 294 return err; 339 295 } 340 296 } 341 - q->wsum += weight; 342 297 343 298 sch_tree_lock(sch); 344 299 qdisc_class_hash_insert(&q->clhash, &cl->common); ··· 754 711 } 755 712 } 756 713 757 - /* What is length of next packet in queue (0 if queue is empty) */ 758 - static unsigned int qdisc_peek_len(struct Qdisc *sch) 759 - { 760 - struct sk_buff *skb; 761 - 762 - skb = sch->ops->peek(sch); 763 - return skb ? qdisc_pkt_len(skb) : 0; 764 - } 765 - 766 714 /* 767 715 * Updates the class, returns true if also the group needs to be updated. 768 716 */ ··· 877 843 static int qfq_enqueue(struct sk_buff *skb, struct Qdisc *sch) 878 844 { 879 845 struct qfq_sched *q = qdisc_priv(sch); 880 - struct qfq_group *grp; 881 846 struct qfq_class *cl; 882 847 int err; 883 - u64 roundedS; 884 - int s; 885 848 886 849 cl = qfq_classify(skb, sch, &err); 887 850 if (cl == NULL) { ··· 907 876 return err; 908 877 909 878 /* If reach this point, queue q was idle */ 910 - grp = cl->grp; 879 + qfq_activate_class(q, cl, qdisc_pkt_len(skb)); 880 + 881 + return err; 882 + } 883 + 884 + /* 885 + * Handle class switch from idle to backlogged. 886 + */ 887 + static void qfq_activate_class(struct qfq_sched *q, struct qfq_class *cl, 888 + unsigned int pkt_len) 889 + { 890 + struct qfq_group *grp = cl->grp; 891 + u64 roundedS; 892 + int s; 893 + 911 894 qfq_update_start(q, cl); 912 895 913 896 /* compute new finish time and rounded start. */ 914 - cl->F = cl->S + (u64)qdisc_pkt_len(skb) * cl->inv_w; 897 + cl->F = cl->S + (u64)pkt_len * cl->inv_w; 915 898 roundedS = qfq_round_down(cl->S, grp->slot_shift); 916 899 917 900 /* ··· 962 917 963 918 skip_update: 964 919 qfq_slot_insert(grp, cl, roundedS); 965 - 966 - return err; 967 920 } 968 921 969 922
+5
net/wireless/core.c
··· 952 952 */ 953 953 synchronize_rcu(); 954 954 INIT_LIST_HEAD(&wdev->list); 955 + /* 956 + * Ensure that all events have been processed and 957 + * freed. 958 + */ 959 + cfg80211_process_wdev_events(wdev); 955 960 break; 956 961 case NETDEV_PRE_UP: 957 962 if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype)))
+1
net/wireless/core.h
··· 426 426 struct net_device *dev, enum nl80211_iftype ntype, 427 427 u32 *flags, struct vif_params *params); 428 428 void cfg80211_process_rdev_events(struct cfg80211_registered_device *rdev); 429 + void cfg80211_process_wdev_events(struct wireless_dev *wdev); 429 430 430 431 int cfg80211_can_use_iftype_chan(struct cfg80211_registered_device *rdev, 431 432 struct wireless_dev *wdev,
+1 -1
net/wireless/util.c
··· 735 735 wdev->connect_keys = NULL; 736 736 } 737 737 738 - static void cfg80211_process_wdev_events(struct wireless_dev *wdev) 738 + void cfg80211_process_wdev_events(struct wireless_dev *wdev) 739 739 { 740 740 struct cfg80211_event *ev; 741 741 unsigned long flags;