X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=fhi_lib%2Flib%2Fethernet%2Fethernet.h;h=bc4bffb18ed04a76e64daba81e53e812085dbc4e;hb=70d9d920dd4e575f085f1f1a9050fefd1c10e127;hp=b22aed8bd5f095d93798aa2cf05d7a5fd305ee71;hpb=4745e5c88ba931c6d71cb6d8c681f76cf364eac5;p=o-du%2Fphy.git diff --git a/fhi_lib/lib/ethernet/ethernet.h b/fhi_lib/lib/ethernet/ethernet.h index b22aed8..bc4bffb 100644 --- a/fhi_lib/lib/ethernet/ethernet.h +++ b/fhi_lib/lib/ethernet/ethernet.h @@ -16,7 +16,6 @@ * *******************************************************************************/ - /** * @brief This file has all definitions for the Ethernet Data Interface Layer * @file ethernet.h @@ -35,20 +34,20 @@ extern "C" { #include #include -#define BURST_SIZE 64 +#define BURST_SIZE 4096 -//#define VLAN_SUPPORT -#define FLEXRAN_UP_VLAN_TAG 2 -#define ETHER_TYPE_ETHDI ETHER_TYPE_IPv4 /* hack needed for jumbo frames */ +#define ETHER_TYPE_ETHDI RTE_ETHER_TYPE_IPV4 /* hack needed for jumbo frames */ #define ETHER_TYPE_ECPRI 0xAEFE #define ETHER_TYPE_SYNC 0xBEFE #define ETHER_TYPE_START_TX 0xCEFE -#define NUM_MBUFS 262144 +#define NUM_MBUFS 65535/*16383*/ /*65535*/ /** optimal is n = (2^q - 1) */ +#define NUM_MBUFS_RING NUM_MBUFS+1 /** The size of the ring (must be a power of 2) */ + #define MBUF_CACHE 256 -#define MBUF_POOL_ELM_SMALL 1500 /* regular ethernet MTU, most compatible */ -#define MBUF_POOL_ELEMENT MAX_RX_LEN +#define MBUF_POOL_ELM_SMALL (1500 + RTE_PKTMBUF_HEADROOM )/* regular ethernet MTU, most compatible */ +#define MBUF_POOL_ELEMENT (MAX_RX_LEN + RTE_PKTMBUF_HEADROOM) #define MAX_RX_LEN 9600 #define MAX_TX_LEN (MAX_RX_LEN - 14) /* headroom for rx driver */ @@ -64,6 +63,8 @@ extern "C" { extern struct rte_mempool *_eth_mbuf_pool; extern struct rte_mempool *_eth_mbuf_pool_small; extern struct rte_mempool *_eth_mbuf_pool_big; +extern struct rte_mempool *socket_direct_pool; +extern struct rte_mempool *socket_indirect_pool; /* Do NOT change the order of this enum and below * - need to be in sync with the table of handlers in testue.c */ @@ -118,26 +119,28 @@ struct ethdi_hdr { void xran_init_mbuf_pool(void); -void xran_init_port(int port, struct ether_addr *p_lls_cu_addr); +void xran_init_port(int port); -void xran_add_eth_hdr_vlan(struct ether_addr *dst, uint16_t ethertype, struct rte_mbuf *mb, uint16_t vlan_tci); -int xran_send_mbuf(struct ether_addr *dst, struct rte_mbuf *mb); - -int xran_send_message_burst(int dst_id, int pkt_type, void *body, int len); +void xran_add_eth_hdr_vlan(struct rte_ether_addr *dst, uint16_t ethertype, struct rte_mbuf *mb); +#if 0 void xran_memdump(void *addr, int len); - +void xran_add_eth_hdr(struct ether_addr *dst, uint16_t ethertype, struct rte_mbuf *); +int xran_send_mbuf(struct ether_addr *dst, struct rte_mbuf *mb); +int xran_send_message_burst(int dst_id, int pkt_type, void *body, int len); +int xran_show_delayed_message(void); +#endif /* * Print a message after all critical processing done. * Mt-safe. 4 variants - normal, warning, error and debug log. */ - -#define nlog(m, ...) -#define delayed_message /* this is the old alias for this function */ -#define wlog(m, ...) -#define elog(m, ...) +int __xran_delayed_msg(const char *fmt, ...); +#define nlog(m, ...) __xran_delayed_msg("%s(): " m "\n", __FUNCTION__, ##__VA_ARGS__) +#define delayed_message nlog /* this is the old alias for this function */ +#define wlog(m, ...) nlog("WARNING: " m, ##__VA_ARGS__) +#define elog(m, ...) nlog("ERROR: " m, ##__VA_ARGS__) #ifdef DEBUG -# define dlog(m, ...) +# define dlog(m, ...) nlog("DEBUG: " m, ##__VA_ARGS__) #else # define dlog(m, ...) #endif