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]
Date:   Wed, 24 Aug 2016 07:15:49 +0000
From:   Yuval Mintz <Yuval.Mintz@...gic.com>
To:     Hariprasad Shenai <hariprasad@...lsio.com>,
        netdev <netdev@...r.kernel.org>
CC:     David Miller <davem@...emloft.net>,
        "leedom@...lsio.com" <leedom@...lsio.com>,
        "nirranjan@...lsio.com" <nirranjan@...lsio.com>
Subject: RE: [PATCH net-next 2/2] cxgb4: Add support for ndo_get_vf_config

> +static void fill_vf_station_mac_addr(struct adapter *adap)
> +{
> +	unsigned int i;
> +	u8 hw_addr[ETH_ALEN], macaddr[ETH_ALEN];
> +	int err;
> +	u8 *na;
> +	u16 a, b;
> +
> +	err = t4_get_raw_vpd_params(adap, &adap->params.vpd);
> +	if (!err) {
> +		na = adap->params.vpd.na;
> +		for (i = 0; i < ETH_ALEN; i++)
> +			hw_addr[i] = (hex2val(na[2 * i + 0]) * 16 +
> +				      hex2val(na[2 * i + 1]));
> +		a = (hw_addr[0] << 8) | hw_addr[1];
> +		b = (hw_addr[1] << 8) | hw_addr[2];
> +		a ^= b;
> +		a |= 0x0200;    /* locally assigned Ethernet MAC address */
> +		a &= ~0x0100;   /* not a multicast Ethernet MAC address */
> +		macaddr[0] = a >> 8;
> +		macaddr[1] = a & 0xff;
> +
> +		for (i = 2; i < 5; i++)
> +			macaddr[i] = hw_addr[i + 1];
> +
> +		for (i = 0; i < adap->num_vfs; i++) {
> +			macaddr[5] = adap->pf * 16 + i;
> +			ether_addr_copy(adap->vfinfo[i].vf_mac_addr,
> macaddr);
> +		}
> +	}
> +}

That's some... magical magic? :-)
But I couldn't see anywhere in the patch where this MAC is propagated
to the VF, only to the new NDO(). Care to explain how does the VF learn it?
	

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