added dependency and usage of ethtool to disable rx/tx checksums, since they will never be valid from a veth. also lowered some noisy logging and removed other logging

This commit is contained in:
Blake Harnden 2019-06-12 12:41:01 -07:00
parent ac9dab097a
commit d724ee289b
5 changed files with 7 additions and 5 deletions

View file

@ -61,6 +61,7 @@ fpm -s dir -t rpm -n core \
-p core_$(PYTHON)_VERSION_ARCH.rpm \ -p core_$(PYTHON)_VERSION_ARCH.rpm \
-v $(PACKAGE_VERSION) \ -v $(PACKAGE_VERSION) \
--rpm-init scripts/core-daemon \ --rpm-init scripts/core-daemon \
-d "ethtool" \
-d "tcl" \ -d "tcl" \
-d "tk" \ -d "tk" \
-d "procps-ng" \ -d "procps-ng" \
@ -84,6 +85,7 @@ fpm -s dir -t deb -n core \
-p core_$(PYTHON)_VERSION_ARCH.deb \ -p core_$(PYTHON)_VERSION_ARCH.deb \
-v $(PACKAGE_VERSION) \ -v $(PACKAGE_VERSION) \
--deb-systemd scripts/core-daemon.service \ --deb-systemd scripts/core-daemon.service \
-d "ethtool" \
-d "tcl" \ -d "tcl" \
-d "tk" \ -d "tk" \
-d "libtk-img" \ -d "libtk-img" \

View file

@ -20,6 +20,7 @@ VCMD_BIN = which("vcmd")
BRCTL_BIN = which("brctl") BRCTL_BIN = which("brctl")
SYSCTL_BIN = which("sysctl") SYSCTL_BIN = which("sysctl")
IP_BIN = which("ip") IP_BIN = which("ip")
ETHTOOL_BIN = which("ethtool")
TC_BIN = which("tc") TC_BIN = which("tc")
EBTABLES_BIN = which("ebtables") EBTABLES_BIN = which("ebtables")
MOUNT_BIN = which("mount") MOUNT_BIN = which("mount")

View file

@ -668,6 +668,7 @@ class CoreNode(CoreNodeBase):
if self.up: if self.up:
utils.check_cmd([constants.IP_BIN, "link", "set", veth.name, "netns", str(self.pid)]) utils.check_cmd([constants.IP_BIN, "link", "set", veth.name, "netns", str(self.pid)])
self.check_cmd([constants.IP_BIN, "link", "set", veth.name, "name", ifname]) self.check_cmd([constants.IP_BIN, "link", "set", veth.name, "name", ifname])
self.check_cmd([constants.ETHTOOL_BIN, "-K", ifname, "rx", "off", "tx", "off"])
veth.name = ifname veth.name = ifname

View file

@ -73,7 +73,7 @@ class VnodeClient(object):
# run command, return process when not waiting # run command, return process when not waiting
cmd = self._cmd_args() + args cmd = self._cmd_args() + args
logging.info("cmd wait(%s): %s", wait, cmd) logging.debug("cmd wait(%s): %s", wait, cmd)
p = Popen(cmd, stdout=PIPE, stderr=PIPE) p = Popen(cmd, stdout=PIPE, stderr=PIPE)
if not wait: if not wait:
return 0 return 0
@ -124,7 +124,7 @@ class VnodeClient(object):
self._verify_connection() self._verify_connection()
args = utils.split_args(args) args = utils.split_args(args)
cmd = self._cmd_args() + args cmd = self._cmd_args() + args
logging.info("popen: %s", cmd) logging.debug("popen: %s", cmd)
p = Popen(cmd, stdout=PIPE, stderr=PIPE, stdin=PIPE) p = Popen(cmd, stdout=PIPE, stderr=PIPE, stdin=PIPE)
return p, p.stdin, p.stdout, p.stderr return p, p.stdin, p.stdout, p.stderr
@ -157,7 +157,7 @@ class VnodeClient(object):
# run command, return process when not waiting # run command, return process when not waiting
args = utils.split_args(args) args = utils.split_args(args)
cmd = self._cmd_args() + args cmd = self._cmd_args() + args
logging.info("redircmd: %s", cmd) logging.debug("redircmd: %s", cmd)
p = Popen(cmd, stdin=infd, stdout=outfd, stderr=errfd) p = Popen(cmd, stdin=infd, stdout=outfd, stderr=errfd)
if not wait: if not wait:

View file

@ -148,9 +148,7 @@ def split_args(args):
:return: shell-like syntax list :return: shell-like syntax list
:rtype: list :rtype: list
""" """
logging.info("split args: %s - %s", args, type(args))
if isinstance(args, basestring): if isinstance(args, basestring):
logging.info("splitting args")
args = shlex.split(args) args = shlex.split(args)
return args return args