From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752817AbcFOFlh (ORCPT ); Wed, 15 Jun 2016 01:41:37 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:54266 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752014AbcFOFlg (ORCPT ); Wed, 15 Jun 2016 01:41:36 -0400 Date: Tue, 14 Jun 2016 22:41:34 -0700 (PDT) Message-Id: <20160614.224134.743787632695474309.davem@davemloft.net> To: Yisen.Zhuang@huawei.com Cc: arnd@arndb.de, charles.chenxin@huawei.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linuxarm@huawei.com Subject: Re: [patch net-next] net: hns: add skb_reset_mac_header() after skb being alloc From: David Miller In-Reply-To: <1465821682-223053-1-git-send-email-Yisen.Zhuang@huawei.com> References: <1465821682-223053-1-git-send-email-Yisen.Zhuang@huawei.com> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Tue, 14 Jun 2016 22:41:35 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yisen Zhuang Date: Mon, 13 Jun 2016 20:41:22 +0800 > From: Kejian Yan > > HNS receives a packet without doing anything, but it should call > skb_reset_mac_header() to initialize the header before using > eth_hdr(). > > Fixes: 0d6b425a3773c3445b0f51b2f333821beaacb619 > Signed-off-by: Kejian Yan > Signed-off-by: Yisen Zhuang Well, this patch made me look at this function. You really shouldn't be filtering packets looped back, that is the stack's job. It shouldn't be happening in the driver. And once you remove that code, this patch here is no longer necessary. Second of all, unless you card supports every protocol that exists in the past, present, and _future_ you cannot set skb->ip_summed to CHECKSUM_UNNECSSARY unconditionally like that. You can only set that for protocols your chip actually supports.