All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] Misc. fixes for hns3 driver
@ 2021-04-03  1:35 Salil Mehta
  2021-04-03  1:35 ` [PATCH net 1/2] net: hns3: Remove the left over redundant check & assignment Salil Mehta
  2021-04-03  1:35 ` [PATCH net 2/2] net: hns3: Remove un-necessary 'else-if' in the hclge_reset_event() Salil Mehta
  0 siblings, 2 replies; 7+ messages in thread
From: Salil Mehta @ 2021-04-03  1:35 UTC (permalink / raw)
  To: davem, kuba; +Cc: salil.mehta, netdev, linux-kernel, linuxarm, linuxarm

Fixes for the miscellaneous problems found during the review of the code.

Salil Mehta (2):
  net: hns3: Remove the left over redundant check & assignment
  net: hns3: Remove un-necessary 'else-if' in the hclge_reset_event()

 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.17.1


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

* [PATCH net 1/2] net: hns3: Remove the left over redundant check & assignment
  2021-04-03  1:35 [PATCH net 0/2] Misc. fixes for hns3 driver Salil Mehta
@ 2021-04-03  1:35 ` Salil Mehta
  2021-04-04  6:25   ` Leon Romanovsky
  2021-04-03  1:35 ` [PATCH net 2/2] net: hns3: Remove un-necessary 'else-if' in the hclge_reset_event() Salil Mehta
  1 sibling, 1 reply; 7+ messages in thread
From: Salil Mehta @ 2021-04-03  1:35 UTC (permalink / raw)
  To: davem, kuba; +Cc: salil.mehta, netdev, linux-kernel, linuxarm, linuxarm

This removes the left over check and assignment which is no longer used
anywhere in the function and should have been removed as part of the
below mentioned patch.

Fixes: 012fcb52f67c ("net: hns3: activate reset timer when calling reset_event")
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index e3f81c7e0ce7..7ad0722383f5 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -3976,8 +3976,6 @@ static void hclge_reset_event(struct pci_dev *pdev, struct hnae3_handle *handle)
 	 * want to make sure we throttle the reset request. Therefore, we will
 	 * not allow it again before 3*HZ times.
 	 */
-	if (!handle)
-		handle = &hdev->vport[0].nic;
 
 	if (time_before(jiffies, (hdev->last_reset_time +
 				  HCLGE_RESET_INTERVAL))) {
-- 
2.17.1


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

* [PATCH net 2/2] net: hns3: Remove un-necessary 'else-if' in the hclge_reset_event()
  2021-04-03  1:35 [PATCH net 0/2] Misc. fixes for hns3 driver Salil Mehta
  2021-04-03  1:35 ` [PATCH net 1/2] net: hns3: Remove the left over redundant check & assignment Salil Mehta
@ 2021-04-03  1:35 ` Salil Mehta
  1 sibling, 0 replies; 7+ messages in thread
From: Salil Mehta @ 2021-04-03  1:35 UTC (permalink / raw)
  To: davem, kuba; +Cc: salil.mehta, netdev, linux-kernel, linuxarm, linuxarm

Code to defer the reset(which caps the frequency of the reset) schedules the
timer and returns. Hence, following 'else-if' looks un-necessary.

Fixes: 9de0b86f6444 ("net: hns3: Prevent to request reset frequently")
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 7ad0722383f5..2ed464e13d1b 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -3981,7 +3981,9 @@ static void hclge_reset_event(struct pci_dev *pdev, struct hnae3_handle *handle)
 				  HCLGE_RESET_INTERVAL))) {
 		mod_timer(&hdev->reset_timer, jiffies + HCLGE_RESET_INTERVAL);
 		return;
-	} else if (hdev->default_reset_request) {
+	}
+
+	if (hdev->default_reset_request) {
 		hdev->reset_level =
 			hclge_get_reset_level(ae_dev,
 					      &hdev->default_reset_request);
-- 
2.17.1


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

* Re: [PATCH net 1/2] net: hns3: Remove the left over redundant check & assignment
  2021-04-03  1:35 ` [PATCH net 1/2] net: hns3: Remove the left over redundant check & assignment Salil Mehta
