@@ -590,10 +590,10 @@ static int parse_icmpv6(struct sk_buff *skb, struct sw_flow_key *key,
590590 * - skb->network_header: just past the Ethernet header, or just past the
591591 * VLAN header, to the first byte of the Ethernet payload.
592592 *
593- * - skb->transport_header: If key->dl_type is ETH_P_IP or ETH_P_IPV6
593+ * - skb->transport_header: If key->eth.type is ETH_P_IP or ETH_P_IPV6
594594 * on output, then just past the IP header, if one is present and
595595 * of a correct length, otherwise the same as skb->network_header.
596- * For other key->dl_type values it is left untouched.
596+ * For other key->eth.type values it is left untouched.
597597 */
598598int ovs_flow_extract (struct sk_buff * skb , u16 in_port , struct sw_flow_key * key ,
599599 int * key_lenp )
@@ -618,6 +618,9 @@ int ovs_flow_extract(struct sk_buff *skb, u16 in_port, struct sw_flow_key *key,
618618 memcpy (key -> eth .dst , eth -> h_dest , ETH_ALEN );
619619
620620 __skb_pull (skb , 2 * ETH_ALEN );
621+ /* We are going to push all headers that we pull, so no need to
622+ * update skb->csum here.
623+ */
621624
622625 if (vlan_tx_tag_present (skb ))
623626 key -> eth .tci = htons (skb -> vlan_tci );
@@ -1122,26 +1125,24 @@ int ovs_flow_from_nlattrs(struct sw_flow_key *swkey, int *key_lenp,
11221125
11231126/**
11241127 * ovs_flow_metadata_from_nlattrs - parses Netlink attributes into a flow key.
1125- * @priority: receives the skb priority
1126- * @mark: receives the skb mark
1127- * @in_port: receives the extracted input port.
1128- * @key: Netlink attribute holding nested %OVS_KEY_ATTR_* Netlink attribute
1128+ * @flow: Receives extracted in_port, priority, tun_key and skb_mark.
1129+ * @attr: Netlink attribute holding nested %OVS_KEY_ATTR_* Netlink attribute
11291130 * sequence.
11301131 *
11311132 * This parses a series of Netlink attributes that form a flow key, which must
11321133 * take the same form accepted by flow_from_nlattrs(), but only enough of it to
11331134 * get the metadata, that is, the parts of the flow key that cannot be
11341135 * extracted from the packet itself.
11351136 */
1136- int ovs_flow_metadata_from_nlattrs (u32 * priority , u32 * mark , u16 * in_port ,
1137- const struct nlattr * attr )
1137+ int ovs_flow_metadata_from_nlattrs (struct sw_flow * flow ,
1138+ const struct nlattr * attr )
11381139{
11391140 const struct nlattr * nla ;
11401141 int rem ;
11411142
1142- * in_port = DP_MAX_PORTS ;
1143- * priority = 0 ;
1144- * mark = 0 ;
1143+ flow -> key . phy . in_port = DP_MAX_PORTS ;
1144+ flow -> key . phy . priority = 0 ;
1145+ flow -> key . phy . skb_mark = 0 ;
11451146
11461147 nla_for_each_nested (nla , attr , rem ) {
11471148 int type = nla_type (nla );
@@ -1152,17 +1153,17 @@ int ovs_flow_metadata_from_nlattrs(u32 *priority, u32 *mark, u16 *in_port,
11521153
11531154 switch (type ) {
11541155 case OVS_KEY_ATTR_PRIORITY :
1155- * priority = nla_get_u32 (nla );
1156+ flow -> key . phy . priority = nla_get_u32 (nla );
11561157 break ;
11571158
11581159 case OVS_KEY_ATTR_IN_PORT :
11591160 if (nla_get_u32 (nla ) >= DP_MAX_PORTS )
11601161 return - EINVAL ;
1161- * in_port = nla_get_u32 (nla );
1162+ flow -> key . phy . in_port = nla_get_u32 (nla );
11621163 break ;
11631164
11641165 case OVS_KEY_ATTR_SKB_MARK :
1165- * mark = nla_get_u32 (nla );
1166+ flow -> key . phy . skb_mark = nla_get_u32 (nla );
11661167 break ;
11671168 }
11681169 }
0 commit comments