- Timestamp:
- 11/08/17 12:02:07 (3 years ago)
- Branches:
- cachetimestamps, develop, dpdk-ndag, etsilive, master, ndag_format, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance
- Children:
- 0317e3c
- Parents:
- e68325b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_ndag.c
re68325b r05b65ae 104 104 } 105 105 106 static inlineuint8_t check_ndag_header(char *msgbuf, uint32_t msgsize) {106 static uint8_t check_ndag_header(char *msgbuf, uint32_t msgsize) { 107 107 ndag_common_t *header = (ndag_common_t *)msgbuf; 108 108 … … 258 258 } 259 259 260 static inlinevoid new_group_alert(libtrace_t *libtrace, uint16_t threadid,260 static void new_group_alert(libtrace_t *libtrace, uint16_t threadid, 261 261 uint16_t portnum, uint16_t monid) { 262 262 … … 430 430 } 431 431 432 static in line int ndag_start_threads(libtrace_t *libtrace, uint32_t maxthreads)432 static int ndag_start_threads(libtrace_t *libtrace, uint32_t maxthreads) 433 433 { 434 434 int ret; … … 685 685 } 686 686 687 static inline int readable_data(streamsock_t ssock) {688 689 if (ssock .sock == -1) {687 static inline int readable_data(streamsock_t *ssock) { 688 689 if (ssock->sock == -1) { 690 690 return 0; 691 691 } 692 if (ssock .savedsize[ssock.nextreadind] == 0) {692 if (ssock->savedsize[ssock->nextreadind] == 0) { 693 693 return 0; 694 694 } 695 if (ssock .nextread - ssock.saved[ssock.nextreadind] >=696 ssock .savedsize[ssock.nextreadind]) {695 if (ssock->nextread - ssock->saved[ssock->nextreadind] >= 696 ssock->savedsize[ssock->nextreadind]) { 697 697 return 0; 698 698 } … … 701 701 702 702 } 703 704 static inline int read_required(streamsock_t ssock) {705 if (ssock.sock == -1)706 return 0;707 if (ssock.savedsize[ssock.nextwriteind] == 0)708 return 1;709 //if (ssock.nextread - ssock.saved >= ssock.savedsize)710 // return 1;711 return 0;712 }713 714 703 715 704 static int receive_from_sockets(recvstream_t *rt) { … … 726 715 ndag_encap_t *encaphdr; 727 716 728 if ( !read_required(rt->sources[i])) {729 if (rt->sources[i].sock != -1) {730 readybufs ++;731 }717 if (rt->sources[i].sock == -1) { 718 continue; 719 } else if (rt->sources[i].savedsize[rt->sources[i].nextwriteind] != 0) { 720 readybufs ++; 732 721 continue; 733 722 } … … 743 732 * count as 'ready' if at least one buffer is full */ 744 733 if (errno == EAGAIN || errno == EWOULDBLOCK) { 745 if (readable_data( rt->sources[i])) {734 if (readable_data(&(rt->sources[i]))) { 746 735 readybufs ++; 747 736 } … … 812 801 } 813 802 814 readybufs + = 1;803 readybufs ++; 815 804 } 816 805 … … 885 874 886 875 for (i = 0; i < rt->sourcecount; i ++) { 887 if (!readable_data( rt->sources[i])) {876 if (!readable_data(&(rt->sources[i]))) { 888 877 continue; 889 878 }
Note: See TracChangeset
for help on using the changeset viewer.