linux/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c

// SPDX-License-Identifier: GPL-2.0+
// Copyright (c) 2016-2017 Hisilicon Limited.

#include <linux/dma-mapping.h>
#include <linux/etherdevice.h>
#include <linux/interrupt.h>
#ifdef CONFIG_RFS_ACCEL
#include <linux/cpu_rmap.h>
#endif
#include <linux/if_vlan.h>
#include <linux/irq.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/skbuff.h>
#include <linux/sctp.h>
#include <net/gre.h>
#include <net/gro.h>
#include <net/ip6_checksum.h>
#include <net/page_pool/helpers.h>
#include <net/pkt_cls.h>
#include <net/pkt_sched.h>
#include <net/tcp.h>
#include <net/vxlan.h>
#include <net/geneve.h>

#include "hnae3.h"
#include "hns3_enet.h"
/* All hns3 tracepoints are defined by the include below, which
 * must be included exactly once across the whole kernel with
 * CREATE_TRACE_POINTS defined
 */
#define CREATE_TRACE_POINTS
#include "hns3_trace.h"

#define hns3_set_field(origin, shift, val)
#define hns3_tx_bd_count(S)

#define hns3_rl_err(fmt, ...)

static void hns3_clear_all_ring(struct hnae3_handle *h, bool force);

static const char hns3_driver_name[] =;
static const char hns3_driver_string[] =;
static const char hns3_copyright[] =;
static struct hnae3_client client;

static int debug =;
module_param(debug, int, 0);
MODULE_PARM_DESC();

static unsigned int tx_sgl =;
module_param(tx_sgl, uint, 0600);
MODULE_PARM_DESC();

static bool page_pool_enabled =;
module_param(page_pool_enabled, bool, 0400);

#define HNS3_SGL_SIZE(nfrag)
#define HNS3_MAX_SGL_SIZE

#define DEFAULT_MSG_LEVEL

#define HNS3_INNER_VLAN_TAG
#define HNS3_OUTER_VLAN_TAG

#define HNS3_MIN_TX_LEN
#define HNS3_MIN_TUN_PKT_LEN

/* hns3_pci_tbl - PCI Device ID Table
 *
 * Last entry must be all 0s
 *
 * { Vendor ID, Device ID, SubVendor ID, SubDevice ID,
 *   Class, Class Mask, private data (not used) }
 */
static const struct pci_device_id hns3_pci_tbl[] =;
MODULE_DEVICE_TABLE(pci, hns3_pci_tbl);

#define HNS3_RX_PTYPE_ENTRY(ptype, l, s, t, h)

#define HNS3_RX_PTYPE_UNUSED_ENTRY(ptype)

static const struct hns3_rx_ptype hns3_rx_ptype_tbl[] =;

#define HNS3_INVALID_PTYPE

static irqreturn_t hns3_irq_handle(int irq, void *vector)
{}

static void hns3_nic_uninit_irq(struct hns3_nic_priv *priv)
{}

static int hns3_nic_init_irq(struct hns3_nic_priv *priv)
{}

static void hns3_mask_vector_irq(struct hns3_enet_tqp_vector *tqp_vector,
				 u32 mask_en)
{}

static void hns3_vector_enable(struct hns3_enet_tqp_vector *tqp_vector)
{}

static void hns3_vector_disable(struct hns3_enet_tqp_vector *tqp_vector)
{}

void hns3_set_vector_coalesce_rl(struct hns3_enet_tqp_vector *tqp_vector,
				 u32 rl_value)
{}

void hns3_set_vector_coalesce_rx_gl(struct hns3_enet_tqp_vector *tqp_vector,
				    u32 gl_value)
{}

void hns3_set_vector_coalesce_tx_gl(struct hns3_enet_tqp_vector *tqp_vector,
				    u32 gl_value)
{}

void hns3_set_vector_coalesce_tx_ql(struct hns3_enet_tqp_vector *tqp_vector,
				    u32 ql_value)
{}

void hns3_set_vector_coalesce_rx_ql(struct hns3_enet_tqp_vector *tqp_vector,
				    u32 ql_value)
{}

