servod: Send multiple controls in one connection to server.
Clients to servod (dut-control, client.py) currently send control
command (get or set) to servod one at a time via get or set method.
While this arguably provides a simpler more debuggable interface it is
susceptable to system/network latency issues. These latencies in turn
cause timing variability especially with time sensitive togglings of
GPIOs. This has been seen when running FAFT where servod runs on a
less compute worthy platform or in a more congested network environment.
This CL creates a new method, set_get_all, across the XMLRPC interface
which processes an entire string of control requests. Additionally it
changes dut-control client to use that method for all non-doc (-i)
related transactions.
Current and future consumers of client methods that are sensitive
timing variability should use this new method.
For example,
Using dut-control:
before:
dut-control cold_reset:on ; sleep 2 ; dut-control cold_reset:off
after:
dut-control cold_reset:on sleep:2 cold_reset:off
Using set_get_all in client.py:
before:
for cmd in ['cold_reset:on', 'sleep:2' 'cold_reset:off']:
client.set(cmd)
after:
client.set_get_all(['cold_reset:on', 'sleep:2' 'cold_reset:off'])
BUG=chrome-os-partner:18047
TEST=manual
1. sudo emerge hdctools
2. sudo servod
3. client commands tested
- dut-control
- dut-control -i
- dut-control cold_reset
- time dut-control i2c_mux_en:off i2c_mux:loc0 i2c_mux_en i2c_mux \
i2c_mux_en:on i2c_mux:loc1 i2c_mux_en i2c_mux
<time was improved ~20ms (from 230ms:real -> 200ms:real on z620)>
Change-Id: Ie4dc280ec2f96f5738f93444f696ec39c638838b
Reviewed-on: https://gerrit.chromium.org/gerrit/46309
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
3 files changed