netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ice: lag: in RCU, use atomic allocation
@ 2023-10-23 10:59 Michal Schmidt
  2023-10-23 11:07 ` Drewek, Wojciech
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michal Schmidt @ 2023-10-23 10:59 UTC (permalink / raw)
  To: netdev
  Cc: Dave Ertman, Daniel Machon, Tony Nguyen, Jesse Brandeburg,
	intel-wired-lan

Sleeping is not allowed in RCU read-side critical sections.
Use atomic allocations under rcu_read_lock.

Fixes: 1e0f9881ef79 ("ice: Flesh out implementation of support for SRIOV on bonded interface")
Fixes: 41ccedf5ca8f ("ice: implement lag netdev event handler")
Fixes: 3579aa86fb40 ("ice: update reset path for SRIOV LAG support")
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
---
 drivers/net/ethernet/intel/ice/ice_lag.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_lag.c b/drivers/net/ethernet/intel/ice/ice_lag.c
index 7b1256992dcf..33f01420eece 100644
--- a/drivers/net/ethernet/intel/ice/ice_lag.c
+++ b/drivers/net/ethernet/intel/ice/ice_lag.c
@@ -595,7 +595,7 @@ void ice_lag_move_new_vf_nodes(struct ice_vf *vf)
 		INIT_LIST_HEAD(&ndlist.node);
 		rcu_read_lock();
 		for_each_netdev_in_bond_rcu(lag->upper_netdev, tmp_nd) {
-			nl = kzalloc(sizeof(*nl), GFP_KERNEL);
+			nl = kzalloc(sizeof(*nl), GFP_ATOMIC);
 			if (!nl)
 				break;
 
@@ -1672,7 +1672,7 @@ ice_lag_event_handler(struct notifier_block *notif_blk, unsigned long event,
 
 		rcu_read_lock();
 		for_each_netdev_in_bond_rcu(upper_netdev, tmp_nd) {
-			nd_list = kzalloc(sizeof(*nd_list), GFP_KERNEL);
+			nd_list = kzalloc(sizeof(*nd_list), GFP_ATOMIC);
 			if (!nd_list)
 				break;
 
@@ -2046,7 +2046,7 @@ void ice_lag_rebuild(struct ice_pf *pf)
 		INIT_LIST_HEAD(&ndlist.node);
 		rcu_read_lock();
 		for_each_netdev_in_bond_rcu(lag->upper_netdev, tmp_nd) {
-			nl = kzalloc(sizeof(*nl), GFP_KERNEL);
+			nl = kzalloc(sizeof(*nl), GFP_ATOMIC);
 			if (!nl)
 				break;
 
-- 
2.41.0


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

* RE: [PATCH net] ice: lag: in RCU, use atomic allocation
  2023-10-23 10:59 [PATCH net] ice: lag: in RCU, use atomic allocation Michal Schmidt
@ 2023-10-23 11:07 ` Drewek, Wojciech
  2023-10-30  6:44 ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
  2023-11-04 13:29 ` Simon Horman
  2 siblings, 0 replies; 4+ messages in thread
From: Drewek, Wojciech @ 2023-10-23 11:07 UTC (permalink / raw)
  To: mschmidt, netdev@vger.kernel.org
  Cc: Ertman, David M, Daniel Machon, Nguyen, Anthony L,
	Brandeburg, Jesse, intel-wired-lan@lists.osuosl.org



> -----Original Message-----
> From: Michal Schmidt <mschmidt@redhat.com>
> Sent: Monday, October 23, 2023 1:00 PM
> To: netdev@vger.kernel.org
> Cc: Ertman, David M <david.m.ertman@intel.com>; Daniel Machon <daniel.machon@microchip.com>; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; Brandeburg, Jesse <jesse.brandeburg@intel.com>; intel-wired-lan@lists.osuosl.org
> Subject: [PATCH net] ice: lag: in RCU, use atomic allocation
> 
> Sleeping is not allowed in RCU read-side critical sections.
> Use atomic allocations under rcu_read_lock.
> 
> Fixes: 1e0f9881ef79 ("ice: Flesh out implementation of support for SRIOV on bonded interface")
> Fixes: 41ccedf5ca8f ("ice: implement lag netdev event handler")
> Fixes: 3579aa86fb40 ("ice: update reset path for SRIOV LAG support")
> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>

Thanks Michal
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>

> ---
>  drivers/net/ethernet/intel/ice/ice_lag.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_lag.c b/drivers/net/ethernet/intel/ice/ice_lag.c
> index 7b1256992dcf..33f01420eece 100644
> --- a/drivers/net/ethernet/intel/ice/ice_lag.c
> +++ b/drivers/net/ethernet/intel/ice/ice_lag.c
> @@ -595,7 +595,7 @@ void ice_lag_move_new_vf_nodes(struct ice_vf *vf)
>  		INIT_LIST_HEAD(&ndlist.node);
>  		rcu_read_lock();
>  		for_each_netdev_in_bond_rcu(lag->upper_netdev, tmp_nd) {
> -			nl = kzalloc(sizeof(*nl), GFP_KERNEL);
> +			nl = kzalloc(sizeof(*nl), GFP_ATOMIC);
>  			if (!nl)
>  				break;
> 
> @@ -1672,7 +1672,7 @@ ice_lag_event_handler(struct notifier_block *notif_blk, unsigned long event,
> 
>  		rcu_read_lock();
>  		for_each_netdev_in_bond_rcu(upper_netdev, tmp_nd) {
> -			nd_list = kzalloc(sizeof(*nd_list), GFP_KERNEL);
> +			nd_list = kzalloc(sizeof(*nd_list), GFP_ATOMIC);
>  			if (!nd_list)
>  				break;
> 
> @@ -2046,7 +2046,7 @@ void ice_lag_rebuild(struct ice_pf *pf)
>  		INIT_LIST_HEAD(&ndlist.node);
>  		rcu_read_lock();
>  		for_each_netdev_in_bond_rcu(lag->upper_netdev, tmp_nd) {
> -			nl = kzalloc(sizeof(*nl), GFP_KERNEL);
> +			nl = kzalloc(sizeof(*nl), GFP_ATOMIC);
>  			if (!nl)
>  				break;
> 
> --
> 2.41.0
> 


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

* RE: [Intel-wired-lan] [PATCH net] ice: lag: in RCU, use atomic allocation
  2023-10-23 10:59 [PATCH net] ice: lag: in RCU, use atomic allocation Michal Schmidt
  2023-10-23 11:07 ` Drewek, Wojciech
