[v2,18/25] drivers/vdpa: introduce the NFP vDPA library
Checks
Commit Message
Introduce the very basic NFP vDPA library.
Signed-off-by: Shujing Dong <shujing.dong@corigine.com>
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
drivers/vdpa/meson.build | 1 +
drivers/vdpa/nfp/meson.build | 16 ++++++++++++++++
drivers/vdpa/nfp/nfp_vdpa_log.c | 9 +++++++++
drivers/vdpa/nfp/nfp_vdpa_log.h | 21 +++++++++++++++++++++
4 files changed, 47 insertions(+)
create mode 100644 drivers/vdpa/nfp/meson.build
create mode 100644 drivers/vdpa/nfp/nfp_vdpa_log.c
create mode 100644 drivers/vdpa/nfp/nfp_vdpa_log.h
Comments
On 10/24/2023 3:28 AM, Chaoyong He wrote:
> Introduce the very basic NFP vDPA library.
>
> Signed-off-by: Shujing Dong <shujing.dong@corigine.com>
> Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
> Reviewed-by: Long Wu <long.wu@corigine.com>
> Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
<...>
> --- /dev/null
> +++ b/drivers/vdpa/nfp/meson.build
> @@ -0,0 +1,16 @@
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright (c) 2023 Corigine, Inc.
> +
> +if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
> + build = false
> + reason = 'only supported on 64-bit Linux'
> +endif
> +
> +if not dpdk_conf.has('RTE_LIB_VHOST')
> + build = false
> + reason = 'missing dependency, DPDK vhost library'
> +endif
> +
Similar to previous comment, this may break the build.
Instead of this check, it is possible to add vhost and common/nfp as
dependency to this driver, using 'deps'.
> +sources = files(
> + 'nfp_vdpa_log.c',
> +)
> diff --git a/drivers/vdpa/nfp/nfp_vdpa_log.c b/drivers/vdpa/nfp/nfp_vdpa_log.c
> new file mode 100644
> index 0000000000..8c957d59ea
> --- /dev/null
> +++ b/drivers/vdpa/nfp/nfp_vdpa_log.c
> @@ -0,0 +1,9 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright (c) 2023 Corigine, Inc.
> + * All rights reserved.
> + */
> +
> +#include "nfp_vdpa_log.h"
> +
> +RTE_LOG_REGISTER_SUFFIX(nfp_core_logtype, driver, NOTICE);
> +RTE_LOG_REGISTER_SUFFIX(nfp_vdpa_logtype, driver, NOTICE);
>
Both has 'driver' has suffix, I assume copy/paste error.
> On 10/24/2023 3:28 AM, Chaoyong He wrote:
> > Introduce the very basic NFP vDPA library.
> >
> > Signed-off-by: Shujing Dong <shujing.dong@corigine.com>
> > Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
> > Reviewed-by: Long Wu <long.wu@corigine.com>
> > Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
>
> <...>
>
> > --- /dev/null
> > +++ b/drivers/vdpa/nfp/meson.build
> > @@ -0,0 +1,16 @@
> > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2023
> > +Corigine, Inc.
> > +
> > +if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
> > + build = false
> > + reason = 'only supported on 64-bit Linux'
> > +endif
> > +
> > +if not dpdk_conf.has('RTE_LIB_VHOST')
> > + build = false
> > + reason = 'missing dependency, DPDK vhost library'
> > +endif
> > +
>
> Similar to previous comment, this may break the build.
> Instead of this check, it is possible to add vhost and common/nfp as
> dependency to this driver, using 'deps'.
>
Sorry for that, I will drop it in the next version.
>
> > +sources = files(
> > + 'nfp_vdpa_log.c',
> > +)
> > diff --git a/drivers/vdpa/nfp/nfp_vdpa_log.c
> > b/drivers/vdpa/nfp/nfp_vdpa_log.c new file mode 100644 index
> > 0000000000..8c957d59ea
> > --- /dev/null
> > +++ b/drivers/vdpa/nfp/nfp_vdpa_log.c
> > @@ -0,0 +1,9 @@
> > +/* SPDX-License-Identifier: BSD-3-Clause
> > + * Copyright (c) 2023 Corigine, Inc.
> > + * All rights reserved.
> > + */
> > +
> > +#include "nfp_vdpa_log.h"
> > +
> > +RTE_LOG_REGISTER_SUFFIX(nfp_core_logtype, driver, NOTICE);
> > +RTE_LOG_REGISTER_SUFFIX(nfp_vdpa_logtype, driver, NOTICE);
> >
>
> Both has 'driver' has suffix, I assume copy/paste error.
Thanks point that out, will revise in the next version.
@@ -8,6 +8,7 @@ endif
drivers = [
'ifc',
'mlx5',
+ 'nfp',
'sfc',
]
std_deps = ['bus_pci', 'kvargs']
new file mode 100644
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2023 Corigine, Inc.
+
+if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
+ build = false
+ reason = 'only supported on 64-bit Linux'
+endif
+
+if not dpdk_conf.has('RTE_LIB_VHOST')
+ build = false
+ reason = 'missing dependency, DPDK vhost library'
+endif
+
+sources = files(
+ 'nfp_vdpa_log.c',
+)
new file mode 100644
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Corigine, Inc.
+ * All rights reserved.
+ */
+
+#include "nfp_vdpa_log.h"
+
+RTE_LOG_REGISTER_SUFFIX(nfp_core_logtype, driver, NOTICE);
+RTE_LOG_REGISTER_SUFFIX(nfp_vdpa_logtype, driver, NOTICE);
new file mode 100644
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Corigine, Inc.
+ * All rights reserved.
+ */
+
+#ifndef __NFP_VDPA_LOG_H__
+#define __NFP_VDPA_LOG_H__
+
+#include <rte_log.h>
+
+extern int nfp_vdpa_logtype;
+#define DRV_VDPA_LOG(level, fmt, args...) \
+ rte_log(RTE_LOG_ ## level, nfp_vdpa_logtype, \
+ "NFP_VDPA: %s(): " fmt "\n", __func__, ## args)
+
+extern int nfp_core_logtype;
+#define DRV_CORE_LOG(level, fmt, args...) \
+ rte_log(RTE_LOG_ ## level, nfp_core_logtype, \
+ "NFP_CORE: %s(): " fmt "\n", __func__, ## args)
+
+#endif /* __NFP_VDPA_LOG_H__ */