static void hns3_vector_coalesce_init(struct hns3_enet_tqp_vector *tqp_vector,
				      struct hns3_nic_priv *priv)
{}

static void
hns3_vector_coalesce_init_hw(struct hns3_enet_tqp_vector *tqp_vector,
			     struct hns3_nic_priv *priv)
{}

static int hns3_nic_set_real_num_queue(struct net_device *netdev)
{}

u16 hns3_get_max_available_channels(struct hnae3_handle *h)
{}

static void hns3_tqp_enable(struct hnae3_queue *tqp)
{}

static void hns3_tqp_disable(struct hnae3_queue *tqp)
{}

static void hns3_free_rx_cpu_rmap(struct net_device *netdev)
{}

static int hns3_set_rx_cpu_rmap(struct net_device *netdev)
{}

static int hns3_nic_net_up(struct net_device *netdev)
{}

static void hns3_config_xps(struct hns3_nic_priv *priv)
{}

static int hns3_nic_net_open(struct net_device *netdev)
{}

static void hns3_reset_tx_queue(struct hnae3_handle *h)
{}

static void hns3_nic_net_down(struct net_device *netdev)
{}

static int hns3_nic_net_stop(struct net_device *netdev)
{}

static int hns3_nic_uc_sync(struct net_device *netdev,
			    const unsigned char *addr)
{}

static int hns3_nic_uc_unsync(struct net_device *netdev,
			      const unsigned char *addr)
{}

static int hns3_nic_mc_sync(struct net_device *netdev,
			    const unsigned char *addr)
{}

static int hns3_nic_mc_unsync(struct net_device *netdev,
			      const unsigned char *addr)
{}

static u8 hns3_get_netdev_flags(struct net_device *netdev)
{}

static void hns3_nic_set_rx_mode(struct net_device *netdev)
{}

void hns3_request_update_promisc_mode(struct hnae3_handle *handle)
{}

static u32 hns3_tx_spare_space(struct hns3_enet_ring *ring)
{}

static void hns3_tx_spare_update(struct hns3_enet_ring *ring)
{}

static bool hns3_can_use_tx_bounce(struct hns3_enet_ring *ring,
				   struct sk_buff *skb,
				   u32 space)
{}

static bool hns3_can_use_tx_sgl(struct hns3_enet_ring *ring,
				struct sk_buff *skb,
				u32 space)
{}

static void hns3_init_tx_spare_buffer(struct hns3_enet_ring *ring)
{}

/* Use hns3_tx_spare_space() to make sure there is enough buffer
 * before calling below function to allocate tx buffer.
 */
static void *hns3_tx_spare_alloc(struct hns3_enet_ring *ring,
				 unsigned int size, dma_addr_t *dma,
				 u32 *cb_len)
{}

static void hns3_tx_spare_rollback(struct hns3_enet_ring *ring, u32 len)
{}

static void hns3_tx_spare_reclaim_cb(struct hns3_enet_ring *ring,
				     struct hns3_desc_cb *cb)
{}

static int hns3_set_tso(struct sk_buff *skb, u32 *paylen_fdop_ol4cs,
			u16 *mss, u32 *type_cs_vlan_tso, u32 *send_bytes)
{}

static int hns3_get_l4_protocol(struct sk_buff *skb, u8 *ol4_proto,
				u8 *il4_proto)
{}

/* when skb->encapsulation is 0, skb->ip_summed is CHECKSUM_PARTIAL
 * and it is udp packet, which has a dest port as the IANA assigned.
 * the hardware is expected to do the checksum offload, but the
 * hardware will not do the checksum offload when udp dest port is
 * 4789, 4790 or 6081.
 */
static bool hns3_tunnel_csum_bug(struct sk_buff *skb)
{}

static void hns3_set_outer_l2l3l4(struct sk_buff *skb, u8 ol4_proto,
				  u32 *ol_type_vlan_len_msec)
{}

static void hns3_set_l3_type(struct sk_buff *skb, union l3_hdr_info l3,
			     u32 *type_cs_vlan_tso)
{}

