Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759963AbbKTOHb (ORCPT ); Fri, 20 Nov 2015 09:07:31 -0500 Received: from mail-lb0-f180.google.com ([209.85.217.180]:32824 "EHLO mail-lb0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759849AbbKTOHW (ORCPT ); Fri, 20 Nov 2015 09:07:22 -0500 Subject: Re: [PATCH V3 net-next 4/5] net:hns: Add support of ethtool TSO set option for Hip06 in HNS To: Salil Mehta , davem@davemloft.net, robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, paul.gortmaker@windriver.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, catalin.marinas@arm.com, will.deacon@arm.com, arnd@arndb.de, liguozhu@hisilicon.com, yisen.zhuang@huawei.com, dingtianhong@huawei.com, zhangfei.gao@linaro.org, huangdaode@hisilicon.com, kenneth-lee-2012@foxmail.com, mehta.salil.lnk@gmail.com, xuwei5@hisilicon.com, lisheng011@huawei.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linuxarm@huawei.com References: <1447966706-16219-1-git-send-email-salil.mehta@huawei.com> <1447966706-16219-5-git-send-email-salil.mehta@huawei.com> From: Sergei Shtylyov Message-ID: <564F2915.1090507@cogentembedded.com> Date: Fri, 20 Nov 2015 17:07:17 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1447966706-16219-5-git-send-email-salil.mehta@huawei.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2675 Lines: 93 On 11/19/2015 11:58 PM, Salil Mehta wrote: > From: Salil > > This patch adds the support of ethtool TSO option to V1 patch, > meant to add support of Hip06 SoC to HNS > > Signed-off-by: Salil Mehta > Signed-off-by: lisheng > --- > drivers/net/ethernet/hisilicon/hns/hns_enet.c | 47 +++++++++++++++++++++++++ > 1 file changed, 47 insertions(+) > > diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c > index 055e14c..a0763ab 100644 > --- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c > +++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c > @@ -1386,6 +1386,51 @@ static int hns_nic_change_mtu(struct net_device *ndev, int new_mtu) > return ret; > } > > +static int hns_nic_set_features(struct net_device *netdev, > + netdev_features_t features) > +{ > + struct hns_nic_priv *priv = netdev_priv(netdev); > + struct hnae_handle *h = priv->ae_handle; > + > + switch (priv->enet_ver) { > + case AE_VERSION_1: > + if ((features & NETIF_F_TSO) || (features & NETIF_F_TSO6)) if ((features & (NETIF_F_TSO| NETIF_F_TSO6)) > + netdev_info(netdev, "enet v1 do not support tso!\n"); > + break; The *break* should have the same indentation level as *if*. > + default: > + if ((features & NETIF_F_TSO) || (features & NETIF_F_TSO6)) { if ((features & (NETIF_F_TSO| NETIF_F_TSO6)) > + priv->ops.fill_desc = fill_tso_desc; > + priv->ops.maybe_stop_tx = hns_nic_maybe_stop_tso; > + /* The chip only support 7*4096 */ > + netif_set_gso_max_size(netdev, 7 * 4096); > + h->dev->ops->set_tso_stats(h, 1); > + } else { > + priv->ops.fill_desc = fill_v2_desc; > + priv->ops.maybe_stop_tx = hns_nic_maybe_stop_tx; > + h->dev->ops->set_tso_stats(h, 0); > + } > + break; Same here. > + } > + netdev->features = features; > + return 0; > +} > + > +static netdev_features_t hns_nic_fix_features( > + struct net_device *netdev, netdev_features_t features) > +{ > + struct hns_nic_priv *priv = netdev_priv(netdev); > + > + switch (priv->enet_ver) { > + case AE_VERSION_1: > + features &= ~(NETIF_F_TSO | NETIF_F_TSO6 | > + NETIF_F_HW_VLAN_CTAG_FILTER); > + break; > + default: > + break; > + } Here it's indented correctly. > + return features; > +} > + > /** > * nic_set_multicast_list - set mutl mac address > * @netdev: net device [...] MBR, Sergei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/