Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2962610ybi; Mon, 17 Jun 2019 13:35:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqxr6nIts3W/+vSddHfemzssJZ5Zv7JZG4SuRnFijFJIwsILdKm7pOpr/hUyY+AeHfgwqNcB X-Received: by 2002:a62:e308:: with SMTP id g8mr33257950pfh.162.1560803709855; Mon, 17 Jun 2019 13:35:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560803709; cv=none; d=google.com; s=arc-20160816; b=kkoKvwAxGiC283Eha1Ib/RcotYgbQtxJpZevX1rNCOdmx1yC2NjIPpXFzVcT4GrGyT u6q9q0Imim6Pa4LTL+WnuFxFtvLCR69Va5FQNaV3sS79MonRRsUIYaU4e0MPbH1rYibE 18bxkMJW0MA8EjbimBdvjLzK8PTntE5/q4NC9V8MViVMn+XwC/GdBXPfr6o0n2UuONJ/ pk7bddLuKtOqOOE4Zp4N92b86ojA6hCGqQhDxme+kKh9sbFjp4zDTtiyyDdbP3r2ONQv TK4O8cpxscxM8HqUhzXtf5ZEWF/kDqQIYfn0USADJdugsdqP/Dg3YTuteU9GA28rjssR uIZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=YHinsRb3Fx5Z5oLhdL6YkKtEqCBl8py/0KCdMZDdlwE=; b=yQTof9ihjFkbc9EL4QTRhh7WMidHJk9SDsqPA22uambdHa0trVlNobJNjSHdyKrooS dV0HTpr4HlveugEpdC7r3rTxXj9qOWT6bG9+IEY6aGAM/il0tSTmCEu8v/JjAMhaojMj BTT4GQtmG4FOGUT5/e/480f9Y9oHaq0ixgtv1esygRJ8oDEDrPlCv5hgxZBjn/gM1S0L Du/5nmmlc+iVexjTtN7UUoRFdMGvVY+8p8QilV6BuU52Sqwc/yAFGpknscqcoB9nDY2g wBamG/CVTcp/au39eNGeJ6RVZtSQiB4sxlFvRjZu/+ygzuhoxxUAnme8oqNXc3elOODl DUWA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a3si11023032pff.117.2019.06.17.13.34.54; Mon, 17 Jun 2019 13:35:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728577AbfFQUea (ORCPT + 99 others); Mon, 17 Jun 2019 16:34:30 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:37906 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725844AbfFQUe3 (ORCPT ); Mon, 17 Jun 2019 16:34:29 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 0231215110457; Mon, 17 Jun 2019 13:34:28 -0700 (PDT) Date: Mon, 17 Jun 2019 13:34:28 -0700 (PDT) Message-Id: <20190617.133428.1681715924857496492.davem@davemloft.net> To: xuechaojing@huawei.com Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, luoshaokai@huawei.com, cloud.wangxiaoyun@huawei.com, chiqijun@huawei.com, wulike1@huawei.com Subject: Re: [PATCH net-next v4 1/3] hinic: add rss support From: David Miller In-Reply-To: <20190617054601.3056-2-xuechaojing@huawei.com> References: <20190617054601.3056-1-xuechaojing@huawei.com> <20190617054601.3056-2-xuechaojing@huawei.com> X-Mailer: Mew version 6.8 on Emacs 26.1 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]); Mon, 17 Jun 2019 13:34:29 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xue Chaojing Date: Mon, 17 Jun 2019 05:45:59 +0000 > +static int hinic_rss_init(struct hinic_dev *nic_dev) > +{ > + u8 default_rss_key[HINIC_RSS_KEY_SIZE] = { 0 }; > + u32 indir_tbl[HINIC_RSS_INDIR_SIZE] = { 0 }; > + u8 tmpl_idx = nic_dev->rss_tmpl_idx; > + int err, i; > + > + netdev_rss_key_fill(default_rss_key, sizeof(default_rss_key)); Since netdev_rss_key_fill() fills the entire object, you don't need the variable initializer for default_rss_key here, please remove it. > +int hinic_rss_set_indir_tbl(struct hinic_dev *nic_dev, u32 tmpl_idx, > + const u32 *indir_table) > +{ > + for (i = 0; i < HINIC_RSS_INDIR_SIZE; i++) { > + indir_tbl->entry[i] = (u8)(*(indir_table + i)); Please index the array normally using "indir_table[i]", I also suspect the u8 cast is also unnecessary.