static int hns3_set_l4_csum_length(struct sk_buff *skb, union l4_hdr_info l4,
				   u32 l4_proto, u32 *type_cs_vlan_tso)
{}

static int hns3_set_l2l3l4(struct sk_buff *skb, u8 ol4_proto,
			   u8 il4_proto, u32 *type_cs_vlan_tso,
			   u32 *ol_type_vlan_len_msec)
{}

static int hns3_handle_vtags(struct hns3_enet_ring *tx_ring,
			     struct sk_buff *skb)
{}

/* check if the hardware is capable of checksum offloading */
static bool hns3_check_hw_tx_csum(struct sk_buff *skb)
{}

struct hns3_desc_param {};

static void hns3_init_desc_data(struct sk_buff *skb, struct hns3_desc_param *pa)
{}

static int hns3_handle_vlan_info(struct hns3_enet_ring *ring,
				 struct sk_buff *skb,
				 struct hns3_desc_param *param)
{}

static int hns3_handle_csum_partial(struct hns3_enet_ring *ring,
				    struct sk_buff *skb,
				    struct hns3_desc_cb *desc_cb,
				    struct hns3_desc_param *param)
{}

static int hns3_fill_skb_desc(struct hns3_enet_ring *ring,
			      struct sk_buff *skb, struct hns3_desc *desc,
			      struct hns3_desc_cb *desc_cb)
{}

static int hns3_fill_desc(struct hns3_enet_ring *ring, dma_addr_t dma,
			  unsigned int size)
{}

static int hns3_map_and_fill_desc(struct hns3_enet_ring *ring, void *priv,
				  unsigned int type)
{}

static unsigned int hns3_skb_bd_num(struct sk_buff *skb, unsigned int *bd_size,
				    unsigned int bd_num)
{}

static unsigned int hns3_tx_bd_num(struct sk_buff *skb, unsigned int *bd_size,
				   u8 max_non_tso_bd_num, unsigned int bd_num,
				   unsigned int recursion_level)
{}

static unsigned int hns3_gso_hdr_len(struct sk_buff *skb)
{}

/* HW need every continuous max_non_tso_bd_num buffer data to be larger
 * than MSS, we simplify it by ensuring skb_headlen + the first continuous
 * max_non_tso_bd_num - 1 frags to be larger than gso header len + mss,
 * and the remaining continuous max_non_tso_bd_num - 1 frags to be larger
 * than MSS except the last max_non_tso_bd_num - 1 frags.
 */
static bool hns3_skb_need_linearized(struct sk_buff *skb, unsigned int *bd_size,
				     unsigned int bd_num, u8 max_non_tso_bd_num)
{}

void hns3_shinfo_pack(struct skb_shared_info *shinfo, __u32 *size)
{}

static int hns3_skb_linearize(struct hns3_enet_ring *ring,
			      struct sk_buff *skb,
			      unsigned int bd_num)
{}

static int hns3_nic_maybe_stop_tx(struct hns3_enet_ring *ring,
				  struct net_device *netdev,
				  struct sk_buff *skb)
{}

static void hns3_clear_desc(struct hns3_enet_ring *ring, int next_to_use_orig)
{}

static int hns3_fill_skb_to_desc(struct hns3_enet_ring *ring,
				 struct sk_buff *skb, unsigned int type)
{}

static void hns3_tx_push_bd(struct hns3_enet_ring *ring, int num)
{}

static void hns3_tx_mem_doorbell(struct hns3_enet_ring *ring)
{}

static void hns3_tx_doorbell(struct hns3_enet_ring *ring, int num,
			     bool doorbell)
{}

static void hns3_tsyn(struct net_device *netdev, struct sk_buff *skb,
		      struct hns3_desc *desc)
{}

static int hns3_handle_tx_bounce(struct hns3_enet_ring *ring,
				 struct sk_buff *skb)
{}

static int hns3_handle_tx_sgl(struct hns3_enet_ring *ring,
			      struct sk_buff *skb)
{}

static int hns3_handle_desc_filling(struct hns3_enet_ring *ring,
				    struct sk_buff *skb)
{}

