History

Merge tag 'net-5.17-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

Pull networking fixes from Jakub Kicinski: "Including fixes from bluetooth, and ipsec. Current release - regressions: - Bluetooth: fix unbalanced unlock in set_device_flags() - Bluetooth: fix not processing all entries on cmd_sync_work, make connect with qualcomm and intel adapters reliable - Revert "xfrm: state and policy should fail if XFRMA_IF_ID 0" - xdp: xdp_mem_allocator can be NULL in trace_mem_connect() - eth: ice: fix race condition and deadlock during interface enslave Current release - new code bugs: - tipc: fix incorrect order of state message data sanity check Previous releases - regressions: - esp: fix possible buffer overflow in ESP transformation - dsa: unlock the rtnl_mutex when dsa_master_setup() fails - phy: meson-gxl: fix interrupt handling in forced mode - smsc95xx: ignore -ENODEV errors when device is unplugged Previous releases - always broken: - xfrm: fix tunnel mode fragmentation behavior - esp: fix inter address family tunneling on GSO - tipc: fix null-deref due to race when enabling bearer - sctp: fix kernel-infoleak for SCTP sockets - eth: macb: fix lost RX packet wakeup race in NAPI receive - eth: intel stop disabling VFs due to PF error responses - eth: bcmgenet: don't claim WOL when its not available" * tag 'net-5.17-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (50 commits) xdp: xdp_mem_allocator can be NULL in trace_mem_connect(). ice: Fix race condition during interface enslave net: phy: meson-gxl: improve link-up behavior net: bcmgenet: Don't claim WOL when its not available net: arc_emac: Fix use after free in arc_mdio_probe() sctp: fix kernel-infoleak for SCTP sockets net: phy: correct spelling error of media in documentation net: phy: DP83822: clear MISR2 register to disable interrupts gianfar: ethtool: Fix refcount leak in gfar_get_ts_info selftests: pmtu.sh: Kill nettest processes launched in subshell. selftests: pmtu.sh: Kill tcpdump processes launched by subshell. NFC: port100: fix use-after-free in port100_send_complete net/mlx5e: SHAMPO, reduce TIR indication net/mlx5e: Lag, Only handle events from highest priority multipath entry net/mlx5: Fix offloading with ESWITCH_IPV4_TTL_MODIFY_ENABLE net/mlx5: Fix a race on command flush flow net/mlx5: Fix size field in bufferx_reg struct ax25: Fix NULL pointer dereference in ax25_kill_by_device net: marvell: prestera: Add missing of_node_put() in prestera_switch_set_base_mac_addr net: ethernet: lpc_eth: Handle error for clk_enable ...

Linus Torvalds committed 4 years ago

Commit 186d32b2 parents 3bcb645 e0ae71357 files · +383 −244Browse files

Unified · Split

57 files
  1. drivers/isdn/hardware/mISDN/hfcpci.c +5 −1
  2. drivers/isdn/mISDN/dsp_pipeline.c +3 −3
  3. drivers/net/dsa/mt7530.c +1 −1
  4. drivers/net/ethernet/8390/mcf8390.c +5 −5
  5. drivers/net/ethernet/arc/emac_mdio.c +3 −2
  6. drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c +7 −0
  7. drivers/net/ethernet/cadence/macb_main.c +24 −1
  8. drivers/net/ethernet/freescale/gianfar_ethtool.c +1 −0
  9. drivers/net/ethernet/intel/i40e/i40e_debugfs.c +2 −4
  10. drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +7 −50
  11. drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h +0 −5
  12. drivers/net/ethernet/intel/iavf/iavf.h +1 −0
  13. drivers/net/ethernet/intel/iavf/iavf_main.c +9 −4
  14. drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +40 −0
  15. drivers/net/ethernet/intel/ice/ice.h +11 −1
  16. drivers/net/ethernet/intel/ice/ice_ethtool.c +1 −1
  17. drivers/net/ethernet/intel/ice/ice_main.c +26 −17
  18. drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c +0 −18
  19. drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h +0 −3
  20. drivers/net/ethernet/lantiq_xrx200.c +1 −1
  21. drivers/net/ethernet/marvell/prestera/prestera_main.c +1 −0
  22. drivers/net/ethernet/mellanox/mlx5/core/cmd.c +8 −7
  23. drivers/net/ethernet/mellanox/mlx5/core/en/tir.c +0 −3
  24. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +1 −2
  25. drivers/net/ethernet/mellanox/mlx5/core/lag/mp.c +8 −3
  26. drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c +0 −3
  27. drivers/net/ethernet/nxp/lpc_eth.c +4 −1
  28. drivers/net/ethernet/qlogic/qed/qed_sriov.c +11 −7
  29. drivers/net/ethernet/qlogic/qed/qed_vf.c +7 −0
  30. drivers/net/ethernet/sun/sunhme.c +5 −1
  31. drivers/net/ethernet/ti/cpts.c +3 −1
  32. drivers/net/ethernet/xilinx/xilinx_emaclite.c +3 −1
  33. drivers/net/phy/dp83822.c +1 −1
  34. drivers/net/phy/meson-gxl.c +20 −11
  35. drivers/net/usb/smsc95xx.c +20 −8
  36. drivers/nfc/port100.c +2 −0
  37. include/linux/mlx5/mlx5_ifc.h +2 −3
  38. include/linux/netdevice.h +2 −0
  39. include/linux/phy.h +2 −2
  40. include/net/esp.h +2 −0
  41. net/ax25/af_ax25.c +7 −0
  42. net/bluetooth/hci_sync.c +23 −26
  43. net/bluetooth/mgmt.c +1 −1
  44. net/core/gro.c +25 −0
  45. net/core/xdp.c +2 −1
  46. net/dsa/dsa2.c +3 −3
  47. net/ipv4/esp4.c +5 −0
  48. net/ipv4/esp4_offload.c +4 −2
  49. net/ipv6/esp6.c +5 −0
  50. net/ipv6/esp6_offload.c +4 −2
  51. net/ipv6/xfrm6_output.c +16 −0
  52. net/sctp/diag.c +3 −6
  53. net/tipc/bearer.c +7 −5
  54. net/tipc/link.c +5 −4
  55. net/xfrm/xfrm_interface.c +4 −1
  56. net/xfrm/xfrm_user.c +3 −18
  57. tools/testing/selftests/net/pmtu.sh +17 −4
