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
20052005 }
20062006 /* Allocate memory for FIFOS */
20072007 /* 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+ }
20092013 buffer = dma_alloc_coherent(&hc->pdev->dev, 0x8000, &hc->hw.dmahandle,
20102014 GFP_KERNEL);
20112015 /* 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
192192 int dsp_pipeline_build(struct dsp_pipeline *pipeline, const char *cfg)
193193 {
194194 int found = 0;
195− char *dup, *tok, *name, *args;
195+ char *dup, *next, *tok, *name, *args;
196196 struct dsp_element_entry *entry, *n;
197197 struct dsp_pipeline_entry *pipeline_entry;
198198 struct mISDN_dsp_element *elem;
@@ -203,10 +203,10 @@ int dsp_pipeline_build(struct dsp_pipeline *pipeline, const char *cfg) · 4 unmodified lines
203203 if (!list_empty(&pipeline->list))
204204 _dsp_pipeline_destroy(pipeline);
205205
206− dup = kstrdup(cfg, GFP_ATOMIC);
206+ dup = next = kstrdup(cfg, GFP_ATOMIC);
207207 if (!dup)
208208 return 0;
209− while ((tok = strsep(&dup, "|"))) {
209+ while ((tok = strsep(&next, "|"))) {
210210 if (!strlen(tok))
211211 continue;
212212 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
29362936
29372937 phylink_set_port_modes(mask);
29382938
2939− if (state->interface != PHY_INTERFACE_MODE_TRGMII ||
2939+ if (state->interface != PHY_INTERFACE_MODE_TRGMII &&
29402940 !phy_interface_mode_is_8023z(state->interface)) {
29412941 phylink_set(mask, 10baseT_Half);
29422942 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
405405 static int mcf8390_probe(struct platform_device *pdev)
406406 {
407407 struct net_device *dev;
408− struct resource *mem, *irq;
408+ struct resource *mem;
409409 resource_size_t msize;
410− int ret;
410+ int ret, irq;
411411
412− irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
413− if (irq == NULL) {
412+ irq = platform_get_irq(pdev, 0);
413+ if (irq < 0) {
414414 dev_err(&pdev->dev, "no IRQ specified?\n");
415415 return -ENXIO;
416416 }
@@ -433,7 +433,7 @@ static int mcf8390_probe(struct platform_device *pdev) · 16 unmodified lines
433433 SET_NETDEV_DEV(dev, &pdev->dev);
434434 platform_set_drvdata(pdev, dev);
435435
436− dev->irq = irq->start;
436+ dev->irq = irq;
437437 dev->base_addr = mem->start;
438438
439439 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
132132 {
133133 struct arc_emac_mdio_bus_data *data = &priv->bus_data;
134134 struct device_node *np = priv->dev->of_node;
135+ const char *name = "Synopsys MII Bus";
135136 struct mii_bus *bus;
136137 int error;
137138
@@ -142,7 +143,7 @@ int arc_mdio_probe(struct arc_emac_priv *priv) · 4 unmodified lines
142143 priv->bus = bus;
143144 bus->priv = priv;
144145 bus->parent = priv->dev;
145− bus->name = "Synopsys MII Bus";
146+ bus->name = name;
146147 bus->read = &arc_mdio_read;
147148 bus->write = &arc_mdio_write;
148149 bus->reset = &arc_mdio_reset;
@@ -167,7 +168,7 @@ int arc_mdio_probe(struct arc_emac_priv *priv) · 18 unmodified lines
167168 if (error) {
168169 mdiobus_free(bus);
169170 return dev_err_probe(priv->dev, error,
170− "cannot register MDIO bus %s\n", bus->name);
171+ "cannot register MDIO bus %s\n", name);
171172 }
172173
173174 return 0;
drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c+7−0
@@ -40,6 +40,13 @@ · 39 unmodified lines
4040 void bcmgenet_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
4141 {
4242 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+ }
4350
4451 wol->supported = WAKE_MAGIC | WAKE_MAGICSECURE | WAKE_FILTER;
4552 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
15731573 if (work_done < budget) {
15741574 napi_complete_done(napi, work_done);
15751575
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+ */
15771584 status = macb_readl(bp, RSR);
15781585 if (status) {
15791586 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
15811588 napi_reschedule(napi);
15821589 } else {
15831590 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+ }
15841607 }
15851608 }
15861609
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
14641464 ptp_node = of_find_compatible_node(NULL, NULL, "fsl,etsec-ptp");
14651465 if (ptp_node) {
14661466 ptp_dev = of_find_device_by_node(ptp_node);
1467+ of_node_put(ptp_node);
14671468 if (ptp_dev)
14681469 ptp = platform_get_drvdata(ptp_dev);
14691470 }
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
742742 vsi = pf->vsi[vf->lan_vsi_idx];
743743 dev_info(&pf->pdev->dev, "vf %2d: VSI id=%d, seid=%d, qps=%d\n",
744744 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",
746− vf->num_mdd_events,
747− vf->num_invalid_msgs,
748− vf->num_valid_msgs);
745+ dev_info(&pf->pdev->dev, " num MDD=%lld\n",
746+ vf->num_mdd_events);
749747 } else {
750748 dev_info(&pf->pdev->dev, "invalid VF id %d\n", vf_id);
751749 }
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c+7−50
@@ -1917,19 +1917,17 @@ sriov_configure_out: · 1916 unmodified lines
19171917 /***********************virtual channel routines******************/
19181918
19191919 /**
1920− * i40e_vc_send_msg_to_vf_ex
1920+ * i40e_vc_send_msg_to_vf
19211921 * @vf: pointer to the VF info
19221922 * @v_opcode: virtual channel opcode
19231923 * @v_retval: virtual channel return value
19241924 * @msg: pointer to the msg buffer
19251925 * @msglen: msg length
1926− * @is_quiet: true for not printing unsuccessful return values, false otherwise
19271926 *
19281927 * send msg to VF
19291928 **/
1930−static int i40e_vc_send_msg_to_vf_ex(struct i40e_vf *vf, u32 v_opcode,
1931− u32 v_retval, u8 *msg, u16 msglen,
1932− bool is_quiet)
1929+static int i40e_vc_send_msg_to_vf(struct i40e_vf *vf, u32 v_opcode,
1930+ u32 v_retval, u8 *msg, u16 msglen)
19331931 {
19341932 struct i40e_pf *pf;
19351933 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
19441942 hw = &pf->hw;
19451943 abs_vf_id = vf->vf_id + hw->func_caps.vf_base_id;
19461944
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−
19661945 aq_ret = i40e_aq_send_msg_to_vf(hw, abs_vf_id, v_opcode, v_retval,
19671946 msg, msglen, NULL);
19681947 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
19751954 return 0;
19761955 }
19771956
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− **/
1988−static 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−
19951957 /**
19961958 * i40e_vc_send_resp_to_vf
19971959 * @vf: pointer to the VF info
@@ -2822,7 +2784,6 @@ error_param: · 824 unmodified lines
28222784 * i40e_check_vf_permission
28232785 * @vf: pointer to the VF info
28242786 * @al: MAC address list from virtchnl
2825− * @is_quiet: set true for printing msg without opcode info, false otherwise
28262787 *
28272788 * Check that the given list of MAC addresses is allowed. Will return -EPERM
28282789 * if any address in the list is not valid. Checks the following conditions:
@@ -2837,8 +2798,7 @@ error_param: · 8 unmodified lines
28372798 * addresses might not be accurate.
28382799 **/
28392800 static inline int i40e_check_vf_permission(struct i40e_vf *vf,
2840− struct virtchnl_ether_addr_list *al,
2841− bool *is_quiet)
2801+ struct virtchnl_ether_addr_list *al)
28422802 {
28432803 struct i40e_pf *pf = vf->pf;
28442804 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
28462806 int mac2add_cnt = 0;
28472807 int i;
28482808
2849− *is_quiet = false;
28502809 for (i = 0; i < al->num_elements; i++) {
28512810 struct i40e_mac_filter *f;
28522811 u8 *addr = al->list[i].addr;
@@ -2870,7 +2829,6 @@ static inline int i40e_check_vf_permission(struct i40e_vf *vf, · 17 unmodified lines
28702829 !ether_addr_equal(addr, vf->default_lan_addr.addr)) {
28712830 dev_err(&pf->pdev->dev,
28722831 "VF attempting to override administratively set MAC address, bring down and up the VF interface to resume normal operation\n");
2873− *is_quiet = true;
28742832 return -EPERM;
28752833 }
28762834
@@ -2921,7 +2879,6 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg) · 44 unmodified lines
29212879 (struct virtchnl_ether_addr_list *)msg;
29222880 struct i40e_pf *pf = vf->pf;
29232881 struct i40e_vsi *vsi = NULL;
2924− bool is_quiet = false;
29252882 i40e_status ret = 0;
29262883 int i;
29272884
@@ -2938,7 +2895,7 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg) · 10 unmodified lines
29382895 */
29392896 spin_lock_bh(&vsi->mac_filter_hash_lock);
29402897
2941− ret = i40e_check_vf_permission(vf, al, &is_quiet);
2898+ ret = i40e_check_vf_permission(vf, al);
29422899 if (ret) {
29432900 spin_unlock_bh(&vsi->mac_filter_hash_lock);
29442901 goto error_param;
@@ -2976,8 +2933,8 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg) · 31 unmodified lines
29762933
29772934 error_param:
29782935 /* send the response to the VF */
2979− return i40e_vc_send_msg_to_vf_ex(vf, VIRTCHNL_OP_ADD_ETH_ADDR,
2980− ret, NULL, 0, is_quiet);
2936+ return i40e_vc_send_msg_to_vf(vf, VIRTCHNL_OP_ADD_ETH_ADDR,
2937+ ret, NULL, 0);
29812938 }
29822939
29832940 /**
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h+0−5
@@ -10,8 +10,6 @@ · 9 unmodified lines
1010
1111 #define I40E_VIRTCHNL_SUPPORTED_QTYPES 2
1212
13−#define I40E_DEFAULT_NUM_INVALID_MSGS_ALLOWED 10
14−
1513 #define I40E_VLAN_PRIORITY_SHIFT 13
1614 #define I40E_VLAN_MASK 0xFFF
1715 #define I40E_PRIORITY_MASK 0xE000
@@ -92,9 +90,6 @@ struct i40e_vf { · 74 unmodified lines
9290 u8 num_queue_pairs; /* num of qps assigned to VF vsis */
9391 u8 num_req_queues; /* num of requested qps */
9492 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 */
9893
9994 unsigned long vf_caps; /* vf's adv. capabilities */
10095 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
288288 #define IAVF_FLAG_REINIT_ITR_NEEDED BIT(16)
289289 #define IAVF_FLAG_QUEUES_DISABLED BIT(17)
290290 #define IAVF_FLAG_SETUP_NETDEV_FEATURES BIT(18)
291+#define IAVF_FLAG_REINIT_MSIX_NEEDED BIT(20)
291292 /* duplicates for common code */
292293 #define IAVF_FLAG_DCB_ENABLED 0
293294 /* 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
21202120 "Requested %d queues, but PF only gave us %d.\n",
21212121 num_req_queues,
21222122 adapter->vsi_res->num_queue_pairs);
2123− adapter->flags |= IAVF_FLAG_REINIT_ITR_NEEDED;
2123+ adapter->flags |= IAVF_FLAG_REINIT_MSIX_NEEDED;
21242124 adapter->num_req_queues = adapter->vsi_res->num_queue_pairs;
21252125 iavf_schedule_reset(adapter);
21262126
@@ -2727,7 +2727,8 @@ continue_reset: · 600 unmodified lines
27272727 err);
27282728 adapter->aq_required = 0;
27292729
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)) {
27312732 err = iavf_reinit_interrupt_scheme(adapter);
27322733 if (err)
27332734 goto reset_err;
@@ -2799,12 +2800,13 @@ continue_reset: · 65 unmodified lines
27992800 if (err)
28002801 goto reset_err;
28012802
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)) {
28032805 err = iavf_request_traffic_irqs(adapter, netdev->name);
28042806 if (err)
28052807 goto reset_err;
28062808
2807− adapter->flags &= ~IAVF_FLAG_REINIT_ITR_NEEDED;
2809+ adapter->flags &= ~IAVF_FLAG_REINIT_MSIX_NEEDED;
28082810 }
28092811
28102812 iavf_configure(adapter);
@@ -2819,6 +2821,9 @@ continue_reset: · 8 unmodified lines
28192821 iavf_change_state(adapter, __IAVF_DOWN);
28202822 wake_up(&adapter->down_waitqueue);
28212823 }
2824+
2825+ adapter->flags &= ~IAVF_FLAG_REINIT_ITR_NEEDED;
2826+
28222827 mutex_unlock(&adapter->client_lock);
28232828 mutex_unlock(&adapter->crit_lock);
28242829
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
18341834 adapter->current_op = VIRTCHNL_OP_UNKNOWN;
18351835 }
18361836
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+ */
1844+static 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+
18371853 /**
18381854 * iavf_virtchnl_completion
18391855 * @adapter: adapter structure
@@ -2057,8 +2073,18 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter, · 217 unmodified lines
20572073 }
20582074 break;
20592075 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;
20602082 case VIRTCHNL_OP_DISABLE_VLAN_STRIPPING:
20612083 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);
20622088 break;
20632089 default:
20642090 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
23122338 spin_unlock_bh(&adapter->adv_rss_lock);
23132339 }
23142340 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;
23152355 default:
23162356 if (adapter->current_op && (v_opcode != adapter->current_op))
23172357 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
483483 ICE_FLAG_MDD_AUTO_RESET_VF,
484484 ICE_FLAG_LINK_LENIENT_MODE_ENA,
485485 ICE_FLAG_PLUG_AUX_DEV,
486+ ICE_FLAG_MTU_CHANGED,
486487 ICE_PF_FLAGS_NBITS /* must be last */
487488 };
488489
@@ -897,7 +898,16 @@ static inline void ice_set_rdma_cap(struct ice_pf *pf) · 408 unmodified lines
897898 */
898899 static inline void ice_clear_rdma_cap(struct ice_pf *pf)
899900 {
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+
901911 clear_bit(ICE_FLAG_RDMA_ENA, pf->flags);
902912 clear_bit(ICE_FLAG_AUX_ENA, pf->flags);
903913 }
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
22982298 if (err)
22992299 goto done;
23002300
2301− curr_link_speed = pi->phy.link_info.link_speed;
2301+ curr_link_speed = pi->phy.curr_user_speed_req;
23022302 adv_link_speed = ice_ksettings_find_adv_link_speed(ks);
23032303
23042304 /* 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
22552255 return;
22562256 }
22572257
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 */
22592260 ice_plug_aux_dev(pf);
22602261
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+
22612282 ice_clean_adminq_subtask(pf);
22622283 ice_check_media_subtask(pf);
22632284 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
30233044 struct iidc_event *event;
30243045
30253046 ena_mask &= ~ICE_AUX_CRIT_ERR;
3026− event = kzalloc(sizeof(*event), GFP_KERNEL);
3047+ event = kzalloc(sizeof(*event), GFP_ATOMIC);
30273048 if (event) {
30283049 set_bit(IIDC_EVENT_CRIT_ERR, event->type);
30293050 /* 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
68226843 struct ice_netdev_priv *np = netdev_priv(netdev);
68236844 struct ice_vsi *vsi = np->vsi;
68246845 struct ice_pf *pf = vsi->back;
6825− struct iidc_event *event;
68266846 u8 count = 0;
68276847 int err = 0;
68286848
@@ -6857,14 +6877,6 @@ static int ice_change_mtu(struct net_device *netdev, int new_mtu) · 28 unmodified lines
68576877 return -EBUSY;
68586878 }
68596879
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−
68686880 netdev->mtu = (unsigned int)new_mtu;
68696881
68706882 /* 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
68726884 err = ice_down(vsi);
68736885 if (err) {
68746886 netdev_err(netdev, "change MTU if_down err %d\n", err);
6875− goto event_after;
6887+ return err;
68766888 }
68776889
68786890 err = ice_up(vsi);
68796891 if (err) {
68806892 netdev_err(netdev, "change MTU if_up err %d\n", err);
6881− goto event_after;
6893+ return err;
68826894 }
68836895 }
68846896
68856897 netdev_dbg(netdev, "changed MTU to %d\n", new_mtu);
6886−event_after:
6887− set_bit(IIDC_EVENT_AFTER_MTU_CHANGE, event->type);
6888− ice_send_event_to_aux(pf, event);
6889− kfree(event);
6898+ set_bit(ICE_FLAG_MTU_CHANGED, pf->flags);
68906899
68916900 return err;
68926901 }
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
21822182
21832183 dev = ice_pf_to_dev(pf);
21842184
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−
22032185 aq_ret = ice_aq_send_msg_to_vf(&pf->hw, vf->vf_id, v_opcode, v_retval,
22042186 msg, msglen, NULL);
22052187 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
1414 #define ICE_MAX_MACADDR_PER_VF 18
1515
1616 /* Malicious Driver Detection */
17−#define ICE_DFLT_NUM_INVAL_MSGS_ALLOWED 10
1817 #define ICE_MDD_EVENTS_THRESHOLD 30
1918
2019 /* Static VF transaction/status register def */
@@ -134,8 +133,6 @@ struct ice_vf { · 113 unmodified lines
134133 unsigned int max_tx_rate; /* Maximum Tx bandwidth limit in Mbps */
135134 DECLARE_BITMAP(vf_states, ICE_VF_STATES_NBITS); /* VF runtime states */
136135
137− u64 num_inval_msgs; /* number of continuous invalid msgs */
138− u64 num_valid_msgs; /* number of valid msgs detected */
139136 unsigned long vf_caps; /* VF's adv. capabilities */
140137 u8 num_req_qs; /* num of queue pairs requested by VF */
141138 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
260260
261261 if (ctl & LTQ_DMA_EOP) {
262262 ch->skb_head->protocol = eth_type_trans(ch->skb_head, net_dev);
263− netif_receive_skb(ch->skb_head);
264263 net_dev->stats.rx_packets++;
265264 net_dev->stats.rx_bytes += ch->skb_head->len;
265+ netif_receive_skb(ch->skb_head);
266266 ch->skb_head = NULL;
267267 ch->skb_tail = NULL;
268268 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
554554 dev_info(prestera_dev(sw), "using random base mac address\n");
555555 }
556556 of_node_put(base_mac_np);
557+ of_node_put(np);
557558
558559 return prestera_hw_switch_mac_set(sw, sw->base_mac);
559560 }
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
131131
132132 static void cmd_free_index(struct mlx5_cmd *cmd, int idx)
133133 {
134− unsigned long flags;
135−
136− spin_lock_irqsave(&cmd->alloc_lock, flags);
134+ lockdep_assert_held(&cmd->alloc_lock);
137135 set_bit(idx, &cmd->bitmask);
138− spin_unlock_irqrestore(&cmd->alloc_lock, flags);
139136 }
140137
141138 static 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
145142
146143 static void cmd_ent_put(struct mlx5_cmd_work_ent *ent)
147144 {
145+ struct mlx5_cmd *cmd = ent->cmd;
146+ unsigned long flags;
147+
148+ spin_lock_irqsave(&cmd->alloc_lock, flags);
148149 if (!refcount_dec_and_test(&ent->refcnt))
149− return;
150+ goto out;
150151
151152 if (ent->idx >= 0) {
152− struct mlx5_cmd *cmd = ent->cmd;
153−
154153 cmd_free_index(cmd, ent->idx);
155154 up(ent->page_queue ? &cmd->pages_sem : &cmd->sem);
156155 }
157156
158157 cmd_free_ent(ent);
158+out:
159+ spin_unlock_irqrestore(&cmd->alloc_lock, flags);
159160 }
160161
161162 static 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
8888 (MLX5E_PARAMS_DEFAULT_LRO_WQE_SZ - rough_max_l2_l3_hdr_sz) >> 8);
8989 MLX5_SET(tirc, tirc, lro_timeout_period_usecs, pkt_merge_param->timeout);
9090 break;
91− case MLX5E_PACKET_MERGE_SHAMPO:
92− MLX5_SET(tirc, tirc, packet_merge_mask, MLX5_TIRC_PACKET_MERGE_MASK_SHAMPO);
93− break;
9491 default:
9592 break;
9693 }
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
36163616 goto out;
36173617 }
36183618
3619− err = mlx5e_safe_switch_params(priv, &new_params,
3620− mlx5e_modify_tirs_packet_merge_ctx, NULL, reset);
3619+ err = mlx5e_safe_switch_params(priv, &new_params, NULL, NULL, reset);
36213620 out:
36223621 mutex_unlock(&priv->state_lock);
36233622 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
126126 return;
127127 }
128128
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+
129133 /* Handle add/replace event */
130134 nhs = fib_info_num_path(fi);
131135 if (nhs == 1) {
@@ -135,12 +139,13 @@ static void mlx5_lag_fib_route_event(struct mlx5_lag *ldev, · 3 unmodified lines
135139 int i = mlx5_lag_dev_get_netdev_idx(ldev, nh_dev);
136140
137141 if (i < 0)
138− i = MLX5_LAG_NORMAL_AFFINITY;
139− else
140− ++i;
142+ return;
141143
144+ i++;
142145 mlx5_lag_set_port_affinity(ldev, i);
143146 }
147+
148+ mp->mfi = fi;
144149 return;
145150 }
146151
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
121121
122122 u32 mlx5_chains_get_prio_range(struct mlx5_fs_chains *chains)
123123 {
124− if (!mlx5_chains_prios_supported(chains))
125− return 1;
126−
127124 if (mlx5_chains_ignore_flow_level_supported(chains))
128125 return UINT_MAX;
129126
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
14711471 {
14721472 struct net_device *ndev = platform_get_drvdata(pdev);
14731473 struct netdata_local *pldat;
1474+ int ret;
14741475
14751476 if (device_may_wakeup(&pdev->dev))
14761477 disable_irq_wake(ndev->irq);
@@ -1480,7 +1481,9 @@ static int lpc_eth_drv_resume(struct platform_device *pdev) · 3 unmodified lines
14801481 pldat = netdev_priv(ndev);
14811482
14821483 /* Enable interface clock */
1483− clk_enable(pldat->clk);
1484+ ret = clk_enable(pldat->clk);
1485+ if (ret)
1486+ return ret;
14841487
14851488 /* Reset and initialize */
14861489 __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
38063806 return found;
38073807 }
38083808
3809−static void qed_iov_get_link(struct qed_hwfn *p_hwfn,
3810− u16 vfid,
3811− struct qed_mcp_link_params *p_params,
3812− struct qed_mcp_link_state *p_link,
3813− struct qed_mcp_link_capabilities *p_caps)
3809+static int qed_iov_get_link(struct qed_hwfn *p_hwfn,
3810+ u16 vfid,
3811+ struct qed_mcp_link_params *p_params,
3812+ struct qed_mcp_link_state *p_link,
3813+ struct qed_mcp_link_capabilities *p_caps)
38143814 {
38153815 struct qed_vf_info *p_vf = qed_iov_get_vf_info(p_hwfn,
38163816 vfid,
@@ -3818,7 +3818,7 @@ static void qed_iov_get_link(struct qed_hwfn *p_hwfn, · 1 unmodified line
38183818 struct qed_bulletin_content *p_bulletin;
38193819
38203820 if (!p_vf)
3821− return;
3821+ return -EINVAL;
38223822
38233823 p_bulletin = p_vf->bulletin.p_virt;
38243824
@@ -3828,6 +3828,7 @@ static void qed_iov_get_link(struct qed_hwfn *p_hwfn, · 3 unmodified lines
38283828 __qed_vf_get_link_state(p_hwfn, p_link, p_bulletin);
38293829 if (p_caps)
38303830 __qed_vf_get_link_caps(p_hwfn, p_caps, p_bulletin);
3831+ return 0;
38313832 }
38323833
38333834 static int
@@ -4686,6 +4687,7 @@ static int qed_get_vf_config(struct qed_dev *cdev, · 852 unmodified lines
46864687 struct qed_public_vf_info *vf_info;
46874688 struct qed_mcp_link_state link;
46884689 u32 tx_rate;
4690+ int ret;
46894691
46904692 /* Sanitize request */
46914693 if (IS_VF(cdev))
@@ -4699,7 +4701,9 @@ static int qed_get_vf_config(struct qed_dev *cdev, · 7 unmodified lines
46994701
47004702 vf_info = qed_iov_get_public_vf_info(hwfn, vf_id, true);
47014703
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;
47034707
47044708 /* Fill information about VF */
47054709 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
513513 p_iov->bulletin.size,
514514 &p_iov->bulletin.phys,
515515 GFP_KERNEL);
516+ if (!p_iov->bulletin.p_virt)
517+ goto free_pf2vf_reply;
518+
516519 DP_VERBOSE(p_hwfn, QED_MSG_IOV,
517520 "VF's bulletin Board [%p virt 0x%llx phys 0x%08x bytes]\n",
518521 p_iov->bulletin.p_virt,
@@ -552,6 +555,10 @@ int qed_vf_hw_prepare(struct qed_hwfn *p_hwfn) · 33 unmodified lines
552555
553556 return rc;
554557
558+free_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);
555562 free_vf2pf_request:
556563 dma_free_coherent(&p_hwfn->cdev->pdev->dev,
557564 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
31463146 if (err) {
31473147 printk(KERN_ERR "happymeal(PCI): Cannot register net device, "
31483148 "aborting.\n");
3149− goto err_out_iounmap;
3149+ goto err_out_free_coherent;
31503150 }
31513151
31523152 pci_set_drvdata(pdev, hp);
@@ -3179,6 +3179,10 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, · 26 unmodified lines
31793179
31803180 return 0;
31813181
3182+err_out_free_coherent:
3183+ dma_free_coherent(hp->dma_dev, PAGE_SIZE,
3184+ hp->happy_block, hp->hblock_dvma);
3185+
31823186 err_out_iounmap:
31833187 iounmap(hp->gregs);
31843188
drivers/net/ethernet/ti/cpts.c+3−1
@@ -568,7 +568,9 @@ int cpts_register(struct cpts *cpts) · 567 unmodified lines
568568 for (i = 0; i < CPTS_MAX_EVENTS; i++)
569569 list_add(&cpts->pool_data[i].list, &cpts->pool);
570570
571− clk_enable(cpts->refclk);
571+ err = clk_enable(cpts->refclk);
572+ if (err)
573+ return err;
572574
573575 cpts_write32(cpts, CPTS_EN, control);
574576 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
11831183 if (rc) {
11841184 dev_err(dev,
11851185 "Cannot register network device, aborting\n");
1186− goto error;
1186+ goto put_node;
11871187 }
11881188
11891189 dev_info(dev,
@@ -1191,6 +1191,8 @@ static int xemaclite_of_probe(struct platform_device *ofdev) · 1 unmodified line
11911191 (unsigned long __force)ndev->mem_start, lp->base_addr, ndev->irq);
11921192 return 0;
11931193
1194+put_node:
1195+ of_node_put(lp->phy_node);
11941196 error:
11951197 free_netdev(ndev);
11961198 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
274274 if (err < 0)
275275 return err;
276276
277− err = phy_write(phydev, MII_DP83822_MISR1, 0);
277+ err = phy_write(phydev, MII_DP83822_MISR2, 0);
278278 if (err < 0)
279279 return err;
280280
drivers/net/phy/meson-gxl.c+20−11
@@ -30,8 +30,12 @@ · 29 unmodified lines
3030 #define INTSRC_LINK_DOWN BIT(4)
3131 #define INTSRC_REMOTE_FAULT BIT(5)
3232 #define INTSRC_ANEG_COMPLETE BIT(6)
33+#define INTSRC_ENERGY_DETECT BIT(7)
3334 #define INTSRC_MASK 30
3435
36+#define INT_SOURCES (INTSRC_LINK_DOWN | INTSRC_ANEG_COMPLETE | \
37+ INTSRC_ENERGY_DETECT)
38+
3539 #define BANK_ANALOG_DSP 0
3640 #define BANK_WOL 1
3741 #define BANK_BIST 3
@@ -200,7 +204,6 @@ static int meson_gxl_ack_interrupt(struct phy_device *phydev) · 162 unmodified lines
200204
201205 static int meson_gxl_config_intr(struct phy_device *phydev)
202206 {
203− u16 val;
204207 int ret;
205208
206209 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
@@ -209,16 +212,9 @@ static int meson_gxl_config_intr(struct phy_device *phydev) · 2 unmodified lines
209212 if (ret)
210213 return ret;
211214
212− val = INTSRC_ANEG_PR
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);
215+ ret = phy_write(phydev, INTSRC_MASK, INT_SOURCES);
219216 } else {
220− val = 0;
221− ret = phy_write(phydev, INTSRC_MASK, val);
217+ ret = phy_write(phydev, INTSRC_MASK, 0);
222218
223219 /* Ack any pending IRQ */
224220 ret = meson_gxl_ack_interrupt(phydev);
@@ -237,10 +233,23 @@ static irqreturn_t meson_gxl_handle_interrupt(struct phy_device *phydev) · 12 unmodified lines
237233 return IRQ_NONE;
238234 }
239235
236+ irq_status &= INT_SOURCES;
237+
240238 if (irq_status == 0)
241239 return IRQ_NONE;
242240
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);
244253
245254 return IRQ_HANDLED;
246255 }
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
8484 ret = fn(dev, USB_VENDOR_REQUEST_READ_REGISTER, USB_DIR_IN
8585 | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
8686 0, index, &buf, 4);
87− if (unlikely(ret < 0)) {
88− netdev_warn(dev->net, "Failed to read reg index 0x%08x: %d\n",
89− index, ret);
87+ if (ret < 0) {
88+ if (ret != -ENODEV)
89+ netdev_warn(dev->net, "Failed to read reg index 0x%08x: %d\n",
90+ index, ret);
9091 return ret;
9192 }
9293
@@ -116,7 +117,7 @@ static int __must_check __smsc95xx_write_reg(struct usbnet *dev, u32 index, · 23 unmodified lines
116117 ret = fn(dev, USB_VENDOR_REQUEST_WRITE_REGISTER, USB_DIR_OUT
117118 | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
118119 0, index, &buf, 4);
119− if (unlikely(ret < 0))
120+ if (ret < 0 && ret != -ENODEV)
120121 netdev_warn(dev->net, "Failed to write reg index 0x%08x: %d\n",
121122 index, ret);
122123
@@ -159,6 +160,9 @@ static int __must_check __smsc95xx_phy_wait_not_busy(struct usbnet *dev, · 36 unmodified lines
159160 do {
160161 ret = __smsc95xx_read_reg(dev, MII_ADDR, &val, in_pm);
161162 if (ret < 0) {
163+ /* Ignore -ENODEV error during disconnect() */
164+ if (ret == -ENODEV)
165+ return 0;
162166 netdev_warn(dev->net, "Error reading MII_ACCESS\n");
163167 return ret;
164168 }
@@ -194,7 +198,8 @@ static int __smsc95xx_mdio_read(struct usbnet *dev, int phy_id, int idx, · 29 unmodified lines
194198 addr = mii_address_cmd(phy_id, idx, MII_READ_ | MII_BUSY_);
195199 ret = __smsc95xx_write_reg(dev, MII_ADDR, addr, in_pm);
196200 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");
198203 goto done;
199204 }
200205
@@ -206,7 +211,8 @@ static int __smsc95xx_mdio_read(struct usbnet *dev, int phy_id, int idx, · 5 unmodified lines
206211
207212 ret = __smsc95xx_read_reg(dev, MII_DATA, &val, in_pm);
208213 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");
210216 goto done;
211217 }
212218
@@ -214,6 +220,10 @@ static int __smsc95xx_mdio_read(struct usbnet *dev, int phy_id, int idx, · 1 unmodified line
214220
215221 done:
216222 mutex_unlock(&dev->phy_mutex);
223+
224+ /* Ignore -ENODEV error during disconnect() */
225+ if (ret == -ENODEV)
226+ return 0;
217227 return ret;
218228 }
219229
@@ -235,7 +245,8 @@ static void __smsc95xx_mdio_write(struct usbnet *dev, int phy_id, · 15 unmodified lines
235245 val = regval;
236246 ret = __smsc95xx_write_reg(dev, MII_DATA, val, in_pm);
237247 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");
239250 goto done;
240251 }
241252
@@ -243,7 +254,8 @@ static void __smsc95xx_mdio_write(struct usbnet *dev, int phy_id, · 1 unmodified line
243254 addr = mii_address_cmd(phy_id, idx, MII_WRITE_ | MII_BUSY_);
244255 ret = __smsc95xx_write_reg(dev, MII_ADDR, addr, in_pm);
245256 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");
247259 goto done;
248260 }
249261
drivers/nfc/port100.c+2−0
@@ -1612,7 +1612,9 @@ free_nfc_dev: · 1611 unmodified lines
16121612 nfc_digital_free_device(dev->nfc_digital_dev);
16131613
16141614 error:
1615+ usb_kill_urb(dev->in_urb);
16151616 usb_free_urb(dev->in_urb);
1617+ usb_kill_urb(dev->out_urb);
16161618 usb_free_urb(dev->out_urb);
16171619 usb_put_dev(dev->udev);
16181620
include/linux/mlx5/mlx5_ifc.h+2−3
@@ -3434,7 +3434,6 @@ enum { · 3433 unmodified lines
34343434 enum {
34353435 MLX5_TIRC_PACKET_MERGE_MASK_IPV4_LRO = BIT(0),
34363436 MLX5_TIRC_PACKET_MERGE_MASK_IPV6_LRO = BIT(1),
3437− MLX5_TIRC_PACKET_MERGE_MASK_SHAMPO = BIT(2),
34383437 };
34393438
34403439 enum {
@@ -9900,8 +9899,8 @@ struct mlx5_ifc_bufferx_reg_bits { · 6459 unmodified lines
99009899 u8 reserved_at_0[0x6];
99019900 u8 lossy[0x1];
99029901 u8 epsb[0x1];
9903− u8 reserved_at_8[0xc];
9904− u8 size[0xc];
9902+ u8 reserved_at_8[0x8];
9903+ u8 size[0x10];
99059904
99069905 u8 xoff_threshold[0x10];
99079906 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
46024602
46034603 struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
46044604 netdev_features_t features, bool tx_path);
4605+struct sk_buff *skb_eth_gso_segment(struct sk_buff *skb,
4606+ netdev_features_t features, __be16 type);
46054607 struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb,
46064608 netdev_features_t features);
46074609
include/linux/phy.h+2−2
@@ -87,8 +87,8 @@ extern const int phy_10gbit_features_array[1]; · 86 unmodified lines
8787 *
8888 * @PHY_INTERFACE_MODE_NA: Not Applicable - don't touch
8989 * @PHY_INTERFACE_MODE_INTERNAL: No interface, MAC and PHY combined
90− * @PHY_INTERFACE_MODE_MII: Median-independent interface
91− * @PHY_INTERFACE_MODE_GMII: Gigabit median-independent interface
90+ * @PHY_INTERFACE_MODE_MII: Media-independent interface
91+ * @PHY_INTERFACE_MODE_GMII: Gigabit media-independent interface
9292 * @PHY_INTERFACE_MODE_SGMII: Serial gigabit media-independent interface
9393 * @PHY_INTERFACE_MODE_TBI: Ten Bit Interface
9494 * @PHY_INTERFACE_MODE_REVMII: Reverse Media Independent Interface
include/net/esp.h+2−0
@@ -4,6 +4,8 @@ · 3 unmodified lines
44
55 #include <linux/skbuff.h>
66
7+#define ESP_SKB_FRAG_MAXSIZE (PAGE_SIZE << SKB_FRAG_PAGE_ORDER)
8+
79 struct ip_esp_hdr;
810
911 static 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
8787 ax25_for_each(s, &ax25_list) {
8888 if (s->ax25_dev == ax25_dev) {
8989 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+ }
9097 sock_hold(sk);
9198 spin_unlock_bh(&ax25_list_lock);
9299 lock_sock(sk);
net/bluetooth/hci_sync.c+23−26
@@ -276,40 +276,37 @@ EXPORT_SYMBOL(__hci_cmd_sync_status); · 275 unmodified lines
276276 static void hci_cmd_sync_work(struct work_struct *work)
277277 {
278278 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;
283279
284280 bt_dev_dbg(hdev, "");
285281
286− mutex_lock(&hdev->cmd_sync_work_lock);
287− entry = list_first_entry(&hdev->cmd_sync_work_list,
288− struct hci_cmd_sync_work_entry, list);
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);
282+ /* Dequeue all entries and run them */
283+ while (1) {
284+ struct hci_cmd_sync_work_entry *entry;
301285
302− if (func) {
303− int err;
286+ mutex_lock(&hdev->cmd_sync_work_lock);
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;
304296
305− hci_req_sync_lock(hdev);
297+ bt_dev_dbg(hdev, "entry %p", entry);
306298
307− err = func(hdev, data);
299+ if (entry->func) {
300+ int err;
308301
309− if (destroy)
310− destroy(hdev, data, err);
302+ hci_req_sync_lock(hdev);
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+ }
311308
312− hci_req_sync_unlock(hdev);
309+ kfree(entry);
313310 }
314311 }
315312
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
45414541 }
45424542 }
45434543
4544−done:
45454544 hci_dev_unlock(hdev);
45464545
4546+done:
45474547 if (status == MGMT_STATUS_SUCCESS)
45484548 device_flags_changed(sk, hdev, &cp->addr.bdaddr, cp->addr.type,
45494549 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
9292 }
9393 EXPORT_SYMBOL(dev_remove_offload);
9494
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+ */
101+struct 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+}
118+EXPORT_SYMBOL(skb_eth_gso_segment);
119+
95120 /**
96121 * skb_mac_gso_segment - mac layer segmentation handler.
97122 * @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
357357 if (IS_ERR(xdp_alloc))
358358 return PTR_ERR(xdp_alloc);
359359
360− trace_mem_connect(xdp_alloc, xdp_rxq);
360+ if (trace_mem_connect_enabled() && xdp_alloc)
361+ trace_mem_connect(xdp_alloc, xdp_rxq);
361362 return 0;
362363 }
363364
net/dsa/dsa2.c+3−3
@@ -1058,7 +1058,7 @@ static int dsa_tree_setup_switches(struct dsa_switch_tree *dst) · 1057 unmodified lines
10581058 static int dsa_tree_setup_master(struct dsa_switch_tree *dst)
10591059 {
10601060 struct dsa_port *dp;
1061− int err;
1061+ int err = 0;
10621062
10631063 rtnl_lock();
10641064
@@ -1066,13 +1066,13 @@ static int dsa_tree_setup_master(struct dsa_switch_tree *dst) · 1 unmodified line
10661066 if (dsa_port_is_cpu(dp)) {
10671067 err = dsa_master_setup(dp->master, dp);
10681068 if (err)
1069− return err;
1069+ break;
10701070 }
10711071 }
10721072
10731073 rtnl_unlock();
10741074
1075− return 0;
1075+ return err;
10761076 }
10771077
10781078 static 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
446446 struct page *page;
447447 struct sk_buff *trailer;
448448 int tailen = esp->tailen;
449+ unsigned int allocsz;
449450
450451 /* this is non-NULL only with TCP/UDP Encapsulation */
451452 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
455456 return err;
456457 }
457458
459+ allocsz = ALIGN(skb->data_len + tailen, L1_CACHE_BYTES);
460+ if (allocsz > ESP_SKB_FRAG_MAXSIZE)
461+ goto cow;
462+
458463 if (!skb_cloned(skb)) {
459464 if (tailen <= skb_tailroom(skb)) {
460465 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
110110 struct sk_buff *skb,
111111 netdev_features_t features)
112112 {
113− __skb_push(skb, skb->mac_len);
114− return skb_mac_gso_segment(skb, features);
113+ return skb_eth_gso_segment(skb, features, htons(ETH_P_IP));
115114 }
116115
117116 static 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
160159 skb_shinfo(skb)->gso_type |= SKB_GSO_TCPV4;
161160 }
162161
162+ if (proto == IPPROTO_IPV6)
163+ skb_shinfo(skb)->gso_type |= SKB_GSO_IPXIP4;
164+
163165 __skb_pull(skb, skb_transport_offset(skb));
164166 ops = rcu_dereference(inet_offloads[proto]);
165167 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
482482 struct page *page;
483483 struct sk_buff *trailer;
484484 int tailen = esp->tailen;
485+ unsigned int allocsz;
485486
486487 if (x->encap) {
487488 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
490491 return err;
491492 }
492493
494+ allocsz = ALIGN(skb->data_len + tailen, L1_CACHE_BYTES);
495+ if (allocsz > ESP_SKB_FRAG_MAXSIZE)
496+ goto cow;
497+
493498 if (!skb_cloned(skb)) {
494499 if (tailen <= skb_tailroom(skb)) {
495500 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
145145 struct sk_buff *skb,
146146 netdev_features_t features)
147147 {
148− __skb_push(skb, skb->mac_len);
149− return skb_mac_gso_segment(skb, features);
148+ return skb_eth_gso_segment(skb, features, htons(ETH_P_IPV6));
150149 }
151150
152151 static 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
199198 ipv6_skip_exthdr(skb, 0, &proto, &frag);
200199 }
201200
201+ if (proto == IPPROTO_IPIP)
202+ skb_shinfo(skb)->gso_type |= SKB_GSO_IPXIP6;
203+
202204 __skb_pull(skb, skb_transport_offset(skb));
203205 ops = rcu_dereference(inet6_offloads[proto]);
204206 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
4545 return xfrm_output(sk, skb);
4646 }
4747
48+static 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+
4861 static int __xfrm6_output(struct net *net, struct sock *sk, struct sk_buff *skb)
4962 {
5063 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
7386 xfrm6_local_rxpmtu(skb, mtu);
7487 kfree_skb(skb);
7588 return -EMSGSIZE;
89+ } else if (toobig && xfrm6_noneed_fragment(skb)) {
90+ skb->ignore_df = 1;
91+ goto skip_frag;
7692 } else if (!skb->ignore_df && toobig && skb->sk) {
7793 xfrm_local_error(skb, mtu);
7894 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
6161 r->idiag_timer = SCTP_EVENT_TIMEOUT_T3_RTX;
6262 r->idiag_retrans = asoc->rtx_data_chunks;
6363 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;
6864 }
6965 }
7066
@@ -144,13 +140,14 @@ static int inet_sctp_diag_fill(struct sock *sk, struct sctp_association *asoc, · 73 unmodified lines
144140 r = nlmsg_data(nlh);
145141 BUG_ON(!sk_fullsock(sk));
146142
143+ r->idiag_timer = 0;
144+ r->idiag_retrans = 0;
145+ r->idiag_expires = 0;
147146 if (asoc) {
148147 inet_diag_msg_sctpasoc_fill(r, sk, asoc);
149148 } else {
150149 inet_diag_msg_common_fill(r, sk);
151150 r->idiag_state = sk->sk_state;
152− r->idiag_timer = 0;
153− r->idiag_retrans = 0;
154151 }
155152
156153 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
352352 goto rejected;
353353 }
354354
355− test_and_set_bit_lock(0, &b->up);
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−
355+ /* Create monitoring data before accepting activate messages */
360356 if (tipc_mon_create(net, bearer_id)) {
361357 bearer_disable(net, b);
358+ kfree_skb(skb);
362359 return -ENOMEM;
363360 }
364361
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+
365367 pr_info("Enabled bearer <%s>, priority %u\n", name, prio);
366368
367369 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
22862286 break;
22872287
22882288 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+
22892294 l->rcv_nxt_state = msg_seqno(hdr) + 1;
22902295
22912296 /* 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
23112316 break;
23122317 }
23132318
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;
23182319 tipc_mon_rcv(l->net, data + glen, dlen - glen, l->addr,
23192320 &l->mon_state, l->bearer_id);
23202321
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
304304 if (mtu < IPV6_MIN_MTU)
305305 mtu = IPV6_MIN_MTU;
306306
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;
308311 } else {
309312 if (!(ip_hdr(skb)->frag_off & htons(IP_DF)))
310313 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
630630
631631 xfrm_smark_init(attrs, &x->props.smark);
632632
633− if (attrs[XFRMA_IF_ID]) {
633+ if (attrs[XFRMA_IF_ID])
634634 x->if_id = nla_get_u32(attrs[XFRMA_IF_ID]);
635− if (!x->if_id) {
636− err = -EINVAL;
637− goto error;
638− }
639− }
640635
641636 err = __xfrm_init_state(x, false, attrs[XFRMA_OFFLOAD_DEV]);
642637 if (err)
@@ -1432,13 +1427,8 @@ static int xfrm_alloc_userspi(struct sk_buff *skb, struct nlmsghdr *nlh, · 789 unmodified lines
14321427
14331428 mark = xfrm_mark_get(attrs, &m);
14341429
1435− if (attrs[XFRMA_IF_ID]) {
1430+ if (attrs[XFRMA_IF_ID])
14361431 if_id = nla_get_u32(attrs[XFRMA_IF_ID]);
1437− if (!if_id) {
1438− err = -EINVAL;
1439− goto out_noput;
1440− }
1441− }
14421432
14431433 if (p->info.seq) {
14441434 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
17511741
17521742 xfrm_mark_get(attrs, &xp->mark);
17531743
1754− if (attrs[XFRMA_IF_ID]) {
1744+ if (attrs[XFRMA_IF_ID])
17551745 xp->if_id = nla_get_u32(attrs[XFRMA_IF_ID]);
1756− if (!xp->if_id) {
1757− err = -EINVAL;
1758− goto error;
1759− }
1760− }
17611746
17621747 return xp;
17631748 error:
tools/testing/selftests/net/pmtu.sh+17−4
@@ -374,6 +374,16 @@ run_cmd() { · 373 unmodified lines
374374 return $rc
375375 }
376376
377+run_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+
377387 # Find the auto-generated name for this namespace
378388 nsname() {
379389 eval echo \$NS_$1
@@ -670,10 +680,10 @@ setup_nettest_xfrm() { · 290 unmodified lines
670680 [ ${1} -eq 6 ] && proto="-6" || proto=""
671681 port=${2}
672682
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
674684 nettest_pids="${nettest_pids} $!"
675685
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
677687 nettest_pids="${nettest_pids} $!"
678688 }
679689
@@ -865,7 +875,6 @@ setup_ovs_bridge() { · 185 unmodified lines
865875 setup() {
866876 [ "$(id -u)" -ne 0 ] && echo " need to run as root" && return $ksft_skip
867877
868− cleanup
869878 for arg do
870879 eval setup_${arg} || { echo " ${arg} not supported"; return 1; }
871880 done
@@ -876,7 +885,7 @@ trace() { · 4 unmodified lines
876885
877886 for arg do
878887 [ "${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 &
880889 tcpdump_pids="${tcpdump_pids} $!"
881890 ns_cmd=
882891 done
@@ -1836,6 +1845,10 @@ run_test() { · 953 unmodified lines
18361845
18371846 unset IFS
18381847
1848+ # Since cleanup() relies on variables modified by this subshell, it
1849+ # has to run in this context.
1850+ trap cleanup EXIT
1851+
18391852 if [ "$VERBOSE" = "1" ]; then
18401853 printf "\n##########################################################################\n\n"
18411854 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