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 ...
Unified · Split
| @@ -2005,7 +2005,11 @@ setup_hw(struct hfc_pci *hc) · 2004 unmodified lines | ||
| 2005 | 2005 | } |
| 2006 | 2006 | /* Allocate memory for FIFOS */ |
| 2007 | 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 | 2013 | buffer = dma_alloc_coherent(&hc->pdev->dev, 0x8000, &hc->hw.dmahandle, |
| 2010 | 2014 | GFP_KERNEL); |
| 2011 | 2015 | /* We silently assume the address is okay if nonzero */ |
| @@ -192,7 +192,7 @@ void dsp_pipeline_destroy(struct dsp_pipeline *pipeline) · 191 unmodified lines | ||
| 192 | 192 | int dsp_pipeline_build(struct dsp_pipeline *pipeline, const char *cfg) |
| 193 | 193 | { |
| 194 | 194 | int found = 0; |
| 195 | − char *dup, *tok, *name, *args; | |
| 195 | + char *dup, *next, *tok, *name, *args; | |
| 196 | 196 | struct dsp_element_entry *entry, *n; |
| 197 | 197 | struct dsp_pipeline_entry *pipeline_entry; |
| 198 | 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 | 203 | if (!list_empty(&pipeline->list)) |
| 204 | 204 | _dsp_pipeline_destroy(pipeline); |
| 205 | 205 | |
| 206 | − dup = kstrdup(cfg, GFP_ATOMIC); | |
| 206 | + dup = next = kstrdup(cfg, GFP_ATOMIC); | |
| 207 | 207 | if (!dup) |
| 208 | 208 | return 0; |
| 209 | − while ((tok = strsep(&dup, "|"))) { | |
| 209 | + while ((tok = strsep(&next, "|"))) { | |
| 210 | 210 | if (!strlen(tok)) |
| 211 | 211 | continue; |
| 212 | 212 | name = strsep(&tok, "("); |
| @@ -2936,7 +2936,7 @@ mt753x_phylink_validate(struct dsa_switch *ds, int port, · 2935 unmodified lines | ||
| 2936 | 2936 | |
| 2937 | 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 | 2940 | !phy_interface_mode_is_8023z(state->interface)) { |
| 2941 | 2941 | phylink_set(mask, 10baseT_Half); |
| 2942 | 2942 | phylink_set(mask, 10baseT_Full); |
| @@ -405,12 +405,12 @@ static int mcf8390_init(struct net_device *dev) · 404 unmodified lines | ||
| 405 | 405 | static int mcf8390_probe(struct platform_device *pdev) |
| 406 | 406 | { |
| 407 | 407 | struct net_device *dev; |
| 408 | − struct resource *mem, *irq; | |
| 408 | + struct resource *mem; | |
| 409 | 409 | resource_size_t msize; |
| 410 | − int ret; | |
| 410 | + int ret, irq; | |
| 411 | 411 | |
| 412 | − irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | |
| 413 | − if (irq == NULL) { | |
| 412 | + irq = platform_get_irq(pdev, 0); | |
| 413 | + if (irq < 0) { | |
| 414 | 414 | dev_err(&pdev->dev, "no IRQ specified?\n"); |
| 415 | 415 | return -ENXIO; |
| 416 | 416 | } |
| @@ -433,7 +433,7 @@ static int mcf8390_probe(struct platform_device *pdev) · 16 unmodified lines | ||
| 433 | 433 | SET_NETDEV_DEV(dev, &pdev->dev); |
| 434 | 434 | platform_set_drvdata(pdev, dev); |
| 435 | 435 | |
| 436 | − dev->irq = irq->start; | |
| 436 | + dev->irq = irq; | |
| 437 | 437 | dev->base_addr = mem->start; |
| 438 | 438 | |
| 439 | 439 | ret = mcf8390_init(dev); |
| @@ -132,6 +132,7 @@ int arc_mdio_probe(struct arc_emac_priv *priv) · 131 unmodified lines | ||
| 132 | 132 | { |
| 133 | 133 | struct arc_emac_mdio_bus_data *data = &priv->bus_data; |
| 134 | 134 | struct device_node *np = priv->dev->of_node; |
| 135 | + const char *name = "Synopsys MII Bus"; | |
| 135 | 136 | struct mii_bus *bus; |
| 136 | 137 | int error; |
| 137 | 138 | |
| @@ -142,7 +143,7 @@ int arc_mdio_probe(struct arc_emac_priv *priv) · 4 unmodified lines | ||
| 142 | 143 | priv->bus = bus; |
| 143 | 144 | bus->priv = priv; |
| 144 | 145 | bus->parent = priv->dev; |
| 145 | − bus->name = "Synopsys MII Bus"; | |
| 146 | + bus->name = name; | |
| 146 | 147 | bus->read = &arc_mdio_read; |
| 147 | 148 | bus->write = &arc_mdio_write; |
| 148 | 149 | bus->reset = &arc_mdio_reset; |
| @@ -167,7 +168,7 @@ int arc_mdio_probe(struct arc_emac_priv *priv) · 18 unmodified lines | ||
| 167 | 168 | if (error) { |
| 168 | 169 | mdiobus_free(bus); |
| 169 | 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 | 174 | return 0; |
| @@ -40,6 +40,13 @@ · 39 unmodified lines | ||
| 40 | 40 | void bcmgenet_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) |
| 41 | 41 | { |
| 42 | 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 | 51 | wol->supported = WAKE_MAGIC | WAKE_MAGICSECURE | WAKE_FILTER; |
| 45 | 52 | wol->wolopts = priv->wolopts; |
| @@ -1573,7 +1573,14 @@ static int macb_poll(struct napi_struct *napi, int budget) · 1572 unmodified lines | ||
| 1573 | 1573 | if (work_done < budget) { |
| 1574 | 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 | 1584 | status = macb_readl(bp, RSR); |
| 1578 | 1585 | if (status) { |
| 1579 | 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 | 1588 | napi_reschedule(napi); |
| 1582 | 1589 | } else { |
| 1583 | 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 | |
| @@ -1464,6 +1464,7 @@ static int gfar_get_ts_info(struct net_device *dev, · 1463 unmodified lines | ||
| 1464 | 1464 | ptp_node = of_find_compatible_node(NULL, NULL, "fsl,etsec-ptp"); |
| 1465 | 1465 | if (ptp_node) { |
| 1466 | 1466 | ptp_dev = of_find_device_by_node(ptp_node); |
| 1467 | + of_node_put(ptp_node); | |
| 1467 | 1468 | if (ptp_dev) |
| 1468 | 1469 | ptp = platform_get_drvdata(ptp_dev); |
| 1469 | 1470 | } |
| @@ -742,10 +742,8 @@ static void i40e_dbg_dump_vf(struct i40e_pf *pf, int vf_id) · 741 unmodified lines | ||
| 742 | 742 | vsi = pf->vsi[vf->lan_vsi_idx]; |
| 743 | 743 | dev_info(&pf->pdev->dev, "vf %2d: VSI id=%d, seid=%d, qps=%d\n", |
| 744 | 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", | |
| 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); | |
| 749 | 747 | } else { |
| 750 | 748 | dev_info(&pf->pdev->dev, "invalid VF id %d\n", vf_id); |
| 751 | 749 | } |
| @@ -1917,19 +1917,17 @@ sriov_configure_out: · 1916 unmodified lines | ||
| 1917 | 1917 | /***********************virtual channel routines******************/ |
| 1918 | 1918 | |
| 1919 | 1919 | /** |
| 1920 | − * i40e_vc_send_msg_to_vf_ex | |
| 1920 | + * i40e_vc_send_msg_to_vf | |
| 1921 | 1921 | * @vf: pointer to the VF info |
| 1922 | 1922 | * @v_opcode: virtual channel opcode |
| 1923 | 1923 | * @v_retval: virtual channel return value |
| 1924 | 1924 | * @msg: pointer to the msg buffer |
| 1925 | 1925 | * @msglen: msg length |
| 1926 | − * @is_quiet: true for not printing unsuccessful return values, false otherwise | |
| 1927 | 1926 | * |
| 1928 | 1927 | * send msg to VF |
| 1929 | 1928 | **/ |
| 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) | |
| 1933 | 1931 | { |
| 1934 | 1932 | struct i40e_pf *pf; |
| 1935 | 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 | 1942 | hw = &pf->hw; |
| 1945 | 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 | 1945 | aq_ret = i40e_aq_send_msg_to_vf(hw, abs_vf_id, v_opcode, v_retval, |
| 1967 | 1946 | msg, msglen, NULL); |
| 1968 | 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 | 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 | − **/ | |
| 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 | − | |
| 1995 | 1957 | /** |
| 1996 | 1958 | * i40e_vc_send_resp_to_vf |
| 1997 | 1959 | * @vf: pointer to the VF info |
| @@ -2822,7 +2784,6 @@ error_param: · 824 unmodified lines | ||
| 2822 | 2784 | * i40e_check_vf_permission |
| 2823 | 2785 | * @vf: pointer to the VF info |
| 2824 | 2786 | * @al: MAC address list from virtchnl |
| 2825 | − * @is_quiet: set true for printing msg without opcode info, false otherwise | |
| 2826 | 2787 | * |
| 2827 | 2788 | * Check that the given list of MAC addresses is allowed. Will return -EPERM |
| 2828 | 2789 | * if any address in the list is not valid. Checks the following conditions: |
| @@ -2837,8 +2798,7 @@ error_param: · 8 unmodified lines | ||
| 2837 | 2798 | * addresses might not be accurate. |
| 2838 | 2799 | **/ |
| 2839 | 2800 | 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) | |
| 2842 | 2802 | { |
| 2843 | 2803 | struct i40e_pf *pf = vf->pf; |
| 2844 | 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 | 2806 | int mac2add_cnt = 0; |
| 2847 | 2807 | int i; |
| 2848 | 2808 | |
| 2849 | − *is_quiet = false; | |
| 2850 | 2809 | for (i = 0; i < al->num_elements; i++) { |
| 2851 | 2810 | struct i40e_mac_filter *f; |
| 2852 | 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 | 2829 | !ether_addr_equal(addr, vf->default_lan_addr.addr)) { |
| 2871 | 2830 | dev_err(&pf->pdev->dev, |
| 2872 | 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 | 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 | 2879 | (struct virtchnl_ether_addr_list *)msg; |
| 2922 | 2880 | struct i40e_pf *pf = vf->pf; |
| 2923 | 2881 | struct i40e_vsi *vsi = NULL; |
| 2924 | − bool is_quiet = false; | |
| 2925 | 2882 | i40e_status ret = 0; |
| 2926 | 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 | 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 | 2899 | if (ret) { |
| 2943 | 2900 | spin_unlock_bh(&vsi->mac_filter_hash_lock); |
| 2944 | 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 | |
| 2977 | 2934 | error_param: |
| 2978 | 2935 | /* 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); | |
| 2981 | 2938 | } |
| 2982 | 2939 | |
| 2983 | 2940 | /** |
| @@ -10,8 +10,6 @@ · 9 unmodified lines | ||
| 10 | 10 | |
| 11 | 11 | #define I40E_VIRTCHNL_SUPPORTED_QTYPES 2 |
| 12 | 12 | |
| 13 | −#define I40E_DEFAULT_NUM_INVALID_MSGS_ALLOWED 10 | |
| 14 | − | |
| 15 | 13 | #define I40E_VLAN_PRIORITY_SHIFT 13 |
| 16 | 14 | #define I40E_VLAN_MASK 0xFFF |
| 17 | 15 | #define I40E_PRIORITY_MASK 0xE000 |
| @@ -92,9 +90,6 @@ struct i40e_vf { · 74 unmodified lines | ||
| 92 | 90 | u8 num_queue_pairs; /* num of qps assigned to VF vsis */ |
| 93 | 91 | u8 num_req_queues; /* num of requested qps */ |
| 94 | 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 | 94 | unsigned long vf_caps; /* vf's adv. capabilities */ |
| 100 | 95 | unsigned long vf_states; /* vf's runtime states */ |
| @@ -288,6 +288,7 @@ struct iavf_adapter { · 287 unmodified lines | ||
| 288 | 288 | #define IAVF_FLAG_REINIT_ITR_NEEDED BIT(16) |
| 289 | 289 | #define IAVF_FLAG_QUEUES_DISABLED BIT(17) |
| 290 | 290 | #define IAVF_FLAG_SETUP_NETDEV_FEATURES BIT(18) |
| 291 | +#define IAVF_FLAG_REINIT_MSIX_NEEDED BIT(20) | |
| 291 | 292 | /* duplicates for common code */ |
| 292 | 293 | #define IAVF_FLAG_DCB_ENABLED 0 |
| 293 | 294 | /* flags for admin queue service task */ |
| @@ -2120,7 +2120,7 @@ int iavf_parse_vf_resource_msg(struct iavf_adapter *adapter) · 2119 unmodified lines | ||
| 2120 | 2120 | "Requested %d queues, but PF only gave us %d.\n", |
| 2121 | 2121 | num_req_queues, |
| 2122 | 2122 | adapter->vsi_res->num_queue_pairs); |
| 2123 | − adapter->flags |= IAVF_FLAG_REINIT_ITR_NEEDED; | |
| 2123 | + adapter->flags |= IAVF_FLAG_REINIT_MSIX_NEEDED; | |
| 2124 | 2124 | adapter->num_req_queues = adapter->vsi_res->num_queue_pairs; |
| 2125 | 2125 | iavf_schedule_reset(adapter); |
| 2126 | 2126 | |
| @@ -2727,7 +2727,8 @@ continue_reset: · 600 unmodified lines | ||
| 2727 | 2727 | err); |
| 2728 | 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 | 2732 | err = iavf_reinit_interrupt_scheme(adapter); |
| 2732 | 2733 | if (err) |
| 2733 | 2734 | goto reset_err; |
| @@ -2799,12 +2800,13 @@ continue_reset: · 65 unmodified lines | ||
| 2799 | 2800 | if (err) |
| 2800 | 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 | 2805 | err = iavf_request_traffic_irqs(adapter, netdev->name); |
| 2804 | 2806 | if (err) |
| 2805 | 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 | 2812 | iavf_configure(adapter); |
| @@ -2819,6 +2821,9 @@ continue_reset: · 8 unmodified lines | ||
| 2819 | 2821 | iavf_change_state(adapter, __IAVF_DOWN); |
| 2820 | 2822 | wake_up(&adapter->down_waitqueue); |
| 2821 | 2823 | } |
| 2824 | + | |
| 2825 | + adapter->flags &= ~IAVF_FLAG_REINIT_ITR_NEEDED; | |
| 2826 | + | |
| 2822 | 2827 | mutex_unlock(&adapter->client_lock); |
| 2823 | 2828 | mutex_unlock(&adapter->crit_lock); |
| 2824 | 2829 | |
| @@ -1834,6 +1834,22 @@ void iavf_request_reset(struct iavf_adapter *adapter) · 1833 unmodified lines | ||
| 1834 | 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 | + */ | |
| 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 | + | |
| 1837 | 1853 | /** |
| 1838 | 1854 | * iavf_virtchnl_completion |
| 1839 | 1855 | * @adapter: adapter structure |
| @@ -2057,8 +2073,18 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter, · 217 unmodified lines | ||
| 2057 | 2073 | } |
| 2058 | 2074 | break; |
| 2059 | 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 | 2082 | case VIRTCHNL_OP_DISABLE_VLAN_STRIPPING: |
| 2061 | 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 | 2088 | break; |
| 2063 | 2089 | default: |
| 2064 | 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 | 2338 | spin_unlock_bh(&adapter->adv_rss_lock); |
| 2313 | 2339 | } |
| 2314 | 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 | 2355 | default: |
| 2316 | 2356 | if (adapter->current_op && (v_opcode != adapter->current_op)) |
| 2317 | 2357 | dev_warn(&adapter->pdev->dev, "Expected response %d from PF, received %d\n", |
| @@ -483,6 +483,7 @@ enum ice_pf_flags { · 482 unmodified lines | ||
| 483 | 483 | ICE_FLAG_MDD_AUTO_RESET_VF, |
| 484 | 484 | ICE_FLAG_LINK_LENIENT_MODE_ENA, |
| 485 | 485 | ICE_FLAG_PLUG_AUX_DEV, |
| 486 | + ICE_FLAG_MTU_CHANGED, | |
| 486 | 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 | */ |
| 898 | 899 | static 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 | 911 | clear_bit(ICE_FLAG_RDMA_ENA, pf->flags); |
| 902 | 912 | clear_bit(ICE_FLAG_AUX_ENA, pf->flags); |
| 903 | 913 | } |
| @@ -2298,7 +2298,7 @@ ice_set_link_ksettings(struct net_device *netdev, · 2297 unmodified lines | ||
| 2298 | 2298 | if (err) |
| 2299 | 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 | 2302 | adv_link_speed = ice_ksettings_find_adv_link_speed(ks); |
| 2303 | 2303 | |
| 2304 | 2304 | /* If speed didn't get set, set it to what it currently is. |
| @@ -2255,9 +2255,30 @@ static void ice_service_task(struct work_struct *work) · 2254 unmodified lines | ||
| 2255 | 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 | 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 | 2282 | ice_clean_adminq_subtask(pf); |
| 2262 | 2283 | ice_check_media_subtask(pf); |
| 2263 | 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 | 3044 | struct iidc_event *event; |
| 3024 | 3045 | |
| 3025 | 3046 | ena_mask &= ~ICE_AUX_CRIT_ERR; |
| 3026 | − event = kzalloc(sizeof(*event), GFP_KERNEL); | |
| 3047 | + event = kzalloc(sizeof(*event), GFP_ATOMIC); | |
| 3027 | 3048 | if (event) { |
| 3028 | 3049 | set_bit(IIDC_EVENT_CRIT_ERR, event->type); |
| 3029 | 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 | 6843 | struct ice_netdev_priv *np = netdev_priv(netdev); |
| 6823 | 6844 | struct ice_vsi *vsi = np->vsi; |
| 6824 | 6845 | struct ice_pf *pf = vsi->back; |
| 6825 | − struct iidc_event *event; | |
| 6826 | 6846 | u8 count = 0; |
| 6827 | 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 | 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 | 6880 | netdev->mtu = (unsigned int)new_mtu; |
| 6869 | 6881 | |
| 6870 | 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 | 6884 | err = ice_down(vsi); |
| 6873 | 6885 | if (err) { |
| 6874 | 6886 | netdev_err(netdev, "change MTU if_down err %d\n", err); |
| 6875 | − goto event_after; | |
| 6887 | + return err; | |
| 6876 | 6888 | } |
| 6877 | 6889 | |
| 6878 | 6890 | err = ice_up(vsi); |
| 6879 | 6891 | if (err) { |
| 6880 | 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 | 6897 | 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); | |
| 6890 | 6899 | |
| 6891 | 6900 | return err; |
| 6892 | 6901 | } |
| @@ -2182,24 +2182,6 @@ ice_vc_send_msg_to_vf(struct ice_vf *vf, u32 v_opcode, · 2181 unmodified lines | ||
| 2182 | 2182 | |
| 2183 | 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 | 2185 | aq_ret = ice_aq_send_msg_to_vf(&pf->hw, vf->vf_id, v_opcode, v_retval, |
| 2204 | 2186 | msg, msglen, NULL); |
| 2205 | 2187 | if (aq_ret && pf->hw.mailboxq.sq_last_status != ICE_AQ_RC_ENOSYS) { |
| @@ -14,7 +14,6 @@ · 13 unmodified lines | ||
| 14 | 14 | #define ICE_MAX_MACADDR_PER_VF 18 |
| 15 | 15 | |
| 16 | 16 | /* Malicious Driver Detection */ |
| 17 | −#define ICE_DFLT_NUM_INVAL_MSGS_ALLOWED 10 | |
| 18 | 17 | #define ICE_MDD_EVENTS_THRESHOLD 30 |
| 19 | 18 | |
| 20 | 19 | /* Static VF transaction/status register def */ |
| @@ -134,8 +133,6 @@ struct ice_vf { · 113 unmodified lines | ||
| 134 | 133 | unsigned int max_tx_rate; /* Maximum Tx bandwidth limit in Mbps */ |
| 135 | 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 | 136 | unsigned long vf_caps; /* VF's adv. capabilities */ |
| 140 | 137 | u8 num_req_qs; /* num of queue pairs requested by VF */ |
| 141 | 138 | u16 num_mac; |
| @@ -260,9 +260,9 @@ static int xrx200_hw_receive(struct xrx200_chan *ch) · 259 unmodified lines | ||
| 260 | 260 | |
| 261 | 261 | if (ctl & LTQ_DMA_EOP) { |
| 262 | 262 | ch->skb_head->protocol = eth_type_trans(ch->skb_head, net_dev); |
| 263 | − netif_receive_skb(ch->skb_head); | |
| 264 | 263 | net_dev->stats.rx_packets++; |
| 265 | 264 | net_dev->stats.rx_bytes += ch->skb_head->len; |
| 265 | + netif_receive_skb(ch->skb_head); | |
| 266 | 266 | ch->skb_head = NULL; |
| 267 | 267 | ch->skb_tail = NULL; |
| 268 | 268 | ret = XRX200_DMA_PACKET_COMPLETE; |
| @@ -554,6 +554,7 @@ static int prestera_switch_set_base_mac_addr(struct prestera_switch *sw) · 553 unmodified lines | ||
| 554 | 554 | dev_info(prestera_dev(sw), "using random base mac address\n"); |
| 555 | 555 | } |
| 556 | 556 | of_node_put(base_mac_np); |
| 557 | + of_node_put(np); | |
| 557 | 558 | |
| 558 | 559 | return prestera_hw_switch_mac_set(sw, sw->base_mac); |
| 559 | 560 | } |
| @@ -131,11 +131,8 @@ static int cmd_alloc_index(struct mlx5_cmd *cmd) · 130 unmodified lines | ||
| 131 | 131 | |
| 132 | 132 | static void cmd_free_index(struct mlx5_cmd *cmd, int idx) |
| 133 | 133 | { |
| 134 | − unsigned long flags; | |
| 135 | − | |
| 136 | − spin_lock_irqsave(&cmd->alloc_lock, flags); | |
| 134 | + lockdep_assert_held(&cmd->alloc_lock); | |
| 137 | 135 | set_bit(idx, &cmd->bitmask); |
| 138 | − spin_unlock_irqrestore(&cmd->alloc_lock, flags); | |
| 139 | 136 | } |
| 140 | 137 | |
| 141 | 138 | 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 | ||
| 145 | 142 | |
| 146 | 143 | static 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 | 149 | if (!refcount_dec_and_test(&ent->refcnt)) |
| 149 | − return; | |
| 150 | + goto out; | |
| 150 | 151 | |
| 151 | 152 | if (ent->idx >= 0) { |
| 152 | − struct mlx5_cmd *cmd = ent->cmd; | |
| 153 | − | |
| 154 | 153 | cmd_free_index(cmd, ent->idx); |
| 155 | 154 | up(ent->page_queue ? &cmd->pages_sem : &cmd->sem); |
| 156 | 155 | } |
| 157 | 156 | |
| 158 | 157 | cmd_free_ent(ent); |
| 158 | +out: | |
| 159 | + spin_unlock_irqrestore(&cmd->alloc_lock, flags); | |
| 159 | 160 | } |
| 160 | 161 | |
| 161 | 162 | static struct mlx5_cmd_layout *get_inst(struct mlx5_cmd *cmd, int idx) |
| @@ -88,9 +88,6 @@ void mlx5e_tir_builder_build_packet_merge(struct mlx5e_tir_builder *builder, · 87 unmodified lines | ||
| 88 | 88 | (MLX5E_PARAMS_DEFAULT_LRO_WQE_SZ - rough_max_l2_l3_hdr_sz) >> 8); |
| 89 | 89 | MLX5_SET(tirc, tirc, lro_timeout_period_usecs, pkt_merge_param->timeout); |
| 90 | 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 | 91 | default: |
| 95 | 92 | break; |
| 96 | 93 | } |
| @@ -3616,8 +3616,7 @@ static int set_feature_hw_gro(struct net_device *netdev, bool enable) · 3615 unmodified lines | ||
| 3616 | 3616 | goto out; |
| 3617 | 3617 | } |
| 3618 | 3618 | |
| 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); | |
| 3621 | 3620 | out: |
| 3622 | 3621 | mutex_unlock(&priv->state_lock); |
| 3623 | 3622 | return err; |
| @@ -126,6 +126,10 @@ static void mlx5_lag_fib_route_event(struct mlx5_lag *ldev, · 125 unmodified lines | ||
| 126 | 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 | 133 | /* Handle add/replace event */ |
| 130 | 134 | nhs = fib_info_num_path(fi); |
| 131 | 135 | if (nhs == 1) { |
| @@ -135,12 +139,13 @@ static void mlx5_lag_fib_route_event(struct mlx5_lag *ldev, · 3 unmodified lines | ||
| 135 | 139 | int i = mlx5_lag_dev_get_netdev_idx(ldev, nh_dev); |
| 136 | 140 | |
| 137 | 141 | if (i < 0) |
| 138 | − i = MLX5_LAG_NORMAL_AFFINITY; | |
| 139 | − else | |
| 140 | − ++i; | |
| 142 | + return; | |
| 141 | 143 | |
| 144 | + i++; | |
| 142 | 145 | mlx5_lag_set_port_affinity(ldev, i); |
| 143 | 146 | } |
| 147 | + | |
| 148 | + mp->mfi = fi; | |
| 144 | 149 | return; |
| 145 | 150 | } |
| 146 | 151 | |
| @@ -121,9 +121,6 @@ u32 mlx5_chains_get_nf_ft_chain(struct mlx5_fs_chains *chains) · 120 unmodified lines | ||
| 121 | 121 | |
| 122 | 122 | u32 mlx5_chains_get_prio_range(struct mlx5_fs_chains *chains) |
| 123 | 123 | { |
| 124 | − if (!mlx5_chains_prios_supported(chains)) | |
| 125 | − return 1; | |
| 126 | − | |
| 127 | 124 | if (mlx5_chains_ignore_flow_level_supported(chains)) |
| 128 | 125 | return UINT_MAX; |
| 129 | 126 | |
| @@ -1471,6 +1471,7 @@ static int lpc_eth_drv_resume(struct platform_device *pdev) · 1470 unmodified lines | ||
| 1471 | 1471 | { |
| 1472 | 1472 | struct net_device *ndev = platform_get_drvdata(pdev); |
| 1473 | 1473 | struct netdata_local *pldat; |
| 1474 | + int ret; | |
| 1474 | 1475 | |
| 1475 | 1476 | if (device_may_wakeup(&pdev->dev)) |
| 1476 | 1477 | disable_irq_wake(ndev->irq); |
| @@ -1480,7 +1481,9 @@ static int lpc_eth_drv_resume(struct platform_device *pdev) · 3 unmodified lines | ||
| 1480 | 1481 | pldat = netdev_priv(ndev); |
| 1481 | 1482 | |
| 1482 | 1483 | /* Enable interface clock */ |
| 1483 | − clk_enable(pldat->clk); | |
| 1484 | + ret = clk_enable(pldat->clk); | |
| 1485 | + if (ret) | |
| 1486 | + return ret; | |
| 1484 | 1487 | |
| 1485 | 1488 | /* Reset and initialize */ |
| 1486 | 1489 | __lpc_eth_reset(pldat); |
| @@ -3806,11 +3806,11 @@ bool qed_iov_mark_vf_flr(struct qed_hwfn *p_hwfn, u32 *p_disabled_vfs) · 3805 unmodified lines | ||
| 3806 | 3806 | return found; |
| 3807 | 3807 | } |
| 3808 | 3808 | |
| 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) | |
| 3814 | 3814 | { |
| 3815 | 3815 | struct qed_vf_info *p_vf = qed_iov_get_vf_info(p_hwfn, |
| 3816 | 3816 | vfid, |
| @@ -3818,7 +3818,7 @@ static void qed_iov_get_link(struct qed_hwfn *p_hwfn, · 1 unmodified line | ||
| 3818 | 3818 | struct qed_bulletin_content *p_bulletin; |
| 3819 | 3819 | |
| 3820 | 3820 | if (!p_vf) |
| 3821 | − return; | |
| 3821 | + return -EINVAL; | |
| 3822 | 3822 | |
| 3823 | 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 | 3828 | __qed_vf_get_link_state(p_hwfn, p_link, p_bulletin); |
| 3829 | 3829 | if (p_caps) |
| 3830 | 3830 | __qed_vf_get_link_caps(p_hwfn, p_caps, p_bulletin); |
| 3831 | + return 0; | |
| 3831 | 3832 | } |
| 3832 | 3833 | |
| 3833 | 3834 | static int |
| @@ -4686,6 +4687,7 @@ static int qed_get_vf_config(struct qed_dev *cdev, · 852 unmodified lines | ||
| 4686 | 4687 | struct qed_public_vf_info *vf_info; |
| 4687 | 4688 | struct qed_mcp_link_state link; |
| 4688 | 4689 | u32 tx_rate; |
| 4690 | + int ret; | |
| 4689 | 4691 | |
| 4690 | 4692 | /* Sanitize request */ |
| 4691 | 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 | 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 | 4708 | /* Fill information about VF */ |
| 4705 | 4709 | ivi->vf = vf_id; |
| @@ -513,6 +513,9 @@ int qed_vf_hw_prepare(struct qed_hwfn *p_hwfn) · 512 unmodified lines | ||
| 513 | 513 | p_iov->bulletin.size, |
| 514 | 514 | &p_iov->bulletin.phys, |
| 515 | 515 | GFP_KERNEL); |
| 516 | + if (!p_iov->bulletin.p_virt) | |
| 517 | + goto free_pf2vf_reply; | |
| 518 | + | |
| 516 | 519 | DP_VERBOSE(p_hwfn, QED_MSG_IOV, |
| 517 | 520 | "VF's bulletin Board [%p virt 0x%llx phys 0x%08x bytes]\n", |
| 518 | 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 | 556 | return rc; |
| 554 | 557 | |
| 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); | |
| 555 | 562 | free_vf2pf_request: |
| 556 | 563 | dma_free_coherent(&p_hwfn->cdev->pdev->dev, |
| 557 | 564 | sizeof(union vfpf_tlvs), |
| @@ -3146,7 +3146,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, · 3145 unmodified lines | ||
| 3146 | 3146 | if (err) { |
| 3147 | 3147 | printk(KERN_ERR "happymeal(PCI): Cannot register net device, " |
| 3148 | 3148 | "aborting.\n"); |
| 3149 | − goto err_out_iounmap; | |
| 3149 | + goto err_out_free_coherent; | |
| 3150 | 3150 | } |
| 3151 | 3151 | |
| 3152 | 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 | 3180 | return 0; |
| 3181 | 3181 | |
| 3182 | +err_out_free_coherent: | |
| 3183 | + dma_free_coherent(hp->dma_dev, PAGE_SIZE, | |
| 3184 | + hp->happy_block, hp->hblock_dvma); | |
| 3185 | + | |
| 3182 | 3186 | err_out_iounmap: |
| 3183 | 3187 | iounmap(hp->gregs); |
| 3184 | 3188 | |
| @@ -568,7 +568,9 @@ int cpts_register(struct cpts *cpts) · 567 unmodified lines | ||
| 568 | 568 | for (i = 0; i < CPTS_MAX_EVENTS; i++) |
| 569 | 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 | 575 | cpts_write32(cpts, CPTS_EN, control); |
| 574 | 576 | cpts_write32(cpts, TS_PEND_EN, int_enable); |
| @@ -1183,7 +1183,7 @@ static int xemaclite_of_probe(struct platform_device *ofdev) · 1182 unmodified lines | ||
| 1183 | 1183 | if (rc) { |
| 1184 | 1184 | dev_err(dev, |
| 1185 | 1185 | "Cannot register network device, aborting\n"); |
| 1186 | − goto error; | |
| 1186 | + goto put_node; | |
| 1187 | 1187 | } |
| 1188 | 1188 | |
| 1189 | 1189 | dev_info(dev, |
| @@ -1191,6 +1191,8 @@ static int xemaclite_of_probe(struct platform_device *ofdev) · 1 unmodified line | ||
| 1191 | 1191 | (unsigned long __force)ndev->mem_start, lp->base_addr, ndev->irq); |
| 1192 | 1192 | return 0; |
| 1193 | 1193 | |
| 1194 | +put_node: | |
| 1195 | + of_node_put(lp->phy_node); | |
| 1194 | 1196 | error: |
| 1195 | 1197 | free_netdev(ndev); |
| 1196 | 1198 | return rc; |
| @@ -274,7 +274,7 @@ static int dp83822_config_intr(struct phy_device *phydev) · 273 unmodified lines | ||
| 274 | 274 | if (err < 0) |
| 275 | 275 | return err; |
| 276 | 276 | |
| 277 | − err = phy_write(phydev, MII_DP83822_MISR1, 0); | |
| 277 | + err = phy_write(phydev, MII_DP83822_MISR2, 0); | |
| 278 | 278 | if (err < 0) |
| 279 | 279 | return err; |
| 280 | 280 | |
| @@ -30,8 +30,12 @@ · 29 unmodified lines | ||
| 30 | 30 | #define INTSRC_LINK_DOWN BIT(4) |
| 31 | 31 | #define INTSRC_REMOTE_FAULT BIT(5) |
| 32 | 32 | #define INTSRC_ANEG_COMPLETE BIT(6) |
| 33 | +#define INTSRC_ENERGY_DETECT BIT(7) | |
| 33 | 34 | #define INTSRC_MASK 30 |
| 34 | 35 | |
| 36 | +#define INT_SOURCES (INTSRC_LINK_DOWN | INTSRC_ANEG_COMPLETE | \ | |
| 37 | + INTSRC_ENERGY_DETECT) | |
| 38 | + | |
| 35 | 39 | #define BANK_ANALOG_DSP 0 |
| 36 | 40 | #define BANK_WOL 1 |
| 37 | 41 | #define BANK_BIST 3 |
| @@ -200,7 +204,6 @@ static int meson_gxl_ack_interrupt(struct phy_device *phydev) · 162 unmodified lines | ||
| 200 | 204 | |
| 201 | 205 | static int meson_gxl_config_intr(struct phy_device *phydev) |
| 202 | 206 | { |
| 203 | − u16 val; | |
| 204 | 207 | int ret; |
| 205 | 208 | |
| 206 | 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 | 212 | if (ret) |
| 210 | 213 | return ret; |
| 211 | 214 | |
| 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); | |
| 219 | 216 | } else { |
| 220 | − val = 0; | |
| 221 | − ret = phy_write(phydev, INTSRC_MASK, val); | |
| 217 | + ret = phy_write(phydev, INTSRC_MASK, 0); | |
| 222 | 218 | |
| 223 | 219 | /* Ack any pending IRQ */ |
| 224 | 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 | 233 | return IRQ_NONE; |
| 238 | 234 | } |
| 239 | 235 | |
| 236 | + irq_status &= INT_SOURCES; | |
| 237 | + | |
| 240 | 238 | if (irq_status == 0) |
| 241 | 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 | 254 | return IRQ_HANDLED; |
| 246 | 255 | } |
| @@ -84,9 +84,10 @@ static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index, · 83 unmodified lines | ||
| 84 | 84 | ret = fn(dev, USB_VENDOR_REQUEST_READ_REGISTER, USB_DIR_IN |
| 85 | 85 | | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
| 86 | 86 | 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); | |
| 90 | 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 | 117 | ret = fn(dev, USB_VENDOR_REQUEST_WRITE_REGISTER, USB_DIR_OUT |
| 117 | 118 | | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
| 118 | 119 | 0, index, &buf, 4); |
| 119 | − if (unlikely(ret < 0)) | |
| 120 | + if (ret < 0 && ret != -ENODEV) | |
| 120 | 121 | netdev_warn(dev->net, "Failed to write reg index 0x%08x: %d\n", |
| 121 | 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 | 160 | do { |
| 160 | 161 | ret = __smsc95xx_read_reg(dev, MII_ADDR, &val, in_pm); |
| 161 | 162 | if (ret < 0) { |
| 163 | + /* Ignore -ENODEV error during disconnect() */ | |
| 164 | + if (ret == -ENODEV) | |
| 165 | + return 0; | |
| 162 | 166 | netdev_warn(dev->net, "Error reading MII_ACCESS\n"); |
| 163 | 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 | 198 | addr = mii_address_cmd(phy_id, idx, MII_READ_ | MII_BUSY_); |
| 195 | 199 | ret = __smsc95xx_write_reg(dev, MII_ADDR, addr, in_pm); |
| 196 | 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 | 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 | 212 | ret = __smsc95xx_read_reg(dev, MII_DATA, &val, in_pm); |
| 208 | 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 | 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 | |
| 215 | 221 | done: |
| 216 | 222 | mutex_unlock(&dev->phy_mutex); |
| 223 | + | |
| 224 | + /* Ignore -ENODEV error during disconnect() */ | |
| 225 | + if (ret == -ENODEV) | |
| 226 | + return 0; | |
| 217 | 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 | 245 | val = regval; |
| 236 | 246 | ret = __smsc95xx_write_reg(dev, MII_DATA, val, in_pm); |
| 237 | 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 | 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 | 254 | addr = mii_address_cmd(phy_id, idx, MII_WRITE_ | MII_BUSY_); |
| 244 | 255 | ret = __smsc95xx_write_reg(dev, MII_ADDR, addr, in_pm); |
| 245 | 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 | 259 | goto done; |
| 248 | 260 | } |
| 249 | 261 | |
| @@ -1612,7 +1612,9 @@ free_nfc_dev: · 1611 unmodified lines | ||
| 1612 | 1612 | nfc_digital_free_device(dev->nfc_digital_dev); |
| 1613 | 1613 | |
| 1614 | 1614 | error: |
| 1615 | + usb_kill_urb(dev->in_urb); | |
| 1615 | 1616 | usb_free_urb(dev->in_urb); |
| 1617 | + usb_kill_urb(dev->out_urb); | |
| 1616 | 1618 | usb_free_urb(dev->out_urb); |
| 1617 | 1619 | usb_put_dev(dev->udev); |
| 1618 | 1620 | |
| @@ -3434,7 +3434,6 @@ enum { · 3433 unmodified lines | ||
| 3434 | 3434 | enum { |
| 3435 | 3435 | MLX5_TIRC_PACKET_MERGE_MASK_IPV4_LRO = BIT(0), |
| 3436 | 3436 | MLX5_TIRC_PACKET_MERGE_MASK_IPV6_LRO = BIT(1), |
| 3437 | − MLX5_TIRC_PACKET_MERGE_MASK_SHAMPO = BIT(2), | |
| 3438 | 3437 | }; |
| 3439 | 3438 | |
| 3440 | 3439 | enum { |
| @@ -9900,8 +9899,8 @@ struct mlx5_ifc_bufferx_reg_bits { · 6459 unmodified lines | ||
| 9900 | 9899 | u8 reserved_at_0[0x6]; |
| 9901 | 9900 | u8 lossy[0x1]; |
| 9902 | 9901 | u8 epsb[0x1]; |
| 9903 | − u8 reserved_at_8[0xc]; | |
| 9904 | − u8 size[0xc]; | |
| 9902 | + u8 reserved_at_8[0x8]; | |
| 9903 | + u8 size[0x10]; | |
| 9905 | 9904 | |
| 9906 | 9905 | u8 xoff_threshold[0x10]; |
| 9907 | 9906 | u8 xon_threshold[0x10]; |
| @@ -4602,6 +4602,8 @@ int skb_csum_hwoffload_help(struct sk_buff *skb, · 4601 unmodified lines | ||
| 4602 | 4602 | |
| 4603 | 4603 | struct sk_buff *__skb_gso_segment(struct sk_buff *skb, |
| 4604 | 4604 | 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); | |
| 4605 | 4607 | struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb, |
| 4606 | 4608 | netdev_features_t features); |
| 4607 | 4609 | |
| @@ -87,8 +87,8 @@ extern const int phy_10gbit_features_array[1]; · 86 unmodified lines | ||
| 87 | 87 | * |
| 88 | 88 | * @PHY_INTERFACE_MODE_NA: Not Applicable - don't touch |
| 89 | 89 | * @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 | |
| 92 | 92 | * @PHY_INTERFACE_MODE_SGMII: Serial gigabit media-independent interface |
| 93 | 93 | * @PHY_INTERFACE_MODE_TBI: Ten Bit Interface |
| 94 | 94 | * @PHY_INTERFACE_MODE_REVMII: Reverse Media Independent Interface |
| @@ -4,6 +4,8 @@ · 3 unmodified lines | ||
| 4 | 4 | |
| 5 | 5 | #include <linux/skbuff.h> |
| 6 | 6 | |
| 7 | +#define ESP_SKB_FRAG_MAXSIZE (PAGE_SIZE << SKB_FRAG_PAGE_ORDER) | |
| 8 | + | |
| 7 | 9 | struct ip_esp_hdr; |
| 8 | 10 | |
| 9 | 11 | static inline struct ip_esp_hdr *ip_esp_hdr(const struct sk_buff *skb) |
| @@ -87,6 +87,13 @@ again: · 86 unmodified lines | ||
| 87 | 87 | ax25_for_each(s, &ax25_list) { |
| 88 | 88 | if (s->ax25_dev == ax25_dev) { |
| 89 | 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 | 97 | sock_hold(sk); |
| 91 | 98 | spin_unlock_bh(&ax25_list_lock); |
| 92 | 99 | lock_sock(sk); |
| @@ -276,40 +276,37 @@ EXPORT_SYMBOL(__hci_cmd_sync_status); · 275 unmodified lines | ||
| 276 | 276 | static void hci_cmd_sync_work(struct work_struct *work) |
| 277 | 277 | { |
| 278 | 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 | 280 | bt_dev_dbg(hdev, ""); |
| 285 | 281 | |
| 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; | |
| 301 | 285 | |
| 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; | |
| 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) | |
| 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 | + } | |
| 311 | 308 | |
| 312 | − hci_req_sync_unlock(hdev); | |
| 309 | + kfree(entry); | |
| 313 | 310 | } |
| 314 | 311 | } |
| 315 | 312 | |
| @@ -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 | |
| 4544 | −done: | |
| 4545 | 4544 | hci_dev_unlock(hdev); |
| 4546 | 4545 | |
| 4546 | +done: | |
| 4547 | 4547 | if (status == MGMT_STATUS_SUCCESS) |
| 4548 | 4548 | device_flags_changed(sk, hdev, &cp->addr.bdaddr, cp->addr.type, |
| 4549 | 4549 | supported_flags, current_flags); |
| @@ -92,6 +92,31 @@ void dev_remove_offload(struct packet_offload *po) · 91 unmodified lines | ||
| 92 | 92 | } |
| 93 | 93 | EXPORT_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 | + */ | |
| 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 | + | |
| 95 | 120 | /** |
| 96 | 121 | * skb_mac_gso_segment - mac layer segmentation handler. |
| 97 | 122 | * @skb: buffer to segment |
| @@ -357,7 +357,8 @@ int xdp_rxq_info_reg_mem_model(struct xdp_rxq_info *xdp_rxq, · 356 unmodified lines | ||
| 357 | 357 | if (IS_ERR(xdp_alloc)) |
| 358 | 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 | 362 | return 0; |
| 362 | 363 | } |
| 363 | 364 | |
| @@ -1058,7 +1058,7 @@ static int dsa_tree_setup_switches(struct dsa_switch_tree *dst) · 1057 unmodified lines | ||
| 1058 | 1058 | static int dsa_tree_setup_master(struct dsa_switch_tree *dst) |
| 1059 | 1059 | { |
| 1060 | 1060 | struct dsa_port *dp; |
| 1061 | − int err; | |
| 1061 | + int err = 0; | |
| 1062 | 1062 | |
| 1063 | 1063 | rtnl_lock(); |
| 1064 | 1064 | |
| @@ -1066,13 +1066,13 @@ static int dsa_tree_setup_master(struct dsa_switch_tree *dst) · 1 unmodified line | ||
| 1066 | 1066 | if (dsa_port_is_cpu(dp)) { |
| 1067 | 1067 | err = dsa_master_setup(dp->master, dp); |
| 1068 | 1068 | if (err) |
| 1069 | − return err; | |
| 1069 | + break; | |
| 1070 | 1070 | } |
| 1071 | 1071 | } |
| 1072 | 1072 | |
| 1073 | 1073 | rtnl_unlock(); |
| 1074 | 1074 | |
| 1075 | − return 0; | |
| 1075 | + return err; | |
| 1076 | 1076 | } |
| 1077 | 1077 | |
| 1078 | 1078 | static void dsa_tree_teardown_master(struct dsa_switch_tree *dst) |
| @@ -446,6 +446,7 @@ int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info * · 445 unmodified lines | ||
| 446 | 446 | struct page *page; |
| 447 | 447 | struct sk_buff *trailer; |
| 448 | 448 | int tailen = esp->tailen; |
| 449 | + unsigned int allocsz; | |
| 449 | 450 | |
| 450 | 451 | /* this is non-NULL only with TCP/UDP Encapsulation */ |
| 451 | 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 | 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 | 463 | if (!skb_cloned(skb)) { |
| 459 | 464 | if (tailen <= skb_tailroom(skb)) { |
| 460 | 465 | nfrags = 1; |
| @@ -110,8 +110,7 @@ static struct sk_buff *xfrm4_tunnel_gso_segment(struct xfrm_state *x, · 109 unmodified lines | ||
| 110 | 110 | struct sk_buff *skb, |
| 111 | 111 | netdev_features_t features) |
| 112 | 112 | { |
| 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)); | |
| 115 | 114 | } |
| 116 | 115 | |
| 117 | 116 | 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 | ||
| 160 | 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 | 165 | __skb_pull(skb, skb_transport_offset(skb)); |
| 164 | 166 | ops = rcu_dereference(inet_offloads[proto]); |
| 165 | 167 | if (likely(ops && ops->callbacks.gso_segment)) |
| @@ -482,6 +482,7 @@ int esp6_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info · 481 unmodified lines | ||
| 482 | 482 | struct page *page; |
| 483 | 483 | struct sk_buff *trailer; |
| 484 | 484 | int tailen = esp->tailen; |
| 485 | + unsigned int allocsz; | |
| 485 | 486 | |
| 486 | 487 | if (x->encap) { |
| 487 | 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 | 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 | 498 | if (!skb_cloned(skb)) { |
| 494 | 499 | if (tailen <= skb_tailroom(skb)) { |
| 495 | 500 | nfrags = 1; |
| @@ -145,8 +145,7 @@ static struct sk_buff *xfrm6_tunnel_gso_segment(struct xfrm_state *x, · 144 unmodified lines | ||
| 145 | 145 | struct sk_buff *skb, |
| 146 | 146 | netdev_features_t features) |
| 147 | 147 | { |
| 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)); | |
| 150 | 149 | } |
| 151 | 150 | |
| 152 | 151 | 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 | ||
| 199 | 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 | 204 | __skb_pull(skb, skb_transport_offset(skb)); |
| 203 | 205 | ops = rcu_dereference(inet6_offloads[proto]); |
| 204 | 206 | if (likely(ops && ops->callbacks.gso_segment)) |
| @@ -45,6 +45,19 @@ static int __xfrm6_output_finish(struct net *net, struct sock *sk, struct sk_buf · 44 unmodified lines | ||
| 45 | 45 | return xfrm_output(sk, skb); |
| 46 | 46 | } |
| 47 | 47 | |
| 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 | + | |
| 48 | 61 | static int __xfrm6_output(struct net *net, struct sock *sk, struct sk_buff *skb) |
| 49 | 62 | { |
| 50 | 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 | 86 | xfrm6_local_rxpmtu(skb, mtu); |
| 74 | 87 | kfree_skb(skb); |
| 75 | 88 | return -EMSGSIZE; |
| 89 | + } else if (toobig && xfrm6_noneed_fragment(skb)) { | |
| 90 | + skb->ignore_df = 1; | |
| 91 | + goto skip_frag; | |
| 76 | 92 | } else if (!skb->ignore_df && toobig && skb->sk) { |
| 77 | 93 | xfrm_local_error(skb, mtu); |
| 78 | 94 | kfree_skb(skb); |
| @@ -61,10 +61,6 @@ static void inet_diag_msg_sctpasoc_fill(struct inet_diag_msg *r, · 60 unmodified lines | ||
| 61 | 61 | r->idiag_timer = SCTP_EVENT_TIMEOUT_T3_RTX; |
| 62 | 62 | r->idiag_retrans = asoc->rtx_data_chunks; |
| 63 | 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 | 140 | r = nlmsg_data(nlh); |
| 145 | 141 | BUG_ON(!sk_fullsock(sk)); |
| 146 | 142 | |
| 143 | + r->idiag_timer = 0; | |
| 144 | + r->idiag_retrans = 0; | |
| 145 | + r->idiag_expires = 0; | |
| 147 | 146 | if (asoc) { |
| 148 | 147 | inet_diag_msg_sctpasoc_fill(r, sk, asoc); |
| 149 | 148 | } else { |
| 150 | 149 | inet_diag_msg_common_fill(r, sk); |
| 151 | 150 | r->idiag_state = sk->sk_state; |
| 152 | − r->idiag_timer = 0; | |
| 153 | − r->idiag_retrans = 0; | |
| 154 | 151 | } |
| 155 | 152 | |
| 156 | 153 | if (inet_diag_msg_attrs_fill(sk, skb, r, ext, user_ns, net_admin)) |
| @@ -352,16 +352,18 @@ static int tipc_enable_bearer(struct net *net, const char *name, · 351 unmodified lines | ||
| 352 | 352 | goto rejected; |
| 353 | 353 | } |
| 354 | 354 | |
| 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 */ | |
| 360 | 356 | if (tipc_mon_create(net, bearer_id)) { |
| 361 | 357 | bearer_disable(net, b); |
| 358 | + kfree_skb(skb); | |
| 362 | 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 | 367 | pr_info("Enabled bearer <%s>, priority %u\n", name, prio); |
| 366 | 368 | |
| 367 | 369 | return res; |
| @@ -2286,6 +2286,11 @@ static int tipc_link_proto_rcv(struct tipc_link *l, struct sk_buff *skb, · 2285 unmodified lines | ||
| 2286 | 2286 | break; |
| 2287 | 2287 | |
| 2288 | 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 | 2294 | l->rcv_nxt_state = msg_seqno(hdr) + 1; |
| 2290 | 2295 | |
| 2291 | 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 | 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 | 2319 | tipc_mon_rcv(l->net, data + glen, dlen - glen, l->addr, |
| 2319 | 2320 | &l->mon_state, l->bearer_id); |
| 2320 | 2321 | |
| @@ -304,7 +304,10 @@ xfrmi_xmit2(struct sk_buff *skb, struct net_device *dev, struct flowi *fl) · 303 unmodified lines | ||
| 304 | 304 | if (mtu < IPV6_MIN_MTU) |
| 305 | 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 | 311 | } else { |
| 309 | 312 | if (!(ip_hdr(skb)->frag_off & htons(IP_DF))) |
| 310 | 313 | goto xmit; |
| @@ -630,13 +630,8 @@ static struct xfrm_state *xfrm_state_construct(struct net *net, · 629 unmodified lines | ||
| 630 | 630 | |
| 631 | 631 | xfrm_smark_init(attrs, &x->props.smark); |
| 632 | 632 | |
| 633 | − if (attrs[XFRMA_IF_ID]) { | |
| 633 | + if (attrs[XFRMA_IF_ID]) | |
| 634 | 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 | 636 | err = __xfrm_init_state(x, false, attrs[XFRMA_OFFLOAD_DEV]); |
| 642 | 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 | 1428 | mark = xfrm_mark_get(attrs, &m); |
| 1434 | 1429 | |
| 1435 | − if (attrs[XFRMA_IF_ID]) { | |
| 1430 | + if (attrs[XFRMA_IF_ID]) | |
| 1436 | 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 | 1433 | if (p->info.seq) { |
| 1444 | 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 | 1742 | xfrm_mark_get(attrs, &xp->mark); |
| 1753 | 1743 | |
| 1754 | − if (attrs[XFRMA_IF_ID]) { | |
| 1744 | + if (attrs[XFRMA_IF_ID]) | |
| 1755 | 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 | 1747 | return xp; |
| 1763 | 1748 | error: |
| @@ -374,6 +374,16 @@ run_cmd() { · 373 unmodified lines | ||
| 374 | 374 | return $rc |
| 375 | 375 | } |
| 376 | 376 | |
| 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 | + | |
| 377 | 387 | # Find the auto-generated name for this namespace |
| 378 | 388 | nsname() { |
| 379 | 389 | eval echo \$NS_$1 |
| @@ -670,10 +680,10 @@ setup_nettest_xfrm() { · 290 unmodified lines | ||
| 670 | 680 | [ ${1} -eq 6 ] && proto="-6" || proto="" |
| 671 | 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 | 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 | 687 | nettest_pids="${nettest_pids} $!" |
| 678 | 688 | } |
| 679 | 689 | |
| @@ -865,7 +875,6 @@ setup_ovs_bridge() { · 185 unmodified lines | ||
| 865 | 875 | setup() { |
| 866 | 876 | [ "$(id -u)" -ne 0 ] && echo " need to run as root" && return $ksft_skip |
| 867 | 877 | |
| 868 | − cleanup | |
| 869 | 878 | for arg do |
| 870 | 879 | eval setup_${arg} || { echo " ${arg} not supported"; return 1; } |
| 871 | 880 | done |
| @@ -876,7 +885,7 @@ trace() { · 4 unmodified lines | ||
| 876 | 885 | |
| 877 | 886 | for arg do |
| 878 | 887 | [ "${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 | 889 | tcpdump_pids="${tcpdump_pids} $!" |
| 881 | 890 | ns_cmd= |
| 882 | 891 | done |
| @@ -1836,6 +1845,10 @@ run_test() { · 953 unmodified lines | ||
| 1836 | 1845 | |
| 1837 | 1846 | 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 | 1852 | if [ "$VERBOSE" = "1" ]; then |
| 1840 | 1853 | printf "\n##########################################################################\n\n" |
| 1841 | 1854 | fi |