Commit 33aae282 authored by David S. Miller's avatar David S. Miller

Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue

Jeff Kirsher says:

====================
Intel Wired LAN Driver Updates 2019-05-31

This series contains updates to the iavf driver.

Nathan Chancellor converts the use of gnu_printf to printf.

Aleksandr modifies the driver to limit the number of RSS queues to the
number of online CPUs in order to avoid creating misconfigured RSS
queues.

Gustavo A. R. Silva converts a couple of instances where sizeof() can be
replaced with struct_size().

Alice makes the remaining changes to the iavf driver to cleanup all the
old "i40evf" references in the driver to iavf, including the file names
that still contained the old driver reference.  There was no functional
changes made, just cosmetic to reduce any confusion going forward now
that the iavf driver is the virtual function driver for both i40e and
ice drivers.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 587a7126 fdad1d54
...@@ -12,4 +12,4 @@ subdir-ccflags-y += -I$(src) ...@@ -12,4 +12,4 @@ subdir-ccflags-y += -I$(src)
obj-$(CONFIG_IAVF) += iavf.o obj-$(CONFIG_IAVF) += iavf.o
iavf-objs := iavf_main.o iavf_ethtool.o iavf_virtchnl.o \ iavf-objs := iavf_main.o iavf_ethtool.o iavf_virtchnl.o \
iavf_txrx.o iavf_common.o i40e_adminq.o iavf_client.o iavf_txrx.o iavf_common.o iavf_adminq.o iavf_client.o
This diff is collapsed.
...@@ -109,7 +109,7 @@ struct iavf_q_vector { ...@@ -109,7 +109,7 @@ struct iavf_q_vector {
/* Helper macros to switch between ints/sec and what the register uses. /* Helper macros to switch between ints/sec and what the register uses.
* And yes, it's the same math going both ways. The lowest value * And yes, it's the same math going both ways. The lowest value
* supported by all of the i40e hardware is 8. * supported by all of the iavf hardware is 8.
*/ */
#define EITR_INTS_PER_SEC_TO_REG(_eitr) \ #define EITR_INTS_PER_SEC_TO_REG(_eitr) \
((_eitr) ? (1000000000 / ((_eitr) * 256)) : 8) ((_eitr) ? (1000000000 / ((_eitr) * 256)) : 8)
...@@ -244,7 +244,7 @@ struct iavf_adapter { ...@@ -244,7 +244,7 @@ struct iavf_adapter {
int num_iwarp_msix; int num_iwarp_msix;
int iwarp_base_vector; int iwarp_base_vector;
u32 client_pending; u32 client_pending;
struct i40e_client_instance *cinst; struct iavf_client_instance *cinst;
struct msix_entry *msix_entries; struct msix_entry *msix_entries;
u32 flags; u32 flags;
...@@ -351,7 +351,7 @@ struct iavf_adapter { ...@@ -351,7 +351,7 @@ struct iavf_adapter {
/* Ethtool Private Flags */ /* Ethtool Private Flags */
/* lan device, used by client interface */ /* lan device, used by client interface */
struct i40e_device { struct iavf_device {
struct list_head list; struct list_head list;
struct iavf_adapter *vf; struct iavf_adapter *vf;
}; };
...@@ -402,7 +402,7 @@ void iavf_enable_vlan_stripping(struct iavf_adapter *adapter); ...@@ -402,7 +402,7 @@ void iavf_enable_vlan_stripping(struct iavf_adapter *adapter);
void iavf_disable_vlan_stripping(struct iavf_adapter *adapter); void iavf_disable_vlan_stripping(struct iavf_adapter *adapter);
void iavf_virtchnl_completion(struct iavf_adapter *adapter, void iavf_virtchnl_completion(struct iavf_adapter *adapter,
enum virtchnl_ops v_opcode, enum virtchnl_ops v_opcode,
iavf_status v_retval, u8 *msg, u16 msglen); enum iavf_status v_retval, u8 *msg, u16 msglen);
int iavf_config_rss(struct iavf_adapter *adapter); int iavf_config_rss(struct iavf_adapter *adapter);
int iavf_lan_add_device(struct iavf_adapter *adapter); int iavf_lan_add_device(struct iavf_adapter *adapter);
int iavf_lan_del_device(struct iavf_adapter *adapter); int iavf_lan_del_device(struct iavf_adapter *adapter);
......
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
#include "iavf_osdep.h" #include "iavf_osdep.h"
#include "iavf_status.h" #include "iavf_status.h"
#include "i40e_adminq_cmd.h" #include "iavf_adminq_cmd.h"
#define IAVF_ADMINQ_DESC(R, i) \ #define IAVF_ADMINQ_DESC(R, i) \
(&(((struct i40e_aq_desc *)((R).desc_buf.va))[i])) (&(((struct iavf_aq_desc *)((R).desc_buf.va))[i]))
#define IAVF_ADMINQ_DESC_ALIGNMENT 4096 #define IAVF_ADMINQ_DESC_ALIGNMENT 4096
...@@ -39,22 +39,22 @@ struct iavf_adminq_ring { ...@@ -39,22 +39,22 @@ struct iavf_adminq_ring {
}; };
/* ASQ transaction details */ /* ASQ transaction details */
struct i40e_asq_cmd_details { struct iavf_asq_cmd_details {
void *callback; /* cast from type I40E_ADMINQ_CALLBACK */ void *callback; /* cast from type IAVF_ADMINQ_CALLBACK */
u64 cookie; u64 cookie;
u16 flags_ena; u16 flags_ena;
u16 flags_dis; u16 flags_dis;
bool async; bool async;
bool postpone; bool postpone;
struct i40e_aq_desc *wb_desc; struct iavf_aq_desc *wb_desc;
}; };
#define I40E_ADMINQ_DETAILS(R, i) \ #define IAVF_ADMINQ_DETAILS(R, i) \
(&(((struct i40e_asq_cmd_details *)((R).cmd_buf.va))[i])) (&(((struct iavf_asq_cmd_details *)((R).cmd_buf.va))[i]))
/* ARQ event information */ /* ARQ event information */
struct i40e_arq_event_info { struct iavf_arq_event_info {
struct i40e_aq_desc desc; struct iavf_aq_desc desc;
u16 msg_len; u16 msg_len;
u16 buf_len; u16 buf_len;
u8 *msg_buf; u8 *msg_buf;
...@@ -79,45 +79,45 @@ struct iavf_adminq_info { ...@@ -79,45 +79,45 @@ struct iavf_adminq_info {
struct mutex arq_mutex; /* Receive queue lock */ struct mutex arq_mutex; /* Receive queue lock */
/* last status values on send and receive queues */ /* last status values on send and receive queues */
enum i40e_admin_queue_err asq_last_status; enum iavf_admin_queue_err asq_last_status;
enum i40e_admin_queue_err arq_last_status; enum iavf_admin_queue_err arq_last_status;
}; };
/** /**
* i40e_aq_rc_to_posix - convert errors to user-land codes * iavf_aq_rc_to_posix - convert errors to user-land codes
* aq_ret: AdminQ handler error code can override aq_rc * aq_ret: AdminQ handler error code can override aq_rc
* aq_rc: AdminQ firmware error code to convert * aq_rc: AdminQ firmware error code to convert
**/ **/
static inline int i40e_aq_rc_to_posix(int aq_ret, int aq_rc) static inline int iavf_aq_rc_to_posix(int aq_ret, int aq_rc)
{ {
int aq_to_posix[] = { int aq_to_posix[] = {
0, /* I40E_AQ_RC_OK */ 0, /* IAVF_AQ_RC_OK */
-EPERM, /* I40E_AQ_RC_EPERM */ -EPERM, /* IAVF_AQ_RC_EPERM */
-ENOENT, /* I40E_AQ_RC_ENOENT */ -ENOENT, /* IAVF_AQ_RC_ENOENT */
-ESRCH, /* I40E_AQ_RC_ESRCH */ -ESRCH, /* IAVF_AQ_RC_ESRCH */
-EINTR, /* I40E_AQ_RC_EINTR */ -EINTR, /* IAVF_AQ_RC_EINTR */
-EIO, /* I40E_AQ_RC_EIO */ -EIO, /* IAVF_AQ_RC_EIO */
-ENXIO, /* I40E_AQ_RC_ENXIO */ -ENXIO, /* IAVF_AQ_RC_ENXIO */
-E2BIG, /* I40E_AQ_RC_E2BIG */ -E2BIG, /* IAVF_AQ_RC_E2BIG */
-EAGAIN, /* I40E_AQ_RC_EAGAIN */ -EAGAIN, /* IAVF_AQ_RC_EAGAIN */
-ENOMEM, /* I40E_AQ_RC_ENOMEM */ -ENOMEM, /* IAVF_AQ_RC_ENOMEM */
-EACCES, /* I40E_AQ_RC_EACCES */ -EACCES, /* IAVF_AQ_RC_EACCES */
-EFAULT, /* I40E_AQ_RC_EFAULT */ -EFAULT, /* IAVF_AQ_RC_EFAULT */
-EBUSY, /* I40E_AQ_RC_EBUSY */ -EBUSY, /* IAVF_AQ_RC_EBUSY */
-EEXIST, /* I40E_AQ_RC_EEXIST */ -EEXIST, /* IAVF_AQ_RC_EEXIST */
-EINVAL, /* I40E_AQ_RC_EINVAL */ -EINVAL, /* IAVF_AQ_RC_EINVAL */
-ENOTTY, /* I40E_AQ_RC_ENOTTY */ -ENOTTY, /* IAVF_AQ_RC_ENOTTY */
-ENOSPC, /* I40E_AQ_RC_ENOSPC */ -ENOSPC, /* IAVF_AQ_RC_ENOSPC */
-ENOSYS, /* I40E_AQ_RC_ENOSYS */ -ENOSYS, /* IAVF_AQ_RC_ENOSYS */
-ERANGE, /* I40E_AQ_RC_ERANGE */ -ERANGE, /* IAVF_AQ_RC_ERANGE */
-EPIPE, /* I40E_AQ_RC_EFLUSHED */ -EPIPE, /* IAVF_AQ_RC_EFLUSHED */
-ESPIPE, /* I40E_AQ_RC_BAD_ADDR */ -ESPIPE, /* IAVF_AQ_RC_BAD_ADDR */
-EROFS, /* I40E_AQ_RC_EMODE */ -EROFS, /* IAVF_AQ_RC_EMODE */
-EFBIG, /* I40E_AQ_RC_EFBIG */ -EFBIG, /* IAVF_AQ_RC_EFBIG */
}; };
/* aq_rc is invalid if AQ timed out */ /* aq_rc is invalid if AQ timed out */
if (aq_ret == I40E_ERR_ADMIN_QUEUE_TIMEOUT) if (aq_ret == IAVF_ERR_ADMIN_QUEUE_TIMEOUT)
return -EAGAIN; return -EAGAIN;
if (!((u32)aq_rc < (sizeof(aq_to_posix) / sizeof((aq_to_posix)[0])))) if (!((u32)aq_rc < (sizeof(aq_to_posix) / sizeof((aq_to_posix)[0]))))
...@@ -127,9 +127,9 @@ static inline int i40e_aq_rc_to_posix(int aq_ret, int aq_rc) ...@@ -127,9 +127,9 @@ static inline int i40e_aq_rc_to_posix(int aq_ret, int aq_rc)
} }
/* general information */ /* general information */
#define I40E_AQ_LARGE_BUF 512 #define IAVF_AQ_LARGE_BUF 512
#define I40E_ASQ_CMD_TIMEOUT 250000 /* usecs */ #define IAVF_ASQ_CMD_TIMEOUT 250000 /* usecs */
void iavf_fill_default_direct_cmd_desc(struct i40e_aq_desc *desc, u16 opcode); void iavf_fill_default_direct_cmd_desc(struct iavf_aq_desc *desc, u16 opcode);
#endif /* _IAVF_ADMINQ_H_ */ #endif /* _IAVF_ADMINQ_H_ */
This diff is collapsed.
...@@ -20,12 +20,15 @@ enum iavf_memory_type { ...@@ -20,12 +20,15 @@ enum iavf_memory_type {
}; };
/* prototype for functions used for dynamic memory allocation */ /* prototype for functions used for dynamic memory allocation */
iavf_status iavf_allocate_dma_mem(struct iavf_hw *hw, struct iavf_dma_mem *mem, enum iavf_status iavf_allocate_dma_mem(struct iavf_hw *hw,
struct iavf_dma_mem *mem,
enum iavf_memory_type type, enum iavf_memory_type type,
u64 size, u32 alignment); u64 size, u32 alignment);
iavf_status iavf_free_dma_mem(struct iavf_hw *hw, struct iavf_dma_mem *mem); enum iavf_status iavf_free_dma_mem(struct iavf_hw *hw,
iavf_status iavf_allocate_virt_mem(struct iavf_hw *hw, struct iavf_dma_mem *mem);
enum iavf_status iavf_allocate_virt_mem(struct iavf_hw *hw,
struct iavf_virt_mem *mem, u32 size); struct iavf_virt_mem *mem, u32 size);
iavf_status iavf_free_virt_mem(struct iavf_hw *hw, struct iavf_virt_mem *mem); enum iavf_status iavf_free_virt_mem(struct iavf_hw *hw,
struct iavf_virt_mem *mem);
#endif /* _IAVF_ALLOC_H_ */ #endif /* _IAVF_ALLOC_H_ */
...@@ -17,86 +17,86 @@ ...@@ -17,86 +17,86 @@
__stringify(IAVF_CLIENT_VERSION_MINOR) "." \ __stringify(IAVF_CLIENT_VERSION_MINOR) "." \
__stringify(IAVF_CLIENT_VERSION_BUILD) __stringify(IAVF_CLIENT_VERSION_BUILD)
struct i40e_client_version { struct iavf_client_version {
u8 major; u8 major;
u8 minor; u8 minor;
u8 build; u8 build;
u8 rsvd; u8 rsvd;
}; };
enum i40e_client_state { enum iavf_client_state {
__I40E_CLIENT_NULL, __IAVF_CLIENT_NULL,
__I40E_CLIENT_REGISTERED __IAVF_CLIENT_REGISTERED
}; };
enum i40e_client_instance_state { enum iavf_client_instance_state {
__I40E_CLIENT_INSTANCE_NONE, __IAVF_CLIENT_INSTANCE_NONE,
__I40E_CLIENT_INSTANCE_OPENED, __IAVF_CLIENT_INSTANCE_OPENED,
}; };
struct i40e_ops; struct iavf_ops;
struct i40e_client; struct iavf_client;
/* HW does not define a type value for AEQ; only for RX/TX and CEQ. /* HW does not define a type value for AEQ; only for RX/TX and CEQ.
* In order for us to keep the interface simple, SW will define a * In order for us to keep the interface simple, SW will define a
* unique type value for AEQ. * unique type value for AEQ.
*/ */
#define I40E_QUEUE_TYPE_PE_AEQ 0x80 #define IAVF_QUEUE_TYPE_PE_AEQ 0x80
#define I40E_QUEUE_INVALID_IDX 0xFFFF #define IAVF_QUEUE_INVALID_IDX 0xFFFF
struct i40e_qv_info { struct iavf_qv_info {
u32 v_idx; /* msix_vector */ u32 v_idx; /* msix_vector */
u16 ceq_idx; u16 ceq_idx;
u16 aeq_idx; u16 aeq_idx;
u8 itr_idx; u8 itr_idx;
}; };
struct i40e_qvlist_info { struct iavf_qvlist_info {
u32 num_vectors; u32 num_vectors;
struct i40e_qv_info qv_info[1]; struct iavf_qv_info qv_info[1];
}; };
#define I40E_CLIENT_MSIX_ALL 0xFFFFFFFF #define IAVF_CLIENT_MSIX_ALL 0xFFFFFFFF
/* set of LAN parameters useful for clients managed by LAN */ /* set of LAN parameters useful for clients managed by LAN */
/* Struct to hold per priority info */ /* Struct to hold per priority info */
struct i40e_prio_qos_params { struct iavf_prio_qos_params {
u16 qs_handle; /* qs handle for prio */ u16 qs_handle; /* qs handle for prio */
u8 tc; /* TC mapped to prio */ u8 tc; /* TC mapped to prio */
u8 reserved; u8 reserved;
}; };
#define I40E_CLIENT_MAX_USER_PRIORITY 8 #define IAVF_CLIENT_MAX_USER_PRIORITY 8
/* Struct to hold Client QoS */ /* Struct to hold Client QoS */
struct i40e_qos_params { struct iavf_qos_params {
struct i40e_prio_qos_params prio_qos[I40E_CLIENT_MAX_USER_PRIORITY]; struct iavf_prio_qos_params prio_qos[IAVF_CLIENT_MAX_USER_PRIORITY];
}; };
struct i40e_params { struct iavf_params {
struct i40e_qos_params qos; struct iavf_qos_params qos;
u16 mtu; u16 mtu;
u16 link_up; /* boolean */ u16 link_up; /* boolean */
}; };
/* Structure to hold LAN device info for a client device */ /* Structure to hold LAN device info for a client device */
struct i40e_info { struct iavf_info {
struct i40e_client_version version; struct iavf_client_version version;
u8 lanmac[6]; u8 lanmac[6];
struct net_device *netdev; struct net_device *netdev;
struct pci_dev *pcidev; struct pci_dev *pcidev;
u8 __iomem *hw_addr; u8 __iomem *hw_addr;
u8 fid; /* function id, PF id or VF id */ u8 fid; /* function id, PF id or VF id */
#define I40E_CLIENT_FTYPE_PF 0 #define IAVF_CLIENT_FTYPE_PF 0
#define I40E_CLIENT_FTYPE_VF 1 #define IAVF_CLIENT_FTYPE_VF 1
u8 ftype; /* function type, PF or VF */ u8 ftype; /* function type, PF or VF */
void *vf; /* cast to iavf_adapter */ void *vf; /* cast to iavf_adapter */
/* All L2 params that could change during the life span of the device /* All L2 params that could change during the life span of the device
* and needs to be communicated to the client when they change * and needs to be communicated to the client when they change
*/ */
struct i40e_params params; struct iavf_params params;
struct i40e_ops *ops; struct iavf_ops *ops;
u16 msix_count; /* number of msix vectors*/ u16 msix_count; /* number of msix vectors*/
/* Array down below will be dynamically allocated based on msix_count */ /* Array down below will be dynamically allocated based on msix_count */
...@@ -104,66 +104,66 @@ struct i40e_info { ...@@ -104,66 +104,66 @@ struct i40e_info {
u16 itr_index; /* Which ITR index the PE driver is suppose to use */ u16 itr_index; /* Which ITR index the PE driver is suppose to use */
}; };
struct i40e_ops { struct iavf_ops {
/* setup_q_vector_list enables queues with a particular vector */ /* setup_q_vector_list enables queues with a particular vector */
int (*setup_qvlist)(struct i40e_info *ldev, struct i40e_client *client, int (*setup_qvlist)(struct iavf_info *ldev, struct iavf_client *client,
struct i40e_qvlist_info *qv_info); struct iavf_qvlist_info *qv_info);
u32 (*virtchnl_send)(struct i40e_info *ldev, struct i40e_client *client, u32 (*virtchnl_send)(struct iavf_info *ldev, struct iavf_client *client,
u8 *msg, u16 len); u8 *msg, u16 len);
/* If the PE Engine is unresponsive, RDMA driver can request a reset.*/ /* If the PE Engine is unresponsive, RDMA driver can request a reset.*/
void (*request_reset)(struct i40e_info *ldev, void (*request_reset)(struct iavf_info *ldev,
struct i40e_client *client); struct iavf_client *client);
}; };
struct i40e_client_ops { struct iavf_client_ops {
/* Should be called from register_client() or whenever the driver is /* Should be called from register_client() or whenever the driver is
* ready to create a specific client instance. * ready to create a specific client instance.
*/ */
int (*open)(struct i40e_info *ldev, struct i40e_client *client); int (*open)(struct iavf_info *ldev, struct iavf_client *client);
/* Should be closed when netdev is unavailable or when unregister /* Should be closed when netdev is unavailable or when unregister
* call comes in. If the close happens due to a reset, set the reset * call comes in. If the close happens due to a reset, set the reset
* bit to true. * bit to true.
*/ */
void (*close)(struct i40e_info *ldev, struct i40e_client *client, void (*close)(struct iavf_info *ldev, struct iavf_client *client,
bool reset); bool reset);
/* called when some l2 managed parameters changes - mss */ /* called when some l2 managed parameters changes - mss */
void (*l2_param_change)(struct i40e_info *ldev, void (*l2_param_change)(struct iavf_info *ldev,
struct i40e_client *client, struct iavf_client *client,
struct i40e_params *params); struct iavf_params *params);
/* called when a message is received from the PF */ /* called when a message is received from the PF */
int (*virtchnl_receive)(struct i40e_info *ldev, int (*virtchnl_receive)(struct iavf_info *ldev,
struct i40e_client *client, struct iavf_client *client,
u8 *msg, u16 len); u8 *msg, u16 len);
}; };
/* Client device */ /* Client device */
struct i40e_client_instance { struct iavf_client_instance {
struct list_head list; struct list_head list;
struct i40e_info lan_info; struct iavf_info lan_info;
struct i40e_client *client; struct iavf_client *client;
unsigned long state; unsigned long state;
}; };
struct i40e_client { struct iavf_client {
struct list_head list; /* list of registered clients */ struct list_head list; /* list of registered clients */
char name[IAVF_CLIENT_STR_LENGTH]; char name[IAVF_CLIENT_STR_LENGTH];
struct i40e_client_version version; struct iavf_client_version version;
unsigned long state; /* client state */ unsigned long state; /* client state */
atomic_t ref_cnt; /* Count of all the client devices of this kind */ atomic_t ref_cnt; /* Count of all the client devices of this kind */
u32 flags; u32 flags;
#define I40E_CLIENT_FLAGS_LAUNCH_ON_PROBE BIT(0) #define IAVF_CLIENT_FLAGS_LAUNCH_ON_PROBE BIT(0)
#define I40E_TX_FLAGS_NOTIFY_OTHER_EVENTS BIT(2) #define IAVF_TX_FLAGS_NOTIFY_OTHER_EVENTS BIT(2)
u8 type; u8 type;
#define I40E_CLIENT_IWARP 0 #define IAVF_CLIENT_IWARP 0
struct i40e_client_ops *ops; /* client ops provided by the client */ struct iavf_client_ops *ops; /* client ops provided by the client */
}; };
/* used by clients */ /* used by clients */
int iavf_register_client(struct i40e_client *client); int iavf_register_client(struct iavf_client *client);
int iavf_unregister_client(struct i40e_client *client); int iavf_unregister_client(struct iavf_client *client);
#endif /* _IAVF_CLIENT_H_ */ #endif /* _IAVF_CLIENT_H_ */
...@@ -280,10 +280,10 @@ static int iavf_get_link_ksettings(struct net_device *netdev, ...@@ -280,10 +280,10 @@ static int iavf_get_link_ksettings(struct net_device *netdev,
cmd->base.port = PORT_NONE; cmd->base.port = PORT_NONE;
/* Set speed and duplex */ /* Set speed and duplex */
switch (adapter->link_speed) { switch (adapter->link_speed) {
case I40E_LINK_SPEED_40GB: case IAVF_LINK_SPEED_40GB:
cmd->base.speed = SPEED_40000; cmd->base.speed = SPEED_40000;
break; break;
case I40E_LINK_SPEED_25GB: case IAVF_LINK_SPEED_25GB:
#ifdef SPEED_25000 #ifdef SPEED_25000
cmd->base.speed = SPEED_25000; cmd->base.speed = SPEED_25000;
#else #else
...@@ -291,16 +291,16 @@ static int iavf_get_link_ksettings(struct net_device *netdev, ...@@ -291,16 +291,16 @@ static int iavf_get_link_ksettings(struct net_device *netdev,
"Speed is 25G, display not supported by this version of ethtool.\n"); "Speed is 25G, display not supported by this version of ethtool.\n");
#endif #endif
break; break;
case I40E_LINK_SPEED_20GB: case IAVF_LINK_SPEED_20GB:
cmd->base.speed = SPEED_20000; cmd->base.speed = SPEED_20000;
break; break;
case I40E_LINK_SPEED_10GB: case IAVF_LINK_SPEED_10GB:
cmd->base.speed = SPEED_10000; cmd->base.speed = SPEED_10000;
break; break;
case I40E_LINK_SPEED_1GB: case IAVF_LINK_SPEED_1GB:
cmd->base.speed = SPEED_1000; cmd->base.speed = SPEED_1000;
break; break;
case I40E_LINK_SPEED_100MB: case IAVF_LINK_SPEED_100MB:
cmd->base.speed = SPEED_100; cmd->base.speed = SPEED_100;
break; break;
default: default:
......
...@@ -66,14 +66,14 @@ static struct workqueue_struct *iavf_wq; ...@@ -66,14 +66,14 @@ static struct workqueue_struct *iavf_wq;
* @size: size of memory requested * @size: size of memory requested
* @alignment: what to align the allocation to * @alignment: what to align the allocation to
**/ **/
iavf_status iavf_allocate_dma_mem_d(struct iavf_hw *hw, enum iavf_status iavf_allocate_dma_mem_d(struct iavf_hw *hw,
struct iavf_dma_mem *mem, struct iavf_dma_mem *mem,
u64 size, u32 alignment) u64 size, u32 alignment)
{ {
struct iavf_adapter *adapter = (struct iavf_adapter *)hw->back; struct iavf_adapter *adapter = (struct iavf_adapter *)hw->back;
if (!mem) if (!mem)
return I40E_ERR_PARAM; return IAVF_ERR_PARAM;
mem->size = ALIGN(size, alignment); mem->size = ALIGN(size, alignment);
mem->va = dma_alloc_coherent(&adapter->pdev->dev, mem->size, mem->va = dma_alloc_coherent(&adapter->pdev->dev, mem->size,
...@@ -81,7 +81,7 @@ iavf_status iavf_allocate_dma_mem_d(struct iavf_hw *hw, ...@@ -81,7 +81,7 @@ iavf_status iavf_allocate_dma_mem_d(struct iavf_hw *hw,
if (mem->va) if (mem->va)
return 0; return 0;
else else
return I40E_ERR_NO_MEMORY; return IAVF_ERR_NO_MEMORY;
} }
/** /**
...@@ -89,12 +89,13 @@ iavf_status iavf_allocate_dma_mem_d(struct iavf_hw *hw, ...@@ -89,12 +89,13 @@ iavf_status iavf_allocate_dma_mem_d(struct iavf_hw *hw,
* @hw: pointer to the HW structure * @hw: pointer to the HW structure
* @mem: ptr to mem struct to free * @mem: ptr to mem struct to free
**/ **/
iavf_status iavf_free_dma_mem_d(struct iavf_hw *hw, struct iavf_dma_mem *mem) enum iavf_status iavf_free_dma_mem_d(struct iavf_hw *hw,
struct iavf_dma_mem *mem)
{ {
struct iavf_adapter *adapter = (struct iavf_adapter *)hw->back; struct iavf_adapter *adapter = (struct iavf_adapter *)hw->back;
if (!mem || !mem->va) if (!mem || !mem->va)
return I40E_ERR_PARAM; return IAVF_ERR_PARAM;
dma_free_coherent(&adapter->pdev->dev, mem->size, dma_free_coherent(&adapter->pdev->dev, mem->size,
mem->va, (dma_addr_t)mem->pa); mem->va, (dma_addr_t)mem->pa);
return 0; return 0;
...@@ -106,11 +107,11 @@ iavf_status iavf_free_dma_mem_d(struct iavf_hw *hw, struct iavf_dma_mem *mem) ...@@ -106,11 +107,11 @@ iavf_status iavf_free_dma_mem_d(struct iavf_hw *hw, struct iavf_dma_mem *mem)
* @mem: ptr to mem struct to fill out * @mem: ptr to mem struct to fill out
* @size: size of memory requested * @size: size of memory requested
**/ **/
iavf_status iavf_allocate_virt_mem_d(struct iavf_hw *hw, enum iavf_status iavf_allocate_virt_mem_d(struct iavf_hw *hw,
struct iavf_virt_mem *mem, u32 size) struct iavf_virt_mem *mem, u32 size)
{ {
if (!mem) if (!mem)
return I40E_ERR_PARAM; return IAVF_ERR_PARAM;
mem->size = size; mem->size = size;
mem->va = kzalloc(size, GFP_KERNEL); mem->va = kzalloc(size, GFP_KERNEL);
...@@ -118,7 +119,7 @@ iavf_status iavf_allocate_virt_mem_d(struct iavf_hw *hw, ...@@ -118,7 +119,7 @@ iavf_status iavf_allocate_virt_mem_d(struct iavf_hw *hw,
if (mem->va) if (mem->va)
return 0; return 0;
else else
return I40E_ERR_NO_MEMORY; return IAVF_ERR_NO_MEMORY;
} }
/** /**
...@@ -126,10 +127,11 @@ iavf_status iavf_allocate_virt_mem_d(struct iavf_hw *hw, ...@@ -126,10 +127,11 @@ iavf_status iavf_allocate_virt_mem_d(struct iavf_hw *hw,
* @hw: pointer to the HW structure * @hw: pointer to the HW structure
* @mem: ptr to mem struct to free * @mem: ptr to mem struct to free
**/ **/
iavf_status iavf_free_virt_mem_d(struct iavf_hw *hw, struct iavf_virt_mem *mem) enum iavf_status iavf_free_virt_mem_d(struct iavf_hw *hw,
struct iavf_virt_mem *mem)
{ {
if (!mem) if (!mem)
return I40E_ERR_PARAM; return IAVF_ERR_PARAM;
/* it's ok to kfree a NULL pointer */ /* it's ok to kfree a NULL pointer */
kfree(mem->va); kfree(mem->va);
...@@ -1227,8 +1229,8 @@ static int iavf_set_interrupt_capability(struct iavf_adapter *adapter) ...@@ -1227,8 +1229,8 @@ static int iavf_set_interrupt_capability(struct iavf_adapter *adapter)
**/ **/
static int iavf_config_rss_aq(struct iavf_adapter *adapter) static int iavf_config_rss_aq(struct iavf_adapter *adapter)
{ {
struct i40e_aqc_get_set_rss_key_data *rss_key = struct iavf_aqc_get_set_rss_key_data *rss_key =
(struct i40e_aqc_get_set_rss_key_data *)adapter->rss_key; (struct iavf_aqc_get_set_rss_key_data *)adapter->rss_key;
struct iavf_hw *hw = &adapter->hw; struct iavf_hw *hw = &adapter->hw;
int ret = 0; int ret = 0;
...@@ -2020,9 +2022,9 @@ static void iavf_adminq_task(struct work_struct *work) ...@@ -2020,9 +2022,9 @@ static void iavf_adminq_task(struct work_struct *work)
struct iavf_adapter *adapter = struct iavf_adapter *adapter =
container_of(work, struct iavf_adapter, adminq_task); container_of(work, struct iavf_adapter, adminq_task);
struct iavf_hw *hw = &adapter->hw; struct iavf_hw *hw = &adapter->hw;
struct i40e_arq_event_info event; struct iavf_arq_event_info event;
enum virtchnl_ops v_op; enum virtchnl_ops v_op;
iavf_status ret, v_ret; enum iavf_status ret, v_ret;
u32 val, oldval; u32 val, oldval;
u16 pending; u16 pending;
...@@ -2037,7 +2039,7 @@ static void iavf_adminq_task(struct work_struct *work) ...@@ -2037,7 +2039,7 @@ static void iavf_adminq_task(struct work_struct *work)
do { do {
ret = iavf_clean_arq_element(hw, &event, &pending); ret = iavf_clean_arq_element(hw, &event, &pending);
v_op = (enum virtchnl_ops)le32_to_cpu(event.desc.cookie_high); v_op = (enum virtchnl_ops)le32_to_cpu(event.desc.cookie_high);
v_ret = (iavf_status)le32_to_cpu(event.desc.cookie_low); v_ret = (enum iavf_status)le32_to_cpu(event.desc.cookie_low);
if (ret || !v_op) if (ret || !v_op)
break; /* No event to process or error cleaning ARQ */ break; /* No event to process or error cleaning ARQ */
...@@ -2239,22 +2241,22 @@ static int iavf_validate_tx_bandwidth(struct iavf_adapter *adapter, ...@@ -2239,22 +2241,22 @@ static int iavf_validate_tx_bandwidth(struct iavf_adapter *adapter,
int speed = 0, ret = 0; int speed = 0, ret = 0;
switch (adapter->link_speed) { switch (adapter->link_speed) {
case I40E_LINK_SPEED_40GB: case IAVF_LINK_SPEED_40GB:
speed = 40000; speed = 40000;
break; break;
case I40E_LINK_SPEED_25GB: case IAVF_LINK_SPEED_25GB:
speed = 25000; speed = 25000;
break; break;
case I40E_LINK_SPEED_20GB: case IAVF_LINK_SPEED_20GB:
speed = 20000; speed = 20000;
break; break;
case I40E_LINK_SPEED_10GB: case IAVF_LINK_SPEED_10GB:
speed = 10000; speed = 10000;
break; break;
case I40E_LINK_SPEED_1GB: case IAVF_LINK_SPEED_1GB:
speed = 1000; speed = 1000;
break; break;
case I40E_LINK_SPEED_100MB: case IAVF_LINK_SPEED_100MB:
speed = 100; speed = 100;
break; break;
default: default:
...@@ -2508,7 +2510,7 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter, ...@@ -2508,7 +2510,7 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter,
} else { } else {
dev_err(&adapter->pdev->dev, "Bad ether dest mask %pM\n", dev_err(&adapter->pdev->dev, "Bad ether dest mask %pM\n",
match.mask->dst); match.mask->dst);
return I40E_ERR_CONFIG; return IAVF_ERR_CONFIG;
} }
} }
...@@ -2518,7 +2520,7 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter, ...@@ -2518,7 +2520,7 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter,
} else { } else {
dev_err(&adapter->pdev->dev, "Bad ether src mask %pM\n", dev_err(&adapter->pdev->dev, "Bad ether src mask %pM\n",
match.mask->src); match.mask->src);
return I40E_ERR_CONFIG; return IAVF_ERR_CONFIG;
} }
} }
...@@ -2553,7 +2555,7 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter, ...@@ -2553,7 +2555,7 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter,
} else { } else {
dev_err(&adapter->pdev->dev, "Bad vlan mask %u\n", dev_err(&adapter->pdev->dev, "Bad vlan mask %u\n",
match.mask->vlan_id); match.mask->vlan_id);
return I40E_ERR_CONFIG; return IAVF_ERR_CONFIG;
} }
} }
vf->mask.tcp_spec.vlan_id |= cpu_to_be16(0xffff); vf->mask.tcp_spec.vlan_id |= cpu_to_be16(0xffff);
...@@ -2577,7 +2579,7 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter, ...@@ -2577,7 +2579,7 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter,
} else { } else {
dev_err(&adapter->pdev->dev, "Bad ip dst mask 0x%08x\n", dev_err(&adapter->pdev->dev, "Bad ip dst mask 0x%08x\n",
be32_to_cpu(match.mask->dst)); be32_to_cpu(match.mask->dst));
return I40E_ERR_CONFIG; return IAVF_ERR_CONFIG;
} }
} }
...@@ -2587,13 +2589,13 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter, ...@@ -2587,13 +2589,13 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter,
} else { } else {
dev_err(&adapter->pdev->dev, "Bad ip src mask 0x%08x\n", dev_err(&adapter->pdev->dev, "Bad ip src mask 0x%08x\n",
be32_to_cpu(match.mask->dst)); be32_to_cpu(match.mask->dst));
return I40E_ERR_CONFIG; return IAVF_ERR_CONFIG;
} }
} }
if (field_flags & IAVF_CLOUD_FIELD_TEN_ID) { if (field_flags & IAVF_CLOUD_FIELD_TEN_ID) {
dev_info(&adapter->pdev->dev, "Tenant id not allowed for ip filter\n"); dev_info(&adapter->pdev->dev, "Tenant id not allowed for ip filter\n");
return I40E_ERR_CONFIG; return IAVF_ERR_CONFIG;
} }
if (match.key->dst) { if (match.key->dst) {
vf->mask.tcp_spec.dst_ip[0] |= cpu_to_be32(0xffffffff); vf->mask.tcp_spec.dst_ip[0] |= cpu_to_be32(0xffffffff);
...@@ -2614,7 +2616,7 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter, ...@@ -2614,7 +2616,7 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter,
if (ipv6_addr_any(&match.mask->dst)) { if (ipv6_addr_any(&match.mask->dst)) {
dev_err(&adapter->pdev->dev, "Bad ipv6 dst mask 0x%02x\n", dev_err(&adapter->pdev->dev, "Bad ipv6 dst mask 0x%02x\n",
IPV6_ADDR_ANY); IPV6_ADDR_ANY);
return I40E_ERR_CONFIG; return IAVF_ERR_CONFIG;
} }
/* src and dest IPv6 address should not be LOOPBACK /* src and dest IPv6 address should not be LOOPBACK
...@@ -2624,7 +2626,7 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter, ...@@ -2624,7 +2626,7 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter,
ipv6_addr_loopback(&match.key->src)) { ipv6_addr_loopback(&match.key->src)) {
dev_err(&adapter->pdev->dev, dev_err(&adapter->pdev->dev,
"ipv6 addr should not be loopback\n"); "ipv6 addr should not be loopback\n");
return I40E_ERR_CONFIG; return IAVF_ERR_CONFIG;
} }
if (!ipv6_addr_any(&match.mask->dst) || if (!ipv6_addr_any(&match.mask->dst) ||
!ipv6_addr_any(&match.mask->src)) !ipv6_addr_any(&match.mask->src))
...@@ -2649,7 +2651,7 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter, ...@@ -2649,7 +2651,7 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter,
} else { } else {
dev_err(&adapter->pdev->dev, "Bad src port mask %u\n", dev_err(&adapter->pdev->dev, "Bad src port mask %u\n",
be16_to_cpu(match.mask->src)); be16_to_cpu(match.mask->src));
return I40E_ERR_CONFIG; return IAVF_ERR_CONFIG;
} }
} }
...@@ -2659,7 +2661,7 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter, ...@@ -2659,7 +2661,7 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter,
} else { } else {
dev_err(&adapter->pdev->dev, "Bad dst port mask %u\n", dev_err(&adapter->pdev->dev, "Bad dst port mask %u\n",
be16_to_cpu(match.mask->dst)); be16_to_cpu(match.mask->dst));
return I40E_ERR_CONFIG; return IAVF_ERR_CONFIG;
} }
} }
if (match.key->dst) { if (match.key->dst) {
...@@ -3353,7 +3355,7 @@ static void iavf_init_task(struct work_struct *work) ...@@ -3353,7 +3355,7 @@ static void iavf_init_task(struct work_struct *work)
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
struct iavf_hw *hw = &adapter->hw; struct iavf_hw *hw = &adapter->hw;
struct pci_dev *pdev = adapter->pdev; struct pci_dev *pdev = adapter->pdev;
int err, bufsz; int err;
switch (adapter->state) { switch (adapter->state) {
case __IAVF_STARTUP: case __IAVF_STARTUP:
...@@ -3402,7 +3404,7 @@ static void iavf_init_task(struct work_struct *work) ...@@ -3402,7 +3404,7 @@ static void iavf_init_task(struct work_struct *work)
/* aq msg sent, awaiting reply */ /* aq msg sent, awaiting reply */
err = iavf_verify_api_ver(adapter); err = iavf_verify_api_ver(adapter);
if (err) { if (err) {
if (err == I40E_ERR_ADMIN_QUEUE_NO_WORK) if (err == IAVF_ERR_ADMIN_QUEUE_NO_WORK)
err = iavf_send_api_ver(adapter); err = iavf_send_api_ver(adapter);
else else
dev_err(&pdev->dev, "Unsupported PF API version %d.%d, expected %d.%d\n", dev_err(&pdev->dev, "Unsupported PF API version %d.%d, expected %d.%d\n",
...@@ -3423,18 +3425,17 @@ static void iavf_init_task(struct work_struct *work) ...@@ -3423,18 +3425,17 @@ static void iavf_init_task(struct work_struct *work)
case __IAVF_INIT_GET_RESOURCES: case __IAVF_INIT_GET_RESOURCES:
/* aq msg sent, awaiting reply */ /* aq msg sent, awaiting reply */
if (!adapter->vf_res) { if (!adapter->vf_res) {
bufsz = sizeof(struct virtchnl_vf_resource) + adapter->vf_res = kzalloc(struct_size(adapter->vf_res,
(IAVF_MAX_VF_VSI * vsi_res, IAVF_MAX_VF_VSI),
sizeof(struct virtchnl_vsi_resource)); GFP_KERNEL);
adapter->vf_res = kzalloc(bufsz, GFP_KERNEL);
if (!adapter->vf_res) if (!adapter->vf_res)
goto err; goto err;
} }
err = iavf_get_vf_config(adapter); err = iavf_get_vf_config(adapter);
if (err == I40E_ERR_ADMIN_QUEUE_NO_WORK) { if (err == IAVF_ERR_ADMIN_QUEUE_NO_WORK) {
err = iavf_send_vf_config_msg(adapter); err = iavf_send_vf_config_msg(adapter);
goto err; goto err;
} else if (err == I40E_ERR_PARAM) { } else if (err == IAVF_ERR_PARAM) {
/* We only get ERR_PARAM if the device is in a very bad /* We only get ERR_PARAM if the device is in a very bad
* state or if we've been disabled for previous bad * state or if we've been disabled for previous bad
* behavior. Either way, we're done now. * behavior. Either way, we're done now.
......
...@@ -46,7 +46,6 @@ struct iavf_virt_mem { ...@@ -46,7 +46,6 @@ struct iavf_virt_mem {
#define iavf_debug(h, m, s, ...) iavf_debug_d(h, m, s, ##__VA_ARGS__) #define iavf_debug(h, m, s, ...) iavf_debug_d(h, m, s, ##__VA_ARGS__)
extern void iavf_debug_d(void *hw, u32 mask, char *fmt_str, ...) extern void iavf_debug_d(void *hw, u32 mask, char *fmt_str, ...)
__attribute__ ((format(gnu_printf, 3, 4))); __printf(3, 4);
typedef enum iavf_status_code iavf_status;
#endif /* _IAVF_OSDEP_H_ */ #endif /* _IAVF_OSDEP_H_ */
...@@ -16,39 +16,40 @@ ...@@ -16,39 +16,40 @@
*/ */
/* adminq functions */ /* adminq functions */
iavf_status iavf_init_adminq(struct iavf_hw *hw); enum iavf_status iavf_init_adminq(struct iavf_hw *hw);
iavf_status iavf_shutdown_adminq(struct iavf_hw *hw); enum iavf_status iavf_shutdown_adminq(struct iavf_hw *hw);
void i40e_adminq_init_ring_data(struct iavf_hw *hw); void iavf_adminq_init_ring_data(struct iavf_hw *hw);
iavf_status iavf_clean_arq_element(struct iavf_hw *hw, enum iavf_status iavf_clean_arq_element(struct iavf_hw *hw,
struct i40e_arq_event_info *e, struct iavf_arq_event_info *e,
u16 *events_pending); u16 *events_pending);
iavf_status iavf_asq_send_command(struct iavf_hw *hw, struct i40e_aq_desc *desc, enum iavf_status iavf_asq_send_command(struct iavf_hw *hw,
struct iavf_aq_desc *desc,
void *buff, /* can be NULL */ void *buff, /* can be NULL */
u16 buff_size, u16 buff_size,
struct i40e_asq_cmd_details *cmd_details); struct iavf_asq_cmd_details *cmd_details);
bool iavf_asq_done(struct iavf_hw *hw); bool iavf_asq_done(struct iavf_hw *hw);
/* debug function for adminq */ /* debug function for adminq */
void iavf_debug_aq(struct iavf_hw *hw, enum iavf_debug_mask mask, void iavf_debug_aq(struct iavf_hw *hw, enum iavf_debug_mask mask,
void *desc, void *buffer, u16 buf_len); void *desc, void *buffer, u16 buf_len);
void i40e_idle_aq(struct iavf_hw *hw); void iavf_idle_aq(struct iavf_hw *hw);
void iavf_resume_aq(struct iavf_hw *hw); void iavf_resume_aq(struct iavf_hw *hw);
bool iavf_check_asq_alive(struct iavf_hw *hw); bool iavf_check_asq_alive(struct iavf_hw *hw);
iavf_status iavf_aq_queue_shutdown(struct iavf_hw *hw, bool unloading); enum iavf_status iavf_aq_queue_shutdown(struct iavf_hw *hw, bool unloading);
const char *iavf_aq_str(struct iavf_hw *hw, enum i40e_admin_queue_err aq_err); const char *iavf_aq_str(struct iavf_hw *hw, enum iavf_admin_queue_err aq_err);
const char *iavf_stat_str(struct iavf_hw *hw, iavf_status stat_err); const char *iavf_stat_str(struct iavf_hw *hw, enum iavf_status stat_err);
iavf_status iavf_aq_get_rss_lut(struct iavf_hw *hw, u16 seid, enum iavf_status iavf_aq_get_rss_lut(struct iavf_hw *hw, u16 seid,
bool pf_lut, u8 *lut, u16 lut_size); bool pf_lut, u8 *lut, u16 lut_size);
iavf_status iavf_aq_set_rss_lut(struct iavf_hw *hw, u16 seid, enum iavf_status iavf_aq_set_rss_lut(struct iavf_hw *hw, u16 seid,
bool pf_lut, u8 *lut, u16 lut_size); bool pf_lut, u8 *lut, u16 lut_size);
iavf_status iavf_aq_get_rss_key(struct iavf_hw *hw, u16 seid, enum iavf_status iavf_aq_get_rss_key(struct iavf_hw *hw, u16 seid,
struct i40e_aqc_get_set_rss_key_data *key); struct iavf_aqc_get_set_rss_key_data *key);
iavf_status iavf_aq_set_rss_key(struct iavf_hw *hw, u16 seid, enum iavf_status iavf_aq_set_rss_key(struct iavf_hw *hw, u16 seid,
struct i40e_aqc_get_set_rss_key_data *key); struct iavf_aqc_get_set_rss_key_data *key);
iavf_status iavf_set_mac_type(struct iavf_hw *hw); enum iavf_status iavf_set_mac_type(struct iavf_hw *hw);
extern struct iavf_rx_ptype_decoded iavf_ptype_lookup[]; extern struct iavf_rx_ptype_decoded iavf_ptype_lookup[];
...@@ -59,9 +60,10 @@ static inline struct iavf_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype) ...@@ -59,9 +60,10 @@ static inline struct iavf_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype)
void iavf_vf_parse_hw_config(struct iavf_hw *hw, void iavf_vf_parse_hw_config(struct iavf_hw *hw,
struct virtchnl_vf_resource *msg); struct virtchnl_vf_resource *msg);
iavf_status iavf_vf_reset(struct iavf_hw *hw); enum iavf_status iavf_vf_reset(struct iavf_hw *hw);
iavf_status iavf_aq_send_msg_to_pf(struct iavf_hw *hw, enum iavf_status iavf_aq_send_msg_to_pf(struct iavf_hw *hw,
enum virtchnl_ops v_opcode, enum virtchnl_ops v_opcode,
iavf_status v_retval, u8 *msg, u16 msglen, enum iavf_status v_retval,
struct i40e_asq_cmd_details *cmd_details); u8 *msg, u16 msglen,
struct iavf_asq_cmd_details *cmd_details);
#endif /* _IAVF_PROTOTYPE_H_ */ #endif /* _IAVF_PROTOTYPE_H_ */
...@@ -5,74 +5,74 @@ ...@@ -5,74 +5,74 @@
#define _IAVF_STATUS_H_ #define _IAVF_STATUS_H_
/* Error Codes */ /* Error Codes */
enum iavf_status_code { enum iavf_status {
I40E_SUCCESS = 0, IAVF_SUCCESS = 0,
I40E_ERR_NVM = -1, IAVF_ERR_NVM = -1,
I40E_ERR_NVM_CHECKSUM = -2, IAVF_ERR_NVM_CHECKSUM = -2,
I40E_ERR_PHY = -3, IAVF_ERR_PHY = -3,
I40E_ERR_CONFIG = -4, IAVF_ERR_CONFIG = -4,
I40E_ERR_PARAM = -5, IAVF_ERR_PARAM = -5,
I40E_ERR_MAC_TYPE = -6, IAVF_ERR_MAC_TYPE = -6,
I40E_ERR_UNKNOWN_PHY = -7, IAVF_ERR_UNKNOWN_PHY = -7,
I40E_ERR_LINK_SETUP = -8, IAVF_ERR_LINK_SETUP = -8,
I40E_ERR_ADAPTER_STOPPED = -9, IAVF_ERR_ADAPTER_STOPPED = -9,
I40E_ERR_INVALID_MAC_ADDR = -10, IAVF_ERR_INVALID_MAC_ADDR = -10,
I40E_ERR_DEVICE_NOT_SUPPORTED = -11, IAVF_ERR_DEVICE_NOT_SUPPORTED = -11,
I40E_ERR_MASTER_REQUESTS_PENDING = -12, IAVF_ERR_MASTER_REQUESTS_PENDING = -12,
I40E_ERR_INVALID_LINK_SETTINGS = -13, IAVF_ERR_INVALID_LINK_SETTINGS = -13,
I40E_ERR_AUTONEG_NOT_COMPLETE = -14, IAVF_ERR_AUTONEG_NOT_COMPLETE = -14,
I40E_ERR_RESET_FAILED = -15, IAVF_ERR_RESET_FAILED = -15,
I40E_ERR_SWFW_SYNC = -16, IAVF_ERR_SWFW_SYNC = -16,
I40E_ERR_NO_AVAILABLE_VSI = -17, IAVF_ERR_NO_AVAILABLE_VSI = -17,
I40E_ERR_NO_MEMORY = -18, IAVF_ERR_NO_MEMORY = -18,
I40E_ERR_BAD_PTR = -19, IAVF_ERR_BAD_PTR = -19,
I40E_ERR_RING_FULL = -20, IAVF_ERR_RING_FULL = -20,
I40E_ERR_INVALID_PD_ID = -21, IAVF_ERR_INVALID_PD_ID = -21,
I40E_ERR_INVALID_QP_ID = -22, IAVF_ERR_INVALID_QP_ID = -22,
I40E_ERR_INVALID_CQ_ID = -23, IAVF_ERR_INVALID_CQ_ID = -23,
I40E_ERR_INVALID_CEQ_ID = -24, IAVF_ERR_INVALID_CEQ_ID = -24,
I40E_ERR_INVALID_AEQ_ID = -25, IAVF_ERR_INVALID_AEQ_ID = -25,
I40E_ERR_INVALID_SIZE = -26, IAVF_ERR_INVALID_SIZE = -26,
I40E_ERR_INVALID_ARP_INDEX = -27, IAVF_ERR_INVALID_ARP_INDEX = -27,
I40E_ERR_INVALID_FPM_FUNC_ID = -28, IAVF_ERR_INVALID_FPM_FUNC_ID = -28,
I40E_ERR_QP_INVALID_MSG_SIZE = -29, IAVF_ERR_QP_INVALID_MSG_SIZE = -29,
I40E_ERR_QP_TOOMANY_WRS_POSTED = -30, IAVF_ERR_QP_TOOMANY_WRS_POSTED = -30,
I40E_ERR_INVALID_FRAG_COUNT = -31, IAVF_ERR_INVALID_FRAG_COUNT = -31,
I40E_ERR_QUEUE_EMPTY = -32, IAVF_ERR_QUEUE_EMPTY = -32,
I40E_ERR_INVALID_ALIGNMENT = -33, IAVF_ERR_INVALID_ALIGNMENT = -33,
I40E_ERR_FLUSHED_QUEUE = -34, IAVF_ERR_FLUSHED_QUEUE = -34,
I40E_ERR_INVALID_PUSH_PAGE_INDEX = -35, IAVF_ERR_INVALID_PUSH_PAGE_INDEX = -35,
I40E_ERR_INVALID_IMM_DATA_SIZE = -36, IAVF_ERR_INVALID_IMM_DATA_SIZE = -36,
I40E_ERR_TIMEOUT = -37, IAVF_ERR_TIMEOUT = -37,
I40E_ERR_OPCODE_MISMATCH = -38, IAVF_ERR_OPCODE_MISMATCH = -38,
I40E_ERR_CQP_COMPL_ERROR = -39, IAVF_ERR_CQP_COMPL_ERROR = -39,
I40E_ERR_INVALID_VF_ID = -40, IAVF_ERR_INVALID_VF_ID = -40,
I40E_ERR_INVALID_HMCFN_ID = -41, IAVF_ERR_INVALID_HMCFN_ID = -41,
I40E_ERR_BACKING_PAGE_ERROR = -42, IAVF_ERR_BACKING_PAGE_ERROR = -42,
I40E_ERR_NO_PBLCHUNKS_AVAILABLE = -43, IAVF_ERR_NO_PBLCHUNKS_AVAILABLE = -43,
I40E_ERR_INVALID_PBLE_INDEX = -44, IAVF_ERR_INVALID_PBLE_INDEX = -44,
I40E_ERR_INVALID_SD_INDEX = -45, IAVF_ERR_INVALID_SD_INDEX = -45,
I40E_ERR_INVALID_PAGE_DESC_INDEX = -46, IAVF_ERR_INVALID_PAGE_DESC_INDEX = -46,
I40E_ERR_INVALID_SD_TYPE = -47, IAVF_ERR_INVALID_SD_TYPE = -47,
I40E_ERR_MEMCPY_FAILED = -48, IAVF_ERR_MEMCPY_FAILED = -48,
I40E_ERR_INVALID_HMC_OBJ_INDEX = -49, IAVF_ERR_INVALID_HMC_OBJ_INDEX = -49,
I40E_ERR_INVALID_HMC_OBJ_COUNT = -50, IAVF_ERR_INVALID_HMC_OBJ_COUNT = -50,
I40E_ERR_INVALID_SRQ_ARM_LIMIT = -51, IAVF_ERR_INVALID_SRQ_ARM_LIMIT = -51,
I40E_ERR_SRQ_ENABLED = -52, IAVF_ERR_SRQ_ENABLED = -52,
I40E_ERR_ADMIN_QUEUE_ERROR = -53, IAVF_ERR_ADMIN_QUEUE_ERROR = -53,
I40E_ERR_ADMIN_QUEUE_TIMEOUT = -54, IAVF_ERR_ADMIN_QUEUE_TIMEOUT = -54,
I40E_ERR_BUF_TOO_SHORT = -55, IAVF_ERR_BUF_TOO_SHORT = -55,
I40E_ERR_ADMIN_QUEUE_FULL = -56, IAVF_ERR_ADMIN_QUEUE_FULL = -56,
I40E_ERR_ADMIN_QUEUE_NO_WORK = -57, IAVF_ERR_ADMIN_QUEUE_NO_WORK = -57,
I40E_ERR_BAD_IWARP_CQE = -58, IAVF_ERR_BAD_IWARP_CQE = -58,
I40E_ERR_NVM_BLANK_MODE = -59, IAVF_ERR_NVM_BLANK_MODE = -59,
I40E_ERR_NOT_IMPLEMENTED = -60, IAVF_ERR_NOT_IMPLEMENTED = -60,
I40E_ERR_PE_DOORBELL_NOT_ENABLED = -61, IAVF_ERR_PE_DOORBELL_NOT_ENABLED = -61,
I40E_ERR_DIAG_TEST_FAILED = -62, IAVF_ERR_DIAG_TEST_FAILED = -62,
I40E_ERR_NOT_READY = -63, IAVF_ERR_NOT_READY = -63,
I40E_NOT_SUPPORTED = -64, IAVF_NOT_SUPPORTED = -64,
I40E_ERR_FIRMWARE_API_VERSION = -65, IAVF_ERR_FIRMWARE_API_VERSION = -65,
I40E_ERR_ADMIN_QUEUE_CRITICAL_ERROR = -66, IAVF_ERR_ADMIN_QUEUE_CRITICAL_ERROR = -66,
}; };
#endif /* _IAVF_STATUS_H_ */ #endif /* _IAVF_STATUS_H_ */
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
/* See trace-events-sample.h for a detailed description of why this /* See trace-events-sample.h for a detailed description of why this
* guard clause is different from most normal include files. * guard clause is different from most normal include files.
*/ */
#if !defined(_I40E_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ) #if !defined(_IAVF_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
#define _I40E_TRACE_H_ #define _IAVF_TRACE_H_
#include <linux/tracepoint.h> #include <linux/tracepoint.h>
......
...@@ -379,19 +379,19 @@ static inline unsigned int iavf_itr_divisor(struct iavf_q_vector *q_vector) ...@@ -379,19 +379,19 @@ static inline unsigned int iavf_itr_divisor(struct iavf_q_vector *q_vector)
unsigned int divisor; unsigned int divisor;
switch (q_vector->adapter->link_speed) { switch (q_vector->adapter->link_speed) {
case I40E_LINK_SPEED_40GB: case IAVF_LINK_SPEED_40GB:
divisor = IAVF_ITR_ADAPTIVE_MIN_INC * 1024; divisor = IAVF_ITR_ADAPTIVE_MIN_INC * 1024;
break; break;
case I40E_LINK_SPEED_25GB: case IAVF_LINK_SPEED_25GB:
case I40E_LINK_SPEED_20GB: case IAVF_LINK_SPEED_20GB:
divisor = IAVF_ITR_ADAPTIVE_MIN_INC * 512; divisor = IAVF_ITR_ADAPTIVE_MIN_INC * 512;
break; break;
default: default:
case I40E_LINK_SPEED_10GB: case IAVF_LINK_SPEED_10GB:
divisor = IAVF_ITR_ADAPTIVE_MIN_INC * 256; divisor = IAVF_ITR_ADAPTIVE_MIN_INC * 256;
break; break;
case I40E_LINK_SPEED_1GB: case IAVF_LINK_SPEED_1GB:
case I40E_LINK_SPEED_100MB: case IAVF_LINK_SPEED_100MB:
divisor = IAVF_ITR_ADAPTIVE_MIN_INC * 32; divisor = IAVF_ITR_ADAPTIVE_MIN_INC * 32;
break; break;
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include "iavf_status.h" #include "iavf_status.h"
#include "iavf_osdep.h" #include "iavf_osdep.h"
#include "iavf_register.h" #include "iavf_register.h"
#include "i40e_adminq.h" #include "iavf_adminq.h"
#include "iavf_devids.h" #include "iavf_devids.h"
#define IAVF_RXQ_CTX_DBUFF_SHIFT 7 #define IAVF_RXQ_CTX_DBUFF_SHIFT 7
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
/* forward declaration */ /* forward declaration */
struct iavf_hw; struct iavf_hw;
typedef void (*I40E_ADMINQ_CALLBACK)(struct iavf_hw *, struct i40e_aq_desc *); typedef void (*IAVF_ADMINQ_CALLBACK)(struct iavf_hw *, struct iavf_aq_desc *);
/* Data type manipulation macros. */ /* Data type manipulation macros. */
......
...@@ -22,7 +22,7 @@ static int iavf_send_pf_msg(struct iavf_adapter *adapter, ...@@ -22,7 +22,7 @@ static int iavf_send_pf_msg(struct iavf_adapter *adapter,
enum virtchnl_ops op, u8 *msg, u16 len) enum virtchnl_ops op, u8 *msg, u16 len)
{ {
struct iavf_hw *hw = &adapter->hw; struct iavf_hw *hw = &adapter->hw;
iavf_status err; enum iavf_status err;
if (adapter->flags & IAVF_FLAG_PF_COMMS_FAILED) if (adapter->flags & IAVF_FLAG_PF_COMMS_FAILED)
return 0; /* nothing to see here, move along */ return 0; /* nothing to see here, move along */
...@@ -41,7 +41,7 @@ static int iavf_send_pf_msg(struct iavf_adapter *adapter, ...@@ -41,7 +41,7 @@ static int iavf_send_pf_msg(struct iavf_adapter *adapter,
* *
* Send API version admin queue message to the PF. The reply is not checked * Send API version admin queue message to the PF. The reply is not checked
* in this function. Returns 0 if the message was successfully * in this function. Returns 0 if the message was successfully
* sent, or one of the I40E_ADMIN_QUEUE_ERROR_ statuses if not. * sent, or one of the IAVF_ADMIN_QUEUE_ERROR_ statuses if not.
**/ **/
int iavf_send_api_ver(struct iavf_adapter *adapter) int iavf_send_api_ver(struct iavf_adapter *adapter)
{ {
...@@ -60,16 +60,16 @@ int iavf_send_api_ver(struct iavf_adapter *adapter) ...@@ -60,16 +60,16 @@ int iavf_send_api_ver(struct iavf_adapter *adapter)
* *
* Compare API versions with the PF. Must be called after admin queue is * Compare API versions with the PF. Must be called after admin queue is
* initialized. Returns 0 if API versions match, -EIO if they do not, * initialized. Returns 0 if API versions match, -EIO if they do not,
* I40E_ERR_ADMIN_QUEUE_NO_WORK if the admin queue is empty, and any errors * IAVF_ERR_ADMIN_QUEUE_NO_WORK if the admin queue is empty, and any errors
* from the firmware are propagated. * from the firmware are propagated.
**/ **/
int iavf_verify_api_ver(struct iavf_adapter *adapter) int iavf_verify_api_ver(struct iavf_adapter *adapter)
{ {
struct virtchnl_version_info *pf_vvi; struct virtchnl_version_info *pf_vvi;
struct iavf_hw *hw = &adapter->hw; struct iavf_hw *hw = &adapter->hw;
struct i40e_arq_event_info event; struct iavf_arq_event_info event;
enum virtchnl_ops op; enum virtchnl_ops op;
iavf_status err; enum iavf_status err;
event.buf_len = IAVF_MAX_AQ_BUF_SIZE; event.buf_len = IAVF_MAX_AQ_BUF_SIZE;
event.msg_buf = kzalloc(event.buf_len, GFP_KERNEL); event.msg_buf = kzalloc(event.buf_len, GFP_KERNEL);
...@@ -92,7 +92,7 @@ int iavf_verify_api_ver(struct iavf_adapter *adapter) ...@@ -92,7 +92,7 @@ int iavf_verify_api_ver(struct iavf_adapter *adapter)
} }
err = (iavf_status)le32_to_cpu(event.desc.cookie_low); err = (enum iavf_status)le32_to_cpu(event.desc.cookie_low);
if (err) if (err)
goto out_alloc; goto out_alloc;
...@@ -123,7 +123,7 @@ int iavf_verify_api_ver(struct iavf_adapter *adapter) ...@@ -123,7 +123,7 @@ int iavf_verify_api_ver(struct iavf_adapter *adapter)
* *
* Send VF configuration request admin queue message to the PF. The reply * Send VF configuration request admin queue message to the PF. The reply
* is not checked in this function. Returns 0 if the message was * is not checked in this function. Returns 0 if the message was
* successfully sent, or one of the I40E_ADMIN_QUEUE_ERROR_ statuses if not. * successfully sent, or one of the IAVF_ADMIN_QUEUE_ERROR_ statuses if not.
**/ **/
int iavf_send_vf_config_msg(struct iavf_adapter *adapter) int iavf_send_vf_config_msg(struct iavf_adapter *adapter)
{ {
...@@ -189,9 +189,9 @@ static void iavf_validate_num_queues(struct iavf_adapter *adapter) ...@@ -189,9 +189,9 @@ static void iavf_validate_num_queues(struct iavf_adapter *adapter)
int iavf_get_vf_config(struct iavf_adapter *adapter) int iavf_get_vf_config(struct iavf_adapter *adapter)
{ {
struct iavf_hw *hw = &adapter->hw; struct iavf_hw *hw = &adapter->hw;
struct i40e_arq_event_info event; struct iavf_arq_event_info event;
enum virtchnl_ops op; enum virtchnl_ops op;
iavf_status err; enum iavf_status err;
u16 len; u16 len;
len = sizeof(struct virtchnl_vf_resource) + len = sizeof(struct virtchnl_vf_resource) +
...@@ -216,7 +216,7 @@ int iavf_get_vf_config(struct iavf_adapter *adapter) ...@@ -216,7 +216,7 @@ int iavf_get_vf_config(struct iavf_adapter *adapter)
break; break;
} }
err = (iavf_status)le32_to_cpu(event.desc.cookie_low); err = (enum iavf_status)le32_to_cpu(event.desc.cookie_low);
memcpy(adapter->vf_res, event.msg_buf, min(event.msg_len, len)); memcpy(adapter->vf_res, event.msg_buf, min(event.msg_len, len));
/* some PFs send more queues than we should have so validate that /* some PFs send more queues than we should have so validate that
...@@ -416,7 +416,7 @@ int iavf_request_queues(struct iavf_adapter *adapter, int num) ...@@ -416,7 +416,7 @@ int iavf_request_queues(struct iavf_adapter *adapter, int num)
return -EBUSY; return -EBUSY;
} }
vfres.num_queue_pairs = num; vfres.num_queue_pairs = min_t(int, num, num_online_cpus());
adapter->current_op = VIRTCHNL_OP_REQUEST_QUEUES; adapter->current_op = VIRTCHNL_OP_REQUEST_QUEUES;
adapter->flags |= IAVF_FLAG_REINIT_ITR_NEEDED; adapter->flags |= IAVF_FLAG_REINIT_ITR_NEEDED;
...@@ -938,22 +938,22 @@ static void iavf_print_link_message(struct iavf_adapter *adapter) ...@@ -938,22 +938,22 @@ static void iavf_print_link_message(struct iavf_adapter *adapter)
} }
switch (adapter->link_speed) { switch (adapter->link_speed) {
case I40E_LINK_SPEED_40GB: case IAVF_LINK_SPEED_40GB:
speed = "40 G"; speed = "40 G";
break; break;
case I40E_LINK_SPEED_25GB: case IAVF_LINK_SPEED_25GB:
speed = "25 G"; speed = "25 G";
break; break;
case I40E_LINK_SPEED_20GB: case IAVF_LINK_SPEED_20GB:
speed = "20 G"; speed = "20 G";
break; break;
case I40E_LINK_SPEED_10GB: case IAVF_LINK_SPEED_10GB:
speed = "10 G"; speed = "10 G";
break; break;
case I40E_LINK_SPEED_1GB: case IAVF_LINK_SPEED_1GB:
speed = "1000 M"; speed = "1000 M";
break; break;
case I40E_LINK_SPEED_100MB: case IAVF_LINK_SPEED_100MB:
speed = "100 M"; speed = "100 M";
break; break;
default: default:
...@@ -1184,8 +1184,8 @@ void iavf_request_reset(struct iavf_adapter *adapter) ...@@ -1184,8 +1184,8 @@ void iavf_request_reset(struct iavf_adapter *adapter)
* This function handles the reply messages. * This function handles the reply messages.
**/ **/
void iavf_virtchnl_completion(struct iavf_adapter *adapter, void iavf_virtchnl_completion(struct iavf_adapter *adapter,
enum virtchnl_ops v_opcode, iavf_status v_retval, enum virtchnl_ops v_opcode,
u8 *msg, u16 msglen) enum iavf_status v_retval, u8 *msg, u16 msglen)
{ {
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment