diff options
52 files changed, 483 insertions, 143 deletions
diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c index 945f532078e9..96edc1346124 100644 --- a/drivers/net/arcnet/com20020-pci.c +++ b/drivers/net/arcnet/com20020-pci.c | |||
@@ -214,8 +214,17 @@ static struct com20020_pci_card_info card_info_sohard = { | |||
214 | .flags = ARC_CAN_10MBIT, | 214 | .flags = ARC_CAN_10MBIT, |
215 | }; | 215 | }; |
216 | 216 | ||
217 | static struct com20020_pci_card_info card_info_eae = { | 217 | static struct com20020_pci_card_info card_info_eae_arc1 = { |
218 | .name = "EAE PLX-PCI", | 218 | .name = "EAE PLX-PCI ARC1", |
219 | .devcount = 1, | ||
220 | .chan_map_tbl = { | ||
221 | { 2, 0x00, 0x08 }, | ||
222 | }, | ||
223 | .flags = ARC_CAN_10MBIT, | ||
224 | }; | ||
225 | |||
226 | static struct com20020_pci_card_info card_info_eae_ma1 = { | ||
227 | .name = "EAE PLX-PCI MA1", | ||
219 | .devcount = 2, | 228 | .devcount = 2, |
220 | .chan_map_tbl = { | 229 | .chan_map_tbl = { |
221 | { 2, 0x00, 0x08 }, | 230 | { 2, 0x00, 0x08 }, |
@@ -359,9 +368,15 @@ static const struct pci_device_id com20020pci_id_table[] = { | |||
359 | }, | 368 | }, |
360 | { | 369 | { |
361 | 0x10B5, 0x9050, | 370 | 0x10B5, 0x9050, |
371 | 0x10B5, 0x3263, | ||
372 | 0, 0, | ||
373 | (kernel_ulong_t)&card_info_eae_arc1 | ||
374 | }, | ||
375 | { | ||
376 | 0x10B5, 0x9050, | ||
362 | 0x10B5, 0x3292, | 377 | 0x10B5, 0x3292, |
363 | 0, 0, | 378 | 0, 0, |
364 | (kernel_ulong_t)&card_info_eae | 379 | (kernel_ulong_t)&card_info_eae_ma1 |
365 | }, | 380 | }, |
366 | { | 381 | { |
367 | 0x14BA, 0x6000, | 382 | 0x14BA, 0x6000, |
diff --git a/drivers/net/ethernet/3com/3c589_cs.c b/drivers/net/ethernet/3com/3c589_cs.c index f18647c23559..c5a320507556 100644 --- a/drivers/net/ethernet/3com/3c589_cs.c +++ b/drivers/net/ethernet/3com/3c589_cs.c | |||
@@ -518,11 +518,8 @@ static int el3_open(struct net_device *dev) | |||
518 | netif_start_queue(dev); | 518 | netif_start_queue(dev); |
519 | 519 | ||
520 | tc589_reset(dev); | 520 | tc589_reset(dev); |
521 | init_timer(&lp->media); | 521 | setup_timer(&lp->media, media_check, (unsigned long)dev); |
522 | lp->media.function = media_check; | 522 | mod_timer(&lp->media, jiffies + HZ); |
523 | lp->media.data = (unsigned long) dev; | ||
524 | lp->media.expires = jiffies + HZ; | ||
525 | add_timer(&lp->media); | ||
526 | 523 | ||
527 | dev_dbg(&link->dev, "%s: opened, status %4.4x.\n", | 524 | dev_dbg(&link->dev, "%s: opened, status %4.4x.\n", |
528 | dev->name, inw(dev->base_addr + EL3_STATUS)); | 525 | dev->name, inw(dev->base_addr + EL3_STATUS)); |
diff --git a/drivers/net/ethernet/agere/et131x.c b/drivers/net/ethernet/agere/et131x.c index 384dc163851b..e0f3d197e7f2 100644 --- a/drivers/net/ethernet/agere/et131x.c +++ b/drivers/net/ethernet/agere/et131x.c | |||
@@ -3127,7 +3127,8 @@ static void et131x_error_timer_handler(unsigned long data) | |||
3127 | } | 3127 | } |
3128 | 3128 | ||
3129 | /* This is a periodic timer, so reschedule */ | 3129 | /* This is a periodic timer, so reschedule */ |
3130 | mod_timer(&adapter->error_timer, jiffies + TX_ERROR_PERIOD * HZ / 1000); | 3130 | mod_timer(&adapter->error_timer, jiffies + |
3131 | msecs_to_jiffies(TX_ERROR_PERIOD)); | ||
3131 | } | 3132 | } |
3132 | 3133 | ||
3133 | static void et131x_adapter_memory_free(struct et131x_adapter *adapter) | 3134 | static void et131x_adapter_memory_free(struct et131x_adapter *adapter) |
@@ -3647,7 +3648,8 @@ static int et131x_open(struct net_device *netdev) | |||
3647 | 3648 | ||
3648 | /* Start the timer to track NIC errors */ | 3649 | /* Start the timer to track NIC errors */ |
3649 | init_timer(&adapter->error_timer); | 3650 | init_timer(&adapter->error_timer); |
3650 | adapter->error_timer.expires = jiffies + TX_ERROR_PERIOD * HZ / 1000; | 3651 | adapter->error_timer.expires = jiffies + |
3652 | msecs_to_jiffies(TX_ERROR_PERIOD); | ||
3651 | adapter->error_timer.function = et131x_error_timer_handler; | 3653 | adapter->error_timer.function = et131x_error_timer_handler; |
3652 | adapter->error_timer.data = (unsigned long)adapter; | 3654 | adapter->error_timer.data = (unsigned long)adapter; |
3653 | add_timer(&adapter->error_timer); | 3655 | add_timer(&adapter->error_timer); |
diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c index 44b15373d6b3..4de62b210c85 100644 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c | |||
@@ -1030,12 +1030,14 @@ static const struct acpi_device_id xgene_enet_acpi_match[] = { | |||
1030 | MODULE_DEVICE_TABLE(acpi, xgene_enet_acpi_match); | 1030 | MODULE_DEVICE_TABLE(acpi, xgene_enet_acpi_match); |
1031 | #endif | 1031 | #endif |
1032 | 1032 | ||
1033 | #ifdef CONFIG_OF | ||
1033 | static struct of_device_id xgene_enet_of_match[] = { | 1034 | static struct of_device_id xgene_enet_of_match[] = { |
1034 | {.compatible = "apm,xgene-enet",}, | 1035 | {.compatible = "apm,xgene-enet",}, |
1035 | {}, | 1036 | {}, |
1036 | }; | 1037 | }; |
1037 | 1038 | ||
1038 | MODULE_DEVICE_TABLE(of, xgene_enet_of_match); | 1039 | MODULE_DEVICE_TABLE(of, xgene_enet_of_match); |
1040 | #endif | ||
1039 | 1041 | ||
1040 | static struct platform_driver xgene_enet_driver = { | 1042 | static struct platform_driver xgene_enet_driver = { |
1041 | .driver = { | 1043 | .driver = { |
diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c index d86d6baf9681..bd5916a60cb5 100644 --- a/drivers/net/ethernet/broadcom/b44.c +++ b/drivers/net/ethernet/broadcom/b44.c | |||
@@ -121,7 +121,7 @@ static struct pci_driver b44_pci_driver = { | |||
121 | 121 | ||
122 | static const struct ssb_device_id b44_ssb_tbl[] = { | 122 | static const struct ssb_device_id b44_ssb_tbl[] = { |
123 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_ETHERNET, SSB_ANY_REV), | 123 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_ETHERNET, SSB_ANY_REV), |
124 | SSB_DEVTABLE_END | 124 | {}, |
125 | }; | 125 | }; |
126 | MODULE_DEVICE_TABLE(ssb, b44_ssb_tbl); | 126 | MODULE_DEVICE_TABLE(ssb, b44_ssb_tbl); |
127 | 127 | ||
diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c index 3007d95fbb9f..676ffe093180 100644 --- a/drivers/net/ethernet/broadcom/bgmac.c +++ b/drivers/net/ethernet/broadcom/bgmac.c | |||
@@ -21,7 +21,7 @@ | |||
21 | static const struct bcma_device_id bgmac_bcma_tbl[] = { | 21 | static const struct bcma_device_id bgmac_bcma_tbl[] = { |
22 | BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_4706_MAC_GBIT, BCMA_ANY_REV, BCMA_ANY_CLASS), | 22 | BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_4706_MAC_GBIT, BCMA_ANY_REV, BCMA_ANY_CLASS), |
23 | BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_MAC_GBIT, BCMA_ANY_REV, BCMA_ANY_CLASS), | 23 | BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_MAC_GBIT, BCMA_ANY_REV, BCMA_ANY_CLASS), |
24 | BCMA_CORETABLE_END | 24 | {}, |
25 | }; | 25 | }; |
26 | MODULE_DEVICE_TABLE(bcma, bgmac_bcma_tbl); | 26 | MODULE_DEVICE_TABLE(bcma, bgmac_bcma_tbl); |
27 | 27 | ||
@@ -1412,6 +1412,7 @@ static void bgmac_mii_unregister(struct bgmac *bgmac) | |||
1412 | /* http://bcm-v4.sipsolutions.net/mac-gbit/gmac/chipattach */ | 1412 | /* http://bcm-v4.sipsolutions.net/mac-gbit/gmac/chipattach */ |
1413 | static int bgmac_probe(struct bcma_device *core) | 1413 | static int bgmac_probe(struct bcma_device *core) |
1414 | { | 1414 | { |
1415 | struct bcma_chipinfo *ci = &core->bus->chipinfo; | ||
1415 | struct net_device *net_dev; | 1416 | struct net_device *net_dev; |
1416 | struct bgmac *bgmac; | 1417 | struct bgmac *bgmac; |
1417 | struct ssb_sprom *sprom = &core->bus->sprom; | 1418 | struct ssb_sprom *sprom = &core->bus->sprom; |
@@ -1474,8 +1475,8 @@ static int bgmac_probe(struct bcma_device *core) | |||
1474 | bgmac_chip_reset(bgmac); | 1475 | bgmac_chip_reset(bgmac); |
1475 | 1476 | ||
1476 | /* For Northstar, we have to take all GMAC core out of reset */ | 1477 | /* For Northstar, we have to take all GMAC core out of reset */ |
1477 | if (core->id.id == BCMA_CHIP_ID_BCM4707 || | 1478 | if (ci->id == BCMA_CHIP_ID_BCM4707 || |
1478 | core->id.id == BCMA_CHIP_ID_BCM53018) { | 1479 | ci->id == BCMA_CHIP_ID_BCM53018) { |
1479 | struct bcma_device *ns_core; | 1480 | struct bcma_device *ns_core; |
1480 | int ns_gmac; | 1481 | int ns_gmac; |
1481 | 1482 | ||
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 615a6dbde047..23a019cee279 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -17855,8 +17855,10 @@ static int tg3_init_one(struct pci_dev *pdev, | |||
17855 | */ | 17855 | */ |
17856 | if ((tr32(HOSTCC_MODE) & HOSTCC_MODE_ENABLE) || | 17856 | if ((tr32(HOSTCC_MODE) & HOSTCC_MODE_ENABLE) || |
17857 | (tr32(WDMAC_MODE) & WDMAC_MODE_ENABLE)) { | 17857 | (tr32(WDMAC_MODE) & WDMAC_MODE_ENABLE)) { |
17858 | tg3_full_lock(tp, 0); | ||
17858 | tw32(MEMARB_MODE, MEMARB_MODE_ENABLE); | 17859 | tw32(MEMARB_MODE, MEMARB_MODE_ENABLE); |
17859 | tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); | 17860 | tg3_halt(tp, RESET_KIND_SHUTDOWN, 1); |
17861 | tg3_full_unlock(tp); | ||
17860 | } | 17862 | } |
17861 | 17863 | ||
17862 | err = tg3_test_dma(tp); | 17864 | err = tg3_test_dma(tp); |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index d6651937d899..5394a8486558 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c | |||
@@ -291,6 +291,7 @@ static void copy_rw_fields(void *to, struct mlx5_caps *from) | |||
291 | MLX5_SET(cmd_hca_cap, to, log_max_ra_req_dc, from->gen.log_max_ra_req_dc); | 291 | MLX5_SET(cmd_hca_cap, to, log_max_ra_req_dc, from->gen.log_max_ra_req_dc); |
292 | MLX5_SET(cmd_hca_cap, to, log_max_ra_res_dc, from->gen.log_max_ra_res_dc); | 292 | MLX5_SET(cmd_hca_cap, to, log_max_ra_res_dc, from->gen.log_max_ra_res_dc); |
293 | MLX5_SET(cmd_hca_cap, to, pkey_table_size, to_fw_pkey_sz(from->gen.pkey_table_size)); | 293 | MLX5_SET(cmd_hca_cap, to, pkey_table_size, to_fw_pkey_sz(from->gen.pkey_table_size)); |
294 | MLX5_SET(cmd_hca_cap, to, log_uar_page_sz, PAGE_SHIFT - 12); | ||
294 | v64 = from->gen.flags & MLX5_CAP_BITS_RW_MASK; | 295 | v64 = from->gen.flags & MLX5_CAP_BITS_RW_MASK; |
295 | *flags_off = cpu_to_be64(v64); | 296 | *flags_off = cpu_to_be64(v64); |
296 | } | 297 | } |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h index e56c1bb36141..fa4317611fd6 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | |||
@@ -848,10 +848,17 @@ struct qlcnic_cardrsp_tx_ctx { | |||
848 | #define QLCNIC_MAC_VLAN_ADD 3 | 848 | #define QLCNIC_MAC_VLAN_ADD 3 |
849 | #define QLCNIC_MAC_VLAN_DEL 4 | 849 | #define QLCNIC_MAC_VLAN_DEL 4 |
850 | 850 | ||
851 | enum qlcnic_mac_type { | ||
852 | QLCNIC_UNICAST_MAC, | ||
853 | QLCNIC_MULTICAST_MAC, | ||
854 | QLCNIC_BROADCAST_MAC, | ||
855 | }; | ||
856 | |||
851 | struct qlcnic_mac_vlan_list { | 857 | struct qlcnic_mac_vlan_list { |
852 | struct list_head list; | 858 | struct list_head list; |
853 | uint8_t mac_addr[ETH_ALEN+2]; | 859 | uint8_t mac_addr[ETH_ALEN+2]; |
854 | u16 vlan_id; | 860 | u16 vlan_id; |
861 | enum qlcnic_mac_type mac_type; | ||
855 | }; | 862 | }; |
856 | 863 | ||
857 | /* MAC Learn */ | 864 | /* MAC Learn */ |
@@ -1615,7 +1622,9 @@ void qlcnic_watchdog_task(struct work_struct *work); | |||
1615 | void qlcnic_post_rx_buffers(struct qlcnic_adapter *adapter, | 1622 | void qlcnic_post_rx_buffers(struct qlcnic_adapter *adapter, |
1616 | struct qlcnic_host_rds_ring *rds_ring, u8 ring_id); | 1623 | struct qlcnic_host_rds_ring *rds_ring, u8 ring_id); |
1617 | void qlcnic_set_multi(struct net_device *netdev); | 1624 | void qlcnic_set_multi(struct net_device *netdev); |
1618 | int qlcnic_nic_add_mac(struct qlcnic_adapter *, const u8 *, u16); | 1625 | void qlcnic_flush_mcast_mac(struct qlcnic_adapter *); |
1626 | int qlcnic_nic_add_mac(struct qlcnic_adapter *, const u8 *, u16, | ||
1627 | enum qlcnic_mac_type); | ||
1619 | int qlcnic_nic_del_mac(struct qlcnic_adapter *, const u8 *); | 1628 | int qlcnic_nic_del_mac(struct qlcnic_adapter *, const u8 *); |
1620 | void qlcnic_82xx_free_mac_list(struct qlcnic_adapter *adapter); | 1629 | void qlcnic_82xx_free_mac_list(struct qlcnic_adapter *adapter); |
1621 | int qlcnic_82xx_read_phys_port_id(struct qlcnic_adapter *); | 1630 | int qlcnic_82xx_read_phys_port_id(struct qlcnic_adapter *); |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c index 69b46c051cc0..3e0f705a4311 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | |||
@@ -487,7 +487,8 @@ int qlcnic_nic_del_mac(struct qlcnic_adapter *adapter, const u8 *addr) | |||
487 | return err; | 487 | return err; |
488 | } | 488 | } |
489 | 489 | ||
490 | int qlcnic_nic_add_mac(struct qlcnic_adapter *adapter, const u8 *addr, u16 vlan) | 490 | int qlcnic_nic_add_mac(struct qlcnic_adapter *adapter, const u8 *addr, u16 vlan, |
491 | enum qlcnic_mac_type mac_type) | ||
491 | { | 492 | { |
492 | struct qlcnic_mac_vlan_list *cur; | 493 | struct qlcnic_mac_vlan_list *cur; |
493 | struct list_head *head; | 494 | struct list_head *head; |
@@ -513,10 +514,29 @@ int qlcnic_nic_add_mac(struct qlcnic_adapter *adapter, const u8 *addr, u16 vlan) | |||
513 | } | 514 | } |
514 | 515 | ||
515 | cur->vlan_id = vlan; | 516 | cur->vlan_id = vlan; |
517 | cur->mac_type = mac_type; | ||
518 | |||
516 | list_add_tail(&cur->list, &adapter->mac_list); | 519 | list_add_tail(&cur->list, &adapter->mac_list); |
517 | return 0; | 520 | return 0; |
518 | } | 521 | } |
519 | 522 | ||
523 | void qlcnic_flush_mcast_mac(struct qlcnic_adapter *adapter) | ||
524 | { | ||
525 | struct qlcnic_mac_vlan_list *cur; | ||
526 | struct list_head *head, *tmp; | ||
527 | |||
528 | list_for_each_safe(head, tmp, &adapter->mac_list) { | ||
529 | cur = list_entry(head, struct qlcnic_mac_vlan_list, list); | ||
530 | if (cur->mac_type != QLCNIC_MULTICAST_MAC) | ||
531 | continue; | ||
532 | |||
533 | qlcnic_sre_macaddr_change(adapter, cur->mac_addr, | ||
534 | cur->vlan_id, QLCNIC_MAC_DEL); | ||
535 | list_del(&cur->list); | ||
536 | kfree(cur); | ||
537 | } | ||
538 | } | ||
539 | |||
520 | static void __qlcnic_set_multi(struct net_device *netdev, u16 vlan) | 540 | static void __qlcnic_set_multi(struct net_device *netdev, u16 vlan) |
521 | { | 541 | { |
522 | struct qlcnic_adapter *adapter = netdev_priv(netdev); | 542 | struct qlcnic_adapter *adapter = netdev_priv(netdev); |
@@ -530,8 +550,9 @@ static void __qlcnic_set_multi(struct net_device *netdev, u16 vlan) | |||
530 | if (!test_bit(__QLCNIC_FW_ATTACHED, &adapter->state)) | 550 | if (!test_bit(__QLCNIC_FW_ATTACHED, &adapter->state)) |
531 | return; | 551 | return; |
532 | 552 | ||
533 | qlcnic_nic_add_mac(adapter, adapter->mac_addr, vlan); | 553 | qlcnic_nic_add_mac(adapter, adapter->mac_addr, vlan, |
534 | qlcnic_nic_add_mac(adapter, bcast_addr, vlan); | 554 | QLCNIC_UNICAST_MAC); |
555 | qlcnic_nic_add_mac(adapter, bcast_addr, vlan, QLCNIC_BROADCAST_MAC); | ||
535 | 556 | ||
536 | if (netdev->flags & IFF_PROMISC) { | 557 | if (netdev->flags & IFF_PROMISC) { |
537 | if (!(adapter->flags & QLCNIC_PROMISC_DISABLED)) | 558 | if (!(adapter->flags & QLCNIC_PROMISC_DISABLED)) |
@@ -540,8 +561,10 @@ static void __qlcnic_set_multi(struct net_device *netdev, u16 vlan) | |||
540 | (netdev_mc_count(netdev) > ahw->max_mc_count)) { | 561 | (netdev_mc_count(netdev) > ahw->max_mc_count)) { |
541 | mode = VPORT_MISS_MODE_ACCEPT_MULTI; | 562 | mode = VPORT_MISS_MODE_ACCEPT_MULTI; |
542 | } else if (!netdev_mc_empty(netdev)) { | 563 | } else if (!netdev_mc_empty(netdev)) { |
564 | qlcnic_flush_mcast_mac(adapter); | ||
543 | netdev_for_each_mc_addr(ha, netdev) | 565 | netdev_for_each_mc_addr(ha, netdev) |
544 | qlcnic_nic_add_mac(adapter, ha->addr, vlan); | 566 | qlcnic_nic_add_mac(adapter, ha->addr, vlan, |
567 | QLCNIC_MULTICAST_MAC); | ||
545 | } | 568 | } |
546 | 569 | ||
547 | /* configure unicast MAC address, if there is not sufficient space | 570 | /* configure unicast MAC address, if there is not sufficient space |
@@ -551,7 +574,8 @@ static void __qlcnic_set_multi(struct net_device *netdev, u16 vlan) | |||
551 | mode = VPORT_MISS_MODE_ACCEPT_ALL; | 574 | mode = VPORT_MISS_MODE_ACCEPT_ALL; |
552 | } else if (!netdev_uc_empty(netdev)) { | 575 | } else if (!netdev_uc_empty(netdev)) { |
553 | netdev_for_each_uc_addr(ha, netdev) | 576 | netdev_for_each_uc_addr(ha, netdev) |
554 | qlcnic_nic_add_mac(adapter, ha->addr, vlan); | 577 | qlcnic_nic_add_mac(adapter, ha->addr, vlan, |
578 | QLCNIC_UNICAST_MAC); | ||
555 | } | 579 | } |
556 | 580 | ||
557 | if (mode == VPORT_MISS_MODE_ACCEPT_ALL && | 581 | if (mode == VPORT_MISS_MODE_ACCEPT_ALL && |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c index 1659c804f1d5..e6312465fe45 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c | |||
@@ -1489,7 +1489,8 @@ out: | |||
1489 | return ret; | 1489 | return ret; |
1490 | } | 1490 | } |
1491 | 1491 | ||
1492 | static void qlcnic_vf_add_mc_list(struct net_device *netdev, const u8 *mac) | 1492 | static void qlcnic_vf_add_mc_list(struct net_device *netdev, const u8 *mac, |
1493 | enum qlcnic_mac_type mac_type) | ||
1493 | { | 1494 | { |
1494 | struct qlcnic_adapter *adapter = netdev_priv(netdev); | 1495 | struct qlcnic_adapter *adapter = netdev_priv(netdev); |
1495 | struct qlcnic_sriov *sriov = adapter->ahw->sriov; | 1496 | struct qlcnic_sriov *sriov = adapter->ahw->sriov; |
@@ -1500,17 +1501,18 @@ static void qlcnic_vf_add_mc_list(struct net_device *netdev, const u8 *mac) | |||
1500 | vf = &adapter->ahw->sriov->vf_info[0]; | 1501 | vf = &adapter->ahw->sriov->vf_info[0]; |
1501 | 1502 | ||
1502 | if (!qlcnic_sriov_check_any_vlan(vf)) { | 1503 | if (!qlcnic_sriov_check_any_vlan(vf)) { |
1503 | qlcnic_nic_add_mac(adapter, mac, 0); | 1504 | qlcnic_nic_add_mac(adapter, mac, 0, mac_type); |
1504 | } else { | 1505 | } else { |
1505 | spin_lock(&vf->vlan_list_lock); | 1506 | spin_lock(&vf->vlan_list_lock); |
1506 | for (i = 0; i < sriov->num_allowed_vlans; i++) { | 1507 | for (i = 0; i < sriov->num_allowed_vlans; i++) { |
1507 | vlan_id = vf->sriov_vlans[i]; | 1508 | vlan_id = vf->sriov_vlans[i]; |
1508 | if (vlan_id) | 1509 | if (vlan_id) |
1509 | qlcnic_nic_add_mac(adapter, mac, vlan_id); | 1510 | qlcnic_nic_add_mac(adapter, mac, vlan_id, |
1511 | mac_type); | ||
1510 | } | 1512 | } |
1511 | spin_unlock(&vf->vlan_list_lock); | 1513 | spin_unlock(&vf->vlan_list_lock); |
1512 | if (qlcnic_84xx_check(adapter)) | 1514 | if (qlcnic_84xx_check(adapter)) |
1513 | qlcnic_nic_add_mac(adapter, mac, 0); | 1515 | qlcnic_nic_add_mac(adapter, mac, 0, mac_type); |
1514 | } | 1516 | } |
1515 | } | 1517 | } |
1516 | 1518 | ||
@@ -1549,10 +1551,12 @@ void qlcnic_sriov_vf_set_multi(struct net_device *netdev) | |||
1549 | (netdev_mc_count(netdev) > ahw->max_mc_count)) { | 1551 | (netdev_mc_count(netdev) > ahw->max_mc_count)) { |
1550 | mode = VPORT_MISS_MODE_ACCEPT_MULTI; | 1552 | mode = VPORT_MISS_MODE_ACCEPT_MULTI; |
1551 | } else { | 1553 | } else { |
1552 | qlcnic_vf_add_mc_list(netdev, bcast_addr); | 1554 | qlcnic_vf_add_mc_list(netdev, bcast_addr, QLCNIC_BROADCAST_MAC); |
1553 | if (!netdev_mc_empty(netdev)) { | 1555 | if (!netdev_mc_empty(netdev)) { |
1556 | qlcnic_flush_mcast_mac(adapter); | ||
1554 | netdev_for_each_mc_addr(ha, netdev) | 1557 | netdev_for_each_mc_addr(ha, netdev) |
1555 | qlcnic_vf_add_mc_list(netdev, ha->addr); | 1558 | qlcnic_vf_add_mc_list(netdev, ha->addr, |
1559 | QLCNIC_MULTICAST_MAC); | ||
1556 | } | 1560 | } |
1557 | } | 1561 | } |
1558 | 1562 | ||
@@ -1563,7 +1567,8 @@ void qlcnic_sriov_vf_set_multi(struct net_device *netdev) | |||
1563 | mode = VPORT_MISS_MODE_ACCEPT_ALL; | 1567 | mode = VPORT_MISS_MODE_ACCEPT_ALL; |
1564 | } else if (!netdev_uc_empty(netdev)) { | 1568 | } else if (!netdev_uc_empty(netdev)) { |
1565 | netdev_for_each_uc_addr(ha, netdev) | 1569 | netdev_for_each_uc_addr(ha, netdev) |
1566 | qlcnic_vf_add_mc_list(netdev, ha->addr); | 1570 | qlcnic_vf_add_mc_list(netdev, ha->addr, |
1571 | QLCNIC_UNICAST_MAC); | ||
1567 | } | 1572 | } |
1568 | 1573 | ||
1569 | if (adapter->pdev->is_virtfn) { | 1574 | if (adapter->pdev->is_virtfn) { |
diff --git a/drivers/net/ethernet/sun/sunvnet.c b/drivers/net/ethernet/sun/sunvnet.c index 2b10b85d8a08..22e0cad1b4b5 100644 --- a/drivers/net/ethernet/sun/sunvnet.c +++ b/drivers/net/ethernet/sun/sunvnet.c | |||
@@ -1192,23 +1192,16 @@ static int vnet_handle_offloads(struct vnet_port *port, struct sk_buff *skb) | |||
1192 | skb_pull(skb, maclen); | 1192 | skb_pull(skb, maclen); |
1193 | 1193 | ||
1194 | if (port->tso && gso_size < datalen) { | 1194 | if (port->tso && gso_size < datalen) { |
1195 | if (skb_unclone(skb, GFP_ATOMIC)) | ||
1196 | goto out_dropped; | ||
1197 | |||
1195 | /* segment to TSO size */ | 1198 | /* segment to TSO size */ |
1196 | skb_shinfo(skb)->gso_size = datalen; | 1199 | skb_shinfo(skb)->gso_size = datalen; |
1197 | skb_shinfo(skb)->gso_segs = gso_segs; | 1200 | skb_shinfo(skb)->gso_segs = gso_segs; |
1198 | |||
1199 | segs = skb_gso_segment(skb, dev->features & ~NETIF_F_TSO); | ||
1200 | |||
1201 | /* restore gso_size & gso_segs */ | ||
1202 | skb_shinfo(skb)->gso_size = gso_size; | ||
1203 | skb_shinfo(skb)->gso_segs = DIV_ROUND_UP(skb->len - hlen, | ||
1204 | gso_size); | ||
1205 | } else | ||
1206 | segs = skb_gso_segment(skb, dev->features & ~NETIF_F_TSO); | ||
1207 | if (IS_ERR(segs)) { | ||
1208 | dev->stats.tx_dropped++; | ||
1209 | dev_kfree_skb_any(skb); | ||
1210 | return NETDEV_TX_OK; | ||
1211 | } | 1201 | } |
1202 | segs = skb_gso_segment(skb, dev->features & ~NETIF_F_TSO); | ||
1203 | if (IS_ERR(segs)) | ||
1204 | goto out_dropped; | ||
1212 | 1205 | ||
1213 | skb_push(skb, maclen); | 1206 | skb_push(skb, maclen); |
1214 | skb_reset_mac_header(skb); | 1207 | skb_reset_mac_header(skb); |
@@ -1246,6 +1239,10 @@ static int vnet_handle_offloads(struct vnet_port *port, struct sk_buff *skb) | |||
1246 | if (!(status & NETDEV_TX_MASK)) | 1239 | if (!(status & NETDEV_TX_MASK)) |
1247 | dev_kfree_skb_any(skb); | 1240 | dev_kfree_skb_any(skb); |
1248 | return status; | 1241 | return status; |
1242 | out_dropped: | ||
1243 | dev->stats.tx_dropped++; | ||
1244 | dev_kfree_skb_any(skb); | ||
1245 | return NETDEV_TX_OK; | ||
1249 | } | 1246 | } |
1250 | 1247 | ||
1251 | static int vnet_start_xmit(struct sk_buff *skb, struct net_device *dev) | 1248 | static int vnet_start_xmit(struct sk_buff *skb, struct net_device *dev) |
diff --git a/drivers/net/ipvlan/ipvlan.h b/drivers/net/ipvlan/ipvlan.h index 2729f64b3e7e..924ea98bd531 100644 --- a/drivers/net/ipvlan/ipvlan.h +++ b/drivers/net/ipvlan/ipvlan.h | |||
@@ -67,7 +67,7 @@ struct ipvl_dev { | |||
67 | struct list_head addrs; | 67 | struct list_head addrs; |
68 | int ipv4cnt; | 68 | int ipv4cnt; |
69 | int ipv6cnt; | 69 | int ipv6cnt; |
70 | struct ipvl_pcpu_stats *pcpu_stats; | 70 | struct ipvl_pcpu_stats __percpu *pcpu_stats; |
71 | DECLARE_BITMAP(mac_filters, IPVLAN_MAC_FILTER_SIZE); | 71 | DECLARE_BITMAP(mac_filters, IPVLAN_MAC_FILTER_SIZE); |
72 | netdev_features_t sfeatures; | 72 | netdev_features_t sfeatures; |
73 | u32 msg_enable; | 73 | u32 msg_enable; |
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 3ad8ca76196d..1190fd8f0088 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c | |||
@@ -32,6 +32,7 @@ | |||
32 | /* Operation Mode Strap Override */ | 32 | /* Operation Mode Strap Override */ |
33 | #define MII_KSZPHY_OMSO 0x16 | 33 | #define MII_KSZPHY_OMSO 0x16 |
34 | #define KSZPHY_OMSO_B_CAST_OFF BIT(9) | 34 | #define KSZPHY_OMSO_B_CAST_OFF BIT(9) |
35 | #define KSZPHY_OMSO_NAND_TREE_ON BIT(5) | ||
35 | #define KSZPHY_OMSO_RMII_OVERRIDE BIT(1) | 36 | #define KSZPHY_OMSO_RMII_OVERRIDE BIT(1) |
36 | #define KSZPHY_OMSO_MII_OVERRIDE BIT(0) | 37 | #define KSZPHY_OMSO_MII_OVERRIDE BIT(0) |
37 | 38 | ||
@@ -76,6 +77,7 @@ struct kszphy_type { | |||
76 | u32 led_mode_reg; | 77 | u32 led_mode_reg; |
77 | u16 interrupt_level_mask; | 78 | u16 interrupt_level_mask; |
78 | bool has_broadcast_disable; | 79 | bool has_broadcast_disable; |
80 | bool has_nand_tree_disable; | ||
79 | bool has_rmii_ref_clk_sel; | 81 | bool has_rmii_ref_clk_sel; |
80 | }; | 82 | }; |
81 | 83 | ||
@@ -89,6 +91,7 @@ struct kszphy_priv { | |||
89 | static const struct kszphy_type ksz8021_type = { | 91 | static const struct kszphy_type ksz8021_type = { |
90 | .led_mode_reg = MII_KSZPHY_CTRL_2, | 92 | .led_mode_reg = MII_KSZPHY_CTRL_2, |
91 | .has_broadcast_disable = true, | 93 | .has_broadcast_disable = true, |
94 | .has_nand_tree_disable = true, | ||
92 | .has_rmii_ref_clk_sel = true, | 95 | .has_rmii_ref_clk_sel = true, |
93 | }; | 96 | }; |
94 | 97 | ||
@@ -98,11 +101,13 @@ static const struct kszphy_type ksz8041_type = { | |||
98 | 101 | ||
99 | static const struct kszphy_type ksz8051_type = { | 102 | static const struct kszphy_type ksz8051_type = { |
100 | .led_mode_reg = MII_KSZPHY_CTRL_2, | 103 | .led_mode_reg = MII_KSZPHY_CTRL_2, |
104 | .has_nand_tree_disable = true, | ||
101 | }; | 105 | }; |
102 | 106 | ||
103 | static const struct kszphy_type ksz8081_type = { | 107 | static const struct kszphy_type ksz8081_type = { |
104 | .led_mode_reg = MII_KSZPHY_CTRL_2, | 108 | .led_mode_reg = MII_KSZPHY_CTRL_2, |
105 | .has_broadcast_disable = true, | 109 | .has_broadcast_disable = true, |
110 | .has_nand_tree_disable = true, | ||
106 | .has_rmii_ref_clk_sel = true, | 111 | .has_rmii_ref_clk_sel = true, |
107 | }; | 112 | }; |
108 | 113 | ||
@@ -231,6 +236,26 @@ out: | |||
231 | return ret; | 236 | return ret; |
232 | } | 237 | } |
233 | 238 | ||
239 | static int kszphy_nand_tree_disable(struct phy_device *phydev) | ||
240 | { | ||
241 | int ret; | ||
242 | |||
243 | ret = phy_read(phydev, MII_KSZPHY_OMSO); | ||
244 | if (ret < 0) | ||
245 | goto out; | ||
246 | |||
247 | if (!(ret & KSZPHY_OMSO_NAND_TREE_ON)) | ||
248 | return 0; | ||
249 | |||
250 | ret = phy_write(phydev, MII_KSZPHY_OMSO, | ||
251 | ret & ~KSZPHY_OMSO_NAND_TREE_ON); | ||
252 | out: | ||
253 | if (ret) | ||
254 | dev_err(&phydev->dev, "failed to disable NAND tree mode\n"); | ||
255 | |||
256 | return ret; | ||
257 | } | ||
258 | |||
234 | static int kszphy_config_init(struct phy_device *phydev) | 259 | static int kszphy_config_init(struct phy_device *phydev) |
235 | { | 260 | { |
236 | struct kszphy_priv *priv = phydev->priv; | 261 | struct kszphy_priv *priv = phydev->priv; |
@@ -245,6 +270,9 @@ static int kszphy_config_init(struct phy_device *phydev) | |||
245 | if (type->has_broadcast_disable) | 270 | if (type->has_broadcast_disable) |
246 | kszphy_broadcast_disable(phydev); | 271 | kszphy_broadcast_disable(phydev); |
247 | 272 | ||
273 | if (type->has_nand_tree_disable) | ||
274 | kszphy_nand_tree_disable(phydev); | ||
275 | |||
248 | if (priv->rmii_ref_clk_sel) { | 276 | if (priv->rmii_ref_clk_sel) { |
249 | ret = kszphy_rmii_clk_sel(phydev, priv->rmii_ref_clk_sel_val); | 277 | ret = kszphy_rmii_clk_sel(phydev, priv->rmii_ref_clk_sel_val); |
250 | if (ret) { | 278 | if (ret) { |
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 6b8efcabb816..9cdfb3fe9c15 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
@@ -914,7 +914,7 @@ static void packetizeRx(struct hso_net *odev, unsigned char *ip_pkt, | |||
914 | /* We got no receive buffer. */ | 914 | /* We got no receive buffer. */ |
915 | D1("could not allocate memory"); | 915 | D1("could not allocate memory"); |
916 | odev->rx_parse_state = WAIT_SYNC; | 916 | odev->rx_parse_state = WAIT_SYNC; |
917 | return; | 917 | continue; |
918 | } | 918 | } |
919 | 919 | ||
920 | /* Copy what we got so far. make room for iphdr | 920 | /* Copy what we got so far. make room for iphdr |
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 5980ac6c48dd..438fc6bcaef1 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #define PLA_RXFIFO_CTRL0 0xc0a0 | 40 | #define PLA_RXFIFO_CTRL0 0xc0a0 |
41 | #define PLA_RXFIFO_CTRL1 0xc0a4 | 41 | #define PLA_RXFIFO_CTRL1 0xc0a4 |
42 | #define PLA_RXFIFO_CTRL2 0xc0a8 | 42 | #define PLA_RXFIFO_CTRL2 0xc0a8 |
43 | #define PLA_DMY_REG0 0xc0b0 | ||
43 | #define PLA_FMC 0xc0b4 | 44 | #define PLA_FMC 0xc0b4 |
44 | #define PLA_CFG_WOL 0xc0b6 | 45 | #define PLA_CFG_WOL 0xc0b6 |
45 | #define PLA_TEREDO_CFG 0xc0bc | 46 | #define PLA_TEREDO_CFG 0xc0bc |
@@ -90,8 +91,14 @@ | |||
90 | #define PLA_BP_7 0xfc36 | 91 | #define PLA_BP_7 0xfc36 |
91 | #define PLA_BP_EN 0xfc38 | 92 | #define PLA_BP_EN 0xfc38 |
92 | 93 | ||
94 | #define USB_USB2PHY 0xb41e | ||
95 | #define USB_SSPHYLINK2 0xb428 | ||
93 | #define USB_U2P3_CTRL 0xb460 | 96 | #define USB_U2P3_CTRL 0xb460 |
97 | #define USB_CSR_DUMMY1 0xb464 | ||
98 | #define USB_CSR_DUMMY2 0xb466 | ||
94 | #define USB_DEV_STAT 0xb808 | 99 | #define USB_DEV_STAT 0xb808 |
100 | #define USB_CONNECT_TIMER 0xcbf8 | ||
101 | #define USB_BURST_SIZE 0xcfc0 | ||
95 | #define USB_USB_CTRL 0xd406 | 102 | #define USB_USB_CTRL 0xd406 |
96 | #define USB_PHY_CTRL 0xd408 | 103 | #define USB_PHY_CTRL 0xd408 |
97 | #define USB_TX_AGG 0xd40a | 104 | #define USB_TX_AGG 0xd40a |
@@ -170,6 +177,9 @@ | |||
170 | #define TXFIFO_THR_NORMAL 0x00400008 | 177 | #define TXFIFO_THR_NORMAL 0x00400008 |
171 | #define TXFIFO_THR_NORMAL2 0x01000008 | 178 | #define TXFIFO_THR_NORMAL2 0x01000008 |
172 | 179 | ||
180 | /* PLA_DMY_REG0 */ | ||
181 | #define ECM_ALDPS 0x0002 | ||
182 | |||
173 | /* PLA_FMC */ | 183 | /* PLA_FMC */ |
174 | #define FMC_FCR_MCU_EN 0x0001 | 184 | #define FMC_FCR_MCU_EN 0x0001 |
175 | 185 | ||
@@ -289,6 +299,20 @@ | |||
289 | /* PLA_BOOT_CTRL */ | 299 | /* PLA_BOOT_CTRL */ |
290 | #define AUTOLOAD_DONE 0x0002 | 300 | #define AUTOLOAD_DONE 0x0002 |
291 | 301 | ||
302 | /* USB_USB2PHY */ | ||
303 | #define USB2PHY_SUSPEND 0x0001 | ||
304 | #define USB2PHY_L1 0x0002 | ||
305 | |||
306 | /* USB_SSPHYLINK2 */ | ||
307 | #define pwd_dn_scale_mask 0x3ffe | ||
308 | #define pwd_dn_scale(x) ((x) << 1) | ||
309 | |||
310 | /* USB_CSR_DUMMY1 */ | ||
311 | #define DYNAMIC_BURST 0x0001 | ||
312 | |||
313 | /* USB_CSR_DUMMY2 */ | ||
314 | #define EP4_FULL_FC 0x0001 | ||
315 | |||
292 | /* USB_DEV_STAT */ | 316 | /* USB_DEV_STAT */ |
293 | #define STAT_SPEED_MASK 0x0006 | 317 | #define STAT_SPEED_MASK 0x0006 |
294 | #define STAT_SPEED_HIGH 0x0000 | 318 | #define STAT_SPEED_HIGH 0x0000 |
@@ -334,9 +358,13 @@ | |||
334 | #define TIMER11_EN 0x0001 | 358 | #define TIMER11_EN 0x0001 |
335 | 359 | ||
336 | /* USB_LPM_CTRL */ | 360 | /* USB_LPM_CTRL */ |
361 | /* bit 4 ~ 5: fifo empty boundary */ | ||
362 | #define FIFO_EMPTY_1FB 0x30 /* 0x1fb * 64 = 32448 bytes */ | ||
363 | /* bit 2 ~ 3: LMP timer */ | ||
337 | #define LPM_TIMER_MASK 0x0c | 364 | #define LPM_TIMER_MASK 0x0c |
338 | #define LPM_TIMER_500MS 0x04 /* 500 ms */ | 365 | #define LPM_TIMER_500MS 0x04 /* 500 ms */ |
339 | #define LPM_TIMER_500US 0x0c /* 500 us */ | 366 | #define LPM_TIMER_500US 0x0c /* 500 us */ |
367 | #define ROK_EXIT_LPM 0x02 | ||
340 | 368 | ||
341 | /* USB_AFE_CTRL2 */ | 369 | /* USB_AFE_CTRL2 */ |
342 | #define SEN_VAL_MASK 0xf800 | 370 | #define SEN_VAL_MASK 0xf800 |
@@ -3230,6 +3258,32 @@ static void r8153_init(struct r8152 *tp) | |||
3230 | 3258 | ||
3231 | r8153_u2p3en(tp, false); | 3259 | r8153_u2p3en(tp, false); |
3232 | 3260 | ||
3261 | if (tp->version == RTL_VER_04) { | ||
3262 | ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_SSPHYLINK2); | ||
3263 | ocp_data &= ~pwd_dn_scale_mask; | ||
3264 | ocp_data |= pwd_dn_scale(96); | ||
3265 | ocp_write_word(tp, MCU_TYPE_USB, USB_SSPHYLINK2, ocp_data); | ||
3266 | |||
3267 | ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_USB2PHY); | ||
3268 | ocp_data |= USB2PHY_L1 | USB2PHY_SUSPEND; | ||
3269 | ocp_write_byte(tp, MCU_TYPE_USB, USB_USB2PHY, ocp_data); | ||
3270 | } else if (tp->version == RTL_VER_05) { | ||
3271 | ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_DMY_REG0); | ||
3272 | ocp_data &= ~ECM_ALDPS; | ||
3273 | ocp_write_byte(tp, MCU_TYPE_PLA, PLA_DMY_REG0, ocp_data); | ||
3274 | |||
3275 | ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_CSR_DUMMY1); | ||
3276 | if (ocp_read_word(tp, MCU_TYPE_USB, USB_BURST_SIZE) == 0) | ||
3277 | ocp_data &= ~DYNAMIC_BURST; | ||
3278 | else | ||
3279 | ocp_data |= DYNAMIC_BURST; | ||
3280 | ocp_write_byte(tp, MCU_TYPE_USB, USB_CSR_DUMMY1, ocp_data); | ||
3281 | } | ||
3282 | |||
3283 | ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_CSR_DUMMY2); | ||
3284 | ocp_data |= EP4_FULL_FC; | ||
3285 | ocp_write_byte(tp, MCU_TYPE_USB, USB_CSR_DUMMY2, ocp_data); | ||
3286 | |||
3233 | ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_WDT11_CTRL); | 3287 | ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_WDT11_CTRL); |
3234 | ocp_data &= ~TIMER11_EN; | 3288 | ocp_data &= ~TIMER11_EN; |
3235 | ocp_write_word(tp, MCU_TYPE_USB, USB_WDT11_CTRL, ocp_data); | 3289 | ocp_write_word(tp, MCU_TYPE_USB, USB_WDT11_CTRL, ocp_data); |
@@ -3238,8 +3292,7 @@ static void r8153_init(struct r8152 *tp) | |||
3238 | ocp_data &= ~LED_MODE_MASK; | 3292 | ocp_data &= ~LED_MODE_MASK; |
3239 | ocp_write_word(tp, MCU_TYPE_PLA, PLA_LED_FEATURE, ocp_data); | 3293 | ocp_write_word(tp, MCU_TYPE_PLA, PLA_LED_FEATURE, ocp_data); |
3240 | 3294 | ||
3241 | ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_LPM_CTRL); | 3295 | ocp_data = FIFO_EMPTY_1FB | ROK_EXIT_LPM; |
3242 | ocp_data &= ~LPM_TIMER_MASK; | ||
3243 | if (tp->version == RTL_VER_04 && tp->udev->speed != USB_SPEED_SUPER) | 3296 | if (tp->version == RTL_VER_04 && tp->udev->speed != USB_SPEED_SUPER) |
3244 | ocp_data |= LPM_TIMER_500MS; | 3297 | ocp_data |= LPM_TIMER_500MS; |
3245 | else | 3298 | else |
@@ -3251,6 +3304,8 @@ static void r8153_init(struct r8152 *tp) | |||
3251 | ocp_data |= SEN_VAL_NORMAL | SEL_RXIDLE; | 3304 | ocp_data |= SEN_VAL_NORMAL | SEL_RXIDLE; |
3252 | ocp_write_word(tp, MCU_TYPE_USB, USB_AFE_CTRL2, ocp_data); | 3305 | ocp_write_word(tp, MCU_TYPE_USB, USB_AFE_CTRL2, ocp_data); |
3253 | 3306 | ||
3307 | ocp_write_word(tp, MCU_TYPE_USB, USB_CONNECT_TIMER, 0x0001); | ||
3308 | |||
3254 | r8153_power_cut_en(tp, false); | 3309 | r8153_power_cut_en(tp, false); |
3255 | r8153_u1u2en(tp, true); | 3310 | r8153_u1u2en(tp, true); |
3256 | 3311 | ||
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 0e57e862c399..1e0a775ea882 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c | |||
@@ -555,12 +555,13 @@ static int vxlan_fdb_append(struct vxlan_fdb *f, | |||
555 | static struct vxlanhdr *vxlan_gro_remcsum(struct sk_buff *skb, | 555 | static struct vxlanhdr *vxlan_gro_remcsum(struct sk_buff *skb, |
556 | unsigned int off, | 556 | unsigned int off, |
557 | struct vxlanhdr *vh, size_t hdrlen, | 557 | struct vxlanhdr *vh, size_t hdrlen, |
558 | u32 data) | 558 | u32 data, struct gro_remcsum *grc, |
559 | bool nopartial) | ||
559 | { | 560 | { |
560 | size_t start, offset, plen; | 561 | size_t start, offset, plen; |
561 | 562 | ||
562 | if (skb->remcsum_offload) | 563 | if (skb->remcsum_offload) |
563 | return vh; | 564 | return NULL; |
564 | 565 | ||
565 | if (!NAPI_GRO_CB(skb)->csum_valid) | 566 | if (!NAPI_GRO_CB(skb)->csum_valid) |
566 | return NULL; | 567 | return NULL; |
@@ -579,7 +580,8 @@ static struct vxlanhdr *vxlan_gro_remcsum(struct sk_buff *skb, | |||
579 | return NULL; | 580 | return NULL; |
580 | } | 581 | } |
581 | 582 | ||
582 | skb_gro_remcsum_process(skb, (void *)vh + hdrlen, start, offset); | 583 | skb_gro_remcsum_process(skb, (void *)vh + hdrlen, |
584 | start, offset, grc, nopartial); | ||
583 | 585 | ||
584 | skb->remcsum_offload = 1; | 586 | skb->remcsum_offload = 1; |
585 | 587 | ||
@@ -597,6 +599,9 @@ static struct sk_buff **vxlan_gro_receive(struct sk_buff **head, | |||
597 | struct vxlan_sock *vs = container_of(uoff, struct vxlan_sock, | 599 | struct vxlan_sock *vs = container_of(uoff, struct vxlan_sock, |
598 | udp_offloads); | 600 | udp_offloads); |
599 | u32 flags; | 601 | u32 flags; |
602 | struct gro_remcsum grc; | ||
603 | |||
604 | skb_gro_remcsum_init(&grc); | ||
600 | 605 | ||
601 | off_vx = skb_gro_offset(skb); | 606 | off_vx = skb_gro_offset(skb); |
602 | hlen = off_vx + sizeof(*vh); | 607 | hlen = off_vx + sizeof(*vh); |
@@ -614,7 +619,9 @@ static struct sk_buff **vxlan_gro_receive(struct sk_buff **head, | |||
614 | 619 | ||
615 | if ((flags & VXLAN_HF_RCO) && (vs->flags & VXLAN_F_REMCSUM_RX)) { | 620 | if ((flags & VXLAN_HF_RCO) && (vs->flags & VXLAN_F_REMCSUM_RX)) { |
616 | vh = vxlan_gro_remcsum(skb, off_vx, vh, sizeof(struct vxlanhdr), | 621 | vh = vxlan_gro_remcsum(skb, off_vx, vh, sizeof(struct vxlanhdr), |
617 | ntohl(vh->vx_vni)); | 622 | ntohl(vh->vx_vni), &grc, |
623 | !!(vs->flags & | ||
624 | VXLAN_F_REMCSUM_NOPARTIAL)); | ||
618 | 625 | ||
619 | if (!vh) | 626 | if (!vh) |
620 | goto out; | 627 | goto out; |
@@ -637,6 +644,7 @@ static struct sk_buff **vxlan_gro_receive(struct sk_buff **head, | |||
637 | pp = eth_gro_receive(head, skb); | 644 | pp = eth_gro_receive(head, skb); |
638 | 645 | ||
639 | out: | 646 | out: |
647 | skb_gro_remcsum_cleanup(skb, &grc); | ||
640 | NAPI_GRO_CB(skb)->flush |= flush; | 648 | NAPI_GRO_CB(skb)->flush |= flush; |
641 | 649 | ||
642 | return pp; | 650 | return pp; |
@@ -1150,16 +1158,10 @@ static void vxlan_igmp_leave(struct work_struct *work) | |||
1150 | } | 1158 | } |
1151 | 1159 | ||
1152 | static struct vxlanhdr *vxlan_remcsum(struct sk_buff *skb, struct vxlanhdr *vh, | 1160 | static struct vxlanhdr *vxlan_remcsum(struct sk_buff *skb, struct vxlanhdr *vh, |
1153 | size_t hdrlen, u32 data) | 1161 | size_t hdrlen, u32 data, bool nopartial) |
1154 | { | 1162 | { |
1155 | size_t start, offset, plen; | 1163 | size_t start, offset, plen; |
1156 | 1164 | ||
1157 | if (skb->remcsum_offload) { | ||
1158 | /* Already processed in GRO path */ | ||
1159 | skb->remcsum_offload = 0; | ||
1160 | return vh; | ||
1161 | } | ||
1162 | |||
1163 | start = (data & VXLAN_RCO_MASK) << VXLAN_RCO_SHIFT; | 1165 | start = (data & VXLAN_RCO_MASK) << VXLAN_RCO_SHIFT; |
1164 | offset = start + ((data & VXLAN_RCO_UDP) ? | 1166 | offset = start + ((data & VXLAN_RCO_UDP) ? |
1165 | offsetof(struct udphdr, check) : | 1167 | offsetof(struct udphdr, check) : |
@@ -1172,7 +1174,8 @@ static struct vxlanhdr *vxlan_remcsum(struct sk_buff *skb, struct vxlanhdr *vh, | |||
1172 | 1174 | ||
1173 | vh = (struct vxlanhdr *)(udp_hdr(skb) + 1); | 1175 | vh = (struct vxlanhdr *)(udp_hdr(skb) + 1); |
1174 | 1176 | ||
1175 | skb_remcsum_process(skb, (void *)vh + hdrlen, start, offset); | 1177 | skb_remcsum_process(skb, (void *)vh + hdrlen, start, offset, |
1178 | nopartial); | ||
1176 | 1179 | ||
1177 | return vh; | 1180 | return vh; |
1178 | } | 1181 | } |
@@ -1209,7 +1212,8 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb) | |||
1209 | goto drop; | 1212 | goto drop; |
1210 | 1213 | ||
1211 | if ((flags & VXLAN_HF_RCO) && (vs->flags & VXLAN_F_REMCSUM_RX)) { | 1214 | if ((flags & VXLAN_HF_RCO) && (vs->flags & VXLAN_F_REMCSUM_RX)) { |
1212 | vxh = vxlan_remcsum(skb, vxh, sizeof(struct vxlanhdr), vni); | 1215 | vxh = vxlan_remcsum(skb, vxh, sizeof(struct vxlanhdr), vni, |
1216 | !!(vs->flags & VXLAN_F_REMCSUM_NOPARTIAL)); | ||
1213 | if (!vxh) | 1217 | if (!vxh) |
1214 | goto drop; | 1218 | goto drop; |
1215 | 1219 | ||
@@ -2438,6 +2442,7 @@ static const struct nla_policy vxlan_policy[IFLA_VXLAN_MAX + 1] = { | |||
2438 | [IFLA_VXLAN_REMCSUM_TX] = { .type = NLA_U8 }, | 2442 | [IFLA_VXLAN_REMCSUM_TX] = { .type = NLA_U8 }, |
2439 | [IFLA_VXLAN_REMCSUM_RX] = { .type = NLA_U8 }, | 2443 | [IFLA_VXLAN_REMCSUM_RX] = { .type = NLA_U8 }, |
2440 | [IFLA_VXLAN_GBP] = { .type = NLA_FLAG, }, | 2444 | [IFLA_VXLAN_GBP] = { .type = NLA_FLAG, }, |
2445 | [IFLA_VXLAN_REMCSUM_NOPARTIAL] = { .type = NLA_FLAG }, | ||
2441 | }; | 2446 | }; |
2442 | 2447 | ||
2443 | static int vxlan_validate(struct nlattr *tb[], struct nlattr *data[]) | 2448 | static int vxlan_validate(struct nlattr *tb[], struct nlattr *data[]) |
@@ -2761,6 +2766,9 @@ static int vxlan_newlink(struct net *src_net, struct net_device *dev, | |||
2761 | if (data[IFLA_VXLAN_GBP]) | 2766 | if (data[IFLA_VXLAN_GBP]) |
2762 | vxlan->flags |= VXLAN_F_GBP; | 2767 | vxlan->flags |= VXLAN_F_GBP; |
2763 | 2768 | ||
2769 | if (data[IFLA_VXLAN_REMCSUM_NOPARTIAL]) | ||
2770 | vxlan->flags |= VXLAN_F_REMCSUM_NOPARTIAL; | ||
2771 | |||
2764 | if (vxlan_find_vni(src_net, vni, use_ipv6 ? AF_INET6 : AF_INET, | 2772 | if (vxlan_find_vni(src_net, vni, use_ipv6 ? AF_INET6 : AF_INET, |
2765 | vxlan->dst_port, vxlan->flags)) { | 2773 | vxlan->dst_port, vxlan->flags)) { |
2766 | pr_info("duplicate VNI %u\n", vni); | 2774 | pr_info("duplicate VNI %u\n", vni); |
@@ -2910,6 +2918,10 @@ static int vxlan_fill_info(struct sk_buff *skb, const struct net_device *dev) | |||
2910 | nla_put_flag(skb, IFLA_VXLAN_GBP)) | 2918 | nla_put_flag(skb, IFLA_VXLAN_GBP)) |
2911 | goto nla_put_failure; | 2919 | goto nla_put_failure; |
2912 | 2920 | ||
2921 | if (vxlan->flags & VXLAN_F_REMCSUM_NOPARTIAL && | ||
2922 | nla_put_flag(skb, IFLA_VXLAN_REMCSUM_NOPARTIAL)) | ||
2923 | goto nla_put_failure; | ||
2924 | |||
2913 | return 0; | 2925 | return 0; |
2914 | 2926 | ||
2915 | nla_put_failure: | 2927 | nla_put_failure: |
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 2c9088633ec6..ccbdb05b28cd 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -127,7 +127,7 @@ static const struct bcma_device_id b43_bcma_tbl[] = { | |||
127 | BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x1E, BCMA_ANY_CLASS), | 127 | BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x1E, BCMA_ANY_CLASS), |
128 | BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x28, BCMA_ANY_CLASS), | 128 | BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x28, BCMA_ANY_CLASS), |
129 | BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x2A, BCMA_ANY_CLASS), | 129 | BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x2A, BCMA_ANY_CLASS), |
130 | BCMA_CORETABLE_END | 130 | {}, |
131 | }; | 131 | }; |
132 | MODULE_DEVICE_TABLE(bcma, b43_bcma_tbl); | 132 | MODULE_DEVICE_TABLE(bcma, b43_bcma_tbl); |
133 | #endif | 133 | #endif |
@@ -144,7 +144,7 @@ static const struct ssb_device_id b43_ssb_tbl[] = { | |||
144 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 13), | 144 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 13), |
145 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 15), | 145 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 15), |
146 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 16), | 146 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 16), |
147 | SSB_DEVTABLE_END | 147 | {}, |
148 | }; | 148 | }; |
149 | MODULE_DEVICE_TABLE(ssb, b43_ssb_tbl); | 149 | MODULE_DEVICE_TABLE(ssb, b43_ssb_tbl); |
150 | #endif | 150 | #endif |
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c index 1aec2146a2bf..4e58c0069830 100644 --- a/drivers/net/wireless/b43legacy/main.c +++ b/drivers/net/wireless/b43legacy/main.c | |||
@@ -86,7 +86,7 @@ MODULE_PARM_DESC(fwpostfix, "Postfix for the firmware files to load."); | |||
86 | static const struct ssb_device_id b43legacy_ssb_tbl[] = { | 86 | static const struct ssb_device_id b43legacy_ssb_tbl[] = { |
87 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 2), | 87 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 2), |
88 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 4), | 88 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 4), |
89 | SSB_DEVTABLE_END | 89 | {}, |
90 | }; | 90 | }; |
91 | MODULE_DEVICE_TABLE(ssb, b43legacy_ssb_tbl); | 91 | MODULE_DEVICE_TABLE(ssb, b43legacy_ssb_tbl); |
92 | 92 | ||
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c index f95b52442281..48135063347e 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c | |||
@@ -99,7 +99,7 @@ static struct bcma_device_id brcms_coreid_table[] = { | |||
99 | BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 17, BCMA_ANY_CLASS), | 99 | BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 17, BCMA_ANY_CLASS), |
100 | BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 23, BCMA_ANY_CLASS), | 100 | BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 23, BCMA_ANY_CLASS), |
101 | BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 24, BCMA_ANY_CLASS), | 101 | BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 24, BCMA_ANY_CLASS), |
102 | BCMA_CORETABLE_END | 102 | {}, |
103 | }; | 103 | }; |
104 | MODULE_DEVICE_TABLE(bcma, brcms_coreid_table); | 104 | MODULE_DEVICE_TABLE(bcma, brcms_coreid_table); |
105 | 105 | ||
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index ec456f0d972e..a62170ea0481 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c | |||
@@ -822,11 +822,8 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) | |||
822 | 822 | ||
823 | /* get a new skb - if fail, old one will be reused */ | 823 | /* get a new skb - if fail, old one will be reused */ |
824 | new_skb = dev_alloc_skb(rtlpci->rxbuffersize); | 824 | new_skb = dev_alloc_skb(rtlpci->rxbuffersize); |
825 | if (unlikely(!new_skb)) { | 825 | if (unlikely(!new_skb)) |
826 | pr_err("Allocation of new skb failed in %s\n", | ||
827 | __func__); | ||
828 | goto no_new; | 826 | goto no_new; |
829 | } | ||
830 | if (rtlpriv->use_new_trx_flow) { | 827 | if (rtlpriv->use_new_trx_flow) { |
831 | buffer_desc = | 828 | buffer_desc = |
832 | &rtlpci->rx_ring[rxring_idx].buffer_desc | 829 | &rtlpci->rx_ring[rxring_idx].buffer_desc |
diff --git a/drivers/spi/spi-bcm53xx.c b/drivers/spi/spi-bcm53xx.c index 17b34cbadc03..3fb91c81015a 100644 --- a/drivers/spi/spi-bcm53xx.c +++ b/drivers/spi/spi-bcm53xx.c | |||
@@ -216,7 +216,7 @@ static struct spi_board_info bcm53xx_info = { | |||
216 | 216 | ||
217 | static const struct bcma_device_id bcm53xxspi_bcma_tbl[] = { | 217 | static const struct bcma_device_id bcm53xxspi_bcma_tbl[] = { |
218 | BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_NS_QSPI, BCMA_ANY_REV, BCMA_ANY_CLASS), | 218 | BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_NS_QSPI, BCMA_ANY_REV, BCMA_ANY_CLASS), |
219 | BCMA_CORETABLE_END | 219 | {}, |
220 | }; | 220 | }; |
221 | MODULE_DEVICE_TABLE(bcma, bcm53xxspi_bcma_tbl); | 221 | MODULE_DEVICE_TABLE(bcma, bcm53xxspi_bcma_tbl); |
222 | 222 | ||
diff --git a/drivers/ssb/driver_gige.c b/drivers/ssb/driver_gige.c index 21f71a1581fa..e9734051e3c4 100644 --- a/drivers/ssb/driver_gige.c +++ b/drivers/ssb/driver_gige.c | |||
@@ -24,7 +24,7 @@ MODULE_LICENSE("GPL"); | |||
24 | 24 | ||
25 | static const struct ssb_device_id ssb_gige_tbl[] = { | 25 | static const struct ssb_device_id ssb_gige_tbl[] = { |
26 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_ETHERNET_GBIT, SSB_ANY_REV), | 26 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_ETHERNET_GBIT, SSB_ANY_REV), |
27 | SSB_DEVTABLE_END | 27 | {}, |
28 | }; | 28 | }; |
29 | /* MODULE_DEVICE_TABLE(ssb, ssb_gige_tbl); */ | 29 | /* MODULE_DEVICE_TABLE(ssb, ssb_gige_tbl); */ |
30 | 30 | ||
diff --git a/drivers/usb/host/bcma-hcd.c b/drivers/usb/host/bcma-hcd.c index cd6d0afb6b8f..526cfab41d5f 100644 --- a/drivers/usb/host/bcma-hcd.c +++ b/drivers/usb/host/bcma-hcd.c | |||
@@ -306,7 +306,7 @@ static int bcma_hcd_resume(struct bcma_device *dev) | |||
306 | 306 | ||
307 | static const struct bcma_device_id bcma_hcd_table[] = { | 307 | static const struct bcma_device_id bcma_hcd_table[] = { |
308 | BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_USB20_HOST, BCMA_ANY_REV, BCMA_ANY_CLASS), | 308 | BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_USB20_HOST, BCMA_ANY_REV, BCMA_ANY_CLASS), |
309 | BCMA_CORETABLE_END | 309 | {}, |
310 | }; | 310 | }; |
311 | MODULE_DEVICE_TABLE(bcma, bcma_hcd_table); | 311 | MODULE_DEVICE_TABLE(bcma, bcma_hcd_table); |
312 | 312 | ||
diff --git a/drivers/usb/host/ssb-hcd.c b/drivers/usb/host/ssb-hcd.c index 0196f766df73..ffc32f4b1b1b 100644 --- a/drivers/usb/host/ssb-hcd.c +++ b/drivers/usb/host/ssb-hcd.c | |||
@@ -251,7 +251,7 @@ static const struct ssb_device_id ssb_hcd_table[] = { | |||
251 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_USB11_HOSTDEV, SSB_ANY_REV), | 251 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_USB11_HOSTDEV, SSB_ANY_REV), |
252 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_USB11_HOST, SSB_ANY_REV), | 252 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_USB11_HOST, SSB_ANY_REV), |
253 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_USB20_HOST, SSB_ANY_REV), | 253 | SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_USB20_HOST, SSB_ANY_REV), |
254 | SSB_DEVTABLE_END | 254 | {}, |
255 | }; | 255 | }; |
256 | MODULE_DEVICE_TABLE(ssb, ssb_hcd_table); | 256 | MODULE_DEVICE_TABLE(ssb, ssb_hcd_table); |
257 | 257 | ||
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 8dccca9013ed..afa06d28725d 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
@@ -528,9 +528,9 @@ static void handle_rx(struct vhost_net *net) | |||
528 | .msg_controllen = 0, | 528 | .msg_controllen = 0, |
529 | .msg_flags = MSG_DONTWAIT, | 529 | .msg_flags = MSG_DONTWAIT, |
530 | }; | 530 | }; |
531 | struct virtio_net_hdr_mrg_rxbuf hdr = { | 531 | struct virtio_net_hdr hdr = { |
532 | .hdr.flags = 0, | 532 | .flags = 0, |
533 | .hdr.gso_type = VIRTIO_NET_HDR_GSO_NONE | 533 | .gso_type = VIRTIO_NET_HDR_GSO_NONE |
534 | }; | 534 | }; |
535 | size_t total_len = 0; | 535 | size_t total_len = 0; |
536 | int err, mergeable; | 536 | int err, mergeable; |
@@ -539,6 +539,7 @@ static void handle_rx(struct vhost_net *net) | |||
539 | size_t vhost_len, sock_len; | 539 | size_t vhost_len, sock_len; |
540 | struct socket *sock; | 540 | struct socket *sock; |
541 | struct iov_iter fixup; | 541 | struct iov_iter fixup; |
542 | __virtio16 num_buffers; | ||
542 | 543 | ||
543 | mutex_lock(&vq->mutex); | 544 | mutex_lock(&vq->mutex); |
544 | sock = vq->private_data; | 545 | sock = vq->private_data; |
@@ -616,9 +617,9 @@ static void handle_rx(struct vhost_net *net) | |||
616 | } | 617 | } |
617 | /* TODO: Should check and handle checksum. */ | 618 | /* TODO: Should check and handle checksum. */ |
618 | 619 | ||
619 | hdr.num_buffers = cpu_to_vhost16(vq, headcount); | 620 | num_buffers = cpu_to_vhost16(vq, headcount); |
620 | if (likely(mergeable) && | 621 | if (likely(mergeable) && |
621 | copy_to_iter(&hdr.num_buffers, 2, &fixup) != 2) { | 622 | copy_to_iter(&num_buffers, 2, &fixup) != 2) { |
622 | vq_err(vq, "Failed num_buffers write"); | 623 | vq_err(vq, "Failed num_buffers write"); |
623 | vhost_discard_vq_desc(vq, headcount); | 624 | vhost_discard_vq_desc(vq, headcount); |
624 | break; | 625 | break; |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 2e75ab00dbf2..e530533b94be 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -364,8 +364,6 @@ struct ssb_device_id { | |||
364 | } __attribute__((packed, aligned(2))); | 364 | } __attribute__((packed, aligned(2))); |
365 | #define SSB_DEVICE(_vendor, _coreid, _revision) \ | 365 | #define SSB_DEVICE(_vendor, _coreid, _revision) \ |
366 | { .vendor = _vendor, .coreid = _coreid, .revision = _revision, } | 366 | { .vendor = _vendor, .coreid = _coreid, .revision = _revision, } |
367 | #define SSB_DEVTABLE_END \ | ||
368 | { 0, }, | ||
369 | 367 | ||
370 | #define SSB_ANY_VENDOR 0xFFFF | 368 | #define SSB_ANY_VENDOR 0xFFFF |
371 | #define SSB_ANY_ID 0xFFFF | 369 | #define SSB_ANY_ID 0xFFFF |
@@ -380,8 +378,6 @@ struct bcma_device_id { | |||
380 | } __attribute__((packed,aligned(2))); | 378 | } __attribute__((packed,aligned(2))); |
381 | #define BCMA_CORE(_manuf, _id, _rev, _class) \ | 379 | #define BCMA_CORE(_manuf, _id, _rev, _class) \ |
382 | { .manuf = _manuf, .id = _id, .rev = _rev, .class = _class, } | 380 | { .manuf = _manuf, .id = _id, .rev = _rev, .class = _class, } |
383 | #define BCMA_CORETABLE_END \ | ||
384 | { 0, }, | ||
385 | 381 | ||
386 | #define BCMA_ANY_MANUF 0xFFFF | 382 | #define BCMA_ANY_MANUF 0xFFFF |
387 | #define BCMA_ANY_ID 0xFFFF | 383 | #define BCMA_ANY_ID 0xFFFF |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index d115256ed5a2..5897b4ea5a3f 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1923,13 +1923,8 @@ struct napi_gro_cb { | |||
1923 | /* Number of segments aggregated. */ | 1923 | /* Number of segments aggregated. */ |
1924 | u16 count; | 1924 | u16 count; |
1925 | 1925 | ||
1926 | /* This is non-zero if the packet may be of the same flow. */ | 1926 | /* Start offset for remote checksum offload */ |
1927 | u8 same_flow; | 1927 | u16 gro_remcsum_start; |
1928 | |||
1929 | /* Free the skb? */ | ||
1930 | u8 free; | ||
1931 | #define NAPI_GRO_FREE 1 | ||
1932 | #define NAPI_GRO_FREE_STOLEN_HEAD 2 | ||
1933 | 1928 | ||
1934 | /* jiffies when first packet was created/queued */ | 1929 | /* jiffies when first packet was created/queued */ |
1935 | unsigned long age; | 1930 | unsigned long age; |
@@ -1937,6 +1932,9 @@ struct napi_gro_cb { | |||
1937 | /* Used in ipv6_gro_receive() and foo-over-udp */ | 1932 | /* Used in ipv6_gro_receive() and foo-over-udp */ |
1938 | u16 proto; | 1933 | u16 proto; |
1939 | 1934 | ||
1935 | /* This is non-zero if the packet may be of the same flow. */ | ||
1936 | u8 same_flow:1; | ||
1937 | |||
1940 | /* Used in udp_gro_receive */ | 1938 | /* Used in udp_gro_receive */ |
1941 | u8 udp_mark:1; | 1939 | u8 udp_mark:1; |
1942 | 1940 | ||
@@ -1946,9 +1944,16 @@ struct napi_gro_cb { | |||
1946 | /* Number of checksums via CHECKSUM_UNNECESSARY */ | 1944 | /* Number of checksums via CHECKSUM_UNNECESSARY */ |
1947 | u8 csum_cnt:3; | 1945 | u8 csum_cnt:3; |
1948 | 1946 | ||
1947 | /* Free the skb? */ | ||
1948 | u8 free:2; | ||
1949 | #define NAPI_GRO_FREE 1 | ||
1950 | #define NAPI_GRO_FREE_STOLEN_HEAD 2 | ||
1951 | |||
1949 | /* Used in foo-over-udp, set in udp[46]_gro_receive */ | 1952 | /* Used in foo-over-udp, set in udp[46]_gro_receive */ |
1950 | u8 is_ipv6:1; | 1953 | u8 is_ipv6:1; |
1951 | 1954 | ||
1955 | /* 7 bit hole */ | ||
1956 | |||
1952 | /* used to support CHECKSUM_COMPLETE for tunneling protocols */ | 1957 | /* used to support CHECKSUM_COMPLETE for tunneling protocols */ |
1953 | __wsum csum; | 1958 | __wsum csum; |
1954 | 1959 | ||
@@ -2242,11 +2247,20 @@ static inline void skb_gro_postpull_rcsum(struct sk_buff *skb, | |||
2242 | 2247 | ||
2243 | __sum16 __skb_gro_checksum_complete(struct sk_buff *skb); | 2248 | __sum16 __skb_gro_checksum_complete(struct sk_buff *skb); |
2244 | 2249 | ||
2250 | static inline bool skb_at_gro_remcsum_start(struct sk_buff *skb) | ||
2251 | { | ||
2252 | return (NAPI_GRO_CB(skb)->gro_remcsum_start - skb_headroom(skb) == | ||
2253 | skb_gro_offset(skb)); | ||
2254 | } | ||
2255 | |||
2245 | static inline bool __skb_gro_checksum_validate_needed(struct sk_buff *skb, | 2256 | static inline bool __skb_gro_checksum_validate_needed(struct sk_buff *skb, |
2246 | bool zero_okay, | 2257 | bool zero_okay, |
2247 | __sum16 check) | 2258 | __sum16 check) |
2248 | { | 2259 | { |
2249 | return (skb->ip_summed != CHECKSUM_PARTIAL && | 2260 | return ((skb->ip_summed != CHECKSUM_PARTIAL || |
2261 | skb_checksum_start_offset(skb) < | ||
2262 | skb_gro_offset(skb)) && | ||
2263 | !skb_at_gro_remcsum_start(skb) && | ||
2250 | NAPI_GRO_CB(skb)->csum_cnt == 0 && | 2264 | NAPI_GRO_CB(skb)->csum_cnt == 0 && |
2251 | (!zero_okay || check)); | 2265 | (!zero_okay || check)); |
2252 | } | 2266 | } |
@@ -2321,20 +2335,48 @@ do { \ | |||
2321 | compute_pseudo(skb, proto)); \ | 2335 | compute_pseudo(skb, proto)); \ |
2322 | } while (0) | 2336 | } while (0) |
2323 | 2337 | ||
2338 | struct gro_remcsum { | ||
2339 | int offset; | ||
2340 | __wsum delta; | ||
2341 | }; | ||
2342 | |||
2343 | static inline void skb_gro_remcsum_init(struct gro_remcsum *grc) | ||
2344 | { | ||
2345 | grc->delta = 0; | ||
2346 | } | ||
2347 | |||
2324 | static inline void skb_gro_remcsum_process(struct sk_buff *skb, void *ptr, | 2348 | static inline void skb_gro_remcsum_process(struct sk_buff *skb, void *ptr, |
2325 | int start, int offset) | 2349 | int start, int offset, |
2350 | struct gro_remcsum *grc, | ||
2351 | bool nopartial) | ||
2326 | { | 2352 | { |
2327 | __wsum delta; | 2353 | __wsum delta; |
2328 | 2354 | ||
2329 | BUG_ON(!NAPI_GRO_CB(skb)->csum_valid); | 2355 | BUG_ON(!NAPI_GRO_CB(skb)->csum_valid); |
2330 | 2356 | ||
2357 | if (!nopartial) { | ||
2358 | NAPI_GRO_CB(skb)->gro_remcsum_start = | ||
2359 | ((unsigned char *)ptr + start) - skb->head; | ||
2360 | return; | ||
2361 | } | ||
2362 | |||
2331 | delta = remcsum_adjust(ptr, NAPI_GRO_CB(skb)->csum, start, offset); | 2363 | delta = remcsum_adjust(ptr, NAPI_GRO_CB(skb)->csum, start, offset); |
2332 | 2364 | ||
2333 | /* Adjust skb->csum since we changed the packet */ | 2365 | /* Adjust skb->csum since we changed the packet */ |
2334 | skb->csum = csum_add(skb->csum, delta); | ||
2335 | NAPI_GRO_CB(skb)->csum = csum_add(NAPI_GRO_CB(skb)->csum, delta); | 2366 | NAPI_GRO_CB(skb)->csum = csum_add(NAPI_GRO_CB(skb)->csum, delta); |
2367 | |||
2368 | grc->offset = (ptr + offset) - (void *)skb->head; | ||
2369 | grc->delta = delta; | ||
2336 | } | 2370 | } |
2337 | 2371 | ||
2372 | static inline void skb_gro_remcsum_cleanup(struct sk_buff *skb, | ||
2373 | struct gro_remcsum *grc) | ||
2374 | { | ||
2375 | if (!grc->delta) | ||
2376 | return; | ||
2377 | |||
2378 | remcsum_unadjust((__sum16 *)(skb->head + grc->offset), grc->delta); | ||
2379 | } | ||
2338 | 2380 | ||
2339 | static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, | 2381 | static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, |
2340 | unsigned short type, | 2382 | unsigned short type, |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 1bb36edb66b9..30007afe70b3 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -83,11 +83,15 @@ | |||
83 | * | 83 | * |
84 | * CHECKSUM_PARTIAL: | 84 | * CHECKSUM_PARTIAL: |
85 | * | 85 | * |
86 | * This is identical to the case for output below. This may occur on a packet | 86 | * A checksum is set up to be offloaded to a device as described in the |
87 | * output description for CHECKSUM_PARTIAL. This may occur on a packet | ||
87 | * received directly from another Linux OS, e.g., a virtualized Linux kernel | 88 | * received directly from another Linux OS, e.g., a virtualized Linux kernel |
88 | * on the same host. The packet can be treated in the same way as | 89 | * on the same host, or it may be set in the input path in GRO or remote |
89 | * CHECKSUM_UNNECESSARY, except that on output (i.e., forwarding) the | 90 | * checksum offload. For the purposes of checksum verification, the checksum |
90 | * checksum must be filled in by the OS or the hardware. | 91 | * referred to by skb->csum_start + skb->csum_offset and any preceding |
92 | * checksums in the packet are considered verified. Any checksums in the | ||
93 | * packet that are after the checksum being offloaded are not considered to | ||
94 | * be verified. | ||
91 | * | 95 | * |
92 | * B. Checksumming on output. | 96 | * B. Checksumming on output. |
93 | * | 97 | * |
@@ -2915,7 +2919,10 @@ __sum16 __skb_checksum_complete(struct sk_buff *skb); | |||
2915 | 2919 | ||
2916 | static inline int skb_csum_unnecessary(const struct sk_buff *skb) | 2920 | static inline int skb_csum_unnecessary(const struct sk_buff *skb) |
2917 | { | 2921 | { |
2918 | return ((skb->ip_summed & CHECKSUM_UNNECESSARY) || skb->csum_valid); | 2922 | return ((skb->ip_summed == CHECKSUM_UNNECESSARY) || |
2923 | skb->csum_valid || | ||
2924 | (skb->ip_summed == CHECKSUM_PARTIAL && | ||
2925 | skb_checksum_start_offset(skb) >= 0)); | ||
2919 | } | 2926 | } |
2920 | 2927 | ||
2921 | /** | 2928 | /** |
@@ -3097,16 +3104,29 @@ do { \ | |||
3097 | compute_pseudo(skb, proto)); \ | 3104 | compute_pseudo(skb, proto)); \ |
3098 | } while (0) | 3105 | } while (0) |
3099 | 3106 | ||
3107 | static inline void skb_remcsum_adjust_partial(struct sk_buff *skb, void *ptr, | ||
3108 | u16 start, u16 offset) | ||
3109 | { | ||
3110 | skb->ip_summed = CHECKSUM_PARTIAL; | ||
3111 | skb->csum_start = ((unsigned char *)ptr + start) - skb->head; | ||
3112 | skb->csum_offset = offset - start; | ||
3113 | } | ||
3114 | |||
3100 | /* Update skbuf and packet to reflect the remote checksum offload operation. | 3115 | /* Update skbuf and packet to reflect the remote checksum offload operation. |
3101 | * When called, ptr indicates the starting point for skb->csum when | 3116 | * When called, ptr indicates the starting point for skb->csum when |
3102 | * ip_summed is CHECKSUM_COMPLETE. If we need create checksum complete | 3117 | * ip_summed is CHECKSUM_COMPLETE. If we need create checksum complete |
3103 | * here, skb_postpull_rcsum is done so skb->csum start is ptr. | 3118 | * here, skb_postpull_rcsum is done so skb->csum start is ptr. |
3104 | */ | 3119 | */ |
3105 | static inline void skb_remcsum_process(struct sk_buff *skb, void *ptr, | 3120 | static inline void skb_remcsum_process(struct sk_buff *skb, void *ptr, |
3106 | int start, int offset) | 3121 | int start, int offset, bool nopartial) |
3107 | { | 3122 | { |
3108 | __wsum delta; | 3123 | __wsum delta; |
3109 | 3124 | ||
3125 | if (!nopartial) { | ||
3126 | skb_remcsum_adjust_partial(skb, ptr, start, offset); | ||
3127 | return; | ||
3128 | } | ||
3129 | |||
3110 | if (unlikely(skb->ip_summed != CHECKSUM_COMPLETE)) { | 3130 | if (unlikely(skb->ip_summed != CHECKSUM_COMPLETE)) { |
3111 | __skb_checksum_complete(skb); | 3131 | __skb_checksum_complete(skb); |
3112 | skb_postpull_rcsum(skb, skb->data, ptr - (void *)skb->data); | 3132 | skb_postpull_rcsum(skb, skb->data, ptr - (void *)skb->data); |
diff --git a/include/net/checksum.h b/include/net/checksum.h index e339a9513e29..0a55ac715077 100644 --- a/include/net/checksum.h +++ b/include/net/checksum.h | |||
@@ -167,4 +167,9 @@ static inline __wsum remcsum_adjust(void *ptr, __wsum csum, | |||
167 | return delta; | 167 | return delta; |
168 | } | 168 | } |
169 | 169 | ||
170 | static inline void remcsum_unadjust(__sum16 *psum, __wsum delta) | ||
171 | { | ||
172 | *psum = csum_fold(csum_sub(delta, *psum)); | ||
173 | } | ||
174 | |||
170 | #endif | 175 | #endif |
diff --git a/include/net/vxlan.h b/include/net/vxlan.h index 2927d6244481..eabd3a038674 100644 --- a/include/net/vxlan.h +++ b/include/net/vxlan.h | |||
@@ -128,13 +128,15 @@ struct vxlan_sock { | |||
128 | #define VXLAN_F_REMCSUM_TX 0x200 | 128 | #define VXLAN_F_REMCSUM_TX 0x200 |
129 | #define VXLAN_F_REMCSUM_RX 0x400 | 129 | #define VXLAN_F_REMCSUM_RX 0x400 |
130 | #define VXLAN_F_GBP 0x800 | 130 | #define VXLAN_F_GBP 0x800 |
131 | #define VXLAN_F_REMCSUM_NOPARTIAL 0x1000 | ||
131 | 132 | ||
132 | /* Flags that are used in the receive patch. These flags must match in | 133 | /* Flags that are used in the receive patch. These flags must match in |
133 | * order for a socket to be shareable | 134 | * order for a socket to be shareable |
134 | */ | 135 | */ |
135 | #define VXLAN_F_RCV_FLAGS (VXLAN_F_GBP | \ | 136 | #define VXLAN_F_RCV_FLAGS (VXLAN_F_GBP | \ |
136 | VXLAN_F_UDP_ZERO_CSUM6_RX | \ | 137 | VXLAN_F_UDP_ZERO_CSUM6_RX | \ |
137 | VXLAN_F_REMCSUM_RX) | 138 | VXLAN_F_REMCSUM_RX | \ |
139 | VXLAN_F_REMCSUM_NOPARTIAL) | ||
138 | 140 | ||
139 | struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port, | 141 | struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port, |
140 | vxlan_rcv_t *rcv, void *data, | 142 | vxlan_rcv_t *rcv, void *data, |
diff --git a/include/uapi/linux/fou.h b/include/uapi/linux/fou.h index 8df06894da23..c303588bb767 100644 --- a/include/uapi/linux/fou.h +++ b/include/uapi/linux/fou.h | |||
@@ -14,6 +14,7 @@ enum { | |||
14 | FOU_ATTR_AF, /* u8 */ | 14 | FOU_ATTR_AF, /* u8 */ |
15 | FOU_ATTR_IPPROTO, /* u8 */ | 15 | FOU_ATTR_IPPROTO, /* u8 */ |
16 | FOU_ATTR_TYPE, /* u8 */ | 16 | FOU_ATTR_TYPE, /* u8 */ |
17 | FOU_ATTR_REMCSUM_NOPARTIAL, /* flag */ | ||
17 | 18 | ||
18 | __FOU_ATTR_MAX, | 19 | __FOU_ATTR_MAX, |
19 | }; | 20 | }; |
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h index 0deee3eeddbf..dfd0bb22e554 100644 --- a/include/uapi/linux/if_link.h +++ b/include/uapi/linux/if_link.h | |||
@@ -374,6 +374,7 @@ enum { | |||
374 | IFLA_VXLAN_REMCSUM_TX, | 374 | IFLA_VXLAN_REMCSUM_TX, |
375 | IFLA_VXLAN_REMCSUM_RX, | 375 | IFLA_VXLAN_REMCSUM_RX, |
376 | IFLA_VXLAN_GBP, | 376 | IFLA_VXLAN_GBP, |
377 | IFLA_VXLAN_REMCSUM_NOPARTIAL, | ||
377 | __IFLA_VXLAN_MAX | 378 | __IFLA_VXLAN_MAX |
378 | }; | 379 | }; |
379 | #define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1) | 380 | #define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1) |
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c index 65728e0dc4ff..0ee453fad3de 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c | |||
@@ -987,15 +987,12 @@ static int __init br_netfilter_init(void) | |||
987 | if (brnf_sysctl_header == NULL) { | 987 | if (brnf_sysctl_header == NULL) { |
988 | printk(KERN_WARNING | 988 | printk(KERN_WARNING |
989 | "br_netfilter: can't register to sysctl.\n"); | 989 | "br_netfilter: can't register to sysctl.\n"); |
990 | ret = -ENOMEM; | 990 | nf_unregister_hooks(br_nf_ops, ARRAY_SIZE(br_nf_ops)); |
991 | goto err1; | 991 | return -ENOMEM; |
992 | } | 992 | } |
993 | #endif | 993 | #endif |
994 | printk(KERN_NOTICE "Bridge firewalling registered\n"); | 994 | printk(KERN_NOTICE "Bridge firewalling registered\n"); |
995 | return 0; | 995 | return 0; |
996 | err1: | ||
997 | nf_unregister_hooks(br_nf_ops, ARRAY_SIZE(br_nf_ops)); | ||
998 | return ret; | ||
999 | } | 996 | } |
1000 | 997 | ||
1001 | static void __exit br_netfilter_fini(void) | 998 | static void __exit br_netfilter_fini(void) |
diff --git a/net/core/dev.c b/net/core/dev.c index d030575532a2..8f9710c62e20 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -4024,6 +4024,7 @@ static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff | |||
4024 | NAPI_GRO_CB(skb)->flush = 0; | 4024 | NAPI_GRO_CB(skb)->flush = 0; |
4025 | NAPI_GRO_CB(skb)->free = 0; | 4025 | NAPI_GRO_CB(skb)->free = 0; |
4026 | NAPI_GRO_CB(skb)->udp_mark = 0; | 4026 | NAPI_GRO_CB(skb)->udp_mark = 0; |
4027 | NAPI_GRO_CB(skb)->gro_remcsum_start = 0; | ||
4027 | 4028 | ||
4028 | /* Setup for GRO checksum validation */ | 4029 | /* Setup for GRO checksum validation */ |
4029 | switch (skb->ip_summed) { | 4030 | switch (skb->ip_summed) { |
@@ -5335,7 +5336,7 @@ EXPORT_SYMBOL(netdev_upper_dev_unlink); | |||
5335 | /** | 5336 | /** |
5336 | * netdev_bonding_info_change - Dispatch event about slave change | 5337 | * netdev_bonding_info_change - Dispatch event about slave change |
5337 | * @dev: device | 5338 | * @dev: device |
5338 | * @netdev_bonding_info: info to dispatch | 5339 | * @bonding_info: info to dispatch |
5339 | * | 5340 | * |
5340 | * Send NETDEV_BONDING_INFO to netdev notifiers with info. | 5341 | * Send NETDEV_BONDING_INFO to netdev notifiers with info. |
5341 | * The caller must hold the RTNL lock. | 5342 | * The caller must hold the RTNL lock. |
diff --git a/net/core/filter.c b/net/core/filter.c index ec9baea10c16..f6bdc2b1ba01 100644 --- a/net/core/filter.c +++ b/net/core/filter.c | |||
@@ -531,7 +531,7 @@ do_pass: | |||
531 | *insn = BPF_LDX_MEM(BPF_W, BPF_REG_A, BPF_REG_CTX, fp->k); | 531 | *insn = BPF_LDX_MEM(BPF_W, BPF_REG_A, BPF_REG_CTX, fp->k); |
532 | break; | 532 | break; |
533 | 533 | ||
534 | /* Unkown instruction. */ | 534 | /* Unknown instruction. */ |
535 | default: | 535 | default: |
536 | goto err; | 536 | goto err; |
537 | } | 537 | } |
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 9fa25b0ea145..b4899f5b7388 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -97,7 +97,7 @@ | |||
97 | * New xmit() return, do_div and misc clean up by Stephen Hemminger | 97 | * New xmit() return, do_div and misc clean up by Stephen Hemminger |
98 | * <shemminger@osdl.org> 040923 | 98 | * <shemminger@osdl.org> 040923 |
99 | * | 99 | * |
100 | * Randy Dunlap fixed u64 printk compiler waring | 100 | * Randy Dunlap fixed u64 printk compiler warning |
101 | * | 101 | * |
102 | * Remove FCS from BW calculation. Lennert Buytenhek <buytenh@wantstofly.org> | 102 | * Remove FCS from BW calculation. Lennert Buytenhek <buytenh@wantstofly.org> |
103 | * New time handling. Lennert Buytenhek <buytenh@wantstofly.org> 041213 | 103 | * New time handling. Lennert Buytenhek <buytenh@wantstofly.org> 041213 |
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 5be499b6a2d2..ab293a3066b3 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -2162,7 +2162,14 @@ replay: | |||
2162 | } | 2162 | } |
2163 | err = rtnl_configure_link(dev, ifm); | 2163 | err = rtnl_configure_link(dev, ifm); |
2164 | if (err < 0) { | 2164 | if (err < 0) { |
2165 | unregister_netdevice(dev); | 2165 | if (ops->newlink) { |
2166 | LIST_HEAD(list_kill); | ||
2167 | |||
2168 | ops->dellink(dev, &list_kill); | ||
2169 | unregister_netdevice_many(&list_kill); | ||
2170 | } else { | ||
2171 | unregister_netdevice(dev); | ||
2172 | } | ||
2166 | goto out; | 2173 | goto out; |
2167 | } | 2174 | } |
2168 | 2175 | ||
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index d104ae15836f..f23deadf42a0 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c | |||
@@ -521,10 +521,13 @@ static int dsa_slave_phy_setup(struct dsa_slave_priv *p, | |||
521 | struct device_node *phy_dn, *port_dn; | 521 | struct device_node *phy_dn, *port_dn; |
522 | bool phy_is_fixed = false; | 522 | bool phy_is_fixed = false; |
523 | u32 phy_flags = 0; | 523 | u32 phy_flags = 0; |
524 | int ret; | 524 | int mode, ret; |
525 | 525 | ||
526 | port_dn = cd->port_dn[p->port]; | 526 | port_dn = cd->port_dn[p->port]; |
527 | p->phy_interface = of_get_phy_mode(port_dn); | 527 | mode = of_get_phy_mode(port_dn); |
528 | if (mode < 0) | ||
529 | mode = PHY_INTERFACE_MODE_NA; | ||
530 | p->phy_interface = mode; | ||
528 | 531 | ||
529 | phy_dn = of_parse_phandle(port_dn, "phy-handle", 0); | 532 | phy_dn = of_parse_phandle(port_dn, "phy-handle", 0); |
530 | if (of_phy_is_fixed_link(port_dn)) { | 533 | if (of_phy_is_fixed_link(port_dn)) { |
@@ -559,6 +562,8 @@ static int dsa_slave_phy_setup(struct dsa_slave_priv *p, | |||
559 | if (!p->phy) | 562 | if (!p->phy) |
560 | return -ENODEV; | 563 | return -ENODEV; |
561 | 564 | ||
565 | /* Use already configured phy mode */ | ||
566 | p->phy_interface = p->phy->interface; | ||
562 | phy_connect_direct(slave_dev, p->phy, dsa_slave_adjust_link, | 567 | phy_connect_direct(slave_dev, p->phy, dsa_slave_adjust_link, |
563 | p->phy_interface); | 568 | p->phy_interface); |
564 | } else { | 569 | } else { |
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index f0b4a31d7bd6..3a8985c94581 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -1186,7 +1186,7 @@ __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope) | |||
1186 | no_in_dev: | 1186 | no_in_dev: |
1187 | 1187 | ||
1188 | /* Not loopback addresses on loopback should be preferred | 1188 | /* Not loopback addresses on loopback should be preferred |
1189 | in this case. It is importnat that lo is the first interface | 1189 | in this case. It is important that lo is the first interface |
1190 | in dev_base list. | 1190 | in dev_base list. |
1191 | */ | 1191 | */ |
1192 | for_each_netdev_rcu(net, dev) { | 1192 | for_each_netdev_rcu(net, dev) { |
diff --git a/net/ipv4/fou.c b/net/ipv4/fou.c index 92ddea1e6457..ff069f6597ac 100644 --- a/net/ipv4/fou.c +++ b/net/ipv4/fou.c | |||
@@ -22,14 +22,18 @@ static LIST_HEAD(fou_list); | |||
22 | struct fou { | 22 | struct fou { |
23 | struct socket *sock; | 23 | struct socket *sock; |
24 | u8 protocol; | 24 | u8 protocol; |
25 | u8 flags; | ||
25 | u16 port; | 26 | u16 port; |
26 | struct udp_offload udp_offloads; | 27 | struct udp_offload udp_offloads; |
27 | struct list_head list; | 28 | struct list_head list; |
28 | }; | 29 | }; |
29 | 30 | ||
31 | #define FOU_F_REMCSUM_NOPARTIAL BIT(0) | ||
32 | |||
30 | struct fou_cfg { | 33 | struct fou_cfg { |
31 | u16 type; | 34 | u16 type; |
32 | u8 protocol; | 35 | u8 protocol; |
36 | u8 flags; | ||
33 | struct udp_port_cfg udp_config; | 37 | struct udp_port_cfg udp_config; |
34 | }; | 38 | }; |
35 | 39 | ||
@@ -64,24 +68,20 @@ static int fou_udp_recv(struct sock *sk, struct sk_buff *skb) | |||
64 | } | 68 | } |
65 | 69 | ||
66 | static struct guehdr *gue_remcsum(struct sk_buff *skb, struct guehdr *guehdr, | 70 | static struct guehdr *gue_remcsum(struct sk_buff *skb, struct guehdr *guehdr, |
67 | void *data, size_t hdrlen, u8 ipproto) | 71 | void *data, size_t hdrlen, u8 ipproto, |
72 | bool nopartial) | ||
68 | { | 73 | { |
69 | __be16 *pd = data; | 74 | __be16 *pd = data; |
70 | size_t start = ntohs(pd[0]); | 75 | size_t start = ntohs(pd[0]); |
71 | size_t offset = ntohs(pd[1]); | 76 | size_t offset = ntohs(pd[1]); |
72 | size_t plen = hdrlen + max_t(size_t, offset + sizeof(u16), start); | 77 | size_t plen = hdrlen + max_t(size_t, offset + sizeof(u16), start); |
73 | 78 | ||
74 | if (skb->remcsum_offload) { | ||
75 | /* Already processed in GRO path */ | ||
76 | skb->remcsum_offload = 0; | ||
77 | return guehdr; | ||
78 | } | ||
79 | |||
80 | if (!pskb_may_pull(skb, plen)) | 79 | if (!pskb_may_pull(skb, plen)) |
81 | return NULL; | 80 | return NULL; |
82 | guehdr = (struct guehdr *)&udp_hdr(skb)[1]; | 81 | guehdr = (struct guehdr *)&udp_hdr(skb)[1]; |
83 | 82 | ||
84 | skb_remcsum_process(skb, (void *)guehdr + hdrlen, start, offset); | 83 | skb_remcsum_process(skb, (void *)guehdr + hdrlen, |
84 | start, offset, nopartial); | ||
85 | 85 | ||
86 | return guehdr; | 86 | return guehdr; |
87 | } | 87 | } |
@@ -142,7 +142,9 @@ static int gue_udp_recv(struct sock *sk, struct sk_buff *skb) | |||
142 | 142 | ||
143 | if (flags & GUE_PFLAG_REMCSUM) { | 143 | if (flags & GUE_PFLAG_REMCSUM) { |
144 | guehdr = gue_remcsum(skb, guehdr, data + doffset, | 144 | guehdr = gue_remcsum(skb, guehdr, data + doffset, |
145 | hdrlen, guehdr->proto_ctype); | 145 | hdrlen, guehdr->proto_ctype, |
146 | !!(fou->flags & | ||
147 | FOU_F_REMCSUM_NOPARTIAL)); | ||
146 | if (!guehdr) | 148 | if (!guehdr) |
147 | goto drop; | 149 | goto drop; |
148 | 150 | ||
@@ -214,7 +216,8 @@ out_unlock: | |||
214 | 216 | ||
215 | static struct guehdr *gue_gro_remcsum(struct sk_buff *skb, unsigned int off, | 217 | static struct guehdr *gue_gro_remcsum(struct sk_buff *skb, unsigned int off, |
216 | struct guehdr *guehdr, void *data, | 218 | struct guehdr *guehdr, void *data, |
217 | size_t hdrlen, u8 ipproto) | 219 | size_t hdrlen, u8 ipproto, |
220 | struct gro_remcsum *grc, bool nopartial) | ||
218 | { | 221 | { |
219 | __be16 *pd = data; | 222 | __be16 *pd = data; |
220 | size_t start = ntohs(pd[0]); | 223 | size_t start = ntohs(pd[0]); |
@@ -222,7 +225,7 @@ static struct guehdr *gue_gro_remcsum(struct sk_buff *skb, unsigned int off, | |||
222 | size_t plen = hdrlen + max_t(size_t, offset + sizeof(u16), start); | 225 | size_t plen = hdrlen + max_t(size_t, offset + sizeof(u16), start); |
223 | 226 | ||
224 | if (skb->remcsum_offload) | 227 | if (skb->remcsum_offload) |
225 | return guehdr; | 228 | return NULL; |
226 | 229 | ||
227 | if (!NAPI_GRO_CB(skb)->csum_valid) | 230 | if (!NAPI_GRO_CB(skb)->csum_valid) |
228 | return NULL; | 231 | return NULL; |
@@ -234,7 +237,8 @@ static struct guehdr *gue_gro_remcsum(struct sk_buff *skb, unsigned int off, | |||
234 | return NULL; | 237 | return NULL; |
235 | } | 238 | } |
236 | 239 | ||
237 | skb_gro_remcsum_process(skb, (void *)guehdr + hdrlen, start, offset); | 240 | skb_gro_remcsum_process(skb, (void *)guehdr + hdrlen, |
241 | start, offset, grc, nopartial); | ||
238 | 242 | ||
239 | skb->remcsum_offload = 1; | 243 | skb->remcsum_offload = 1; |
240 | 244 | ||
@@ -254,6 +258,10 @@ static struct sk_buff **gue_gro_receive(struct sk_buff **head, | |||
254 | void *data; | 258 | void *data; |
255 | u16 doffset = 0; | 259 | u16 doffset = 0; |
256 | int flush = 1; | 260 | int flush = 1; |
261 | struct fou *fou = container_of(uoff, struct fou, udp_offloads); | ||
262 | struct gro_remcsum grc; | ||
263 | |||
264 | skb_gro_remcsum_init(&grc); | ||
257 | 265 | ||
258 | off = skb_gro_offset(skb); | 266 | off = skb_gro_offset(skb); |
259 | len = off + sizeof(*guehdr); | 267 | len = off + sizeof(*guehdr); |
@@ -295,7 +303,9 @@ static struct sk_buff **gue_gro_receive(struct sk_buff **head, | |||
295 | if (flags & GUE_PFLAG_REMCSUM) { | 303 | if (flags & GUE_PFLAG_REMCSUM) { |
296 | guehdr = gue_gro_remcsum(skb, off, guehdr, | 304 | guehdr = gue_gro_remcsum(skb, off, guehdr, |
297 | data + doffset, hdrlen, | 305 | data + doffset, hdrlen, |
298 | guehdr->proto_ctype); | 306 | guehdr->proto_ctype, &grc, |
307 | !!(fou->flags & | ||
308 | FOU_F_REMCSUM_NOPARTIAL)); | ||
299 | if (!guehdr) | 309 | if (!guehdr) |
300 | goto out; | 310 | goto out; |
301 | 311 | ||
@@ -345,6 +355,7 @@ out_unlock: | |||
345 | rcu_read_unlock(); | 355 | rcu_read_unlock(); |
346 | out: | 356 | out: |
347 | NAPI_GRO_CB(skb)->flush |= flush; | 357 | NAPI_GRO_CB(skb)->flush |= flush; |
358 | skb_gro_remcsum_cleanup(skb, &grc); | ||
348 | 359 | ||
349 | return pp; | 360 | return pp; |
350 | } | 361 | } |
@@ -455,6 +466,7 @@ static int fou_create(struct net *net, struct fou_cfg *cfg, | |||
455 | 466 | ||
456 | sk = sock->sk; | 467 | sk = sock->sk; |
457 | 468 | ||
469 | fou->flags = cfg->flags; | ||
458 | fou->port = cfg->udp_config.local_udp_port; | 470 | fou->port = cfg->udp_config.local_udp_port; |
459 | 471 | ||
460 | /* Initial for fou type */ | 472 | /* Initial for fou type */ |
@@ -541,6 +553,7 @@ static struct nla_policy fou_nl_policy[FOU_ATTR_MAX + 1] = { | |||
541 | [FOU_ATTR_AF] = { .type = NLA_U8, }, | 553 | [FOU_ATTR_AF] = { .type = NLA_U8, }, |
542 | [FOU_ATTR_IPPROTO] = { .type = NLA_U8, }, | 554 | [FOU_ATTR_IPPROTO] = { .type = NLA_U8, }, |
543 | [FOU_ATTR_TYPE] = { .type = NLA_U8, }, | 555 | [FOU_ATTR_TYPE] = { .type = NLA_U8, }, |
556 | [FOU_ATTR_REMCSUM_NOPARTIAL] = { .type = NLA_FLAG, }, | ||
544 | }; | 557 | }; |
545 | 558 | ||
546 | static int parse_nl_config(struct genl_info *info, | 559 | static int parse_nl_config(struct genl_info *info, |
@@ -571,6 +584,9 @@ static int parse_nl_config(struct genl_info *info, | |||
571 | if (info->attrs[FOU_ATTR_TYPE]) | 584 | if (info->attrs[FOU_ATTR_TYPE]) |
572 | cfg->type = nla_get_u8(info->attrs[FOU_ATTR_TYPE]); | 585 | cfg->type = nla_get_u8(info->attrs[FOU_ATTR_TYPE]); |
573 | 586 | ||
587 | if (info->attrs[FOU_ATTR_REMCSUM_NOPARTIAL]) | ||
588 | cfg->flags |= FOU_F_REMCSUM_NOPARTIAL; | ||
589 | |||
574 | return 0; | 590 | return 0; |
575 | } | 591 | } |
576 | 592 | ||
diff --git a/net/ipv4/tcp_fastopen.c b/net/ipv4/tcp_fastopen.c index 53db2c309572..ea82fd492c1b 100644 --- a/net/ipv4/tcp_fastopen.c +++ b/net/ipv4/tcp_fastopen.c | |||
@@ -134,6 +134,7 @@ static bool tcp_fastopen_create_child(struct sock *sk, | |||
134 | struct tcp_sock *tp; | 134 | struct tcp_sock *tp; |
135 | struct request_sock_queue *queue = &inet_csk(sk)->icsk_accept_queue; | 135 | struct request_sock_queue *queue = &inet_csk(sk)->icsk_accept_queue; |
136 | struct sock *child; | 136 | struct sock *child; |
137 | u32 end_seq; | ||
137 | 138 | ||
138 | req->num_retrans = 0; | 139 | req->num_retrans = 0; |
139 | req->num_timeout = 0; | 140 | req->num_timeout = 0; |
@@ -185,20 +186,35 @@ static bool tcp_fastopen_create_child(struct sock *sk, | |||
185 | 186 | ||
186 | /* Queue the data carried in the SYN packet. We need to first | 187 | /* Queue the data carried in the SYN packet. We need to first |
187 | * bump skb's refcnt because the caller will attempt to free it. | 188 | * bump skb's refcnt because the caller will attempt to free it. |
189 | * Note that IPv6 might also have used skb_get() trick | ||
190 | * in tcp_v6_conn_request() to keep this SYN around (treq->pktopts) | ||
191 | * So we need to eventually get a clone of the packet, | ||
192 | * before inserting it in sk_receive_queue. | ||
188 | * | 193 | * |
189 | * XXX (TFO) - we honor a zero-payload TFO request for now, | 194 | * XXX (TFO) - we honor a zero-payload TFO request for now, |
190 | * (any reason not to?) but no need to queue the skb since | 195 | * (any reason not to?) but no need to queue the skb since |
191 | * there is no data. How about SYN+FIN? | 196 | * there is no data. How about SYN+FIN? |
192 | */ | 197 | */ |
193 | if (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq + 1) { | 198 | end_seq = TCP_SKB_CB(skb)->end_seq; |
194 | skb = skb_get(skb); | 199 | if (end_seq != TCP_SKB_CB(skb)->seq + 1) { |
195 | skb_dst_drop(skb); | 200 | struct sk_buff *skb2; |
196 | __skb_pull(skb, tcp_hdr(skb)->doff * 4); | 201 | |
197 | skb_set_owner_r(skb, child); | 202 | if (unlikely(skb_shared(skb))) |
198 | __skb_queue_tail(&child->sk_receive_queue, skb); | 203 | skb2 = skb_clone(skb, GFP_ATOMIC); |
199 | tp->syn_data_acked = 1; | 204 | else |
205 | skb2 = skb_get(skb); | ||
206 | |||
207 | if (likely(skb2)) { | ||
208 | skb_dst_drop(skb2); | ||
209 | __skb_pull(skb2, tcp_hdrlen(skb)); | ||
210 | skb_set_owner_r(skb2, child); | ||
211 | __skb_queue_tail(&child->sk_receive_queue, skb2); | ||
212 | tp->syn_data_acked = 1; | ||
213 | } else { | ||
214 | end_seq = TCP_SKB_CB(skb)->seq + 1; | ||
215 | } | ||
200 | } | 216 | } |
201 | tcp_rsk(req)->rcv_nxt = tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq; | 217 | tcp_rsk(req)->rcv_nxt = tp->rcv_nxt = end_seq; |
202 | sk->sk_data_ready(sk); | 218 | sk->sk_data_ready(sk); |
203 | bh_unlock_sock(child); | 219 | bh_unlock_sock(child); |
204 | sock_put(child); | 220 | sock_put(child); |
diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c index d10f6f4ead27..4915d8284a86 100644 --- a/net/ipv4/udp_offload.c +++ b/net/ipv4/udp_offload.c | |||
@@ -402,6 +402,13 @@ int udp_gro_complete(struct sk_buff *skb, int nhoff) | |||
402 | } | 402 | } |
403 | 403 | ||
404 | rcu_read_unlock(); | 404 | rcu_read_unlock(); |
405 | |||
406 | if (skb->remcsum_offload) | ||
407 | skb_shinfo(skb)->gso_type |= SKB_GSO_TUNNEL_REMCSUM; | ||
408 | |||
409 | skb->encapsulation = 1; | ||
410 | skb_set_inner_mac_header(skb, nhoff + sizeof(struct udphdr)); | ||
411 | |||
405 | return err; | 412 | return err; |
406 | } | 413 | } |
407 | 414 | ||
@@ -410,9 +417,13 @@ static int udp4_gro_complete(struct sk_buff *skb, int nhoff) | |||
410 | const struct iphdr *iph = ip_hdr(skb); | 417 | const struct iphdr *iph = ip_hdr(skb); |
411 | struct udphdr *uh = (struct udphdr *)(skb->data + nhoff); | 418 | struct udphdr *uh = (struct udphdr *)(skb->data + nhoff); |
412 | 419 | ||
413 | if (uh->check) | 420 | if (uh->check) { |
421 | skb_shinfo(skb)->gso_type |= SKB_GSO_UDP_TUNNEL_CSUM; | ||
414 | uh->check = ~udp_v4_check(skb->len - nhoff, iph->saddr, | 422 | uh->check = ~udp_v4_check(skb->len - nhoff, iph->saddr, |
415 | iph->daddr, 0); | 423 | iph->daddr, 0); |
424 | } else { | ||
425 | skb_shinfo(skb)->gso_type |= SKB_GSO_UDP_TUNNEL; | ||
426 | } | ||
416 | 427 | ||
417 | return udp_gro_complete(skb, nhoff); | 428 | return udp_gro_complete(skb, nhoff); |
418 | } | 429 | } |
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c index 2f780cba6e12..f45d6db50a45 100644 --- a/net/ipv6/ip6_flowlabel.c +++ b/net/ipv6/ip6_flowlabel.c | |||
@@ -172,7 +172,7 @@ static void __net_exit ip6_fl_purge(struct net *net) | |||
172 | { | 172 | { |
173 | int i; | 173 | int i; |
174 | 174 | ||
175 | spin_lock(&ip6_fl_lock); | 175 | spin_lock_bh(&ip6_fl_lock); |
176 | for (i = 0; i <= FL_HASH_MASK; i++) { | 176 | for (i = 0; i <= FL_HASH_MASK; i++) { |
177 | struct ip6_flowlabel *fl; | 177 | struct ip6_flowlabel *fl; |
178 | struct ip6_flowlabel __rcu **flp; | 178 | struct ip6_flowlabel __rcu **flp; |
@@ -190,7 +190,7 @@ static void __net_exit ip6_fl_purge(struct net *net) | |||
190 | flp = &fl->next; | 190 | flp = &fl->next; |
191 | } | 191 | } |
192 | } | 192 | } |
193 | spin_unlock(&ip6_fl_lock); | 193 | spin_unlock_bh(&ip6_fl_lock); |
194 | } | 194 | } |
195 | 195 | ||
196 | static struct ip6_flowlabel *fl_intern(struct net *net, | 196 | static struct ip6_flowlabel *fl_intern(struct net *net, |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index d33df4cbd872..7deebf102cba 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -1273,7 +1273,7 @@ emsgsize: | |||
1273 | /* If this is the first and only packet and device | 1273 | /* If this is the first and only packet and device |
1274 | * supports checksum offloading, let's use it. | 1274 | * supports checksum offloading, let's use it. |
1275 | */ | 1275 | */ |
1276 | if (!skb && | 1276 | if (!skb && sk->sk_protocol == IPPROTO_UDP && |
1277 | length + fragheaderlen < mtu && | 1277 | length + fragheaderlen < mtu && |
1278 | rt->dst.dev->features & NETIF_F_V6_CSUM && | 1278 | rt->dst.dev->features & NETIF_F_V6_CSUM && |
1279 | !exthdrlen) | 1279 | !exthdrlen) |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 98565ce0ebcd..4688bd4d7f59 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -141,7 +141,7 @@ static u32 *ipv6_cow_metrics(struct dst_entry *dst, unsigned long old) | |||
141 | u32 *p = NULL; | 141 | u32 *p = NULL; |
142 | 142 | ||
143 | if (!(rt->dst.flags & DST_HOST)) | 143 | if (!(rt->dst.flags & DST_HOST)) |
144 | return NULL; | 144 | return dst_cow_metrics_generic(dst, old); |
145 | 145 | ||
146 | peer = rt6_get_peer_create(rt); | 146 | peer = rt6_get_peer_create(rt); |
147 | if (peer) { | 147 | if (peer) { |
diff --git a/net/ipv6/udp_offload.c b/net/ipv6/udp_offload.c index a56276996b72..ab889bb16b3c 100644 --- a/net/ipv6/udp_offload.c +++ b/net/ipv6/udp_offload.c | |||
@@ -161,9 +161,13 @@ static int udp6_gro_complete(struct sk_buff *skb, int nhoff) | |||
161 | const struct ipv6hdr *ipv6h = ipv6_hdr(skb); | 161 | const struct ipv6hdr *ipv6h = ipv6_hdr(skb); |
162 | struct udphdr *uh = (struct udphdr *)(skb->data + nhoff); | 162 | struct udphdr *uh = (struct udphdr *)(skb->data + nhoff); |
163 | 163 | ||
164 | if (uh->check) | 164 | if (uh->check) { |
165 | skb_shinfo(skb)->gso_type |= SKB_GSO_UDP_TUNNEL_CSUM; | ||
165 | uh->check = ~udp_v6_check(skb->len - nhoff, &ipv6h->saddr, | 166 | uh->check = ~udp_v6_check(skb->len - nhoff, &ipv6h->saddr, |
166 | &ipv6h->daddr, 0); | 167 | &ipv6h->daddr, 0); |
168 | } else { | ||
169 | skb_shinfo(skb)->gso_type |= SKB_GSO_UDP_TUNNEL; | ||
170 | } | ||
167 | 171 | ||
168 | return udp_gro_complete(skb, nhoff); | 172 | return udp_gro_complete(skb, nhoff); |
169 | } | 173 | } |
diff --git a/net/netfilter/nft_compat.c b/net/netfilter/nft_compat.c index 265e190f2218..c598f74063a1 100644 --- a/net/netfilter/nft_compat.c +++ b/net/netfilter/nft_compat.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/netfilter/x_tables.h> | 19 | #include <linux/netfilter/x_tables.h> |
20 | #include <linux/netfilter_ipv4/ip_tables.h> | 20 | #include <linux/netfilter_ipv4/ip_tables.h> |
21 | #include <linux/netfilter_ipv6/ip6_tables.h> | 21 | #include <linux/netfilter_ipv6/ip6_tables.h> |
22 | #include <linux/netfilter_bridge/ebtables.h> | ||
22 | #include <net/netfilter/nf_tables.h> | 23 | #include <net/netfilter/nf_tables.h> |
23 | 24 | ||
24 | static int nft_compat_chain_validate_dependency(const char *tablename, | 25 | static int nft_compat_chain_validate_dependency(const char *tablename, |
@@ -40,6 +41,7 @@ static int nft_compat_chain_validate_dependency(const char *tablename, | |||
40 | union nft_entry { | 41 | union nft_entry { |
41 | struct ipt_entry e4; | 42 | struct ipt_entry e4; |
42 | struct ip6t_entry e6; | 43 | struct ip6t_entry e6; |
44 | struct ebt_entry ebt; | ||
43 | }; | 45 | }; |
44 | 46 | ||
45 | static inline void | 47 | static inline void |
@@ -50,9 +52,9 @@ nft_compat_set_par(struct xt_action_param *par, void *xt, const void *xt_info) | |||
50 | par->hotdrop = false; | 52 | par->hotdrop = false; |
51 | } | 53 | } |
52 | 54 | ||
53 | static void nft_target_eval(const struct nft_expr *expr, | 55 | static void nft_target_eval_xt(const struct nft_expr *expr, |
54 | struct nft_data data[NFT_REG_MAX + 1], | 56 | struct nft_data data[NFT_REG_MAX + 1], |
55 | const struct nft_pktinfo *pkt) | 57 | const struct nft_pktinfo *pkt) |
56 | { | 58 | { |
57 | void *info = nft_expr_priv(expr); | 59 | void *info = nft_expr_priv(expr); |
58 | struct xt_target *target = expr->ops->data; | 60 | struct xt_target *target = expr->ops->data; |
@@ -66,7 +68,7 @@ static void nft_target_eval(const struct nft_expr *expr, | |||
66 | if (pkt->xt.hotdrop) | 68 | if (pkt->xt.hotdrop) |
67 | ret = NF_DROP; | 69 | ret = NF_DROP; |
68 | 70 | ||
69 | switch(ret) { | 71 | switch (ret) { |
70 | case XT_CONTINUE: | 72 | case XT_CONTINUE: |
71 | data[NFT_REG_VERDICT].verdict = NFT_CONTINUE; | 73 | data[NFT_REG_VERDICT].verdict = NFT_CONTINUE; |
72 | break; | 74 | break; |
@@ -74,7 +76,41 @@ static void nft_target_eval(const struct nft_expr *expr, | |||
74 | data[NFT_REG_VERDICT].verdict = ret; | 76 | data[NFT_REG_VERDICT].verdict = ret; |
75 | break; | 77 | break; |
76 | } | 78 | } |
77 | return; | 79 | } |
80 | |||
81 | static void nft_target_eval_bridge(const struct nft_expr *expr, | ||
82 | struct nft_data data[NFT_REG_MAX + 1], | ||
83 | const struct nft_pktinfo *pkt) | ||
84 | { | ||
85 | void *info = nft_expr_priv(expr); | ||
86 | struct xt_target *target = expr->ops->data; | ||
87 | struct sk_buff *skb = pkt->skb; | ||
88 | int ret; | ||
89 | |||
90 | nft_compat_set_par((struct xt_action_param *)&pkt->xt, target, info); | ||
91 | |||
92 | ret = target->target(skb, &pkt->xt); | ||
93 | |||
94 | if (pkt->xt.hotdrop) | ||
95 | ret = NF_DROP; | ||
96 | |||
97 | switch (ret) { | ||
98 | case EBT_ACCEPT: | ||
99 | data[NFT_REG_VERDICT].verdict = NF_ACCEPT; | ||
100 | break; | ||
101 | case EBT_DROP: | ||
102 | data[NFT_REG_VERDICT].verdict = NF_DROP; | ||
103 | break; | ||
104 | case EBT_CONTINUE: | ||
105 | data[NFT_REG_VERDICT].verdict = NFT_CONTINUE; | ||
106 | break; | ||
107 | case EBT_RETURN: | ||
108 | data[NFT_REG_VERDICT].verdict = NFT_RETURN; | ||
109 | break; | ||
110 | default: | ||
111 | data[NFT_REG_VERDICT].verdict = ret; | ||
112 | break; | ||
113 | } | ||
78 | } | 114 | } |
79 | 115 | ||
80 | static const struct nla_policy nft_target_policy[NFTA_TARGET_MAX + 1] = { | 116 | static const struct nla_policy nft_target_policy[NFTA_TARGET_MAX + 1] = { |
@@ -100,6 +136,10 @@ nft_target_set_tgchk_param(struct xt_tgchk_param *par, | |||
100 | entry->e6.ipv6.proto = proto; | 136 | entry->e6.ipv6.proto = proto; |
101 | entry->e6.ipv6.invflags = inv ? IP6T_INV_PROTO : 0; | 137 | entry->e6.ipv6.invflags = inv ? IP6T_INV_PROTO : 0; |
102 | break; | 138 | break; |
139 | case NFPROTO_BRIDGE: | ||
140 | entry->ebt.ethproto = proto; | ||
141 | entry->ebt.invflags = inv ? EBT_IPROTO : 0; | ||
142 | break; | ||
103 | } | 143 | } |
104 | par->entryinfo = entry; | 144 | par->entryinfo = entry; |
105 | par->target = target; | 145 | par->target = target; |
@@ -307,6 +347,10 @@ nft_match_set_mtchk_param(struct xt_mtchk_param *par, const struct nft_ctx *ctx, | |||
307 | entry->e6.ipv6.proto = proto; | 347 | entry->e6.ipv6.proto = proto; |
308 | entry->e6.ipv6.invflags = inv ? IP6T_INV_PROTO : 0; | 348 | entry->e6.ipv6.invflags = inv ? IP6T_INV_PROTO : 0; |
309 | break; | 349 | break; |
350 | case NFPROTO_BRIDGE: | ||
351 | entry->ebt.ethproto = proto; | ||
352 | entry->ebt.invflags = inv ? EBT_IPROTO : 0; | ||
353 | break; | ||
310 | } | 354 | } |
311 | par->entryinfo = entry; | 355 | par->entryinfo = entry; |
312 | par->match = match; | 356 | par->match = match; |
@@ -490,6 +534,9 @@ nfnl_compat_get(struct sock *nfnl, struct sk_buff *skb, | |||
490 | case AF_INET6: | 534 | case AF_INET6: |
491 | fmt = "ip6t_%s"; | 535 | fmt = "ip6t_%s"; |
492 | break; | 536 | break; |
537 | case NFPROTO_BRIDGE: | ||
538 | fmt = "ebt_%s"; | ||
539 | break; | ||
493 | default: | 540 | default: |
494 | pr_err("nft_compat: unsupported protocol %d\n", | 541 | pr_err("nft_compat: unsupported protocol %d\n", |
495 | nfmsg->nfgen_family); | 542 | nfmsg->nfgen_family); |
@@ -663,13 +710,17 @@ nft_target_select_ops(const struct nft_ctx *ctx, | |||
663 | 710 | ||
664 | nft_target->ops.type = &nft_target_type; | 711 | nft_target->ops.type = &nft_target_type; |
665 | nft_target->ops.size = NFT_EXPR_SIZE(XT_ALIGN(target->targetsize)); | 712 | nft_target->ops.size = NFT_EXPR_SIZE(XT_ALIGN(target->targetsize)); |
666 | nft_target->ops.eval = nft_target_eval; | ||
667 | nft_target->ops.init = nft_target_init; | 713 | nft_target->ops.init = nft_target_init; |
668 | nft_target->ops.destroy = nft_target_destroy; | 714 | nft_target->ops.destroy = nft_target_destroy; |
669 | nft_target->ops.dump = nft_target_dump; | 715 | nft_target->ops.dump = nft_target_dump; |
670 | nft_target->ops.validate = nft_target_validate; | 716 | nft_target->ops.validate = nft_target_validate; |
671 | nft_target->ops.data = target; | 717 | nft_target->ops.data = target; |
672 | 718 | ||
719 | if (family == NFPROTO_BRIDGE) | ||
720 | nft_target->ops.eval = nft_target_eval_bridge; | ||
721 | else | ||
722 | nft_target->ops.eval = nft_target_eval_xt; | ||
723 | |||
673 | list_add(&nft_target->head, &nft_target_list); | 724 | list_add(&nft_target->head, &nft_target_list); |
674 | 725 | ||
675 | return &nft_target->ops; | 726 | return &nft_target->ops; |
diff --git a/net/netfilter/nft_lookup.c b/net/netfilter/nft_lookup.c index 6404a726d17b..9615b8b9fb37 100644 --- a/net/netfilter/nft_lookup.c +++ b/net/netfilter/nft_lookup.c | |||
@@ -39,6 +39,7 @@ static void nft_lookup_eval(const struct nft_expr *expr, | |||
39 | 39 | ||
40 | static const struct nla_policy nft_lookup_policy[NFTA_LOOKUP_MAX + 1] = { | 40 | static const struct nla_policy nft_lookup_policy[NFTA_LOOKUP_MAX + 1] = { |
41 | [NFTA_LOOKUP_SET] = { .type = NLA_STRING }, | 41 | [NFTA_LOOKUP_SET] = { .type = NLA_STRING }, |
42 | [NFTA_LOOKUP_SET_ID] = { .type = NLA_U32 }, | ||
42 | [NFTA_LOOKUP_SREG] = { .type = NLA_U32 }, | 43 | [NFTA_LOOKUP_SREG] = { .type = NLA_U32 }, |
43 | [NFTA_LOOKUP_DREG] = { .type = NLA_U32 }, | 44 | [NFTA_LOOKUP_DREG] = { .type = NLA_U32 }, |
44 | }; | 45 | }; |
diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c index e2c348b8baca..50ec42f170a0 100644 --- a/net/openvswitch/flow.c +++ b/net/openvswitch/flow.c | |||
@@ -717,6 +717,8 @@ int ovs_flow_key_extract_userspace(const struct nlattr *attr, | |||
717 | { | 717 | { |
718 | int err; | 718 | int err; |
719 | 719 | ||
720 | memset(key, 0, OVS_SW_FLOW_KEY_METADATA_SIZE); | ||
721 | |||
720 | /* Extract metadata from netlink attributes. */ | 722 | /* Extract metadata from netlink attributes. */ |
721 | err = ovs_nla_get_flow_metadata(attr, key, log); | 723 | err = ovs_nla_get_flow_metadata(attr, key, log); |
722 | if (err) | 724 | if (err) |
diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c index 993281e6278d..216f20b90aa5 100644 --- a/net/openvswitch/flow_netlink.c +++ b/net/openvswitch/flow_netlink.c | |||
@@ -1516,7 +1516,7 @@ int ovs_nla_put_identifier(const struct sw_flow *flow, struct sk_buff *skb) | |||
1516 | /* Called with ovs_mutex or RCU read lock. */ | 1516 | /* Called with ovs_mutex or RCU read lock. */ |
1517 | int ovs_nla_put_masked_key(const struct sw_flow *flow, struct sk_buff *skb) | 1517 | int ovs_nla_put_masked_key(const struct sw_flow *flow, struct sk_buff *skb) |
1518 | { | 1518 | { |
1519 | return ovs_nla_put_key(&flow->mask->key, &flow->key, | 1519 | return ovs_nla_put_key(&flow->key, &flow->key, |
1520 | OVS_FLOW_ATTR_KEY, false, skb); | 1520 | OVS_FLOW_ATTR_KEY, false, skb); |
1521 | } | 1521 | } |
1522 | 1522 | ||
@@ -1746,7 +1746,7 @@ static int validate_and_copy_set_tun(const struct nlattr *attr, | |||
1746 | struct sw_flow_key key; | 1746 | struct sw_flow_key key; |
1747 | struct ovs_tunnel_info *tun_info; | 1747 | struct ovs_tunnel_info *tun_info; |
1748 | struct nlattr *a; | 1748 | struct nlattr *a; |
1749 | int err, start, opts_type; | 1749 | int err = 0, start, opts_type; |
1750 | 1750 | ||
1751 | ovs_match_init(&match, &key, NULL); | 1751 | ovs_match_init(&match, &key, NULL); |
1752 | opts_type = ipv4_tun_from_nlattr(nla_data(attr), &match, false, log); | 1752 | opts_type = ipv4_tun_from_nlattr(nla_data(attr), &match, false, log); |
diff --git a/net/rds/cong.c b/net/rds/cong.c index e5b65acd650b..e6144b8246fd 100644 --- a/net/rds/cong.c +++ b/net/rds/cong.c | |||
@@ -221,7 +221,21 @@ void rds_cong_queue_updates(struct rds_cong_map *map) | |||
221 | list_for_each_entry(conn, &map->m_conn_list, c_map_item) { | 221 | list_for_each_entry(conn, &map->m_conn_list, c_map_item) { |
222 | if (!test_and_set_bit(0, &conn->c_map_queued)) { | 222 | if (!test_and_set_bit(0, &conn->c_map_queued)) { |
223 | rds_stats_inc(s_cong_update_queued); | 223 | rds_stats_inc(s_cong_update_queued); |
224 | rds_send_xmit(conn); | 224 | /* We cannot inline the call to rds_send_xmit() here |
225 | * for two reasons (both pertaining to a TCP transport): | ||
226 | * 1. When we get here from the receive path, we | ||
227 | * are already holding the sock_lock (held by | ||
228 | * tcp_v4_rcv()). So inlining calls to | ||
229 | * tcp_setsockopt and/or tcp_sendmsg will deadlock | ||
230 | * when it tries to get the sock_lock()) | ||
231 | * 2. Interrupts are masked so that we can mark the | ||
232 | * the port congested from both send and recv paths. | ||
233 | * (See comment around declaration of rdc_cong_lock). | ||
234 | * An attempt to get the sock_lock() here will | ||
235 | * therefore trigger warnings. | ||
236 | * Defer the xmit to rds_send_worker() instead. | ||
237 | */ | ||
238 | queue_delayed_work(rds_wq, &conn->c_send_w, 0); | ||
225 | } | 239 | } |
226 | } | 240 | } |
227 | 241 | ||