X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=datapath%2Fflow.c;h=d30fb73fa21595a154112bdd527bd9ee51e20776;hb=2e4f5fcf3f5837de6805ccad58cd852a7cca595d;hp=1aa6e291bf903f7fdb690cee1dadf19521d9df67;hpb=b7a31ec13d0617868378d39a72beb4c4ffcb7e5c;p=openvswitch diff --git a/datapath/flow.c b/datapath/flow.c index 1aa6e291..d30fb73f 100644 --- a/datapath/flow.c +++ b/datapath/flow.c @@ -32,7 +32,7 @@ #include "compat.h" struct kmem_cache *flow_cache; -static unsigned int hash_seed; +static unsigned int hash_seed __read_mostly; static inline bool arphdr_ok(struct sk_buff *skb) { @@ -205,8 +205,7 @@ static void parse_vlan(struct sk_buff *skb, struct odp_flow_key *key) return; qp = (struct qtag_prefix *) skb->data; - key->dl_vlan = qp->tci & htons(VLAN_VID_MASK); - key->dl_vlan_pcp = (ntohs(qp->tci) & VLAN_PCP_MASK) >> VLAN_PCP_SHIFT; + key->dl_tci = qp->tci | htons(ODP_TCI_PRESENT); __skb_pull(skb, sizeof(struct qtag_prefix)); } @@ -247,6 +246,8 @@ static __be16 parse_ethertype(struct sk_buff *skb) * Ethernet header * @in_port: port number on which @skb was received. * @key: output flow key + * @is_frag: set to 1 if @skb contains an IPv4 fragment, or to 0 if @skb does + * not contain an IPv4 packet or if it is not a fragment. * * The caller must ensure that skb->len >= ETH_HLEN. * @@ -263,9 +264,6 @@ static __be16 parse_ethertype(struct sk_buff *skb) * past the IPv4 header, if one is present and of a correct length, * otherwise the same as skb->network_header. For other key->dl_type * values it is left untouched. - * - * Sets OVS_CB(skb)->is_frag to %true if @skb is an IPv4 fragment, otherwise to - * %false. */ int flow_extract(struct sk_buff *skb, u16 in_port, struct odp_flow_key *key, bool *is_frag) @@ -275,7 +273,6 @@ int flow_extract(struct sk_buff *skb, u16 in_port, struct odp_flow_key *key, memset(key, 0, sizeof *key); key->tun_id = OVS_CB(skb)->tun_id; key->in_port = in_port; - key->dl_vlan = htons(ODP_VLAN_NONE); *is_frag = false; /*