[rds-devel] Trying out RDS

Carl Yang (caryang) caryang at cisco.com
Mon Nov 6 10:43:02 PST 2006


Yep.  That seems to help and I got further with the test.

Now, the problem is with my client program.  All the socket connection
seems to be OK.  When I called sendto(), I got the following message
"rds_sendmsg: invalid socket control block."  I checked out the code in
file rds_send.c and this error only shows up if (1) port control block
is NULL or the control block magic number does not match - 

        /* get port control block */
        cb = (struct rds_cb*)sk->sk_user_data;

        if (!cb || cb->magic != RDS_MAGIC_CB) {
                printk("rds_sendmsg: invalid socket control block\n");
                return -EAGAIN;
        }

Any ideas?

Regards,
Carl

My client code attached -

int main(int argc, char *argv[])
{
   int sock, length, n;
   struct sockaddr_in server, from;
   struct hostent *hp;
   char buffer[256];

   if (argc != 3) { printf("Usage: server port\n");
                    exit(1);
   }
   sock= socket(AF_INET_OFFLOAD, SOCK_DGRAM, 0);
   if (sock < 0) error("socket");

   server.sin_family = AF_INET_OFFLOAD;
   hp = gethostbyname(argv[1]);
   if (hp==0) error("Unknown host");

   bcopy((char *)hp->h_addr,
        (char *)&server.sin_addr,
         hp->h_length);
   server.sin_port = htons(atoi(argv[2]));
   length=sizeof(struct sockaddr_in);
   printf("Please enter the message: ");
   bzero(buffer,256);
   fgets(buffer,255,stdin);
   n=sendto(sock,buffer,
            strlen(buffer),0,&server,length);
   if (n < 0) error("Sendto");
} 

-----Original Message-----
From: Vladimir Sokolovsky [mailto:vlad at dev.mellanox.co.il] 
Sent: Monday, November 06, 2006 8:29 AM
To: Carl Yang (caryang)
Cc: rds-devel at oss.oracle.com
Subject: Re: [rds-devel] Trying out RDS

Hello Carl,
Try to use AF_INET_OFFLOAD instead of AF_INET as a parameter to socket
call.

#define AF_INET_OFFLOAD 30
#define NF_INET_OFFLOAD 30

Note:
The Oracle RDS from http://oss.oracle.com/projects/rds/src/trunk has the
different API.
See an example http://oss.oracle.com/projects/rds-tools/src/trunk
and the README file: 
http://oss.oracle.com/projects/rds/dist/documentation/rds.7.txt

Regards,
Vladimir

Carl Yang (caryang) wrote:
> All,
>  
> I am using 2.6.9-42.ELsmp kernel, which comes with IB support (include

> RDS).  I enabled loading RDS module in /etc/sysconfig/openib.conf and 
> rebooted the system.  I then checked that ib_rds has been successfully

> loaded with lsmod.  I then wrote a simple UDP program and substitute 
> AF_INET with 21 in the socket() call.  When I ran the program, I got 
> the following message: "Opening socket: Address family not supported 
> by protocol."
>  
> What did I miss?
>  
> Regards,
> Carl
>  
>  
> ----------------------------------------------------------------------
> --
>
> _______________________________________________
> rds-devel mailing list
> rds-devel at oss.oracle.com
> http://oss.oracle.com/mailman/listinfo/rds-devel
>   



More information about the rds-devel mailing list