X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fenic%2Fenic.h;h=bd2783430c082ec359f8fd292070706c19e262e2;hb=35b2d13fd6fdcbd191f2a30d74648faeb1186c65;hp=1b3813a585d513678c7bd0f66e2ba0628b8f2f55;hpb=422ba91716a761a5d06b85d2a5dd406616a647bd;p=dpdk.git diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h index 1b3813a585..bd2783430c 100644 --- a/drivers/net/enic/enic.h +++ b/drivers/net/enic/enic.h @@ -17,6 +17,7 @@ #include "vnic_rss.h" #include "enic_res.h" #include "cq_enet_desc.h" +#include #include #include @@ -24,8 +25,6 @@ #define DRV_DESCRIPTION "Cisco VIC Ethernet NIC Poll-mode Driver" #define DRV_COPYRIGHT "Copyright 2008-2015 Cisco Systems, Inc" -#define ENIC_MAX_MAC_ADDR 64 - #define VLAN_ETH_HLEN 18 #define ENICPMD_SETTING(enic, f) ((enic->config.flags & VENETF_##f) ? 1 : 0) @@ -38,6 +37,9 @@ #define PAGE_ROUND_UP(x) \ ((((unsigned long)(x)) + ENIC_PAGE_SIZE-1) & (~(ENIC_PAGE_SIZE-1))) +/* must be >= VNIC_COUNTER_DMA_MIN_PERIOD */ +#define VNIC_FLOW_COUNTER_UPDATE_MSECS 500 + #define ENICPMD_VFIO_PATH "/dev/vfio/vfio" /*#define ENIC_DESC_COUNT_MAKE_ODD (x) do{if ((~(x)) & 1) { (x)--; } }while(0)*/ @@ -49,6 +51,18 @@ #define ENICPMD_FDIR_MAX 64 +/* HW default VXLAN port */ +#define ENIC_DEFAULT_VXLAN_PORT 4789 + +/* + * Interrupt 0: LSC and errors + * Interrupt 1: rx queue 0 + * Interrupt 2: rx queue 1 + * ... + */ +#define ENICPMD_LSC_INTR_OFFSET 0 +#define ENICPMD_RXQ_INTR_OFFSET 1 + struct enic_fdir_node { struct rte_eth_fdir_filter filter; u16 fltr_id; @@ -62,8 +76,8 @@ struct enic_fdir { u32 modes; u32 types_mask; void (*copy_fltr_fn)(struct filter_v2 *filt, - struct rte_eth_fdir_input *input, - struct rte_eth_fdir_masks *masks); + const struct rte_eth_fdir_input *input, + const struct rte_eth_fdir_masks *masks); }; struct enic_soft_stats { @@ -81,6 +95,7 @@ struct rte_flow { LIST_ENTRY(rte_flow) next; u16 enic_filter_id; struct filter_v2 enic_filter; + int counter_idx; /* NIC allocated counter index (-1 = invalid) */ }; /* Per-instance private data structure */ @@ -91,7 +106,13 @@ struct enic { struct vnic_dev_bar bar0; struct vnic_dev *vdev; + /* + * mbuf_initializer contains 64 bits of mbuf rearm_data, used by + * the avx2 handler at this time. + */ + uint64_t mbuf_initializer; unsigned int port_id; + bool overlay_offload; struct rte_eth_dev *rte_dev; struct enic_fdir fdir; char bdf_name[ENICPMD_BDF_LENGTH]; @@ -109,7 +130,14 @@ struct enic { u16 max_mtu; u8 adv_filters; u32 flow_filter_mode; - u8 filter_tags; + u8 filter_actions; /* HW supported actions */ + bool vxlan; + bool disable_overlay; /* devargs disable_overlay=1 */ + uint8_t enable_avx2_rx; /* devargs enable-avx2-rx=1 */ + bool nic_cfg_chk; /* NIC_CFG_CHK available */ + bool udp_rss_weak; /* Bodega style UDP RSS */ + uint8_t ig_vlan_rewrite_mode; /* devargs ig-vlan-rewrite */ + uint16_t vxlan_port; /* current vxlan port pushed to NIC */ unsigned int flags; unsigned int priv_flags; @@ -126,9 +154,9 @@ struct enic { struct vnic_cq *cq; unsigned int cq_count; /* equals rq_count + wq_count */ - /* interrupt resource */ - struct vnic_intr intr; - unsigned int intr_count; + /* interrupt vectors (len = conf_intr_count) */ + struct vnic_intr *intr; + unsigned int intr_count; /* equals enabled interrupts (lsc + rxqs) */ /* software counters */ struct enic_soft_stats soft_stats; @@ -145,6 +173,7 @@ struct enic { rte_spinlock_t mtu_lock; LIST_HEAD(enic_flows, rte_flow) flows; + int max_flow_counter; rte_spinlock_t flows_lock; /* RSS */ @@ -160,13 +189,22 @@ struct enic { uint64_t rss_hf; /* ETH_RSS flags */ union vnic_rss_key rss_key; union vnic_rss_cpu rss_cpu; + + uint64_t rx_offload_capa; /* DEV_RX_OFFLOAD flags */ + uint64_t tx_offload_capa; /* DEV_TX_OFFLOAD flags */ + uint64_t tx_queue_offload_capa; /* DEV_TX_OFFLOAD flags */ + uint64_t tx_offload_mask; /* PKT_TX flags accepted */ + + /* Multicast MAC addresses added to the NIC */ + uint32_t mc_count; + struct rte_ether_addr mc_addrs[ENIC_MULTICAST_PERFECT_FILTERS]; }; /* Compute ethdev's max packet size from MTU */ static inline uint32_t enic_mtu_to_max_rx_pktlen(uint32_t mtu) { - /* ethdev max size includes eth and crc whereas NIC MTU does not */ - return mtu + ETHER_HDR_LEN + ETHER_CRC_LEN; + /* ethdev max size includes eth whereas NIC MTU does not */ + return mtu + RTE_ETHER_HDR_LEN; } /* Get the CQ index from a Start of Packet(SOP) RQ index */ @@ -275,7 +313,7 @@ int enic_dev_stats_get(struct enic *enic, void enic_dev_stats_clear(struct enic *enic); void enic_add_packet_filter(struct enic *enic); int enic_set_mac_address(struct enic *enic, uint8_t *mac_addr); -void enic_del_mac_address(struct enic *enic, int mac_index); +int enic_del_mac_address(struct enic *enic, int mac_index); unsigned int enic_cleanup_wq(struct enic *enic, struct vnic_wq *wq); void enic_send_pkt(struct enic *enic, struct vnic_wq *wq, struct rte_mbuf *tx_pkt, unsigned short len, @@ -288,20 +326,21 @@ int enic_clsf_init(struct enic *enic); void enic_clsf_destroy(struct enic *enic); uint16_t enic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts); +uint16_t enic_noscatter_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, + uint16_t nb_pkts); uint16_t enic_dummy_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts); uint16_t enic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts); +uint16_t enic_simple_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, + uint16_t nb_pkts); uint16_t enic_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts); int enic_set_mtu(struct enic *enic, uint16_t new_mtu); int enic_link_update(struct enic *enic); +bool enic_use_vector_rx_handler(struct enic *enic); void enic_fdir_info(struct enic *enic); void enic_fdir_info_get(struct enic *enic, struct rte_eth_fdir_info *stats); -void copy_fltr_v1(struct filter_v2 *fltr, struct rte_eth_fdir_input *input, - struct rte_eth_fdir_masks *masks); -void copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input, - struct rte_eth_fdir_masks *masks); extern const struct rte_flow_ops enic_flow_ops; #endif /* _ENIC_H_ */