@ 2023-10-30  6:44 ` Pucha, HimasekharX Reddy
  2023-11-04 13:29 ` Simon Horman
  2 siblings, 0 replies; 4+ messages in thread
From: Pucha, HimasekharX Reddy @ 2023-10-30  6:44 UTC (permalink / raw)
  To: mschmidt, netdev@vger.kernel.org
  Cc: Ertman, David M, intel-wired-lan@lists.osuosl.org,
	Nguyen, Anthony L, Daniel Machon, Brandeburg, Jesse

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of Michal Schmidt
> Sent: Monday, October 23, 2023 4:30 PM
> To: netdev@vger.kernel.org
> Cc: Ertman, David M <david.m.ertman@intel.com>; intel-wired-lan@lists.osuosl.org; Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Daniel Machon <daniel.machon@microchip.com>; Brandeburg, Jesse <jesse.brandeburg@intel.com>
> Subject: [Intel-wired-lan] [PATCH net] ice: lag: in RCU, use atomic allocation
>
> Sleeping is not allowed in RCU read-side critical sections.
> Use atomic allocations under rcu_read_lock.
>
> Fixes: 1e0f9881ef79 ("ice: Flesh out implementation of support for SRIOV on bonded interface")
> Fixes: 41ccedf5ca8f ("ice: implement lag netdev event handler")
> Fixes: 3579aa86fb40 ("ice: update reset path for SRIOV LAG support")
> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_lag.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>

Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)


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

* Re: [PATCH net] ice: lag: in RCU, use atomic allocation
  2023-10-23 10:59 [PATCH net] ice: lag: in RCU, use atomic allocation Michal Schmidt
  2023-10-23 11:07 ` Drewek, Wojciech
  2023-10-30  6:44 ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
@ 2023-11-04 13:29 ` Simon Horman
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2023-11-04 13:29 UTC (permalink / raw)
  To: Michal Schmidt
  Cc: netdev, Dave Ertman, Daniel Machon, Tony Nguyen, Jesse Brandeburg,
	intel-wired-lan

On Mon, Oct 23, 2023 at 12:59:53PM +0200, Michal Schmidt wrote:
> Sleeping is not allowed in RCU read-side critical sections.
> Use atomic allocations under rcu_read_lock.
> 
> Fixes: 1e0f9881ef79 ("ice: Flesh out implementation of support for SRIOV on bonded interface")
> Fixes: 41ccedf5ca8f ("ice: implement lag netdev event handler")
> Fixes: 3579aa86fb40 ("ice: update reset path for SRIOV LAG support")
> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>

Reviewed-by: Simon Horman <horms@kernel.org>


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

end of thread, other threads:[~2023-11-04 13:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-23 10:59 [PATCH net] ice: lag: in RCU, use atomic allocation Michal Schmidt
2023-10-23 11:07 ` Drewek, Wojciech
2023-10-30  6:44 ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2023-11-04 13:29 ` Simon Horman

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).