Changeset 20712 in vbox for trunk/src/VBox/Devices/Network/slirp
- Timestamp:
- Jun 19, 2009 11:33:32 AM (16 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/counters.h
r20574 r20712 1 1 /** $Id$ */ 2 2 /** @file 3 * Counters definitions and declarations 3 * Counters macro invocation template. 4 * 5 * This is included with different PROFILE_COUNTER and COUNTING_COUNTER 6 * implementations to instantiate data members, create function prototypes and 7 * implement these prototypes. 4 8 */ 5 9 6 10 /* 7 * Copyright (C) 2007 Sun Microsystems, Inc.11 * Copyright (C) 2007-2009 Sun Microsystems, Inc. 8 12 * 9 13 * This file is part of VirtualBox Open Source Edition (OSE), as … … 19 23 * additional information or have any questions. 20 24 */ 25 21 26 #ifndef PROFILE_COUNTER 22 27 # error PROFILE_COUNTER is not defied 23 28 #endif 24 29 #ifndef COUNTING_COUNTER 25 # error COUNTING_COUNTER is not defined30 # error COUNTING_COUNTER is not defined 26 31 #endif 27 32 28 PROFILE_COUNTER(Fill, "Profiling slirp fills") 29 PROFILE_COUNTER(Poll, "Profiling slirp polls") 30 PROFILE_COUNTER(FastTimer, "Profiling slirp fast timer") 31 PROFILE_COUNTER(SlowTimer, "Profiling slirp slow timer") 32 PROFILE_COUNTER(IOwrite, "Profiling IO sowrite") 33 PROFILE_COUNTER(IOread, "Profiling IO soread") 33 PROFILE_COUNTER(Fill, "Profiling slirp fills"); 34 PROFILE_COUNTER(Poll, "Profiling slirp polls"); 35 PROFILE_COUNTER(FastTimer, "Profiling slirp fast timer"); 36 PROFILE_COUNTER(SlowTimer, "Profiling slirp slow timer"); 37 PROFILE_COUNTER(IOwrite, "Profiling IO sowrite"); 38 PROFILE_COUNTER(IOread, "Profiling IO soread"); 34 39 35 COUNTING_COUNTER(TCP, "TCP sockets") 36 COUNTING_COUNTER(TCPHot, "TCP sockets active") 37 COUNTING_COUNTER(UDP, "UDP sockets") 38 COUNTING_COUNTER(UDPHot, "UDP sockets active") 40 COUNTING_COUNTER(TCP, "TCP sockets"); 41 COUNTING_COUNTER(TCPHot, "TCP sockets active"); 42 COUNTING_COUNTER(UDP, "UDP sockets"); 43 COUNTING_COUNTER(UDPHot, "UDP sockets active"); 39 44 40 COUNTING_COUNTER(IORead_in_1, "SB IORead_in_1") 41 COUNTING_COUNTER(IORead_in_1_bytes, "SB IORead_in_1_bytes") 42 COUNTING_COUNTER(IORead_in_2, "SB IORead_in_2") 43 COUNTING_COUNTER(IORead_in_2_1st_bytes, "SB IORead_in_2_1st_bytes") 44 COUNTING_COUNTER(IORead_in_2_2nd_bytes, "SB IORead_in_2_2nd_bytes") 45 COUNTING_COUNTER(IOWrite_in_1, "SB IOWrite_in_1") 46 COUNTING_COUNTER(IOWrite_in_1_bytes, "SB IOWrite_in_1_bytes") 47 COUNTING_COUNTER(IOWrite_in_2, "SB IOWrite_in_2") 48 COUNTING_COUNTER(IOWrite_in_2_1st_bytes, "SB IOWrite_in_2_1st_bytes") 49 COUNTING_COUNTER(IOWrite_in_2_2nd_bytes, "SB IOWrite_in_2_2nd_bytes") 50 COUNTING_COUNTER(IOWrite_no_w, "SB IOWrite_no_w") 51 COUNTING_COUNTER(IOWrite_rest, "SB IOWrite_rest") 52 COUNTING_COUNTER(IOWrite_rest_bytes, "SB IOWrite_rest_bytes") 45 COUNTING_COUNTER(IORead_in_1, "SB IORead_in_1"); 46 COUNTING_COUNTER(IORead_in_1_bytes, "SB IORead_in_1_bytes"); 47 COUNTING_COUNTER(IORead_in_2, "SB IORead_in_2"); 48 COUNTING_COUNTER(IORead_in_2_1st_bytes, "SB IORead_in_2_1st_bytes"); 49 COUNTING_COUNTER(IORead_in_2_2nd_bytes, "SB IORead_in_2_2nd_bytes"); 50 COUNTING_COUNTER(IOWrite_in_1, "SB IOWrite_in_1"); 51 COUNTING_COUNTER(IOWrite_in_1_bytes, "SB IOWrite_in_1_bytes"); 52 COUNTING_COUNTER(IOWrite_in_2, "SB IOWrite_in_2"); 53 COUNTING_COUNTER(IOWrite_in_2_1st_bytes, "SB IOWrite_in_2_1st_bytes"); 54 COUNTING_COUNTER(IOWrite_in_2_2nd_bytes, "SB IOWrite_in_2_2nd_bytes"); 55 COUNTING_COUNTER(IOWrite_no_w, "SB IOWrite_no_w"); 56 COUNTING_COUNTER(IOWrite_rest, "SB IOWrite_rest"); 57 COUNTING_COUNTER(IOWrite_rest_bytes, "SB IOWrite_rest_bytes"); 53 58 54 PROFILE_COUNTER(IOSBAppend_pf, "Profiling sbuf::append common") 55 PROFILE_COUNTER(IOSBAppend_pf_wa, "Profiling sbuf::append all writen in network") 56 PROFILE_COUNTER(IOSBAppend_pf_wf, "Profiling sbuf::append writen fault") 57 PROFILE_COUNTER(IOSBAppend_pf_wp, "Profiling sbuf::append writen partly") 58 COUNTING_COUNTER(IOSBAppend, "SB: Append total") 59 COUNTING_COUNTER(IOSBAppend_wa, "SB: Append all is written to network ") 60 COUNTING_COUNTER(IOSBAppend_wf, "SB: Append nothing is written") 61 COUNTING_COUNTER(IOSBAppend_wp, "SB: Append is written partly") 62 COUNTING_COUNTER(IOSBAppend_zm, "SB: Append mbuf is zerro or less") 59 PROFILE_COUNTER(IOSBAppend_pf, "Profiling sbuf::append common"); 60 PROFILE_COUNTER(IOSBAppend_pf_wa, "Profiling sbuf::append all writen in network"); 61 PROFILE_COUNTER(IOSBAppend_pf_wf, "Profiling sbuf::append writen fault"); 62 PROFILE_COUNTER(IOSBAppend_pf_wp, "Profiling sbuf::append writen partly"); 63 COUNTING_COUNTER(IOSBAppend, "SB: Append total"); 64 COUNTING_COUNTER(IOSBAppend_wa, "SB: Append all is written to network "); 65 COUNTING_COUNTER(IOSBAppend_wf, "SB: Append nothing is written"); 66 COUNTING_COUNTER(IOSBAppend_wp, "SB: Append is written partly"); 67 COUNTING_COUNTER(IOSBAppend_zm, "SB: Append mbuf is zerro or less"); 63 68 64 COUNTING_COUNTER(IOSBAppendSB, "SB: AppendSB total") 65 COUNTING_COUNTER(IOSBAppendSB_w_l_r, "SB: AppendSB (sb_wptr < sb_rptr)") 66 COUNTING_COUNTER(IOSBAppendSB_w_ge_r, "SB: AppendSB (sb_wptr >= sb_rptr)") 67 COUNTING_COUNTER(IOSBAppendSB_w_alter, "SB: AppendSB (altering of sb_wptr)") 69 COUNTING_COUNTER(IOSBAppendSB, "SB: AppendSB total"); 70 COUNTING_COUNTER(IOSBAppendSB_w_l_r, "SB: AppendSB (sb_wptr < sb_rptr)"); 71 COUNTING_COUNTER(IOSBAppendSB_w_ge_r, "SB: AppendSB (sb_wptr >= sb_rptr)"); 72 COUNTING_COUNTER(IOSBAppendSB_w_alter, "SB: AppendSB (altering of sb_wptr)"); 68 73 69 PROFILE_COUNTER(TCP_reassamble, "TCP::reasamble") 70 PROFILE_COUNTER(TCP_input, "TCP::input") 74 PROFILE_COUNTER(TCP_reassamble, "TCP::reasamble"); 75 PROFILE_COUNTER(TCP_input, "TCP::input"); 71 76 72 COUNTING_COUNTER(DrvNAT_package_sent, "counting package sent via PDM queue") 73 COUNTING_COUNTER(DrvNAT_package_drop, "counting package drops by PDM queue") 77 COUNTING_COUNTER(DrvNAT_package_sent, "counting package sent via PDM queue"); 78 COUNTING_COUNTER(DrvNAT_package_drop, "counting package drops by PDM queue"); 74 79 75 -
trunk/src/VBox/Devices/Network/slirp/libslirp.h
r20380 r20712 33 33 int slirp_init(PNATState *, uint32_t, uint32_t, bool, void *); 34 34 #endif 35 void slirp_register_timers(PNATState pData, PPDMDRVINS pDrvIns); 35 void slirp_register_statistics(PNATState pData, PPDMDRVINS pDrvIns); 36 void slirp_deregister_statistics(PNATState pData, PPDMDRVINS pDrvIns); 36 37 void slirp_term(PNATState); 37 38 void slirp_link_up(PNATState); -
trunk/src/VBox/Devices/Network/slirp/sbuf.c
r20453 r20712 78 78 int ret = 0; 79 79 80 S LIRP_PROFILE_START(IOSBAppend_pf, a);80 STAM_PROFILE_START(&pData->StatIOSBAppend_pf, a); 81 81 DEBUG_CALL("sbappend"); 82 82 DEBUG_ARG("so = %lx", (long)so); … … 84 84 DEBUG_ARG("m->m_len = %d", m->m_len); 85 85 86 S LIRP_COUNTER_RESET(IOSBAppend);87 S LIRP_COUNTER_RESET(IOSBAppend_zm);88 S LIRP_COUNTER_RESET(IOSBAppend_wa);89 S LIRP_COUNTER_RESET(IOSBAppend_wf);90 S LIRP_COUNTER_RESET(IOSBAppend_wp);91 92 S LIRP_COUNTER_INC(IOSBAppend);86 STAM_COUNTER_RESET(&pData->StatIOSBAppend); 87 STAM_COUNTER_RESET(&pData->StatIOSBAppend_zm); 88 STAM_COUNTER_RESET(&pData->StatIOSBAppend_wa); 89 STAM_COUNTER_RESET(&pData->StatIOSBAppend_wf); 90 STAM_COUNTER_RESET(&pData->StatIOSBAppend_wp); 91 92 STAM_COUNTER_INC(&pData->StatIOSBAppend); 93 93 /* Shouldn't happen, but... e.g. foreign host closes connection */ 94 94 if (m->m_len <= 0) 95 95 { 96 S LIRP_COUNTER_INC(IOSBAppend_zm);96 STAM_COUNTER_INC(&pData->StatIOSBAppend_zm); 97 97 goto done; 98 98 } … … 120 120 if (ret <= 0) 121 121 { 122 S LIRP_COUNTER_INC(IOSBAppend_wf);122 STAM_COUNTER_INC(&pData->StatIOSBAppend_wf); 123 123 /* 124 124 * Nothing was written … … 128 128 */ 129 129 sbappendsb(pData, &so->so_rcv, m); 130 S LIRP_PROFILE_STOP(IOSBAppend_pf_wf, a);130 STAM_PROFILE_STOP(&pData->StatIOSBAppend_pf_wf, a); 131 131 goto done; 132 132 } 133 133 else if (ret != m->m_len) 134 134 { 135 S LIRP_COUNTER_INC(IOSBAppend_wp);135 STAM_COUNTER_INC(&pData->StatIOSBAppend_wp); 136 136 /* 137 137 * Something was written, but not everything.. … … 141 141 m->m_data += ret; 142 142 sbappendsb(pData, &so->so_rcv, m); 143 S LIRP_PROFILE_STOP(IOSBAppend_pf_wp, a);143 STAM_PROFILE_STOP(&pData->StatIOSBAppend_pf_wp, a); 144 144 goto done; 145 145 } /* else */ 146 146 /* Whatever happened, we free the mbuf */ 147 S LIRP_COUNTER_INC(IOSBAppend_wa);148 S LIRP_PROFILE_STOP(IOSBAppend_pf_wa, a);147 STAM_COUNTER_INC(&pData->StatIOSBAppend_wa); 148 STAM_PROFILE_STOP(&pData->StatIOSBAppend_pf_wa, a); 149 149 done: 150 150 m_free(pData, m); … … 162 162 len = m->m_len; 163 163 164 S LIRP_COUNTER_RESET(IOSBAppendSB);165 S LIRP_COUNTER_RESET(IOSBAppendSB_w_l_r);166 S LIRP_COUNTER_RESET(IOSBAppendSB_w_ge_r);167 S LIRP_COUNTER_RESET(IOSBAppendSB_w_alter);168 169 S LIRP_COUNTER_INC(IOSBAppendSB);164 STAM_COUNTER_RESET(&pData->StatIOSBAppendSB); 165 STAM_COUNTER_RESET(&pData->StatIOSBAppendSB_w_l_r); 166 STAM_COUNTER_RESET(&pData->StatIOSBAppendSB_w_ge_r); 167 STAM_COUNTER_RESET(&pData->StatIOSBAppendSB_w_alter); 168 169 STAM_COUNTER_INC(&pData->StatIOSBAppendSB); 170 170 if (sb->sb_wptr < sb->sb_rptr) 171 171 { 172 S LIRP_COUNTER_INC(IOSBAppendSB_w_l_r);172 STAM_COUNTER_INC(&pData->StatIOSBAppendSB_w_l_r); 173 173 n = sb->sb_rptr - sb->sb_wptr; 174 174 if (n > len) … … 178 178 else 179 179 { 180 S LIRP_COUNTER_INC(IOSBAppendSB_w_ge_r);180 STAM_COUNTER_INC(&pData->StatIOSBAppendSB_w_ge_r); 181 181 /* Do the right edge first */ 182 182 n = sb->sb_data + sb->sb_datalen - sb->sb_wptr; … … 200 200 if (sb->sb_wptr >= sb->sb_data + sb->sb_datalen) 201 201 { 202 S LIRP_COUNTER_INC(IOSBAppendSB_w_alter);202 STAM_COUNTER_INC(&pData->StatIOSBAppendSB_w_alter); 203 203 sb->sb_wptr -= sb->sb_datalen; 204 204 } -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r20574 r20712 19 19 #endif 20 20 #ifdef VBOX_WITH_SLIRP_ALIAS 21 # include<alias.h> 21 # include <alias.h> 22 #endif 23 24 #ifdef VBOX_WITH_STATISTICS 25 # include "statistics.h" 22 26 #endif 23 27 … … 463 467 snprintf(buff, sizeof(buff), "%s/resolv.conf", home); 464 468 f = fopen(buff, "r"); 465 if (f != NULL) 469 if (f != NULL) 466 470 { 467 471 Log(("NAT: DNS we're using %s\n", buff)); … … 705 709 ftp_alias_load(); 706 710 nbt_alias_load(); 707 711 708 712 } 709 713 #endif … … 711 715 } 712 716 717 /* instantiate the variables. */ 718 #ifdef VBOX_WITH_STATISTICS 719 # define COUNTING_COUNTER(name, desc) DECLHIDDEN(uint32_t) g_offSlirpStat##name 720 # define PROFILE_COUNTER(name, desc) DECLHIDDEN(uint32_t) g_offSlirpStat##name 721 # include "counters.h" 722 # undef COUNTING_COUNTER 723 # undef PROFILE_COUNTER 724 #endif 725 713 726 /** 714 * Statistics counters.727 * Register statistics. 715 728 */ 716 void slirp_register_ timers(PNATState pData, PPDMDRVINS pDrvIns)729 void slirp_register_statistics(PNATState pData, PPDMDRVINS pDrvIns) 717 730 { 718 731 #ifdef VBOX_WITH_STATISTICS 719 732 # define COUNTER(name, type, units, dsc) \ 720 do{ \ 721 PDMDrvHlpSTAMRegisterF(pDrvIns, \ 722 &pData->Stat ## name, \ 723 type, \ 724 STAMVISIBILITY_ALWAYS, \ 725 units, \ 726 dsc, \ 727 "/Drivers/NAT%d/Stat" #name, pDrvIns->iInstance); \ 728 }while(0) 729 730 # define PROFILE_COUNTER(name, dsc) \ 731 COUNTER(name, STAMTYPE_PROFILE, STAMUNIT_TICKS_PER_CALL, dsc); 732 # define COUNTING_COUNTER(name, dsc) \ 733 COUNTER(name, STAMTYPE_COUNTER, STAMUNIT_COUNT, dsc); 734 735 #include "counters.h" 736 737 #undef COUNTER 738 #undef PROFILE_COUNTER 739 #undef COUNTING_COUNTER 740 733 do { \ 734 ASMAtomicUoWriteU32(&g_offSlirpStat##name, \ 735 RT_UOFFSETOF(NATState, Stat##name)); \ 736 PDMDrvHlpSTAMRegisterF(pDrvIns, \ 737 &pData->Stat ## name, \ 738 type, \ 739 STAMVISIBILITY_ALWAYS, \ 740 units, \ 741 dsc, \ 742 "/Drivers/NAT%u/Stat" #name, \ 743 pDrvIns->iInstance); \ 744 } while (0) 745 746 # define PROFILE_COUNTER(name, dsc) COUNTER(name, STAMTYPE_PROFILE, STAMUNIT_TICKS_PER_CALL, dsc) 747 # define COUNTING_COUNTER(name, dsc) COUNTER(name, STAMTYPE_COUNTER, STAMUNIT_COUNT, dsc) 748 749 # include "counters.h" 750 751 # undef COUNTER 752 # undef PROFILE_COUNTER 753 # undef COUNTING_COUNTER 754 #endif /* VBOX_WITH_STATISTICS */ 755 } 756 757 /** 758 * Deregister statistics. 759 */ 760 void slirp_deregister_statistics(PNATState pData, PPDMDRVINS pDrvIns) 761 { 762 #ifdef VBOX_WITH_STATISTICS 763 # define PROFILE_COUNTER(name, dsc) PDMDrvHlpSTAMDeregister(pDrvIns, &pData->Stat ## name) 764 # define COUNTING_COUNTER(name, dsc) PDMDrvHlpSTAMDeregister(pDrvIns, &pData->Stat ## name) 765 766 # include "counters.h" 767 768 # undef COUNTING_COUNTER 769 # undef PROFILE_COUNTER 741 770 #endif /* VBOX_WITH_STATISTICS */ 742 771 } … … 864 893 int i; 865 894 866 S LIRP_PROFILE_START(Fill, a);895 STAM_PROFILE_START(&pData->StatFill, a); 867 896 868 897 nfds = *pnfds; … … 894 923 } 895 924 ICMP_ENGAGE_EVENT(&pData->icmp_socket, readfds); 896 897 S LIRP_COUNTER_RESET(TCP);898 S LIRP_COUNTER_RESET(TCPHot);899 925 926 STAM_COUNTER_RESET(&pData->StatTCP); 927 STAM_COUNTER_RESET(&pData->StatTCPHot); 928 900 929 QSOCKET_FOREACH(so, so_next, tcp) 901 930 /* { */ … … 903 932 so->so_poll_index = -1; 904 933 #endif 905 S LIRP_COUNTER_INC(TCP);906 934 STAM_COUNTER_INC(&pData->StatTCP); 935 907 936 /* 908 937 * See if we need a tcp_fasttimo … … 912 941 && so->so_tcpcb->t_flags & TF_DELACK) 913 942 time_fasttimo = curtime; /* Flag when we want a fasttimo */ 914 943 915 944 /* 916 945 * NOFDREF can include still connecting to local-host, … … 919 948 if (so->so_state & SS_NOFDREF || so->s == -1) 920 949 CONTINUE(tcp); 921 950 922 951 /* 923 952 * Set for reading sockets which are accepting … … 925 954 if (so->so_state & SS_FACCEPTCONN) 926 955 { 927 S LIRP_COUNTER_INC(TCPHot);956 STAM_COUNTER_INC(&pData->StatTCPHot); 928 957 TCP_ENGAGE_EVENT1(so, readfds); 929 958 CONTINUE(tcp); 930 959 } 931 960 932 961 /* 933 962 * Set for writing sockets which are connecting … … 936 965 { 937 966 Log2(("connecting %R[natsock] engaged\n",so)); 938 S LIRP_COUNTER_INC(TCPHot);967 STAM_COUNTER_INC(&pData->StatTCPHot); 939 968 TCP_ENGAGE_EVENT1(so, writefds); 940 969 } 941 970 942 971 /* 943 972 * Set for writing if we are connected, can send more, and … … 946 975 if (CONN_CANFSEND(so) && so->so_rcv.sb_cc) 947 976 { 948 S LIRP_COUNTER_INC(TCPHot);977 STAM_COUNTER_INC(&pData->StatTCPHot); 949 978 TCP_ENGAGE_EVENT1(so, writefds); 950 979 } 951 980 952 981 /* 953 982 * Set for reading (and urgent data) if we are connected, can … … 956 985 if (CONN_CANFRCV(so) && (so->so_snd.sb_cc < (so->so_snd.sb_datalen/2))) 957 986 { 958 S LIRP_COUNTER_INC(TCPHot);987 STAM_COUNTER_INC(&pData->StatTCPHot); 959 988 TCP_ENGAGE_EVENT2(so, readfds, xfds); 960 989 } 961 990 LOOP_LABEL(tcp, so, so_next); 962 991 } 963 992 964 993 /* 965 994 * UDP sockets 966 995 */ 967 S LIRP_COUNTER_RESET(UDP);968 S LIRP_COUNTER_RESET(UDPHot);969 996 STAM_COUNTER_RESET(&pData->StatUDP); 997 STAM_COUNTER_RESET(&pData->StatUDPHot); 998 970 999 QSOCKET_FOREACH(so, so_next, udp) 971 1000 /* { */ 972 973 S LIRP_COUNTER_INC(UDP);1001 1002 STAM_COUNTER_INC(&pData->StatUDP); 974 1003 #if !defined(RT_OS_WINDOWS) 975 1004 so->so_poll_index = -1; … … 1000 1029 do_slowtimo = 1; /* Let socket expire */ 1001 1030 } 1002 1031 1003 1032 /* 1004 1033 * When UDP packets are received from over the link, they're … … 1013 1042 if ((so->so_state & SS_ISFCONNECTED) && so->so_queued <= 4) 1014 1043 { 1015 S LIRP_COUNTER_INC(UDPHot);1044 STAM_COUNTER_INC(&pData->StatUDPHot); 1016 1045 UDP_ENGAGE_EVENT(so, readfds); 1017 1046 } … … 1027 1056 #endif /* !RT_OS_WINDOWS */ 1028 1057 1029 S LIRP_PROFILE_STOP(Fill, a);1058 STAM_PROFILE_STOP(&pData->StatFill, a); 1030 1059 } 1031 1060 … … 1046 1075 #endif 1047 1076 1048 S LIRP_PROFILE_START(Poll, a);1077 STAM_PROFILE_START(&pData->StatPoll, a); 1049 1078 1050 1079 /* Update time */ … … 1058 1087 if (time_fasttimo && ((curtime - time_fasttimo) >= 2)) 1059 1088 { 1060 S LIRP_PROFILE_START(FastTimer, a);1089 STAM_PROFILE_START(&pData->StatFastTimer, a); 1061 1090 tcp_fasttimo(pData); 1062 1091 time_fasttimo = 0; 1063 S LIRP_PROFILE_STOP(FastTimer, a);1092 STAM_PROFILE_STOP(&pData->StatFastTimer, a); 1064 1093 } 1065 1094 if (do_slowtimo && ((curtime - last_slowtimo) >= 499)) 1066 1095 { 1067 S LIRP_PROFILE_START(SlowTimer, a);1096 STAM_PROFILE_START(&pData->StatSlowTimer, a); 1068 1097 ip_slowtimo(pData); 1069 1098 tcp_slowtimo(pData); 1070 1099 last_slowtimo = curtime; 1071 S LIRP_PROFILE_STOP(SlowTimer, a);1100 STAM_PROFILE_STOP(&pData->StatSlowTimer, a); 1072 1101 } 1073 1102 } … … 1081 1110 */ 1082 1111 if (!link_up) 1083 goto done; 1112 goto done; 1084 1113 #if defined(RT_OS_WINDOWS) 1085 1114 /*XXX: before renaming please make see define … … 1135 1164 if (so->so_state & SS_NOFDREF || so->s == -1) 1136 1165 CONTINUE(tcp); 1137 1166 1138 1167 POLL_TCP_EVENTS(rc, error, so, &NetworkEvents); 1139 1168 1140 1169 LOG_NAT_SOCK(so, TCP, &NetworkEvents, readfds, writefds, xfds); 1141 1142 1170 1171 1143 1172 /* 1144 1173 * Check for URG data … … 1146 1175 * test for readfds below if this succeeds 1147 1176 */ 1148 1177 1149 1178 /* out-of-band data */ 1150 1179 if (CHECK_FD_SET(so, NetworkEvents, xfds)) … … 1152 1181 sorecvoob(pData, so); 1153 1182 } 1154 1183 1155 1184 /* 1156 1185 * Check sockets for reading … … 1170 1199 CONTINUE(tcp); 1171 1200 } 1172 1201 1173 1202 ret = soread(pData, so); 1174 1203 /* Output it if we read something */ … … 1200 1229 } 1201 1230 #endif 1202 1231 1203 1232 /* 1204 1233 * Check sockets for writing … … 1214 1243 /* Connected */ 1215 1244 so->so_state &= ~SS_ISFCONNECTING; 1216 1245 1217 1246 /* 1218 1247 * This should be probably guarded by PROBE_CONN too. Anyway, … … 1231 1260 || errno == ENOTCONN) 1232 1261 CONTINUE(tcp); 1233 1262 1234 1263 /* else failed */ 1235 1264 so->so_state = SS_NOFDREF; … … 1237 1266 /* else so->so_state &= ~SS_ISFCONNECTING; */ 1238 1267 #endif 1239 1268 1240 1269 /* 1241 1270 * Continue tcp_input … … 1252 1281 */ 1253 1282 } 1254 1283 1255 1284 /* 1256 1285 * Probe a still-connecting, non-blocking socket … … 1261 1290 { 1262 1291 ret = recv(so->s, (char *)&ret, 0, 0); 1263 1292 1264 1293 if (ret < 0) 1265 1294 { … … 1272 1301 CONTINUE(tcp); /* Still connecting, continue */ 1273 1302 } 1274 1303 1275 1304 /* else failed */ 1276 1305 so->so_state = SS_NOFDREF; 1277 1306 1278 1307 /* tcp_input will take care of it */ 1279 1308 } … … 1296 1325 else 1297 1326 so->so_state &= ~SS_ISFCONNECTING; 1298 1327 1299 1328 } 1300 1329 TCP_INPUT((struct mbuf *)NULL, sizeof(struct ip),so); … … 1417 1446 #endif 1418 1447 POLL_UDP_EVENTS(rc, error, so, &NetworkEvents); 1419 1448 1420 1449 LOG_NAT_SOCK(so, UDP, &NetworkEvents, readfds, writefds, xfds); 1421 1450 1422 1451 if (so->s != -1 && CHECK_FD_SET(so, NetworkEvents, readfds)) 1423 1452 { … … 1436 1465 #endif 1437 1466 1438 S LIRP_PROFILE_STOP(Poll, a);1467 STAM_PROFILE_STOP(&pData->StatPoll, a); 1439 1468 } 1440 1469 … … 1492 1521 #ifdef VBOX_WITHOUT_SLIRP_CLIENT_ETHER 1493 1522 reh = mtod(mr, struct ethhdr *); 1494 memcpy(reh->h_source, eh->h_source, ETH_ALEN); /* XXX: if_encap will swap src and dst*/ 1523 memcpy(reh->h_source, eh->h_source, ETH_ALEN); /* XXX: if_encap will swap src and dst*/ 1495 1524 Log4(("NAT: arp:%R[ether]->%R[ether]\n", 1496 1525 reh->h_source, reh->h_dest)); … … 1516 1545 for (ex_ptr = exec_list; ex_ptr; ex_ptr = ex_ptr->ex_next) 1517 1546 { 1518 if ((htip & ~pData->netmask) == ex_ptr->ex_addr) 1547 if ((htip & ~pData->netmask) == ex_ptr->ex_addr) 1519 1548 { 1520 1549 goto arp_ok; … … 1566 1595 Log4(("NAT: in:%R[ether]->%R[ether]\n", &eh->h_source, &eh->h_dest)); 1567 1596 #ifdef VBOX_WITHOUT_SLIRP_CLIENT_ETHER 1568 if (memcmp(eh->h_source, special_ethaddr, ETH_ALEN) == 0) 1597 if (memcmp(eh->h_source, special_ethaddr, ETH_ALEN) == 0) 1569 1598 { 1570 1599 /* @todo vasily: add ether logging routine in debug.c */ … … 1628 1657 m->m_len += ETH_HLEN; 1629 1658 eh = mtod(m, struct ethhdr *); 1630 1659 1631 1660 if(MBUF_HEAD(m) != m->m_data) 1632 1661 { … … 1641 1670 eh->h_source[5] = CTL_ALIAS; 1642 1671 #else 1643 if (memcmp(eh->h_source, special_ethaddr, ETH_ALEN) != 0) 1672 if (memcmp(eh->h_source, special_ethaddr, ETH_ALEN) != 0) 1644 1673 { 1645 1674 memcpy(eh->h_dest, eh->h_source, ETH_ALEN); … … 1699 1728 psin->sin_addr.s_addr = INADDR_ANY; 1700 1729 socketlen = sizeof(struct sockaddr); 1701 1702 rc = getsockname(so->s, &sa, &socketlen); 1703 if (rc < 0 || sa.sa_family != AF_INET) 1730 1731 rc = getsockname(so->s, &sa, &socketlen); 1732 if (rc < 0 || sa.sa_family != AF_INET) 1704 1733 { 1705 1734 Log(("NAT: can't get socket's name\n")); … … 1708 1737 1709 1738 psin = (struct sockaddr_in *)&sa; 1710 1739 1711 1740 #if 1 1712 1741 lib = LibAliasInit(pData, NULL); … … 1724 1753 special_addr, -1, /* not very clear for now*/ 1725 1754 (is_udp ? IPPROTO_UDP : IPPROTO_TCP)); 1726 if (link == NULL) 1755 if (link == NULL) 1727 1756 { 1728 1757 Log(("NAT: can't create redirect\n")); … … 1730 1759 } 1731 1760 so->so_la = lib; 1732 1761 1733 1762 return 0; 1734 1763 #endif … … 1765 1794 { 1766 1795 if (time_fasttimo) 1767 return 2; 1796 return 2; 1768 1797 if (do_slowtimo) 1769 1798 return 500; /* see PR_SLOWHZ */ … … 1813 1842 case 500: 1814 1843 if (hsport != 500) /* vpnc by default try operate in src:500/dst:500 mode*/ 1815 /* Not sure why this make Cisco VPN client's connection more stable, 1844 /* Not sure why this make Cisco VPN client's connection more stable, 1816 1845 * at least on some servers 1817 1846 */ 1818 service = sport; 1847 service = sport; 1819 1848 break; 1820 1849 } … … 1870 1899 void slirp_set_rcvbuf(PNATState pData, int kilobytes) 1871 1900 { 1872 _8K_1M_CHECK_ARG("SOCKET_RCVBUF", kilobytes); 1901 _8K_1M_CHECK_ARG("SOCKET_RCVBUF", kilobytes); 1873 1902 pData->socket_rcv = kilobytes; 1874 1903 } 1875 1904 void slirp_set_sndbuf(PNATState pData, int kilobytes) 1876 1905 { 1877 _8K_1M_CHECK_ARG("SOCKET_SNDBUF", kilobytes); 1906 _8K_1M_CHECK_ARG("SOCKET_SNDBUF", kilobytes); 1878 1907 pData->socket_snd = kilobytes * _1K; 1879 1908 } 1880 1909 void slirp_set_tcp_rcvspace(PNATState pData, int kilobytes) 1881 1910 { 1882 _8K_1M_CHECK_ARG("TCP_RCVSPACE", kilobytes); 1911 _8K_1M_CHECK_ARG("TCP_RCVSPACE", kilobytes); 1883 1912 tcp_rcvspace = kilobytes * _1K; 1884 1913 } 1885 1914 void slirp_set_tcp_sndspace(PNATState pData, int kilobytes) 1886 1915 { 1887 _8K_1M_CHECK_ARG("TCP_SNDSPACE", kilobytes); 1916 _8K_1M_CHECK_ARG("TCP_SNDSPACE", kilobytes); 1888 1917 tcp_sndspace = kilobytes * _1K; 1889 1918 } 1890 1919 1891 #ifdef VBOX_WITH_STATISTICS1892 /*definitions */1893 #define COUNTING_COUNTER(name, dsc) \1894 void slirp_counting_counter_##name##_reset(PNATState); \1895 void slirp_counting_counter_##name##_inc(PNATState); \1896 void slirp_counting_counter_##name##_add(PNATState,int ); \1897 /* @todo think abaout it */1898 #define PROFILE_COUNTER(name, dsc)1899 #include "counters.h"1900 #undef COUNTING_COUNTER1901 #undef PROFILE_COUNTER1902 1903 /*declarations*/1904 #define COUNTING_COUNTER(name, dsc) \1905 void slirp_counting_counter_##name##_reset(PNATState pData) \1906 { \1907 SLIRP_COUNTER_RESET(name); \1908 } \1909 void slirp_counting_counter_##name##_inc(PNATState pData) \1910 { \1911 SLIRP_COUNTER_INC(name); \1912 } \1913 void slirp_counting_counter_##name##_add(PNATState pData,int val) \1914 { \1915 SLIRP_COUNTER_ADD(name, val); \1916 }1917 /* @todo think abaout it */1918 #define PROFILE_COUNTER(name, dsc)1919 #include "counters.h"1920 #undef COUNTING_COUNTER1921 #undef PROFILE_COUNTER1922 #endif -
trunk/src/VBox/Devices/Network/slirp/slirp.h
r20376 r20712 370 370 # define ip_next(ip) (void *)((uint8_t *)(ip) + ((ip)->ip_hl << 2)) 371 371 # define udp_next(udp) (void *)((uint8_t *)&((struct udphdr *)(udp))[1] ) 372 # define bcopy(src, dst, len) memcpy((dst), (src), (len)) 373 # define bcmp(a1, a2, len) memcmp((a1), (a2), (len)) 372 # define bcopy(src, dst, len) memcpy((dst), (src), (len)) 373 # define bcmp(a1, a2, len) memcmp((a1), (a2), (len)) 374 374 # define NO_FW_PUNCH 375 375 … … 436 436 #endif /*VBOX_WITH_SLIRP_ALIAS*/ 437 437 438 #ifdef VBOX_WITH_STATISTICS 439 #define VBOX_SLIRP_COUNTER_OPER_ARG0(name, type, op) \ 440 STAM_##type##_##op(&pData->Stat##name) 441 #define VBOX_SLIRP_COUNTER_OPER_ARG1(name, type, op, arg) \ 442 STAM_##type##_##op(&pData->Stat##name, arg) 443 #else 444 #define VBOX_SLIRP_COUNTER_OPER_ARG0(name, type, op) do{}while(0) 445 #define VBOX_SLIRP_COUNTER_OPER_ARG1(name, type, op, arg) do{}while(0) 446 #endif 447 448 #define SLIRP_PROFILE_START(name, arg) \ 449 VBOX_SLIRP_COUNTER_OPER_ARG1(name, PROFILE, START, arg) 450 #define SLIRP_PROFILE_STOP(name, arg) \ 451 VBOX_SLIRP_COUNTER_OPER_ARG1(name, PROFILE, STOP, arg) 452 453 #define SLIRP_COUNTER_RESET(name) \ 454 VBOX_SLIRP_COUNTER_OPER_ARG0(name, COUNTER, RESET) 455 456 #define SLIRP_COUNTER_INC(name) \ 457 VBOX_SLIRP_COUNTER_OPER_ARG0(name, COUNTER, INC) 458 459 #define SLIRP_COUNTER_ADD(name, val) \ 460 VBOX_SLIRP_COUNTER_OPER_ARG1(name, COUNTER, ADD, (val)) 461 462 #endif 438 #endif 439 -
trunk/src/VBox/Devices/Network/slirp/slirp_state.h
r20574 r20712 19 19 */ 20 20 21 #ifndef _slirp_state_h_ 22 #define _slirp_state_h_ 21 #ifndef ___slirp_state_h 22 #define ___slirp_state_h 23 23 24 #include <iprt/req.h> 24 25 #include "ip_icmp.h" … … 229 230 int sock_answer; 230 231 /* dnsproxy/hash.c */ 231 #define HASHSIZE 10232 #define HASH(id) (id & ((1 << HASHSIZE) - 1))232 # define HASHSIZE 10 233 # define HASH(id) (id & ((1 << HASHSIZE) - 1)) 233 234 struct request *request_hash[1 << HASHSIZE]; 234 235 /* this field control behaviour of DHCP server */ … … 240 241 #endif 241 242 242 # define PROFILE_COUNTER(name, dsc) STAMPROFILE Stat ## name;243 # define COUNTING_COUNTER(name, dsc) STAMCOUNTER Stat ## name;243 #define PROFILE_COUNTER(name, dsc) STAMPROFILE Stat ## name 244 #define COUNTING_COUNTER(name, dsc) STAMCOUNTER Stat ## name 244 245 245 246 #include "counters.h" … … 600 601 && so->so_fport == (dport)) \ 601 602 { \ 602 if (sonxt != &VBOX_X2(queue_ ## label ## _label)) 603 if (sonxt != &VBOX_X2(queue_ ## label ## _label)) \ 603 604 SOCKET_UNLOCK(sonxt); \ 604 605 break; /*so is locked*/ \ … … 685 686 #endif 686 687 687 #endif /* !_slirp_state_h_ */ 688 #endif /* !___slirp_state_h */ 689 -
trunk/src/VBox/Devices/Network/slirp/socket.c
r20379 r20712 125 125 int mss = so->so_tcpcb->t_maxseg; 126 126 127 S LIRP_PROFILE_START(IOread, a);128 S LIRP_COUNTER_RESET(IORead_in_1);129 S LIRP_COUNTER_RESET(IORead_in_2);127 STAM_PROFILE_START(&pData->StatIOread, a); 128 STAM_COUNTER_RESET(&pData->StatIORead_in_1); 129 STAM_COUNTER_RESET(&pData->StatIORead_in_2); 130 130 131 131 QSOCKET_LOCK(tcb); … … 220 220 { 221 221 SOCKET_UNLOCK(so); 222 S LIRP_PROFILE_STOP(IOread, a);222 STAM_PROFILE_STOP(&pData->StatIOread, a); 223 223 return 0; 224 224 } … … 244 244 STAM_STATS( 245 245 if (n == 1) 246 { 246 { 247 247 STAM_COUNTER_INC(&pData->StatIORead_in_1); 248 248 STAM_COUNTER_ADD(&pData->StatIORead_in_1_bytes, nn); … … 274 274 if(ret > 0) 275 275 { 276 S LIRP_COUNTER_INC(IORead_in_2);277 S LIRP_COUNTER_ADD(IORead_in_2_2nd_bytes, ret);276 STAM_COUNTER_INC(&pData->StatIORead_in_2); 277 STAM_COUNTER_ADD(&pData->StatIORead_in_2_2nd_bytes, ret); 278 278 } 279 279 ); … … 401 401 struct iovec iov[2]; 402 402 403 S LIRP_PROFILE_START(IOwrite, a);404 S LIRP_COUNTER_RESET(IOWrite_in_1);405 S LIRP_COUNTER_RESET(IOWrite_in_1_bytes);406 S LIRP_COUNTER_RESET(IOWrite_in_2);407 S LIRP_COUNTER_RESET(IOWrite_in_2_1st_bytes);408 S LIRP_COUNTER_RESET(IOWrite_in_2_2nd_bytes);409 S LIRP_COUNTER_RESET(IOWrite_no_w);410 S LIRP_COUNTER_RESET(IOWrite_rest);411 S LIRP_COUNTER_RESET(IOWrite_rest_bytes);403 STAM_PROFILE_START(&pData->StatIOwrite, a); 404 STAM_COUNTER_RESET(&pData->StatIOWrite_in_1); 405 STAM_COUNTER_RESET(&pData->StatIOWrite_in_1_bytes); 406 STAM_COUNTER_RESET(&pData->StatIOWrite_in_2); 407 STAM_COUNTER_RESET(&pData->StatIOWrite_in_2_1st_bytes); 408 STAM_COUNTER_RESET(&pData->StatIOWrite_in_2_2nd_bytes); 409 STAM_COUNTER_RESET(&pData->StatIOWrite_no_w); 410 STAM_COUNTER_RESET(&pData->StatIOWrite_rest); 411 STAM_COUNTER_RESET(&pData->StatIOWrite_rest_bytes); 412 412 DEBUG_CALL("sowrite"); 413 413 DEBUG_ARG("so = %lx", (long)so); … … 462 462 } 463 463 STAM_STATS({ 464 if (n == 1) 465 { 466 S LIRP_COUNTER_INC(IOWrite_in_1);467 S LIRP_COUNTER_ADD(IOWrite_in_1_bytes, iov[0].iov_len);464 if (n == 1) 465 { 466 STAM_COUNTER_INC(&pData->StatIOWrite_in_1); 467 STAM_COUNTER_ADD(&pData->StatIOWrite_in_1_bytes, iov[0].iov_len); 468 468 } 469 469 else 470 470 { 471 S LIRP_COUNTER_INC(IOWrite_in_2);472 S LIRP_COUNTER_ADD(IOWrite_in_2_1st_bytes, iov[0].iov_len);473 S LIRP_COUNTER_ADD(IOWrite_in_2_2nd_bytes, iov[1].iov_len);471 STAM_COUNTER_INC(&pData->StatIOWrite_in_2); 472 STAM_COUNTER_ADD(&pData->StatIOWrite_in_2_1st_bytes, iov[0].iov_len); 473 STAM_COUNTER_ADD(&pData->StatIOWrite_in_2_2nd_bytes, iov[1].iov_len); 474 474 } 475 475 }); … … 510 510 if (ret > 0 && ret != iov[1].iov_len) 511 511 { 512 S LIRP_COUNTER_INC(IOWrite_rest);513 S LIRP_COUNTER_ADD(IOWrite_rest_bytes, (ret - iov[1].iov_len));512 STAM_COUNTER_INC(&pData->StatIOWrite_rest); 513 STAM_COUNTER_ADD(&pData->StatIOWrite_rest_bytes, (ret - iov[1].iov_len)); 514 514 } 515 515 }); … … 532 532 533 533 SOCKET_UNLOCK(so); 534 S LIRP_PROFILE_STOP(IOwrite, a);534 STAM_PROFILE_STOP(&pData->StatIOwrite, a); 535 535 return nn; 536 536 } … … 576 576 } 577 577 /* adjust both parameters to maks M_FREEROOM calculate correct */ 578 m_adj(m, if_maxlinkhdr + sizeof(struct udphdr) + sizeof(struct ip)); 578 m_adj(m, if_maxlinkhdr + sizeof(struct udphdr) + sizeof(struct ip)); 579 579 580 580 /* … … 635 635 so->so_expire = curtime + SO_EXPIRE; 636 636 } 637 /* 637 /* 638 638 * last argument should be changed if Slirp will inject IP attributes 639 639 * Note: Here we can't check if dnsproxy's sent initial request 640 640 */ 641 641 if (so->so_fport == htons(53)) 642 dnsproxy_answer(pData, so, m); 642 dnsproxy_answer(pData, so, m); 643 643 #endif 644 644 -
trunk/src/VBox/Devices/Network/slirp/tcp_input.c
r20453 r20712 79 79 struct socket *so = tp->t_socket; 80 80 int flags; 81 S LIRP_PROFILE_START(TCP_reassamble, tcp_reassamble);81 STAM_PROFILE_START(&pData->StatTCP_reassamble, tcp_reassamble); 82 82 83 83 /* … … 109 109 m_freem(pData, m); 110 110 *tlenp = 0; 111 S LIRP_PROFILE_STOP(TCP_reassamble, tcp_reassamble);111 STAM_PROFILE_STOP(&pData->StatTCP_reassamble, tcp_reassamble); 112 112 return (0); 113 113 } … … 123 123 m_freem(pData, m); 124 124 *tlenp = 0; 125 S LIRP_PROFILE_STOP(TCP_reassamble, tcp_reassamble);125 STAM_PROFILE_STOP(&pData->StatTCP_reassamble, tcp_reassamble); 126 126 return (0); 127 127 } … … 222 222 if (!TCPS_HAVEESTABLISHED(tp->t_state)) 223 223 { 224 S LIRP_PROFILE_STOP(TCP_reassamble, tcp_reassamble);224 STAM_PROFILE_STOP(&pData->StatTCP_reassamble, tcp_reassamble); 225 225 return (0); 226 226 } … … 228 228 if (!q || q->tqe_th->th_seq != tp->rcv_nxt) 229 229 { 230 S LIRP_PROFILE_STOP(TCP_reassamble, tcp_reassamble);230 STAM_PROFILE_STOP(&pData->StatTCP_reassamble, tcp_reassamble); 231 231 return (0); 232 232 } … … 247 247 { 248 248 if (tcp_emu(pData, so, q->tqe_m)) 249 sbappend(pData, so, q->tqe_m); 249 sbappend(pData, so, q->tqe_m); 250 250 } 251 251 else … … 259 259 while (q && q->tqe_th->th_seq == tp->rcv_nxt); 260 260 261 S LIRP_PROFILE_STOP(TCP_reassamble, tcp_reassamble);261 STAM_PROFILE_STOP(&pData->StatTCP_reassamble, tcp_reassamble); 262 262 return flags; 263 263 } … … 283 283 u_long tiwin; 284 284 /* int ts_present = 0; */ 285 S LIRP_PROFILE_START(TCP_input, counter_input);285 STAM_PROFILE_START(&pData->StatTCP_input, counter_input); 286 286 287 287 DEBUG_CALL("tcp_input"); 288 288 DEBUG_ARGS((dfd," m = %8lx iphlen = %2d inso = %lx\n", 289 289 (long )m, iphlen, (long )inso )); 290 291 if (inso != NULL) 292 { 290 291 if (inso != NULL) 292 { 293 293 QSOCKET_LOCK(tcb); 294 294 SOCKET_LOCK(inso); … … 314 314 /* mbuf should be cleared in sofree called from tcp_close */ 315 315 tcp_close(pData, tp); 316 S LIRP_PROFILE_STOP(TCP_input, counter_input);316 STAM_PROFILE_STOP(&pData->StatTCP_input, counter_input); 317 317 return; 318 318 } … … 431 431 struct socket *sonxt; 432 432 QSOCKET_UNLOCK(tcb); 433 /* @todo fix SOLOOKUP macrodefinition to be usable here */ 433 /* @todo fix SOLOOKUP macrodefinition to be usable here */ 434 434 #ifndef VBOX_WITH_SLIRP_MT 435 435 so = solookup(&tcb, ti->ti_src, ti->ti_sport, … … 437 437 #else 438 438 so = NULL; 439 QSOCKET_FOREACH(so, sonxt, tcp) 439 QSOCKET_FOREACH(so, sonxt, tcp) 440 440 /* { */ 441 441 if ( so->so_lport == ti->ti_sport … … 443 443 && so->so_faddr.s_addr == ti->ti_dst.s_addr 444 444 && so->so_fport == ti->ti_dport 445 && so->so_deleted != 1) 445 && so->so_deleted != 1) 446 446 { 447 447 break; /* so is locked here */ … … 458 458 } 459 459 ++tcpstat.tcps_socachemiss; 460 } 460 } 461 461 else 462 462 { … … 490 490 goto dropwithreset; 491 491 } 492 SOCKET_LOCK(so); 492 SOCKET_LOCK(so); 493 493 sbreserve(pData, &so->so_snd, tcp_sndspace); 494 494 sbreserve(pData, &so->so_rcv, tcp_rcvspace); … … 514 514 * or something else, we nuke it. 515 515 */ 516 if (so->so_state & SS_ISFCONNECTING) 516 if (so->so_state & SS_ISFCONNECTING) 517 517 { 518 518 goto drop; … … 649 649 650 650 SOCKET_UNLOCK(so); 651 S LIRP_PROFILE_STOP(TCP_input, counter_input);651 STAM_PROFILE_STOP(&pData->StatTCP_input, counter_input); 652 652 return; 653 653 } … … 695 695 tcp_output(pData, tp); 696 696 SOCKET_UNLOCK(so); 697 S LIRP_PROFILE_STOP(TCP_input, counter_input);697 STAM_PROFILE_STOP(&pData->StatTCP_input, counter_input); 698 698 return; 699 699 } … … 735 735 if (tiflags & TH_ACK) 736 736 goto dropwithreset; 737 if ((tiflags & TH_SYN) == 0) 737 if ((tiflags & TH_SYN) == 0) 738 738 { 739 739 goto drop; … … 795 795 } 796 796 SOCKET_UNLOCK(so); 797 S LIRP_PROFILE_STOP(TCP_input, counter_input);797 STAM_PROFILE_STOP(&pData->StatTCP_input, counter_input); 798 798 return; 799 799 … … 853 853 } 854 854 855 if ((tiflags & TH_SYN) == 0) 855 if ((tiflags & TH_SYN) == 0) 856 856 { 857 857 goto drop; … … 1076 1076 if ( ts_present 1077 1077 && SEQ_LEQ(ti->ti_seq, tp->last_ack_sent) 1078 && SEQ_LT(tp->last_ack_sent, ti->ti_seq + ti->ti_len + ((tiflags & (TH_SYN|TH_FIN)) != 0))) 1078 && SEQ_LT(tp->last_ack_sent, ti->ti_seq + ti->ti_len + ((tiflags & (TH_SYN|TH_FIN)) != 0))) 1079 1079 { 1080 1080 tp->ts_recent_age = tcp_now; … … 1131 1131 * If the ACK bit is off we drop the segment and return. 1132 1132 */ 1133 if ((tiflags & TH_ACK) == 0) 1133 if ((tiflags & TH_ACK) == 0) 1134 1134 { 1135 1135 goto drop; … … 1520 1520 if (so->so_state & SS_FCANTRCVMORE) 1521 1521 m_freem(pData, m); 1522 else 1523 { 1524 if (so->so_emu) 1522 else 1523 { 1524 if (so->so_emu) 1525 1525 { 1526 1526 if (tcp_emu(pData, so, m)) … … 1622 1622 1623 1623 SOCKET_UNLOCK(so); 1624 S LIRP_PROFILE_STOP(TCP_input, counter_input);1624 STAM_PROFILE_STOP(&pData->StatTCP_input, counter_input); 1625 1625 return; 1626 1626 … … 1637 1637 (void) tcp_output(pData, tp); 1638 1638 SOCKET_UNLOCK(so); 1639 S LIRP_PROFILE_STOP(TCP_input, counter_input);1639 STAM_PROFILE_STOP(&pData->StatTCP_input, counter_input); 1640 1640 return; 1641 1641 … … 1653 1653 if (so != &tcb) 1654 1654 SOCKET_UNLOCK(so); 1655 S LIRP_PROFILE_STOP(TCP_input, counter_input);1655 STAM_PROFILE_STOP(&pData->StatTCP_input, counter_input); 1656 1656 return; 1657 1657 … … 1663 1663 1664 1664 #ifdef VBOX_WITH_SLIRP_MT 1665 if (RTCritSectIsOwned(&so->so_mutex)) 1665 if (RTCritSectIsOwned(&so->so_mutex)) 1666 1666 { 1667 1667 SOCKET_UNLOCK(so); … … 1669 1669 #endif 1670 1670 1671 S LIRP_PROFILE_STOP(TCP_input, counter_input);1671 STAM_PROFILE_STOP(&pData->StatTCP_input, counter_input); 1672 1672 return; 1673 1673 }
Note:
See TracChangeset
for help on using the changeset viewer.