Subject: Re: [PATCH net-next v3] Add support of Cavium Liquidio ethernet adapters

From: Lino Sanfilippo <[email-masked]>
Date: Fri, 19 Dec 2014 23:24:14 +0100

There seem to be various places where GFP_KERNEL could be used instead
of GFP_ATOMIC, e.g.:

> +static int setup_nic_devices(struct octeon_device *octeon_dev)
> +{

> +
> +	sc = kmalloc(sizeof(*sc), GFP_ATOMIC);
> +	if (!sc)
> +		return -ENOMEM;
> +

and

> +static int liquidio_init_nic_module(int octeon_id, void *octeon_dev)
> +{

> +	/* Allocate a soft command to be used to send link status requests
> +	 * to the core app.
> +	 */
> +	sc = kmalloc(sizeof(*sc), GFP_ATOMIC);
> +	if (!sc) {
> +		kfree(ls);
> +		return -ENOMEM;

also

> +/*  Configure interrupt moderation parameters */
> +static int octnet_set_intrmod_cfg(void *oct, struct oct_intrmod_cfg *intr_cfg)
> +{
> +	struct octeon_soft_command *sc;
> +	struct oct_intrmod_cmd *cmd;
> +	int retval;
> +	struct octeon_device *oct_dev = (struct octeon_device *)oct;
> +	unsigned char *cfg;
> +
> +	/* Alloc soft command */
> +	sc = (struct octeon_soft_command *)
> +	     kmalloc(sizeof(struct octeon_soft_command), GFP_ATOMIC);
> +	if (!sc)
> +		return -ENOMEM;

seems only to be called from process context.

Regards,
Lino