Bug 2224733

Summary: create vhost-net port and specify mac address failed
Product: Red Hat Enterprise Linux Fast Datapath Reporter: mhou <mhou>
Component: openvswitchAssignee: Timothy Redaelli <tredaelli>
openvswitch sub component: ovs-dpdk QA Contact: mhou <mhou>
Status: NEW --- Docs Contact:
Severity: medium    
Priority: unspecified CC: ctrautma, jhsiao, ktraynor
Version: RHEL 9.0   
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description mhou 2023-07-22 15:18:15 UTC
Description of problem:
create a vhost-net port and assign mac to this port. But mac address didn't effect.

Version-Release number of selected component (if applicable):
openvswitch3.1-3.1.0-35.el9fdp.x86_64

How reproducible: 100%


Steps to Reproduce:
1. disable selinux
setenforce0

2. start openvswitch service
ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true
ovs-vsctl --may-exist add-br guestbridge -- set bridge guestbridge datapath_type=netdev

3. create port
ovs-vsctl --timeout=60 --may-exist add-port guestbridge g1_eth1 \
-- set interface g1_eth1 type=dpdk \
-- set interface g1_eth1 options:dpdk-devargs=net_virtio_user1,path=/dev/vhost-net,iface=g1_eth1 \
-- set interface g1_eth1 mtu_request=9000 \
-- set interface g1_eth1 mac=\"00:de:ad:01:01:01\"

4. check mac address
# ovs-vsctl list interface g1_eth1
_uuid               : 82eae4fb-4709-4e45-bbd9-461c6bea7267
admin_state         : up
bfd                 : {}
bfd_status          : {}
cfm_fault           : []
cfm_fault_status    : []
cfm_flap_count      : []
cfm_health          : []
cfm_mpid            : []
cfm_remote_mpids    : []
cfm_remote_opstate  : []
duplex              : []
error               : []
external_ids        : {}
ifindex             : 5217615
ingress_policing_burst: 0
ingress_policing_kpkts_burst: 0
ingress_policing_kpkts_rate: 0
ingress_policing_rate: 0
lacp_current        : []
link_resets         : 0
link_speed          : []
link_state          : up
lldp                : {}
mac                 : "00:de:ad:01:01:01"
mac_in_use          : "76:9d:34:25:71:bd"
mtu                 : 9000
mtu_request         : 9000
name                : g1_eth1
ofport              : 3
ofport_request      : []
options             : {dpdk-devargs="net_virtio_user1,path=/dev/vhost-net,iface=g1_eth1"}
other_config        : {}
statistics          : {ovs_rx_qos_drops=0, ovs_tx_failure_drops=0, ovs_tx_invalid_hwol_drops=0, ovs_tx_mtu_exceeded_drops=0, ovs_tx_qos_drops=0, rx_bytes=0, rx_dropped=0, rx_errors=0, rx_mbuf_allocation_errors=0, rx_missed_errors=0, rx_packets=0, rx_q0_bytes=0, rx_q0_errors=0, rx_q0_packets=0, tx_bytes=0, tx_dropped=0, tx_errors=0, tx_packets=0, tx_q0_bytes=0, tx_q0_packets=0}
status              : {bus_info="bus_name=vdev", driver_name=net_virtio_user, if_descr="DPDK 22.11.1 net_virtio_user", if_type="6", link_speed="Not Defined", max_hash_mac_addrs="0", max_mac_addrs="64", max_rx_pktlen="9018", max_rx_queues="1", max_tx_queues="1", max_vfs="0", max_vmdq_pools="0", min_rx_bufsize="64", numa_id="-1", port_no="2"}
type                : dpdk


Actual results:
1. check mac address different between 'mac' and 'mac_in_use'
2. check err log on ovs-vswitchd.log
2023-07-22T15:09:50.222Z|00180|netdev_dpdk|INFO|Device 'net_virtio_user1,path=/dev/vhost-net,iface=g1_eth1' has been removed and detached
2023-07-22T15:09:52.830Z|00181|dpdk|ERR|virtio_user_dev_init_mac(): (/dev/vhost-net) No valid MAC in devargs or device, use random
2023-07-22T15:09:52.830Z|00182|netdev_dpdk|INFO|Device 'net_virtio_user1,path=/dev/vhost-net,iface=g1_eth1' attached to DPDK
Expected results:


Additional info: