All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net v2 0/3] Fix bugs in Octeontx2 netdev driver
@ 2020-07-25  4:43 sundeep.lkml
  2020-07-25  4:43 ` [PATCH net v2 1/3] octeontx2-pf: Fix reset_task bugs sundeep.lkml
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: sundeep.lkml @ 2020-07-25  4:43 UTC (permalink / raw)
  To: davem, kuba, netdev; +Cc: sgoutham, sbhatta

From: Subbaraya Sundeep <sbhatta@marvell.com>

Hi,

There are problems in the existing Octeontx2
netdev drivers like missing cancel_work for the
reset task, missing lock in reset task and
missing unergister_netdev in driver remove.
This patch set fixes the above problems.

Thanks,
Sundeep


Subbaraya Sundeep (3):
  octeontx2-pf: Fix reset_task bugs
  octeontx2-pf: cancel reset_task work
  octeontx2-pf: Unregister netdev at driver remove

 drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 3 +++
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c | 2 ++
 2 files changed, 5 insertions(+)

-- 
2.7.4


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

* [PATCH net v2 1/3] octeontx2-pf: Fix reset_task bugs
  2020-07-25  4:43 [PATCH net v2 0/3] Fix bugs in Octeontx2 netdev driver sundeep.lkml
@ 2020-07-25  4:43 ` sundeep.lkml
  2020-07-25  4:43 ` [PATCH net v2 2/3] octeontx2-pf: cancel reset_task work sundeep.lkml
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: sundeep.lkml @ 2020-07-25  4:43 UTC (permalink / raw)
  To: davem, kuba, netdev; +Cc: sgoutham, sbhatta

From: Subbaraya Sundeep <sbhatta@marvell.com>

Two bugs exist in the code related to reset_task
in PF driver one is the missing protection
against network stack ndo_open and ndo_close.
Other one is the missing cancel_work.
This patch fixes those problems.

Fixes: 4ff7d1488a84 ("octeontx2-pf: Error handling support")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
---

v2 changes:
	None


 drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
index 6478656..75a8c40 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
@@ -1730,10 +1730,12 @@ static void otx2_reset_task(struct work_struct *work)
 	if (!netif_running(pf->netdev))
 		return;
 
+	rtnl_lock();
 	otx2_stop(pf->netdev);
 	pf->reset_count++;
 	otx2_open(pf->netdev);
 	netif_trans_update(pf->netdev);
+	rtnl_unlock();
 }
 
 static const struct net_device_ops otx2_netdev_ops = {
@@ -2111,6 +2113,7 @@ static void otx2_remove(struct pci_dev *pdev)
 
 	pf = netdev_priv(netdev);
 
+	cancel_work_sync(&pf->reset_task);
 	/* Disable link notifications */
 	otx2_cgx_config_linkevents(pf, false);
 
-- 
2.7.4


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

* [PATCH net v2 2/3] octeontx2-pf: cancel reset_task work
  2020-07-25  4:43 [PATCH net v2 0/3] Fix bugs in Octeontx2 netdev driver sundeep.lkml
  2020-07-25  4:43 ` [PATCH net v2 1/3] octeontx2-pf: Fix reset_task bugs sundeep.lkml
