X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fiavf%2Fiavf.h;h=fe25d807c8ac02d0d77315b6c96b4752c96b8764;hb=89214fe915b8afb118105a784740b6910e54ade5;hp=e6e3e8d30cbfabf5728e3c568d8937d5f11a1d45;hpb=02d212ca3125444a70952aae79a1d679e2f83973;p=dpdk.git diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index e6e3e8d30c..fe25d807c8 100644 --- a/drivers/net/iavf/iavf.h +++ b/drivers/net/iavf/iavf.h @@ -6,6 +6,11 @@ #define _IAVF_ETHDEV_H_ #include +#include +#include +#include + +#include "iavf_log.h" #define IAVF_AQ_LEN 32 #define IAVF_AQ_BUF_SZ 4096 @@ -56,7 +61,11 @@ */ #define IAVF_VLAN_TAG_SIZE 4 #define IAVF_ETH_OVERHEAD \ - (ETHER_HDR_LEN + ETHER_CRC_LEN + IAVF_VLAN_TAG_SIZE * 2) + (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + IAVF_VLAN_TAG_SIZE * 2) + +#define IAVF_32_BIT_WIDTH (CHAR_BIT * 4) +#define IAVF_48_BIT_WIDTH (CHAR_BIT * 6) +#define IAVF_48_BIT_MASK RTE_LEN2MASK(IAVF_48_BIT_WIDTH, uint64_t) struct iavf_adapter; struct iavf_rx_queue; @@ -71,6 +80,7 @@ struct iavf_vsi { uint16_t max_macaddrs; /* Maximum number of MAC addresses */ uint16_t base_vector; uint16_t msix_intr; /* The MSIX interrupt binds to VSI */ + struct virtchnl_eth_stats eth_stats_offset; }; /* TODO: is that correct to assume the max number to be 16 ?*/ @@ -95,7 +105,7 @@ struct iavf_info { /* Event from pf */ bool dev_closed; bool link_up; - enum virtchnl_link_speed link_speed; + uint32_t link_speed; struct iavf_vsi vsi; bool vf_reset; @@ -121,6 +131,7 @@ struct iavf_adapter { /* For vector PMD */ bool rx_vec_allowed; bool tx_vec_allowed; + bool stopped; }; /* IAVF_DEV_PRIVATE_TO */ @@ -167,6 +178,17 @@ struct iavf_cmd_info { uint32_t out_size; /* buffer size for response */ }; +/* notify current command done. Only call in case execute + * _atomic_set_cmd successfully. + */ +static inline void +_notify_cmd(struct iavf_info *vf, uint32_t msg_ret) +{ + vf->cmd_retval = msg_ret; + rte_wmb(); + vf->pend_cmd = VIRTCHNL_OP_UNKNOWN; +} + /* clear current command. Only call in case execute * _atomic_set_cmd successfully. */ @@ -211,6 +233,6 @@ int iavf_query_stats(struct iavf_adapter *adapter, int iavf_config_promisc(struct iavf_adapter *adapter, bool enable_unicast, bool enable_multicast); int iavf_add_del_eth_addr(struct iavf_adapter *adapter, - struct ether_addr *addr, bool add); + struct rte_ether_addr *addr, bool add); int iavf_add_del_vlan(struct iavf_adapter *adapter, uint16_t vlanid, bool add); #endif /* _IAVF_ETHDEV_H_ */