Skip to content
Snippets Groups Projects
Select Git revision
  • 03e69b508b6f7c51743055c9f61d1dfeadf4b635
  • vme-testing default
  • ci-test
  • master
  • remoteproc
  • am625-sk-ov5640
  • pcal6534-upstreaming
  • lps22df-upstreaming
  • msc-upstreaming
  • imx8mp
  • iio/noa1305
  • vme-next
  • vme-next-4.14-rc4
  • v4.14-rc4
  • v4.14-rc3
  • v4.14-rc2
  • v4.14-rc1
  • v4.13
  • vme-next-4.13-rc7
  • v4.13-rc7
  • v4.13-rc6
  • v4.13-rc5
  • v4.13-rc4
  • v4.13-rc3
  • v4.13-rc2
  • v4.13-rc1
  • v4.12
  • v4.12-rc7
  • v4.12-rc6
  • v4.12-rc5
  • v4.12-rc4
  • v4.12-rc3
32 results

core.c

Blame
  • ice_main.c 101.57 KiB
    // SPDX-License-Identifier: GPL-2.0
    /* Copyright (c) 2018, Intel Corporation. */
    
    /* Intel(R) Ethernet Connection E800 Series Linux Driver */
    
    #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
    
    #include "ice.h"
    #include "ice_lib.h"
    
    #define DRV_VERSION	"0.7.1-k"
    #define DRV_SUMMARY	"Intel(R) Ethernet Connection E800 Series Linux Driver"
    const char ice_drv_ver[] = DRV_VERSION;
    static const char ice_driver_string[] = DRV_SUMMARY;
    static const char ice_copyright[] = "Copyright (c) 2018, Intel Corporation.";
    
    MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>");
    MODULE_DESCRIPTION(DRV_SUMMARY);
    MODULE_LICENSE("GPL v2");
    MODULE_VERSION(DRV_VERSION);
    
    static int debug = -1;
    module_param(debug, int, 0644);
    #ifndef CONFIG_DYNAMIC_DEBUG
    MODULE_PARM_DESC(debug, "netif level (0=none,...,16=all), hw debug_mask (0x8XXXXXXX)");
    #else
    MODULE_PARM_DESC(debug, "netif level (0=none,...,16=all)");
    #endif /* !CONFIG_DYNAMIC_DEBUG */
    
    static struct workqueue_struct *ice_wq;
    static const struct net_device_ops ice_netdev_ops;
    
    static void ice_pf_dis_all_vsi(struct ice_pf *pf);
    static void ice_rebuild(struct ice_pf *pf);
    
    static void ice_vsi_release_all(struct ice_pf *pf);
    static void ice_update_vsi_stats(struct ice_vsi *vsi);
    static void ice_update_pf_stats(struct ice_pf *pf);
    
    /**
     * ice_get_tx_pending - returns number of Tx descriptors not processed
     * @ring: the ring of descriptors
     */
    static u32 ice_get_tx_pending(struct ice_ring *ring)
    {
    	u32 head, tail;
    
    	head = ring->next_to_clean;
    	tail = readl(ring->tail);
    
    	if (head != tail)
    		return (head < tail) ?
    			tail - head : (tail + ring->count - head);
    	return 0;
    }
    
    /**
     * ice_check_for_hang_subtask - check for and recover hung queues
     * @pf: pointer to PF struct
     */
    static void ice_check_for_hang_subtask(struct ice_pf *pf)
    {
    	struct ice_vsi *vsi = NULL;
    	unsigned int i;
    	u32 v, v_idx;
    	int packets;
    
    	ice_for_each_vsi(pf, v)
    		if (pf->vsi[v] && pf->vsi[v]->type == ICE_VSI_PF) {
    			vsi = pf->vsi[v];