mirror of
https://github.com/openvswitch/ovs
synced 2025-10-17 14:28:02 +00:00
datapath: Convert odp_flow_key to use Netlink attributes instead.
One of the goals for Open vSwitch is to decouple kernel and userspace software, so that either one can be upgraded or rolled back independent of the other. To do this in full generality, it must be possible to change the kernel's idea of the flow key separately from the userspace version. In turn, that means that flow keys must become variable-length. This commit makes that change using Netlink attribute sequences. This commit does not actually make userspace flexible enough to handle changes in the kernel flow key structure, because userspace doesn't yet have enough information to do that intelligently. Upcoming commits will fix that. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
This commit is contained in:
@@ -101,12 +101,12 @@ parse_ethertype(struct ofpbuf *b)
|
||||
ovs_be16 proto;
|
||||
|
||||
proto = *(ovs_be16 *) ofpbuf_pull(b, sizeof proto);
|
||||
if (ntohs(proto) >= ODP_DL_TYPE_ETH2_CUTOFF) {
|
||||
if (ntohs(proto) >= ETH_TYPE_MIN) {
|
||||
return proto;
|
||||
}
|
||||
|
||||
if (b->size < sizeof *llc) {
|
||||
return htons(ODP_DL_TYPE_NOT_ETH_TYPE);
|
||||
return htons(FLOW_DL_TYPE_NONE);
|
||||
}
|
||||
|
||||
llc = b->data;
|
||||
@@ -115,7 +115,7 @@ parse_ethertype(struct ofpbuf *b)
|
||||
|| llc->llc.llc_cntl != LLC_CNTL_SNAP
|
||||
|| memcmp(llc->snap.snap_org, SNAP_ORG_ETHERNET,
|
||||
sizeof llc->snap.snap_org)) {
|
||||
return htons(ODP_DL_TYPE_NOT_ETH_TYPE);
|
||||
return htons(FLOW_DL_TYPE_NONE);
|
||||
}
|
||||
|
||||
ofpbuf_pull(b, sizeof *llc);
|
||||
|
Reference in New Issue
Block a user