All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 1/1] qlge: Fix netdev features configuration.
@ 2018-08-23 20:32 Manish Chopra
  2018-08-23 21:59 ` Chopra, Manish
  0 siblings, 1 reply; 4+ messages in thread
From: Manish Chopra @ 2018-08-23 20:32 UTC (permalink / raw)
  To: davem; +Cc: netdev, Dept-GELinuxNICDev, bpoirier

qlge_fix_features() is not supposed to modify hardware or
driver state, rather it is supposed to only fix requested
fetures bits. Currently qlge_fix_features() also goes for
interface down and up unnecessarily if there is not even
any change in features set.

This patch changes/fixes following -

1) Move reload of interface or device re-config from
   qlge_fix_features() to qlge_set_features().
2) Reload of interface in qlge_set_features() only if
   relevant feature bit (NETIF_F_HW_VLAN_CTAG_RX) is changed.
3) Get rid of qlge_fix_features() since driver is not really
   required to fix any features bit.

Signed-off-by: Manish <manish.chopra@cavium.com>
Reviewed-by: Benjamin Poirier <bpoirier@suse.com>
---
 drivers/net/ethernet/qlogic/qlge/qlge_main.c | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
index 353f1c1..059ba94 100644
--- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c
+++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
@@ -2384,26 +2384,20 @@ static int qlge_update_hw_vlan_features(struct net_device *ndev,
 	return status;
 }
 
-static netdev_features_t qlge_fix_features(struct net_device *ndev,
-	netdev_features_t features)
-{
-	int err;
-
-	/* Update the behavior of vlan accel in the adapter */
-	err = qlge_update_hw_vlan_features(ndev, features);
-	if (err)
-		return err;
-
-	return features;
-}
-
 static int qlge_set_features(struct net_device *ndev,
 	netdev_features_t features)
 {
 	netdev_features_t changed = ndev->features ^ features;
+	int err;
+
+	if (changed & NETIF_F_HW_VLAN_CTAG_RX) {
+		/* Update the behavior of vlan accel in the adapter */
+		err = qlge_update_hw_vlan_features(ndev, features);
+		if (err)
+			return err;
 
-	if (changed & NETIF_F_HW_VLAN_CTAG_RX)
 		qlge_vlan_mode(ndev, features);
+	}
 
 	return 0;
 }
@@ -4719,7 +4713,6 @@ static int ql_init_device(struct pci_dev *pdev, struct net_device *ndev,
 	.ndo_set_mac_address	= qlge_set_mac_address,
 	.ndo_validate_addr	= eth_validate_addr,
 	.ndo_tx_timeout		= qlge_tx_timeout,
-	.ndo_fix_features	= qlge_fix_features,
 	.ndo_set_features	= qlge_set_features,
 	.ndo_vlan_rx_add_vid	= qlge_vlan_rx_add_vid,
 	.ndo_vlan_rx_kill_vid	= qlge_vlan_rx_kill_vid,
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCH net 1/1] qlge: Fix netdev features configuration.
  2018-08-23 20:32 [PATCH net 1/1] qlge: Fix netdev features configuration Manish Chopra
@ 2018-08-23 21:59 ` Chopra, Manish
  0 siblings, 0 replies; 4+ messages in thread
From: Chopra, Manish @ 2018-08-23 21:59 UTC (permalink / raw)
  To: Chopra, Manish, davem; +Cc: netdev, Dept-GE Linux NIC Dev, bpoirier

> -----Original Message-----
> From: Manish Chopra <manish.chopra@cavium.com>
> Sent: Friday, August 24, 2018 2:02 AM
> To: davem@davemloft.net
> Cc: netdev@vger.kernel.org; Dept-GE Linux NIC Dev <Dept-
> GELinuxNICDev@cavium.com>; bpoirier@suse.com
> Subject: [PATCH net 1/1] qlge: Fix netdev features configuration.
> 
> qlge_fix_features() is not supposed to modify hardware or driver state,
> rather it is supposed to only fix requested fetures bits. Currently
> qlge_fix_features() also goes for interface down and up unnecessarily if there
> is not even any change in features set.
> 
> This patch changes/fixes following -
> 
> 1) Move reload of interface or device re-config from
>    qlge_fix_features() to qlge_set_features().
> 2) Reload of interface in qlge_set_features() only if
>    relevant feature bit (NETIF_F_HW_VLAN_CTAG_RX) is changed.
> 3) Get rid of qlge_fix_features() since driver is not really
>    required to fix any features bit.
> 
> Signed-off-by: Manish <manish.chopra@cavium.com>
> Reviewed-by: Benjamin Poirier <bpoirier@suse.com>
> ---
>  drivers/net/ethernet/qlogic/qlge/qlge_main.c | 23 ++++++++---------------
>  1 file changed, 8 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c
> b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
> index 353f1c1..059ba94 100644
> --- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c
> +++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
> @@ -2384,26 +2384,20 @@ static int qlge_update_hw_vlan_features(struct
> net_device *ndev,
>  	return status;
>  }
> 
> -static netdev_features_t qlge_fix_features(struct net_device *ndev,
> -	netdev_features_t features)
> -{
> -	int err;
> -
> -	/* Update the behavior of vlan accel in the adapter */
> -	err = qlge_update_hw_vlan_features(ndev, features);
> -	if (err)
> -		return err;
> -
> -	return features;
> -}
> -
>  static int qlge_set_features(struct net_device *ndev,
>  	netdev_features_t features)
>  {
>  	netdev_features_t changed = ndev->features ^ features;
> +	int err;
> +
> +	if (changed & NETIF_F_HW_VLAN_CTAG_RX) {
> +		/* Update the behavior of vlan accel in the adapter */
> +		err = qlge_update_hw_vlan_features(ndev, features);
> +		if (err)
> +			return err;
> 
> -	if (changed & NETIF_F_HW_VLAN_CTAG_RX)
>  		qlge_vlan_mode(ndev, features);
> +	}
> 
>  	return 0;
>  }
> @@ -4719,7 +4713,6 @@ static int ql_init_device(struct pci_dev *pdev,
> struct net_device *ndev,
>  	.ndo_set_mac_address	= qlge_set_mac_address,
>  	.ndo_validate_addr	= eth_validate_addr,
>  	.ndo_tx_timeout		= qlge_tx_timeout,
> -	.ndo_fix_features	= qlge_fix_features,
>  	.ndo_set_features	= qlge_set_features,
>  	.ndo_vlan_rx_add_vid	= qlge_vlan_rx_add_vid,
>  	.ndo_vlan_rx_kill_vid	= qlge_vlan_rx_kill_vid,
> --
> 1.8.3.1

Hello David,  Please ignore this patch and consider the previous same patch. By mistake it was submitted twice.

Thanks !!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net 1/1] qlge: Fix netdev features configuration.
  2018-08-23 20:20 Manish Chopra
