Return-Path: Received: from mail-sn1nam01on0099.outbound.protection.outlook.com ([104.47.32.99]:27264 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965476AbeCSQCv (ORCPT ); Mon, 19 Mar 2018 12:02:51 -0400 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Arjun Vynipadath , Steve Wise , Ganesh Goudar , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 163/281] cxgb4: Fix netdev_features flag Date: Mon, 19 Mar 2018 16:01:06 +0000 Message-ID: <20180319155742.13731-163-alexander.levin@microsoft.com> References: <20180319155742.13731-1-alexander.levin@microsoft.com> In-Reply-To: <20180319155742.13731-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Arjun Vynipadath [ Upstream commit 90592b9a35836bacd34d92a3aba7958756b6a7c0 ] GRO is not supported by Chelsio HW when rx_csum is disabled. Update the netdev features flag when rx_csum is modified. Signed-off-by: Arjun Vynipadath Signed-off-by: Steve Wise Signed-off-by: Ganesh Goudar Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/= ethernet/chelsio/cxgb4/cxgb4_main.c index 0c2a32a305bc..3ec32d7c5866 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c @@ -2742,6 +2742,16 @@ static int cxgb_setup_tc(struct net_device *dev, u32= handle, __be16 proto, return -EOPNOTSUPP; } =20 +static netdev_features_t cxgb_fix_features(struct net_device *dev, + netdev_features_t features) +{ + /* Disable GRO, if RX_CSUM is disabled */ + if (!(features & NETIF_F_RXCSUM)) + features &=3D ~NETIF_F_GRO; + + return features; +} + static const struct net_device_ops cxgb4_netdev_ops =3D { .ndo_open =3D cxgb_open, .ndo_stop =3D cxgb_close, @@ -2766,6 +2776,7 @@ static const struct net_device_ops cxgb4_netdev_ops = =3D { #endif .ndo_set_tx_maxrate =3D cxgb_set_tx_maxrate, .ndo_setup_tc =3D cxgb_setup_tc, + .ndo_fix_features =3D cxgb_fix_features, }; =20 #ifdef CONFIG_PCI_IOV --=20 2.14.1