* [openeuler:OLK-5.10 2858/2858] drivers/net/ethernet/netswift/ngbe/ngbe_main.c:6835 ngbe_io_error_detected() warn: inconsistent indenting
@ 2025-04-11 16:46 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-04-11 16:46 UTC (permalink / raw)
To: kernel; +Cc: oe-kbuild-all
tree: https://gitee.com/openeuler/kernel.git OLK-5.10
head: 8cf05d37849321b8bb9b74e099fa5bb6164d4f56
commit: a5961b4bc6ce09a70902686ecc848a47493a9251 [2858/2858] openeuler: net: ngbe: add ngbe module support
config: x86_64-randconfig-161-20250411 (https://download.01.org/0day-ci/archive/20250412/202504120007.4O7NSSul-lkp@intel.com/config)
compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202504120007.4O7NSSul-lkp@intel.com/
New smatch warnings:
drivers/net/ethernet/netswift/ngbe/ngbe_main.c:6835 ngbe_io_error_detected() warn: inconsistent indenting
Old smatch warnings:
drivers/net/ethernet/netswift/ngbe/ngbe_main.c:1850 ngbe_request_msix_irqs() warn: 'entry->vector' from request_irq() not released on lines: 1850.
drivers/net/ethernet/netswift/ngbe/ngbe_main.c:3931 ngbe_setup_all_rx_resources() warn: inconsistent indenting
drivers/net/ethernet/netswift/ngbe/ngbe_main.c:5084 ngbe_reset_subtask() warn: inconsistent indenting
drivers/net/ethernet/netswift/ngbe/ngbe_main.c:5313 ngbe_tso() warn: inconsistent indenting
vim +6835 drivers/net/ethernet/netswift/ngbe/ngbe_main.c
6819
6820 /**
6821 * ngbe_io_error_detected - called when PCI error is detected
6822 * @pdev: Pointer to PCI device
6823 * @state: The current pci connection state
6824 *
6825 * This function is called after a PCI bus error affecting
6826 * this device has been detected.
6827 */
6828 static pci_ers_result_t ngbe_io_error_detected(struct pci_dev *pdev,
6829 pci_channel_state_t state)
6830 {
6831 struct ngbe_adapter *adapter = pci_get_drvdata(pdev);
6832 struct net_device *netdev = adapter->netdev;
6833
6834 #ifdef CONFIG_PCI_IOV
> 6835 struct ngbe_hw *hw = &adapter->hw;
6836 struct pci_dev *bdev, *vfdev;
6837 u32 dw0, dw1, dw2, dw3;
6838 int vf, pos;
6839 u16 req_id, pf_func;
6840
6841 if (adapter->num_vfs == 0)
6842 goto skip_bad_vf_detection;
6843
6844 bdev = pdev->bus->self;
6845 while (bdev && (pci_pcie_type(bdev) != PCI_EXP_TYPE_ROOT_PORT))
6846 bdev = bdev->bus->self;
6847
6848 if (!bdev)
6849 goto skip_bad_vf_detection;
6850
6851 pos = pci_find_ext_capability(bdev, PCI_EXT_CAP_ID_ERR);
6852 if (!pos)
6853 goto skip_bad_vf_detection;
6854
6855 dw0 = ngbe_read_pci_cfg_dword(hw, pos + PCI_ERR_HEADER_LOG);
6856 dw1 = ngbe_read_pci_cfg_dword(hw,
6857 pos + PCI_ERR_HEADER_LOG + 4);
6858 dw2 = ngbe_read_pci_cfg_dword(hw,
6859 pos + PCI_ERR_HEADER_LOG + 8);
6860 dw3 = ngbe_read_pci_cfg_dword(hw,
6861 pos + PCI_ERR_HEADER_LOG + 12);
6862 if (NGBE_REMOVED(hw->hw_addr))
6863 goto skip_bad_vf_detection;
6864
6865 req_id = dw1 >> 16;
6866 /* if bit 7 of the requestor ID is set then it's a VF */
6867 if (!(req_id & 0x0080))
6868 goto skip_bad_vf_detection;
6869
6870 pf_func = req_id & 0x01;
6871 if ((pf_func & 1) == (pdev->devfn & 1)) {
6872 vf = (req_id & 0x7F) >> 1;
6873 e_dev_err("VF %d has caused a PCIe error\n", vf);
6874 e_dev_err("TLP: dw0: %8.8x\tdw1: %8.8x\tdw2: %8.8x\tdw3: %8.8x\n",
6875 dw0, dw1, dw2, dw3);
6876
6877 /* Find the pci device of the offending VF */
6878 vfdev = pci_get_device(PCI_VENDOR_ID_TRUSTNETIC,
6879 NGBE_VF_DEVICE_ID, NULL);
6880 while (vfdev) {
6881 if (vfdev->devfn == (req_id & 0xFF))
6882 break;
6883 vfdev = pci_get_device(PCI_VENDOR_ID_TRUSTNETIC,
6884 NGBE_VF_DEVICE_ID, vfdev);
6885 }
6886 /* There's a slim chance the VF could have been hot
6887 * plugged, so if it is no longer present we don't need
6888 * to issue the VFLR.Just clean up the AER in that case.
6889 */
6890 if (vfdev) {
6891 ngbe_issue_vf_flr(adapter, vfdev);
6892 /* Free device reference count */
6893 pci_dev_put(vfdev);
6894 }
6895
6896 pci_aer_clear_nonfatal_status(pdev);
6897 }
6898
6899 /* Even though the error may have occurred on the other port
6900 * we still need to increment the vf error reference count for
6901 * both ports because the I/O resume function will be called
6902 * for both of them.
6903 */
6904 adapter->vferr_refcount++;
6905
6906 return PCI_ERS_RESULT_RECOVERED;
6907
6908 skip_bad_vf_detection:
6909 #endif /* CONFIG_PCI_IOV */
6910
6911 if (!test_bit(__NGBE_SERVICE_INITED, &adapter->state))
6912 return PCI_ERS_RESULT_DISCONNECT;
6913
6914 rtnl_lock();
6915 netif_device_detach(netdev);
6916
6917 if (state == pci_channel_io_perm_failure) {
6918 rtnl_unlock();
6919 return PCI_ERS_RESULT_DISCONNECT;
6920 }
6921
6922 if (netif_running(netdev))
6923 ngbe_close(netdev);
6924
6925 if (!test_and_set_bit(__NGBE_DISABLED, &adapter->state))
6926 pci_disable_device(pdev);
6927 rtnl_unlock();
6928
6929 /* Request a slot reset. */
6930 return PCI_ERS_RESULT_NEED_RESET;
6931 }
6932
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-04-11 16:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-11 16:46 [openeuler:OLK-5.10 2858/2858] drivers/net/ethernet/netswift/ngbe/ngbe_main.c:6835 ngbe_io_error_detected() warn: inconsistent indenting kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.