From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cong Wang Subject: Re: [Patch net] mlx5: check for malformed packets Date: Mon, 3 Dec 2018 10:15:01 -0800 Message-ID: References: <20181201203837.3306-1-xiyou.wangcong@gmail.com> <955711f0-eb24-4512-c9a3-429bdad8bcad@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Linux Kernel Network Developers , Saeed Mahameed To: Tariq Toukan Return-path: Received: from mail-pg1-f195.google.com ([209.85.215.195]:45452 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726014AbeLCSPS (ORCPT ); Mon, 3 Dec 2018 13:15:18 -0500 Received: by mail-pg1-f195.google.com with SMTP id y4so6058619pgc.12 for ; Mon, 03 Dec 2018 10:15:14 -0800 (PST) In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Sun, Dec 2, 2018 at 9:11 PM Cong Wang wrote: > > On Sun, Dec 2, 2018 at 12:56 AM Tariq Toukan wrote: > > > > > + } else if (*proto == htons(ETH_P_IPV6)) { > > > > No need for an else here, the first if block always returns. > > > Yeah, but not sure if this makes a difference on the generated > asm code. I will give it a try anyway. I just tried, there is no difference on the generated assembly code. The gcc I use is: $ gcc --version gcc (GCC) 8.2.1 20181011 (Red Hat 8.2.1-4) Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Are you okay with the current code now? :)