2022-06-07 16:11:24 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2008-09-15 09:17:11 -07:00
|
|
|
/*
|
2010-06-24 10:52:26 +00:00
|
|
|
* Copyright 2008-2010 Cisco Systems, Inc. All rights reserved.
|
2008-09-15 09:17:11 -07:00
|
|
|
* Copyright 2007 Nuova Systems, Inc. All rights reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _ENIC_H_
|
|
|
|
#define _ENIC_H_
|
|
|
|
|
|
|
|
#include "vnic_enet.h"
|
|
|
|
#include "vnic_dev.h"
|
|
|
|
#include "vnic_wq.h"
|
|
|
|
#include "vnic_rq.h"
|
|
|
|
#include "vnic_cq.h"
|
|
|
|
#include "vnic_intr.h"
|
|
|
|
#include "vnic_stats.h"
|
2009-09-03 17:02:24 +00:00
|
|
|
#include "vnic_nic.h"
|
2010-10-20 10:16:59 +00:00
|
|
|
#include "vnic_rss.h"
|
2014-04-02 11:24:00 -04:00
|
|
|
#include <linux/irq.h>
|
2025-02-05 15:54:15 -08:00
|
|
|
#include <net/page_pool/helpers.h>
|
2008-09-15 09:17:11 -07:00
|
|
|
|
|
|
|
#define DRV_NAME "enic"
|
2010-03-18 16:20:04 +00:00
|
|
|
#define DRV_DESCRIPTION "Cisco VIC Ethernet NIC Driver"
|
2008-09-15 09:17:11 -07:00
|
|
|
|
2009-09-03 17:01:53 +00:00
|
|
|
#define ENIC_BARS_MAX 6
|
|
|
|
|
2024-11-13 23:56:36 +00:00
|
|
|
#define ENIC_WQ_MAX 256
|
|
|
|
#define ENIC_RQ_MAX 256
|
2025-05-21 01:19:29 +00:00
|
|
|
#define ENIC_RQ_MIN_DEFAULT 8
|
2009-09-03 17:02:24 +00:00
|
|
|
|
2017-12-21 08:12:28 -08:00
|
|
|
#define ENIC_WQ_NAPI_BUDGET 256
|
|
|
|
|
2014-05-20 03:14:05 +05:30
|
|
|
#define ENIC_AIC_LARGE_PKT_DIFF 3
|
|
|
|
|
2025-03-04 19:56:40 -05:00
|
|
|
enum ext_cq {
|
|
|
|
ENIC_RQ_CQ_ENTRY_SIZE_16,
|
|
|
|
ENIC_RQ_CQ_ENTRY_SIZE_32,
|
|
|
|
ENIC_RQ_CQ_ENTRY_SIZE_64,
|
|
|
|
ENIC_RQ_CQ_ENTRY_SIZE_MAX,
|
|
|
|
};
|
|
|
|
|
2008-09-15 09:17:11 -07:00
|
|
|
struct enic_msix_entry {
|
|
|
|
int requested;
|
enic: Fix format truncation warning
With -Wformat-truncation, gcc throws the following warning.
Fix this by increasing the size of devname to accommodate 15 character
netdev interface name and description.
Remove length format precision for %s. We can fit entire name.
Also increment the version.
drivers/net/ethernet/cisco/enic/enic_main.c: In function ‘enic_open’:
drivers/net/ethernet/cisco/enic/enic_main.c:1740:15: warning: ‘%u’ directive output may be truncated writing between 1 and 2 bytes into a region of size between 1 and 12 [-Wformat-truncation=]
"%.11s-rx-%u", netdev->name, i);
^~
drivers/net/ethernet/cisco/enic/enic_main.c:1740:5: note: directive argument in the range [0, 16]
"%.11s-rx-%u", netdev->name, i);
^~~~~~~~~~~~~
drivers/net/ethernet/cisco/enic/enic_main.c:1738:4: note: ‘snprintf’ output between 6 and 18 bytes into a destination of size 16
snprintf(enic->msix[intr].devname,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sizeof(enic->msix[intr].devname),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"%.11s-rx-%u", netdev->name, i);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Govindarajulu Varadarajan <gvaradar@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-19 16:28:44 -07:00
|
|
|
char devname[IFNAMSIZ + 8];
|
2008-09-15 09:17:11 -07:00
|
|
|
irqreturn_t (*isr)(int, void *);
|
|
|
|
void *devid;
|
2015-10-30 16:52:51 +05:30
|
|
|
cpumask_var_t affinity_mask;
|
2008-09-15 09:17:11 -07:00
|
|
|
};
|
|
|
|
|
2014-05-20 03:14:05 +05:30
|
|
|
/* Store only the lower range. Higher range is given by fw. */
|
|
|
|
struct enic_intr_mod_range {
|
|
|
|
u32 small_pkt_range_start;
|
|
|
|
u32 large_pkt_range_start;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct enic_intr_mod_table {
|
|
|
|
u32 rx_rate;
|
|
|
|
u32 range_percent;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define ENIC_MAX_LINK_SPEEDS 3
|
|
|
|
#define ENIC_LINK_SPEED_10G 10000
|
|
|
|
#define ENIC_LINK_SPEED_4G 4000
|
|
|
|
#define ENIC_LINK_40G_INDEX 2
|
|
|
|
#define ENIC_LINK_10G_INDEX 1
|
|
|
|
#define ENIC_LINK_4G_INDEX 0
|
|
|
|
#define ENIC_RX_COALESCE_RANGE_END 125
|
|
|
|
#define ENIC_AIC_TS_BREAK 100
|
|
|
|
|
|
|
|
struct enic_rx_coal {
|
|
|
|
u32 small_pkt_range_start;
|
|
|
|
u32 large_pkt_range_start;
|
|
|
|
u32 range_end;
|
|
|
|
u32 use_adaptive_rx_coalesce;
|
|
|
|
};
|
|
|
|
|
2011-09-22 03:44:33 +00:00
|
|
|
/* priv_flags */
|
|
|
|
#define ENIC_SRIOV_ENABLED (1 << 0)
|
|
|
|
|
|
|
|
/* enic port profile set flags */
|
2011-01-20 14:35:54 +00:00
|
|
|
#define ENIC_PORT_REQUEST_APPLIED (1 << 0)
|
2010-06-01 08:59:33 +00:00
|
|
|
#define ENIC_SET_REQUEST (1 << 1)
|
|
|
|
#define ENIC_SET_NAME (1 << 2)
|
|
|
|
#define ENIC_SET_INSTANCE (1 << 3)
|
|
|
|
#define ENIC_SET_HOST (1 << 4)
|
|
|
|
|
2025-03-04 19:56:42 -05:00
|
|
|
#define MAX_TSO BIT(16)
|
|
|
|
#define WQ_ENET_MAX_DESC_LEN BIT(WQ_ENET_LEN_BITS)
|
|
|
|
#define ENIC_DESC_MAX_SPLITS (MAX_TSO / WQ_ENET_MAX_DESC_LEN + 1)
|
|
|
|
|
2010-05-17 22:50:19 -07:00
|
|
|
struct enic_port_profile {
|
2010-06-01 08:59:33 +00:00
|
|
|
u32 set;
|
2010-05-17 22:50:19 -07:00
|
|
|
u8 request;
|
|
|
|
char name[PORT_PROFILE_MAX];
|
|
|
|
u8 instance_uuid[PORT_UUID_MAX];
|
|
|
|
u8 host_uuid[PORT_UUID_MAX];
|
2010-12-08 13:53:58 +00:00
|
|
|
u8 vf_mac[ETH_ALEN];
|
2010-12-08 13:54:03 +00:00
|
|
|
u8 mac_addr[ETH_ALEN];
|
2010-05-17 22:50:19 -07:00
|
|
|
};
|
|
|
|
|
2014-06-23 16:08:02 +05:30
|
|
|
/* enic_rfs_fltr_node - rfs filter node in hash table
|
|
|
|
* @@keys: IPv4 5 tuple
|
|
|
|
* @flow_id: flow_id of clsf filter provided by kernel
|
|
|
|
* @fltr_id: filter id of clsf filter returned by adaptor
|
|
|
|
* @rq_id: desired rq index
|
|
|
|
* @node: hlist_node
|
|
|
|
*/
|
|
|
|
struct enic_rfs_fltr_node {
|
|
|
|
struct flow_keys keys;
|
|
|
|
u32 flow_id;
|
|
|
|
u16 fltr_id;
|
|
|
|
u16 rq_id;
|
|
|
|
struct hlist_node node;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* enic_rfs_flw_tbl - rfs flow table
|
|
|
|
* @max: Maximum number of filters vNIC supports
|
|
|
|
* @free: Number of free filters available
|
|
|
|
* @toclean: hash table index to clean next
|
|
|
|
* @ht_head: hash table list head
|
|
|
|
* @lock: spin lock
|
|
|
|
* @rfs_may_expire: timer function for enic_rps_may_expire_flow
|
|
|
|
*/
|
|
|
|
struct enic_rfs_flw_tbl {
|
|
|
|
u16 max;
|
|
|
|
int free;
|
|
|
|
|
|
|
|
#define ENIC_RFS_FLW_BITSHIFT (10)
|
|
|
|
#define ENIC_RFS_FLW_MASK ((1 << ENIC_RFS_FLW_BITSHIFT) - 1)
|
|
|
|
u16 toclean:ENIC_RFS_FLW_BITSHIFT;
|
|
|
|
struct hlist_head ht_head[1 << ENIC_RFS_FLW_BITSHIFT];
|
|
|
|
spinlock_t lock;
|
|
|
|
struct timer_list rfs_may_expire;
|
|
|
|
};
|
|
|
|
|
2017-02-08 16:43:08 -08:00
|
|
|
struct vxlan_offload {
|
|
|
|
u16 vxlan_udp_port_number;
|
|
|
|
u8 patch_level;
|
2018-03-01 11:07:20 -08:00
|
|
|
u8 flags;
|
2017-02-08 16:43:08 -08:00
|
|
|
};
|
|
|
|
|
2024-09-11 17:50:37 -07:00
|
|
|
struct enic_wq_stats {
|
|
|
|
u64 packets; /* pkts queued for Tx */
|
|
|
|
u64 stopped; /* Tx ring almost full, queue stopped */
|
|
|
|
u64 wake; /* Tx ring no longer full, queue woken up*/
|
|
|
|
u64 tso; /* non-encap tso pkt */
|
|
|
|
u64 encap_tso; /* encap tso pkt */
|
|
|
|
u64 encap_csum; /* encap HW csum */
|
|
|
|
u64 csum_partial; /* skb->ip_summed = CHECKSUM_PARTIAL */
|
|
|
|
u64 csum_none; /* HW csum not required */
|
|
|
|
u64 bytes; /* bytes queued for Tx */
|
|
|
|
u64 add_vlan; /* HW adds vlan tag */
|
|
|
|
u64 cq_work; /* Tx completions processed */
|
|
|
|
u64 cq_bytes; /* Tx bytes processed */
|
|
|
|
u64 null_pkt; /* skb length <= 0 */
|
|
|
|
u64 skb_linear_fail; /* linearize failures */
|
|
|
|
u64 desc_full_awake; /* TX ring full while queue awake */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct enic_rq_stats {
|
|
|
|
u64 packets; /* pkts received */
|
|
|
|
u64 bytes; /* bytes received */
|
|
|
|
u64 l4_rss_hash; /* hashed on l4 */
|
|
|
|
u64 l3_rss_hash; /* hashed on l3 */
|
|
|
|
u64 csum_unnecessary; /* HW verified csum */
|
|
|
|
u64 csum_unnecessary_encap; /* HW verified csum on encap packet */
|
|
|
|
u64 vlan_stripped; /* HW stripped vlan */
|
|
|
|
u64 napi_complete; /* napi complete intr reenabled */
|
|
|
|
u64 napi_repoll; /* napi poll again */
|
|
|
|
u64 bad_fcs; /* bad pkts */
|
|
|
|
u64 pkt_truncated; /* truncated pkts */
|
|
|
|
u64 no_skb; /* out of skbs */
|
|
|
|
u64 desc_skip; /* Rx pkt went into later buffer */
|
2025-02-05 15:54:15 -08:00
|
|
|
u64 pp_alloc_fail; /* page pool alloc failure */
|
2024-09-11 17:50:37 -07:00
|
|
|
};
|
|
|
|
|
2024-11-13 23:56:33 +00:00
|
|
|
struct enic_wq {
|
|
|
|
spinlock_t lock; /* spinlock for wq */
|
|
|
|
struct vnic_wq vwq;
|
|
|
|
struct enic_wq_stats stats;
|
|
|
|
} ____cacheline_aligned;
|
|
|
|
|
|
|
|
struct enic_rq {
|
|
|
|
struct vnic_rq vrq;
|
|
|
|
struct enic_rq_stats stats;
|
2025-02-05 15:54:15 -08:00
|
|
|
struct page_pool *pool;
|
2024-11-13 23:56:33 +00:00
|
|
|
} ____cacheline_aligned;
|
|
|
|
|
2008-09-15 09:17:11 -07:00
|
|
|
/* Per-instance private data structure */
|
|
|
|
struct enic {
|
|
|
|
struct net_device *netdev;
|
|
|
|
struct pci_dev *pdev;
|
|
|
|
struct vnic_enet_config config;
|
2009-09-03 17:01:53 +00:00
|
|
|
struct vnic_dev_bar bar[ENIC_BARS_MAX];
|
2008-09-15 09:17:11 -07:00
|
|
|
struct vnic_dev *vdev;
|
|
|
|
struct timer_list notify_timer;
|
|
|
|
struct work_struct reset;
|
2015-10-01 14:18:47 +05:30
|
|
|
struct work_struct tx_hang_reset;
|
2011-06-03 14:35:17 +00:00
|
|
|
struct work_struct change_mtu_work;
|
2024-11-13 23:56:36 +00:00
|
|
|
struct msix_entry *msix_entry;
|
|
|
|
struct enic_msix_entry *msix;
|
2008-09-15 09:17:11 -07:00
|
|
|
u32 msg_enable;
|
|
|
|
spinlock_t devcmd_lock;
|
|
|
|
u8 mac_addr[ETH_ALEN];
|
2009-12-23 13:27:43 +00:00
|
|
|
unsigned int flags;
|
2011-09-22 03:44:33 +00:00
|
|
|
unsigned int priv_flags;
|
2008-09-15 09:17:11 -07:00
|
|
|
unsigned int mc_count;
|
2010-12-08 13:19:58 +00:00
|
|
|
unsigned int uc_count;
|
2008-09-15 09:17:11 -07:00
|
|
|
u32 port_mtu;
|
2014-05-20 03:14:05 +05:30
|
|
|
struct enic_rx_coal rx_coalesce_setting;
|
2009-12-23 13:27:54 +00:00
|
|
|
u32 rx_coalesce_usecs;
|
|
|
|
u32 tx_coalesce_usecs;
|
2011-09-22 03:44:33 +00:00
|
|
|
#ifdef CONFIG_PCI_IOV
|
2012-02-29 21:19:54 +00:00
|
|
|
u16 num_vfs;
|
2011-09-22 03:44:33 +00:00
|
|
|
#endif
|
2013-08-16 15:47:40 -07:00
|
|
|
spinlock_t enic_api_lock;
|
2020-09-29 22:25:10 +02:00
|
|
|
bool enic_api_busy;
|
2011-09-22 03:44:43 +00:00
|
|
|
struct enic_port_profile *pp;
|
2008-09-15 09:17:11 -07:00
|
|
|
|
2024-11-13 23:56:36 +00:00
|
|
|
struct enic_wq *wq;
|
2024-11-13 23:56:35 +00:00
|
|
|
unsigned int wq_avail;
|
2008-09-15 09:17:11 -07:00
|
|
|
unsigned int wq_count;
|
2010-06-24 10:51:59 +00:00
|
|
|
u16 loop_enable;
|
|
|
|
u16 loop_tag;
|
2008-09-15 09:17:11 -07:00
|
|
|
|
2024-11-13 23:56:36 +00:00
|
|
|
struct enic_rq *rq;
|
2024-11-13 23:56:35 +00:00
|
|
|
unsigned int rq_avail;
|
2008-09-15 09:17:11 -07:00
|
|
|
unsigned int rq_count;
|
2017-02-08 16:43:08 -08:00
|
|
|
struct vxlan_offload vxlan;
|
2024-11-13 23:56:36 +00:00
|
|
|
struct napi_struct *napi;
|
2008-09-15 09:17:11 -07:00
|
|
|
|
2024-11-13 23:56:36 +00:00
|
|
|
struct vnic_intr *intr;
|
2024-11-13 23:56:35 +00:00
|
|
|
unsigned int intr_avail;
|
2008-09-15 09:17:11 -07:00
|
|
|
unsigned int intr_count;
|
|
|
|
u32 __iomem *legacy_pba; /* memory-mapped */
|
|
|
|
|
2024-11-13 23:56:36 +00:00
|
|
|
struct vnic_cq *cq;
|
2024-11-13 23:56:35 +00:00
|
|
|
unsigned int cq_avail;
|
2008-09-15 09:17:11 -07:00
|
|
|
unsigned int cq_count;
|
2014-06-23 16:08:02 +05:30
|
|
|
struct enic_rfs_flw_tbl rfs_h;
|
2014-12-10 13:40:23 +05:30
|
|
|
u8 rss_key[ENIC_RSS_LEN];
|
2014-12-24 15:59:38 +05:30
|
|
|
struct vnic_gen_stats gen_stats;
|
2025-03-04 19:56:40 -05:00
|
|
|
enum ext_cq ext_cq;
|
2008-09-15 09:17:11 -07:00
|
|
|
};
|
|
|
|
|
2015-08-16 01:44:52 +05:30
|
|
|
static inline struct net_device *vnic_get_netdev(struct vnic_dev *vdev)
|
|
|
|
{
|
|
|
|
struct enic *enic = vdev->priv;
|
|
|
|
|
|
|
|
return enic->netdev;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* wrappers function for kernel log
|
|
|
|
*/
|
2016-03-08 13:54:56 -08:00
|
|
|
#define vdev_err(vdev, fmt, ...) \
|
|
|
|
dev_err(&(vdev)->pdev->dev, fmt, ##__VA_ARGS__)
|
|
|
|
#define vdev_warn(vdev, fmt, ...) \
|
|
|
|
dev_warn(&(vdev)->pdev->dev, fmt, ##__VA_ARGS__)
|
|
|
|
#define vdev_info(vdev, fmt, ...) \
|
|
|
|
dev_info(&(vdev)->pdev->dev, fmt, ##__VA_ARGS__)
|
|
|
|
|
|
|
|
#define vdev_neterr(vdev, fmt, ...) \
|
|
|
|
netdev_err(vnic_get_netdev(vdev), fmt, ##__VA_ARGS__)
|
|
|
|
#define vdev_netwarn(vdev, fmt, ...) \
|
|
|
|
netdev_warn(vnic_get_netdev(vdev), fmt, ##__VA_ARGS__)
|
|
|
|
#define vdev_netinfo(vdev, fmt, ...) \
|
|
|
|
netdev_info(vnic_get_netdev(vdev), fmt, ##__VA_ARGS__)
|
2015-08-16 01:44:52 +05:30
|
|
|
|
2010-06-24 10:50:56 +00:00
|
|
|
static inline struct device *enic_get_dev(struct enic *enic)
|
|
|
|
{
|
|
|
|
return &(enic->pdev->dev);
|
|
|
|
}
|
|
|
|
|
2013-07-22 09:59:18 -07:00
|
|
|
static inline unsigned int enic_cq_rq(struct enic *enic, unsigned int rq)
|
|
|
|
{
|
|
|
|
return rq;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline unsigned int enic_cq_wq(struct enic *enic, unsigned int wq)
|
|
|
|
{
|
|
|
|
return enic->rq_count + wq;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline unsigned int enic_msix_rq_intr(struct enic *enic,
|
|
|
|
unsigned int rq)
|
|
|
|
{
|
|
|
|
return enic->cq[enic_cq_rq(enic, rq)].interrupt_offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline unsigned int enic_msix_wq_intr(struct enic *enic,
|
|
|
|
unsigned int wq)
|
|
|
|
{
|
|
|
|
return enic->cq[enic_cq_wq(enic, wq)].interrupt_offset;
|
|
|
|
}
|
|
|
|
|
2024-11-13 23:56:34 +00:00
|
|
|
/* MSIX interrupts are organized as the error interrupt, then the notify
|
|
|
|
* interrupt followed by all the I/O interrupts. The error interrupt needs
|
|
|
|
* to fit in 7 bits due to hardware constraints
|
|
|
|
*/
|
|
|
|
#define ENIC_MSIX_RESERVED_INTR 2
|
|
|
|
#define ENIC_MSIX_ERR_INTR 0
|
|
|
|
#define ENIC_MSIX_NOTIFY_INTR 1
|
|
|
|
#define ENIC_MSIX_IO_INTR_BASE ENIC_MSIX_RESERVED_INTR
|
|
|
|
#define ENIC_MSIX_MIN_INTR (ENIC_MSIX_RESERVED_INTR + 2)
|
2013-07-22 09:59:18 -07:00
|
|
|
|
2022-10-17 17:58:04 -07:00
|
|
|
#define ENIC_LEGACY_IO_INTR 0
|
|
|
|
#define ENIC_LEGACY_ERR_INTR 1
|
|
|
|
#define ENIC_LEGACY_NOTIFY_INTR 2
|
|
|
|
|
2024-11-13 23:56:34 +00:00
|
|
|
static inline unsigned int enic_msix_err_intr(struct enic *enic)
|
|
|
|
{
|
|
|
|
return ENIC_MSIX_ERR_INTR;
|
|
|
|
}
|
|
|
|
|
2013-07-22 09:59:18 -07:00
|
|
|
static inline unsigned int enic_msix_notify_intr(struct enic *enic)
|
|
|
|
{
|
2024-11-13 23:56:34 +00:00
|
|
|
return ENIC_MSIX_NOTIFY_INTR;
|
2013-07-22 09:59:18 -07:00
|
|
|
}
|
|
|
|
|
2015-10-30 16:52:51 +05:30
|
|
|
static inline bool enic_is_err_intr(struct enic *enic, int intr)
|
|
|
|
{
|
|
|
|
switch (vnic_dev_get_intr_mode(enic->vdev)) {
|
|
|
|
case VNIC_DEV_INTR_MODE_INTX:
|
2022-10-17 17:58:04 -07:00
|
|
|
return intr == ENIC_LEGACY_ERR_INTR;
|
2015-10-30 16:52:51 +05:30
|
|
|
case VNIC_DEV_INTR_MODE_MSIX:
|
|
|
|
return intr == enic_msix_err_intr(enic);
|
|
|
|
case VNIC_DEV_INTR_MODE_MSI:
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline bool enic_is_notify_intr(struct enic *enic, int intr)
|
|
|
|
{
|
|
|
|
switch (vnic_dev_get_intr_mode(enic->vdev)) {
|
|
|
|
case VNIC_DEV_INTR_MODE_INTX:
|
2022-10-17 17:58:04 -07:00
|
|
|
return intr == ENIC_LEGACY_NOTIFY_INTR;
|
2015-10-30 16:52:51 +05:30
|
|
|
case VNIC_DEV_INTR_MODE_MSIX:
|
|
|
|
return intr == enic_msix_notify_intr(enic);
|
|
|
|
case VNIC_DEV_INTR_MODE_MSI:
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-12-24 15:59:37 +05:30
|
|
|
static inline int enic_dma_map_check(struct enic *enic, dma_addr_t dma_addr)
|
|
|
|
{
|
2022-01-02 11:23:39 +01:00
|
|
|
if (unlikely(dma_mapping_error(&enic->pdev->dev, dma_addr))) {
|
2014-12-24 15:59:37 +05:30
|
|
|
net_warn_ratelimited("%s: PCI dma mapping failed!\n",
|
|
|
|
enic->netdev->name);
|
2014-12-24 15:59:38 +05:30
|
|
|
enic->gen_stats.dma_map_error++;
|
2014-12-24 15:59:37 +05:30
|
|
|
|
|
|
|
return -ENOMEM;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-03-29 20:36:07 +00:00
|
|
|
void enic_reset_addr_lists(struct enic *enic);
|
2011-09-22 03:44:33 +00:00
|
|
|
int enic_sriov_enabled(struct enic *enic);
|
2011-09-22 03:44:38 +00:00
|
|
|
int enic_is_valid_vf(struct enic *enic, int vf);
|
2011-09-22 03:44:43 +00:00
|
|
|
int enic_is_dynamic(struct enic *enic);
|
2013-07-22 09:59:18 -07:00
|
|
|
void enic_set_ethtool_ops(struct net_device *netdev);
|
2014-12-10 13:40:23 +05:30
|
|
|
int __enic_set_rsskey(struct enic *enic);
|
2025-03-04 19:56:40 -05:00
|
|
|
void enic_ext_cq(struct enic *enic);
|
2011-03-29 20:36:07 +00:00
|
|
|
|
2008-09-15 09:17:11 -07:00
|
|
|
#endif /* _ENIC_H_ */
|