Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934610AbdC3SrM (ORCPT ); Thu, 30 Mar 2017 14:47:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55264 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933891AbdC3SrK (ORCPT ); Thu, 30 Mar 2017 14:47:10 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5803B41A24 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jbenc@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 5803B41A24 Date: Thu, 30 Mar 2017 20:47:06 +0200 From: Jiri Benc To: Yi-Hung Wei Cc: Joe Stringer , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] openvswitch: Fix ovs_flow_key_update() Message-ID: <20170330204706.64616842@griffin> In-Reply-To: References: <1490832850-6012-1-git-send-email-yihung.wei@gmail.com> <20170330152215.7b4f9703@griffin> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 30 Mar 2017 18:47:09 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 619 Lines: 16 On Thu, 30 Mar 2017 11:39:35 -0700, Yi-Hung Wei wrote: > If we invalidate a flow key of a L3 packet, the flow's mac_proto is like this > (MAC_PROTO_NONE | SW_FLOW_KEY_INVALID), then key_extract() will > process the link layer of this L3 packet since mac_proto !=MAC_PROTO_NONE? > > In this case, shall we update key_extract() like this > static int key_extract(struct sk_buff *skb, struct sw_flow_key *key) > > /* Link layer. */ > clear_vlan(key); > - if (key->mac_proto == MAC_PROTO_NONE) { > + if (key->mac_proto & MAC_PROTO_NONE) { Use ovs_key_mac_proto(key) == MAC_PROTO_NONE. Jiri