static int hns3_handle_skb_desc(struct hns3_enet_ring *ring,
				struct sk_buff *skb,
				struct hns3_desc_cb *desc_cb,
				int next_to_use_head)
{}

netdev_tx_t hns3_nic_net_xmit(struct sk_buff *skb, struct net_device *netdev)
{}

static int hns3_nic_net_set_mac_address(struct net_device *netdev, void *p)
{}

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

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

static netdev_features_t hns3_features_check(struct sk_buff *skb,
					     struct net_device *dev,
					     netdev_features_t features)
{}

static void hns3_fetch_stats(struct rtnl_link_stats64 *stats,
			     struct hns3_enet_ring *ring, bool is_tx)
{}

static void hns3_nic_get_stats64(struct net_device *netdev,
				 struct rtnl_link_stats64 *stats)
{}

static int hns3_setup_tc(struct net_device *netdev, void *type_data)
{}

static int hns3_setup_tc_cls_flower(struct hns3_nic_priv *priv,
				    struct flow_cls_offload *flow)
{}

static int hns3_setup_tc_block_cb(enum tc_setup_type type, void *type_data,
				  void *cb_priv)
{}

static LIST_HEAD(hns3_block_cb_list);

static int hns3_nic_setup_tc(struct net_device *dev, enum tc_setup_type type,
			     void *type_data)
{}

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

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

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

static int hns3_set_vf_spoofchk(struct net_device *netdev, int vf, bool enable)
{}

static int hns3_set_vf_trust(struct net_device *netdev, int vf, bool enable)
{}

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

static int hns3_get_timeout_queue(struct net_device *ndev)
{}

static void hns3_dump_queue_stats(struct net_device *ndev,
				  struct hns3_enet_ring *tx_ring,
				  int timeout_queue)
{}

static void hns3_dump_queue_reg(struct net_device *ndev,
				struct hns3_enet_ring *tx_ring)
{}

static bool hns3_get_tx_timeo_queue_info(struct net_device *ndev)
{}

static void hns3_nic_net_timeout(struct net_device *ndev, unsigned int txqueue)
{}

#ifdef CONFIG_RFS_ACCEL
static int hns3_rx_flow_steer(struct net_device *dev, const struct sk_buff *skb,
			      u16 rxq_index, u32 flow_id)
{}
#endif

static int hns3_nic_get_vf_config(struct net_device *ndev, int vf,
				  struct ifla_vf_info *ivf)
{}

static int hns3_nic_set_vf_link_state(struct net_device *ndev, int vf,
				      int link_state)
{}

static int hns3_nic_set_vf_rate(struct net_device *ndev, int vf,
				int min_tx_rate, int max_tx_rate)
{}

static int hns3_nic_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
{}

#define HNS3_INVALID_DSCP
#define HNS3_DSCP_SHIFT

static u8 hns3_get_skb_dscp(struct sk_buff *skb)
{}

static u16 hns3_nic_select_queue(struct net_device *netdev,
				 struct sk_buff *skb,
				 struct net_device *sb_dev)
{}

static const struct net_device_ops hns3_nic_netdev_ops =;

bool hns3_is_phys_func(struct pci_dev *pdev)
{}

static void hns3_disable_sriov(struct pci_dev *pdev)
{}

/* hns3_probe - Device initialization routine
 * @pdev: PCI device information struct
 * @ent: entry in hns3_pci_tbl
 *
 * hns3_probe initializes a PF identified by a pci_dev structure.
 * The OS initialization, configuring of the PF private structure,
 * and a hardware reset occur.
 *
 * Returns 0 on success, negative on failure
 */
static int hns3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{}

/**
 * hns3_clean_vf_config
 * @pdev: pointer to a pci_dev structure
 * @num_vfs: number of VFs allocated
 *
 * Clean residual vf config after disable sriov
 **/
static void hns3_clean_vf_config(struct pci_dev *pdev, int num_vfs)
{}

/* hns3_remove - Device removal routine
 * @pdev: PCI device information struct
 */
static void hns3_remove(struct pci_dev *pdev)
{}

