lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191016110751.rkt3tgdlkxjf4ip3@netronome.com>
Date:   Wed, 16 Oct 2019 13:07:52 +0200
From:   Simon Horman <simon.horman@...ronome.com>
To:     Ioana Ciornei <ioana.ciornei@....com>
Cc:     davem@...emloft.net, jakub.kicinski@...ronome.com, andrew@...n.ch,
        netdev@...r.kernel.org,
        Florin Chiculita <florinlaurentiu.chiculita@....com>
Subject: Re: [PATCH v3 net 1/2] dpaa2-eth: add irq for the dpmac
 connect/disconnect event

On Wed, Oct 16, 2019 at 10:36:22AM +0300, Ioana Ciornei wrote:
> From: Florin Chiculita <florinlaurentiu.chiculita@....com>
> 
> Add IRQ for the DPNI endpoint change event, resolving the issue
> when a dynamically created DPNI gets a randomly generated hw address
> when the endpoint is a DPMAC object.
> 
> Signed-off-by: Florin Chiculita <florinlaurentiu.chiculita@....com>
> Signed-off-by: Ioana Ciornei <ioana.ciornei@....com>
> ---
> Changes in v2:
>  - none
> Changes in v3:
>  - none
> 
>  drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 6 +++++-
>  drivers/net/ethernet/freescale/dpaa2/dpni.h      | 5 ++++-
>  2 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
> index 162d7d8fb295..5acd734a216b 100644
> --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
> +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
> @@ -3306,6 +3306,9 @@ static irqreturn_t dpni_irq0_handler_thread(int irq_num, void *arg)
>  	if (status & DPNI_IRQ_EVENT_LINK_CHANGED)
>  		link_state_update(netdev_priv(net_dev));
>  
> +	if (status & DPNI_IRQ_EVENT_ENDPOINT_CHANGED)
> +		set_mac_addr(netdev_priv(net_dev));
> +
>  	return IRQ_HANDLED;
>  }
>  
> @@ -3331,7 +3334,8 @@ static int setup_irqs(struct fsl_mc_device *ls_dev)
>  	}
>  
>  	err = dpni_set_irq_mask(ls_dev->mc_io, 0, ls_dev->mc_handle,
> -				DPNI_IRQ_INDEX, DPNI_IRQ_EVENT_LINK_CHANGED);
> +				DPNI_IRQ_INDEX, DPNI_IRQ_EVENT_LINK_CHANGED |
> +				DPNI_IRQ_EVENT_ENDPOINT_CHANGED);
>  	if (err < 0) {
>  		dev_err(&ls_dev->dev, "dpni_set_irq_mask(): %d\n", err);
>  		goto free_irq;
> diff --git a/drivers/net/ethernet/freescale/dpaa2/dpni.h b/drivers/net/ethernet/freescale/dpaa2/dpni.h
> index fd583911b6c0..ee0711d06b3a 100644
> --- a/drivers/net/ethernet/freescale/dpaa2/dpni.h
> +++ b/drivers/net/ethernet/freescale/dpaa2/dpni.h
> @@ -133,9 +133,12 @@ int dpni_reset(struct fsl_mc_io	*mc_io,
>   */
>  #define DPNI_IRQ_INDEX				0
>  /**
> - * IRQ event - indicates a change in link state
> + * IRQ events:
> + *       indicates a change in link state
> + *       indicates a change in endpoint
>   */
>  #define DPNI_IRQ_EVENT_LINK_CHANGED		0x00000001
> +#define DPNI_IRQ_EVENT_ENDPOINT_CHANGED		0x00000002

Perhaps (as a follow-up?) this is a candidate for using the BIT() macro.

>  
>  int dpni_set_irq_enable(struct fsl_mc_io	*mc_io,
>  			u32			cmd_flags,
> -- 
> 1.9.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