@ 2021-04-04  6:25   ` Leon Romanovsky
  2021-04-05 12:26     ` Salil Mehta
  0 siblings, 1 reply; 7+ messages in thread
From: Leon Romanovsky @ 2021-04-04  6:25 UTC (permalink / raw)
  To: Salil Mehta; +Cc: davem, kuba, netdev, linux-kernel, linuxarm, linuxarm

On Sat, Apr 03, 2021 at 02:35:19AM +0100, Salil Mehta wrote:
> This removes the left over check and assignment which is no longer used
> anywhere in the function and should have been removed as part of the
> below mentioned patch.
> 
> Fixes: 012fcb52f67c ("net: hns3: activate reset timer when calling reset_event")
> Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
> ---
>  drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> index e3f81c7e0ce7..7ad0722383f5 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> @@ -3976,8 +3976,6 @@ static void hclge_reset_event(struct pci_dev *pdev, struct hnae3_handle *handle)
>  	 * want to make sure we throttle the reset request. Therefore, we will
>  	 * not allow it again before 3*HZ times.
>  	 */
> -	if (!handle)
> -		handle = &hdev->vport[0].nic;

The comment above should be updated too, and probably the signature of
hclge_reset_event() worth to be changed.

Thanks

>  
>  	if (time_before(jiffies, (hdev->last_reset_time +
>  				  HCLGE_RESET_INTERVAL))) {
> -- 
> 2.17.1
> 

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

* RE: [PATCH net 1/2] net: hns3: Remove the left over redundant check & assignment
  2021-04-04  6:25   ` Leon Romanovsky
@ 2021-04-05 12:26     ` Salil Mehta
  2021-04-05 12:43       ` Leon Romanovsky
  0 siblings, 1 reply; 7+ messages in thread
From: Salil Mehta @ 2021-04-05 12:26 UTC (permalink / raw)
  To: Leon Romanovsky; +Cc: davem, kuba, netdev, linux-kernel, Linuxarm, linuxarm

Hi Leon,
Thanks for the review.

> From: Leon Romanovsky [mailto:leon@kernel.org]
> Sent: Sunday, April 4, 2021 7:26 AM
> To: Salil Mehta <salil.mehta@huawei.com>
> Cc: davem@davemloft.net; kuba@kernel.org; netdev@vger.kernel.org;
> linux-kernel@vger.kernel.org; Linuxarm <linuxarm@huawei.com>;
> linuxarm@openeuler.org
> Subject: Re: [PATCH net 1/2] net: hns3: Remove the left over redundant check
> & assignment
> 
> On Sat, Apr 03, 2021 at 02:35:19AM +0100, Salil Mehta wrote:
> > This removes the left over check and assignment which is no longer used
> > anywhere in the function and should have been removed as part of the
> > below mentioned patch.
> >
> > Fixes: 012fcb52f67c ("net: hns3: activate reset timer when calling
> reset_event")
> > Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
> > ---
> >  drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 --
> >  1 file changed, 2 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> > index e3f81c7e0ce7..7ad0722383f5 100644
> > --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> > +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> > @@ -3976,8 +3976,6 @@ static void hclge_reset_event(struct pci_dev *pdev,
> struct hnae3_handle *handle)
> >  	 * want to make sure we throttle the reset request. Therefore, we will
> >  	 * not allow it again before 3*HZ times.
> >  	 */
> > -	if (!handle)
> > -		handle = &hdev->vport[0].nic;
> 
> The comment above should be updated too, and probably the signature of
> hclge_reset_event() worth to be changed.


Yes, true. Both the comment and the prototype will be updated in near future.
I can assure you this did not go un-noticed during the change. There are
some internal subtleties which I am trying to sort out. Those might come
as part of different patch-set which deals with other related changes as well.

The current change(and some other) will pave the way for necessary refactoring
Of the code being done.


> 
> Thanks
> 
> >
> >  	if (time_before(jiffies, (hdev->last_reset_time +
> >  				  HCLGE_RESET_INTERVAL))) {
> > --
> > 2.17.1
> >

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

* Re: [PATCH net 1/2] net: hns3: Remove the left over redundant check & assignment
  2021-04-05 12:26     ` Salil Mehta
@ 2021-04-05 12:43       ` Leon Romanovsky
  2021-04-05 16:21         ` Salil Mehta
  0 siblings, 1 reply; 7+ messages in thread
From: Leon Romanovsky @ 2021-04-05 12:43 UTC (permalink / raw)
  To: Salil Mehta; +Cc: davem, kuba, netdev, linux-kernel, Linuxarm, linuxarm

On Mon, Apr 05, 2021 at 12:26:37PM +0000, Salil Mehta wrote:
> Hi Leon,
> Thanks for the review.
> 
> > From: Leon Romanovsky [mailto:leon@kernel.org]
> > Sent: Sunday, April 4, 2021 7:26 AM
> > To: Salil Mehta <salil.mehta@huawei.com>
> > Cc: davem@davemloft.net; kuba@kernel.org; netdev@vger.kernel.org;
> > linux-kernel@vger.kernel.org; Linuxarm <linuxarm@huawei.com>;
> > linuxarm@openeuler.org
> > Subject: Re: [PATCH net 1/2] net: hns3: Remove the left over redundant check
> > & assignment
> > 
> > On Sat, Apr 03, 2021 at 02:35:19AM +0100, Salil Mehta wrote:
> > > This removes the left over check and assignment which is no longer used
> > > anywhere in the function and should have been removed as part of the
> > > below mentioned patch.
> > >
> > > Fixes: 012fcb52f67c ("net: hns3: activate reset timer when calling
> > reset_event")
> > > Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
> > > ---
> > >  drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 --
> > >  1 file changed, 2 deletions(-)
> > >
> > > diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> > b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> > > index e3f81c7e0ce7..7ad0722383f5 100644
> > > --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> > > +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> > > @@ -3976,8 +3976,6 @@ static void hclge_reset_event(struct pci_dev *pdev,
> > struct hnae3_handle *handle)
> > >  	 * want to make sure we throttle the reset request. Therefore, we will
> > >  	 * not allow it again before 3*HZ times.
> > >  	 */
> > > -	if (!handle)
> > > -		handle = &hdev->vport[0].nic;
> > 
> > The comment above should be updated too, and probably the signature of
> > hclge_reset_event() worth to be changed.
> 
> 
> Yes, true. Both the comment and the prototype will be updated in near future.
> I can assure you this did not go un-noticed during the change. There are
> some internal subtleties which I am trying to sort out. Those might come
> as part of different patch-set which deals with other related changes as well.

I can buy such explanation for the change in function signature, but have hard
time to believe that extra commit is needed to change comment above.

Thanks

> 
> The current change(and some other) will pave the way for necessary refactoring
> Of the code being done.
> 
> 
> > 
> > Thanks
> > 
> > >
> > >  	if (time_before(jiffies, (hdev->last_reset_time +
> > >  				  HCLGE_RESET_INTERVAL))) {
> > > --
> > > 2.17.1
> > >

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

* RE: [PATCH net 1/2] net: hns3: Remove the left over redundant check & assignment
  2021-04-05 12:43       ` Leon Romanovsky
@ 2021-04-05 16:21         ` Salil Mehta
  0 siblings, 0 replies; 7+ messages in thread
From: Salil Mehta @ 2021-04-05 16:21 UTC (permalink / raw)
  To: Leon Romanovsky; +Cc: davem, kuba, netdev, linux-kernel, Linuxarm, linuxarm

> From: Leon Romanovsky [mailto:leon@kernel.org]
> Sent: Monday, April 5, 2021 1:43 PM
> To: Salil Mehta <salil.mehta@huawei.com>
> Cc: davem@davemloft.net; kuba@kernel.org; netdev@vger.kernel.org;
> linux-kernel@vger.kernel.org; Linuxarm <linuxarm@huawei.com>;
> linuxarm@openeuler.org
> Subject: Re: [PATCH net 1/2] net: hns3: Remove the left over redundant check
> & assignment
> 
> On Mon, Apr 05, 2021 at 12:26:37PM +0000, Salil Mehta wrote:
> > Hi Leon,
> > Thanks for the review.
> >
> > > From: Leon Romanovsky [mailto:leon@kernel.org]
> > > Sent: Sunday, April 4, 2021 7:26 AM
> > > To: Salil Mehta <salil.mehta@huawei.com>
> > > Cc: davem@davemloft.net; kuba@kernel.org; netdev@vger.kernel.org;
> > > linux-kernel@vger.kernel.org; Linuxarm <linuxarm@huawei.com>;
> > > linuxarm@openeuler.org
> > > Subject: Re: [PATCH net 1/2] net: hns3: Remove the left over redundant check
> > > & assignment
> > >
> > > On Sat, Apr 03, 2021 at 02:35:19AM +0100, Salil Mehta wrote:
> > > > This removes the left over check and assignment which is no longer used
> > > > anywhere in the function and should have been removed as part of the
> > > > below mentioned patch.
> > > >
> > > > Fixes: 012fcb52f67c ("net: hns3: activate reset timer when calling
> > > reset_event")
> > > > Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
> > > > ---
> > > >  drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 --
> > > >  1 file changed, 2 deletions(-)
> > > >
> > > > diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> > > b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> > > > index e3f81c7e0ce7..7ad0722383f5 100644
> > > > --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> > > > +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> > > > @@ -3976,8 +3976,6 @@ static void hclge_reset_event(struct pci_dev *pdev,
> > > struct hnae3_handle *handle)
> > > >  	 * want to make sure we throttle the reset request. Therefore, we will
> > > >  	 * not allow it again before 3*HZ times.
> > > >  	 */
> > > > -	if (!handle)
> > > > -		handle = &hdev->vport[0].nic;
> > >
> > > The comment above should be updated too, and probably the signature of
> > > hclge_reset_event() worth to be changed.
> >
> >
> > Yes, true. Both the comment and the prototype will be updated in near future.
> > I can assure you this did not go un-noticed during the change. There are
> > some internal subtleties which I am trying to sort out. Those might come
> > as part of different patch-set which deals with other related changes as well.
> 
> I can buy such explanation for the change in function signature, but have hard
> time to believe that extra commit is needed to change comment above.

Sure, I understand your point. Earlier I thought to retain the comment for reference
and make it part of the refactor change. But will send another version changing
the comment now. No issues :)

Many thanks

> 
> Thanks
> 
> >
> > The current change(and some other) will pave the way for necessary refactoring
> > Of the code being done.
> >
> >
> > >
> > > Thanks
> > >
> > > >
> > > >  	if (time_before(jiffies, (hdev->last_reset_time +
> > > >  				  HCLGE_RESET_INTERVAL))) {
> > > > --
> > > > 2.17.1
> > > >

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

end of thread, other threads:[~2021-04-05 16:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-03  1:35 [PATCH net 0/2] Misc. fixes for hns3 driver Salil Mehta
2021-04-03  1:35 ` [PATCH net 1/2] net: hns3: Remove the left over redundant check & assignment Salil Mehta
2021-04-04  6:25   ` Leon Romanovsky
2021-04-05 12:26     ` Salil Mehta
2021-04-05 12:43       ` Leon Romanovsky
2021-04-05 16:21         ` Salil Mehta
2021-04-03  1:35 ` [PATCH net 2/2] net: hns3: Remove un-necessary 'else-if' in the hclge_reset_event() Salil Mehta

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.