@ 2020-07-25  4:43 ` sundeep.lkml
  2020-07-25  4:43 ` [PATCH net v2 3/3] octeontx2-pf: Unregister netdev at driver remove sundeep.lkml
  2020-07-29  0:15 ` [PATCH net v2 0/3] Fix bugs in Octeontx2 netdev driver David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: sundeep.lkml @ 2020-07-25  4:43 UTC (permalink / raw)
  To: davem, kuba, netdev; +Cc: sgoutham, sbhatta

From: Subbaraya Sundeep <sbhatta@marvell.com>

During driver exit cancel the queued
reset_task work in VF driver.

Fixes: 3184fb5ba96e ("octeontx2-vf: Virtual function driver support")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
---

v2 changes:
	None

 drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c
index f422751..c1c263d 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c
@@ -617,6 +617,7 @@ static void otx2vf_remove(struct pci_dev *pdev)
 
 	vf = netdev_priv(netdev);
 
+	cancel_work_sync(&vf->reset_task);
 	otx2vf_disable_mbox_intr(vf);
 
 	otx2_detach_resources(&vf->mbox);
-- 
2.7.4


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

* [PATCH net v2 3/3] octeontx2-pf: Unregister netdev at driver remove
  2020-07-25  4:43 [PATCH net v2 0/3] Fix bugs in Octeontx2 netdev driver sundeep.lkml
  2020-07-25  4:43 ` [PATCH net v2 1/3] octeontx2-pf: Fix reset_task bugs sundeep.lkml
  2020-07-25  4:43 ` [PATCH net v2 2/3] octeontx2-pf: cancel reset_task work sundeep.lkml
@ 2020-07-25  4:43 ` sundeep.lkml
  2020-07-29  0:15 ` [PATCH net v2 0/3] Fix bugs in Octeontx2 netdev driver David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: sundeep.lkml @ 2020-07-25  4:43 UTC (permalink / raw)
  To: davem, kuba, netdev; +Cc: sgoutham, sbhatta

From: Subbaraya Sundeep <sbhatta@marvell.com>

Added unregister_netdev in the driver remove
function. Generally unregister_netdev is called
after disabling all the device interrupts but here
it is called before disabling device mailbox
interrupts. The reason behind this is VF needs
mailbox interrupt to communicate with its PF to
clean up its resources during otx2_stop.
otx2_stop disables packet I/O and queue interrupts
first and by using mailbox interrupt communicates
to PF to free VF resources. Hence this patch
calls unregister_device just before
disabling mailbox interrupts.

Fixes: 3184fb5ba96e ("octeontx2-vf: Virtual function driver support")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
---

v2 changes:
	Modified commit description

 drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c
index c1c263d..92a3db6 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c
@@ -618,6 +618,7 @@ static void otx2vf_remove(struct pci_dev *pdev)
 	vf = netdev_priv(netdev);
 
 	cancel_work_sync(&vf->reset_task);
+	unregister_netdev(netdev);
 	otx2vf_disable_mbox_intr(vf);
 
 	otx2_detach_resources(&vf->mbox);
-- 
2.7.4


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

* Re: [PATCH net v2 0/3] Fix bugs in Octeontx2 netdev driver
  2020-07-25  4:43 [PATCH net v2 0/3] Fix bugs in Octeontx2 netdev driver sundeep.lkml
                   ` (2 preceding siblings ...)
  2020-07-25  4:43 ` [PATCH net v2 3/3] octeontx2-pf: Unregister netdev at driver remove sundeep.lkml
@ 2020-07-29  0:15 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2020-07-29  0:15 UTC (permalink / raw)
  To: sundeep.lkml; +Cc: kuba, netdev, sgoutham, sbhatta

From: sundeep.lkml@gmail.com
Date: Sat, 25 Jul 2020 10:13:51 +0530

> From: Subbaraya Sundeep <sbhatta@marvell.com>
> 
> Hi,
> 
> There are problems in the existing Octeontx2
> netdev drivers like missing cancel_work for the
> reset task, missing lock in reset task and
> missing unergister_netdev in driver remove.
> This patch set fixes the above problems.

Series applied, thanks.

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

end of thread, other threads:[~2020-07-29  0:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-25  4:43 [PATCH net v2 0/3] Fix bugs in Octeontx2 netdev driver sundeep.lkml
2020-07-25  4:43 ` [PATCH net v2 1/3] octeontx2-pf: Fix reset_task bugs sundeep.lkml
2020-07-25  4:43 ` [PATCH net v2 2/3] octeontx2-pf: cancel reset_task work sundeep.lkml
2020-07-25  4:43 ` [PATCH net v2 3/3] octeontx2-pf: Unregister netdev at driver remove sundeep.lkml
2020-07-29  0:15 ` [PATCH net v2 0/3] Fix bugs in Octeontx2 netdev driver 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.