From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 9E8DCDE3 for ; Mon, 18 Sep 2017 15:11:34 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Sep 2017 06:11:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,412,1500966000"; d="scan'208";a="312910475" Received: from dwdohert-mobl.ger.corp.intel.com (HELO [163.33.228.187]) ([163.33.228.187]) by fmsmga004.fm.intel.com with ESMTP; 18 Sep 2017 06:11:23 -0700 To: zengganghui , "dev@dpdk.org" References: <1504064774-6340-1-git-send-email-zengganghui@huawei.com> <8ae48210-7291-7ee5-a17c-c82f9ed116cd@intel.com> <7683DD995282C14797C50C5AB01DF6D6B8C010@DGGEMA504-MBX.china.huawei.com> <2cbd474d-6505-9188-97ae-476a5edb16ef@intel.com> <7683DD995282C14797C50C5AB01DF6D6B8D124@DGGEMA504-MBX.china.huawei.com> From: "Doherty, Declan" Message-ID: <029f043f-7e7d-e638-d718-c61e34100e56@intel.com> Date: Mon, 18 Sep 2017 14:11:23 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <7683DD995282C14797C50C5AB01DF6D6B8D124@DGGEMA504-MBX.china.huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] net/bonding: strengthen the judgment of lacp packets X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Sep 2017 13:11:35 -0000 On 18/09/2017 1:50 PM, zengganghui wrote: > All mbuf packets have been init to zero when pktmbuf pool create. So judgment this flag is safe, whether or not support VLAN stripping. Ok, but is there any need to check the ol_flags for PKT_RX_VLAN_PKT or check the vlan_tci at all. I haven't come across anything in the specification which allows LACP links to be formed on top of VLANs but I may be missing something? So if the ethertype is not ETHER_TYPE_SLOW it is irrelevant whether the packet has a VLAN tag or not. Also on the basis that you could have LAG groups on top of VLANs, if the NIC doesn't support VLAN stripping/insertion then we would miss all the ingress LACP PDU at the moment now anyway, since the ethertype would be VLAN and not ETHER_TYPE_SLOW, so is_lacp_packet() would always return 0, and we would also fail to encapsulate the LACP PDU in the correct VLAN on egress as that isn't supported in the bonding implementation. > > BR. > Zeng Ganghui > Huawei Technologies Co., Ltd. > > -----Original Message----- > From: Doherty, Declan [mailto:declan.doherty@intel.com] > Sent: Monday, September 18, 2017 8:34 PM > To: zengganghui; dev@dpdk.org > Subject: Re: [PATCH] net/bonding: strengthen the judgment of lacp packets > > On 18/09/2017 12:12 PM, zengganghui wrote: >> For example, when packets received from an MLX network card, the value of mbuf->vlan_tci is a random value. So that this value cannot be used to determine whether VLAN packets . We need to judgment mbuf->ol_flags first. >> >> BR. >> Zeng Ganghui >> Huawei Technologies Co., Ltd. >> >> -----Original Message----- >> From: Doherty, Declan [mailto:declan.doherty@intel.com] >> Sent: Monday, September 18, 2017 5:14 PM >> To: zengganghui; dev@dpdk.org >> Subject: Re: [PATCH] net/bonding: strengthen the judgment of lacp >> packets >> >> On 30/08/2017 4:46 AM, ZengGanghui wrote: >>> When the nic does not support vlan rx offload may be wrong, resulting >>> in lacp packets will not be processed. >>> >>> Signed-off-by: ZengGanghui >>> --- >> ... >>> >> >> Acked-by: Declan Doherty >> > > Ok, I see your point. A LACP PDU can't be encapsulated in a VLAN packet anyway, as it is link local traffic. So a check for ol_flags & PKT_RX_VLAN_PKT != 0 should be sufficient, otherwise if the PKT_RX_VLAN_PKT flag is true the packet cannot be link local and therefore a LACP PDU. I think that it's safe to assume all PMDs must set this flag if VLAN stripping is enabled? >