X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fsfc%2Fsfc_dp.h;h=c302a5cc13c9cad445dcca363e45736ba4da577f;hb=de32ec32d720ca3070a48a24da1a18eb315003fe;hp=4bed137806115b16f1cd93357cc77c7f80445032;hpb=98d26ef7b839e43b0cdbdee216c7caca6b76f8f8;p=dpdk.git diff --git a/drivers/net/sfc/sfc_dp.h b/drivers/net/sfc/sfc_dp.h index 4bed137806..c302a5cc13 100644 --- a/drivers/net/sfc/sfc_dp.h +++ b/drivers/net/sfc/sfc_dp.h @@ -16,6 +16,7 @@ #include #include "sfc_log.h" +#include "sfc_stats.h" #ifdef __cplusplus extern "C" { @@ -42,6 +43,16 @@ enum sfc_dp_type { /** Datapath queue run-time information */ struct sfc_dp_queue { + /* + * Typically the structure is located at the end of Rx/Tx queue + * data structure and not used on datapath. So, it is not a + * problem to have extra fields even if not used. However, + * put stats at top of the structure to be closer to fields + * used on datapath or reap to have more chances to be cache-hot. + */ + union sfc_pkts_bytes stats; + uint32_t dbells; + uint16_t port_id; uint16_t queue_id; struct rte_pci_addr pci_addr; @@ -96,6 +107,12 @@ struct sfc_dp { /** List of datapath variants */ TAILQ_HEAD(sfc_dp_list, sfc_dp); +typedef unsigned int sfc_sw_index_t; +#define SFC_SW_INDEX_INVALID ((sfc_sw_index_t)(UINT_MAX)) + +typedef int32_t sfc_ethdev_qid_t; +#define SFC_ETHDEV_QID_INVALID ((sfc_ethdev_qid_t)(-1)) + /* Check if available HW/FW capabilities are sufficient for the datapath */ static inline bool sfc_dp_match_hw_fw_caps(const struct sfc_dp *dp, unsigned int avail_caps) @@ -110,6 +127,40 @@ struct sfc_dp *sfc_dp_find_by_caps(struct sfc_dp_list *head, unsigned int avail_caps); int sfc_dp_register(struct sfc_dp_list *head, struct sfc_dp *entry); +/** + * Dynamically registered mbuf flag "mport_override" (as a bitmask). + * + * If this flag is set in an mbuf then the dynamically registered + * mbuf field "mport" holds a valid value. This is used to direct + * port representor transmit traffic to the correct target port. + */ +extern uint64_t sfc_dp_mport_override; + +/** + * Dynamically registered mbuf field "mport" (mbuf byte offset). + * + * If the dynamically registered "mport_override" flag is set in + * an mbuf then the mbuf "mport" field holds a valid value. This + * is used to direct port representor transmit traffic to the + * correct target port. + */ +extern int sfc_dp_mport_offset; + +/** + * Register dynamic mbuf flag and field which can be used to require Tx override + * prefix descriptor with egress mport set. + */ +int sfc_dp_mport_register(void); + +/** Dynamically registered mbuf "ft_id" validity flag (as a bitmask). */ +extern uint64_t sfc_dp_ft_id_valid; + +/** Dynamically registered mbuf field "ft_id" (mbuf byte offset). */ +extern int sfc_dp_ft_id_offset; + +/** Register dynamic mbuf field "ft_id" and its validity flag. */ +int sfc_dp_ft_id_register(void); + #ifdef __cplusplus } #endif