From 58d53561bad01ae7829fdeee0c67f5dae4a9dc34 Mon Sep 17 00:00:00 2001 From: Martin Klozik Date: Fri, 5 Jan 2018 13:24:09 +0000 Subject: vswitch: Improve add_phy_port error messages In case that vSwitch can't add required number of physical ports, then error message should be printed. Previous implementation was not consistent. Thus error handling has been united across all vswitches and message explicitly states the cause of the failure. NOTE: A better solution would be a refactoring of all vSwitch classes to follow VPP port handling and to move port related structures and physical port check into parent vswitch class. JIRA: VSPERF-555 Change-Id: Id09a61432ea93e261f563254829348ac61f5dc8a Signed-off-by: Martin Klozik Reviewed-by: Jose Lausuch Reviewed-by: Al Morton Reviewed-by: Christian Trautman Reviewed-by: Sridhar Rao Reviewed-by: Trevor Cooper --- vswitches/vpp_dpdk_vhost.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'vswitches/vpp_dpdk_vhost.py') diff --git a/vswitches/vpp_dpdk_vhost.py b/vswitches/vpp_dpdk_vhost.py index c62e28d4..58d6bf51 100644 --- a/vswitches/vpp_dpdk_vhost.py +++ b/vswitches/vpp_dpdk_vhost.py @@ -225,7 +225,8 @@ class VppDpdkVhost(IVSwitch, tasks.Process): vpp_nics = self._get_nic_info(key='Pci') # check if there are any NICs left if len(self._phy_ports) >= len(S.getValue('NICS')): - raise RuntimeError('All available NICs are already configured!') + raise RuntimeError("Can't add phy port! There are only {} ports defined " + "by WHITELIST_NICS parameter!".format(len(S.getValue('NICS')))) nic = S.getValue('NICS')[len(self._phy_ports)] if not nic['pci'] in vpp_nics: -- cgit 1.2.3-korg