From 438850f5e2d480e7bf2556367361f3c53506ee25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jarom=C3=ADr=20Smr=C4=8Dek?= <4plague@gmail.com> Date: Fri, 18 Oct 2024 14:06:20 +0200 Subject: [PATCH] Add better cmdline argument checks for multiport-eswitch --- src/dp_service.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/dp_service.c b/src/dp_service.c index 0e39ba37..5b58aa33 100644 --- a/src/dp_service.c +++ b/src/dp_service.c @@ -236,9 +236,26 @@ static int run_service(void) return DP_ERROR; } - if (dp_conf_is_multiport_eswitch() && dp_conf_is_offload_enabled()) { - DP_EARLY_ERR("HW offloading is currently not supported for multi-port eswitch mode"); - return DP_ERROR; + if (dp_conf_is_multiport_eswitch()) { + if (dp_conf_is_offload_enabled()) { + DP_EARLY_ERR("HW offloading is currently not supported for multi-port eswitch mode"); + return DP_ERROR; + } +#ifdef ENABLE_PF1_PROXY + if (dp_conf_is_pf1_proxy_enabled()) { + if (*dp_conf_get_pf1_proxy_vf() == '\0') { + DP_EARLY_ERR("PF1-proxy also requires --pf1-proxy-vf argument to be set"); + return DP_ERROR; + } + } +#endif + } else { +#ifdef ENABLE_PF1_PROXY + if (dp_conf_is_pf1_proxy_enabled()) { + DP_EARLY_ERR("PF1-proxy is only supported for multiport-eswitch mode"); + return DP_ERROR; + } +#endif } if (DP_FAILED(dp_log_init()))