drivers/isdn/hardware/mISDN/hfcpci.c+5−1
@@ -2005,7 +2005,11 @@ setup_hw(struct hfc_pci *hc) · 2004 unmodified lines
2005 }2005 }
2006 /* Allocate memory for FIFOS */2006 /* Allocate memory for FIFOS */
2007 /* the memory needs to be on a 32k boundary within the first 4G */2007 /* the memory needs to be on a 32k boundary within the first 4G */
2008 dma_set_mask(&hc->pdev->dev, 0xFFFF8000);2008 if (dma_set_mask(&hc->pdev->dev, 0xFFFF8000)) {
2009 printk(KERN_WARNING
2010 "HFC-PCI: No usable DMA configuration!\n");
2011 return -EIO;
2012 }
2009 buffer = dma_alloc_coherent(&hc->pdev->dev, 0x8000, &hc->hw.dmahandle,2013 buffer = dma_alloc_coherent(&hc->pdev->dev, 0x8000, &hc->hw.dmahandle,
2010 GFP_KERNEL);2014 GFP_KERNEL);
2011 /* We silently assume the address is okay if nonzero */2015 /* We silently assume the address is okay if nonzero */
drivers/isdn/mISDN/dsp_pipeline.c+3−3
@@ -192,7 +192,7 @@ void dsp_pipeline_destroy(struct dsp_pipeline *pipeline) · 191 unmodified lines
192int dsp_pipeline_build(struct dsp_pipeline *pipeline, const char *cfg)192int dsp_pipeline_build(struct dsp_pipeline *pipeline, const char *cfg)
193{193{
194 int found = 0;194 int found = 0;
195 char *dup, *tok, *name, *args;195 char *dup, *next, *tok, *name, *args;
196 struct dsp_element_entry *entry, *n;196 struct dsp_element_entry *entry, *n;
197 struct dsp_pipeline_entry *pipeline_entry;197 struct dsp_pipeline_entry *pipeline_entry;
198 struct mISDN_dsp_element *elem;198 struct mISDN_dsp_element *elem;
@@ -203,10 +203,10 @@ int dsp_pipeline_build(struct dsp_pipeline *pipeline, const char *cfg) · 4 unmodified lines
203 if (!list_empty(&pipeline->list))203 if (!list_empty(&pipeline->list))
204 _dsp_pipeline_destroy(pipeline);204 _dsp_pipeline_destroy(pipeline);
205 205
206 dup = kstrdup(cfg, GFP_ATOMIC);206 dup = next = kstrdup(cfg, GFP_ATOMIC);
207 if (!dup)207 if (!dup)
208 return 0;208 return 0;
209 while ((tok = strsep(&dup, "|"))) {209 while ((tok = strsep(&next, "|"))) {
210 if (!strlen(tok))210 if (!strlen(tok))
211 continue;211 continue;
212 name = strsep(&tok, "(");212 name = strsep(&tok, "(");
drivers/net/dsa/mt7530.c+1−1
@@ -2936,7 +2936,7 @@ mt753x_phylink_validate(struct dsa_switch *ds, int port, · 2935 unmodified lines
2936 2936
2937 phylink_set_port_modes(mask);2937 phylink_set_port_modes(mask);
2938 2938
2939 if (state->interface != PHY_INTERFACE_MODE_TRGMII ||2939 if (state->interface != PHY_INTERFACE_MODE_TRGMII &&
2940 !phy_interface_mode_is_8023z(state->interface)) {2940 !phy_interface_mode_is_8023z(state->interface)) {
2941 phylink_set(mask, 10baseT_Half);2941 phylink_set(mask, 10baseT_Half);
2942 phylink_set(mask, 10baseT_Full);2942 phylink_set(mask, 10baseT_Full);
drivers/net/ethernet/8390/mcf8390.c+5−5
@@ -405,12 +405,12 @@ static int mcf8390_init(struct net_device *dev) · 404 unmodified lines
405static int mcf8390_probe(struct platform_device *pdev)405static int mcf8390_probe(struct platform_device *pdev)
406{406{
407 struct net_device *dev;407 struct net_device *dev;
408 struct resource *mem, *irq;408 struct resource *mem;
409 resource_size_t msize;409 resource_size_t msize;
410 int ret;410 int ret, irq;
411 411
412 irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);412 irq = platform_get_irq(pdev, 0);
413 if (irq == NULL) {413 if (irq < 0) {
414 dev_err(&pdev->dev, "no IRQ specified?\n");414 dev_err(&pdev->dev, "no IRQ specified?\n");
415 return -ENXIO;415 return -ENXIO;
416 }416 }
@@ -433,7 +433,7 @@ static int mcf8390_probe(struct platform_device *pdev) · 16 unmodified lines
433 SET_NETDEV_DEV(dev, &pdev->dev);433 SET_NETDEV_DEV(dev, &pdev->dev);
434 platform_set_drvdata(pdev, dev);434 platform_set_drvdata(pdev, dev);
435 435
436 dev->irq = irq->start;436 dev->irq = irq;
437 dev->base_addr = mem->start;437 dev->base_addr = mem->start;
438 438
439 ret = mcf8390_init(dev);439 ret = mcf8390_init(dev);
drivers/net/ethernet/arc/emac_mdio.c+3−2
@@ -132,6 +132,7 @@ int arc_mdio_probe(struct arc_emac_priv *priv) · 131 unmodified lines
132{132{
133 struct arc_emac_mdio_bus_data *data = &priv->bus_data;133 struct arc_emac_mdio_bus_data *data = &priv->bus_data;
134 struct device_node *np = priv->dev->of_node;134 struct device_node *np = priv->dev->of_node;
135 const char *name = "Synopsys MII Bus";
135 struct mii_bus *bus;136 struct mii_bus *bus;
136 int error;137 int error;
137 138
@@ -142,7 +143,7 @@ int arc_mdio_probe(struct arc_emac_priv *priv) · 4 unmodified lines
142 priv->bus = bus;143 priv->bus = bus;
143 bus->priv = priv;144 bus->priv = priv;
144 bus->parent = priv->dev;145 bus->parent = priv->dev;
145 bus->name = "Synopsys MII Bus";146 bus->name = name;
146 bus->read = &arc_mdio_read;147 bus->read = &arc_mdio_read;
147 bus->write = &arc_mdio_write;148 bus->write = &arc_mdio_write;
148 bus->reset = &arc_mdio_reset;149 bus->reset = &arc_mdio_reset;
@@ -167,7 +168,7 @@ int arc_mdio_probe(struct arc_emac_priv *priv) · 18 unmodified lines
167 if (error) {168 if (error) {
168 mdiobus_free(bus);169 mdiobus_free(bus);
169 return dev_err_probe(priv->dev, error,170 return dev_err_probe(priv->dev, error,
170 "cannot register MDIO bus %s\n", bus->name);171 "cannot register MDIO bus %s\n", name);
171 }172 }
172 173
173 return 0;174 return 0;
drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c+7−0
@@ -40,6 +40,13 @@ · 39 unmodified lines
40void bcmgenet_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)40void bcmgenet_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
41{41{
42 struct bcmgenet_priv *priv = netdev_priv(dev);42 struct bcmgenet_priv *priv = netdev_priv(dev);
43 struct device *kdev = &priv->pdev->dev;
44
45 if (!device_can_wakeup(kdev)) {
46 wol->supported = 0;
47 wol->wolopts = 0;
48 return;
49 }
43 50
44 wol->supported = WAKE_MAGIC | WAKE_MAGICSECURE | WAKE_FILTER;51 wol->supported = WAKE_MAGIC | WAKE_MAGICSECURE | WAKE_FILTER;
45 wol->wolopts = priv->wolopts;52 wol->wolopts = priv->wolopts;
drivers/net/ethernet/cadence/macb_main.c+24−1
@@ -1573,7 +1573,14 @@ static int macb_poll(struct napi_struct *napi, int budget) · 1572 unmodified lines
1573 if (work_done < budget) {1573 if (work_done < budget) {
1574 napi_complete_done(napi, work_done);1574 napi_complete_done(napi, work_done);
1575 1575
1576 /* Packets received while interrupts were disabled */1576 /* RSR bits only seem to propagate to raise interrupts when
1577 * interrupts are enabled at the time, so if bits are already
1578 * set due to packets received while interrupts were disabled,
1579 * they will not cause another interrupt to be generated when
1580 * interrupts are re-enabled.
1581 * Check for this case here. This has been seen to happen
1582 * around 30% of the time under heavy network load.
1583 */
1577 status = macb_readl(bp, RSR);1584 status = macb_readl(bp, RSR);
1578 if (status) {1585 if (status) {
1579 if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE)1586 if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE)
@@ -1581,6 +1588,22 @@ static int macb_poll(struct napi_struct *napi, int budget) · 1 unmodified line
1581 napi_reschedule(napi);1588 napi_reschedule(napi);
1582 } else {1589 } else {
1583 queue_writel(queue, IER, bp->rx_intr_mask);1590 queue_writel(queue, IER, bp->rx_intr_mask);
1591
1592 /* In rare cases, packets could have been received in
1593 * the window between the check above and re-enabling
1594 * interrupts. Therefore, a double-check is required
1595 * to avoid losing a wakeup. This can potentially race
1596 * with the interrupt handler doing the same actions
1597 * if an interrupt is raised just after enabling them,
1598 * but this should be harmless.
1599 */
1600 status = macb_readl(bp, RSR);
1601 if (unlikely(status)) {
1602 queue_writel(queue, IDR, bp->rx_intr_mask);
1603 if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE)
1604 queue_writel(queue, ISR, MACB_BIT(RCOMP));
1605 napi_schedule(napi);
1606 }
1584 }1607 }
1585 }1608 }
1586 1609
drivers/net/ethernet/freescale/gianfar_ethtool.c+1−0
@@ -1464,6 +1464,7 @@ static int gfar_get_ts_info(struct net_device *dev, · 1463 unmodified lines
1464 ptp_node = of_find_compatible_node(NULL, NULL, "fsl,etsec-ptp");1464 ptp_node = of_find_compatible_node(NULL, NULL, "fsl,etsec-ptp");
1465 if (ptp_node) {1465 if (ptp_node) {
1466 ptp_dev = of_find_device_by_node(ptp_node);1466 ptp_dev = of_find_device_by_node(ptp_node);
1467 of_node_put(ptp_node);
1467 if (ptp_dev)1468 if (ptp_dev)
1468 ptp = platform_get_drvdata(ptp_dev);1469 ptp = platform_get_drvdata(ptp_dev);
1469 }1470 }
drivers/net/ethernet/intel/i40e/i40e_debugfs.c+2−4
@@ -742,10 +742,8 @@ static void i40e_dbg_dump_vf(struct i40e_pf *pf, int vf_id) · 741 unmodified lines
742 vsi = pf->vsi[vf->lan_vsi_idx];742 vsi = pf->vsi[vf->lan_vsi_idx];
743 dev_info(&pf->pdev->dev, "vf %2d: VSI id=%d, seid=%d, qps=%d\n",743 dev_info(&pf->pdev->dev, "vf %2d: VSI id=%d, seid=%d, qps=%d\n",
744 vf_id, vf->lan_vsi_id, vsi->seid, vf->num_queue_pairs);744 vf_id, vf->lan_vsi_id, vsi->seid, vf->num_queue_pairs);
745 dev_info(&pf->pdev->dev, " num MDD=%lld, invalid msg=%lld, valid msg=%lld\n",745 dev_info(&pf->pdev->dev, " num MDD=%lld\n",
746 vf->num_mdd_events,746 vf->num_mdd_events);
747 vf->num_invalid_msgs,
748 vf->num_valid_msgs);
749 } else {747 } else {
750 dev_info(&pf->pdev->dev, "invalid VF id %d\n", vf_id);748 dev_info(&pf->pdev->dev, "invalid VF id %d\n", vf_id);
751 }749 }
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c+7−50
@@ -1917,19 +1917,17 @@ sriov_configure_out: · 1916 unmodified lines
1917/***********************virtual channel routines******************/1917/***********************virtual channel routines******************/
1918 1918
1919/**1919/**
1920 * i40e_vc_send_msg_to_vf_ex1920 * i40e_vc_send_msg_to_vf
1921 * @vf: pointer to the VF info1921 * @vf: pointer to the VF info
1922 * @v_opcode: virtual channel opcode1922 * @v_opcode: virtual channel opcode
1923 * @v_retval: virtual channel return value1923 * @v_retval: virtual channel return value
1924 * @msg: pointer to the msg buffer1924 * @msg: pointer to the msg buffer
1925 * @msglen: msg length1925 * @msglen: msg length
1926 * @is_quiet: true for not printing unsuccessful return values, false otherwise
1927 *1926 *
1928 * send msg to VF1927 * send msg to VF
1929 **/1928 **/
1930static int i40e_vc_send_msg_to_vf_ex(struct i40e_vf *vf, u32 v_opcode,1929static int i40e_vc_send_msg_to_vf(struct i40e_vf *vf, u32 v_opcode,
1931 u32 v_retval, u8 *msg, u16 msglen,1930 u32 v_retval, u8 *msg, u16 msglen)
1932 bool is_quiet)
1933{1931{
1934 struct i40e_pf *pf;1932 struct i40e_pf *pf;
1935 struct i40e_hw *hw;1933 struct i40e_hw *hw;
@@ -1944,25 +1942,6 @@ static int i40e_vc_send_msg_to_vf_ex(struct i40e_vf *vf, u32 v_opcode, · 8 unmodified lines
1944 hw = &pf->hw;1942 hw = &pf->hw;
1945 abs_vf_id = vf->vf_id + hw->func_caps.vf_base_id;1943 abs_vf_id = vf->vf_id + hw->func_caps.vf_base_id;
1946 1944
1947 /* single place to detect unsuccessful return values */
1948 if (v_retval && !is_quiet) {
1949 vf->num_invalid_msgs++;
1950 dev_info(&pf->pdev->dev, "VF %d failed opcode %d, retval: %d\n",
1951 vf->vf_id, v_opcode, v_retval);
1952 if (vf->num_invalid_msgs >
1953 I40E_DEFAULT_NUM_INVALID_MSGS_ALLOWED) {
1954 dev_err(&pf->pdev->dev,
1955 "Number of invalid messages exceeded for VF %d\n",
1956 vf->vf_id);
1957 dev_err(&pf->pdev->dev, "Use PF Control I/F to enable the VF\n");
1958 set_bit(I40E_VF_STATE_DISABLED, &vf->vf_states);
1959 }
1960 } else {
1961 vf->num_valid_msgs++;
1962 /* reset the invalid counter, if a valid message is received. */
1963 vf->num_invalid_msgs = 0;
1964 }
1965
1966 aq_ret = i40e_aq_send_msg_to_vf(hw, abs_vf_id, v_opcode, v_retval,1945 aq_ret = i40e_aq_send_msg_to_vf(hw, abs_vf_id, v_opcode, v_retval,
1967 msg, msglen, NULL);1946 msg, msglen, NULL);
1968 if (aq_ret) {1947 if (aq_ret) {
@@ -1975,23 +1954,6 @@ static int i40e_vc_send_msg_to_vf_ex(struct i40e_vf *vf, u32 v_opcode, · 6 unmodified lines
1975 return 0;1954 return 0;
1976}1955}
1977 1956
1978/**
1979 * i40e_vc_send_msg_to_vf
1980 * @vf: pointer to the VF info
1981 * @v_opcode: virtual channel opcode
1982 * @v_retval: virtual channel return value
1983 * @msg: pointer to the msg buffer
1984 * @msglen: msg length
1985 *
1986 * send msg to VF
1987 **/
1988static int i40e_vc_send_msg_to_vf(struct i40e_vf *vf, u32 v_opcode,
1989 u32 v_retval, u8 *msg, u16 msglen)
1990{
1991 return i40e_vc_send_msg_to_vf_ex(vf, v_opcode, v_retval,
1992 msg, msglen, false);
1993}
1994
1995/**1957/**
1996 * i40e_vc_send_resp_to_vf1958 * i40e_vc_send_resp_to_vf
1997 * @vf: pointer to the VF info1959 * @vf: pointer to the VF info
@@ -2822,7 +2784,6 @@ error_param: · 824 unmodified lines
2822 * i40e_check_vf_permission2784 * i40e_check_vf_permission
2823 * @vf: pointer to the VF info2785 * @vf: pointer to the VF info
2824 * @al: MAC address list from virtchnl2786 * @al: MAC address list from virtchnl
2825 * @is_quiet: set true for printing msg without opcode info, false otherwise
2826 *2787 *
2827 * Check that the given list of MAC addresses is allowed. Will return -EPERM2788 * Check that the given list of MAC addresses is allowed. Will return -EPERM
2828 * if any address in the list is not valid. Checks the following conditions:2789 * if any address in the list is not valid. Checks the following conditions:
@@ -2837,8 +2798,7 @@ error_param: · 8 unmodified lines
2837 * addresses might not be accurate.2798 * addresses might not be accurate.
2838 **/2799 **/
2839static inline int i40e_check_vf_permission(struct i40e_vf *vf,2800static inline int i40e_check_vf_permission(struct i40e_vf *vf,
2840 struct virtchnl_ether_addr_list *al,2801 struct virtchnl_ether_addr_list *al)
2841 bool *is_quiet)
2842{2802{
2843 struct i40e_pf *pf = vf->pf;2803 struct i40e_pf *pf = vf->pf;
2844 struct i40e_vsi *vsi = pf->vsi[vf->lan_vsi_idx];2804 struct i40e_vsi *vsi = pf->vsi[vf->lan_vsi_idx];
@@ -2846,7 +2806,6 @@ static inline int i40e_check_vf_permission(struct i40e_vf *vf, · 1 unmodified line
2846 int mac2add_cnt = 0;2806 int mac2add_cnt = 0;
2847 int i;2807 int i;
2848 2808
2849 *is_quiet = false;
2850 for (i = 0; i < al->num_elements; i++) {2809 for (i = 0; i < al->num_elements; i++) {
2851 struct i40e_mac_filter *f;2810 struct i40e_mac_filter *f;
2852 u8 *addr = al->list[i].addr;2811 u8 *addr = al->list[i].addr;
@@ -2870,7 +2829,6 @@ static inline int i40e_check_vf_permission(struct i40e_vf *vf, · 17 unmodified lines
2870 !ether_addr_equal(addr, vf->default_lan_addr.addr)) {2829 !ether_addr_equal(addr, vf->default_lan_addr.addr)) {
2871 dev_err(&pf->pdev->dev,2830 dev_err(&pf->pdev->dev,
2872 "VF attempting to override administratively set MAC address, bring down and up the VF interface to resume normal operation\n");2831 "VF attempting to override administratively set MAC address, bring down and up the VF interface to resume normal operation\n");
2873 *is_quiet = true;
2874 return -EPERM;2832 return -EPERM;
2875 }2833 }
2876 2834
@@ -2921,7 +2879,6 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg) · 44 unmodified lines
2921 (struct virtchnl_ether_addr_list *)msg;2879 (struct virtchnl_ether_addr_list *)msg;
2922 struct i40e_pf *pf = vf->pf;2880 struct i40e_pf *pf = vf->pf;
2923 struct i40e_vsi *vsi = NULL;2881 struct i40e_vsi *vsi = NULL;
2924 bool is_quiet = false;
2925 i40e_status ret = 0;2882 i40e_status ret = 0;
2926 int i;2883 int i;
2927 2884
@@ -2938,7 +2895,7 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg) · 10 unmodified lines
2938 */2895 */
2939 spin_lock_bh(&vsi->mac_filter_hash_lock);2896 spin_lock_bh(&vsi->mac_filter_hash_lock);
2940 2897
2941 ret = i40e_check_vf_permission(vf, al, &is_quiet);2898 ret = i40e_check_vf_permission(vf, al);
2942 if (ret) {2899 if (ret) {
2943 spin_unlock_bh(&vsi->mac_filter_hash_lock);2900 spin_unlock_bh(&vsi->mac_filter_hash_lock);
2944 goto error_param;2901 goto error_param;
@@ -2976,8 +2933,8 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg) · 31 unmodified lines
2976 2933
2977error_param:2934error_param:
2978 /* send the response to the VF */2935 /* send the response to the VF */
2979 return i40e_vc_send_msg_to_vf_ex(vf, VIRTCHNL_OP_ADD_ETH_ADDR,2936 return i40e_vc_send_msg_to_vf(vf, VIRTCHNL_OP_ADD_ETH_ADDR,
2980 ret, NULL, 0, is_quiet);2937 ret, NULL, 0);
2981}2938}
2982 2939
2983/**2940/**
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h+0−5
@@ -10,8 +10,6 @@ · 9 unmodified lines
10 10
11#define I40E_VIRTCHNL_SUPPORTED_QTYPES 211#define I40E_VIRTCHNL_SUPPORTED_QTYPES 2
12 12
13#define I40E_DEFAULT_NUM_INVALID_MSGS_ALLOWED 10
14
15#define I40E_VLAN_PRIORITY_SHIFT 1313#define I40E_VLAN_PRIORITY_SHIFT 13
16#define I40E_VLAN_MASK 0xFFF14#define I40E_VLAN_MASK 0xFFF
17#define I40E_PRIORITY_MASK 0xE00015#define I40E_PRIORITY_MASK 0xE000
@@ -92,9 +90,6 @@ struct i40e_vf { · 74 unmodified lines
92 u8 num_queue_pairs; /* num of qps assigned to VF vsis */90 u8 num_queue_pairs; /* num of qps assigned to VF vsis */
93 u8 num_req_queues; /* num of requested qps */91 u8 num_req_queues; /* num of requested qps */
94 u64 num_mdd_events; /* num of mdd events detected */92 u64 num_mdd_events; /* num of mdd events detected */
95 /* num of continuous malformed or invalid msgs detected */
96 u64 num_invalid_msgs;
97 u64 num_valid_msgs; /* num of valid msgs detected */
98 93
99 unsigned long vf_caps; /* vf's adv. capabilities */94 unsigned long vf_caps; /* vf's adv. capabilities */
100 unsigned long vf_states; /* vf's runtime states */95 unsigned long vf_states; /* vf's runtime states */
drivers/net/ethernet/intel/iavf/iavf.h+1−0
@@ -288,6 +288,7 @@ struct iavf_adapter { · 287 unmodified lines
288#define IAVF_FLAG_REINIT_ITR_NEEDED BIT(16)288#define IAVF_FLAG_REINIT_ITR_NEEDED BIT(16)
289#define IAVF_FLAG_QUEUES_DISABLED BIT(17)289#define IAVF_FLAG_QUEUES_DISABLED BIT(17)
290#define IAVF_FLAG_SETUP_NETDEV_FEATURES BIT(18)290#define IAVF_FLAG_SETUP_NETDEV_FEATURES BIT(18)
291#define IAVF_FLAG_REINIT_MSIX_NEEDED BIT(20)
291/* duplicates for common code */292/* duplicates for common code */
292#define IAVF_FLAG_DCB_ENABLED 0293#define IAVF_FLAG_DCB_ENABLED 0
293 /* flags for admin queue service task */294 /* flags for admin queue service task */
drivers/net/ethernet/intel/iavf/iavf_main.c+9−4
@@ -2120,7 +2120,7 @@ int iavf_parse_vf_resource_msg(struct iavf_adapter *adapter) · 2119 unmodified lines
2120 "Requested %d queues, but PF only gave us %d.\n",2120 "Requested %d queues, but PF only gave us %d.\n",
2121 num_req_queues,2121 num_req_queues,
2122 adapter->vsi_res->num_queue_pairs);2122 adapter->vsi_res->num_queue_pairs);
2123 adapter->flags |= IAVF_FLAG_REINIT_ITR_NEEDED;2123 adapter->flags |= IAVF_FLAG_REINIT_MSIX_NEEDED;
2124 adapter->num_req_queues = adapter->vsi_res->num_queue_pairs;2124 adapter->num_req_queues = adapter->vsi_res->num_queue_pairs;
2125 iavf_schedule_reset(adapter);2125 iavf_schedule_reset(adapter);
2126 2126
@@ -2727,7 +2727,8 @@ continue_reset: · 600 unmodified lines
2727 err);2727 err);
2728 adapter->aq_required = 0;2728 adapter->aq_required = 0;
2729 2729
2730 if (adapter->flags & IAVF_FLAG_REINIT_ITR_NEEDED) {2730 if ((adapter->flags & IAVF_FLAG_REINIT_MSIX_NEEDED) ||
2731 (adapter->flags & IAVF_FLAG_REINIT_ITR_NEEDED)) {
2731 err = iavf_reinit_interrupt_scheme(adapter);2732 err = iavf_reinit_interrupt_scheme(adapter);
2732 if (err)2733 if (err)
2733 goto reset_err;2734 goto reset_err;
@@ -2799,12 +2800,13 @@ continue_reset: · 65 unmodified lines
2799 if (err)2800 if (err)
2800 goto reset_err;2801 goto reset_err;
2801 2802
2802 if (adapter->flags & IAVF_FLAG_REINIT_ITR_NEEDED) {2803 if ((adapter->flags & IAVF_FLAG_REINIT_MSIX_NEEDED) ||
2804 (adapter->flags & IAVF_FLAG_REINIT_ITR_NEEDED)) {
2803 err = iavf_request_traffic_irqs(adapter, netdev->name);2805 err = iavf_request_traffic_irqs(adapter, netdev->name);
2804 if (err)2806 if (err)
2805 goto reset_err;2807 goto reset_err;
2806 2808
2807 adapter->flags &= ~IAVF_FLAG_REINIT_ITR_NEEDED;2809 adapter->flags &= ~IAVF_FLAG_REINIT_MSIX_NEEDED;
2808 }2810 }
2809 2811
2810 iavf_configure(adapter);2812 iavf_configure(adapter);
@@ -2819,6 +2821,9 @@ continue_reset: · 8 unmodified lines
2819 iavf_change_state(adapter, __IAVF_DOWN);2821 iavf_change_state(adapter, __IAVF_DOWN);
2820 wake_up(&adapter->down_waitqueue);2822 wake_up(&adapter->down_waitqueue);
2821 }2823 }
2824
2825 adapter->flags &= ~IAVF_FLAG_REINIT_ITR_NEEDED;
2826
2822 mutex_unlock(&adapter->client_lock);2827 mutex_unlock(&adapter->client_lock);
2823 mutex_unlock(&adapter->crit_lock);2828 mutex_unlock(&adapter->crit_lock);
2824 2829
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c+40−0
@@ -1834,6 +1834,22 @@ void iavf_request_reset(struct iavf_adapter *adapter) · 1833 unmodified lines
1834 adapter->current_op = VIRTCHNL_OP_UNKNOWN;1834 adapter->current_op = VIRTCHNL_OP_UNKNOWN;
1835}1835}
1836 1836
1837/**
1838 * iavf_netdev_features_vlan_strip_set - update vlan strip status
1839 * @netdev: ptr to netdev being adjusted
1840 * @enable: enable or disable vlan strip
1841 *
1842 * Helper function to change vlan strip status in netdev->features.
1843 */
1844static void iavf_netdev_features_vlan_strip_set(struct net_device *netdev,
1845 const bool enable)
1846{
1847 if (enable)
1848 netdev->features |= NETIF_F_HW_VLAN_CTAG_RX;
1849 else
1850 netdev->features &= ~NETIF_F_HW_VLAN_CTAG_RX;
1851}
1852
1837/**1853/**
1838 * iavf_virtchnl_completion1854 * iavf_virtchnl_completion
1839 * @adapter: adapter structure1855 * @adapter: adapter structure
@@ -2057,8 +2073,18 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter, · 217 unmodified lines
2057 }2073 }
2058 break;2074 break;
2059 case VIRTCHNL_OP_ENABLE_VLAN_STRIPPING:2075 case VIRTCHNL_OP_ENABLE_VLAN_STRIPPING:
2076 dev_warn(&adapter->pdev->dev, "Changing VLAN Stripping is not allowed when Port VLAN is configured\n");
2077 /* Vlan stripping could not be enabled by ethtool.
2078 * Disable it in netdev->features.
2079 */
2080 iavf_netdev_features_vlan_strip_set(netdev, false);
2081 break;
2060 case VIRTCHNL_OP_DISABLE_VLAN_STRIPPING:2082 case VIRTCHNL_OP_DISABLE_VLAN_STRIPPING:
2061 dev_warn(&adapter->pdev->dev, "Changing VLAN Stripping is not allowed when Port VLAN is configured\n");2083 dev_warn(&adapter->pdev->dev, "Changing VLAN Stripping is not allowed when Port VLAN is configured\n");
2084 /* Vlan stripping could not be disabled by ethtool.
2085 * Enable it in netdev->features.
2086 */
2087 iavf_netdev_features_vlan_strip_set(netdev, true);
2062 break;2088 break;
2063 default:2089 default:
2064 dev_err(&adapter->pdev->dev, "PF returned error %d (%s) to our request %d\n",2090 dev_err(&adapter->pdev->dev, "PF returned error %d (%s) to our request %d\n",
@@ -2312,6 +2338,20 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter, · 247 unmodified lines
2312 spin_unlock_bh(&adapter->adv_rss_lock);2338 spin_unlock_bh(&adapter->adv_rss_lock);
2313 }2339 }
2314 break;2340 break;
2341 case VIRTCHNL_OP_ENABLE_VLAN_STRIPPING:
2342 /* PF enabled vlan strip on this VF.
2343 * Update netdev->features if needed to be in sync with ethtool.
2344 */
2345 if (!v_retval)
2346 iavf_netdev_features_vlan_strip_set(netdev, true);
2347 break;
2348 case VIRTCHNL_OP_DISABLE_VLAN_STRIPPING:
2349 /* PF disabled vlan strip on this VF.
2350 * Update netdev->features if needed to be in sync with ethtool.
2351 */
2352 if (!v_retval)
2353 iavf_netdev_features_vlan_strip_set(netdev, false);
2354 break;
2315 default:2355 default:
2316 if (adapter->current_op && (v_opcode != adapter->current_op))2356 if (adapter->current_op && (v_opcode != adapter->current_op))
2317 dev_warn(&adapter->pdev->dev, "Expected response %d from PF, received %d\n",2357 dev_warn(&adapter->pdev->dev, "Expected response %d from PF, received %d\n",
drivers/net/ethernet/intel/ice/ice.h+11−1
@@ -483,6 +483,7 @@ enum ice_pf_flags { · 482 unmodified lines
483 ICE_FLAG_MDD_AUTO_RESET_VF,483 ICE_FLAG_MDD_AUTO_RESET_VF,
484 ICE_FLAG_LINK_LENIENT_MODE_ENA,484 ICE_FLAG_LINK_LENIENT_MODE_ENA,
485 ICE_FLAG_PLUG_AUX_DEV,485 ICE_FLAG_PLUG_AUX_DEV,
486 ICE_FLAG_MTU_CHANGED,
486 ICE_PF_FLAGS_NBITS /* must be last */487 ICE_PF_FLAGS_NBITS /* must be last */
487};488};
488 489
@@ -897,7 +898,16 @@ static inline void ice_set_rdma_cap(struct ice_pf *pf) · 408 unmodified lines
897 */898 */
898static inline void ice_clear_rdma_cap(struct ice_pf *pf)899static inline void ice_clear_rdma_cap(struct ice_pf *pf)
899{900{
900 ice_unplug_aux_dev(pf);901 /* We can directly unplug aux device here only if the flag bit
902 * ICE_FLAG_PLUG_AUX_DEV is not set because ice_unplug_aux_dev()
903 * could race with ice_plug_aux_dev() called from
904 * ice_service_task(). In this case we only clear that bit now and
905 * aux device will be unplugged later once ice_plug_aux_device()
906 * called from ice_service_task() finishes (see ice_service_task()).
907 */
908 if (!test_and_clear_bit(ICE_FLAG_PLUG_AUX_DEV, pf->flags))
909 ice_unplug_aux_dev(pf);
910
901 clear_bit(ICE_FLAG_RDMA_ENA, pf->flags);911 clear_bit(ICE_FLAG_RDMA_ENA, pf->flags);
902 clear_bit(ICE_FLAG_AUX_ENA, pf->flags);912 clear_bit(ICE_FLAG_AUX_ENA, pf->flags);
903}913}
drivers/net/ethernet/intel/ice/ice_ethtool.c+1−1
@@ -2298,7 +2298,7 @@ ice_set_link_ksettings(struct net_device *netdev, · 2297 unmodified lines
2298 if (err)2298 if (err)
2299 goto done;2299 goto done;
2300 2300
2301 curr_link_speed = pi->phy.link_info.link_speed;2301 curr_link_speed = pi->phy.curr_user_speed_req;
2302 adv_link_speed = ice_ksettings_find_adv_link_speed(ks);2302 adv_link_speed = ice_ksettings_find_adv_link_speed(ks);
2303 2303
2304 /* If speed didn't get set, set it to what it currently is.2304 /* If speed didn't get set, set it to what it currently is.
drivers/net/ethernet/intel/ice/ice_main.c+26−17
@@ -2255,9 +2255,30 @@ static void ice_service_task(struct work_struct *work) · 2254 unmodified lines
2255 return;2255 return;
2256 }2256 }
2257 2257
2258 if (test_and_clear_bit(ICE_FLAG_PLUG_AUX_DEV, pf->flags))2258 if (test_bit(ICE_FLAG_PLUG_AUX_DEV, pf->flags)) {
2259 /* Plug aux device per request */
2259 ice_plug_aux_dev(pf);2260 ice_plug_aux_dev(pf);
2260 2261
2262 /* Mark plugging as done but check whether unplug was
2263 * requested during ice_plug_aux_dev() call
2264 * (e.g. from ice_clear_rdma_cap()) and if so then
2265 * plug aux device.
2266 */
2267 if (!test_and_clear_bit(ICE_FLAG_PLUG_AUX_DEV, pf->flags))
2268 ice_unplug_aux_dev(pf);
2269 }
2270
2271 if (test_and_clear_bit(ICE_FLAG_MTU_CHANGED, pf->flags)) {
2272 struct iidc_event *event;
2273
2274 event = kzalloc(sizeof(*event), GFP_KERNEL);
2275 if (event) {
2276 set_bit(IIDC_EVENT_AFTER_MTU_CHANGE, event->type);
2277 ice_send_event_to_aux(pf, event);
2278 kfree(event);
2279 }
2280 }
2281
2261 ice_clean_adminq_subtask(pf);2282 ice_clean_adminq_subtask(pf);
2262 ice_check_media_subtask(pf);2283 ice_check_media_subtask(pf);
2263 ice_check_for_hang_subtask(pf);2284 ice_check_for_hang_subtask(pf);
@@ -3023,7 +3044,7 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data) · 759 unmodified lines
3023 struct iidc_event *event;3044 struct iidc_event *event;
3024 3045
3025 ena_mask &= ~ICE_AUX_CRIT_ERR;3046 ena_mask &= ~ICE_AUX_CRIT_ERR;
3026 event = kzalloc(sizeof(*event), GFP_KERNEL);3047 event = kzalloc(sizeof(*event), GFP_ATOMIC);
3027 if (event) {3048 if (event) {
3028 set_bit(IIDC_EVENT_CRIT_ERR, event->type);3049 set_bit(IIDC_EVENT_CRIT_ERR, event->type);
3029 /* report the entire OICR value to AUX driver */3050 /* report the entire OICR value to AUX driver */
@@ -6822,7 +6843,6 @@ static int ice_change_mtu(struct net_device *netdev, int new_mtu) · 3792 unmodified lines
6822 struct ice_netdev_priv *np = netdev_priv(netdev);6843 struct ice_netdev_priv *np = netdev_priv(netdev);
6823 struct ice_vsi *vsi = np->vsi;6844 struct ice_vsi *vsi = np->vsi;
6824 struct ice_pf *pf = vsi->back;6845 struct ice_pf *pf = vsi->back;
6825 struct iidc_event *event;
6826 u8 count = 0;6846 u8 count = 0;
6827 int err = 0;6847 int err = 0;
6828 6848
@@ -6857,14 +6877,6 @@ static int ice_change_mtu(struct net_device *netdev, int new_mtu) · 28 unmodified lines
6857 return -EBUSY;6877 return -EBUSY;
6858 }6878 }
6859 6879
6860 event = kzalloc(sizeof(*event), GFP_KERNEL);
6861 if (!event)
6862 return -ENOMEM;
6863
6864 set_bit(IIDC_EVENT_BEFORE_MTU_CHANGE, event->type);
6865 ice_send_event_to_aux(pf, event);
6866 clear_bit(IIDC_EVENT_BEFORE_MTU_CHANGE, event->type);
6867
6868 netdev->mtu = (unsigned int)new_mtu;6880 netdev->mtu = (unsigned int)new_mtu;
6869 6881
6870 /* if VSI is up, bring it down and then back up */6882 /* if VSI is up, bring it down and then back up */
@@ -6872,21 +6884,18 @@ static int ice_change_mtu(struct net_device *netdev, int new_mtu) · 1 unmodified line
6872 err = ice_down(vsi);6884 err = ice_down(vsi);
6873 if (err) {6885 if (err) {
6874 netdev_err(netdev, "change MTU if_down err %d\n", err);6886 netdev_err(netdev, "change MTU if_down err %d\n", err);
6875 goto event_after;6887 return err;
6876 }6888 }
6877 6889
6878 err = ice_up(vsi);6890 err = ice_up(vsi);
6879 if (err) {6891 if (err) {
6880 netdev_err(netdev, "change MTU if_up err %d\n", err);6892 netdev_err(netdev, "change MTU if_up err %d\n", err);
6881 goto event_after;6893 return err;
6882 }6894 }
6883 }6895 }
6884 6896
6885 netdev_dbg(netdev, "changed MTU to %d\n", new_mtu);6897 netdev_dbg(netdev, "changed MTU to %d\n", new_mtu);
6886event_after:6898 set_bit(ICE_FLAG_MTU_CHANGED, pf->flags);
6887 set_bit(IIDC_EVENT_AFTER_MTU_CHANGE, event->type);
6888 ice_send_event_to_aux(pf, event);
6889 kfree(event);
6890 6899
6891 return err;6900 return err;
6892}6901}
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c+0−18
@@ -2182,24 +2182,6 @@ ice_vc_send_msg_to_vf(struct ice_vf *vf, u32 v_opcode, · 2181 unmodified lines
2182 2182
2183 dev = ice_pf_to_dev(pf);2183 dev = ice_pf_to_dev(pf);
2184 2184
2185 /* single place to detect unsuccessful return values */
2186 if (v_retval) {
2187 vf->num_inval_msgs++;
2188 dev_info(dev, "VF %d failed opcode %d, retval: %d\n", vf->vf_id,
2189 v_opcode, v_retval);
2190 if (vf->num_inval_msgs > ICE_DFLT_NUM_INVAL_MSGS_ALLOWED) {
2191 dev_err(dev, "Number of invalid messages exceeded for VF %d\n",
2192 vf->vf_id);
2193 dev_err(dev, "Use PF Control I/F to enable the VF\n");
2194 set_bit(ICE_VF_STATE_DIS, vf->vf_states);
2195 return -EIO;
2196 }
2197 } else {
2198 vf->num_valid_msgs++;
2199 /* reset the invalid counter, if a valid message is received. */
2200 vf->num_inval_msgs = 0;
2201 }
2202
2203 aq_ret = ice_aq_send_msg_to_vf(&pf->hw, vf->vf_id, v_opcode, v_retval,2185 aq_ret = ice_aq_send_msg_to_vf(&pf->hw, vf->vf_id, v_opcode, v_retval,
2204 msg, msglen, NULL);2186 msg, msglen, NULL);
2205 if (aq_ret && pf->hw.mailboxq.sq_last_status != ICE_AQ_RC_ENOSYS) {2187 if (aq_ret && pf->hw.mailboxq.sq_last_status != ICE_AQ_RC_ENOSYS) {
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h+0−3
@@ -14,7 +14,6 @@ · 13 unmodified lines
14#define ICE_MAX_MACADDR_PER_VF 1814#define ICE_MAX_MACADDR_PER_VF 18
15 15
16/* Malicious Driver Detection */16/* Malicious Driver Detection */
17#define ICE_DFLT_NUM_INVAL_MSGS_ALLOWED 10
18#define ICE_MDD_EVENTS_THRESHOLD 3017#define ICE_MDD_EVENTS_THRESHOLD 30
19 18
20/* Static VF transaction/status register def */19/* Static VF transaction/status register def */
@@ -134,8 +133,6 @@ struct ice_vf { · 113 unmodified lines
134 unsigned int max_tx_rate; /* Maximum Tx bandwidth limit in Mbps */133 unsigned int max_tx_rate; /* Maximum Tx bandwidth limit in Mbps */
135 DECLARE_BITMAP(vf_states, ICE_VF_STATES_NBITS); /* VF runtime states */134 DECLARE_BITMAP(vf_states, ICE_VF_STATES_NBITS); /* VF runtime states */
136 135
137 u64 num_inval_msgs; /* number of continuous invalid msgs */
138 u64 num_valid_msgs; /* number of valid msgs detected */
139 unsigned long vf_caps; /* VF's adv. capabilities */136 unsigned long vf_caps; /* VF's adv. capabilities */
140 u8 num_req_qs; /* num of queue pairs requested by VF */137 u8 num_req_qs; /* num of queue pairs requested by VF */
141 u16 num_mac;138 u16 num_mac;
drivers/net/ethernet/lantiq_xrx200.c+1−1
@@ -260,9 +260,9 @@ static int xrx200_hw_receive(struct xrx200_chan *ch) · 259 unmodified lines
260 260
261 if (ctl & LTQ_DMA_EOP) {261 if (ctl & LTQ_DMA_EOP) {
262 ch->skb_head->protocol = eth_type_trans(ch->skb_head, net_dev);262 ch->skb_head->protocol = eth_type_trans(ch->skb_head, net_dev);
263 netif_receive_skb(ch->skb_head);
264 net_dev->stats.rx_packets++;263 net_dev->stats.rx_packets++;
265 net_dev->stats.rx_bytes += ch->skb_head->len;264 net_dev->stats.rx_bytes += ch->skb_head->len;
265 netif_receive_skb(ch->skb_head);
266 ch->skb_head = NULL;266 ch->skb_head = NULL;
267 ch->skb_tail = NULL;267 ch->skb_tail = NULL;
268 ret = XRX200_DMA_PACKET_COMPLETE;268 ret = XRX200_DMA_PACKET_COMPLETE;
drivers/net/ethernet/marvell/prestera/prestera_main.c+1−0
@@ -554,6 +554,7 @@ static int prestera_switch_set_base_mac_addr(struct prestera_switch *sw) · 553 unmodified lines
554 dev_info(prestera_dev(sw), "using random base mac address\n");554 dev_info(prestera_dev(sw), "using random base mac address\n");
555 }555 }
556 of_node_put(base_mac_np);556 of_node_put(base_mac_np);
557 of_node_put(np);
557 558
558 return prestera_hw_switch_mac_set(sw, sw->base_mac);559 return prestera_hw_switch_mac_set(sw, sw->base_mac);
559}560}
drivers/net/ethernet/mellanox/mlx5/core/cmd.c+8−7
@@ -131,11 +131,8 @@ static int cmd_alloc_index(struct mlx5_cmd *cmd) · 130 unmodified lines
131 131
132static void cmd_free_index(struct mlx5_cmd *cmd, int idx)132static void cmd_free_index(struct mlx5_cmd *cmd, int idx)
133{133{
134 unsigned long flags;134 lockdep_assert_held(&cmd->alloc_lock);
135
136 spin_lock_irqsave(&cmd->alloc_lock, flags);
137 set_bit(idx, &cmd->bitmask);135 set_bit(idx, &cmd->bitmask);
138 spin_unlock_irqrestore(&cmd->alloc_lock, flags);
139}136}
140 137
141static void cmd_ent_get(struct mlx5_cmd_work_ent *ent)138static void cmd_ent_get(struct mlx5_cmd_work_ent *ent)
@@ -145,17 +142,21 @@ static void cmd_ent_get(struct mlx5_cmd_work_ent *ent) · 3 unmodified lines
145 142
146static void cmd_ent_put(struct mlx5_cmd_work_ent *ent)143static void cmd_ent_put(struct mlx5_cmd_work_ent *ent)
147{144{
145 struct mlx5_cmd *cmd = ent->cmd;
146 unsigned long flags;
147
148 spin_lock_irqsave(&cmd->alloc_lock, flags);
148 if (!refcount_dec_and_test(&ent->refcnt))149 if (!refcount_dec_and_test(&ent->refcnt))
149 return;150 goto out;
150 151
151 if (ent->idx >= 0) {152 if (ent->idx >= 0) {
152 struct mlx5_cmd *cmd = ent->cmd;
153
154 cmd_free_index(cmd, ent->idx);153 cmd_free_index(cmd, ent->idx);
155 up(ent->page_queue ? &cmd->pages_sem : &cmd->sem);154 up(ent->page_queue ? &cmd->pages_sem : &cmd->sem);
156 }155 }
157 156
158 cmd_free_ent(ent);157 cmd_free_ent(ent);
158out:
159 spin_unlock_irqrestore(&cmd->alloc_lock, flags);
159}160}
160 161
161static struct mlx5_cmd_layout *get_inst(struct mlx5_cmd *cmd, int idx)162static struct mlx5_cmd_layout *get_inst(struct mlx5_cmd *cmd, int idx)
drivers/net/ethernet/mellanox/mlx5/core/en/tir.c+0−3
@@ -88,9 +88,6 @@ void mlx5e_tir_builder_build_packet_merge(struct mlx5e_tir_builder *builder, · 87 unmodified lines
88 (MLX5E_PARAMS_DEFAULT_LRO_WQE_SZ - rough_max_l2_l3_hdr_sz) >> 8);88 (MLX5E_PARAMS_DEFAULT_LRO_WQE_SZ - rough_max_l2_l3_hdr_sz) >> 8);
89 MLX5_SET(tirc, tirc, lro_timeout_period_usecs, pkt_merge_param->timeout);89 MLX5_SET(tirc, tirc, lro_timeout_period_usecs, pkt_merge_param->timeout);
90 break;90 break;
91 case MLX5E_PACKET_MERGE_SHAMPO:
92 MLX5_SET(tirc, tirc, packet_merge_mask, MLX5_TIRC_PACKET_MERGE_MASK_SHAMPO);
93 break;
94 default:91 default:
95 break;92 break;
96 }93 }
drivers/net/ethernet/mellanox/mlx5/core/en_main.c+1−2
@@ -3616,8 +3616,7 @@ static int set_feature_hw_gro(struct net_device *netdev, bool enable) · 3615 unmodified lines
3616 goto out;3616 goto out;
3617 }3617 }
3618 3618
3619 err = mlx5e_safe_switch_params(priv, &new_params,3619 err = mlx5e_safe_switch_params(priv, &new_params, NULL, NULL, reset);
3620 mlx5e_modify_tirs_packet_merge_ctx, NULL, reset);
3621out:3620out:
3622 mutex_unlock(&priv->state_lock);3621 mutex_unlock(&priv->state_lock);
3623 return err;3622 return err;
drivers/net/ethernet/mellanox/mlx5/core/lag/mp.c+8−3
@@ -126,6 +126,10 @@ static void mlx5_lag_fib_route_event(struct mlx5_lag *ldev, · 125 unmodified lines
126 return;126 return;
127 }127 }
128 128
129 /* Handle multipath entry with lower priority value */
130 if (mp->mfi && mp->mfi != fi && fi->fib_priority >= mp->mfi->fib_priority)
131 return;
132
129 /* Handle add/replace event */133 /* Handle add/replace event */
130 nhs = fib_info_num_path(fi);134 nhs = fib_info_num_path(fi);
131 if (nhs == 1) {135 if (nhs == 1) {
@@ -135,12 +139,13 @@ static void mlx5_lag_fib_route_event(struct mlx5_lag *ldev, · 3 unmodified lines
135 int i = mlx5_lag_dev_get_netdev_idx(ldev, nh_dev);139 int i = mlx5_lag_dev_get_netdev_idx(ldev, nh_dev);
136 140
137 if (i < 0)141 if (i < 0)
138 i = MLX5_LAG_NORMAL_AFFINITY;142 return;
139 else
140 ++i;
141 143
144 i++;
142 mlx5_lag_set_port_affinity(ldev, i);145 mlx5_lag_set_port_affinity(ldev, i);
143 }146 }
147
148 mp->mfi = fi;
144 return;149 return;
145 }150 }
146 151
drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c+0−3
@@ -121,9 +121,6 @@ u32 mlx5_chains_get_nf_ft_chain(struct mlx5_fs_chains *chains) · 120 unmodified lines
121 121
122u32 mlx5_chains_get_prio_range(struct mlx5_fs_chains *chains)122u32 mlx5_chains_get_prio_range(struct mlx5_fs_chains *chains)
123{123{
124 if (!mlx5_chains_prios_supported(chains))
125 return 1;
126
127 if (mlx5_chains_ignore_flow_level_supported(chains))124 if (mlx5_chains_ignore_flow_level_supported(chains))
128 return UINT_MAX;125 return UINT_MAX;
129 126
drivers/net/ethernet/nxp/lpc_eth.c+4−1
@@ -1471,6 +1471,7 @@ static int lpc_eth_drv_resume(struct platform_device *pdev) · 1470 unmodified lines
1471{1471{
1472 struct net_device *ndev = platform_get_drvdata(pdev);1472 struct net_device *ndev = platform_get_drvdata(pdev);
1473 struct netdata_local *pldat;1473 struct netdata_local *pldat;
1474 int ret;
1474 1475
1475 if (device_may_wakeup(&pdev->dev))1476 if (device_may_wakeup(&pdev->dev))
1476 disable_irq_wake(ndev->irq);1477 disable_irq_wake(ndev->irq);
@@ -1480,7 +1481,9 @@ static int lpc_eth_drv_resume(struct platform_device *pdev) · 3 unmodified lines
1480 pldat = netdev_priv(ndev);1481 pldat = netdev_priv(ndev);
1481 1482
1482 /* Enable interface clock */1483 /* Enable interface clock */
1483 clk_enable(pldat->clk);1484 ret = clk_enable(pldat->clk);
1485 if (ret)
1486 return ret;
1484 1487
1485 /* Reset and initialize */1488 /* Reset and initialize */
1486 __lpc_eth_reset(pldat);1489 __lpc_eth_reset(pldat);
drivers/net/ethernet/qlogic/qed/qed_sriov.c+11−7
@@ -3806,11 +3806,11 @@ bool qed_iov_mark_vf_flr(struct qed_hwfn *p_hwfn, u32 *p_disabled_vfs) · 3805 unmodified lines
3806 return found;3806 return found;
3807}3807}
3808 3808
3809static void qed_iov_get_link(struct qed_hwfn *p_hwfn,3809static int qed_iov_get_link(struct qed_hwfn *p_hwfn,
3810 u16 vfid,3810 u16 vfid,
3811 struct qed_mcp_link_params *p_params,3811 struct qed_mcp_link_params *p_params,
3812 struct qed_mcp_link_state *p_link,3812 struct qed_mcp_link_state *p_link,
3813 struct qed_mcp_link_capabilities *p_caps)3813 struct qed_mcp_link_capabilities *p_caps)
3814{3814{
3815 struct qed_vf_info *p_vf = qed_iov_get_vf_info(p_hwfn,3815 struct qed_vf_info *p_vf = qed_iov_get_vf_info(p_hwfn,
3816 vfid,3816 vfid,
@@ -3818,7 +3818,7 @@ static void qed_iov_get_link(struct qed_hwfn *p_hwfn, · 1 unmodified line
3818 struct qed_bulletin_content *p_bulletin;3818 struct qed_bulletin_content *p_bulletin;
3819 3819
3820 if (!p_vf)3820 if (!p_vf)
3821 return;3821 return -EINVAL;
3822 3822
3823 p_bulletin = p_vf->bulletin.p_virt;3823 p_bulletin = p_vf->bulletin.p_virt;
3824 3824
@@ -3828,6 +3828,7 @@ static void qed_iov_get_link(struct qed_hwfn *p_hwfn, · 3 unmodified lines
3828 __qed_vf_get_link_state(p_hwfn, p_link, p_bulletin);3828 __qed_vf_get_link_state(p_hwfn, p_link, p_bulletin);
3829 if (p_caps)3829 if (p_caps)
3830 __qed_vf_get_link_caps(p_hwfn, p_caps, p_bulletin);3830 __qed_vf_get_link_caps(p_hwfn, p_caps, p_bulletin);
3831 return 0;
3831}3832}
3832 3833
3833static int3834static int
@@ -4686,6 +4687,7 @@ static int qed_get_vf_config(struct qed_dev *cdev, · 852 unmodified lines
4686 struct qed_public_vf_info *vf_info;4687 struct qed_public_vf_info *vf_info;
4687 struct qed_mcp_link_state link;4688 struct qed_mcp_link_state link;
4688 u32 tx_rate;4689 u32 tx_rate;
4690 int ret;
4689 4691
4690 /* Sanitize request */4692 /* Sanitize request */
4691 if (IS_VF(cdev))4693 if (IS_VF(cdev))
@@ -4699,7 +4701,9 @@ static int qed_get_vf_config(struct qed_dev *cdev, · 7 unmodified lines
4699 4701
4700 vf_info = qed_iov_get_public_vf_info(hwfn, vf_id, true);4702 vf_info = qed_iov_get_public_vf_info(hwfn, vf_id, true);
4701 4703
4702 qed_iov_get_link(hwfn, vf_id, NULL, &link, NULL);4704 ret = qed_iov_get_link(hwfn, vf_id, NULL, &link, NULL);
4705 if (ret)
4706 return ret;
4703 4707
4704 /* Fill information about VF */4708 /* Fill information about VF */
4705 ivi->vf = vf_id;4709 ivi->vf = vf_id;
drivers/net/ethernet/qlogic/qed/qed_vf.c+7−0
@@ -513,6 +513,9 @@ int qed_vf_hw_prepare(struct qed_hwfn *p_hwfn) · 512 unmodified lines
513 p_iov->bulletin.size,513 p_iov->bulletin.size,
514 &p_iov->bulletin.phys,514 &p_iov->bulletin.phys,
515 GFP_KERNEL);515 GFP_KERNEL);
516 if (!p_iov->bulletin.p_virt)
517 goto free_pf2vf_reply;
518
516 DP_VERBOSE(p_hwfn, QED_MSG_IOV,519 DP_VERBOSE(p_hwfn, QED_MSG_IOV,
517 "VF's bulletin Board [%p virt 0x%llx phys 0x%08x bytes]\n",520 "VF's bulletin Board [%p virt 0x%llx phys 0x%08x bytes]\n",
518 p_iov->bulletin.p_virt,521 p_iov->bulletin.p_virt,
@@ -552,6 +555,10 @@ int qed_vf_hw_prepare(struct qed_hwfn *p_hwfn) · 33 unmodified lines
552 555
553 return rc;556 return rc;
554 557
558free_pf2vf_reply:
559 dma_free_coherent(&p_hwfn->cdev->pdev->dev,
560 sizeof(union pfvf_tlvs),
561 p_iov->pf2vf_reply, p_iov->pf2vf_reply_phys);
555free_vf2pf_request:562free_vf2pf_request:
556 dma_free_coherent(&p_hwfn->cdev->pdev->dev,563 dma_free_coherent(&p_hwfn->cdev->pdev->dev,
557 sizeof(union vfpf_tlvs),564 sizeof(union vfpf_tlvs),
drivers/net/ethernet/sun/sunhme.c+5−1
@@ -3146,7 +3146,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, · 3145 unmodified lines
3146 if (err) {3146 if (err) {
3147 printk(KERN_ERR "happymeal(PCI): Cannot register net device, "3147 printk(KERN_ERR "happymeal(PCI): Cannot register net device, "
3148 "aborting.\n");3148 "aborting.\n");
3149 goto err_out_iounmap;3149 goto err_out_free_coherent;
3150 }3150 }
3151 3151
3152 pci_set_drvdata(pdev, hp);3152 pci_set_drvdata(pdev, hp);
@@ -3179,6 +3179,10 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, · 26 unmodified lines
3179 3179
3180 return 0;3180 return 0;
3181 3181
3182err_out_free_coherent:
3183 dma_free_coherent(hp->dma_dev, PAGE_SIZE,
3184 hp->happy_block, hp->hblock_dvma);
3185
3182err_out_iounmap:3186err_out_iounmap:
3183 iounmap(hp->gregs);3187 iounmap(hp->gregs);
3184 3188
drivers/net/ethernet/ti/cpts.c+3−1
@@ -568,7 +568,9 @@ int cpts_register(struct cpts *cpts) · 567 unmodified lines
568 for (i = 0; i < CPTS_MAX_EVENTS; i++)568 for (i = 0; i < CPTS_MAX_EVENTS; i++)
569 list_add(&cpts->pool_data[i].list, &cpts->pool);569 list_add(&cpts->pool_data[i].list, &cpts->pool);
570 570
571 clk_enable(cpts->refclk);571 err = clk_enable(cpts->refclk);
572 if (err)
573 return err;
572 574
573 cpts_write32(cpts, CPTS_EN, control);575 cpts_write32(cpts, CPTS_EN, control);
574 cpts_write32(cpts, TS_PEND_EN, int_enable);576 cpts_write32(cpts, TS_PEND_EN, int_enable);
drivers/net/ethernet/xilinx/xilinx_emaclite.c+3−1
@@ -1183,7 +1183,7 @@ static int xemaclite_of_probe(struct platform_device *ofdev) · 1182 unmodified lines
1183 if (rc) {1183 if (rc) {
1184 dev_err(dev,1184 dev_err(dev,
1185 "Cannot register network device, aborting\n");1185 "Cannot register network device, aborting\n");
1186 goto error;1186 goto put_node;
1187 }1187 }
1188 1188
1189 dev_info(dev,1189 dev_info(dev,
@@ -1191,6 +1191,8 @@ static int xemaclite_of_probe(struct platform_device *ofdev) · 1 unmodified line
1191 (unsigned long __force)ndev->mem_start, lp->base_addr, ndev->irq);1191 (unsigned long __force)ndev->mem_start, lp->base_addr, ndev->irq);
1192 return 0;1192 return 0;
1193 1193
1194put_node:
1195 of_node_put(lp->phy_node);
1194error:1196error:
1195 free_netdev(ndev);1197 free_netdev(ndev);
1196 return rc;1198 return rc;
drivers/net/phy/dp83822.c+1−1
@@ -274,7 +274,7 @@ static int dp83822_config_intr(struct phy_device *phydev) · 273 unmodified lines
274 if (err < 0)274 if (err < 0)
275 return err;275 return err;
276 276
277 err = phy_write(phydev, MII_DP83822_MISR1, 0);277 err = phy_write(phydev, MII_DP83822_MISR2, 0);
278 if (err < 0)278 if (err < 0)
279 return err;279 return err;
280 280
drivers/net/phy/meson-gxl.c+20−11
@@ -30,8 +30,12 @@ · 29 unmodified lines
30#define INTSRC_LINK_DOWN BIT(4)30#define INTSRC_LINK_DOWN BIT(4)
31#define INTSRC_REMOTE_FAULT BIT(5)31#define INTSRC_REMOTE_FAULT BIT(5)
32#define INTSRC_ANEG_COMPLETE BIT(6)32#define INTSRC_ANEG_COMPLETE BIT(6)
33#define INTSRC_ENERGY_DETECT BIT(7)
33#define INTSRC_MASK 3034#define INTSRC_MASK 30
34 35
36#define INT_SOURCES (INTSRC_LINK_DOWN | INTSRC_ANEG_COMPLETE | \
37 INTSRC_ENERGY_DETECT)
38
35#define BANK_ANALOG_DSP 039#define BANK_ANALOG_DSP 0
36#define BANK_WOL 140#define BANK_WOL 1
37#define BANK_BIST 341#define BANK_BIST 3
@@ -200,7 +204,6 @@ static int meson_gxl_ack_interrupt(struct phy_device *phydev) · 162 unmodified lines
200 204
201static int meson_gxl_config_intr(struct phy_device *phydev)205static int meson_gxl_config_intr(struct phy_device *phydev)
202{206{
203 u16 val;
204 int ret;207 int ret;
205 208
206 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {209 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
@@ -209,16 +212,9 @@ static int meson_gxl_config_intr(struct phy_device *phydev) · 2 unmodified lines
209 if (ret)212 if (ret)
210 return ret;213 return ret;
211 214
212 val = INTSRC_ANEG_PR215 ret = phy_write(phydev, INTSRC_MASK, INT_SOURCES);
213 | INTSRC_PARALLEL_FAULT
214 | INTSRC_ANEG_LP_ACK
215 | INTSRC_LINK_DOWN
216 | INTSRC_REMOTE_FAULT
217 | INTSRC_ANEG_COMPLETE;
218 ret = phy_write(phydev, INTSRC_MASK, val);
219 } else {216 } else {
220 val = 0;217 ret = phy_write(phydev, INTSRC_MASK, 0);
221 ret = phy_write(phydev, INTSRC_MASK, val);
222 218
223 /* Ack any pending IRQ */219 /* Ack any pending IRQ */
224 ret = meson_gxl_ack_interrupt(phydev);220 ret = meson_gxl_ack_interrupt(phydev);
@@ -237,10 +233,23 @@ static irqreturn_t meson_gxl_handle_interrupt(struct phy_device *phydev) · 12 unmodified lines
237 return IRQ_NONE;233 return IRQ_NONE;
238 }234 }
239 235
236 irq_status &= INT_SOURCES;
237
240 if (irq_status == 0)238 if (irq_status == 0)
241 return IRQ_NONE;239 return IRQ_NONE;
242 240
243 phy_trigger_machine(phydev);241 /* Aneg-complete interrupt is used for link-up detection */
242 if (phydev->autoneg == AUTONEG_ENABLE &&
243 irq_status == INTSRC_ENERGY_DETECT)
244 return IRQ_HANDLED;
245
246 /* Give PHY some time before MAC starts sending data. This works
247 * around an issue where network doesn't come up properly.
248 */
249 if (!(irq_status & INTSRC_LINK_DOWN))
250 phy_queue_state_machine(phydev, msecs_to_jiffies(100));
251 else
252 phy_trigger_machine(phydev);
244 253
245 return IRQ_HANDLED;254 return IRQ_HANDLED;
246}255}
drivers/net/usb/smsc95xx.c+20−8
@@ -84,9 +84,10 @@ static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index, · 83 unmodified lines
84 ret = fn(dev, USB_VENDOR_REQUEST_READ_REGISTER, USB_DIR_IN84 ret = fn(dev, USB_VENDOR_REQUEST_READ_REGISTER, USB_DIR_IN
85 | USB_TYPE_VENDOR | USB_RECIP_DEVICE,85 | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
86 0, index, &buf, 4);86 0, index, &buf, 4);
87 if (unlikely(ret < 0)) {87 if (ret < 0) {
88 netdev_warn(dev->net, "Failed to read reg index 0x%08x: %d\n",88 if (ret != -ENODEV)
89 index, ret);89 netdev_warn(dev->net, "Failed to read reg index 0x%08x: %d\n",
90 index, ret);
90 return ret;91 return ret;
91 }92 }
92 93
@@ -116,7 +117,7 @@ static int __must_check __smsc95xx_write_reg(struct usbnet *dev, u32 index, · 23 unmodified lines
116 ret = fn(dev, USB_VENDOR_REQUEST_WRITE_REGISTER, USB_DIR_OUT117 ret = fn(dev, USB_VENDOR_REQUEST_WRITE_REGISTER, USB_DIR_OUT
117 | USB_TYPE_VENDOR | USB_RECIP_DEVICE,118 | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
118 0, index, &buf, 4);119 0, index, &buf, 4);
119 if (unlikely(ret < 0))120 if (ret < 0 && ret != -ENODEV)
120 netdev_warn(dev->net, "Failed to write reg index 0x%08x: %d\n",121 netdev_warn(dev->net, "Failed to write reg index 0x%08x: %d\n",
121 index, ret);122 index, ret);
122 123
@@ -159,6 +160,9 @@ static int __must_check __smsc95xx_phy_wait_not_busy(struct usbnet *dev, · 36 unmodified lines
159 do {160 do {
160 ret = __smsc95xx_read_reg(dev, MII_ADDR, &val, in_pm);161 ret = __smsc95xx_read_reg(dev, MII_ADDR, &val, in_pm);
161 if (ret < 0) {162 if (ret < 0) {
163 /* Ignore -ENODEV error during disconnect() */
164 if (ret == -ENODEV)
165 return 0;
162 netdev_warn(dev->net, "Error reading MII_ACCESS\n");166 netdev_warn(dev->net, "Error reading MII_ACCESS\n");
163 return ret;167 return ret;
164 }168 }
@@ -194,7 +198,8 @@ static int __smsc95xx_mdio_read(struct usbnet *dev, int phy_id, int idx, · 29 unmodified lines
194 addr = mii_address_cmd(phy_id, idx, MII_READ_ | MII_BUSY_);198 addr = mii_address_cmd(phy_id, idx, MII_READ_ | MII_BUSY_);
195 ret = __smsc95xx_write_reg(dev, MII_ADDR, addr, in_pm);199 ret = __smsc95xx_write_reg(dev, MII_ADDR, addr, in_pm);
196 if (ret < 0) {200 if (ret < 0) {
197 netdev_warn(dev->net, "Error writing MII_ADDR\n");201 if (ret != -ENODEV)
202 netdev_warn(dev->net, "Error writing MII_ADDR\n");
198 goto done;203 goto done;
199 }204 }
200 205
@@ -206,7 +211,8 @@ static int __smsc95xx_mdio_read(struct usbnet *dev, int phy_id, int idx, · 5 unmodified lines
206 211
207 ret = __smsc95xx_read_reg(dev, MII_DATA, &val, in_pm);212 ret = __smsc95xx_read_reg(dev, MII_DATA, &val, in_pm);
208 if (ret < 0) {213 if (ret < 0) {
209 netdev_warn(dev->net, "Error reading MII_DATA\n");214 if (ret != -ENODEV)
215 netdev_warn(dev->net, "Error reading MII_DATA\n");
210 goto done;216 goto done;
211 }217 }
212 218
@@ -214,6 +220,10 @@ static int __smsc95xx_mdio_read(struct usbnet *dev, int phy_id, int idx, · 1 unmodified line
214 220
215done:221done:
216 mutex_unlock(&dev->phy_mutex);222 mutex_unlock(&dev->phy_mutex);
223
224 /* Ignore -ENODEV error during disconnect() */
225 if (ret == -ENODEV)
226 return 0;
217 return ret;227 return ret;
218}228}
219 229
@@ -235,7 +245,8 @@ static void __smsc95xx_mdio_write(struct usbnet *dev, int phy_id, · 15 unmodified lines
235 val = regval;245 val = regval;
236 ret = __smsc95xx_write_reg(dev, MII_DATA, val, in_pm);246 ret = __smsc95xx_write_reg(dev, MII_DATA, val, in_pm);
237 if (ret < 0) {247 if (ret < 0) {
238 netdev_warn(dev->net, "Error writing MII_DATA\n");248 if (ret != -ENODEV)
249 netdev_warn(dev->net, "Error writing MII_DATA\n");
239 goto done;250 goto done;
240 }251 }
241 252
@@ -243,7 +254,8 @@ static void __smsc95xx_mdio_write(struct usbnet *dev, int phy_id, · 1 unmodified line
243 addr = mii_address_cmd(phy_id, idx, MII_WRITE_ | MII_BUSY_);254 addr = mii_address_cmd(phy_id, idx, MII_WRITE_ | MII_BUSY_);
244 ret = __smsc95xx_write_reg(dev, MII_ADDR, addr, in_pm);255 ret = __smsc95xx_write_reg(dev, MII_ADDR, addr, in_pm);
245 if (ret < 0) {256 if (ret < 0) {
246 netdev_warn(dev->net, "Error writing MII_ADDR\n");257 if (ret != -ENODEV)
258 netdev_warn(dev->net, "Error writing MII_ADDR\n");
247 goto done;259 goto done;
248 }260 }
249 261
drivers/nfc/port100.c+2−0
@@ -1612,7 +1612,9 @@ free_nfc_dev: · 1611 unmodified lines
1612 nfc_digital_free_device(dev->nfc_digital_dev);1612 nfc_digital_free_device(dev->nfc_digital_dev);
1613 1613
1614error:1614error:
1615 usb_kill_urb(dev->in_urb);
1615 usb_free_urb(dev->in_urb);1616 usb_free_urb(dev->in_urb);
1617 usb_kill_urb(dev->out_urb);
1616 usb_free_urb(dev->out_urb);1618 usb_free_urb(dev->out_urb);
1617 usb_put_dev(dev->udev);1619 usb_put_dev(dev->udev);
1618 1620
include/linux/mlx5/mlx5_ifc.h+2−3
@@ -3434,7 +3434,6 @@ enum { · 3433 unmodified lines
3434enum {3434enum {
3435 MLX5_TIRC_PACKET_MERGE_MASK_IPV4_LRO = BIT(0),3435 MLX5_TIRC_PACKET_MERGE_MASK_IPV4_LRO = BIT(0),
3436 MLX5_TIRC_PACKET_MERGE_MASK_IPV6_LRO = BIT(1),3436 MLX5_TIRC_PACKET_MERGE_MASK_IPV6_LRO = BIT(1),
3437 MLX5_TIRC_PACKET_MERGE_MASK_SHAMPO = BIT(2),
3438};3437};
3439 3438
3440enum {3439enum {
@@ -9900,8 +9899,8 @@ struct mlx5_ifc_bufferx_reg_bits { · 6459 unmodified lines
9900 u8 reserved_at_0[0x6];9899 u8 reserved_at_0[0x6];
9901 u8 lossy[0x1];9900 u8 lossy[0x1];
9902 u8 epsb[0x1];9901 u8 epsb[0x1];
9903 u8 reserved_at_8[0xc];9902 u8 reserved_at_8[0x8];
9904 u8 size[0xc];9903 u8 size[0x10];
9905 9904
9906 u8 xoff_threshold[0x10];9905 u8 xoff_threshold[0x10];
9907 u8 xon_threshold[0x10];9906 u8 xon_threshold[0x10];
include/linux/netdevice.h+2−0
@@ -4602,6 +4602,8 @@ int skb_csum_hwoffload_help(struct sk_buff *skb, · 4601 unmodified lines
4602 4602
4603struct sk_buff *__skb_gso_segment(struct sk_buff *skb,4603struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
4604 netdev_features_t features, bool tx_path);4604 netdev_features_t features, bool tx_path);
4605struct sk_buff *skb_eth_gso_segment(struct sk_buff *skb,
4606 netdev_features_t features, __be16 type);
4605struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb,4607struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb,
4606 netdev_features_t features);4608 netdev_features_t features);
4607 4609
include/linux/phy.h+2−2
@@ -87,8 +87,8 @@ extern const int phy_10gbit_features_array[1]; · 86 unmodified lines
87 *87 *
88 * @PHY_INTERFACE_MODE_NA: Not Applicable - don't touch88 * @PHY_INTERFACE_MODE_NA: Not Applicable - don't touch
89 * @PHY_INTERFACE_MODE_INTERNAL: No interface, MAC and PHY combined89 * @PHY_INTERFACE_MODE_INTERNAL: No interface, MAC and PHY combined
90 * @PHY_INTERFACE_MODE_MII: Median-independent interface90 * @PHY_INTERFACE_MODE_MII: Media-independent interface
91 * @PHY_INTERFACE_MODE_GMII: Gigabit median-independent interface91 * @PHY_INTERFACE_MODE_GMII: Gigabit media-independent interface
92 * @PHY_INTERFACE_MODE_SGMII: Serial gigabit media-independent interface92 * @PHY_INTERFACE_MODE_SGMII: Serial gigabit media-independent interface
93 * @PHY_INTERFACE_MODE_TBI: Ten Bit Interface93 * @PHY_INTERFACE_MODE_TBI: Ten Bit Interface
94 * @PHY_INTERFACE_MODE_REVMII: Reverse Media Independent Interface94 * @PHY_INTERFACE_MODE_REVMII: Reverse Media Independent Interface
include/net/esp.h+2−0
@@ -4,6 +4,8 @@ · 3 unmodified lines
4 4
5#include <linux/skbuff.h>5#include <linux/skbuff.h>
6 6
7#define ESP_SKB_FRAG_MAXSIZE (PAGE_SIZE << SKB_FRAG_PAGE_ORDER)
8
7struct ip_esp_hdr;9struct ip_esp_hdr;
8 10
9static inline struct ip_esp_hdr *ip_esp_hdr(const struct sk_buff *skb)11static inline struct ip_esp_hdr *ip_esp_hdr(const struct sk_buff *skb)
net/ax25/af_ax25.c+7−0
@@ -87,6 +87,13 @@ again: · 86 unmodified lines
87 ax25_for_each(s, &ax25_list) {87 ax25_for_each(s, &ax25_list) {
88 if (s->ax25_dev == ax25_dev) {88 if (s->ax25_dev == ax25_dev) {
89 sk = s->sk;89 sk = s->sk;
90 if (!sk) {
91 spin_unlock_bh(&ax25_list_lock);
92 s->ax25_dev = NULL;
93 ax25_disconnect(s, ENETUNREACH);
94 spin_lock_bh(&ax25_list_lock);
95 goto again;
96 }
90 sock_hold(sk);97 sock_hold(sk);
91 spin_unlock_bh(&ax25_list_lock);98 spin_unlock_bh(&ax25_list_lock);
92 lock_sock(sk);99 lock_sock(sk);
net/bluetooth/hci_sync.c+23−26
@@ -276,40 +276,37 @@ EXPORT_SYMBOL(__hci_cmd_sync_status); · 275 unmodified lines
276static void hci_cmd_sync_work(struct work_struct *work)276static void hci_cmd_sync_work(struct work_struct *work)
277{277{
278 struct hci_dev *hdev = container_of(work, struct hci_dev, cmd_sync_work);278 struct hci_dev *hdev = container_of(work, struct hci_dev, cmd_sync_work);
279 struct hci_cmd_sync_work_entry *entry;
280 hci_cmd_sync_work_func_t func;
281 hci_cmd_sync_work_destroy_t destroy;
282 void *data;
283 279
284 bt_dev_dbg(hdev, "");280 bt_dev_dbg(hdev, "");
285 281
286 mutex_lock(&hdev->cmd_sync_work_lock);282 /* Dequeue all entries and run them */
287 entry = list_first_entry(&hdev->cmd_sync_work_list,283 while (1) {
288 struct hci_cmd_sync_work_entry, list);284 struct hci_cmd_sync_work_entry *entry;
289 if (entry) {
290 list_del(&entry->list);
291 func = entry->func;
292 data = entry->data;
293 destroy = entry->destroy;
294 kfree(entry);
295 } else {
296 func = NULL;
297 data = NULL;
298 destroy = NULL;
299 }
300 mutex_unlock(&hdev->cmd_sync_work_lock);
301 285
302 if (func) {286 mutex_lock(&hdev->cmd_sync_work_lock);
303 int err;287 entry = list_first_entry_or_null(&hdev->cmd_sync_work_list,
288 struct hci_cmd_sync_work_entry,
289 list);
290 if (entry)
291 list_del(&entry->list);
292 mutex_unlock(&hdev->cmd_sync_work_lock);
293
294 if (!entry)
295 break;
304 296
305 hci_req_sync_lock(hdev);297 bt_dev_dbg(hdev, "entry %p", entry);
306 298
307 err = func(hdev, data);299 if (entry->func) {
300 int err;
308 301
309 if (destroy)302 hci_req_sync_lock(hdev);
310 destroy(hdev, data, err);303 err = entry->func(hdev, entry->data);
304 if (entry->destroy)
305 entry->destroy(hdev, entry->data, err);
306 hci_req_sync_unlock(hdev);
307 }
311 308
312 hci_req_sync_unlock(hdev);309 kfree(entry);
313 }310 }
314}311}
315 312
net/bluetooth/mgmt.c+1−1
@@ -4541,9 +4541,9 @@ static int set_device_flags(struct sock *sk, struct hci_dev *hdev, void *data, · 4540 unmodified lines
4541 }4541 }
4542 }4542 }
4543 4543
4544done:
4545 hci_dev_unlock(hdev);4544 hci_dev_unlock(hdev);
4546 4545
4546done:
4547 if (status == MGMT_STATUS_SUCCESS)4547 if (status == MGMT_STATUS_SUCCESS)
4548 device_flags_changed(sk, hdev, &cp->addr.bdaddr, cp->addr.type,4548 device_flags_changed(sk, hdev, &cp->addr.bdaddr, cp->addr.type,
4549 supported_flags, current_flags);4549 supported_flags, current_flags);
net/core/gro.c+25−0
@@ -92,6 +92,31 @@ void dev_remove_offload(struct packet_offload *po) · 91 unmodified lines
92}92}
93EXPORT_SYMBOL(dev_remove_offload);93EXPORT_SYMBOL(dev_remove_offload);
94 94
95/**
96 * skb_eth_gso_segment - segmentation handler for ethernet protocols.
97 * @skb: buffer to segment
98 * @features: features for the output path (see dev->features)
99 * @type: Ethernet Protocol ID
100 */
101struct sk_buff *skb_eth_gso_segment(struct sk_buff *skb,
102 netdev_features_t features, __be16 type)
103{
104 struct sk_buff *segs = ERR_PTR(-EPROTONOSUPPORT);
105 struct packet_offload *ptype;
106
107 rcu_read_lock();
108 list_for_each_entry_rcu(ptype, &offload_base, list) {
109 if (ptype->type == type && ptype->callbacks.gso_segment) {
110 segs = ptype->callbacks.gso_segment(skb, features);
111 break;
112 }
113 }
114 rcu_read_unlock();
115
116 return segs;
117}
118EXPORT_SYMBOL(skb_eth_gso_segment);
119
95/**120/**
96 * skb_mac_gso_segment - mac layer segmentation handler.121 * skb_mac_gso_segment - mac layer segmentation handler.
97 * @skb: buffer to segment122 * @skb: buffer to segment
net/core/xdp.c+2−1
@@ -357,7 +357,8 @@ int xdp_rxq_info_reg_mem_model(struct xdp_rxq_info *xdp_rxq, · 356 unmodified lines
357 if (IS_ERR(xdp_alloc))357 if (IS_ERR(xdp_alloc))
358 return PTR_ERR(xdp_alloc);358 return PTR_ERR(xdp_alloc);
359 359
360 trace_mem_connect(xdp_alloc, xdp_rxq);360 if (trace_mem_connect_enabled() && xdp_alloc)
361 trace_mem_connect(xdp_alloc, xdp_rxq);
361 return 0;362 return 0;
362}363}
363 364
net/dsa/dsa2.c+3−3
@@ -1058,7 +1058,7 @@ static int dsa_tree_setup_switches(struct dsa_switch_tree *dst) · 1057 unmodified lines
1058static int dsa_tree_setup_master(struct dsa_switch_tree *dst)1058static int dsa_tree_setup_master(struct dsa_switch_tree *dst)
1059{1059{
1060 struct dsa_port *dp;1060 struct dsa_port *dp;
1061 int err;1061 int err = 0;
1062 1062
1063 rtnl_lock();1063 rtnl_lock();
1064 1064
@@ -1066,13 +1066,13 @@ static int dsa_tree_setup_master(struct dsa_switch_tree *dst) · 1 unmodified line
1066 if (dsa_port_is_cpu(dp)) {1066 if (dsa_port_is_cpu(dp)) {
1067 err = dsa_master_setup(dp->master, dp);1067 err = dsa_master_setup(dp->master, dp);
1068 if (err)1068 if (err)
1069 return err;1069 break;
1070 }1070 }
1071 }1071 }
1072 1072
1073 rtnl_unlock();1073 rtnl_unlock();
1074 1074
1075 return 0;1075 return err;
1076}1076}
1077 1077
1078static void dsa_tree_teardown_master(struct dsa_switch_tree *dst)1078static void dsa_tree_teardown_master(struct dsa_switch_tree *dst)
net/ipv4/esp4.c+5−0
@@ -446,6 +446,7 @@ int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info * · 445 unmodified lines
446 struct page *page;446 struct page *page;
447 struct sk_buff *trailer;447 struct sk_buff *trailer;
448 int tailen = esp->tailen;448 int tailen = esp->tailen;
449 unsigned int allocsz;
449 450
450 /* this is non-NULL only with TCP/UDP Encapsulation */451 /* this is non-NULL only with TCP/UDP Encapsulation */
451 if (x->encap) {452 if (x->encap) {
@@ -455,6 +456,10 @@ int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info * · 3 unmodified lines
455 return err;456 return err;
456 }457 }
457 458
459 allocsz = ALIGN(skb->data_len + tailen, L1_CACHE_BYTES);
460 if (allocsz > ESP_SKB_FRAG_MAXSIZE)
461 goto cow;
462
458 if (!skb_cloned(skb)) {463 if (!skb_cloned(skb)) {
459 if (tailen <= skb_tailroom(skb)) {464 if (tailen <= skb_tailroom(skb)) {
460 nfrags = 1;465 nfrags = 1;
net/ipv4/esp4_offload.c+4−2
@@ -110,8 +110,7 @@ static struct sk_buff *xfrm4_tunnel_gso_segment(struct xfrm_state *x, · 109 unmodified lines
110 struct sk_buff *skb,110 struct sk_buff *skb,
111 netdev_features_t features)111 netdev_features_t features)
112{112{
113 __skb_push(skb, skb->mac_len);113 return skb_eth_gso_segment(skb, features, htons(ETH_P_IP));
114 return skb_mac_gso_segment(skb, features);
115}114}
116 115
117static struct sk_buff *xfrm4_transport_gso_segment(struct xfrm_state *x,116static struct sk_buff *xfrm4_transport_gso_segment(struct xfrm_state *x,
@@ -160,6 +159,9 @@ static struct sk_buff *xfrm4_beet_gso_segment(struct xfrm_state *x, · 42 unmodified lines
160 skb_shinfo(skb)->gso_type |= SKB_GSO_TCPV4;159 skb_shinfo(skb)->gso_type |= SKB_GSO_TCPV4;
161 }160 }
162 161
162 if (proto == IPPROTO_IPV6)
163 skb_shinfo(skb)->gso_type |= SKB_GSO_IPXIP4;
164
163 __skb_pull(skb, skb_transport_offset(skb));165 __skb_pull(skb, skb_transport_offset(skb));
164 ops = rcu_dereference(inet_offloads[proto]);166 ops = rcu_dereference(inet_offloads[proto]);
165 if (likely(ops && ops->callbacks.gso_segment))167 if (likely(ops && ops->callbacks.gso_segment))
net/ipv6/esp6.c+5−0
@@ -482,6 +482,7 @@ int esp6_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info · 481 unmodified lines
482 struct page *page;482 struct page *page;
483 struct sk_buff *trailer;483 struct sk_buff *trailer;
484 int tailen = esp->tailen;484 int tailen = esp->tailen;
485 unsigned int allocsz;
485 486
486 if (x->encap) {487 if (x->encap) {
487 int err = esp6_output_encap(x, skb, esp);488 int err = esp6_output_encap(x, skb, esp);
@@ -490,6 +491,10 @@ int esp6_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info · 2 unmodified lines
490 return err;491 return err;
491 }492 }
492 493
494 allocsz = ALIGN(skb->data_len + tailen, L1_CACHE_BYTES);
495 if (allocsz > ESP_SKB_FRAG_MAXSIZE)
496 goto cow;
497
493 if (!skb_cloned(skb)) {498 if (!skb_cloned(skb)) {
494 if (tailen <= skb_tailroom(skb)) {499 if (tailen <= skb_tailroom(skb)) {
495 nfrags = 1;500 nfrags = 1;
net/ipv6/esp6_offload.c+4−2
@@ -145,8 +145,7 @@ static struct sk_buff *xfrm6_tunnel_gso_segment(struct xfrm_state *x, · 144 unmodified lines
145 struct sk_buff *skb,145 struct sk_buff *skb,
146 netdev_features_t features)146 netdev_features_t features)
147{147{
148 __skb_push(skb, skb->mac_len);148 return skb_eth_gso_segment(skb, features, htons(ETH_P_IPV6));
149 return skb_mac_gso_segment(skb, features);
150}149}
151 150
152static struct sk_buff *xfrm6_transport_gso_segment(struct xfrm_state *x,151static struct sk_buff *xfrm6_transport_gso_segment(struct xfrm_state *x,
@@ -199,6 +198,9 @@ static struct sk_buff *xfrm6_beet_gso_segment(struct xfrm_state *x, · 46 unmodified lines
199 ipv6_skip_exthdr(skb, 0, &proto, &frag);198 ipv6_skip_exthdr(skb, 0, &proto, &frag);
200 }199 }
201 200
201 if (proto == IPPROTO_IPIP)
202 skb_shinfo(skb)->gso_type |= SKB_GSO_IPXIP6;
203
202 __skb_pull(skb, skb_transport_offset(skb));204 __skb_pull(skb, skb_transport_offset(skb));
203 ops = rcu_dereference(inet6_offloads[proto]);205 ops = rcu_dereference(inet6_offloads[proto]);
204 if (likely(ops && ops->callbacks.gso_segment))206 if (likely(ops && ops->callbacks.gso_segment))
net/ipv6/xfrm6_output.c+16−0
@@ -45,6 +45,19 @@ static int __xfrm6_output_finish(struct net *net, struct sock *sk, struct sk_buf · 44 unmodified lines
45 return xfrm_output(sk, skb);45 return xfrm_output(sk, skb);
46}46}
47 47
48static int xfrm6_noneed_fragment(struct sk_buff *skb)
49{
50 struct frag_hdr *fh;
51 u8 prevhdr = ipv6_hdr(skb)->nexthdr;
52
53 if (prevhdr != NEXTHDR_FRAGMENT)
54 return 0;
55 fh = (struct frag_hdr *)(skb->data + sizeof(struct ipv6hdr));
56 if (fh->nexthdr == NEXTHDR_ESP || fh->nexthdr == NEXTHDR_AUTH)
57 return 1;
58 return 0;
59}
60
48static int __xfrm6_output(struct net *net, struct sock *sk, struct sk_buff *skb)61static int __xfrm6_output(struct net *net, struct sock *sk, struct sk_buff *skb)
49{62{
50 struct dst_entry *dst = skb_dst(skb);63 struct dst_entry *dst = skb_dst(skb);
@@ -73,6 +86,9 @@ static int __xfrm6_output(struct net *net, struct sock *sk, struct sk_buff *skb) · 22 unmodified lines
73 xfrm6_local_rxpmtu(skb, mtu);86 xfrm6_local_rxpmtu(skb, mtu);
74 kfree_skb(skb);87 kfree_skb(skb);
75 return -EMSGSIZE;88 return -EMSGSIZE;
89 } else if (toobig && xfrm6_noneed_fragment(skb)) {
90 skb->ignore_df = 1;
91 goto skip_frag;
76 } else if (!skb->ignore_df && toobig && skb->sk) {92 } else if (!skb->ignore_df && toobig && skb->sk) {
77 xfrm_local_error(skb, mtu);93 xfrm_local_error(skb, mtu);
78 kfree_skb(skb);94 kfree_skb(skb);
net/sctp/diag.c+3−6
@@ -61,10 +61,6 @@ static void inet_diag_msg_sctpasoc_fill(struct inet_diag_msg *r, · 60 unmodified lines
61 r->idiag_timer = SCTP_EVENT_TIMEOUT_T3_RTX;61 r->idiag_timer = SCTP_EVENT_TIMEOUT_T3_RTX;
62 r->idiag_retrans = asoc->rtx_data_chunks;62 r->idiag_retrans = asoc->rtx_data_chunks;
63 r->idiag_expires = jiffies_to_msecs(t3_rtx->expires - jiffies);63 r->idiag_expires = jiffies_to_msecs(t3_rtx->expires - jiffies);
64 } else {
65 r->idiag_timer = 0;
66 r->idiag_retrans = 0;
67 r->idiag_expires = 0;
68 }64 }
69}65}
70 66
@@ -144,13 +140,14 @@ static int inet_sctp_diag_fill(struct sock *sk, struct sctp_association *asoc, · 73 unmodified lines
144 r = nlmsg_data(nlh);140 r = nlmsg_data(nlh);
145 BUG_ON(!sk_fullsock(sk));141 BUG_ON(!sk_fullsock(sk));
146 142
143 r->idiag_timer = 0;
144 r->idiag_retrans = 0;
145 r->idiag_expires = 0;
147 if (asoc) {146 if (asoc) {
148 inet_diag_msg_sctpasoc_fill(r, sk, asoc);147 inet_diag_msg_sctpasoc_fill(r, sk, asoc);
149 } else {148 } else {
150 inet_diag_msg_common_fill(r, sk);149 inet_diag_msg_common_fill(r, sk);
151 r->idiag_state = sk->sk_state;150 r->idiag_state = sk->sk_state;
152 r->idiag_timer = 0;
153 r->idiag_retrans = 0;
154 }151 }
155 152
156 if (inet_diag_msg_attrs_fill(sk, skb, r, ext, user_ns, net_admin))153 if (inet_diag_msg_attrs_fill(sk, skb, r, ext, user_ns, net_admin))
net/tipc/bearer.c+7−5
@@ -352,16 +352,18 @@ static int tipc_enable_bearer(struct net *net, const char *name, · 351 unmodified lines
352 goto rejected;352 goto rejected;
353 }353 }
354 354
355 test_and_set_bit_lock(0, &b->up);355 /* Create monitoring data before accepting activate messages */
356 rcu_assign_pointer(tn->bearer_list[bearer_id], b);
357 if (skb)
358 tipc_bearer_xmit_skb(net, bearer_id, skb, &b->bcast_addr);
359
360 if (tipc_mon_create(net, bearer_id)) {356 if (tipc_mon_create(net, bearer_id)) {
361 bearer_disable(net, b);357 bearer_disable(net, b);
358 kfree_skb(skb);
362 return -ENOMEM;359 return -ENOMEM;
363 }360 }
364 361
362 test_and_set_bit_lock(0, &b->up);
363 rcu_assign_pointer(tn->bearer_list[bearer_id], b);
364 if (skb)
365 tipc_bearer_xmit_skb(net, bearer_id, skb, &b->bcast_addr);
366
365 pr_info("Enabled bearer <%s>, priority %u\n", name, prio);367 pr_info("Enabled bearer <%s>, priority %u\n", name, prio);
366 368
367 return res;369 return res;
net/tipc/link.c+5−4
@@ -2286,6 +2286,11 @@ static int tipc_link_proto_rcv(struct tipc_link *l, struct sk_buff *skb, · 2285 unmodified lines
2286 break;2286 break;
2287 2287
2288 case STATE_MSG:2288 case STATE_MSG:
2289 /* Validate Gap ACK blocks, drop if invalid */
2290 glen = tipc_get_gap_ack_blks(&ga, l, hdr, true);
2291 if (glen > dlen)
2292 break;
2293
2289 l->rcv_nxt_state = msg_seqno(hdr) + 1;2294 l->rcv_nxt_state = msg_seqno(hdr) + 1;
2290 2295
2291 /* Update own tolerance if peer indicates a non-zero value */2296 /* Update own tolerance if peer indicates a non-zero value */
@@ -2311,10 +2316,6 @@ static int tipc_link_proto_rcv(struct tipc_link *l, struct sk_buff *skb, · 19 unmodified lines
2311 break;2316 break;
2312 }2317 }
2313 2318
2314 /* Receive Gap ACK blocks from peer if any */
2315 glen = tipc_get_gap_ack_blks(&ga, l, hdr, true);
2316 if(glen > dlen)
2317 break;
2318 tipc_mon_rcv(l->net, data + glen, dlen - glen, l->addr,2319 tipc_mon_rcv(l->net, data + glen, dlen - glen, l->addr,
2319 &l->mon_state, l->bearer_id);2320 &l->mon_state, l->bearer_id);
2320 2321
net/xfrm/xfrm_interface.c+4−1
@@ -304,7 +304,10 @@ xfrmi_xmit2(struct sk_buff *skb, struct net_device *dev, struct flowi *fl) · 303 unmodified lines
304 if (mtu < IPV6_MIN_MTU)304 if (mtu < IPV6_MIN_MTU)
305 mtu = IPV6_MIN_MTU;305 mtu = IPV6_MIN_MTU;
306 306
307 icmpv6_ndo_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);307 if (skb->len > 1280)
308 icmpv6_ndo_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
309 else
310 goto xmit;
308 } else {311 } else {
309 if (!(ip_hdr(skb)->frag_off & htons(IP_DF)))312 if (!(ip_hdr(skb)->frag_off & htons(IP_DF)))
310 goto xmit;313 goto xmit;
net/xfrm/xfrm_user.c+3−18
@@ -630,13 +630,8 @@ static struct xfrm_state *xfrm_state_construct(struct net *net, · 629 unmodified lines
630 630
631 xfrm_smark_init(attrs, &x->props.smark);631 xfrm_smark_init(attrs, &x->props.smark);
632 632
633 if (attrs[XFRMA_IF_ID]) {633 if (attrs[XFRMA_IF_ID])
634 x->if_id = nla_get_u32(attrs[XFRMA_IF_ID]);634 x->if_id = nla_get_u32(attrs[XFRMA_IF_ID]);
635 if (!x->if_id) {
636 err = -EINVAL;
637 goto error;
638 }
639 }
640 635
641 err = __xfrm_init_state(x, false, attrs[XFRMA_OFFLOAD_DEV]);636 err = __xfrm_init_state(x, false, attrs[XFRMA_OFFLOAD_DEV]);
642 if (err)637 if (err)
@@ -1432,13 +1427,8 @@ static int xfrm_alloc_userspi(struct sk_buff *skb, struct nlmsghdr *nlh, · 789 unmodified lines
1432 1427
1433 mark = xfrm_mark_get(attrs, &m);1428 mark = xfrm_mark_get(attrs, &m);
1434 1429
1435 if (attrs[XFRMA_IF_ID]) {1430 if (attrs[XFRMA_IF_ID])
1436 if_id = nla_get_u32(attrs[XFRMA_IF_ID]);1431 if_id = nla_get_u32(attrs[XFRMA_IF_ID]);
1437 if (!if_id) {
1438 err = -EINVAL;
1439 goto out_noput;
1440 }
1441 }
1442 1432
1443 if (p->info.seq) {1433 if (p->info.seq) {
1444 x = xfrm_find_acq_byseq(net, mark, p->info.seq);1434 x = xfrm_find_acq_byseq(net, mark, p->info.seq);
@@ -1751,13 +1741,8 @@ static struct xfrm_policy *xfrm_policy_construct(struct net *net, struct xfrm_us · 306 unmodified lines
1751 1741
1752 xfrm_mark_get(attrs, &xp->mark);1742 xfrm_mark_get(attrs, &xp->mark);
1753 1743
1754 if (attrs[XFRMA_IF_ID]) {1744 if (attrs[XFRMA_IF_ID])
1755 xp->if_id = nla_get_u32(attrs[XFRMA_IF_ID]);1745 xp->if_id = nla_get_u32(attrs[XFRMA_IF_ID]);
1756 if (!xp->if_id) {
1757 err = -EINVAL;
1758 goto error;
1759 }
1760 }
1761 1746
1762 return xp;1747 return xp;
1763 error:1748 error:
tools/testing/selftests/net/pmtu.sh+17−4
@@ -374,6 +374,16 @@ run_cmd() { · 373 unmodified lines
374 return $rc374 return $rc
375}375}
376 376
377run_cmd_bg() {
378 cmd="$*"
379
380 if [ "$VERBOSE" = "1" ]; then
381 printf " COMMAND: %s &\n" "${cmd}"
382 fi
383
384 $cmd 2>&1 &
385}
386
377# Find the auto-generated name for this namespace387# Find the auto-generated name for this namespace
378nsname() {388nsname() {
379 eval echo \$NS_$1389 eval echo \$NS_$1
@@ -670,10 +680,10 @@ setup_nettest_xfrm() { · 290 unmodified lines
670 [ ${1} -eq 6 ] && proto="-6" || proto=""680 [ ${1} -eq 6 ] && proto="-6" || proto=""
671 port=${2}681 port=${2}
672 682
673 run_cmd ${ns_a} nettest ${proto} -q -D -s -x -p ${port} -t 5 &683 run_cmd_bg "${ns_a}" nettest "${proto}" -q -D -s -x -p "${port}" -t 5
674 nettest_pids="${nettest_pids} $!"684 nettest_pids="${nettest_pids} $!"
675 685
676 run_cmd ${ns_b} nettest ${proto} -q -D -s -x -p ${port} -t 5 &686 run_cmd_bg "${ns_b}" nettest "${proto}" -q -D -s -x -p "${port}" -t 5
677 nettest_pids="${nettest_pids} $!"687 nettest_pids="${nettest_pids} $!"
678}688}
679 689
@@ -865,7 +875,6 @@ setup_ovs_bridge() { · 185 unmodified lines
865setup() {875setup() {
866 [ "$(id -u)" -ne 0 ] && echo " need to run as root" && return $ksft_skip876 [ "$(id -u)" -ne 0 ] && echo " need to run as root" && return $ksft_skip
867 877
868 cleanup
869 for arg do878 for arg do
870 eval setup_${arg} || { echo " ${arg} not supported"; return 1; }879 eval setup_${arg} || { echo " ${arg} not supported"; return 1; }
871 done880 done
@@ -876,7 +885,7 @@ trace() { · 4 unmodified lines
876 885
877 for arg do886 for arg do
878 [ "${ns_cmd}" = "" ] && ns_cmd="${arg}" && continue887 [ "${ns_cmd}" = "" ] && ns_cmd="${arg}" && continue
879 ${ns_cmd} tcpdump -s 0 -i "${arg}" -w "${name}_${arg}.pcap" 2> /dev/null &888 ${ns_cmd} tcpdump --immediate-mode -s 0 -i "${arg}" -w "${name}_${arg}.pcap" 2> /dev/null &
880 tcpdump_pids="${tcpdump_pids} $!"889 tcpdump_pids="${tcpdump_pids} $!"
881 ns_cmd=890 ns_cmd=
882 done891 done
@@ -1836,6 +1845,10 @@ run_test() { · 953 unmodified lines
1836 1845
1837 unset IFS1846 unset IFS
1838 1847
1848 # Since cleanup() relies on variables modified by this subshell, it
1849 # has to run in this context.
1850 trap cleanup EXIT
1851
1839 if [ "$VERBOSE" = "1" ]; then1852 if [ "$VERBOSE" = "1" ]; then
1840 printf "\n##########################################################################\n\n"1853 printf "\n##########################################################################\n\n"
1841 fi1854 fi

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t