linux/drivers/net/ethernet/pensando/ionic/ionic_lif.c

// SPDX-License-Identifier: GPL-2.0
/* Copyright(c) 2017 - 2019 Pensando Systems, Inc */

#include <linux/ethtool.h>
#include <linux/printk.h>
#include <linux/dynamic_debug.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/if_vlan.h>
#include <linux/rtnetlink.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/cpumask.h>
#include <linux/crash_dump.h>
#include <linux/vmalloc.h>

#include "ionic.h"
#include "ionic_bus.h"
#include "ionic_dev.h"
#include "ionic_lif.h"
#include "ionic_txrx.h"
#include "ionic_ethtool.h"
#include "ionic_debugfs.h"

/* queuetype support level */
static const u8 ionic_qtype_versions[IONIC_QTYPE_MAX] =;

static void ionic_link_status_check(struct ionic_lif *lif);
static void ionic_lif_handle_fw_down(struct ionic_lif *lif);
static void ionic_lif_handle_fw_up(struct ionic_lif *lif);
static void ionic_lif_set_netdev_info(struct ionic_lif *lif);

static void ionic_txrx_deinit(struct ionic_lif *lif);
static int ionic_txrx_init(struct ionic_lif *lif);
static int ionic_start_queues(struct ionic_lif *lif);
static void ionic_stop_queues(struct ionic_lif *lif);
static void ionic_lif_queue_identify(struct ionic_lif *lif);

static int ionic_xdp_queues_config(struct ionic_lif *lif);
static void ionic_xdp_unregister_rxq_info(struct ionic_queue *q);

static void ionic_dim_work(struct work_struct *work)
{}

static void ionic_lif_deferred_work(struct work_struct *work)
{}

void ionic_lif_deferred_enqueue(struct ionic_lif *lif,
				struct ionic_deferred_work *work)
{}

static void ionic_link_status_check(struct ionic_lif *lif)
{}

void ionic_link_status_check_request(struct ionic_lif *lif, bool can_sleep)
{}

static irqreturn_t ionic_isr(int irq, void *data)
{}

static int ionic_request_irq(struct ionic_lif *lif, struct ionic_qcq *qcq)
{}

static int ionic_intr_alloc(struct ionic_lif *lif, struct ionic_intr_info *intr)
{}

static void ionic_intr_free(struct ionic *ionic, int index)
{}

static void ionic_irq_aff_notify(struct irq_affinity_notify *notify,
				 const cpumask_t *mask)
{}

static void ionic_irq_aff_release(struct kref __always_unused *ref)
{}

static int ionic_qcq_enable(struct ionic_qcq *qcq)
{}

static int ionic_qcq_disable(struct ionic_lif *lif, struct ionic_qcq *qcq, int fw_err)
{}

static void ionic_lif_qcq_deinit(struct ionic_lif *lif, struct ionic_qcq *qcq)
{}

static void ionic_qcq_intr_free(struct ionic_lif *lif, struct ionic_qcq *qcq)
{}

static void ionic_qcq_free(struct ionic_lif *lif, struct ionic_qcq *qcq)
{}

void ionic_qcqs_free(struct ionic_lif *lif)
{}

static void ionic_link_qcq_interrupts(struct ionic_qcq *src_qcq,
				      struct ionic_qcq *n_qcq)
{}

static int ionic_alloc_qcq_interrupt(struct ionic_lif *lif, struct ionic_qcq *qcq)
{}

static int ionic_qcq_alloc(struct ionic_lif *lif, unsigned int type,
			   unsigned int index,
			   const char *name, unsigned int flags,
			   unsigned int num_descs, unsigned int desc_size,
			   unsigned int cq_desc_size,
			   unsigned int sg_desc_size,
			   unsigned int desc_info_size,
			   unsigned int pid, struct ionic_qcq **qcq)
{}

static int ionic_qcqs_alloc(struct ionic_lif *lif)
{}

static void ionic_qcq_sanitize(struct ionic_qcq *qcq)
{}

static int ionic_lif_txq_init(struct ionic_lif *lif, struct ionic_qcq *qcq)
{}

static int ionic_lif_rxq_init(struct ionic_lif *lif, struct ionic_qcq *qcq)
{}

int ionic_lif_create_hwstamp_txq(struct ionic_lif *lif)
{}

int ionic_lif_create_hwstamp_rxq(struct ionic_lif *lif)
{}

int ionic_lif_config_hwstamp_rxq_all(struct ionic_lif *lif, bool rx_all)
{}

int ionic_lif_set_hwstamp_txmode(struct ionic_lif *lif, u16 txstamp_mode)
{}

static void ionic_lif_del_hwstamp_rxfilt(struct ionic_lif *lif)
{}

static int ionic_lif_add_hwstamp_rxfilt(struct ionic_lif *lif, u64 pkt_class)
{}

int ionic_lif_set_hwstamp_rxfilt(struct ionic_lif *lif, u64 pkt_class)
{}

static int ionic_adminq_napi(struct napi_struct *napi, int budget)
{}

void ionic_get_stats64(struct net_device *netdev,
		       struct rtnl_link_stats64 *ns)
{}

static int ionic_addr_add(struct net_device *netdev, const u8 *addr)
{}

static int ionic_addr_del(struct net_device *netdev, const u8 *addr)
{}

void ionic_lif_rx_mode(struct ionic_lif *lif)
{}

static void ionic_ndo_set_rx_mode(struct net_device *netdev)
{}

static __le64 ionic_netdev_features_to_nic(netdev_features_t features)
{}

static int ionic_set_nic_features(struct ionic_lif *lif,
				  netdev_features_t features)
{}

static int ionic_init_nic_features(struct ionic_lif *lif)
{}

