From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH][net-next] net: slightly optimize eth_type_trans Date: Thu, 15 Nov 2018 15:11:31 -0800 (PST) Message-ID: <20181115.151131.596213640354724307.davem@davemloft.net> References: <1542072871-21208-1-git-send-email-lirongqing@baidu.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: lirongqing@baidu.com Return-path: Received: from shards.monkeyblade.net ([23.128.96.9]:49106 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725860AbeKPJVY (ORCPT ); Fri, 16 Nov 2018 04:21:24 -0500 In-Reply-To: <1542072871-21208-1-git-send-email-lirongqing@baidu.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Li RongQing Date: Tue, 13 Nov 2018 09:34:31 +0800 > netperf udp stream shows that eth_type_trans takes certain cpu, > so adjust the mac address check order, and firstly check if it > is device address, and only check if it is multicast address > only if not the device address. > > After this change: > To unicast, and skb dst mac is device mac, this is most of time > reduce a comparision > To unicast, and skb dst mac is not device mac, nothing change > To multicast, increase a comparision > > Before: > 1.03% [kernel] [k] eth_type_trans > > After: > 0.78% [kernel] [k] eth_type_trans > > Signed-off-by: Zhang Yu > Signed-off-by: Li RongQing Applied.