linux/drivers/infiniband/hw/hfi1/vnic_main.c

// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/*
 * Copyright(c) 2017 - 2020 Intel Corporation.
 */

/*
 * This file contains HFI1 support for VNIC functionality
 */

#include <linux/io.h>
#include <linux/if_vlan.h>

#include "vnic.h"
#include "netdev.h"

#define HFI_TX_TIMEOUT_MS

#define HFI1_VNIC_RCV_Q_SIZE

#define HFI1_VNIC_UP

static DEFINE_SPINLOCK(vport_cntr_lock);

#define SUM_GRP_COUNTERS(stats, qstats, x_grp)

#define VNIC_MASK
#define VNIC_ID(val)

/* hfi1_vnic_update_stats - update statistics */
static void hfi1_vnic_update_stats(struct hfi1_vnic_vport_info *vinfo,
				   struct opa_vnic_stats *stats)
{}

/* update_len_counters - update pkt's len histogram counters */
static inline void update_len_counters(struct opa_vnic_grp_stats *grp,
				       int len)
{}

/* hfi1_vnic_update_tx_counters - update transmit counters */
static void hfi1_vnic_update_tx_counters(struct hfi1_vnic_vport_info *vinfo,
					 u8 q_idx, struct sk_buff *skb, int err)
{}

/* hfi1_vnic_update_rx_counters - update receive counters */
static void hfi1_vnic_update_rx_counters(struct hfi1_vnic_vport_info *vinfo,
					 u8 q_idx, struct sk_buff *skb, int err)
{}

/* This function is overloaded for opa_vnic specific implementation */
static void hfi1_vnic_get_stats64(struct net_device *netdev,
				  struct rtnl_link_stats64 *stats)
{}

static u64 create_bypass_pbc(u32 vl, u32 dw_len)
{}

/* hfi1_vnic_maybe_stop_tx - stop tx queue if required */
static void hfi1_vnic_maybe_stop_tx(struct hfi1_vnic_vport_info *vinfo,
				    u8 q_idx)
{}

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

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

/* hfi1_vnic_decap_skb - strip OPA header from the skb (ethernet) packet */
static inline int hfi1_vnic_decap_skb(struct hfi1_vnic_rx_queue *rxq,
				      struct sk_buff *skb)
{}

static struct hfi1_vnic_vport_info *get_vnic_port(struct hfi1_devdata *dd,
						  int vesw_id)
{}

static struct hfi1_vnic_vport_info *get_first_vnic_port(struct hfi1_devdata *dd)
{}

void hfi1_vnic_bypass_rcv(struct hfi1_packet *packet)
{}

static int hfi1_vnic_up(struct hfi1_vnic_vport_info *vinfo)
{}

static void hfi1_vnic_down(struct hfi1_vnic_vport_info *vinfo)
{}

static int hfi1_netdev_open(struct net_device *netdev)
{}

static int hfi1_netdev_close(struct net_device *netdev)
{}

static int hfi1_vnic_init(struct hfi1_vnic_vport_info *vinfo)
{}

static void hfi1_vnic_deinit(struct hfi1_vnic_vport_info *vinfo)
{}

static void hfi1_vnic_set_vesw_id(struct net_device *netdev, int id)
{}

/* netdev ops */
static const struct net_device_ops hfi1_netdev_ops =;

static void hfi1_vnic_free_rn(struct net_device *netdev)
{}

struct net_device *hfi1_vnic_alloc_rn(struct ib_device *device,
				      u32 port_num,
				      enum rdma_netdev_t type,
				      const char *name,
				      unsigned char name_assign_type,
				      void (*setup)(struct net_device *))
{}