未验证 提交 543b1e21 编写于 作者: Q Qianqian Zhu 提交者: GitHub

Merge pull request #1500 from xiywang/offload_txrx_chksum

offload_txrx_chksum: fix bug
- ethtool:
virt_test_type = qemu libvirt
only Linux
only e1000, virtio_net
only e1000, e1000e, virtio_net
no RHEL.3
type = ethtool
filesize = 512
nic_mode = tap
e1000:
e1000, e1000e:
# gso gro lro is only supported by latest kernel
supported_features = "tx rx sg tso gso gro lro"
# lro off is fixed
supported_features = "tx rx sg tso gso gro"
virtio_net:
# rx on and lro off are fixed
supported_features = "tx sg tso gso"
RHEL.4..e1000:
supported_features = "tx rx sg tso"
......
......@@ -52,8 +52,12 @@ def run(test, params, env):
status = {}
for f in feature_pattern.keys():
try:
status[f] = re.findall(
"%s: (.*)" % feature_pattern.get(f), o)[0]
temp = re.findall(
"%s: (.*)" % feature_pattern.get(f), o)[0]
if temp.find("[fixed]") != -1:
logging.debug("%s is fixed" % f)
continue
status[f] = temp
except IndexError:
status[f] = None
logging.debug("(%s) failed to get status '%s'", ethname, f)
......@@ -94,8 +98,10 @@ def run(test, params, env):
return ethtool_get(session)
def ethtool_restore_params(session, status):
error_context.context("Restoring ethtool configuration", logging.info)
ethtool_set(session, status)
cur_stat = ethtool_get(session)
if cur_stat != status:
error_context.context("Restoring ethtool configuration", logging.info)
ethtool_set(session, status)
def compare_md5sum(name):
txt = "Comparing md5sum of the files on guest and host"
......@@ -247,7 +253,11 @@ def run(test, params, env):
offload_stat = {f_type: "on"}
offload_stat.update(dict.fromkeys(test_matrix[f_type][1], "on"))
offload_stat.update(dict.fromkeys(test_matrix[f_type][2], "off"))
# lro is fixed for e1000 and e1000e, while trying to exclude
# lro by setting "lro off", the command of ethtool returns error
if not (f_type == "gro" and (vm.virtnet[0].nic_model == "e1000e"
or vm.virtnet[0].nic_model == "e1000")):
offload_stat.update(dict.fromkeys(test_matrix[f_type][2], "off"))
if not ethtool_set(session, offload_stat):
e_msg = "Failed to set offload status"
logging.error(e_msg)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册