From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754518AbcCJIXh (ORCPT ); Thu, 10 Mar 2016 03:23:37 -0500 Received: from mga04.intel.com ([192.55.52.120]:62448 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751711AbcCJIX3 (ORCPT ); Thu, 10 Mar 2016 03:23:29 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,314,1455004800"; d="scan'208";a="930775562" Message-ID: <1457598253.1347.52.camel@linux.intel.com> Subject: Re: [patch net 2/2] net: hns: fixes a bug of RSS From: Andy Shevchenko To: Kejian Yan , davem@davemloft.net Cc: yisen.zhuang@huawei.com, salil.mehta@huawei.com, liguozhu@huawei.com, huangdaode@hisilicon.com, arnd@arndb.de, andrew@lunn.ch, chenny.xu@huawei.com, ivecera@redhat.com, lisheng011@huawei.com, fengguang.wu@intel.com, haifeng.wei@huawei.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxarm@huawei.com Date: Thu, 10 Mar 2016 10:24:13 +0200 In-Reply-To: <1457576189-22924-3-git-send-email-yankejian@huawei.com> References: <1457576189-22924-1-git-send-email-yankejian@huawei.com> <1457576189-22924-3-git-send-email-yankejian@huawei.com> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.1-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2016-03-10 at 10:16 +0800, Kejian Yan wrote: > If trying to get receive flow hash indirection table by ethtool, it > needs > to call .get_rxnfc to get ring number first. So this patch implements > the > .get_rxnfc of ethtool. And the data type of rss_indir_table is u32, > it has > to be multiply by the width of data type when using memcpy. +static int hns_get_rxnfc(struct net_device *netdev, > +  struct ethtool_rxnfc *cmd, > +  u32 *rule_locs) > +{ > + struct hns_nic_priv *priv = netdev_priv(netdev); > + int ret = 0; > + > + switch (cmd->cmd) { > + case ETHTOOL_GRXRINGS: > + cmd->data = priv->ae_handle->q_num; > + break; > + default: > + ret = -EOPNOTSUPP; > + break; > + } > + > + return ret; Redundant ret variable. switch (value) { case X:  break; default:  return -ERRNO; } return 0; > +} -- Andy Shevchenko Intel Finland Oy