<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        color:black;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        color:black;}
span.EmailStyle22
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle23
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle24
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>What value do you use for mintocopy? Do you call pcap_setmintocopy?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Have a nice day<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>GV<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> Anton Tremsin [mailto:ast@ssl.berkeley.edu] <br><b>Sent:</b> Friday, February 04, 2011 9:39 PM<br><b>To:</b> winpcap-users@winpcap.org<br><b>Cc:</b> Gianluca Varenni<br><b>Subject:</b> Re: [Winpcap-users] Delay receiving packets - wrong functionality ofpcap_setmintocopy()<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Gianluca,<br><br>Thanks a lot for helping me. I am in a dire situation since my detector really needs that problem to be solved before our experiments in couple of months time (need to do a lot of debugging and code writing after Winpcap issue is solved).<br><br>I am not loosing packets. Sorry if I made it confusing.<br><br>The packets always arrive into my C code (although Wireshark may loose them, maybe that was a confusion with packets being lost). I only need my C code to work right.  The rest of packets come only after the timeout. <br><br>I varied timeout from 1 ms to 20 sec and the effect is the same. With timeout 0 - the packets do not arrive until I push more packets into Chelsio card and these, in turn, push the once which were already in some buffer. <br><br>I am using Chelsio card, but Winpcap I downloaded from the official website (version 4.1.2). <br><br>The problem seems to be as if the function setmintocopy() does not work right and the driver decides by itself how much to buffer before sending it to me. One strange thing - the number of packets being delivered to me changes from time to time, however very often number 31 (31 packets, 8234 bytes each) arrive in a single chunk. Sometimes it is 62 packets, sometimes other numbers, e.g. 57. etc.<br><br>I will be very glad if someone ca advise something I can try to resolve that issue.<br><br>Thanks again,<br><br>Anton<br><br><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Anton,</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>You say that you are using a Chelsio board. Are you using the official version of WinPcap or Chelsio provided you with a custom one? What do you set as timeout and mintocopy?</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Have a nice day</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>GV</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><div><div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;border-color:-moz-use-text-color -moz-use-text-color'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> <a href="mailto:winpcap-users-bounces@winpcap.org">winpcap-users-bounces@winpcap.org</a> [<a href="mailto:winpcap-users-bounces@winpcap.org">mailto:winpcap-users-bounces@winpcap.org</a>] <b>On Behalf Of </b>Mark Pizzolato - WinPCap-Users<br><b>Sent:</b> Friday, January 28, 2011 11:57 AM<br><b>To:</b> <a href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org</a><br><b>Subject:</b> Re: [Winpcap-users] Delay receiving packets - wrong functionality ofpcap_setmintocopy()</span><o:p></o:p></p></div></div><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Ho Anton,</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>My first question to you would be:</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>WHY are you using WinPcap to receive UDP packets?</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>This sounds like a job for a winsock application….</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoListParagraph style='text-indent:-.25in'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Mark Pizzolato</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><div style='border:none;border-left:solid windowtext 1.5pt;padding:0in 0in 0in 4.0pt;border-color:-moz-use-text-color -moz-use-text-color -moz-use-text-color blue'><div><div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;border-color:-moz-use-text-color -moz-use-text-color'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> <a href="mailto:winpcap-users-bounces@winpcap.org">winpcap-users-bounces@winpcap.org</a> [<a href="mailto:winpcap-users-bounces@winpcap.org">mailto:winpcap-users-bounces@winpcap.org</a>] <b>On Behalf Of </b>Anton Tremsin<br><b>Sent:</b> Friday, January 28, 2011 11:50 AM<br><b>To:</b> <a href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org</a><br><b>Subject:</b> [Winpcap-users] Delay receiving packets - wrong functionality ofpcap_setmintocopy()</span><o:p></o:p></p></div></div><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>I hope someone can help my problem receiving packets in Windows7<br><br>I am sending data by UDP packets from an FPGA through 10GB card (Chelsio). Using VC++ 2010 to compile code to receive them. <br><br>All packets arrive, no losses seen, but the problem is with the proper <b>operation of pcap_setmintocopy() function.</b> <br><br><b>I send 64 packets with 8234 bytes each. Receiving them through pcp_next_ex() and I only get 31 packets (sometimes 62, sometimes 47, 50 packets) before the timeout occurs. After timeout the rest of the packets arrives. <br></b><br>I set the minimum amount of data in the kernel buffer that causes a read from the application to return (unless the timeout expires) to be 1 byte or it to be all 8234x64 bytes, no difference. Looks like the setmintocpy function has no effect on my kernel buffer to be copied to my application. If I send another set of 64 packets - data arrives into pcp_next_ex(), still only in lamp of 31 (62, 47,50) packets <br><br>That is a big problem for my application.<br><br><b>Is there anything I am doing wrong or need to change something in the system/driver to make setmintocopy function to operate properly?<br></b><br>Thanks a lot for your help, <br><br>Anton Tremsin<br><br><br><o:p></o:p></p><pre>-- <o:p></o:p></pre><pre> <o:p></o:p></pre><pre>Anton S. Tremsin, Ph.D.<o:p></o:p></pre><pre>Space Sciences Laboratory<o:p></o:p></pre><pre>University of California at Berkeley<o:p></o:p></pre><pre>Berkeley, CA 94720<o:p></o:p></pre><pre>Tel: (510) 642 4554<o:p></o:p></pre></div><pre><o:p> </o:p></pre><pre><o:p> </o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre>Winpcap-users mailing list<o:p></o:p></pre><pre><a href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org</a><o:p></o:p></pre><pre><a href="https://www.winpcap.org/mailman/listinfo/winpcap-users">https://www.winpcap.org/mailman/listinfo/winpcap-users</a><o:p></o:p></pre><pre>  <o:p></o:p></pre><p class=MsoNormal><o:p> </o:p></p></div></body></html>