/**
 * hns3_pci_sriov_configure
 * @pdev: pointer to a pci_dev structure
 * @num_vfs: number of VFs to allocate
 *
 * Enable or change the number of VFs. Called when the user updates the number
 * of VFs in sysfs.
 **/
static int hns3_pci_sriov_configure(struct pci_dev *pdev, int num_vfs)
{}

static void hns3_shutdown(struct pci_dev *pdev)
{}

static int __maybe_unused hns3_suspend(struct device *dev)
{}

static int __maybe_unused hns3_resume(struct device *dev)
{}

static pci_ers_result_t hns3_error_detected(struct pci_dev *pdev,
					    pci_channel_state_t state)
{}

static pci_ers_result_t hns3_slot_reset(struct pci_dev *pdev)
{}

static void hns3_reset_prepare(struct pci_dev *pdev)
{}

static void hns3_reset_done(struct pci_dev *pdev)
{}

static const struct pci_error_handlers hns3_err_handler =;

static SIMPLE_DEV_PM_OPS(hns3_pm_ops, hns3_suspend, hns3_resume);

static struct pci_driver hns3_driver =;

/* set default feature to hns3 */
static void hns3_set_default_feature(struct net_device *netdev)
{}

static int hns3_alloc_buffer(struct hns3_enet_ring *ring,
			     struct hns3_desc_cb *cb)
{}

static void hns3_free_buffer(struct hns3_enet_ring *ring,
			     struct hns3_desc_cb *cb, int budget)
{}

static int hns3_map_buffer(struct hns3_enet_ring *ring, struct hns3_desc_cb *cb)
{}

static void hns3_unmap_buffer(struct hns3_enet_ring *ring,
			      struct hns3_desc_cb *cb)
{}

static void hns3_buffer_detach(struct hns3_enet_ring *ring, int i)
{}

static void hns3_free_buffer_detach(struct hns3_enet_ring *ring, int i,
				    int budget)
{}

static void hns3_free_buffers(struct hns3_enet_ring *ring)
{}

/* free desc along with its attached buffer */
static void hns3_free_desc(struct hns3_enet_ring *ring)
{}

static int hns3_alloc_desc(struct hns3_enet_ring *ring)
{}

static int hns3_alloc_and_map_buffer(struct hns3_enet_ring *ring,
				   struct hns3_desc_cb *cb)
{}

static int hns3_alloc_and_attach_buffer(struct hns3_enet_ring *ring, int i)
{}

/* Allocate memory for raw pkg, and map with dma */
static int hns3_alloc_ring_buffers(struct hns3_enet_ring *ring)
{}

/* detach a in-used buffer and replace with a reserved one */
static void hns3_replace_buffer(struct hns3_enet_ring *ring, int i,
				struct hns3_desc_cb *res_cb)
{}

static void hns3_reuse_buffer(struct hns3_enet_ring *ring, int i)
{}

static bool hns3_nic_reclaim_desc(struct hns3_enet_ring *ring,
				  int *bytes, int *pkts, int budget)
{}

void hns3_clean_tx_ring(struct hns3_enet_ring *ring, int budget)
{}

static int hns3_desc_unused(struct hns3_enet_ring *ring)
{}

/* Return true if there is any allocation failure */
static bool hns3_nic_alloc_rx_buffers(struct hns3_enet_ring *ring,
				      int cleand_count)
{}

static bool hns3_can_reuse_page(struct hns3_desc_cb *cb)
{}

static int hns3_handle_rx_copybreak(struct sk_buff *skb, int i,
				    struct hns3_enet_ring *ring,
				    int pull_len,
				    struct hns3_desc_cb *desc_cb)
{}

static void hns3_nic_reuse_page(struct sk_buff *skb, int i,
				struct hns3_enet_ring *ring, int pull_len,
				struct hns3_desc_cb *desc_cb)
{}

static int hns3_gro_complete(struct sk_buff *skb, u32 l234info)
{}

static void hns3_checksum_complete(struct hns3_enet_ring *ring,
				   struct sk_buff *skb, u32 ptype, u16 csum)
{}

