Re: [PATCH 02/13] net/sxe: add ethdev probe and remove

Stephen Hemminger
2025-04-26T16:15:59Z

On Thu, 24 Apr 2025 19:36:41 -0700
Jie Liu <liujie5@linkdatatechnology.com> wrote:

> diff --git a/drivers/net/sxe/base/sxe_logs.h b/drivers/net/sxe/base/sxe_logs.h
> new file mode 100644
> index 0000000000..e90b563eac
> --- /dev/null
> +++ b/drivers/net/sxe/base/sxe_logs.h
> @@ -0,0 +1,273 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright (C), 2022, Linkdata Technology Co., Ltd.
> + */
> +
> +#ifndef _SXE_LOGS_H_
> +#define _SXE_LOGS_H_
> +
> +#include <stdio.h>
> +#include <sys/time.h>
> +#include <pthread.h>
> +
> +#include "sxe_types.h"
> +
> +#define LOG_FILE_NAME_LEN 256
> +#define LOG_FILE_PATH "/var/log/"
> +#define LOG_FILE_PREFIX "sxepmd.log"
> +
> +extern s32 sxe_log_init;
> +extern s32 sxe_log_rx;
> +extern s32 sxe_log_tx;
> +extern s32 sxe_log_drv;
> +extern s32 sxe_log_hw;
> +
> +#define RTE_LOGTYPE_sxe_log_init sxe_log_init
> +#define RTE_LOGTYPE_sxe_log_rx sxe_log_rx
> +#define RTE_LOGTYPE_sxe_log_tx sxe_log_tx
> +#define RTE_LOGTYPE_sxe_log_drv sxe_log_drv
> +#define RTE_LOGTYPE_sxe_log_hw sxe_log_hw
> +
> +#define INIT sxe_log_init
> +#define RX sxe_log_rx
> +#define TX sxe_log_tx
> +#define HW sxe_log_hw
> +#define DRV sxe_log_drv
> +
> +#define UNUSED(x) ((void)(x))
> +
> +#define TIME(log_time) \
> + do { \
> + struct timeval tv; \
> + struct tm *td; \
> + gettimeofday(&tv, NULL); \
> + td = localtime(&tv.tv_sec); \
> + strftime(log_time, sizeof(log_time), "%Y-%m-%d-%H:%M:%S", td); \
> + } while (0)
> +
> +#define filename_printf(x) (strrchr((x), '/') ? strrchr((x), '/') + 1 : (x))
> +
> +#ifdef SXE_DPDK_DEBUG
> +#define PMD_LOG_DEBUG(logtype, ...) \

NAK
Not carrying custom backport code in the upstream tree.

This driver is abusing the idea behind base/ code.
In DPDK base directory is intended for code shared between multiple platforms.
I.e some vendors support DPDK, BSD, VmWare, and even Linux with common code.

The base directory is not intended as a backport hook.