[ovs-dev] [PATCH 1/1] flow: Fix parsing l3_ofs with partial offloading

Eli Britstein elibr at mellanox.com
Wed Jan 29 07:59:10 UTC 2020


ping

On 1/14/2020 3:21 PM, Eli Britstein wrote:
> l3_ofs should be set all Ethernet packets, not just IPv4/IPv6 ones.
> For example for ARP over VLAN tagged packets, it may cause wrong
> processing like in changing the VLAN ID action. Fix it.
>
> Fixes: aab96ec4d81e ("dpif-netdev: retrieve flow directly from the flow mark")
> Signed-off-by: Eli Britstein <elibr at mellanox.com>
> Reviewed-by: Roi Dayan <roid at mellanox.com>
> ---
>   lib/flow.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/lib/flow.c b/lib/flow.c
> index 45bb96b54..5c32b4a01 100644
> --- a/lib/flow.c
> +++ b/lib/flow.c
> @@ -1107,6 +1107,7 @@ parse_tcp_flags(struct dp_packet *packet)
>       if (OVS_UNLIKELY(eth_type_mpls(dl_type))) {
>           packet->l2_5_ofs = (char *)data - frame;
>       }
> +    packet->l3_ofs = (char *)data - frame;
>       if (OVS_LIKELY(dl_type == htons(ETH_TYPE_IP))) {
>           const struct ip_header *nh = data;
>           int ip_len;
> @@ -1116,7 +1117,6 @@ parse_tcp_flags(struct dp_packet *packet)
>               return 0;
>           }
>           dp_packet_set_l2_pad_size(packet, size - tot_len);
> -        packet->l3_ofs = (uint16_t)((char *)nh - frame);
>           nw_proto = nh->ip_proto;
>           nw_frag = ipv4_get_nw_frag(nh);
>   
> @@ -1129,7 +1129,6 @@ parse_tcp_flags(struct dp_packet *packet)
>           if (OVS_UNLIKELY(!ipv6_sanity_check(nh, size))) {
>               return 0;
>           }
> -        packet->l3_ofs = (uint16_t)((char *)nh - frame);
>           data_pull(&data, &size, sizeof *nh);
>   
>           plen = ntohs(nh->ip6_plen); /* Never pull padding. */


More information about the dev mailing list