[External] Re: [PATCH 2/2] net/mlx5: improve log file path
Yang Ming
ming.1.yang at nokia-sbell.com
Wed Mar 12 03:32:50 CET 2025
On 2025/3/10 22:59, Stephen Hemminger wrote:
> Caution: This is an external email. Please be very careful when clicking links or opening attachments. See http://nok.it/nsb for additional information.
>
> On Tue, 4 Mar 2025 06:23:06 +0000
> Bing Zhao <bingz at nvidia.com> wrote:
>
>> Hi Ming,
>>
>>> -----Original Message-----
>>> From: Yang Ming <ming.1.yang at nokia-sbell.com>
>>> Sent: Friday, December 13, 2024 5:25 PM
>>> To: Dariusz Sosnowski <dsosnowski at nvidia.com>; Slava Ovsiienko
>>> <viacheslavo at nvidia.com>; Bing Zhao <bingz at nvidia.com>; Ori Kam
>>> <orika at nvidia.com>; Suanming Mou <suanmingm at nvidia.com>; Matan Azrad
>>> <matan at nvidia.com>
>>> Cc: dev at dpdk.org; Yang Ming <ming.1.yang at nokia-sbell.com>
>>> Subject: [PATCH 2/2] net/mlx5: improve log file path
>>>
>>> External email: Use caution opening links or attachments
>>>
>>>
>>> 1. /var/log is hard code which is not a good coding style.
>>> 2. /var/log may be not allowed to be written via container's read-only
>>> mode.
>>>
>>> Signed-off-by: Yang Ming <ming.1.yang at nokia-sbell.com>
>>> ---
>>> drivers/net/mlx5/mlx5_rxtx.c | 3 ++-
>>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
>>> index eadadcdffb..a0da73c9c3 100644
>>> --- a/drivers/net/mlx5/mlx5_rxtx.c
>>> +++ b/drivers/net/mlx5/mlx5_rxtx.c
>>> @@ -12,6 +12,7 @@
>>> #include <rte_prefetch.h>
>>> #include <rte_common.h>
>>> #include <rte_branch_prediction.h>
>>> +#include <rte_eal.h>
>>> #include <rte_ether.h>
>>> #include <rte_cycles.h>
>>> #include <rte_flow.h>
>>> @@ -311,7 +312,7 @@ mlx5_set_swp_types_table(void)
>>> }
>>> }
>>>
>>> -#define MLX5_SYSTEM_LOG_DIR "/var/log"
>>> +#define MLX5_SYSTEM_LOG_DIR rte_eal_get_runtime_dir()
>> I agree that using the fixed PATH is not a good practice. Can you ensure that the runtime DIR is with RW+ permissions?
> Drivers doing any kind of custom logging is bad practice.
> This should be handled by EAL logging, not private fprintf's
>
>
>
Hi Stephen,
Yes, I completely agree with you. The DPDK driver should utilize EAL
logging instead of fprintf. We have recently addressed an issue where
DPDK was applied in a container with a read-only file system mode. In
this mode, the /var/log directory is read-only. However, when DPDK is
running, the directory specified by rte_eal_get_runtime_dir() must be
configured with read-write permissions. Therefore, we have made this
minor improvement.
Please note that we are not the developers of the Mellanox CX4/CX5 NIC,
nor are we affiliated with the manufacturer of these NICs. As such, we
are unable to make the improvements you described.
Brs,
Yang Ming
More information about the dev
mailing list