* [PATCH 0/6] refactor the service module
@ 2024-06-19 3:06 Chaoyong He
2024-06-19 3:06 ` [PATCH 1/6] net/nfp: fix check logic for device arguments Chaoyong He
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: Chaoyong He @ 2024-06-19 3:06 UTC (permalink / raw)
To: dev; +Cc: oss-drivers, Chaoyong He
This patch series refactor the service module, remove some specific
logic and use the service framework logic as much as possible.
Also add a device argument to control the enable of CPP service.
Long Wu (6):
net/nfp: fix check logic for device arguments
net/nfp: remove redundant NFP service code
net/nfp: remove the flower service dead loop
net/nfp: fix disable CPP service
net/nfp: add CPP service enable option
net/nfp: add CPP service abnormal exit logic
doc/guides/nics/nfp.rst | 9 +++
.../net/nfp/flower/nfp_flower_representor.c | 3 -
drivers/net/nfp/flower/nfp_flower_service.c | 29 +++----
drivers/net/nfp/nfp_cpp_bridge.c | 6 ++
drivers/net/nfp/nfp_cpp_bridge.h | 1 +
drivers/net/nfp/nfp_ethdev.c | 81 ++++++++++++++-----
drivers/net/nfp/nfp_net_common.h | 3 +
drivers/net/nfp/nfp_service.c | 76 +++--------------
drivers/net/nfp/nfp_service.h | 1 -
9 files changed, 101 insertions(+), 108 deletions(-)
--
2.39.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/6] net/nfp: fix check logic for device arguments
2024-06-19 3:06 [PATCH 0/6] refactor the service module Chaoyong He
@ 2024-06-19 3:06 ` Chaoyong He
2024-06-19 3:06 ` [PATCH 2/6] net/nfp: remove redundant NFP service code Chaoyong He
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Chaoyong He @ 2024-06-19 3:06 UTC (permalink / raw)
To: dev; +Cc: oss-drivers, Long Wu, peng.zhang, stable, Chaoyong He
From: Long Wu <long.wu@corigine.com>
There is no check for NFP device argument now, so the users may
not be aware of the wrong device argument and feels confused
with the result in some case.
Add the check logic to fix this problem.
Fixes: b301fd736003 ("net/nfp: add force reload firmware option")
Cc: peng.zhang@corigine.com
Cc: stable@dpdk.org
Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
---
drivers/net/nfp/nfp_ethdev.c | 59 +++++++++++++++++++++++++-----------
1 file changed, 41 insertions(+), 18 deletions(-)
diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 71c4f35c56..ddbbd736db 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -67,46 +67,64 @@ nfp_devarg_handle_int(const char *key,
return 0;
}
-static void
-nfp_devarg_parse_force_reload_fw(struct rte_kvargs *kvlist,
- bool *force_reload_fw)
+static int
+nfp_devarg_parse_bool_para(struct rte_kvargs *kvlist,
+ const char *key_match,
+ bool *value_ret)
{
int ret;
+ uint32_t count;
uint64_t value;
+ count = rte_kvargs_count(kvlist, key_match);
+ if (count == 0)
+ return 0;
- if (rte_kvargs_count(kvlist, NFP_PF_FORCE_RELOAD_FW) != 1)
- return;
+ if (count > 1) {
+ PMD_DRV_LOG(ERR, "Too much bool arguments: %s", key_match);
+ return -EINVAL;
+ }
- ret = rte_kvargs_process(kvlist, NFP_PF_FORCE_RELOAD_FW, &nfp_devarg_handle_int, &value);
+ ret = rte_kvargs_process(kvlist, key_match, &nfp_devarg_handle_int, &value);
if (ret != 0)
- return;
+ return -EINVAL;
- if (value == 1)
- *force_reload_fw = true;
- else if (value == 0)
- *force_reload_fw = false;
- else
+ if (value == 1) {
+ *value_ret = true;
+ } else if (value == 0) {
+ *value_ret = false;
+ } else {
PMD_DRV_LOG(ERR, "The param does not work, the format is %s=0/1",
- NFP_PF_FORCE_RELOAD_FW);
+ key_match);
+ return -EINVAL;
+ }
+
+ return 0;
}
-static void
+static int
nfp_devargs_parse(struct nfp_devargs *nfp_devargs_param,
const struct rte_devargs *devargs)
{
+ int ret;
struct rte_kvargs *kvlist;
if (devargs == NULL)
- return;
+ return 0;
kvlist = rte_kvargs_parse(devargs->args, NULL);
if (kvlist == NULL)
- return;
+ return -EINVAL;
- nfp_devarg_parse_force_reload_fw(kvlist, &nfp_devargs_param->force_reload_fw);
+ ret = nfp_devarg_parse_bool_para(kvlist, NFP_PF_FORCE_RELOAD_FW,
+ &nfp_devargs_param->force_reload_fw);
+ if (ret != 0)
+ goto exit;
+exit:
rte_kvargs_free(kvlist);
+
+ return ret;
}
static void
@@ -1856,7 +1874,12 @@ nfp_pf_init(struct rte_pci_device *pci_dev)
nfp_eth_set_configured(cpp, index, 0);
}
- nfp_devargs_parse(&pf_dev->devargs, pci_dev->device.devargs);
+ ret = nfp_devargs_parse(&pf_dev->devargs, pci_dev->device.devargs);
+ if (ret != 0) {
+ PMD_INIT_LOG(ERR, "Error when parsing device args");
+ ret = -EINVAL;
+ goto eth_table_cleanup;
+ }
if (nfp_fw_setup(pci_dev, cpp, nfp_eth_table, hwinfo,
dev_info, &pf_dev->multi_pf, pf_dev->devargs.force_reload_fw) != 0) {
--
2.39.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/6] net/nfp: remove redundant NFP service code
2024-06-19 3:06 [PATCH 0/6] refactor the service module Chaoyong He
2024-06-19 3:06 ` [PATCH 1/6] net/nfp: fix check logic for device arguments Chaoyong He
@ 2024-06-19 3:06 ` Chaoyong He
2024-06-19 3:06 ` [PATCH 3/6] net/nfp: remove the flower service dead loop Chaoyong He
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Chaoyong He @ 2024-06-19 3:06 UTC (permalink / raw)
To: dev; +Cc: oss-drivers, Long Wu, Peng Zhang, Chaoyong He
From: Long Wu <long.wu@corigine.com>
The 'rte_eal_init()' will call 'rte_service_start_with_defaults()'
to start service core, map service core and set service state.
NFP service does not have any special needs for these setps, so
remove the redundant NFP service code.
Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
---
drivers/net/nfp/nfp_service.c | 76 +++++------------------------------
drivers/net/nfp/nfp_service.h | 1 -
2 files changed, 10 insertions(+), 67 deletions(-)
diff --git a/drivers/net/nfp/nfp_service.c b/drivers/net/nfp/nfp_service.c
index 24d60857ac..37e2187a3f 100644
--- a/drivers/net/nfp/nfp_service.c
+++ b/drivers/net/nfp/nfp_service.c
@@ -5,68 +5,24 @@
#include "nfp_service.h"
-#include "nfpcore/nfp_cpp.h"
+#include <errno.h>
+#include <rte_cycles.h>
+
#include "nfp_logs.h"
/* Disable service and try to get service status */
#define NFP_SERVICE_DISABLE_WAIT_COUNT 3000
-static int
-nfp_map_service(struct nfp_service_info *info)
-{
- int32_t ret;
- uint32_t slcore = 0;
- int32_t slcore_count;
- uint8_t service_count;
- const char *service_name;
- uint32_t slcore_array[RTE_MAX_LCORE];
- uint8_t min_service_count = UINT8_MAX;
-
- slcore_count = rte_service_lcore_list(slcore_array, RTE_MAX_LCORE);
- if (slcore_count <= 0) {
- PMD_DRV_LOG(DEBUG, "No service cores found");
- return -ENOENT;
- }
-
- /*
- * Find a service core with the least number of services already
- * registered to it
- */
- while (slcore_count--) {
- service_count = rte_service_lcore_count_services(slcore_array[slcore_count]);
- if (service_count < min_service_count) {
- slcore = slcore_array[slcore_count];
- min_service_count = service_count;
- }
- }
-
- service_name = rte_service_get_name(info->id);
- PMD_INIT_LOG(INFO, "Mapping service %s to core %u", service_name, slcore);
-
- ret = rte_service_map_lcore_set(info->id, slcore, 1);
- if (ret != 0) {
- PMD_DRV_LOG(DEBUG, "Could not map flower service");
- return -ENOENT;
- }
-
- rte_service_runstate_set(info->id, 1);
- rte_service_component_runstate_set(info->id, 1);
- rte_service_lcore_start(slcore);
- if (rte_service_may_be_active(slcore))
- PMD_DRV_LOG(INFO, "The service %s is running", service_name);
- else
- PMD_DRV_LOG(ERR, "The service %s is not running", service_name);
-
- info->lcore = slcore;
-
- return 0;
-}
-
int
nfp_service_enable(const struct rte_service_spec *service_spec,
struct nfp_service_info *info)
{
int ret;
+ int32_t lcore_count;
+
+ lcore_count = rte_service_lcore_count();
+ if (lcore_count == 0)
+ return -ENOTSUP;
/* Register the service */
ret = rte_service_component_register(service_spec, &info->id);
@@ -75,12 +31,8 @@ nfp_service_enable(const struct rte_service_spec *service_spec,
return -EINVAL;
}
- /* Map it to available service core */
- ret = nfp_map_service(info);
- if (ret != 0) {
- PMD_DRV_LOG(DEBUG, "Could not map %s", service_spec->name);
- return -EINVAL;
- }
+ /* Set the NFP service runstate of a component. */
+ rte_service_component_runstate_set(info->id, 1);
PMD_DRV_LOG(DEBUG, "Enable service %s successfully", service_spec->name);
@@ -90,7 +42,6 @@ nfp_service_enable(const struct rte_service_spec *service_spec,
int
nfp_service_disable(struct nfp_service_info *info)
{
- int ret;
uint32_t i;
const char *service_name;
@@ -100,7 +51,6 @@ nfp_service_disable(struct nfp_service_info *info)
return -EINVAL;
}
- rte_service_runstate_set(info->id, 0);
rte_service_component_runstate_set(info->id, 0);
for (i = 0; i < NFP_SERVICE_DISABLE_WAIT_COUNT; i++) {
@@ -112,12 +62,6 @@ nfp_service_disable(struct nfp_service_info *info)
if (i == NFP_SERVICE_DISABLE_WAIT_COUNT)
PMD_DRV_LOG(ERR, "Could not stop service %s", service_name);
- ret = rte_service_map_lcore_set(info->id, info->lcore, 0);
- if (ret != 0) {
- PMD_DRV_LOG(DEBUG, "Could not unmap flower service");
- return -ENOENT;
- }
-
rte_service_component_unregister(info->id);
return 0;
diff --git a/drivers/net/nfp/nfp_service.h b/drivers/net/nfp/nfp_service.h
index 4b99d5b973..0db4f8b371 100644
--- a/drivers/net/nfp/nfp_service.h
+++ b/drivers/net/nfp/nfp_service.h
@@ -10,7 +10,6 @@
struct nfp_service_info {
uint32_t id;
- uint32_t lcore;
};
int nfp_service_disable(struct nfp_service_info *info);
--
2.39.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 3/6] net/nfp: remove the flower service dead loop
2024-06-19 3:06 [PATCH 0/6] refactor the service module Chaoyong He
2024-06-19 3:06 ` [PATCH 1/6] net/nfp: fix check logic for device arguments Chaoyong He
2024-06-19 3:06 ` [PATCH 2/6] net/nfp: remove redundant NFP service code Chaoyong He
@ 2024-06-19 3:06 ` Chaoyong He
2024-06-19 3:06 ` [PATCH 4/6] net/nfp: fix disable CPP service Chaoyong He
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Chaoyong He @ 2024-06-19 3:06 UTC (permalink / raw)
To: dev; +Cc: oss-drivers, Long Wu, Peng Zhang, Chaoyong He
From: Long Wu <long.wu@corigine.com>
The flower service does not require high real-time performance,
so remove the dead loop to share service core with other services.
Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
---
drivers/net/nfp/flower/nfp_flower_service.c | 29 +++++++++------------
1 file changed, 13 insertions(+), 16 deletions(-)
diff --git a/drivers/net/nfp/flower/nfp_flower_service.c b/drivers/net/nfp/flower/nfp_flower_service.c
index 515b4abef0..64753f5bf6 100644
--- a/drivers/net/nfp/flower/nfp_flower_service.c
+++ b/drivers/net/nfp/flower/nfp_flower_service.c
@@ -34,28 +34,25 @@ nfp_flower_service_handle_get(struct nfp_net_hw_priv *hw_priv)
}
static int
-nfp_flower_service_loop(void *arg)
+nfp_flower_service_func(void *arg)
{
uint16_t slot;
struct nfp_app_fw_flower *app;
struct nfp_flower_service *service_handle;
service_handle = arg;
- /* Waiting for enabling service */
- while (!service_handle->enabled)
- rte_delay_ms(1);
-
- while (rte_service_runstate_get(service_handle->info.id) != 0) {
- rte_spinlock_lock(&service_handle->spinlock);
- for (slot = 0; slot < MAX_FLOWER_SERVICE_SLOT; slot++) {
- app = service_handle->slots[slot];
- if (app == NULL)
- continue;
-
- nfp_flower_ctrl_vnic_process(app);
- }
- rte_spinlock_unlock(&service_handle->spinlock);
+ if (!service_handle->enabled)
+ return 0;
+
+ rte_spinlock_lock(&service_handle->spinlock);
+ for (slot = 0; slot < MAX_FLOWER_SERVICE_SLOT; slot++) {
+ app = service_handle->slots[slot];
+ if (app == NULL)
+ continue;
+
+ nfp_flower_ctrl_vnic_process(app);
}
+ rte_spinlock_unlock(&service_handle->spinlock);
return 0;
}
@@ -67,7 +64,7 @@ nfp_flower_service_enable(struct nfp_flower_service *service_handle)
const struct rte_service_spec flower_service = {
.name = "flower_ctrl_vnic_service",
- .callback = nfp_flower_service_loop,
+ .callback = nfp_flower_service_func,
.callback_userdata = (void *)service_handle,
};
--
2.39.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 4/6] net/nfp: fix disable CPP service
2024-06-19 3:06 [PATCH 0/6] refactor the service module Chaoyong He
` (2 preceding siblings ...)
2024-06-19 3:06 ` [PATCH 3/6] net/nfp: remove the flower service dead loop Chaoyong He
@ 2024-06-19 3:06 ` Chaoyong He
2024-06-19 3:06 ` [PATCH 5/6] net/nfp: add CPP service enable option Chaoyong He
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Chaoyong He @ 2024-06-19 3:06 UTC (permalink / raw)
To: dev; +Cc: oss-drivers, Long Wu, stable, Peng Zhang, Chaoyong He
From: Long Wu <long.wu@corigine.com>
The CPP service is enabled in 'nfp_pf_init()', so it should be disabled
in corresponding free function 'nfp_pf_uninit()'.
Fixes: 600f6d2c7704 ("net/nfp: add service module")
Cc: stable@dpdk.org
Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
---
drivers/net/nfp/flower/nfp_flower_representor.c | 3 ---
drivers/net/nfp/nfp_cpp_bridge.c | 6 ++++++
drivers/net/nfp/nfp_cpp_bridge.h | 1 +
drivers/net/nfp/nfp_ethdev.c | 1 +
4 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c
index f1451fcca2..700957f945 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.c
+++ b/drivers/net/nfp/flower/nfp_flower_representor.c
@@ -457,9 +457,6 @@ nfp_flower_repr_dev_close(struct rte_eth_dev *dev)
/* Stop flower service first */
nfp_flower_service_stop(app_fw_flower, hw_priv);
- /* Disable cpp service */
- nfp_service_disable(&pf_dev->cpp_service_info);
-
/* Now it is safe to free all PF resources */
nfp_uninit_app_fw_flower(hw_priv);
nfp_pf_uninit(hw_priv);
diff --git a/drivers/net/nfp/nfp_cpp_bridge.c b/drivers/net/nfp/nfp_cpp_bridge.c
index 441c0d2843..fc73fa20ab 100644
--- a/drivers/net/nfp/nfp_cpp_bridge.c
+++ b/drivers/net/nfp/nfp_cpp_bridge.c
@@ -45,6 +45,12 @@ nfp_enable_cpp_service(struct nfp_pf_dev *pf_dev)
return 0;
}
+void
+nfp_disable_cpp_service(struct nfp_pf_dev *pf_dev)
+{
+ nfp_service_disable(&pf_dev->cpp_service_info);
+}
+
/*
* Serving a write request to NFP from host programs. The request
* sends the write size and the CPP target. The bridge makes use
diff --git a/drivers/net/nfp/nfp_cpp_bridge.h b/drivers/net/nfp/nfp_cpp_bridge.h
index 406c961dce..93026c10f4 100644
--- a/drivers/net/nfp/nfp_cpp_bridge.h
+++ b/drivers/net/nfp/nfp_cpp_bridge.h
@@ -9,5 +9,6 @@
#include "nfp_net_common.h"
int nfp_enable_cpp_service(struct nfp_pf_dev *pf_dev);
+void nfp_disable_cpp_service(struct nfp_pf_dev *pf_dev);
#endif /* __NFP_CPP_BRIDGE_H__ */
diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index ddbbd736db..76bbaf1f50 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -641,6 +641,7 @@ nfp_pf_uninit(struct nfp_net_hw_priv *hw_priv)
{
struct nfp_pf_dev *pf_dev = hw_priv->pf_dev;
+ nfp_disable_cpp_service(pf_dev);
nfp_cpp_area_release_free(pf_dev->mac_stats_area);
nfp_cpp_area_release_free(pf_dev->qc_area);
free(pf_dev->sym_tbl);
--
2.39.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 5/6] net/nfp: add CPP service enable option
2024-06-19 3:06 [PATCH 0/6] refactor the service module Chaoyong He
` (3 preceding siblings ...)
2024-06-19 3:06 ` [PATCH 4/6] net/nfp: fix disable CPP service Chaoyong He
@ 2024-06-19 3:06 ` Chaoyong He
2024-06-19 3:06 ` [PATCH 6/6] net/nfp: add CPP service abnormal exit logic Chaoyong He
2024-07-06 18:51 ` [PATCH 0/6] refactor the service module Ferruh Yigit
6 siblings, 0 replies; 8+ messages in thread
From: Chaoyong He @ 2024-06-19 3:06 UTC (permalink / raw)
To: dev; +Cc: oss-drivers, Long Wu, Peng Zhang, Chaoyong He
From: Long Wu <long.wu@corigine.com>
The CPP service is not necessary for NFP PMD,
so add an option as the switch of it.
Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
---
doc/guides/nics/nfp.rst | 9 +++++++++
drivers/net/nfp/nfp_ethdev.c | 21 ++++++++++++++++-----
drivers/net/nfp/nfp_net_common.h | 3 +++
3 files changed, 28 insertions(+), 5 deletions(-)
diff --git a/doc/guides/nics/nfp.rst b/doc/guides/nics/nfp.rst
index 22692bedc0..ed9548de0b 100644
--- a/doc/guides/nics/nfp.rst
+++ b/doc/guides/nics/nfp.rst
@@ -246,6 +246,15 @@ NFP devargs
firmware option, only the first one will cause the firmware reload
and the second one will be ignored.
+- ``cpp_service_enable`` (default **0**)
+
+ The NFP PF PMD supports enable CPP service. For example, user let a PF with
+ PCI ID 0000:af:00.0 enable CPP service by:
+
+ .. code-block:: console
+
+ -a af:00.0,cpp_service_enable=1 -- -i
+
Metadata Format
---------------
diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 76bbaf1f50..696a301650 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -34,6 +34,7 @@
#define NFP_PF_DRIVER_NAME net_nfp_pf
#define NFP_PF_FORCE_RELOAD_FW "force_reload_fw"
+#define NFP_CPP_SERVICE_ENABLE "cpp_service_enable"
struct nfp_net_init {
/** Sequential physical port number, only valid for CoreNIC firmware */
@@ -121,6 +122,11 @@ nfp_devargs_parse(struct nfp_devargs *nfp_devargs_param,
if (ret != 0)
goto exit;
+ ret = nfp_devarg_parse_bool_para(kvlist, NFP_CPP_SERVICE_ENABLE,
+ &nfp_devargs_param->cpp_service_enable);
+ if (ret != 0)
+ goto exit;
+
exit:
rte_kvargs_free(kvlist);
@@ -641,7 +647,8 @@ nfp_pf_uninit(struct nfp_net_hw_priv *hw_priv)
{
struct nfp_pf_dev *pf_dev = hw_priv->pf_dev;
- nfp_disable_cpp_service(pf_dev);
+ if (pf_dev->devargs.cpp_service_enable)
+ nfp_disable_cpp_service(pf_dev);
nfp_cpp_area_release_free(pf_dev->mac_stats_area);
nfp_cpp_area_release_free(pf_dev->qc_area);
free(pf_dev->sym_tbl);
@@ -1993,9 +2000,11 @@ nfp_pf_init(struct rte_pci_device *pci_dev)
}
/* Register the CPP bridge service here for primary use */
- ret = nfp_enable_cpp_service(pf_dev);
- if (ret != 0)
- PMD_INIT_LOG(INFO, "Enable cpp service failed.");
+ if (pf_dev->devargs.cpp_service_enable) {
+ ret = nfp_enable_cpp_service(pf_dev);
+ if (ret != 0)
+ PMD_INIT_LOG(INFO, "Enable cpp service failed.");
+ }
return 0;
@@ -2302,4 +2311,6 @@ static struct rte_pci_driver rte_nfp_net_pf_pmd = {
RTE_PMD_REGISTER_PCI(NFP_PF_DRIVER_NAME, rte_nfp_net_pf_pmd);
RTE_PMD_REGISTER_PCI_TABLE(NFP_PF_DRIVER_NAME, pci_id_nfp_pf_net_map);
RTE_PMD_REGISTER_KMOD_DEP(NFP_PF_DRIVER_NAME, "* igb_uio | uio_pci_generic | vfio");
-RTE_PMD_REGISTER_PARAM_STRING(NFP_PF_DRIVER_NAME, NFP_PF_FORCE_RELOAD_FW "=<0|1>");
+RTE_PMD_REGISTER_PARAM_STRING(NFP_PF_DRIVER_NAME,
+ NFP_PF_FORCE_RELOAD_FW "=<0|1>"
+ NFP_CPP_SERVICE_ENABLE "=<0|1>");
diff --git a/drivers/net/nfp/nfp_net_common.h b/drivers/net/nfp/nfp_net_common.h
index 8d9851f969..2feeb6f5bd 100644
--- a/drivers/net/nfp/nfp_net_common.h
+++ b/drivers/net/nfp/nfp_net_common.h
@@ -94,6 +94,9 @@ struct nfp_process_share {
struct nfp_devargs {
/** Force reload firmware */
bool force_reload_fw;
+
+ /** Enable CPP bridge service */
+ bool cpp_service_enable;
};
struct nfp_pf_dev {
--
2.39.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 6/6] net/nfp: add CPP service abnormal exit logic
2024-06-19 3:06 [PATCH 0/6] refactor the service module Chaoyong He
` (4 preceding siblings ...)
2024-06-19 3:06 ` [PATCH 5/6] net/nfp: add CPP service enable option Chaoyong He
@ 2024-06-19 3:06 ` Chaoyong He
2024-07-06 18:51 ` [PATCH 0/6] refactor the service module Ferruh Yigit
6 siblings, 0 replies; 8+ messages in thread
From: Chaoyong He @ 2024-06-19 3:06 UTC (permalink / raw)
To: dev; +Cc: oss-drivers, Long Wu, Peng Zhang, Chaoyong He
From: Long Wu <long.wu@corigine.com>
As we already use the device argument to control the switch of
CPP service, it is time we can add the abnormal exit logic now.
Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
---
drivers/net/nfp/nfp_ethdev.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 696a301650..181798e8e3 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -2002,8 +2002,10 @@ nfp_pf_init(struct rte_pci_device *pci_dev)
/* Register the CPP bridge service here for primary use */
if (pf_dev->devargs.cpp_service_enable) {
ret = nfp_enable_cpp_service(pf_dev);
- if (ret != 0)
- PMD_INIT_LOG(INFO, "Enable cpp service failed.");
+ if (ret != 0) {
+ PMD_INIT_LOG(ERR, "Enable CPP service failed.");
+ goto hwqueues_cleanup;
+ }
}
return 0;
--
2.39.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/6] refactor the service module
2024-06-19 3:06 [PATCH 0/6] refactor the service module Chaoyong He
` (5 preceding siblings ...)
2024-06-19 3:06 ` [PATCH 6/6] net/nfp: add CPP service abnormal exit logic Chaoyong He
@ 2024-07-06 18:51 ` Ferruh Yigit
6 siblings, 0 replies; 8+ messages in thread
From: Ferruh Yigit @ 2024-07-06 18:51 UTC (permalink / raw)
To: Chaoyong He, dev; +Cc: oss-drivers
On 6/19/2024 4:06 AM, Chaoyong He wrote:
> This patch series refactor the service module, remove some specific
> logic and use the service framework logic as much as possible.
> Also add a device argument to control the enable of CPP service.
>
> Long Wu (6):
> net/nfp: fix check logic for device arguments
> net/nfp: remove redundant NFP service code
> net/nfp: remove the flower service dead loop
> net/nfp: fix disable CPP service
> net/nfp: add CPP service enable option
> net/nfp: add CPP service abnormal exit logic
>
Series applied to dpdk-next-net/main, thanks.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-07-06 18:52 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-19 3:06 [PATCH 0/6] refactor the service module Chaoyong He
2024-06-19 3:06 ` [PATCH 1/6] net/nfp: fix check logic for device arguments Chaoyong He
2024-06-19 3:06 ` [PATCH 2/6] net/nfp: remove redundant NFP service code Chaoyong He
2024-06-19 3:06 ` [PATCH 3/6] net/nfp: remove the flower service dead loop Chaoyong He
2024-06-19 3:06 ` [PATCH 4/6] net/nfp: fix disable CPP service Chaoyong He
2024-06-19 3:06 ` [PATCH 5/6] net/nfp: add CPP service enable option Chaoyong He
2024-06-19 3:06 ` [PATCH 6/6] net/nfp: add CPP service abnormal exit logic Chaoyong He
2024-07-06 18:51 ` [PATCH 0/6] refactor the service module Ferruh Yigit
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).