static int ionic_set_features(struct net_device *netdev,
			      netdev_features_t features)
{}

static int ionic_set_attr_mac(struct ionic_lif *lif, u8 *mac)
{}

static int ionic_get_attr_mac(struct ionic_lif *lif, u8 *mac_addr)
{}

static int ionic_program_mac(struct ionic_lif *lif, u8 *mac)
{}

static int ionic_set_mac_address(struct net_device *netdev, void *sa)
{}

void ionic_stop_queues_reconfig(struct ionic_lif *lif)
{}

static int ionic_start_queues_reconfig(struct ionic_lif *lif)
{}

static bool ionic_xdp_is_valid_mtu(struct ionic_lif *lif, u32 mtu,
				   struct bpf_prog *xdp_prog)
{}

static int ionic_change_mtu(struct net_device *netdev, int new_mtu)
{}

static void ionic_tx_timeout_work(struct work_struct *ws)
{}

static void ionic_tx_timeout(struct net_device *netdev, unsigned int txqueue)
{}

static int ionic_vlan_rx_add_vid(struct net_device *netdev, __be16 proto,
				 u16 vid)
{}

static int ionic_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto,
				  u16 vid)
{}

int ionic_lif_rss_config(struct ionic_lif *lif, const u16 types,
			 const u8 *key, const u32 *indir)
{}

static int ionic_lif_rss_init(struct ionic_lif *lif)
{}

static void ionic_lif_rss_deinit(struct ionic_lif *lif)
{}

static void ionic_lif_quiesce(struct ionic_lif *lif)
{}

static void ionic_txrx_disable(struct ionic_lif *lif)
{}

static void ionic_txrx_deinit(struct ionic_lif *lif)
{}

void ionic_txrx_free(struct ionic_lif *lif)
{}

static int ionic_txrx_alloc(struct ionic_lif *lif)
{}

static int ionic_txrx_init(struct ionic_lif *lif)
{}

static int ionic_txrx_enable(struct ionic_lif *lif)
{}

static int ionic_start_queues(struct ionic_lif *lif)
{}

static int ionic_open(struct net_device *netdev)
{}

static void ionic_stop_queues(struct ionic_lif *lif)
{}

static int ionic_stop(struct net_device *netdev)
{}

static int ionic_eth_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
{}

static int ionic_get_vf_config(struct net_device *netdev,
			       int vf, struct ifla_vf_info *ivf)
{}

static int ionic_get_vf_stats(struct net_device *netdev, int vf,
			      struct ifla_vf_stats *vf_stats)
{}

static int ionic_set_vf_mac(struct net_device *netdev, int vf, u8 *mac)
{}

static int ionic_set_vf_vlan(struct net_device *netdev, int vf, u16 vlan,
			     u8 qos, __be16 proto)
{}

static int ionic_set_vf_rate(struct net_device *netdev, int vf,
			     int tx_min, int tx_max)
{}

static int ionic_set_vf_spoofchk(struct net_device *netdev, int vf, bool set)
{}

static int ionic_set_vf_trust(struct net_device *netdev, int vf, bool set)
{}

static int ionic_set_vf_link_state(struct net_device *netdev, int vf, int set)
{}

static void ionic_vf_attr_replay(struct ionic_lif *lif)
{}

static void ionic_xdp_unregister_rxq_info(struct ionic_queue *q)
{}

static int ionic_xdp_register_rxq_info(struct ionic_queue *q, unsigned int napi_id)
{}

static int ionic_xdp_queues_config(struct ionic_lif *lif)
{}

static int ionic_xdp_config(struct net_device *netdev, struct netdev_bpf *bpf)
{}

static int ionic_xdp(struct net_device *netdev, struct netdev_bpf *bpf)
{}

static const struct net_device_ops ionic_netdev_ops =;

static int ionic_cmb_reconfig(struct ionic_lif *lif,
			      struct ionic_queue_params *qparam)
{}

static void ionic_swap_queues(struct ionic_qcq *a, struct ionic_qcq *b)
{}

int ionic_reconfigure_queues(struct ionic_lif *lif,
			     struct ionic_queue_params *qparam)
{}

static int ionic_affinity_masks_alloc(struct ionic *ionic)
{}

static void ionic_affinity_masks_free(struct ionic *ionic)
{}

int ionic_lif_alloc(struct ionic *ionic)
{}

static void ionic_lif_reset(struct ionic_lif *lif)
{}

static void ionic_lif_handle_fw_down(struct ionic_lif *lif)
{}

int ionic_restart_lif(struct ionic_lif *lif)
{}

static void ionic_lif_handle_fw_up(struct ionic_lif *lif)
{}

void ionic_lif_free(struct ionic_lif *lif)
{}

void ionic_lif_deinit(struct ionic_lif *lif)
{}

static int ionic_lif_adminq_init(struct ionic_lif *lif)
{}

static int ionic_lif_notifyq_init(struct ionic_lif *lif)
{}

static int ionic_station_set(struct ionic_lif *lif)
{}

int ionic_lif_init(struct ionic_lif *lif)
{}

static void ionic_lif_notify_work(struct work_struct *ws)
{}

static void ionic_lif_set_netdev_info(struct ionic_lif *lif)
{}

static struct ionic_lif *ionic_netdev_lif(struct net_device *netdev)
{}

static int ionic_lif_notify(struct notifier_block *nb,
			    unsigned long event, void *info)
{}

int ionic_lif_register(struct ionic_lif *lif)
{}

void ionic_lif_unregister(struct ionic_lif *lif)
{}

static void ionic_lif_queue_identify(struct ionic_lif *lif)
{}

int ionic_lif_identify(struct ionic *ionic, u8 lif_type,
		       union ionic_lif_identity *lid)
{}

int ionic_lif_size(struct ionic *ionic)
{}