- Timestamp:
- 12/14/17 11:03:03 (3 years ago)
- Branches:
- cachetimestamps, develop, dpdk-ndag, etsilive, master, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance
- Children:
- a6f2d1d
- Parents:
- b3199cf
- Location:
- lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_dpdk.c
rc7e547e r8efa986 55 55 #include <endian.h> 56 56 #include <string.h> 57 #include <math.h> 57 58 58 59 #if HAVE_LIBNUMA … … 1059 1060 port_conf.rxmode.max_rx_pkt_len = 0; 1060 1061 } else { 1062 double expn; 1063 1061 1064 /* Use jumbo frames */ 1062 1065 port_conf.rxmode.jumbo_frame = 1; 1063 1066 port_conf.rxmode.max_rx_pkt_len = format_data->snaplen; 1067 1068 /* Use less buffers if we're supporting jumbo frames 1069 * otherwise we won't be able to allocate memory. 1070 */ 1071 if (format_data->snaplen > 1500) { 1072 format_data->nb_rx_buf /= 2; 1073 } 1074 1075 /* snaplen should be rounded up to next power of two 1076 * to ensure enough memory is allocated for each 1077 * mbuf :( 1078 */ 1079 expn = ceil(log2((double)(format_data->snaplen))); 1080 format_data->snaplen = pow(2, (int)expn); 1064 1081 } 1065 1082 … … 1589 1606 } 1590 1607 1591 staticint dpdk_get_framing_length (const libtrace_packet_t *packet) {1608 int dpdk_get_framing_length (const libtrace_packet_t *packet) { 1592 1609 struct dpdk_addt_hdr * hdr = get_addt_hdr(packet); 1593 1610 if (hdr->flags & INCLUDES_HW_TIMESTAMP) … … 1991 2008 } 1992 2009 1993 staticvoid dpdk_get_stats(libtrace_t *trace, libtrace_stat_t *stats) {2010 void dpdk_get_stats(libtrace_t *trace, libtrace_stat_t *stats) { 1994 2011 struct rte_eth_stats dev_stats = {0}; 1995 2012 -
lib/format_dpdk.h
rc7e547e r8efa986 284 284 bool reading); 285 285 void dpdk_punregister_thread(libtrace_t *libtrace, libtrace_thread_t *t); 286 void dpdk_get_stats(libtrace_t *trace, libtrace_stat_t *stats); 287 int dpdk_get_framing_length (const libtrace_packet_t *packet) ; 286 288 int dpdk_read_packet_stream (libtrace_t *libtrace, 287 289 dpdk_per_stream_t *stream,
Note: See TracChangeset
for help on using the changeset viewer.