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: 
 <DM6PR18MB2602EBCCC4F0EC2378C100B4CD12A@DM6PR18MB2602.namprd18.prod.outlook.com>
Date: Wed, 9 Aug 2023 03:30:29 +0000
From: Geethasowjanya Akula <gakula@...vell.com>
To: Li Zetao <lizetao1@...wei.com>,
        Sunil Kovvuri Goutham
	<sgoutham@...vell.com>,
        Linu Cherian <lcherian@...vell.com>,
        Jerin Jacob
 Kollanukkaran <jerinj@...vell.com>,
        Hariprasad Kelam <hkelam@...vell.com>,
        Subbaraya Sundeep Bhatta <sbhatta@...vell.com>,
        "davem@...emloft.net"
	<davem@...emloft.net>,
        "edumazet@...gle.com" <edumazet@...gle.com>,
        "kuba@...nel.org" <kuba@...nel.org>,
        "pabeni@...hat.com" <pabeni@...hat.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [EXT] [PATCH net-next 2/3] octeontx2-af: Use u64_to_ether_addr()
 to convert ethernet address



> -----Original Message-----
> From: Li Zetao <lizetao1@...wei.com>
> Sent: Tuesday, August 8, 2023 5:15 PM
> To: Sunil Kovvuri Goutham <sgoutham@...vell.com>; Linu Cherian
> <lcherian@...vell.com>; Geethasowjanya Akula <gakula@...vell.com>;
> Jerin Jacob Kollanukkaran <jerinj@...vell.com>; Hariprasad Kelam
> <hkelam@...vell.com>; Subbaraya Sundeep Bhatta
> <sbhatta@...vell.com>; davem@...emloft.net; edumazet@...gle.com;
> kuba@...nel.org; pabeni@...hat.com
> Cc: lizetao1@...wei.com; netdev@...r.kernel.org
> Subject: [EXT] [PATCH net-next 2/3] octeontx2-af: Use u64_to_ether_addr()
> to convert ethernet address
> 
> External Email
> 
> ----------------------------------------------------------------------
> Use u64_to_ether_addr() to convert a u64 value to an Ethernet MAC
> address, instead of directly calculating, as this is exactly what this function
> does.
> 
> Signed-off-by: Li Zetao <lizetao1@...wei.com>
> ---
>  drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
> b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
> index 095b2cc4a699..b3f766b970ca 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
> @@ -686,7 +686,7 @@ int rvu_mbox_handler_cgx_mac_addr_get(struct rvu
> *rvu,  {
>  	int pf = rvu_get_pf(req->hdr.pcifunc);
>  	u8 cgx_id, lmac_id;
> -	int rc = 0, i;
> +	int rc = 0;
>  	u64 cfg;
> 
>  	if (!is_cgx_config_permitted(rvu, req->hdr.pcifunc)) @@ -697,8
> +697,7 @@ int rvu_mbox_handler_cgx_mac_addr_get(struct rvu *rvu,
>  	rsp->hdr.rc = rc;
>  	cfg = cgx_lmac_addr_get(cgx_id, lmac_id);
>  	/* copy 48 bit mac address to req->mac_addr */
> -	for (i = 0; i < ETH_ALEN; i++)
> -		rsp->mac_addr[i] = cfg >> (ETH_ALEN - 1 - i) * 8;
> +	u64_to_ether_addr(cfg, rsp->mac_addr);
>  	return 0;
>  }
> 
> --
> 2.34.1
Ack. 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