@ 2018-08-26  0:38 ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2018-08-26  0:38 UTC (permalink / raw)
  To: manish.chopra; +Cc: netdev, Dept-GELinuxNICDev, bpoirier

From: Manish Chopra <manish.chopra@cavium.com>
Date: Thu, 23 Aug 2018 13:20:52 -0700

> qlge_fix_features() is not supposed to modify hardware or
> driver state, rather it is supposed to only fix requested
> fetures bits. Currently qlge_fix_features() also goes for
> interface down and up unnecessarily if there is not even
> any change in features set.
> 
> This patch changes/fixes following -
> 
> 1) Move reload of interface or device re-config from
>    qlge_fix_features() to qlge_set_features().
> 2) Reload of interface in qlge_set_features() only if
>    relevant feature bit (NETIF_F_HW_VLAN_CTAG_RX) is changed.
> 3) Get rid of qlge_fix_features() since driver is not really
>    required to fix any features bit.
> 
> Signed-off-by: Manish <manish.chopra@cavium.com>
> Reviewed-by: Benjamin Poirier <bpoirier@suse.com>

Applied and queued up for -stable.

Please provide a proper Fixes: tag next time.

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net 1/1] qlge: Fix netdev features configuration.
@ 2018-08-23 20:20 Manish Chopra
  2018-08-26  0:38 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Manish Chopra @ 2018-08-23 20:20 UTC (permalink / raw)
  To: davem; +Cc: netdev, Dept-GELinuxNICDev, bpoirier

qlge_fix_features() is not supposed to modify hardware or
driver state, rather it is supposed to only fix requested
fetures bits. Currently qlge_fix_features() also goes for
interface down and up unnecessarily if there is not even
any change in features set.

This patch changes/fixes following -

1) Move reload of interface or device re-config from
   qlge_fix_features() to qlge_set_features().
2) Reload of interface in qlge_set_features() only if
   relevant feature bit (NETIF_F_HW_VLAN_CTAG_RX) is changed.
3) Get rid of qlge_fix_features() since driver is not really
   required to fix any features bit.

Signed-off-by: Manish <manish.chopra@cavium.com>
Reviewed-by: Benjamin Poirier <bpoirier@suse.com>
---
 drivers/net/ethernet/qlogic/qlge/qlge_main.c | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
index 353f1c1..059ba94 100644
--- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c
+++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
@@ -2384,26 +2384,20 @@ static int qlge_update_hw_vlan_features(struct net_device *ndev,
 	return status;
 }
 
-static netdev_features_t qlge_fix_features(struct net_device *ndev,
-	netdev_features_t features)
-{
-	int err;
-
-	/* Update the behavior of vlan accel in the adapter */
-	err = qlge_update_hw_vlan_features(ndev, features);
-	if (err)
-		return err;
-
-	return features;
-}
-
 static int qlge_set_features(struct net_device *ndev,
 	netdev_features_t features)
 {
 	netdev_features_t changed = ndev->features ^ features;
+	int err;
+
+	if (changed & NETIF_F_HW_VLAN_CTAG_RX) {
+		/* Update the behavior of vlan accel in the adapter */
+		err = qlge_update_hw_vlan_features(ndev, features);
+		if (err)
+			return err;
 
-	if (changed & NETIF_F_HW_VLAN_CTAG_RX)
 		qlge_vlan_mode(ndev, features);
+	}
 
 	return 0;
 }
@@ -4719,7 +4713,6 @@ static int ql_init_device(struct pci_dev *pdev, struct net_device *ndev,
 	.ndo_set_mac_address	= qlge_set_mac_address,
 	.ndo_validate_addr	= eth_validate_addr,
 	.ndo_tx_timeout		= qlge_tx_timeout,
-	.ndo_fix_features	= qlge_fix_features,
 	.ndo_set_features	= qlge_set_features,
 	.ndo_vlan_rx_add_vid	= qlge_vlan_rx_add_vid,
 	.ndo_vlan_rx_kill_vid	= qlge_vlan_rx_kill_vid,
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-08-26  4:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-23 20:32 [PATCH net 1/1] qlge: Fix netdev features configuration Manish Chopra
2018-08-23 21:59 ` Chopra, Manish
  -- strict thread matches above, loose matches on Subject: below --
2018-08-23 20:20 Manish Chopra
2018-08-26  0:38 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.