#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/workqueue.h>
#include <linux/pci.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/if.h>
#include <linux/if_ether.h>
#include <linux/if_vlan.h>
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/tcp.h>
#include <linux/rtnetlink.h>
#include <linux/prefetch.h>
#include <net/ip6_checksum.h>
#include <linux/ktime.h>
#include <linux/numa.h>
#ifdef CONFIG_RFS_ACCEL
#include <linux/cpu_rmap.h>
#endif
#include <linux/crash_dump.h>
#include <net/busy_poll.h>
#include <net/vxlan.h>
#include "cq_enet_desc.h"
#include "vnic_dev.h"
#include "vnic_intr.h"
#include "vnic_stats.h"
#include "vnic_vic.h"
#include "enic_res.h"
#include "enic.h"
#include "enic_dev.h"
#include "enic_pp.h"
#include "enic_clsf.h"
#define ENIC_NOTIFY_TIMER_PERIOD …
#define WQ_ENET_MAX_DESC_LEN …
#define MAX_TSO …
#define ENIC_DESC_MAX_SPLITS …
#define PCI_DEVICE_ID_CISCO_VIC_ENET …
#define PCI_DEVICE_ID_CISCO_VIC_ENET_DYN …
#define PCI_DEVICE_ID_CISCO_VIC_ENET_VF …
#define RX_COPYBREAK_DEFAULT …
static const struct pci_device_id enic_id_table[] = …;
MODULE_DESCRIPTION(…);
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_DEVICE_TABLE(pci, enic_id_table);
#define ENIC_LARGE_PKT_THRESHOLD …
#define ENIC_MAX_COALESCE_TIMERS …
static struct enic_intr_mod_table mod_table[ENIC_MAX_COALESCE_TIMERS + 1] = …;
static struct enic_intr_mod_range mod_range[ENIC_MAX_LINK_SPEEDS] = …;
static void enic_init_affinity_hint(struct enic *enic)
{ … }
static void enic_free_affinity_hint(struct enic *enic)
{ … }
static void enic_set_affinity_hint(struct enic *enic)
{ … }
static void enic_unset_affinity_hint(struct enic *enic)
{ … }
static int enic_udp_tunnel_set_port(struct net_device *netdev,
unsigned int table, unsigned int entry,
struct udp_tunnel_info *ti)
{ … }
static int enic_udp_tunnel_unset_port(struct net_device *netdev,
unsigned int table, unsigned int entry,
struct udp_tunnel_info *ti)
{ … }
static const struct udp_tunnel_nic_info enic_udp_tunnels = …, enic_udp_tunnels_v4 = …;
static netdev_features_t enic_features_check(struct sk_buff *skb,
struct net_device *dev,
netdev_features_t features)
{ … }
int enic_is_dynamic(struct enic *enic)
{ … }
int enic_sriov_enabled(struct enic *enic)
{ … }
static int enic_is_sriov_vf(struct enic *enic)
{ … }
int enic_is_valid_vf(struct enic *enic, int vf)
{ … }
static void enic_free_wq_buf(struct vnic_wq *wq, struct vnic_wq_buf *buf)
{ … }
static void enic_wq_free_buf(struct vnic_wq *wq,
struct cq_desc *cq_desc, struct vnic_wq_buf *buf, void *opaque)
{ … }
static int enic_wq_service(struct vnic_dev *vdev, struct cq_desc *cq_desc,
u8 type, u16 q_number, u16 completed_index, void *opaque)
{ … }
static bool enic_log_q_error(struct enic *enic)
{ … }
static void enic_msglvl_check(struct enic *enic)
{ … }
static void enic_mtu_check(struct enic *enic)
{ … }
static void enic_link_check(struct enic *enic)
{ … }
static void enic_notify_check(struct enic *enic)
{ … }
#define ENIC_TEST_INTR(pba, i) …
static irqreturn_t enic_isr_legacy(int irq, void *data)
{ … }
static irqreturn_t enic_isr_msi(int irq, void *data)
{ … }
static irqreturn_t enic_isr_msix(int irq, void *data)
{ … }
static irqreturn_t enic_isr_msix_err(int irq, void *data)
{ … }
static irqreturn_t enic_isr_msix_notify(int irq, void *data)
{ … }
static int enic_queue_wq_skb_cont(struct enic *enic, struct vnic_wq *wq,
struct sk_buff *skb, unsigned int len_left,
int loopback)
{ … }
static int enic_queue_wq_skb_vlan(struct enic *enic, struct vnic_wq *wq,
struct sk_buff *skb, int vlan_tag_insert,
unsigned int vlan_tag, int loopback)
{ … }
static int enic_queue_wq_skb_csum_l4(struct enic *enic, struct vnic_wq *wq,
struct sk_buff *skb, int vlan_tag_insert,
unsigned int vlan_tag, int loopback)
{ … }
static void enic_preload_tcp_csum_encap(struct sk_buff *skb)
{ … }
static void enic_preload_tcp_csum(struct sk_buff *skb)
{ … }
static int enic_queue_wq_skb_tso(struct enic *enic, struct vnic_wq *wq,
struct sk_buff *skb, unsigned int mss,
int vlan_tag_insert, unsigned int vlan_tag,
int loopback)
{ … }
static inline int enic_queue_wq_skb_encap(struct enic *enic, struct vnic_wq *wq,
struct sk_buff *skb,
int vlan_tag_insert,
unsigned int vlan_tag, int loopback)
{ … }
static inline int enic_queue_wq_skb(struct enic *enic,
struct vnic_wq *wq, struct sk_buff *skb)
{ … }
static netdev_tx_t enic_hard_start_xmit(struct sk_buff *skb,
struct net_device *netdev)
{ … }
static void enic_get_stats(struct net_device *netdev,
struct rtnl_link_stats64 *net_stats)
{ … }
static int enic_mc_sync(struct net_device *netdev, const u8 *mc_addr)
{ … }
static int enic_mc_unsync(struct net_device *netdev, const u8 *mc_addr)
{ … }
static int enic_uc_sync(struct net_device *netdev, const u8 *uc_addr)
{ … }
static int enic_uc_unsync(struct net_device *netdev, const u8 *uc_addr)
{ … }
void enic_reset_addr_lists(struct enic *enic)
{ … }
static int enic_set_mac_addr(struct net_device *netdev, char *addr)
{ … }
static int enic_set_mac_address_dynamic(struct net_device *netdev, void *p)
{ … }
static int enic_set_mac_address(struct net_device *netdev, void *p)
{ … }
static void enic_set_rx_mode(struct net_device *netdev)
{ … }
static void enic_tx_timeout(struct net_device *netdev, unsigned int txqueue)
{ … }
static int enic_set_vf_mac(struct net_device *netdev, int vf, u8 *mac)
{ … }
static int enic_set_vf_port(struct net_device *netdev, int vf,
struct nlattr *port[])
{ … }
static int enic_get_vf_port(struct net_device *netdev, int vf,
struct sk_buff *skb)
{ … }
static void enic_free_rq_buf(struct vnic_rq *rq, struct vnic_rq_buf *buf)
{ … }
static int enic_rq_alloc_buf(struct vnic_rq *rq)
{ … }
static void enic_intr_update_pkt_size(struct vnic_rx_bytes_counter *pkt_size,
u32 pkt_len)
{ … }
static bool enic_rxcopybreak(struct net_device *netdev, struct sk_buff **skb,
struct vnic_rq_buf *buf, u16 len)
{ … }
static void enic_rq_indicate_buf(struct vnic_rq *rq,
struct cq_desc *cq_desc, struct vnic_rq_buf *buf,
int skipped, void *opaque)
{ … }
static int enic_rq_service(struct vnic_dev *vdev, struct cq_desc *cq_desc,
u8 type, u16 q_number, u16 completed_index, void *opaque)
{ … }
static void enic_set_int_moderation(struct enic *enic, struct vnic_rq *rq)
{ … }
static void enic_calc_int_moderation(struct enic *enic, struct vnic_rq *rq)
{ … }
static int enic_poll(struct napi_struct *napi, int budget)
{ … }
#ifdef CONFIG_RFS_ACCEL
static void enic_free_rx_cpu_rmap(struct enic *enic)
{ … }
static void enic_set_rx_cpu_rmap(struct enic *enic)
{ … }
#else
static void enic_free_rx_cpu_rmap(struct enic *enic)
{
}
static void enic_set_rx_cpu_rmap(struct enic *enic)
{
}
#endif
static int enic_poll_msix_wq(struct napi_struct *napi, int budget)
{ … }
static int enic_poll_msix_rq(struct napi_struct *napi, int budget)
{ … }
static void enic_notify_timer(struct timer_list *t)
{ … }
static void enic_free_intr(struct enic *enic)
{ … }
static int enic_request_intr(struct enic *enic)
{ … }
static void enic_synchronize_irqs(struct enic *enic)
{ … }
static void enic_set_rx_coal_setting(struct enic *enic)
{ … }
static int enic_dev_notify_set(struct enic *enic)
{ … }
static void enic_notify_timer_start(struct enic *enic)
{ … }
static int enic_open(struct net_device *netdev)
{ … }
static int enic_stop(struct net_device *netdev)
{ … }
static int _enic_change_mtu(struct net_device *netdev, int new_mtu)
{ … }
static int enic_change_mtu(struct net_device *netdev, int new_mtu)
{ … }
static void enic_change_mtu_work(struct work_struct *work)
{ … }
#ifdef CONFIG_NET_POLL_CONTROLLER
static void enic_poll_controller(struct net_device *netdev)
{ … }
#endif
static int enic_dev_wait(struct vnic_dev *vdev,
int (*start)(struct vnic_dev *, int),
int (*finished)(struct vnic_dev *, int *),
int arg)
{ … }
static int enic_dev_open(struct enic *enic)
{ … }
static int enic_dev_soft_reset(struct enic *enic)
{ … }
static int enic_dev_hang_reset(struct enic *enic)
{ … }
int __enic_set_rsskey(struct enic *enic)
{ … }
static int enic_set_rsskey(struct enic *enic)
{ … }
static int enic_set_rsscpu(struct enic *enic, u8 rss_hash_bits)
{ … }
static int enic_set_niccfg(struct enic *enic, u8 rss_default_cpu,
u8 rss_hash_type, u8 rss_hash_bits, u8 rss_base_cpu, u8 rss_enable)
{ … }
static int enic_set_rss_nic_cfg(struct enic *enic)
{ … }
static void enic_set_api_busy(struct enic *enic, bool busy)
{ … }
static void enic_reset(struct work_struct *work)
{ … }
static void enic_tx_hang_reset(struct work_struct *work)
{ … }
static int enic_set_intr_mode(struct enic *enic)
{ … }
static void enic_clear_intr_mode(struct enic *enic)
{ … }
static const struct net_device_ops enic_netdev_dynamic_ops = …;
static const struct net_device_ops enic_netdev_ops = …;
static void enic_dev_deinit(struct enic *enic)
{ … }
static void enic_kdump_kernel_config(struct enic *enic)
{ … }
static int enic_dev_init(struct enic *enic)
{ … }
static void enic_iounmap(struct enic *enic)
{ … }
static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{ … }
static void enic_remove(struct pci_dev *pdev)
{ … }
static struct pci_driver enic_driver = …;
module_pci_driver(…) …;