diff mbox series

fcoe: fix io path allocation

Message ID 1596831813-9839-1-git-send-email-michael.christie@oracle.com (mailing list archive)
State Mainlined
Commit fa39ab5184d64563cd36f2fb5f0d3fbad83a432c
Headers show
Series fcoe: fix io path allocation | expand

Commit Message

Mike Christie Aug. 7, 2020, 8:23 p.m. UTC
ixgbe_fcoe_ddp_setup can be called from the main IO path and is called
with a spin_lock held, so we have to use GFP_ATOMIC allocation instead
of GFP_KERNEL.

Signed-off-by: Mike Christie <michael.christie@oracle.com>
cc: Hannes Reinecke <hare@suse.de>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Lee Duncan Aug. 7, 2020, 10:41 p.m. UTC | #1
On 8/7/20 1:23 PM, Mike Christie wrote:
> ixgbe_fcoe_ddp_setup can be called from the main IO path and is called
> with a spin_lock held, so we have to use GFP_ATOMIC allocation instead
> of GFP_KERNEL.
> 
> Signed-off-by: Mike Christie <michael.christie@oracle.com>
> cc: Hannes Reinecke <hare@suse.de>
> ---
>  drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
> index ec7a11d..9e70b9a 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
> @@ -192,7 +192,7 @@ static int ixgbe_fcoe_ddp_setup(struct net_device *netdev, u16 xid,
>  	}
>  
>  	/* alloc the udl from per cpu ddp pool */
> -	ddp->udl = dma_pool_alloc(ddp_pool->pool, GFP_KERNEL, &ddp->udp);
> +	ddp->udl = dma_pool_alloc(ddp_pool->pool, GFP_ATOMIC, &ddp->udp);
>  	if (!ddp->udl) {
>  		e_err(drv, "failed allocated ddp context\n");
>  		goto out_noddp_unmap;
> 

Reviewed-by: Lee Duncan <lduncan@suse.com>
Martin K. Petersen Aug. 18, 2020, 3:12 a.m. UTC | #2
On Fri, 7 Aug 2020 15:23:33 -0500, Mike Christie wrote:

> ixgbe_fcoe_ddp_setup can be called from the main IO path and is called
> with a spin_lock held, so we have to use GFP_ATOMIC allocation instead
> of GFP_KERNEL.

Applied to 5.9/scsi-fixes, thanks!

[1/1] scsi: fcoe: Fix I/O path allocation
      https://git.kernel.org/mkp/scsi/c/fa39ab5184d6
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
index ec7a11d..9e70b9a 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
@@ -192,7 +192,7 @@  static int ixgbe_fcoe_ddp_setup(struct net_device *netdev, u16 xid,
 	}
 
 	/* alloc the udl from per cpu ddp pool */
-	ddp->udl = dma_pool_alloc(ddp_pool->pool, GFP_KERNEL, &ddp->udp);
+	ddp->udl = dma_pool_alloc(ddp_pool->pool, GFP_ATOMIC, &ddp->udp);
 	if (!ddp->udl) {
 		e_err(drv, "failed allocated ddp context\n");
 		goto out_noddp_unmap;