public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* UDP and e1000 : Simple test,  little bugs.
@ 2005-02-15 10:08 Vincent Roqueta
  2005-02-15 10:34 ` Vincent Roqueta
  2005-02-18  0:28 ` Ben Greear
  0 siblings, 2 replies; 3+ messages in thread
From: Vincent Roqueta @ 2005-02-15 10:08 UTC (permalink / raw)
  To: linux-kernel

Hello all,

I am working on NFS interoperabiity and I experiment some problems with UDP. 
The problem appear between the linux 2.6.10rc1 and 2.6.10rc2, and is still 
present in the last kernel (2.6.11rc3)

With NFSv3:
Client send a 32k file splited into 22 IP fragments. The problem is the server 
only receive 17 fragments.
More investigation tell me that the server reveive 17 fragments because the 
client only send 17  IP fragments.

As the NFS client code is exactly the same between the 2.6.10rc1 and 2.6.10rc2 
I tried to write a simple UDP client server, to be sure there is no relation 
between this bug and NFS.

Client create a buffer of X bytes and fill it with the 'A' symbol. Then it 
write it over a udp socket (sendto).
Server read the first 1024KB sent.

If X is <26000 the write is done with sucess.
Else it fail. (Typicaly for a 32KB size, as for NFS)

Network card is the intel e1000 ethernet card. I tried with rxpolling turned 
on and off. Bug doesnot appear in loopback.

Anyone interrested in that?

Vincent ROQUETA


/****************************************
 * Simple Client 
* Port : 9999
* argument 1 : buffer size to send
* argument 2 : server ip adress.
 ****************************************/
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdio.h>

int main (int argc, char * argv[])
{
    int sock;
    struct sockaddr_in name;
    int size;
    char *ip;
    
    
    size=atoi(argv[1]);    
    ip=argv[2];
    char DATA[size];

    
    sock = socket (AF_INET, SOCK_DGRAM, 0);
    if (sock < 0)
    {
        perror ("socket");
        return 1;
    }
    bzero (&name, sizeof (name));
    memset(DATA, 'A', sizeof(DATA));

    name.sin_family      = AF_INET;
    name.sin_addr.s_addr = inet_addr  (ip); 
    name.sin_port = htons(9999);

    fprintf(stdout, "client UDP, port: %d\n", ntohs(name.sin_port));

    if(sendto(sock,DATA,sizeof(DATA),0,(struct sockaddr 
*)&name,sizeof(name))<0)
    {
        perror("sendto");
        close(sock);
        return 1;
    }  close(sock);
    return 0;
}

/********************************************
* Simple server
* port 9999
********************************************/
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdio.h>

int main (int argc, char * argv[])
{
    int sock;
    size_t length;
    struct sockaddr_in name;
    char buf [1024];
    int nbr=0;
    while (1)
    {

        bzero (&name, sizeof (name));
        sock = socket (AF_INET, SOCK_DGRAM, 0);
        if (sock < 0)
        {
            perror ("socket");
            return 1;
        }

        name.sin_family      = AF_INET;
        name.sin_addr.s_addr = INADDR_ANY;  
        name.sin_port        = htons(9999);

        if (bind (sock, (struct sockaddr *)&name, sizeof (name)) < 0)
        {
            perror ("bind");
            close (sock);
            return 1;
        }
        if (getsockname (sock, (struct sockaddr *)&name, &length) < 0)
        {
            perror ("getsockname");
            close (sock);
            return 1;
        }

        printf ("Socket UDP  port #%d\n", ntohs (name.sin_port));
        nbr++;
        printf("read nb%d\n",nbr);
        if(read(sock, buf, 1024)<0)
        {
            perror ("read");
            close (sock);
            return 1;
        }

       printf ("%s", buf);

        printf("\n");
        close (sock);
    }

    return 0;
}

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: UDP and e1000 : Simple test,  little bugs.
  2005-02-15 10:08 UDP and e1000 : Simple test, little bugs Vincent Roqueta
@ 2005-02-15 10:34 ` Vincent Roqueta
  2005-02-18  0:28 ` Ben Greear
  1 sibling, 0 replies; 3+ messages in thread
From: Vincent Roqueta @ 2005-02-15 10:34 UTC (permalink / raw)
  To: linux-kernel


> Network card is the intel e1000 ethernet card. I tried with rxpolling
> turned on and off. Bug doesnot appear in loopback.
Compiling with the linux 2.6.10rc1 e1000 driver does not change anything. That 
may not come from the driver.

Vincent ROQUETA

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: UDP and e1000 : Simple test,  little bugs.
  2005-02-15 10:08 UDP and e1000 : Simple test, little bugs Vincent Roqueta
  2005-02-15 10:34 ` Vincent Roqueta
@ 2005-02-18  0:28 ` Ben Greear
  1 sibling, 0 replies; 3+ messages in thread
From: Ben Greear @ 2005-02-18  0:28 UTC (permalink / raw)
  To: Vincent Roqueta; +Cc: linux-kernel

Vincent Roqueta wrote:
> Hello all,
> 
> I am working on NFS interoperabiity and I experiment some problems with UDP. 
> The problem appear between the linux 2.6.10rc1 and 2.6.10rc2, and is still 
> present in the last kernel (2.6.11rc3)
> 
> With NFSv3:
> Client send a 32k file splited into 22 IP fragments. The problem is the server 
> only receive 17 fragments.
> More investigation tell me that the server reveive 17 fragments because the 
> client only send 17  IP fragments.
> 
> As the NFS client code is exactly the same between the 2.6.10rc1 and 2.6.10rc2 
> I tried to write a simple UDP client server, to be sure there is no relation 
> between this bug and NFS.
> 
> Client create a buffer of X bytes and fill it with the 'A' symbol. Then it 
> write it over a udp socket (sendto).
> Server read the first 1024KB sent.
> 
> If X is <26000 the write is done with sucess.
> Else it fail. (Typicaly for a 32KB size, as for NFS)

Try setting the socket send buffer size larger.  By default it's
quite small, and so it may not accept a large UDP frame.

Ben


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-02-18  0:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-15 10:08 UDP and e1000 : Simple test, little bugs Vincent Roqueta
2005-02-15 10:34 ` Vincent Roqueta
2005-02-18  0:28 ` Ben Greear

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox