Open ZTE-SuZhengwei opened 8 years ago
Hi,
1.To one vm with mixed-type ports,after it firstly deal with no-sriov port, it returns and never deal with sriov port. I just raise it through your code logic and has not prove it.Please check by yourself. 2.my env is rhel7/kilo/libvirt 3.my env doesn't have this directory: COUNTERS_DEST = "/sys/class/net/%(if_name)s/vf%(vf)s/statistics/%(cnt_name)s" so I execute ""ethtool -S %s | grep 'VF %s'"% (if_name, vf_num)" to get vf's io-state. 4.I start a vm by below steps:
then,I found the doman dumpxml of the vm: """ <! interface type='hostdev' managed='yes'> <! mac address='fa:16:3e:a2:82:2d'/> <! driver name='kvm'/> <! source> <! address type='pci' domain='0x0000' bus='0x84' slot='0x1f' function='0x5'/> <! /source> <! vlan> <! tag id='160'/> <! /vlan> <! alias name='hostdev0'/> <! address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> <! /interface> <! interface type='hostdev' managed='yes'> <! mac address='fa:16:3e:a2:82:2d'/> <! driver name='kvm'/> <! source> <! address type='pci' domain='0x0000' bus='0x84' slot='0x12' function='0x2'/> <! /source> <! vlan> <! tag id='160'/> <! /vlan> <! alias name='hostdev1'/> <! address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> <! /interface> """ It has two sriov port with the same mac_address.
""" ... 4: enp132s0f0: <NO-CARRIER,BROADCAST,MULTICAST,PROMISC,UP> mtu 9000 qdisc mq master ovs-system state DOWN mode DEFAULT qlen 1000 .... vf 9 MAC fa:16:3e:a2:82:2d, vlan 160, link-state auto ... 5: enp132s0f1: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 9000 qdisc mq master ovs-system state UP mode DEFAULT qlen 1000 ..... vf 62 MAC fa:16:3e:a2:82:2d, vlan 160, link-state auto ... """ There are two vf, but your code only deal with the last one. I have improved it in my applying. if you need I will push it to github.
for issues 1 I see the mistake it would be great if you can submit a patch for it regarding "/sys/class/net/%(if_name)s/vf%(vf)s/statistics/%(cnt_name)s" this was mellanox propriety we can change it to ethtool you can submit for this as well regarding the bond issue, I didn't know openstack support --bond
I don't know how to modify base on your project.This is my commit for openstack/ceilometer,please refer to it.
https://github.com/ZTE-SuZhengwei/ceilometer/commit/13dc880f6eb6f6ed6fd325c47d996d2ba00e85d9
Fixed with f186d857cc010eca77e96a86276593d9f4a3fee0
1.it cann't deal with the vm which used mixed-type ports. 2.If one vm bond two sriov port,then it only get one sriov's io-state.