1. 10 Jun, 2023 20 commits
  2. 09 Jun, 2023 8 commits
  3. 08 Jun, 2023 12 commits
    • Wei Fang's avatar
      net: enetc: correct the indexes of highest and 2nd highest TCs · 21225873
      Wei Fang authored
      For ENETC hardware, the TCs are numbered from 0 to N-1, where N
      is the number of TCs. Numerically higher TC has higher priority.
      It's obvious that the highest priority TC index should be N-1 and
      the 2nd highest priority TC index should be N-2.
      
      However, the previous logic uses netdev_get_prio_tc_map() to get
      the indexes of highest priority and 2nd highest priority TCs, it
      does not make sense and is incorrect to give a "tc" argument to
      netdev_get_prio_tc_map(). So the driver may get the wrong indexes
      of the two highest priotiry TCs which would lead to failed to set
      the CBS for the two highest priotiry TCs.
      
      e.g.
      $ tc qdisc add dev eno0 parent root handle 100: mqprio num_tc 6 \
      	map 0 0 1 1 2 3 4 5 queues 1@0 1@1 1@2 1@3 2@4 2@6 hw 1
      $ tc qdisc replace dev eno0 parent 100:6 cbs idleslope 100000 \
      	sendslope -900000 hicredit 12 locredit -113 offload 1
      $ Error: Specified device failed to setup cbs hardware offload.
        ^^^^^
      
      In this example, the previous logic deems the indexes of the two
      highest priotiry TCs should be 3 and 2. Actually, the indexes are
      5 and 4, because the number of TCs is 6. So it would be failed to
      configure the CBS for the two highest priority TCs.
      
      Fixes: c431047c ("enetc: add support Credit Based Shaper(CBS) for hardware offload")
      Signed-off-by: default avatarWei Fang <wei.fang@nxp.com>
      Reviewed-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarMaciej Fijalkowski <maciej.fijalkowski@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      21225873
    • Kamil Maziarz's avatar
      ice: Fix XDP memory leak when NIC is brought up and down · 78c50d69
      Kamil Maziarz authored
      Fix the buffer leak that occurs while switching
      the port up and down with traffic and XDP by
      checking for an active XDP program and freeing all empty TX buffers.
      
      Fixes: efc2214b ("ice: Add support for XDP")
      Signed-off-by: default avatarKamil Maziarz <kamil.maziarz@intel.com>
      Tested-by: Chandan Kumar Rout <chandanx.rout@intel.com> (A Contingent Worker at Intel)
      Acked-by: default avatarMaciej Fijalkowski <maciej.fijalkowski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      78c50d69
    • Linus Torvalds's avatar
      Merge tag 'net-6.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 25041a4c
      Linus Torvalds authored
      Pull networking fixes from Paolo Abeni:
       "Including fixes from can, wifi, netfilter, bluetooth and ebpf.
      
        Current release - regressions:
      
         - bpf: sockmap: avoid potential NULL dereference in
           sk_psock_verdict_data_ready()
      
         - wifi: iwlwifi: fix -Warray-bounds bug in iwl_mvm_wait_d3_notif()
      
         - phylink: actually fix ksettings_set() ethtool call
      
         - eth: dwmac-qcom-ethqos: fix a regression on EMAC < 3
      
        Current release - new code bugs:
      
         - wifi: mt76: fix possible NULL pointer dereference in
           mt7996_mac_write_txwi()
      
        Previous releases - regressions:
      
         - netfilter: fix NULL pointer dereference in nf_confirm_cthelper
      
         - wifi: rtw88/rtw89: correct PS calculation for SUPPORTS_DYNAMIC_PS
      
         - openvswitch: fix upcall counter access before allocation
      
         - bluetooth:
            - fix use-after-free in hci_remove_ltk/hci_remove_irk
            - fix l2cap_disconnect_req deadlock
      
         - nic: bnxt_en: prevent kernel panic when receiving unexpected
           PHC_UPDATE event
      
        Previous releases - always broken:
      
         - core: annotate rfs lockless accesses
      
         - sched: fq_pie: ensure reasonable TCA_FQ_PIE_QUANTUM values
      
         - netfilter: add null check for nla_nest_start_noflag() in
           nft_dump_basechain_hook()
      
         - bpf: fix UAF in task local storage
      
         - ipv4: ping_group_range: allow GID from 2147483648 to 4294967294
      
         - ipv6: rpl: fix route of death.
      
         - tcp: gso: really support BIG TCP
      
         - mptcp: fixes for user-space PM address advertisement
      
         - smc: avoid to access invalid RMBs' MRs in SMCRv1 ADD LINK CONT
      
         - can: avoid possible use-after-free when j1939_can_rx_register fails
      
         - batman-adv: fix UaF while rescheduling delayed work
      
         - eth: qede: fix scheduling while atomic
      
         - eth: ice: make writes to /dev/gnssX synchronous"
      
      * tag 'net-6.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (83 commits)
        bnxt_en: Implement .set_port / .unset_port UDP tunnel callbacks
        bnxt_en: Prevent kernel panic when receiving unexpected PHC_UPDATE event
        bnxt_en: Skip firmware fatal error recovery if chip is not accessible
        bnxt_en: Query default VLAN before VNIC setup on a VF
        bnxt_en: Don't issue AP reset during ethtool's reset operation
        bnxt_en: Fix bnxt_hwrm_update_rss_hash_cfg()
        net: bcmgenet: Fix EEE implementation
        eth: ixgbe: fix the wake condition
        eth: bnxt: fix the wake condition
        lib: cpu_rmap: Fix potential use-after-free in irq_cpu_rmap_release()
        bpf: Add extra path pointer check to d_path helper
        net: sched: fix possible refcount leak in tc_chain_tmplt_add()
        net: sched: act_police: fix sparse errors in tcf_police_dump()
        net: openvswitch: fix upcall counter access before allocation
        net: sched: move rtm_tca_policy declaration to include file
        ice: make writes to /dev/gnssX synchronous
        net: sched: add rcu annotations around qdisc->qdisc_sleeping
        rfs: annotate lockless accesses to RFS sock flow table
        rfs: annotate lockless accesses to sk->sk_rxhash
        virtio_net: use control_buf for coalesce params
        ...
      25041a4c
    • Linus Torvalds's avatar
      Merge tag 'xfs-6.4-rc5-fixes' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · 79b6fad5
      Linus Torvalds authored
      Pull xfs fixes from Dave Chinner:
       "These are a set of regression fixes discovered on recent kernels. I
        was hoping to send this to you a week and half ago, but events out of
        my control delayed finalising the changes until early this week.
      
        Whilst the diffstat looks large for this stage of the merge window, a
        large chunk of it comes from moving the guts of one function from one
        file to another i.e. it's the same code, it is just run in a different
        context where it is safe to hold a specific lock. Otherwise the
        individual changes are relatively small and straigtht forward.
      
        Summary:
      
         - Propagate unlinked inode list corruption back up to log recovery
           (regression fix)
      
         - improve corruption detection for AGFL entries, AGFL indexes and
           XEFI extents (syzkaller fuzzer oops report)
      
         - Avoid double perag reference release (regression fix)
      
         - Improve extent merging detection in scrub (regression fix)
      
         - Fix a new undefined high bit shift (regression fix)
      
         - Fix for AGF vs inode cluster buffer deadlock (regression fix)"
      
      * tag 'xfs-6.4-rc5-fixes' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: collect errors from inodegc for unlinked inode recovery
        xfs: validate block number being freed before adding to xefi
        xfs: validity check agbnos on the AGFL
        xfs: fix agf/agfl verification on v4 filesystems
        xfs: fix double xfs_perag_rele() in xfs_filestream_pick_ag()
        xfs: fix broken logic when detecting mergeable bmap records
        xfs: Fix undefined behavior of shift into sign bit
        xfs: fix AGF vs inode cluster buffer deadlock
        xfs: defered work could create precommits
        xfs: restore allocation trylock iteration
        xfs: buffer pins need to hold a buffer reference
      79b6fad5
    • Simon Horman's avatar
      ice: Don't dereference NULL in ice_gnss_read error path · 05a1308a
      Simon Horman authored
      If pf is NULL in ice_gnss_read() then it will be dereferenced
      in the error path by a call to dev_dbg(ice_pf_to_dev(pf), ...).
      
      Avoid this by simply returning in this case.
      If logging is desired an alternate approach might be to
      use pr_err() before returning.
      
      Flagged by Smatch as:
      
        .../ice_gnss.c:196 ice_gnss_read() error: we previously assumed 'pf' could be null (see line 131)
      
      Fixes: 43113ff7 ("ice: add TTY for GNSS module for E810T device")
      Signed-off-by: default avatarSimon Horman <horms@kernel.org>
      Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
      Tested-by: Sunitha Mekala <sunithax.d.mekala@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      05a1308a
    • Paolo Abeni's avatar
      Merge branch 'bnxt_en-bug-fixes' · 6c0ec7ab
      Paolo Abeni authored
      Michael Chan says:
      
      ====================
      bnxt_en: Bug fixes
      
      This patchset has the following fixes for bnxt_en:
      
      1. Add missing VNIC ID parameter in the FW message when getting an
      updated RSS configuration from the FW.
      
      2. Fix a warning when doing ethtool reset on newer chips.
      
      3. Fix VLAN issue on a VF when a default VLAN is assigned.
      
      4. Fix a problem during DPC (Downstream Port containment) scenario.
      
      5. Fix a NULL pointer dereference when receiving a PTP event from FW.
      
      6. Fix VXLAN/Geneve UDP port delete/add with newer FW.
      ====================
      
      Link: https://lore.kernel.org/r/20230607075409.228450-1-michael.chan@broadcom.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      6c0ec7ab
    • Somnath Kotur's avatar
      bnxt_en: Implement .set_port / .unset_port UDP tunnel callbacks · 1eb4ef12
      Somnath Kotur authored
      As per the new udp tunnel framework, drivers which need to know the
      details of a port entry (i.e. port type) when it gets deleted should
      use the .set_port / .unset_port callbacks.
      
      Implementing the current .udp_tunnel_sync callback would mean that the
      deleted tunnel port entry would be all zeros.  This used to work on
      older firmware because it would not check the input when deleting a
      tunnel port.  With newer firmware, the delete will now fail and
      subsequent tunnel port allocation will fail as a result.
      
      Fixes: 442a35a5 ("bnxt: convert to new udp_tunnel_nic infra")
      Reviewed-by: default avatarKalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
      Signed-off-by: default avatarSomnath Kotur <somnath.kotur@broadcom.com>
      Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      1eb4ef12
    • Pavan Chebbi's avatar
      bnxt_en: Prevent kernel panic when receiving unexpected PHC_UPDATE event · 319a7827
      Pavan Chebbi authored
      The firmware can send PHC_RTC_UPDATE async event on a PF that may not
      have PTP registered. In such a case, there will be a null pointer
      deference for bp->ptp_cfg when we try to handle the event.
      
      Fix it by not registering for this event with the firmware if !bp->ptp_cfg.
      Also, check that bp->ptp_cfg is valid before proceeding when we receive
      the event.
      
      Fixes: 8bcf6f04 ("bnxt_en: Handle async event when the PHC is updated in RTC mode")
      Signed-off-by: default avatarPavan Chebbi <pavan.chebbi@broadcom.com>
      Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      319a7827
    • Vikas Gupta's avatar
      bnxt_en: Skip firmware fatal error recovery if chip is not accessible · 83474a9b
      Vikas Gupta authored
      Driver starts firmware fatal error recovery by detecting
      heartbeat failure or fw reset count register changing.  But
      these checks are not reliable if the device is not accessible.
      This can happen while DPC (Downstream Port containment) is in
      progress.  Skip firmware fatal recovery if pci_device_is_present()
      returns false.
      
      Fixes: acfb50e4 ("bnxt_en: Add FW fatal devlink_health_reporter.")
      Reviewed-by: default avatarSomnath Kotur <somnath.kotur@broadcom.com>
      Reviewed-by: default avatarPavan Chebbi <pavan.chebbi@broadcom.com>
      Signed-off-by: default avatarVikas Gupta <vikas.gupta@broadcom.com>
      Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      83474a9b
    • Somnath Kotur's avatar
      bnxt_en: Query default VLAN before VNIC setup on a VF · 1a9e4f50
      Somnath Kotur authored
      We need to call bnxt_hwrm_func_qcfg() on a VF to query the default
      VLAN that may be setup by the PF.  If a default VLAN is enabled,
      the VF cannot support VLAN acceleration on the receive side and
      the VNIC must be setup to strip out the default VLAN tag.  If a
      default VLAN is not enabled, the VF can support VLAN acceleration
      on the receive side.  The VNIC should be set up to strip or not
      strip the VLAN based on the RX VLAN acceleration setting.
      
      Without this call to determine the default VLAN before calling
      bnxt_setup_vnic(), the VNIC may not be set up correctly.  For
      example, bnxt_setup_vnic() may set up to strip the VLAN tag based
      on stale default VLAN information.  If RX VLAN acceleration is
      not enabled, the VLAN tag will be incorrectly stripped and the
      RX data path will not work correctly.
      
      Fixes: cf6645f8 ("bnxt_en: Add function for VF driver to query default VLAN.")
      Reviewed-by: default avatarPavan Chebbi <pavan.chebbi@broadcom.com>
      Signed-off-by: default avatarSomnath Kotur <somnath.kotur@broadcom.com>
      Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      1a9e4f50
    • Sreekanth Reddy's avatar
      bnxt_en: Don't issue AP reset during ethtool's reset operation · 1d997801
      Sreekanth Reddy authored
      Only older NIC controller's firmware uses the PROC AP reset type.
      Firmware on 5731X/5741X and newer chips does not support this reset
      type.  When bnxt_reset() issues a series of resets, this PROC AP
      reset may actually fail on these newer chips because the firmware
      is not ready to accept this unsupported command yet.  Avoid this
      unnecessary error by skipping this reset type on chips that don't
      support it.
      
      Fixes: 7a13240e ("bnxt_en: fix ethtool_reset_flags ABI violations")
      Reviewed-by: default avatarPavan Chebbi <pavan.chebbi@broadcom.com>
      Signed-off-by: default avatarSreekanth Reddy <sreekanth.reddy@broadcom.com>
      Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      1d997801
    • Pavan Chebbi's avatar
      bnxt_en: Fix bnxt_hwrm_update_rss_hash_cfg() · 095d5dc0
      Pavan Chebbi authored
      We must specify the vnic id of the vnic in the input structure of this
      firmware message.  Otherwise we will get an error from the firmware.
      
      Fixes: 98a4322b ("bnxt_en: update RSS config using difference algorithm")
      Reviewed-by: default avatarKalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
      Reviewed-by: default avatarSomnath Kotur <somnath.kotur@broadcom.com>
      Signed-off-by: default avatarPavan Chebbi <pavan.chebbi@broadcom.com>
      Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      095d5dc0