Bug 237471 - [PowerPC64] pseries llan driver wrong MAC address
Summary: [PowerPC64] pseries llan driver wrong MAC address
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: powerpc Any
: --- Affects Many People
Assignee: freebsd-ppc (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-22 14:08 UTC by Alfredo Dal'Ava Junior
Modified: 2019-08-23 17:38 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alfredo Dal'Ava Junior freebsd_committer freebsd_triage 2019-04-22 14:08:38 UTC
The network driver (pseries llan) isn't reading the MAC address set by QEMU correctly.

In the example bellow, user defines MAC address to 52:54:00:fa:de:56 and driver assumes 00:fa:de:56:00:00. 

The issue was seen on both "12.0-RELEASE r341666" and "13.0-CURRENT r346544"


QEMU 4.0rc0 start command:

/qemu4/usr/local/bin/qemu-system-ppc64 \
	-name guest=freebsd -cpu POWER8 -m 2048 \
	-drive file=vdisks/freebsd-vm-disk1.qcow2,if=scsi,index=0,format=qcow2 \
	-net nic,macaddr=52:54:00:fa:de:56 -net tap \
	-nographic -vga none -enable-kvm \
	-smp 16 \
	-machine pseries,accel=kvm,cap-cfpc=broken,cap-sbbc=broken,cap-ibs=broken,cap-hpt-max-page-size=16M \
	-mem-prealloc -mem-path /dev/hugepages \


root@base-test:~ # ifconfig llan0
llan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:fa:de:56:00:00
        inet 10.10.71.70 netmask 0xffffff00 broadcast 10.10.71.255 
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect
        status: active
root@base-test:~ # uname -a
FreeBSD base-test 12.0-RELEASE FreeBSD 12.0-RELEASE r341666 GENERIC  powerpc
Comment 1 Alfredo Dal'Ava Junior freebsd_committer freebsd_triage 2019-07-03 18:16:50 UTC
There's a fix on the way: https://reviews.freebsd.org/D20843
Comment 2 commit-hook freebsd_committer freebsd_triage 2019-07-04 12:31:40 UTC
A commit references this bug:

Author: luporl
Date: Thu Jul  4 12:31:25 UTC 2019
New revision: 349723
URL: https://svnweb.freebsd.org/changeset/base/349723

Log:
  [PPC64] pseries llan: fix MAC address

  There was an issue in pseries llan driver, that resulted in the first 2 bytes
  of the MAC address getting stripped, and the last 2 being always 0.

  In most cases the network interface still worked, despite the MAC being
  different of what was specified to QEMU, but when some other host or DHCP
  server expected a specific MAC, this would fail.

  This change fixes this by shifting right by 2 the local-mac-address read from
  device tree, if its length is 6 instead of 8, as observed in QEMU DT, that
  always presents a 6 bytes value for this property.

  PR:		237471
  Reported by:	Alfredo Dal'Ava Junior
  Reviewed by:	jhibbits
  Differential Revision:	https://reviews.freebsd.org/D20843

Changes:
  head/sys/powerpc/pseries/phyp_llan.c
Comment 3 Alfredo Dal'Ava Junior freebsd_committer freebsd_triage 2019-08-23 17:38:58 UTC
Confirmed fixed in 13-CURRENT