* [PATCH net] ixgbevf: fix invalid use of napi_hash_del()
@ 2016-11-16 15:15 Eric Dumazet
2016-11-16 15:25 ` Eric Dumazet
2016-11-16 15:26 ` [PATCH v2 net] ixgbevf: fix invalid uses " Eric Dumazet
0 siblings, 2 replies; 5+ messages in thread
From: Eric Dumazet @ 2016-11-16 15:15 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Jeff Kirsher
From: Eric Dumazet <edumazet@google.com>
Calling napi_hash_del() before netif_napi_del() is dangerous
if a synchronize_rcu() is not enforced before NAPI struct freeing.
Lets leave this detail to core networking stack to get it right.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 7eaac3234049..30a26e624e5a 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -2511,9 +2511,6 @@ static int ixgbevf_alloc_q_vectors(struct ixgbevf_adapter *adapter)
while (q_idx) {
q_idx--;
q_vector = adapter->q_vector[q_idx];
-#ifdef CONFIG_NET_RX_BUSY_POLL
- napi_hash_del(&q_vector->napi);
-#endif
netif_napi_del(&q_vector->napi);
kfree(q_vector);
adapter->q_vector[q_idx] = NULL;
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net] ixgbevf: fix invalid use of napi_hash_del()
2016-11-16 15:15 [PATCH net] ixgbevf: fix invalid use of napi_hash_del() Eric Dumazet
@ 2016-11-16 15:25 ` Eric Dumazet
2016-11-16 15:26 ` [PATCH v2 net] ixgbevf: fix invalid uses " Eric Dumazet
1 sibling, 0 replies; 5+ messages in thread
From: Eric Dumazet @ 2016-11-16 15:25 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Jeff Kirsher
On Wed, 2016-11-16 at 07:15 -0800, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> Calling napi_hash_del() before netif_napi_del() is dangerous
> if a synchronize_rcu() is not enforced before NAPI struct freeing.
>
> Lets leave this detail to core networking stack to get it right.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> ---
> drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 3 ---
> 1 file changed, 3 deletions(-)
Will send a v2
Same stuff is needed in ixgbevf_free_q_vectors()
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 net] ixgbevf: fix invalid uses of napi_hash_del()
2016-11-16 15:15 [PATCH net] ixgbevf: fix invalid use of napi_hash_del() Eric Dumazet
2016-11-16 15:25 ` Eric Dumazet
@ 2016-11-16 15:26 ` Eric Dumazet
2016-12-03 15:00 ` Eric Dumazet
1 sibling, 1 reply; 5+ messages in thread
From: Eric Dumazet @ 2016-11-16 15:26 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Jeff Kirsher
From: Eric Dumazet <edumazet@google.com>
Calling napi_hash_del() before netif_napi_del() is dangerous
if a synchronize_rcu() is not enforced before NAPI struct freeing.
Lets leave this detail to core networking stack to get it right.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 7eaac3234049..bf4d7efc7dbd 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -2511,9 +2511,6 @@ static int ixgbevf_alloc_q_vectors(struct ixgbevf_adapter *adapter)
while (q_idx) {
q_idx--;
q_vector = adapter->q_vector[q_idx];
-#ifdef CONFIG_NET_RX_BUSY_POLL
- napi_hash_del(&q_vector->napi);
-#endif
netif_napi_del(&q_vector->napi);
kfree(q_vector);
adapter->q_vector[q_idx] = NULL;
@@ -2537,9 +2534,6 @@ static void ixgbevf_free_q_vectors(struct ixgbevf_adapter *adapter)
struct ixgbevf_q_vector *q_vector = adapter->q_vector[q_idx];
adapter->q_vector[q_idx] = NULL;
-#ifdef CONFIG_NET_RX_BUSY_POLL
- napi_hash_del(&q_vector->napi);
-#endif
netif_napi_del(&q_vector->napi);
kfree(q_vector);
}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 net] ixgbevf: fix invalid uses of napi_hash_del()
2016-11-16 15:26 ` [PATCH v2 net] ixgbevf: fix invalid uses " Eric Dumazet
@ 2016-12-03 15:00 ` Eric Dumazet
2016-12-03 16:46 ` Jeff Kirsher
0 siblings, 1 reply; 5+ messages in thread
From: Eric Dumazet @ 2016-12-03 15:00 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Jeff Kirsher
On Wed, 2016-11-16 at 07:26 -0800, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> Calling napi_hash_del() before netif_napi_del() is dangerous
> if a synchronize_rcu() is not enforced before NAPI struct freeing.
>
> Lets leave this detail to core networking stack to get it right.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> ---
> drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
> index 7eaac3234049..bf4d7efc7dbd 100644
> --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
> +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
> @@ -2511,9 +2511,6 @@ static int ixgbevf_alloc_q_vectors(struct ixgbevf_adapter *adapter)
> while (q_idx) {
> q_idx--;
> q_vector = adapter->q_vector[q_idx];
> -#ifdef CONFIG_NET_RX_BUSY_POLL
> - napi_hash_del(&q_vector->napi);
> -#endif
> netif_napi_del(&q_vector->napi);
> kfree(q_vector);
> adapter->q_vector[q_idx] = NULL;
> @@ -2537,9 +2534,6 @@ static void ixgbevf_free_q_vectors(struct ixgbevf_adapter *adapter)
> struct ixgbevf_q_vector *q_vector = adapter->q_vector[q_idx];
>
> adapter->q_vector[q_idx] = NULL;
> -#ifdef CONFIG_NET_RX_BUSY_POLL
> - napi_hash_del(&q_vector->napi);
> -#endif
> netif_napi_del(&q_vector->napi);
> kfree(q_vector);
> }
>
>
It looks this patch was not picked up ?
Thanks !
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 net] ixgbevf: fix invalid uses of napi_hash_del()
2016-12-03 15:00 ` Eric Dumazet
@ 2016-12-03 16:46 ` Jeff Kirsher
0 siblings, 0 replies; 5+ messages in thread
From: Jeff Kirsher @ 2016-12-03 16:46 UTC (permalink / raw)
To: Eric Dumazet, David Miller; +Cc: netdev
[-- Attachment #1: Type: text/plain, Size: 2231 bytes --]
On Sat, 2016-12-03 at 07:00 -0800, Eric Dumazet wrote:
> On Wed, 2016-11-16 at 07:26 -0800, Eric Dumazet wrote:
> > From: Eric Dumazet <edumazet@google.com>
> >
> > Calling napi_hash_del() before netif_napi_del() is dangerous
> > if a synchronize_rcu() is not enforced before NAPI struct freeing.
> >
> > Lets leave this detail to core networking stack to get it right.
> >
> > Signed-off-by: Eric Dumazet <edumazet@google.com>
> > Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> > ---
> > drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 6 ------
> > 1 file changed, 6 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
> > b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
> > index 7eaac3234049..bf4d7efc7dbd 100644
> > --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
> > +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
> > @@ -2511,9 +2511,6 @@ static int ixgbevf_alloc_q_vectors(struct
> > ixgbevf_adapter *adapter)
> > while (q_idx) {
> > q_idx--;
> > q_vector = adapter->q_vector[q_idx];
> > -#ifdef CONFIG_NET_RX_BUSY_POLL
> > - napi_hash_del(&q_vector->napi);
> > -#endif
> > netif_napi_del(&q_vector->napi);
> > kfree(q_vector);
> > adapter->q_vector[q_idx] = NULL;
> > @@ -2537,9 +2534,6 @@ static void ixgbevf_free_q_vectors(struct
> > ixgbevf_adapter *adapter)
> > struct ixgbevf_q_vector *q_vector = adapter-
> > >q_vector[q_idx];
> >
> > adapter->q_vector[q_idx] = NULL;
> > -#ifdef CONFIG_NET_RX_BUSY_POLL
> > - napi_hash_del(&q_vector->napi);
> > -#endif
> > netif_napi_del(&q_vector->napi);
> > kfree(q_vector);
> > }
> >
> >
>
> It looks this patch was not picked up ?
Yeah, sorry I missed it since it was not sent to intel-wired-lan mailing
list. Dave I am fine if you want to pick this up for your net tree (if it
is not too late).
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-12-03 16:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-16 15:15 [PATCH net] ixgbevf: fix invalid use of napi_hash_del() Eric Dumazet
2016-11-16 15:25 ` Eric Dumazet
2016-11-16 15:26 ` [PATCH v2 net] ixgbevf: fix invalid uses " Eric Dumazet
2016-12-03 15:00 ` Eric Dumazet
2016-12-03 16:46 ` Jeff Kirsher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).