Changeset 9b533c6
- Timestamp:
- 01/08/15 18:52:13 (7 years ago)
- Branches:
- 4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
- Children:
- 706561a
- Parents:
- 1960910
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_linux.c
r9e429e8 r9b533c6 1148 1148 } 1149 1149 // Otherwise we must have a packet 1150 hdr->wirelen = recvmsg(fd, &msghdr, 0);1150 hdr->wirelen = recvmsg(fd, &msghdr, MSG_TRUNC); 1151 1151 } 1152 1152 } else { … … 1261 1261 } 1262 1262 1263 static int linuxnative_pread_packet(libtrace_t *libtrace, libtrace_thread_t *t, libtrace_packet_t *packet) 1264 { 1263 static int linuxnative_pread_packets(libtrace_t *libtrace, 1264 libtrace_thread_t *t, 1265 libtrace_packet_t **packets, 1266 UNUSED size_t nb_packets) { 1267 /* For now just read one packet */ 1265 1268 int fd = PERPKT_FORMAT(t)->fd; 1266 //fprintf(stderr, "Thread number is #%d fd=%d\n", t->perpkt_num, PERPKT_FORMAT(t)->fd); 1267 return linuxnative_read_packet_fd(libtrace, packet, fd, 1); 1269 packets[0]->error = linuxnative_read_packet_fd(libtrace, packets[0], 1270 fd, 1); 1271 if (packets[0]->error >= 1) 1272 return 1; 1273 else 1274 return packets[0]->error; 1268 1275 } 1269 1276 … … 1415 1422 } 1416 1423 1417 static int linuxring_pread_packet(libtrace_t *libtrace, libtrace_thread_t *t, libtrace_packet_t *packet) { 1424 static int linuxring_pread_packets(libtrace_t *libtrace, 1425 libtrace_thread_t *t, 1426 libtrace_packet_t **packets, 1427 UNUSED size_t nb_packets) { 1418 1428 //fprintf(stderr, "Thread number is #%d\n", t->perpkt_num); 1419 1429 int fd = PERPKT_FORMAT(t)->fd; 1420 1430 int *rxring_offset = &PERPKT_FORMAT(t)->rxring_offset; 1421 1431 char *rx_ring = PERPKT_FORMAT(t)->rx_ring; 1422 return linuxring_read_packet_fd(libtrace, packet, fd, rxring_offset, rx_ring, 1); 1432 packets[0]->error = linuxring_read_packet_fd(libtrace, packets[0], fd, 1433 rxring_offset, rx_ring, 1); 1434 if (packets[0]->error >= 1) 1435 return 1; 1436 else 1437 return packets[0]->error; 1423 1438 } 1424 1439 … … 1951 1966 {true, -1}, /* Live, no thread limit */ 1952 1967 linuxnative_pstart_input, /* pstart_input */ 1953 linuxnative_pread_packet , /* pread_packet*/1968 linuxnative_pread_packets, /* pread_packets */ 1954 1969 linuxnative_ppause_input, /* ppause */ 1955 1970 linuxnative_fin_input, /* p_fin */ … … 2002 2017 {true, -1}, /* Live, no thread limit */ 2003 2018 linuxnative_pstart_input, /* pstart_input */ 2004 linuxring_pread_packet , /* pread_packet*/2019 linuxring_pread_packets, /* pread_packets */ 2005 2020 linuxnative_ppause_input, /* ppause */ 2006 2021 linuxnative_fin_input, /* p_fin */
Note: See TracChangeset
for help on using the changeset viewer.