diff options
author | David S. Miller <davem@davemloft.net> | 2013-11-04 13:48:30 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-11-04 13:48:30 -0500 |
commit | 394efd19d5fcae936261bd48e5b33b21897aacf8 (patch) | |
tree | c48cf3ddbb07fd87309f1abdf31a27c71330e587 /drivers/net | |
parent | f421436a591d34fa5279b54a96ac07d70250cc8d (diff) | |
parent | be408cd3e1fef73e9408b196a79b9934697fe3b1 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/ethernet/emulex/benet/be.h
drivers/net/netconsole.c
net/bridge/br_private.h
Three mostly trivial conflicts.
The net/bridge/br_private.h conflict was a function signature (argument
addition) change overlapping with the extern removals from Joe Perches.
In drivers/net/netconsole.c we had one change adjusting a printk message
whilst another changed "printk(KERN_INFO" into "pr_info(".
Lastly, the emulex change was a new inline function addition overlapping
with Joe Perches's extern removals.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/can/c_can/c_can.c | 6 | ||||
-rw-r--r-- | drivers/net/can/usb/kvaser_usb.c | 20 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bgmac.c | 20 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 10 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 16 | ||||
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb3/sge.c | 3 | ||||
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be.h | 10 | ||||
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_main.c | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/ibm/emac/mal.c | 16 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/cmd.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | 7 | ||||
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 6 | ||||
-rw-r--r-- | drivers/net/netconsole.c | 20 | ||||
-rw-r--r-- | drivers/net/usb/ax88179_178a.c | 11 | ||||
-rw-r--r-- | drivers/net/virtio_net.c | 13 | ||||
-rw-r--r-- | drivers/net/wan/sbni.c | 89 | ||||
-rw-r--r-- | drivers/net/xen-netback/common.h | 1 | ||||
-rw-r--r-- | drivers/net/xen-netback/interface.c | 3 | ||||
-rw-r--r-- | drivers/net/xen-netback/netback.c | 10 |
20 files changed, 116 insertions, 159 deletions
diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c index a668cd491cb3..e3fc07cf2f62 100644 --- a/drivers/net/can/c_can/c_can.c +++ b/drivers/net/can/c_can/c_can.c | |||
@@ -814,9 +814,6 @@ static int c_can_do_rx_poll(struct net_device *dev, int quota) | |||
814 | msg_ctrl_save = priv->read_reg(priv, | 814 | msg_ctrl_save = priv->read_reg(priv, |
815 | C_CAN_IFACE(MSGCTRL_REG, 0)); | 815 | C_CAN_IFACE(MSGCTRL_REG, 0)); |
816 | 816 | ||
817 | if (msg_ctrl_save & IF_MCONT_EOB) | ||
818 | return num_rx_pkts; | ||
819 | |||
820 | if (msg_ctrl_save & IF_MCONT_MSGLST) { | 817 | if (msg_ctrl_save & IF_MCONT_MSGLST) { |
821 | c_can_handle_lost_msg_obj(dev, 0, msg_obj); | 818 | c_can_handle_lost_msg_obj(dev, 0, msg_obj); |
822 | num_rx_pkts++; | 819 | num_rx_pkts++; |
@@ -824,6 +821,9 @@ static int c_can_do_rx_poll(struct net_device *dev, int quota) | |||
824 | continue; | 821 | continue; |
825 | } | 822 | } |
826 | 823 | ||
824 | if (msg_ctrl_save & IF_MCONT_EOB) | ||
825 | return num_rx_pkts; | ||
826 | |||
827 | if (!(msg_ctrl_save & IF_MCONT_NEWDAT)) | 827 | if (!(msg_ctrl_save & IF_MCONT_NEWDAT)) |
828 | continue; | 828 | continue; |
829 | 829 | ||
diff --git a/drivers/net/can/usb/kvaser_usb.c b/drivers/net/can/usb/kvaser_usb.c index 3b9546588240..4b2d5ed62b11 100644 --- a/drivers/net/can/usb/kvaser_usb.c +++ b/drivers/net/can/usb/kvaser_usb.c | |||
@@ -1544,9 +1544,9 @@ static int kvaser_usb_init_one(struct usb_interface *intf, | |||
1544 | return 0; | 1544 | return 0; |
1545 | } | 1545 | } |
1546 | 1546 | ||
1547 | static void kvaser_usb_get_endpoints(const struct usb_interface *intf, | 1547 | static int kvaser_usb_get_endpoints(const struct usb_interface *intf, |
1548 | struct usb_endpoint_descriptor **in, | 1548 | struct usb_endpoint_descriptor **in, |
1549 | struct usb_endpoint_descriptor **out) | 1549 | struct usb_endpoint_descriptor **out) |
1550 | { | 1550 | { |
1551 | const struct usb_host_interface *iface_desc; | 1551 | const struct usb_host_interface *iface_desc; |
1552 | struct usb_endpoint_descriptor *endpoint; | 1552 | struct usb_endpoint_descriptor *endpoint; |
@@ -1557,12 +1557,18 @@ static void kvaser_usb_get_endpoints(const struct usb_interface *intf, | |||
1557 | for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) { | 1557 | for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) { |
1558 | endpoint = &iface_desc->endpoint[i].desc; | 1558 | endpoint = &iface_desc->endpoint[i].desc; |
1559 | 1559 | ||
1560 | if (usb_endpoint_is_bulk_in(endpoint)) | 1560 | if (!*in && usb_endpoint_is_bulk_in(endpoint)) |
1561 | *in = endpoint; | 1561 | *in = endpoint; |
1562 | 1562 | ||
1563 | if (usb_endpoint_is_bulk_out(endpoint)) | 1563 | if (!*out && usb_endpoint_is_bulk_out(endpoint)) |
1564 | *out = endpoint; | 1564 | *out = endpoint; |
1565 | |||
1566 | /* use first bulk endpoint for in and out */ | ||
1567 | if (*in && *out) | ||
1568 | return 0; | ||
1565 | } | 1569 | } |
1570 | |||
1571 | return -ENODEV; | ||
1566 | } | 1572 | } |
1567 | 1573 | ||
1568 | static int kvaser_usb_probe(struct usb_interface *intf, | 1574 | static int kvaser_usb_probe(struct usb_interface *intf, |
@@ -1576,8 +1582,8 @@ static int kvaser_usb_probe(struct usb_interface *intf, | |||
1576 | if (!dev) | 1582 | if (!dev) |
1577 | return -ENOMEM; | 1583 | return -ENOMEM; |
1578 | 1584 | ||
1579 | kvaser_usb_get_endpoints(intf, &dev->bulk_in, &dev->bulk_out); | 1585 | err = kvaser_usb_get_endpoints(intf, &dev->bulk_in, &dev->bulk_out); |
1580 | if (!dev->bulk_in || !dev->bulk_out) { | 1586 | if (err) { |
1581 | dev_err(&intf->dev, "Cannot get usb endpoint(s)"); | 1587 | dev_err(&intf->dev, "Cannot get usb endpoint(s)"); |
1582 | return err; | 1588 | return err; |
1583 | } | 1589 | } |
diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c index a98778e3af84..e2aa09ce6af7 100644 --- a/drivers/net/ethernet/broadcom/bgmac.c +++ b/drivers/net/ethernet/broadcom/bgmac.c | |||
@@ -252,25 +252,33 @@ static int bgmac_dma_rx_skb_for_slot(struct bgmac *bgmac, | |||
252 | struct bgmac_slot_info *slot) | 252 | struct bgmac_slot_info *slot) |
253 | { | 253 | { |
254 | struct device *dma_dev = bgmac->core->dma_dev; | 254 | struct device *dma_dev = bgmac->core->dma_dev; |
255 | struct sk_buff *skb; | ||
256 | dma_addr_t dma_addr; | ||
255 | struct bgmac_rx_header *rx; | 257 | struct bgmac_rx_header *rx; |
256 | 258 | ||
257 | /* Alloc skb */ | 259 | /* Alloc skb */ |
258 | slot->skb = netdev_alloc_skb(bgmac->net_dev, BGMAC_RX_BUF_SIZE); | 260 | skb = netdev_alloc_skb(bgmac->net_dev, BGMAC_RX_BUF_SIZE); |
259 | if (!slot->skb) | 261 | if (!skb) |
260 | return -ENOMEM; | 262 | return -ENOMEM; |
261 | 263 | ||
262 | /* Poison - if everything goes fine, hardware will overwrite it */ | 264 | /* Poison - if everything goes fine, hardware will overwrite it */ |
263 | rx = (struct bgmac_rx_header *)slot->skb->data; | 265 | rx = (struct bgmac_rx_header *)skb->data; |
264 | rx->len = cpu_to_le16(0xdead); | 266 | rx->len = cpu_to_le16(0xdead); |
265 | rx->flags = cpu_to_le16(0xbeef); | 267 | rx->flags = cpu_to_le16(0xbeef); |
266 | 268 | ||
267 | /* Map skb for the DMA */ | 269 | /* Map skb for the DMA */ |
268 | slot->dma_addr = dma_map_single(dma_dev, slot->skb->data, | 270 | dma_addr = dma_map_single(dma_dev, skb->data, |
269 | BGMAC_RX_BUF_SIZE, DMA_FROM_DEVICE); | 271 | BGMAC_RX_BUF_SIZE, DMA_FROM_DEVICE); |
270 | if (dma_mapping_error(dma_dev, slot->dma_addr)) { | 272 | if (dma_mapping_error(dma_dev, dma_addr)) { |
271 | bgmac_err(bgmac, "DMA mapping error\n"); | 273 | bgmac_err(bgmac, "DMA mapping error\n"); |
274 | dev_kfree_skb(skb); | ||
272 | return -ENOMEM; | 275 | return -ENOMEM; |
273 | } | 276 | } |
277 | |||
278 | /* Update the slot */ | ||
279 | slot->skb = skb; | ||
280 | slot->dma_addr = dma_addr; | ||
281 | |||
274 | if (slot->dma_addr & 0xC0000000) | 282 | if (slot->dma_addr & 0xC0000000) |
275 | bgmac_warn(bgmac, "DMA address using 0xC0000000 bit(s), it may need translation trick\n"); | 283 | bgmac_warn(bgmac, "DMA address using 0xC0000000 bit(s), it may need translation trick\n"); |
276 | 284 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index 6e46cff5236d..dcafbda3e5be 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |||
@@ -2545,10 +2545,6 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
2545 | } | 2545 | } |
2546 | } | 2546 | } |
2547 | 2547 | ||
2548 | /* Allocated memory for FW statistics */ | ||
2549 | if (bnx2x_alloc_fw_stats_mem(bp)) | ||
2550 | LOAD_ERROR_EXIT(bp, load_error0); | ||
2551 | |||
2552 | /* need to be done after alloc mem, since it's self adjusting to amount | 2548 | /* need to be done after alloc mem, since it's self adjusting to amount |
2553 | * of memory available for RSS queues | 2549 | * of memory available for RSS queues |
2554 | */ | 2550 | */ |
@@ -2558,6 +2554,10 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
2558 | LOAD_ERROR_EXIT(bp, load_error0); | 2554 | LOAD_ERROR_EXIT(bp, load_error0); |
2559 | } | 2555 | } |
2560 | 2556 | ||
2557 | /* Allocated memory for FW statistics */ | ||
2558 | if (bnx2x_alloc_fw_stats_mem(bp)) | ||
2559 | LOAD_ERROR_EXIT(bp, load_error0); | ||
2560 | |||
2561 | /* request pf to initialize status blocks */ | 2561 | /* request pf to initialize status blocks */ |
2562 | if (IS_VF(bp)) { | 2562 | if (IS_VF(bp)) { |
2563 | rc = bnx2x_vfpf_init(bp); | 2563 | rc = bnx2x_vfpf_init(bp); |
@@ -2812,8 +2812,8 @@ load_error1: | |||
2812 | if (IS_PF(bp)) | 2812 | if (IS_PF(bp)) |
2813 | bnx2x_clear_pf_load(bp); | 2813 | bnx2x_clear_pf_load(bp); |
2814 | load_error0: | 2814 | load_error0: |
2815 | bnx2x_free_fp_mem(bp); | ||
2816 | bnx2x_free_fw_stats_mem(bp); | 2815 | bnx2x_free_fw_stats_mem(bp); |
2816 | bnx2x_free_fp_mem(bp); | ||
2817 | bnx2x_free_mem(bp); | 2817 | bnx2x_free_mem(bp); |
2818 | 2818 | ||
2819 | return rc; | 2819 | return rc; |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c index 71fffad94aff..0216d592d0ce 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | |||
@@ -2018,6 +2018,8 @@ failed: | |||
2018 | 2018 | ||
2019 | void bnx2x_iov_remove_one(struct bnx2x *bp) | 2019 | void bnx2x_iov_remove_one(struct bnx2x *bp) |
2020 | { | 2020 | { |
2021 | int vf_idx; | ||
2022 | |||
2021 | /* if SRIOV is not enabled there's nothing to do */ | 2023 | /* if SRIOV is not enabled there's nothing to do */ |
2022 | if (!IS_SRIOV(bp)) | 2024 | if (!IS_SRIOV(bp)) |
2023 | return; | 2025 | return; |
@@ -2026,6 +2028,18 @@ void bnx2x_iov_remove_one(struct bnx2x *bp) | |||
2026 | pci_disable_sriov(bp->pdev); | 2028 | pci_disable_sriov(bp->pdev); |
2027 | DP(BNX2X_MSG_IOV, "sriov disabled\n"); | 2029 | DP(BNX2X_MSG_IOV, "sriov disabled\n"); |
2028 | 2030 | ||
2031 | /* disable access to all VFs */ | ||
2032 | for (vf_idx = 0; vf_idx < bp->vfdb->sriov.total; vf_idx++) { | ||
2033 | bnx2x_pretend_func(bp, | ||
2034 | HW_VF_HANDLE(bp, | ||
2035 | bp->vfdb->sriov.first_vf_in_pf + | ||
2036 | vf_idx)); | ||
2037 | DP(BNX2X_MSG_IOV, "disabling internal access for vf %d\n", | ||
2038 | bp->vfdb->sriov.first_vf_in_pf + vf_idx); | ||
2039 | bnx2x_vf_enable_internal(bp, 0); | ||
2040 | bnx2x_pretend_func(bp, BP_ABS_FUNC(bp)); | ||
2041 | } | ||
2042 | |||
2029 | /* free vf database */ | 2043 | /* free vf database */ |
2030 | __bnx2x_iov_free_vfdb(bp); | 2044 | __bnx2x_iov_free_vfdb(bp); |
2031 | } | 2045 | } |
@@ -3197,7 +3211,7 @@ int bnx2x_enable_sriov(struct bnx2x *bp) | |||
3197 | * the "acquire" messages to appear on the VF PF channel. | 3211 | * the "acquire" messages to appear on the VF PF channel. |
3198 | */ | 3212 | */ |
3199 | DP(BNX2X_MSG_IOV, "about to call enable sriov\n"); | 3213 | DP(BNX2X_MSG_IOV, "about to call enable sriov\n"); |
3200 | pci_disable_sriov(bp->pdev); | 3214 | bnx2x_disable_sriov(bp); |
3201 | rc = pci_enable_sriov(bp->pdev, req_vfs); | 3215 | rc = pci_enable_sriov(bp->pdev, req_vfs); |
3202 | if (rc) { | 3216 | if (rc) { |
3203 | BNX2X_ERR("pci_enable_sriov failed with %d\n", rc); | 3217 | BNX2X_ERR("pci_enable_sriov failed with %d\n", rc); |
diff --git a/drivers/net/ethernet/chelsio/cxgb3/sge.c b/drivers/net/ethernet/chelsio/cxgb3/sge.c index 9c89dc8fe105..632b318eb38a 100644 --- a/drivers/net/ethernet/chelsio/cxgb3/sge.c +++ b/drivers/net/ethernet/chelsio/cxgb3/sge.c | |||
@@ -1599,7 +1599,8 @@ static void write_ofld_wr(struct adapter *adap, struct sk_buff *skb, | |||
1599 | flits = skb_transport_offset(skb) / 8; | 1599 | flits = skb_transport_offset(skb) / 8; |
1600 | sgp = ndesc == 1 ? (struct sg_ent *)&d->flit[flits] : sgl; | 1600 | sgp = ndesc == 1 ? (struct sg_ent *)&d->flit[flits] : sgl; |
1601 | sgl_flits = make_sgl(skb, sgp, skb_transport_header(skb), | 1601 | sgl_flits = make_sgl(skb, sgp, skb_transport_header(skb), |
1602 | skb->tail - skb->transport_header, | 1602 | skb_tail_pointer(skb) - |
1603 | skb_transport_header(skb), | ||
1603 | adap->pdev); | 1604 | adap->pdev); |
1604 | if (need_skb_unmap()) { | 1605 | if (need_skb_unmap()) { |
1605 | setup_deferred_unmapping(skb, adap->pdev, sgp, sgl_flits); | 1606 | setup_deferred_unmapping(skb, adap->pdev, sgp, sgl_flits); |
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h index 2c88ac295eea..f4825db5d179 100644 --- a/drivers/net/ethernet/emulex/benet/be.h +++ b/drivers/net/ethernet/emulex/benet/be.h | |||
@@ -840,6 +840,16 @@ int be_load_fw(struct be_adapter *adapter, u8 *func); | |||
840 | bool be_is_wol_supported(struct be_adapter *adapter); | 840 | bool be_is_wol_supported(struct be_adapter *adapter); |
841 | bool be_pause_supported(struct be_adapter *adapter); | 841 | bool be_pause_supported(struct be_adapter *adapter); |
842 | u32 be_get_fw_log_level(struct be_adapter *adapter); | 842 | u32 be_get_fw_log_level(struct be_adapter *adapter); |
843 | |||
844 | static inline int fw_major_num(const char *fw_ver) | ||
845 | { | ||
846 | int fw_major = 0; | ||
847 | |||
848 | sscanf(fw_ver, "%d.", &fw_major); | ||
849 | |||
850 | return fw_major; | ||
851 | } | ||
852 | |||
843 | int be_update_queues(struct be_adapter *adapter); | 853 | int be_update_queues(struct be_adapter *adapter); |
844 | int be_poll(struct napi_struct *napi, int budget); | 854 | int be_poll(struct napi_struct *napi, int budget); |
845 | 855 | ||
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 8080a1a5cee7..741d3bff5ae7 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -3379,6 +3379,12 @@ static int be_setup(struct be_adapter *adapter) | |||
3379 | 3379 | ||
3380 | be_cmd_get_fw_ver(adapter, adapter->fw_ver, adapter->fw_on_flash); | 3380 | be_cmd_get_fw_ver(adapter, adapter->fw_ver, adapter->fw_on_flash); |
3381 | 3381 | ||
3382 | if (BE2_chip(adapter) && fw_major_num(adapter->fw_ver) < 4) { | ||
3383 | dev_err(dev, "Firmware on card is old(%s), IRQs may not work.", | ||
3384 | adapter->fw_ver); | ||
3385 | dev_err(dev, "Please upgrade firmware to version >= 4.0\n"); | ||
3386 | } | ||
3387 | |||
3382 | if (adapter->vlans_added) | 3388 | if (adapter->vlans_added) |
3383 | be_vid_config(adapter); | 3389 | be_vid_config(adapter); |
3384 | 3390 | ||
diff --git a/drivers/net/ethernet/ibm/emac/mal.c b/drivers/net/ethernet/ibm/emac/mal.c index dac564c25440..e7847510eda2 100644 --- a/drivers/net/ethernet/ibm/emac/mal.c +++ b/drivers/net/ethernet/ibm/emac/mal.c | |||
@@ -263,7 +263,9 @@ static inline void mal_schedule_poll(struct mal_instance *mal) | |||
263 | { | 263 | { |
264 | if (likely(napi_schedule_prep(&mal->napi))) { | 264 | if (likely(napi_schedule_prep(&mal->napi))) { |
265 | MAL_DBG2(mal, "schedule_poll" NL); | 265 | MAL_DBG2(mal, "schedule_poll" NL); |
266 | spin_lock(&mal->lock); | ||
266 | mal_disable_eob_irq(mal); | 267 | mal_disable_eob_irq(mal); |
268 | spin_unlock(&mal->lock); | ||
267 | __napi_schedule(&mal->napi); | 269 | __napi_schedule(&mal->napi); |
268 | } else | 270 | } else |
269 | MAL_DBG2(mal, "already in poll" NL); | 271 | MAL_DBG2(mal, "already in poll" NL); |
@@ -442,15 +444,13 @@ static int mal_poll(struct napi_struct *napi, int budget) | |||
442 | if (unlikely(mc->ops->peek_rx(mc->dev) || | 444 | if (unlikely(mc->ops->peek_rx(mc->dev) || |
443 | test_bit(MAL_COMMAC_RX_STOPPED, &mc->flags))) { | 445 | test_bit(MAL_COMMAC_RX_STOPPED, &mc->flags))) { |
444 | MAL_DBG2(mal, "rotting packet" NL); | 446 | MAL_DBG2(mal, "rotting packet" NL); |
445 | if (napi_reschedule(napi)) | 447 | if (!napi_reschedule(napi)) |
446 | mal_disable_eob_irq(mal); | ||
447 | else | ||
448 | MAL_DBG2(mal, "already in poll list" NL); | ||
449 | |||
450 | if (budget > 0) | ||
451 | goto again; | ||
452 | else | ||
453 | goto more_work; | 448 | goto more_work; |
449 | |||
450 | spin_lock_irqsave(&mal->lock, flags); | ||
451 | mal_disable_eob_irq(mal); | ||
452 | spin_unlock_irqrestore(&mal->lock, flags); | ||
453 | goto again; | ||
454 | } | 454 | } |
455 | mc->ops->poll_tx(mc->dev); | 455 | mc->ops->poll_tx(mc->dev); |
456 | } | 456 | } |
diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c index 735765c21c95..ae8eb4c4fb6c 100644 --- a/drivers/net/ethernet/mellanox/mlx4/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c | |||
@@ -1691,7 +1691,7 @@ static void mlx4_master_deactivate_admin_state(struct mlx4_priv *priv, int slave | |||
1691 | vp_oper->vlan_idx = NO_INDX; | 1691 | vp_oper->vlan_idx = NO_INDX; |
1692 | } | 1692 | } |
1693 | if (NO_INDX != vp_oper->mac_idx) { | 1693 | if (NO_INDX != vp_oper->mac_idx) { |
1694 | __mlx4_unregister_mac(&priv->dev, port, vp_oper->mac_idx); | 1694 | __mlx4_unregister_mac(&priv->dev, port, vp_oper->state.mac); |
1695 | vp_oper->mac_idx = NO_INDX; | 1695 | vp_oper->mac_idx = NO_INDX; |
1696 | } | 1696 | } |
1697 | } | 1697 | } |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c index a126bdf27952..a44b9395b37a 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | |||
@@ -2276,9 +2276,9 @@ int qlcnic_83xx_get_nic_info(struct qlcnic_adapter *adapter, | |||
2276 | temp = (cmd.rsp.arg[8] & 0x7FFE0000) >> 17; | 2276 | temp = (cmd.rsp.arg[8] & 0x7FFE0000) >> 17; |
2277 | npar_info->max_linkspeed_reg_offset = temp; | 2277 | npar_info->max_linkspeed_reg_offset = temp; |
2278 | } | 2278 | } |
2279 | if (npar_info->capabilities & QLCNIC_FW_CAPABILITY_MORE_CAPS) | 2279 | |
2280 | memcpy(ahw->extra_capability, &cmd.rsp.arg[16], | 2280 | memcpy(ahw->extra_capability, &cmd.rsp.arg[16], |
2281 | sizeof(ahw->extra_capability)); | 2281 | sizeof(ahw->extra_capability)); |
2282 | 2282 | ||
2283 | out: | 2283 | out: |
2284 | qlcnic_free_mbx_args(&cmd); | 2284 | qlcnic_free_mbx_args(&cmd); |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c index 73e72eb83bdf..6f7f60c09f07 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | |||
@@ -785,8 +785,6 @@ void qlcnic_82xx_config_intr_coalesce(struct qlcnic_adapter *adapter) | |||
785 | 785 | ||
786 | #define QLCNIC_ENABLE_IPV4_LRO 1 | 786 | #define QLCNIC_ENABLE_IPV4_LRO 1 |
787 | #define QLCNIC_ENABLE_IPV6_LRO 2 | 787 | #define QLCNIC_ENABLE_IPV6_LRO 2 |
788 | #define QLCNIC_NO_DEST_IPV4_CHECK (1 << 8) | ||
789 | #define QLCNIC_NO_DEST_IPV6_CHECK (2 << 8) | ||
790 | 788 | ||
791 | int qlcnic_82xx_config_hw_lro(struct qlcnic_adapter *adapter, int enable) | 789 | int qlcnic_82xx_config_hw_lro(struct qlcnic_adapter *adapter, int enable) |
792 | { | 790 | { |
@@ -806,11 +804,10 @@ int qlcnic_82xx_config_hw_lro(struct qlcnic_adapter *adapter, int enable) | |||
806 | 804 | ||
807 | word = 0; | 805 | word = 0; |
808 | if (enable) { | 806 | if (enable) { |
809 | word = QLCNIC_ENABLE_IPV4_LRO | QLCNIC_NO_DEST_IPV4_CHECK; | 807 | word = QLCNIC_ENABLE_IPV4_LRO; |
810 | if (adapter->ahw->extra_capability[0] & | 808 | if (adapter->ahw->extra_capability[0] & |
811 | QLCNIC_FW_CAP2_HW_LRO_IPV6) | 809 | QLCNIC_FW_CAP2_HW_LRO_IPV6) |
812 | word |= QLCNIC_ENABLE_IPV6_LRO | | 810 | word |= QLCNIC_ENABLE_IPV6_LRO; |
813 | QLCNIC_NO_DEST_IPV6_CHECK; | ||
814 | } | 811 | } |
815 | 812 | ||
816 | req.words[0] = cpu_to_le64(word); | 813 | req.words[0] = cpu_to_le64(word); |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index dcf4a4e7ce23..b97e4a0079d1 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | |||
@@ -1133,7 +1133,10 @@ qlcnic_initialize_nic(struct qlcnic_adapter *adapter) | |||
1133 | if (err == -EIO) | 1133 | if (err == -EIO) |
1134 | return err; | 1134 | return err; |
1135 | adapter->ahw->extra_capability[0] = temp; | 1135 | adapter->ahw->extra_capability[0] = temp; |
1136 | } else { | ||
1137 | adapter->ahw->extra_capability[0] = 0; | ||
1136 | } | 1138 | } |
1139 | |||
1137 | adapter->ahw->max_mac_filters = nic_info.max_mac_filters; | 1140 | adapter->ahw->max_mac_filters = nic_info.max_mac_filters; |
1138 | adapter->ahw->max_mtu = nic_info.max_mtu; | 1141 | adapter->ahw->max_mtu = nic_info.max_mtu; |
1139 | 1142 | ||
@@ -2161,8 +2164,7 @@ void qlcnic_set_drv_version(struct qlcnic_adapter *adapter) | |||
2161 | else if (qlcnic_83xx_check(adapter)) | 2164 | else if (qlcnic_83xx_check(adapter)) |
2162 | fw_cmd = QLCNIC_CMD_83XX_SET_DRV_VER; | 2165 | fw_cmd = QLCNIC_CMD_83XX_SET_DRV_VER; |
2163 | 2166 | ||
2164 | if ((ahw->capabilities & QLCNIC_FW_CAPABILITY_MORE_CAPS) && | 2167 | if (ahw->extra_capability[0] & QLCNIC_FW_CAPABILITY_SET_DRV_VER) |
2165 | (ahw->extra_capability[0] & QLCNIC_FW_CAPABILITY_SET_DRV_VER)) | ||
2166 | qlcnic_fw_cmd_set_drv_version(adapter, fw_cmd); | 2168 | qlcnic_fw_cmd_set_drv_version(adapter, fw_cmd); |
2167 | } | 2169 | } |
2168 | 2170 | ||
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index a8ef4c4b94be..ba2f5e710af1 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c | |||
@@ -312,6 +312,7 @@ static ssize_t store_enabled(struct netconsole_target *nt, | |||
312 | const char *buf, | 312 | const char *buf, |
313 | size_t count) | 313 | size_t count) |
314 | { | 314 | { |
315 | unsigned long flags; | ||
315 | int enabled; | 316 | int enabled; |
316 | int err; | 317 | int err; |
317 | 318 | ||
@@ -326,9 +327,7 @@ static ssize_t store_enabled(struct netconsole_target *nt, | |||
326 | return -EINVAL; | 327 | return -EINVAL; |
327 | } | 328 | } |
328 | 329 | ||
329 | mutex_lock(&nt->mutex); | ||
330 | if (enabled) { /* 1 */ | 330 | if (enabled) { /* 1 */ |
331 | |||
332 | /* | 331 | /* |
333 | * Skip netpoll_parse_options() -- all the attributes are | 332 | * Skip netpoll_parse_options() -- all the attributes are |
334 | * already configured via configfs. Just print them out. | 333 | * already configured via configfs. Just print them out. |
@@ -336,19 +335,22 @@ static ssize_t store_enabled(struct netconsole_target *nt, | |||
336 | netpoll_print_options(&nt->np); | 335 | netpoll_print_options(&nt->np); |
337 | 336 | ||
338 | err = netpoll_setup(&nt->np); | 337 | err = netpoll_setup(&nt->np); |
339 | if (err) { | 338 | if (err) |
340 | mutex_unlock(&nt->mutex); | ||
341 | return err; | 339 | return err; |
342 | } | ||
343 | |||
344 | pr_info("network logging started\n"); | ||
345 | 340 | ||
341 | pr_info("netconsole: network logging started\n"); | ||
346 | } else { /* 0 */ | 342 | } else { /* 0 */ |
343 | /* We need to disable the netconsole before cleaning it up | ||
344 | * otherwise we might end up in write_msg() with | ||
345 | * nt->np.dev == NULL and nt->enabled == 1 | ||
346 | */ | ||
347 | spin_lock_irqsave(&target_list_lock, flags); | ||
348 | nt->enabled = 0; | ||
349 | spin_unlock_irqrestore(&target_list_lock, flags); | ||
347 | netpoll_cleanup(&nt->np); | 350 | netpoll_cleanup(&nt->np); |
348 | } | 351 | } |
349 | 352 | ||
350 | nt->enabled = enabled; | 353 | nt->enabled = enabled; |
351 | mutex_unlock(&nt->mutex); | ||
352 | 354 | ||
353 | return strnlen(buf, count); | 355 | return strnlen(buf, count); |
354 | } | 356 | } |
@@ -559,8 +561,10 @@ static ssize_t netconsole_target_attr_store(struct config_item *item, | |||
559 | struct netconsole_target_attr *na = | 561 | struct netconsole_target_attr *na = |
560 | container_of(attr, struct netconsole_target_attr, attr); | 562 | container_of(attr, struct netconsole_target_attr, attr); |
561 | 563 | ||
564 | mutex_lock(&nt->mutex); | ||
562 | if (na->store) | 565 | if (na->store) |
563 | ret = na->store(nt, buf, count); | 566 | ret = na->store(nt, buf, count); |
567 | mutex_unlock(&nt->mutex); | ||
564 | 568 | ||
565 | return ret; | 569 | return ret; |
566 | } | 570 | } |
diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c index 846cc19c04f2..8e8d0fcd4979 100644 --- a/drivers/net/usb/ax88179_178a.c +++ b/drivers/net/usb/ax88179_178a.c | |||
@@ -78,7 +78,6 @@ | |||
78 | #define AX_MEDIUM_STATUS_MODE 0x22 | 78 | #define AX_MEDIUM_STATUS_MODE 0x22 |
79 | #define AX_MEDIUM_GIGAMODE 0x01 | 79 | #define AX_MEDIUM_GIGAMODE 0x01 |
80 | #define AX_MEDIUM_FULL_DUPLEX 0x02 | 80 | #define AX_MEDIUM_FULL_DUPLEX 0x02 |
81 | #define AX_MEDIUM_ALWAYS_ONE 0x04 | ||
82 | #define AX_MEDIUM_EN_125MHZ 0x08 | 81 | #define AX_MEDIUM_EN_125MHZ 0x08 |
83 | #define AX_MEDIUM_RXFLOW_CTRLEN 0x10 | 82 | #define AX_MEDIUM_RXFLOW_CTRLEN 0x10 |
84 | #define AX_MEDIUM_TXFLOW_CTRLEN 0x20 | 83 | #define AX_MEDIUM_TXFLOW_CTRLEN 0x20 |
@@ -1065,8 +1064,8 @@ static int ax88179_bind(struct usbnet *dev, struct usb_interface *intf) | |||
1065 | 1064 | ||
1066 | /* Configure default medium type => giga */ | 1065 | /* Configure default medium type => giga */ |
1067 | *tmp16 = AX_MEDIUM_RECEIVE_EN | AX_MEDIUM_TXFLOW_CTRLEN | | 1066 | *tmp16 = AX_MEDIUM_RECEIVE_EN | AX_MEDIUM_TXFLOW_CTRLEN | |
1068 | AX_MEDIUM_RXFLOW_CTRLEN | AX_MEDIUM_ALWAYS_ONE | | 1067 | AX_MEDIUM_RXFLOW_CTRLEN | AX_MEDIUM_FULL_DUPLEX | |
1069 | AX_MEDIUM_FULL_DUPLEX | AX_MEDIUM_GIGAMODE; | 1068 | AX_MEDIUM_GIGAMODE; |
1070 | ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_MEDIUM_STATUS_MODE, | 1069 | ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_MEDIUM_STATUS_MODE, |
1071 | 2, 2, tmp16); | 1070 | 2, 2, tmp16); |
1072 | 1071 | ||
@@ -1225,7 +1224,7 @@ static int ax88179_link_reset(struct usbnet *dev) | |||
1225 | } | 1224 | } |
1226 | 1225 | ||
1227 | mode = AX_MEDIUM_RECEIVE_EN | AX_MEDIUM_TXFLOW_CTRLEN | | 1226 | mode = AX_MEDIUM_RECEIVE_EN | AX_MEDIUM_TXFLOW_CTRLEN | |
1228 | AX_MEDIUM_RXFLOW_CTRLEN | AX_MEDIUM_ALWAYS_ONE; | 1227 | AX_MEDIUM_RXFLOW_CTRLEN; |
1229 | 1228 | ||
1230 | ax88179_read_cmd(dev, AX_ACCESS_MAC, PHYSICAL_LINK_STATUS, | 1229 | ax88179_read_cmd(dev, AX_ACCESS_MAC, PHYSICAL_LINK_STATUS, |
1231 | 1, 1, &link_sts); | 1230 | 1, 1, &link_sts); |
@@ -1339,8 +1338,8 @@ static int ax88179_reset(struct usbnet *dev) | |||
1339 | 1338 | ||
1340 | /* Configure default medium type => giga */ | 1339 | /* Configure default medium type => giga */ |
1341 | *tmp16 = AX_MEDIUM_RECEIVE_EN | AX_MEDIUM_TXFLOW_CTRLEN | | 1340 | *tmp16 = AX_MEDIUM_RECEIVE_EN | AX_MEDIUM_TXFLOW_CTRLEN | |
1342 | AX_MEDIUM_RXFLOW_CTRLEN | AX_MEDIUM_ALWAYS_ONE | | 1341 | AX_MEDIUM_RXFLOW_CTRLEN | AX_MEDIUM_FULL_DUPLEX | |
1343 | AX_MEDIUM_FULL_DUPLEX | AX_MEDIUM_GIGAMODE; | 1342 | AX_MEDIUM_GIGAMODE; |
1344 | ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_MEDIUM_STATUS_MODE, | 1343 | ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_MEDIUM_STATUS_MODE, |
1345 | 2, 2, tmp16); | 1344 | 2, 2, tmp16); |
1346 | 1345 | ||
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 113ee93dbb2e..656a02e28e26 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -1160,11 +1160,6 @@ static int virtnet_cpu_callback(struct notifier_block *nfb, | |||
1160 | { | 1160 | { |
1161 | struct virtnet_info *vi = container_of(nfb, struct virtnet_info, nb); | 1161 | struct virtnet_info *vi = container_of(nfb, struct virtnet_info, nb); |
1162 | 1162 | ||
1163 | mutex_lock(&vi->config_lock); | ||
1164 | |||
1165 | if (!vi->config_enable) | ||
1166 | goto done; | ||
1167 | |||
1168 | switch(action & ~CPU_TASKS_FROZEN) { | 1163 | switch(action & ~CPU_TASKS_FROZEN) { |
1169 | case CPU_ONLINE: | 1164 | case CPU_ONLINE: |
1170 | case CPU_DOWN_FAILED: | 1165 | case CPU_DOWN_FAILED: |
@@ -1178,8 +1173,6 @@ static int virtnet_cpu_callback(struct notifier_block *nfb, | |||
1178 | break; | 1173 | break; |
1179 | } | 1174 | } |
1180 | 1175 | ||
1181 | done: | ||
1182 | mutex_unlock(&vi->config_lock); | ||
1183 | return NOTIFY_OK; | 1176 | return NOTIFY_OK; |
1184 | } | 1177 | } |
1185 | 1178 | ||
@@ -1747,6 +1740,8 @@ static int virtnet_freeze(struct virtio_device *vdev) | |||
1747 | struct virtnet_info *vi = vdev->priv; | 1740 | struct virtnet_info *vi = vdev->priv; |
1748 | int i; | 1741 | int i; |
1749 | 1742 | ||
1743 | unregister_hotcpu_notifier(&vi->nb); | ||
1744 | |||
1750 | /* Prevent config work handler from accessing the device */ | 1745 | /* Prevent config work handler from accessing the device */ |
1751 | mutex_lock(&vi->config_lock); | 1746 | mutex_lock(&vi->config_lock); |
1752 | vi->config_enable = false; | 1747 | vi->config_enable = false; |
@@ -1795,6 +1790,10 @@ static int virtnet_restore(struct virtio_device *vdev) | |||
1795 | virtnet_set_queues(vi, vi->curr_queue_pairs); | 1790 | virtnet_set_queues(vi, vi->curr_queue_pairs); |
1796 | rtnl_unlock(); | 1791 | rtnl_unlock(); |
1797 | 1792 | ||
1793 | err = register_hotcpu_notifier(&vi->nb); | ||
1794 | if (err) | ||
1795 | return err; | ||
1796 | |||
1798 | return 0; | 1797 | return 0; |
1799 | } | 1798 | } |
1800 | #endif | 1799 | #endif |
diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c index 5bbcb5e3ee0c..388ddf60a66d 100644 --- a/drivers/net/wan/sbni.c +++ b/drivers/net/wan/sbni.c | |||
@@ -148,10 +148,6 @@ static int enslave( struct net_device *, struct net_device * ); | |||
148 | static int emancipate( struct net_device * ); | 148 | static int emancipate( struct net_device * ); |
149 | #endif | 149 | #endif |
150 | 150 | ||
151 | #ifdef __i386__ | ||
152 | #define ASM_CRC 1 | ||
153 | #endif | ||
154 | |||
155 | static const char version[] = | 151 | static const char version[] = |
156 | "Granch SBNI12 driver ver 5.0.1 Jun 22 2001 Denis I.Timofeev.\n"; | 152 | "Granch SBNI12 driver ver 5.0.1 Jun 22 2001 Denis I.Timofeev.\n"; |
157 | 153 | ||
@@ -1551,88 +1547,6 @@ __setup( "sbni=", sbni_setup ); | |||
1551 | 1547 | ||
1552 | /* -------------------------------------------------------------------------- */ | 1548 | /* -------------------------------------------------------------------------- */ |
1553 | 1549 | ||
1554 | #ifdef ASM_CRC | ||
1555 | |||
1556 | static u32 | ||
1557 | calc_crc32( u32 crc, u8 *p, u32 len ) | ||
1558 | { | ||
1559 | register u32 _crc; | ||
1560 | _crc = crc; | ||
1561 | |||
1562 | __asm__ __volatile__ ( | ||
1563 | "xorl %%ebx, %%ebx\n" | ||
1564 | "movl %2, %%esi\n" | ||
1565 | "movl %3, %%ecx\n" | ||
1566 | "movl $crc32tab, %%edi\n" | ||
1567 | "shrl $2, %%ecx\n" | ||
1568 | "jz 1f\n" | ||
1569 | |||
1570 | ".align 4\n" | ||
1571 | "0:\n" | ||
1572 | "movb %%al, %%bl\n" | ||
1573 | "movl (%%esi), %%edx\n" | ||
1574 | "shrl $8, %%eax\n" | ||
1575 | "xorb %%dl, %%bl\n" | ||
1576 | "shrl $8, %%edx\n" | ||
1577 | "xorl (%%edi,%%ebx,4), %%eax\n" | ||
1578 | |||
1579 | "movb %%al, %%bl\n" | ||
1580 | "shrl $8, %%eax\n" | ||
1581 | "xorb %%dl, %%bl\n" | ||
1582 | "shrl $8, %%edx\n" | ||
1583 | "xorl (%%edi,%%ebx,4), %%eax\n" | ||
1584 | |||
1585 | "movb %%al, %%bl\n" | ||
1586 | "shrl $8, %%eax\n" | ||
1587 | "xorb %%dl, %%bl\n" | ||
1588 | "movb %%dh, %%dl\n" | ||
1589 | "xorl (%%edi,%%ebx,4), %%eax\n" | ||
1590 | |||
1591 | "movb %%al, %%bl\n" | ||
1592 | "shrl $8, %%eax\n" | ||
1593 | "xorb %%dl, %%bl\n" | ||
1594 | "addl $4, %%esi\n" | ||
1595 | "xorl (%%edi,%%ebx,4), %%eax\n" | ||
1596 | |||
1597 | "decl %%ecx\n" | ||
1598 | "jnz 0b\n" | ||
1599 | |||
1600 | "1:\n" | ||
1601 | "movl %3, %%ecx\n" | ||
1602 | "andl $3, %%ecx\n" | ||
1603 | "jz 2f\n" | ||
1604 | |||
1605 | "movb %%al, %%bl\n" | ||
1606 | "shrl $8, %%eax\n" | ||
1607 | "xorb (%%esi), %%bl\n" | ||
1608 | "xorl (%%edi,%%ebx,4), %%eax\n" | ||
1609 | |||
1610 | "decl %%ecx\n" | ||
1611 | "jz 2f\n" | ||
1612 | |||
1613 | "movb %%al, %%bl\n" | ||
1614 | "shrl $8, %%eax\n" | ||
1615 | "xorb 1(%%esi), %%bl\n" | ||
1616 | "xorl (%%edi,%%ebx,4), %%eax\n" | ||
1617 | |||
1618 | "decl %%ecx\n" | ||
1619 | "jz 2f\n" | ||
1620 | |||
1621 | "movb %%al, %%bl\n" | ||
1622 | "shrl $8, %%eax\n" | ||
1623 | "xorb 2(%%esi), %%bl\n" | ||
1624 | "xorl (%%edi,%%ebx,4), %%eax\n" | ||
1625 | "2:\n" | ||
1626 | : "=a" (_crc) | ||
1627 | : "0" (_crc), "g" (p), "g" (len) | ||
1628 | : "bx", "cx", "dx", "si", "di" | ||
1629 | ); | ||
1630 | |||
1631 | return _crc; | ||
1632 | } | ||
1633 | |||
1634 | #else /* ASM_CRC */ | ||
1635 | |||
1636 | static u32 | 1550 | static u32 |
1637 | calc_crc32( u32 crc, u8 *p, u32 len ) | 1551 | calc_crc32( u32 crc, u8 *p, u32 len ) |
1638 | { | 1552 | { |
@@ -1642,9 +1556,6 @@ calc_crc32( u32 crc, u8 *p, u32 len ) | |||
1642 | return crc; | 1556 | return crc; |
1643 | } | 1557 | } |
1644 | 1558 | ||
1645 | #endif /* ASM_CRC */ | ||
1646 | |||
1647 | |||
1648 | static u32 crc32tab[] __attribute__ ((aligned(8))) = { | 1559 | static u32 crc32tab[] __attribute__ ((aligned(8))) = { |
1649 | 0xD202EF8D, 0xA505DF1B, 0x3C0C8EA1, 0x4B0BBE37, | 1560 | 0xD202EF8D, 0xA505DF1B, 0x3C0C8EA1, 0x4B0BBE37, |
1650 | 0xD56F2B94, 0xA2681B02, 0x3B614AB8, 0x4C667A2E, | 1561 | 0xD56F2B94, 0xA2681B02, 0x3B614AB8, 0x4C667A2E, |
diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h index 55b8dec86233..08ae01b41c83 100644 --- a/drivers/net/xen-netback/common.h +++ b/drivers/net/xen-netback/common.h | |||
@@ -169,6 +169,7 @@ struct xenvif { | |||
169 | unsigned long credit_usec; | 169 | unsigned long credit_usec; |
170 | unsigned long remaining_credit; | 170 | unsigned long remaining_credit; |
171 | struct timer_list credit_timeout; | 171 | struct timer_list credit_timeout; |
172 | u64 credit_window_start; | ||
172 | 173 | ||
173 | /* Statistics */ | 174 | /* Statistics */ |
174 | unsigned long rx_gso_checksum_fixup; | 175 | unsigned long rx_gso_checksum_fixup; |
diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c index e4aa26748f80..b78ee10a956a 100644 --- a/drivers/net/xen-netback/interface.c +++ b/drivers/net/xen-netback/interface.c | |||
@@ -316,8 +316,7 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid, | |||
316 | vif->credit_bytes = vif->remaining_credit = ~0UL; | 316 | vif->credit_bytes = vif->remaining_credit = ~0UL; |
317 | vif->credit_usec = 0UL; | 317 | vif->credit_usec = 0UL; |
318 | init_timer(&vif->credit_timeout); | 318 | init_timer(&vif->credit_timeout); |
319 | /* Initialize 'expires' now: it's used to track the credit window. */ | 319 | vif->credit_window_start = get_jiffies_64(); |
320 | vif->credit_timeout.expires = jiffies; | ||
321 | 320 | ||
322 | dev->netdev_ops = &xenvif_netdev_ops; | 321 | dev->netdev_ops = &xenvif_netdev_ops; |
323 | dev->hw_features = NETIF_F_SG | | 322 | dev->hw_features = NETIF_F_SG | |
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c index 828fdab4f1a4..919b6509455c 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c | |||
@@ -1380,9 +1380,8 @@ static int checksum_setup(struct xenvif *vif, struct sk_buff *skb) | |||
1380 | 1380 | ||
1381 | static bool tx_credit_exceeded(struct xenvif *vif, unsigned size) | 1381 | static bool tx_credit_exceeded(struct xenvif *vif, unsigned size) |
1382 | { | 1382 | { |
1383 | unsigned long now = jiffies; | 1383 | u64 now = get_jiffies_64(); |
1384 | unsigned long next_credit = | 1384 | u64 next_credit = vif->credit_window_start + |
1385 | vif->credit_timeout.expires + | ||
1386 | msecs_to_jiffies(vif->credit_usec / 1000); | 1385 | msecs_to_jiffies(vif->credit_usec / 1000); |
1387 | 1386 | ||
1388 | /* Timer could already be pending in rare cases. */ | 1387 | /* Timer could already be pending in rare cases. */ |
@@ -1390,8 +1389,8 @@ static bool tx_credit_exceeded(struct xenvif *vif, unsigned size) | |||
1390 | return true; | 1389 | return true; |
1391 | 1390 | ||
1392 | /* Passed the point where we can replenish credit? */ | 1391 | /* Passed the point where we can replenish credit? */ |
1393 | if (time_after_eq(now, next_credit)) { | 1392 | if (time_after_eq64(now, next_credit)) { |
1394 | vif->credit_timeout.expires = now; | 1393 | vif->credit_window_start = now; |
1395 | tx_add_credit(vif); | 1394 | tx_add_credit(vif); |
1396 | } | 1395 | } |
1397 | 1396 | ||
@@ -1403,6 +1402,7 @@ static bool tx_credit_exceeded(struct xenvif *vif, unsigned size) | |||
1403 | tx_credit_callback; | 1402 | tx_credit_callback; |
1404 | mod_timer(&vif->credit_timeout, | 1403 | mod_timer(&vif->credit_timeout, |
1405 | next_credit); | 1404 | next_credit); |
1405 | vif->credit_window_start = next_credit; | ||
1406 | 1406 | ||
1407 | return true; | 1407 | return true; |
1408 | } | 1408 | } |