static void hns3_rx_handle_csum(struct sk_buff *skb, u32 l234info,
				u32 ol_info, u32 ptype)
{}

static void hns3_rx_checksum(struct hns3_enet_ring *ring, struct sk_buff *skb,
			     u32 l234info, u32 bd_base_info, u32 ol_info,
			     u16 csum)
{}

static void hns3_rx_skb(struct hns3_enet_ring *ring, struct sk_buff *skb)
{}

static bool hns3_parse_vlan_tag(struct hns3_enet_ring *ring,
				struct hns3_desc *desc, u32 l234info,
				u16 *vlan_tag)
{}

static void hns3_rx_ring_move_fw(struct hns3_enet_ring *ring)
{}

static int hns3_alloc_skb(struct hns3_enet_ring *ring, unsigned int length,
			  unsigned char *va)
{}

static int hns3_add_frag(struct hns3_enet_ring *ring)
{}

static int hns3_set_gro_and_checksum(struct hns3_enet_ring *ring,
				     struct sk_buff *skb, u32 l234info,
				     u32 bd_base_info, u32 ol_info, u16 csum)
{}

static void hns3_set_rx_skb_rss_type(struct hns3_enet_ring *ring,
				     struct sk_buff *skb, u32 rss_hash,
				     u32 l234info, u32 ol_info)
{}

static void hns3_handle_rx_ts_info(struct net_device *netdev,
				   struct hns3_desc *desc, struct sk_buff *skb,
				   u32 bd_base_info)
{}

static void hns3_handle_rx_vlan_tag(struct hns3_enet_ring *ring,
				    struct hns3_desc *desc, struct sk_buff *skb,
				    u32 l234info)
{}

static int hns3_handle_bdinfo(struct hns3_enet_ring *ring, struct sk_buff *skb)
{}

static int hns3_handle_rx_bd(struct hns3_enet_ring *ring)
{}

int hns3_clean_rx_ring(struct hns3_enet_ring *ring, int budget,
		       void (*rx_fn)(struct hns3_enet_ring *, struct sk_buff *))
{}

static void hns3_update_rx_int_coalesce(struct hns3_enet_tqp_vector *tqp_vector)
{}

static void hns3_update_tx_int_coalesce(struct hns3_enet_tqp_vector *tqp_vector)
{}

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

static int hns3_create_ring_chain(struct hns3_enet_tqp_vector *tqp_vector,
				  struct hnae3_ring_chain_node **head,
				  bool is_tx)
{}

static struct hnae3_ring_chain_node *
hns3_get_vector_ring_chain(struct hns3_enet_tqp_vector *tqp_vector)
{}

static void hns3_free_vector_ring_chain(struct hns3_enet_tqp_vector *tqp_vector,
					struct hnae3_ring_chain_node *head)
{}

static void hns3_add_ring_to_group(struct hns3_enet_ring_group *group,
				   struct hns3_enet_ring *ring)
{}

static void hns3_nic_set_cpumask(struct hns3_nic_priv *priv)
{}

static void hns3_rx_dim_work(struct work_struct *work)
{}

static void hns3_tx_dim_work(struct work_struct *work)
{}

static void hns3_nic_init_dim(struct hns3_enet_tqp_vector *tqp_vector)
{}

static int hns3_nic_init_vector_data(struct hns3_nic_priv *priv)
{}

static void hns3_nic_init_coal_cfg(struct hns3_nic_priv *priv)
{}

static int hns3_nic_alloc_vector_data(struct hns3_nic_priv *priv)
{}

static void hns3_clear_ring_group(struct hns3_enet_ring_group *group)
{}

static void hns3_nic_uninit_vector_data(struct hns3_nic_priv *priv)
{}

static void hns3_nic_dealloc_vector_data(struct hns3_nic_priv *priv)
{}

static void hns3_ring_get_cfg(struct hnae3_queue *q, struct hns3_nic_priv *priv,
			      unsigned int ring_type)
{}

static void hns3_queue_to_ring(struct hnae3_queue *tqp,
			       struct hns3_nic_priv *priv)
{}

