Discussion:
[CI] dropping XDR from ICS param attributes
Aneesh Kumar
2006-05-11 06:24:01 UTC
Permalink
Hi John and Brian,

What is the specific requirment of using XDR within ICS. ? I see
structures like pt_regs being encoded using ics directly. As per our
last discussion most of these structures are marked OOL. So with XDR
we encode them with XDR routines and out then as OOL data. But then if
all the nodes involved in clustering are of same endian do we need to
encode them using XDR routines ?

-aneesh
Aneesh Kumar
2006-05-11 13:38:33 UTC
Permalink
Post by Aneesh Kumar
Hi John and Brian,
What is the specific requirment of using XDR within ICS. ? I see
structures like pt_regs being encoded using ics directly. As per our
last discussion most of these structures are marked OOL. So with XDR
we encode them with XDR routines and out then as OOL data. But then if
all the nodes involved in clustering are of same endian do we need to
encode them using XDR routines ?
After looking at the code again i guess i understand what is
happening. For structures carrying pointers to another data type we
need the XDR param type.

I have dropped from the latest ICS code the openssirpcgen. I am right
now looking at NFS and understanding how to do the work the same way
they are doing.


-aneesh
Aneesh Kumar
2006-05-11 14:10:06 UTC
Permalink
Post by Aneesh Kumar
Post by Aneesh Kumar
Hi John and Brian,
What is the specific requirment of using XDR within ICS. ? I see
structures like pt_regs being encoded using ics directly. As per our
last discussion most of these structures are marked OOL. So with XDR
we encode them with XDR routines and out then as OOL data. But then if
all the nodes involved in clustering are of same endian do we need to
encode them using XDR routines ?
After looking at the code again i guess i understand what is
happening. For structures carrying pointers to another data type we
need the XDR param type.
I have dropped from the latest ICS code the openssirpcgen. I am right
now looking at NFS and understanding how to do the work the same way
they are doing.
How about doing it the below way

struct my_struct {
int a;
char *data;
}

cli_encode_xdr_struct_my_struct(cli_handle_t *handle, struct my_struct *p)
{
/* scalar type encode inline */
cli_encode_int(handle, p->a)
cli_encode_ool_data_t(handle, p->data, length_of_data, NULL, 0);
}



By carefully doing this way i guess we should be able to drop XDR and rpcgen


-aneesh
John Byrne
2006-05-11 15:11:01 UTC
Permalink
Post by Aneesh Kumar
Post by Aneesh Kumar
Post by Aneesh Kumar
Hi John and Brian,
What is the specific requirment of using XDR within ICS. ? I see
structures like pt_regs being encoded using ics directly. As per our
last discussion most of these structures are marked OOL. So with XDR
we encode them with XDR routines and out then as OOL data. But then if
all the nodes involved in clustering are of same endian do we need to
encode them using XDR routines ?
After looking at the code again i guess i understand what is
happening. For structures carrying pointers to another data type we
need the XDR param type.
I have dropped from the latest ICS code the openssirpcgen. I am right
now looking at NFS and understanding how to do the work the same way
they are doing.
How about doing it the below way
struct my_struct {
int a;
char *data;
}
cli_encode_xdr_struct_my_struct(cli_handle_t *handle, struct my_struct *p)
{
/* scalar type encode inline */
cli_encode_int(handle, p->a)
cli_encode_ool_data_t(handle, p->data, length_of_data, NULL, 0);
}
By carefully doing this way i guess we should be able to drop XDR and rpcgen
You certainly can. It can become painful for complex structures. You
don't necessarily have to encode the pointer data as ool, though. It
depends on the length. (There is a 300 byte limit on inline data.)

John
Post by Aneesh Kumar
-aneesh
John Byrne
2006-05-11 15:01:03 UTC
Permalink
Post by Aneesh Kumar
Post by Aneesh Kumar
Hi John and Brian,
What is the specific requirment of using XDR within ICS. ? I see
structures like pt_regs being encoded using ics directly. As per our
last discussion most of these structures are marked OOL. So with XDR
we encode them with XDR routines and out then as OOL data. But then if
all the nodes involved in clustering are of same endian do we need to
encode them using XDR routines ?
After looking at the code again i guess i understand what is
happening. For structures carrying pointers to another data type we
need the XDR param type.
You don't need it. XDR is just a convenient way of generating the glue
for a complex structure. You can always write the marshaling routines by
hand and drop the XDR.
Post by Aneesh Kumar
I have dropped from the latest ICS code the openssirpcgen. I am right
now looking at NFS and understanding how to do the work the same way
they are doing.
-aneesh
Loading...