Hi, Eder,

Ok, got it, thanks.



Regards,
Fengkai Li

From: Eder Leão Fernandes [mailto:[email protected]]
Sent: Friday, November 23, 2012 9:42 AM
To: Lifengkai
Cc: [email protected]; Yuqingsong; Dongwenxia; Linchengyong
Subject: Re: [openflow-discuss] One question about the open source of 
OpenVswitch from CPqD-of12softswitch-797b816

Hi,

The code is from an old version. The most recent doesn't reassign the m->header 
value. Please check at: 
https://github.com/CPqD/of12softswitch/blob/master/oflib/ofl-structs-unpack.c

Another thing. Please don't confuse CPqD software switch with Open 
vSwitch<http://openvswitch.org/>. Our switch is based on the Stanford OpenFlow 
1.0 software switch reference and is intended only for experimentation 
purposes, as it doesn't have Open vSwitch efficiency. (because all the 
processing goes on user space).

Best Regards,
Eder.



On 22 November 2012 23:13, Lifengkai 
<[email protected]<mailto:[email protected]>> wrote:
Hi, all

I do not know whether it is suitable to post it here, just wanting somebody who 
is familiar with the code to confirm it.

While I was reading the open source of OpenVswitch from 
"CPqD-of12softswitch-797b816", in the file ofl-structs-unpack.c, the following 
function:

static ofl_err
ofl_structs_oxm_match_unpack(struct ofp_match* src, uint8_t* buf, size_t *len, 
struct ofl_match **dst){

     int error = 0;
     struct ofpbuf *b = ofpbuf_new(0);
     struct ofl_match *m = (struct ofl_match *) malloc(sizeof(struct 
ofl_match));
     m->header.type = ntohs(src->type);
    *len -= ROUND_UP(ntohs(src->length),8); /* lifengkai, this is the length of 
the instructions */
     if(ntohs(src->length) > sizeof(struct ofp_match)){
              /* ofpbuf, buf to the oxm_fields, length of all the oxm_fields */
         ofpbuf_put(b, buf, ntohs(src->length) - (sizeof(struct ofp_match) -4));
         error = oxm_pull_match(b, m, ntohs(src->length) - (sizeof(struct 
ofp_match) -4));
         m->header.length = ntohs(src->length) - 4;
     }
    else m->header.length = 0;
    ofpbuf_delete(b);
    *dst = m;
    return error;
}

Why the header.length is reassigned to this value, as I see it has already been 
assigned in the function "parse_oxm_entry " for different cases, which is 
called deeper by "oxm_pull_match".
I think the m->header.length in the "ofl" datapath layer should not be the 
length of the "ofp" layer.

Of courcse, the OpenVswitch works well, as we have several test, we printed the 
value of m->header.length, it is the same as the src->length.



Regards,
Fengkai Li


_______________________________________________
openflow-discuss mailing list
[email protected]<mailto:[email protected]>
https://mailman.stanford.edu/mailman/listinfo/openflow-discuss



--
Eder Leão Fernandes

Bacharelado em Ciências de Computação
Instituto de Ciências Matemáticas e de Computação
Universidade de São Paulo
_______________________________________________
openflow-discuss mailing list
[email protected]
https://mailman.stanford.edu/mailman/listinfo/openflow-discuss

Reply via email to