static int hns3_get_ring_config(struct hns3_nic_priv *priv)
{}

static void hns3_put_ring_config(struct hns3_nic_priv *priv)
{}

static void hns3_alloc_page_pool(struct hns3_enet_ring *ring)
{}

static int hns3_alloc_ring_memory(struct hns3_enet_ring *ring)
{}

void hns3_fini_ring(struct hns3_enet_ring *ring)
{}

static int hns3_buf_size2type(u32 buf_size)
{}

static void hns3_init_ring_hw(struct hns3_enet_ring *ring)
{}

static void hns3_init_tx_ring_tc(struct hns3_nic_priv *priv)
{}

int hns3_init_all_ring(struct hns3_nic_priv *priv)
{}

static void hns3_uninit_all_ring(struct hns3_nic_priv *priv)
{}

/* Set mac addr if it is configured. or leave it to the AE driver */
static int hns3_init_mac_addr(struct net_device *netdev)
{}

static int hns3_init_phy(struct net_device *netdev)
{}

static void hns3_uninit_phy(struct net_device *netdev)
{}

static int hns3_client_start(struct hnae3_handle *handle)
{}

static void hns3_client_stop(struct hnae3_handle *handle)
{}

static void hns3_info_show(struct hns3_nic_priv *priv)
{}

static void hns3_set_cq_period_mode(struct hns3_nic_priv *priv,
				    enum dim_cq_period_mode mode, bool is_tx)
{}

void hns3_cq_period_mode_init(struct hns3_nic_priv *priv,
			      enum dim_cq_period_mode tx_mode,
			      enum dim_cq_period_mode rx_mode)
{}

static void hns3_state_init(struct hnae3_handle *handle)
{}

static void hns3_state_uninit(struct hnae3_handle *handle)
{}

static int hns3_client_init(struct hnae3_handle *handle)
{}

static void hns3_client_uninit(struct hnae3_handle *handle, bool reset)
{}

static void hns3_link_status_change(struct hnae3_handle *handle, bool linkup)
{}

static void hns3_clear_tx_ring(struct hns3_enet_ring *ring)
{}

static int hns3_clear_rx_ring(struct hns3_enet_ring *ring)
{}

static void hns3_force_clear_rx_ring(struct hns3_enet_ring *ring)
{}

static void hns3_clear_all_ring(struct hnae3_handle *h, bool force)
{}

int hns3_nic_reset_all_ring(struct hnae3_handle *h)
{}

static int hns3_reset_notify_down_enet(struct hnae3_handle *handle)
{}

static int hns3_reset_notify_up_enet(struct hnae3_handle *handle)
{}

static int hns3_reset_notify_init_enet(struct hnae3_handle *handle)
{}

static int hns3_reset_notify_uninit_enet(struct hnae3_handle *handle)
{}

int hns3_reset_notify(struct hnae3_handle *handle,
		      enum hnae3_reset_notify_type type)
{}

static int hns3_change_channels(struct hnae3_handle *handle, u32 new_tqp_num,
				bool rxfh_configured)
{}

int hns3_set_channels(struct net_device *netdev,
		      struct ethtool_channels *ch)
{}

void hns3_external_lb_prepare(struct net_device *ndev, bool if_running)
{}

void hns3_external_lb_restore(struct net_device *ndev, bool if_running)
{}

static const struct hns3_hw_error_info hns3_hw_err[] =;

static void hns3_process_hw_error(struct hnae3_handle *handle,
				  enum hnae3_hw_error_type type)
{}

static const struct hnae3_client_ops client_ops =;

/* hns3_init_module - Driver registration routine
 * hns3_init_module is the first routine called when the driver is
 * loaded. All it does is register with the PCI subsystem.
 */
static int __init hns3_init_module(void)
{}
module_init();

/* hns3_exit_module - Driver exit cleanup routine
 * hns3_exit_module is called just before the driver is removed
 * from memory.
 */
static void __exit hns3_exit_module(void)
{}
module_exit(hns3_exit_module);

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();
MODULE_ALIAS();