Hello,

I took the odd hour to look into this, and in big-endian this is broken:

lib/packet.h:
union flow_in_port {
    odp_port_t odp_port;
    ofp_port_t ofp_port;
};

I would propose to change this to something like:

#ifdef WORDS_BIGENDIAN
    #define LVALUE 1
#else
    #define LVALUE 0
#endif

union flow_in_port {
    odp_port_t odp_port;
    ofp_port_t ofp_port[2];
};


and access ofp_port with ofp_port[LVALUE].

This makes the following work in all cases:
(This was posted by Ben some time ago)

lib/match.c:

    if (wc->masks.in_port.odp_port == UINT32_MAX) {
        ds_put_format(s, "in_port=%"PRIu32",", f->in_port.odp_port);
    }
    else if (wc->masks.in_port.ofp_port[LVALUE]) {
        ds_put_cstr(s, "in_port=");
        ofputil_format_port(f->in_port.ofp_port[LVALUE], s);
        ds_put_char(s, ',');
    }

Unforunately this requires a larger number of changes
in the other files, and I haven't been able to find a less invasive
method, but I tested it and it works for little and big endian.

Cheers!

Dirk
_______________________________________________
discuss mailing list
discuss@openvswitch.org
http://openvswitch.org/mailman/listinfo/discuss

Reply via email to