已开启
Kunpeng-hinci3-patch #748
AtomGit-Bot创建于 2025年7月23日
Kunpeng-hinci3-patch #748
已开启
AtomGit-Bot创建于 2025年7月23日
从refs/pull/748/head合入到master
共 11 个文件变更+54406-1
此文件变更行数或变更字符数较多,你可以直接 查看源码
@@ -0,0 +1,588 @@
1+From e03dfd213b84df966b38d88ba4a82a7712b03bd8 Mon Sep 17 00:00:00 2001
2+From: zry6666 <zhangruiyu2@huawei.com>
3+Date: Thu, 26 Jun 2025 16:47:38 +0800
4+Subject: [PATCH] remove macro HAVE_OVS_DPDK
5+ 
6+---
7+ drivers/net/hinic3/meson.build | 7 +++-
8+ .../common/hinic3_utils/hinic3_file_util.c | 41 -------------------
9+ .../common/hinic3_utils/hinic3_file_util.h | 1 -
10+ .../hinic3_utils/hinic3_packets_types.h | 2 -
11+ .../common/hinic3_utils/hinic3_set_userdata.c | 2 -
12+ .../src/common/hinic3_utils/hinic3_util.c | 3 --
13+ .../hinic3_capture/hinic3_capture_command.c | 2 -
14+ .../src/hinic3_capture/hinic3_capture_core.c | 2 -
15+ .../hinic3_capture/hinic3_capture_filter.c | 5 ---
16+ .../src/hinic3_capture/hinic3_capture_hooks.c | 2 -
17+ .../src/hinic3_capture/hinic3_capture_main.c | 2 -
18+ .../src/hinic3_capture/hinic3_capture_save.c | 2 -
19+ .../src/hinic3_capture/hinic3_capture_utils.c | 2 -
20+ .../comm/hinic3_agent_flow_cmd_dump_file.c | 6 ---
21+ .../comm/hinic3_dfx_port_bond_slave.c | 2 -
22+ .../comm/hinic3_dfx_port_flush_dump.c | 2 -
23+ .../comm/hinic3_dfx_port_upcall_queue.c | 2 -
24+ .../src/hinic3_cmds/server/hinic3_command.c | 34 ---------------
25+ .../hinic3_iface_global.c | 2 -
26+ .../hinic3_iface_global_api_record.c | 2 -
27+ .../comm/hinic3_offload_flow_public.c | 2 -
28+ .../hinic3_flow_dump/hinic3_flow_api.c | 2 -
29+ .../hinic3_flows/hinic3_vxlan/hinic3_vxlan.c | 2 -
30+ .../hinic3/src/hinic3_init/comm/hinic3_init.c | 2 -
31+ .../hinic3_bond/hinic3_bond_controller.c | 2 -
32+ .../hinic3_bond/hinic3_bond_controller.h | 2 -
33+ .../hinic3_bond/hinic3_bond_statistics.c | 2 -
34+ .../hinic3_vf/hinic3_function_statistics.c | 2 -
35+ .../hinic3_vf/hinic3_vf_controller.h | 2 -
36+ .../hinic3_ports/hinic3_vf/hinic3_vf_mgmt.c | 3 --
37+ .../hinic3/src/hinic3_qos/meter/hinic3_qos.c | 2 -
38+ 31 files changed, 6 insertions(+), 140 deletions(-)
39+ 
40+diff --git a/drivers/net/hinic3/meson.build b/drivers/net/hinic3/meson.build
41+index af0793845f..77916f79e1 100644
42+--- a/drivers/net/hinic3/meson.build
43++++ b/drivers/net/hinic3/meson.build
44+@@ -174,7 +174,12 @@ foreach d:deps
45+ static_deps += [get_variable('static_rte_' + d)]
46+ endforeach
47+
48+-executable('dpak_ovs_ctl',
49++executable('dpak-ovs-ctl',
50+ 'src/hinic3_cmds/client/hinic3_command_client.c',
51+ include_directories: includes,
52++ install_rpath: '/usr/bin',
53++ install: true
54+ )
55++
56++install_data('cfg/ovs_dpu_virt/agent_config.ini', install_dir: '/etc/dpak/net')
57++install_data('scripts/dpak_ovs_completion_ovs.sh', install_dir: '/etc/bash_completion.d')
58+diff --git a/drivers/net/hinic3/src/common/hinic3_utils/hinic3_file_util.c b/drivers/net/hinic3/src/common/hinic3_utils/hinic3_file_util.c
59+index 2cefeaafd7..9635cedcbf 100644
60+--- a/drivers/net/hinic3/src/common/hinic3_utils/hinic3_file_util.c
61++++ b/drivers/net/hinic3/src/common/hinic3_utils/hinic3_file_util.c
62+@@ -65,8 +65,6 @@ static bool hinic3_check_directory_existence(char *path)
63+ static int hinic3_mkdir(char *path)
64+ {
65+ char dir_path[PATH_MAX];
66+- struct passwd *user = NULL;
67+- struct group *grp = NULL;
68+ int ret;
69+
70+ ret = snprintf(dir_path, PATH_MAX, "%s", path);
71+@@ -80,29 +78,6 @@ static int hinic3_mkdir(char *path)
72+ return -1;
73+ }
74+
75+- user = getpwnam(HINIC3_FILE_USER);
76+- if (user == NULL) {
77+- HINIC3_LOG(ERR, AGENT, "get file directory user fail, path: %s", path);
78+- return 0;
79+- }
80+- grp = getgrnam(HINIC3_FILE_GROUP);
81+- if (grp == NULL) {
82+- HINIC3_LOG(ERR, AGENT, "get file directory group fail, path: %s", path);
83+- return 0;
84+- }
85+-
86+- if (hinic3_check_masked_to_exact_switch() == false) {
87+- if (chown(path, -1, grp->gr_gid) == -1) {
88+- HINIC3_LOG(ERR, AGENT, "change file directory group fail, path: %s", path);
89+- return 0;
90+- }
91+- } else {
92+- if (chown(path, user->pw_uid, grp->gr_gid) == -1) {
93+- HINIC3_LOG(ERR, AGENT, "change file directory user and group fail, path: %s", path);
94+- return 0;
95+- }
96+- }
97+-
98+ return 0;
99+ }
100+
101+@@ -192,22 +167,6 @@ static bool hinic3_is_directory_reach_limit(void)
102+ return false;
103+ }
104+
105+-int hinic3_agent_chown_output_file_path(const char *resolve_path)
106+-{
107+- struct group *grp = getgrnam(HINIC3_OVS_GROUP_NAME);
108+- if (grp != NULL) {
109+- gid_t group_id = grp->gr_gid;
110+- if (chown(resolve_path, -1, group_id) == -1) {
111+- HINIC3_LOG(ERR, AGENT, "chown fail, errno: %d", errno);
112+- return -1;
113+- }
114+- } else {
115+- HINIC3_LOG(ERR, AGENT, "getgrnam %s fail", HINIC3_OVS_GROUP_NAME);
116+- return -1;
117+- }
118+- return 0;
119+-}
120+-
121+ int hinic3_check_output_file_directory(const char *filename, char *absolute_path, unsigned int path_len, struct ds *ds)
122+ {
123+ int ret;
124+diff --git a/drivers/net/hinic3/src/common/hinic3_utils/hinic3_file_util.h b/drivers/net/hinic3/src/common/hinic3_utils/hinic3_file_util.h
125+index 70313bf2cd..806218c8cc 100644
126+--- a/drivers/net/hinic3/src/common/hinic3_utils/hinic3_file_util.h
127++++ b/drivers/net/hinic3/src/common/hinic3_utils/hinic3_file_util.h
128+@@ -11,7 +11,6 @@
129+
130+ const char *hinic3_get_default_directory(void);
131+ int hinic3_check_output_file_directory(const char *filename, char *absolute_path, unsigned int path_len, struct ds *ds);
132+-int hinic3_agent_chown_output_file_path(const char *resolve_path);
133+ uint64_t hinic3_get_default_file_directory_size(bool *is_obtained);
134+ uint64_t hinic3_get_partition_free_space_size(void);
135+ int hinic3_check_file_realpath(const char *absolute_path, char *resolve_path, struct ds *ds);
136+diff --git a/drivers/net/hinic3/src/common/hinic3_utils/hinic3_packets_types.h b/drivers/net/hinic3/src/common/hinic3_utils/hinic3_packets_types.h
137+index aec6355bd4..9f8c1d711d 100644
138+--- a/drivers/net/hinic3/src/common/hinic3_utils/hinic3_packets_types.h
139++++ b/drivers/net/hinic3/src/common/hinic3_utils/hinic3_packets_types.h
140+@@ -323,9 +323,7 @@ struct padding_info {
141+ };
142+
143+ struct hinic3_packet {
144+-#ifdef HAVE_OVS_DPDK
145+ struct rte_mbuf mbuf;
146+-#endif
147+ /* basic packet info */
148+ hinic3_be16 dl_type;
149+ uint16_t l3_ofs; /* l3 header offset, or UINT16_MAX. */
150+diff --git a/drivers/net/hinic3/src/common/hinic3_utils/hinic3_set_userdata.c b/drivers/net/hinic3/src/common/hinic3_utils/hinic3_set_userdata.c
151+index 1ab68bd1c1..6842024acc 100644
152+--- a/drivers/net/hinic3/src/common/hinic3_utils/hinic3_set_userdata.c
153++++ b/drivers/net/hinic3/src/common/hinic3_utils/hinic3_set_userdata.c
154+@@ -18,9 +18,7 @@
155+ #include "hinic3_offload_flow.h"
156+ #include "hinic3_iface_global.h"
157+ #include "hinic3_set_userdata.h"
158+-#ifdef HAVE_OVS_DPDK
159+ #include "hinic3_dpdk_adapter.h"
160+-#endif
161+
162+ #define HINIC3_METER_RTE_MBUF_GET_PTR 8
163+
164+diff --git a/drivers/net/hinic3/src/common/hinic3_utils/hinic3_util.c b/drivers/net/hinic3/src/common/hinic3_utils/hinic3_util.c
165+index aa7484de07..a4d4c5c98e 100644
166+--- a/drivers/net/hinic3/src/common/hinic3_utils/hinic3_util.c
167++++ b/drivers/net/hinic3/src/common/hinic3_utils/hinic3_util.c
168+@@ -14,10 +14,7 @@
169+ #include "rte_ethdev.h"
170+ #include "hinic3_meminfo.h"
171+ #include "hinic3_string_util.h"
172+-
173+-#ifdef HAVE_OVS_DPDK
174+ #include "hinic3_dpdk_adapter.h"
175+-#endif
176+
177+ #define HINIC3_HEX_PREFIX_LEN 2
178+ static clockid_t g_monotonic_clock = CLOCK_MONOTONIC;
179+diff --git a/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_command.c b/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_command.c
180+index 099d7b198e..919c5f1484 100644
181+--- a/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_command.c
182++++ b/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_command.c
183+@@ -11,10 +11,8 @@
184+ #include "rte_cycles.h"
185+ #include "rte_lcore.h"
186+ #include "rte_spinlock.h"
187+-#ifdef HAVE_OVS_DPDK
188+ #include "hinic3_dpdk_adapter.h"
189+ #include "hinic3_ovs_adapter.h"
190+-#endif
191+
192+ #include "hinic3_ds.h"
193+ #include "hinic3_log.h"
194+diff --git a/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_core.c b/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_core.c
195+index 328ce6522b..34afa037a8 100644
196+--- a/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_core.c
197++++ b/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_core.c
198+@@ -13,11 +13,9 @@
199+ #include "hinic3_iface_global.h"
200+ #include "hinic3_capture_filter.h"
201+ #include "hinic3_capture_save.h"
202+-#ifdef HAVE_OVS_DPDK
203+ #include "hinic3_dpdk_adapter.h"
204+ #include "hinic3_ovs_adapter.h"
205+ #include "hinic3_capture_core.h"
206+-#endif
207+
208+ static inline void
209+ pcap_hinic3_pkt_summary_init(struct pcap_pkt_summary *buf, struct rte_mbuf *pkt)
210+diff --git a/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_filter.c b/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_filter.c
211+index 61c36faf0d..d1c44faa20 100644
212+--- a/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_filter.c
213++++ b/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_filter.c
214+@@ -1116,11 +1116,6 @@ pcap_file_open(const char *file_name, const char *mode)
215+ return NULL;
216+ }
217+
218+- if (hinic3_agent_chown_output_file_path(file_name) != 0) {
219+- fclose(file);
220+- return NULL;
221+- }
222+-
223+ return file;
224+ }
225+
226+diff --git a/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_hooks.c b/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_hooks.c
227+index 4c38fe7544..b33be8bb7f 100644
228+--- a/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_hooks.c
229++++ b/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_hooks.c
230+@@ -13,10 +13,8 @@
231+ #include "rte_cycles.h"
232+ #include "rte_lcore.h"
233+ #include "rte_spinlock.h"
234+-#ifdef HAVE_OVS_DPDK
235+ #include "hinic3_dpdk_adapter.h"
236+ #include "hinic3_ovs_adapter.h"
237+-#endif
238+
239+ #include "hinic3_log.h"
240+ #include "hinic3_init.h"
241+diff --git a/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_main.c b/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_main.c
242+index a87f38f69a..a66844347f 100644
243+--- a/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_main.c
244++++ b/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_main.c
245+@@ -12,10 +12,8 @@
246+ #include "rte_lcore.h"
247+ #include "rte_spinlock.h"
248+ #include "hinic3_thread.h"
249+-#ifdef HAVE_OVS_DPDK
250+ #include "hinic3_dpdk_adapter.h"
251+ #include "hinic3_ovs_adapter.h"
252+-#endif
253+
254+ #include "hinic3_log.h"
255+ #include "hinic3_init.h"
256+diff --git a/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_save.c b/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_save.c
257+index ffc1c5d40c..75e08f61c5 100644
258+--- a/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_save.c
259++++ b/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_save.c
260+@@ -13,10 +13,8 @@
261+ #include "rte_cycles.h"
262+ #include "rte_lcore.h"
263+ #include "rte_spinlock.h"
264+-#ifdef HAVE_OVS_DPDK
265+ #include "hinic3_dpdk_adapter.h"
266+ #include "hinic3_ovs_adapter.h"
267+-#endif
268+
269+ #include "hinic3_log.h"
270+ #include "hinic3_init.h"
271+diff --git a/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_utils.c b/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_utils.c
272+index dedcaf590b..3dcec18e5b 100644
273+--- a/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_utils.c
274++++ b/drivers/net/hinic3/src/hinic3_capture/hinic3_capture_utils.c
275+@@ -28,11 +28,9 @@
276+ #include "hinic3_ds.h"
277+ #include "hinic3_ui_string.h"
278+ #include "hinic3_dpdk_adapter.h"
279+-#ifdef HAVE_OVS_DPDK
280+ #include "hinic3_dpdk_adapter.h"
281+ #include "hinic3_ovs_adapter.h"
282+ #include "hinic3_capture_utils.h"
283+-#endif
284+
285+ #define HINIC3_EVENT_FD_INVAILD (-1)
286+ uint64_t g_ticks_per_ms;
287+diff --git a/drivers/net/hinic3/src/hinic3_cmds/comm/hinic3_agent_flow_cmd_dump_file.c b/drivers/net/hinic3/src/hinic3_cmds/comm/hinic3_agent_flow_cmd_dump_file.c
288+index 852ed9486e..1b2cbf763a 100644
289+--- a/drivers/net/hinic3/src/hinic3_cmds/comm/hinic3_agent_flow_cmd_dump_file.c
290++++ b/drivers/net/hinic3/src/hinic3_cmds/comm/hinic3_agent_flow_cmd_dump_file.c
291+@@ -115,12 +115,6 @@ hinic3_agent_parse_output_file_path(struct hinic3_dump_all_flows_mgmt_t *m, int
292+ goto fail;
293+ }
294+
295+- if (hinic3_agent_chown_output_file_path(resolve_path) != 0) {
296+- fclose(m->file);
297+- m->file = NULL;
298+- goto fail;
299+- }
300+-
301+ hinic3_free(resolve_path);
302+ return 0;
303+
304+diff --git a/drivers/net/hinic3/src/hinic3_cmds/comm/hinic3_dfx_port_bond_slave.c b/drivers/net/hinic3/src/hinic3_cmds/comm/hinic3_dfx_port_bond_slave.c
305+index fd46999cb7..af069cba92 100644
306+--- a/drivers/net/hinic3/src/hinic3_cmds/comm/hinic3_dfx_port_bond_slave.c
307++++ b/drivers/net/hinic3/src/hinic3_cmds/comm/hinic3_dfx_port_bond_slave.c
308+@@ -20,9 +20,7 @@
309+ #include "hinic3_smap.h"
310+ #include "hinic3_command.h"
311+ #include "hinic3_vf_controller.h"
312+-#ifdef HAVE_OVS_DPDK
313+ #include "hinic3_dpdk_adapter.h"
314+-#endif
315+ #include "hinic3_dfx_port.h"
316+
317+ static void
318+diff --git a/drivers/net/hinic3/src/hinic3_cmds/comm/hinic3_dfx_port_flush_dump.c b/drivers/net/hinic3/src/hinic3_cmds/comm/hinic3_dfx_port_flush_dump.c
319+index e9d8f2b99a..471bba5d1d 100644
320+--- a/drivers/net/hinic3/src/hinic3_cmds/comm/hinic3_dfx_port_flush_dump.c
321++++ b/drivers/net/hinic3/src/hinic3_cmds/comm/hinic3_dfx_port_flush_dump.c
322+@@ -14,9 +14,7 @@
323+ #include "hinic3_bond_controller.h"
324+ #include "hinic3_agent_cmd_format.h"
325+ #include "rte_ethdev.h"
326+-#ifdef HAVE_OVS_DPDK
327+ #include "hinic3_dpdk_adapter.h"
328+-#endif
329+
330+ #define HINIC3_LINK_STATUS_STR_LEN 10
331+ #define HINIC3_LINK_STATUS_NUM 2
332+diff --git a/drivers/net/hinic3/src/hinic3_cmds/comm/hinic3_dfx_port_upcall_queue.c b/drivers/net/hinic3/src/hinic3_cmds/comm/hinic3_dfx_port_upcall_queue.c
333+index fc6d3f2c71..2f6c76c205 100644
334+--- a/drivers/net/hinic3/src/hinic3_cmds/comm/hinic3_dfx_port_upcall_queue.c
335++++ b/drivers/net/hinic3/src/hinic3_cmds/comm/hinic3_dfx_port_upcall_queue.c
336+@@ -9,9 +9,7 @@
337+ #include "hinic3_vf_port_qos_public.h"
338+ #include "hinic3_vf_controller.h"
339+ #include "hinic3_bond_controller.h"
340+-#ifdef HAVE_OVS_DPDK
341+ #include "hinic3_dpdk_adapter.h"
342+-#endif
343+
344+ static int
345+ hinic3_dump_virtual_upcall_queues_info(struct ds *ds)
346+diff --git a/drivers/net/hinic3/src/hinic3_cmds/server/hinic3_command.c b/drivers/net/hinic3/src/hinic3_cmds/server/hinic3_command.c
347+index 9208521eed..7fdf61fc46 100644
348+--- a/drivers/net/hinic3/src/hinic3_cmds/server/hinic3_command.c
349++++ b/drivers/net/hinic3/src/hinic3_cmds/server/hinic3_command.c
350+@@ -480,34 +480,6 @@ hinic3_command_thread(void *arg)
351+ return 0;
352+ }
353+
354+-static int
355+-hinic3_change_group(void)
356+-{
357+- int ret;
358+- gid_t group_id;
359+- struct group *grp;
360+-
361+- grp = getgrnam(HINIC3_OVS_GROUP_NAME);
362+- if (grp == NULL) {
363+- HINIC3_LOG(ERR, AGENT, "getgrnam fail");
364+- return -1;
365+- }
366+- group_id = grp->gr_gid;
367+-
368+- ret = chown(SOCKET_PATH, -1, group_id);
369+- if (ret == -1) {
370+- HINIC3_LOG(ERR, AGENT, "chown fail");
371+- return -1;
372+- }
373+-
374+- ret = chmod(SOCKET_PATH, HINIC3_SOCKET_RIGHT);
375+- if (ret == -1) {
376+- HINIC3_LOG(ERR, AGENT, "chmod fail");
377+- return -1;
378+- }
379+- return 0;
380+-}
381+-
382+ static int
383+ hinic3_command_pre_init(int *listen_socket)
384+ {
385+@@ -607,12 +579,6 @@ hinic3_command_mgr_init(void)
386+ return ret;
387+ }
388+
389+- ret = hinic3_change_group();
390+- if (ret != 0) {
391+- HINIC3_LOG(ERR, AGENT, "change group fail");
392+- return ret;
393+- }
394+-
395+ HINIC3_LOG(INFO, AGENT, "command mgr init success");
396+ return 0;
397+ }
398+diff --git a/drivers/net/hinic3/src/hinic3_driver_adapter/hinic3_iface_global.c b/drivers/net/hinic3/src/hinic3_driver_adapter/hinic3_iface_global.c
399+index 8ee1b5a343..13e1f2cac0 100644
400+--- a/drivers/net/hinic3/src/hinic3_driver_adapter/hinic3_iface_global.c
401++++ b/drivers/net/hinic3/src/hinic3_driver_adapter/hinic3_iface_global.c
402+@@ -21,10 +21,8 @@
403+ #include "hinic3_smap.h"
404+ #include "hinic3_ds.h"
405+ #include "hinic3_iface_global.h"
406+-#ifdef HAVE_OVS_DPDK
407+ #include "hinic3_dpdk_adapter.h"
408+ #include "hinic3_ovs_adapter.h"
409+-#endif
410+ #include "hinic3_command.h"
411+ #include "hinic3_parse_agent_config.h"
412+ #include "hinic3_ui_string.h"
413+diff --git a/drivers/net/hinic3/src/hinic3_driver_adapter/hinic3_iface_global_api_record.c b/drivers/net/hinic3/src/hinic3_driver_adapter/hinic3_iface_global_api_record.c
414+index b76c281320..852f9bf23d 100644
415+--- a/drivers/net/hinic3/src/hinic3_driver_adapter/hinic3_iface_global_api_record.c
416++++ b/drivers/net/hinic3/src/hinic3_driver_adapter/hinic3_iface_global_api_record.c
417+@@ -19,10 +19,8 @@
418+ #include "hinic3_util.h"
419+ #include "hinic3_iface_global.h"
420+ #include "hinic3_ds.h"
421+-#ifdef HAVE_OVS_DPDK
422+ #include "hinic3_dpdk_adapter.h"
423+ #include "hinic3_ovs_adapter.h"
424+-#endif
425+ #include "hinic3_iface_global_api_record.h"
426+
427+ hiovs_api_record g_global_api_record[HINIC3_GLOBAL_API_MAX];
428+diff --git a/drivers/net/hinic3/src/hinic3_flows/comm/hinic3_offload_flow_public.c b/drivers/net/hinic3/src/hinic3_flows/comm/hinic3_offload_flow_public.c
429+index b84961a241..3b817fc4ea 100644
430+--- a/drivers/net/hinic3/src/hinic3_flows/comm/hinic3_offload_flow_public.c
431++++ b/drivers/net/hinic3/src/hinic3_flows/comm/hinic3_offload_flow_public.c
432+@@ -10,10 +10,8 @@
433+ #include "hinic3_iface_global.h"
434+ #include "hinic3_iface_flow.h"
435+ #include "hinic3_log.h"
436+-#ifdef HAVE_OVS_DPDK
437+ #include "hinic3_dpdk_adapter.h"
438+ #include "hinic3_ovs_adapter.h"
439+-#endif
440+
441+ void hinic3_offload_thread_rx_put_ack(uint32_t thread_id, struct hinic3_dp_extend_info *dp_info)
442+ {
443+diff --git a/drivers/net/hinic3/src/hinic3_flows/hinic3_flow_dump/hinic3_flow_api.c b/drivers/net/hinic3/src/hinic3_flows/hinic3_flow_dump/hinic3_flow_api.c
444+index 48d89eab81..289d6ed92a 100644
445+--- a/drivers/net/hinic3/src/hinic3_flows/hinic3_flow_dump/hinic3_flow_api.c
446++++ b/drivers/net/hinic3/src/hinic3_flows/hinic3_flow_dump/hinic3_flow_api.c
447+@@ -21,11 +21,9 @@
448+ #include "hinic3_agent_flow_cmd_dump.h"
449+ #include "hinic3_agent_cmd_format.h"
450+ #include "hinic3_offload_flow.h"
451+-#ifdef HAVE_OVS_DPDK
452+ #include "hinic3_dpdk_adapter.h"
453+ #include "hinic3_ovs_adapter.h"
454+ #include "hinic3_iface_flow.h"
455+-#endif
456+
457+ #define HINIC3_NO_FOUND_FLOW (-4)
458+ uint64_t g_get_related_ufid;
459+diff --git a/drivers/net/hinic3/src/hinic3_flows/hinic3_vxlan/hinic3_vxlan.c b/drivers/net/hinic3/src/hinic3_flows/hinic3_vxlan/hinic3_vxlan.c
460+index 3349adfb83..4889c37cf7 100644
461+--- a/drivers/net/hinic3/src/hinic3_flows/hinic3_vxlan/hinic3_vxlan.c
462++++ b/drivers/net/hinic3/src/hinic3_flows/hinic3_vxlan/hinic3_vxlan.c
463+@@ -2,9 +2,7 @@
464+ * Copyright(c) 2023 Huawei Technologies Co., Ltd
465+ */
466+ #include "hinic3_vxlan.h"
467+-#ifdef HAVE_OVS_DPDK
468+ #include "hinic3_dpdk_adapter.h"
469+-#endif
470+ #define HINIC3_IPV6_ADDR_SIZE 4
471+ #define HINIC3_VNI_LOW 0
472+ #define HINIC3_VNI_MID 1
473+diff --git a/drivers/net/hinic3/src/hinic3_init/comm/hinic3_init.c b/drivers/net/hinic3/src/hinic3_init/comm/hinic3_init.c
474+index 5abd51cab1..652faad002 100644
475+--- a/drivers/net/hinic3/src/hinic3_init/comm/hinic3_init.c
476++++ b/drivers/net/hinic3/src/hinic3_init/comm/hinic3_init.c
477+@@ -22,9 +22,7 @@
478+ #include "hinic3_agent.h"
479+ #include "hinic3_smap.h"
480+ #include "hinic3_parse_agent_config.h"
481+-#ifdef HAVE_OVS_DPDK
482+ #include "hinic3_dpdk_adapter.h"
483+-#endif
484+
485+ #define HINIC3_DRV_SHARD_LIBRARY "/usr/lib64/libhiovs3.so"
486+ #define HINIC3_PF_ADDR_NULL_STR "XXXX:XX:XX.X"
487+diff --git a/drivers/net/hinic3/src/hinic3_ports/hinic3_bond/hinic3_bond_controller.c b/drivers/net/hinic3/src/hinic3_ports/hinic3_bond/hinic3_bond_controller.c
488+index e626a5dd19..4149684984 100644
489+--- a/drivers/net/hinic3/src/hinic3_ports/hinic3_bond/hinic3_bond_controller.c
490++++ b/drivers/net/hinic3/src/hinic3_ports/hinic3_bond/hinic3_bond_controller.c
491+@@ -10,9 +10,7 @@
492+ #include "hinic3_vxlan.h"
493+ #include "hinic3_flow_dump.h"
494+ #include "hinic3_tlv_key.h"
495+-#ifdef HAVE_OVS_DPDK
496+ #include "hinic3_dpdk_adapter.h"
497+-#endif
498+ #include "hinic3_bond_controller.h"
499+
500+ #define PRIORITY_UPCALL_MAX_NUM 2
501+diff --git a/drivers/net/hinic3/src/hinic3_ports/hinic3_bond/hinic3_bond_controller.h b/drivers/net/hinic3/src/hinic3_ports/hinic3_bond/hinic3_bond_controller.h
502+index d145013b54..16b10b4a2f 100644
503+--- a/drivers/net/hinic3/src/hinic3_ports/hinic3_bond/hinic3_bond_controller.h
504++++ b/drivers/net/hinic3/src/hinic3_ports/hinic3_bond/hinic3_bond_controller.h
505+@@ -7,9 +7,7 @@
506+
507+ #include <ethdev_driver.h>
508+ #include "hinic3_queue.h"
509+-#ifdef HAVE_OVS_DPDK
510+ #include "hinic3_dpdk_adapter.h"
511+-#endif
512+
513+ #define HINIC3_PF_DEFAULT_MTU 9058
514+ #define HINIC3_PF_DEFAULT_NB_QUEUES 1
515+diff --git a/drivers/net/hinic3/src/hinic3_ports/hinic3_bond/hinic3_bond_statistics.c b/drivers/net/hinic3/src/hinic3_ports/hinic3_bond/hinic3_bond_statistics.c
516+index 6f48552b88..c2e767b2d8 100644
517+--- a/drivers/net/hinic3/src/hinic3_ports/hinic3_bond/hinic3_bond_statistics.c
518++++ b/drivers/net/hinic3/src/hinic3_ports/hinic3_bond/hinic3_bond_statistics.c
519+@@ -6,9 +6,7 @@
520+ #include "hinic3_dfx_port.h"
521+ #include "hinic3_port_util.h"
522+ #include "hinic3_bond_controller.h"
523+-#ifdef HAVE_OVS_DPDK
524+ #include "hinic3_dpdk_adapter.h"
525+-#endif
526+ #include "hinic3_bond_statistics.h"
527+
528+ int
529+diff --git a/drivers/net/hinic3/src/hinic3_ports/hinic3_vf/hinic3_function_statistics.c b/drivers/net/hinic3/src/hinic3_ports/hinic3_vf/hinic3_function_statistics.c
530+index 7e3d7aa2c0..ea4e2c8d6e 100644
531+--- a/drivers/net/hinic3/src/hinic3_ports/hinic3_vf/hinic3_function_statistics.c
532++++ b/drivers/net/hinic3/src/hinic3_ports/hinic3_vf/hinic3_function_statistics.c
533+@@ -19,9 +19,7 @@
534+ #include "hinic3_vxlan.h"
535+ #include "hinic3_flow_dump.h"
536+ #include "hinic3_offload_flow_port.h"
537+-#ifdef HAVE_OVS_DPDK
538+ #include "hinic3_dpdk_adapter.h"
539+-#endif
540+
541+ int hinic3_vf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
542+ {
543+diff --git a/drivers/net/hinic3/src/hinic3_ports/hinic3_vf/hinic3_vf_controller.h b/drivers/net/hinic3/src/hinic3_ports/hinic3_vf/hinic3_vf_controller.h
544+index 7c2acb0719..cc5b2d28cd 100644
545+--- a/drivers/net/hinic3/src/hinic3_ports/hinic3_vf/hinic3_vf_controller.h
546++++ b/drivers/net/hinic3/src/hinic3_ports/hinic3_vf/hinic3_vf_controller.h
547+@@ -16,9 +16,7 @@
548+ #include "hinic3_eth_util.h"
549+ #include "hinic3_vf_mgmt.h"
550+ #include "hinic3_queue.h"
551+-#ifdef HAVE_OVS_DPDK
552+ #include "hinic3_dpdk_adapter.h"
553+-#endif
554+
555+ #define HINIC3_VF_DEFAULT_NB_QUEUES 1
556+ #define HINIC3_MAX_JUMBO_FRAME_SIZE 9626
557+diff --git a/drivers/net/hinic3/src/hinic3_ports/hinic3_vf/hinic3_vf_mgmt.c b/drivers/net/hinic3/src/hinic3_ports/hinic3_vf/hinic3_vf_mgmt.c
558+index 91a82d6727..29116b76ac 100644
559+--- a/drivers/net/hinic3/src/hinic3_ports/hinic3_vf/hinic3_vf_mgmt.c
560++++ b/drivers/net/hinic3/src/hinic3_ports/hinic3_vf/hinic3_vf_mgmt.c
561+@@ -25,10 +25,7 @@
562+ #include "hinic3_mutex.h"
563+ #include "hinic3_vf_mgmt_virtual.h"
564+ #include "hinic3_vf_mgmt_baremetal.h"
565+-
566+-#ifdef HAVE_OVS_DPDK
567+ #include "hinic3_dpdk_adapter.h"
568+-#endif
569+
570+ struct hinic3_mutex hwpt_phy_dev_mutex;
571+ static int g_port_conf_type = PORT_CONF_NULL;
572+diff --git a/drivers/net/hinic3/src/hinic3_qos/meter/hinic3_qos.c b/drivers/net/hinic3/src/hinic3_qos/meter/hinic3_qos.c
573+index 93dc57f888..241d8c2072 100644
574+--- a/drivers/net/hinic3/src/hinic3_qos/meter/hinic3_qos.c
575++++ b/drivers/net/hinic3/src/hinic3_qos/meter/hinic3_qos.c
576+@@ -5,9 +5,7 @@
577+ #include "hinic3_mtr.h"
578+ #include "hinic3_meminfo.h"
579+ #include "hinic3_qos.h"
580+-#ifdef HAVE_OVS_DPDK
581+ #include "hinic3_dpdk_adapter.h"
582+-#endif
583+
584+ struct rte_mtr_ops *g_hinic3_mtr_ops = NULL;
585+
586+--
587+2.47.0.windows.2
588+ 
@@ -0,0 +1,139 @@
1+From e5c13b8eda2557b0961f84357e258fb8b925286c Mon Sep 17 00:00:00 2001
2+From: zry6666 <zhangruiyu2@huawei.com>
3+Date: Thu, 26 Jun 2025 11:11:29 +0800
4+Subject: [PATCH] Support set mtu feature
5+ 
6+---
7+ .../hinic3/scripts/dpak_ovs_completion_ovs.sh | 1 +
8+ .../src/common/hinic3_utils/hinic3_drv.h | 1 +
9+ .../hinic3_driver_adapter/hinic3_iface_port.c | 31 ++++++++++++++++++-
10+ .../hinic3_driver_adapter/hinic3_iface_port.h | 4 +++
11+ .../hinic3_driver_adapter/hiovs/hiovs_api.h | 10 ++++++
12+ .../hinic3/src/hinic3_init/comm/hinic3_init.c | 1 +
13+ 6 files changed, 47 insertions(+), 1 deletion(-)
14+ 
15+diff --git a/drivers/net/hinic3/scripts/dpak_ovs_completion_ovs.sh b/drivers/net/hinic3/scripts/dpak_ovs_completion_ovs.sh
16+index bd7a820d00..f18e1f2c0d 100644
17+--- a/drivers/net/hinic3/scripts/dpak_ovs_completion_ovs.sh
18++++ b/drivers/net/hinic3/scripts/dpak_ovs_completion_ovs.sh
19+@@ -93,6 +93,7 @@ _complete_show_global_api() {
20+ local api_opts=(
21+ hovs_global_cfg_set
22+ hovs_global_cfg_get
23++ hovs_global_device_feature_get
24+ hovs_global_statistics_get
25+ hovs_global_statistics_flush
26+ hovs_open_log
27+diff --git a/drivers/net/hinic3/src/common/hinic3_utils/hinic3_drv.h b/drivers/net/hinic3/src/common/hinic3_utils/hinic3_drv.h
28+index 49aa55403b..cf0ba3bc2b 100644
29+--- a/drivers/net/hinic3/src/common/hinic3_utils/hinic3_drv.h
30++++ b/drivers/net/hinic3/src/common/hinic3_utils/hinic3_drv.h
31+@@ -65,6 +65,7 @@ struct hinic3_drv_ops {
32+ int (*hovs_global_cfg_set)(const struct nlattr *args, size_t args_len, struct nlattr *unset_args,
33+ size_t *unset_args_len);
34+ int (*hovs_global_cfg_get)(struct nlattr *args, size_t *args_len);
35++ int (*hovs_global_device_feature_get)(uint64_t *default_device_feature, uint64_t *support_device_feature);
36+ int (*hovs_global_statistics_get)(struct hovs_global_stats *stats);
37+ int (*hovs_global_statistics_flush)(void);
38+ int (*hovs_mml_lib)(const char *buf_in, uint32_t in_size, char *buf_out, uint32_t *out_len,
39+diff --git a/drivers/net/hinic3/src/hinic3_driver_adapter/hinic3_iface_port.c b/drivers/net/hinic3/src/hinic3_driver_adapter/hinic3_iface_port.c
40+index 48635ed641..59d7e92cfe 100644
41+--- a/drivers/net/hinic3/src/hinic3_driver_adapter/hinic3_iface_port.c
42++++ b/drivers/net/hinic3/src/hinic3_driver_adapter/hinic3_iface_port.c
43+@@ -628,6 +628,25 @@ const char *hinic3_port_get_api_name(hinic3_port_api api_index)
44+ return NULL;
45+ }
46+
47++static int hinic3_vdpa_feature_add_mtu(uint64_t *vdpa_feature)
48++{
49++ int ret;
50++ struct hinic3_drv_ops *ops = NULL;
51++ uint64_t default_feature = 0;
52++ uint64_t support_feature = 0;
53++
54++ ops = hinic3_get_drv_ops();
55++ HINIC3_FUNC_PTR_OR_ERR_RET(ops->hovs_global_device_feature_get, HINIC3_DRV_FUNC_NO_PTR);
56++
57++ ret = ops->hovs_global_device_feature_get(&default_feature, &support_feature);
58++ if (ret != 0) {
59++ return -1;
60++ }
61++
62++ *vdpa_feature = default_feature | (1 << VIRTIO_NET_F_MTU);
63++ return 0;
64++}
65++
66+ int hinic3_port_mgmt_add_dynamic(uint16_t *port_id, const struct smap *args)
67+ {
68+ int ret;
69+@@ -656,8 +675,18 @@ int hinic3_port_mgmt_add_dynamic(uint16_t *port_id, const struct smap *args)
70+ hinic3_nlattr_init(&nla_args, tmp_buff, HOVS_MAX_TLV_BUF_LEN);
71+ /* smap to nlattr */
72+ port_args_smap_to_nlattr(args, &nla_args);
73++
74+ /* vdpa feature */
75+- vdpa_feature = hinic3_vdpa_feature_get();
76++ if (hinic3_hiovs_mode_get() == HIOVS_WORK_MODE_ZERO_VM_PT) {
77++ // 只在虚拟化场景下支持
78++ ret = hinic3_vdpa_feature_add_mtu(&vdpa_feature);
79++ if (ret != 0) {
80++ HINIC3_LOG(ERR, VPORT, "get featrue failed.");
81++ return -EPERM;
82++ }
83++ } else {
84++ vdpa_feature = hinic3_vdpa_feature_get();
85++ }
86+ if (vdpa_feature != 0) {
87+ hinic3_nlattr_put_u64(&nla_args, HINIC3_PORT_ARG_DEVICE_FEATURE, vdpa_feature);
88+ }
89+diff --git a/drivers/net/hinic3/src/hinic3_driver_adapter/hinic3_iface_port.h b/drivers/net/hinic3/src/hinic3_driver_adapter/hinic3_iface_port.h
90+index 1385e990db..b75b09a336 100644
91+--- a/drivers/net/hinic3/src/hinic3_driver_adapter/hinic3_iface_port.h
92++++ b/drivers/net/hinic3/src/hinic3_driver_adapter/hinic3_iface_port.h
93+@@ -13,6 +13,10 @@
94+ #include "hinic3_map.h"
95+ #include "hinic3_provider.h"
96+
97++#ifndef VIRTIO_NET_F_MTU
98++ #define VIRTIO_NET_F_MTU 3
99++#endif
100++
101+ #ifdef __cplusplus
102+ extern "C" {
103+ #endif
104+diff --git a/drivers/net/hinic3/src/hinic3_driver_adapter/hiovs/hiovs_api.h b/drivers/net/hinic3/src/hinic3_driver_adapter/hiovs/hiovs_api.h
105+index e5caf628a0..df1cfe0e47 100644
106+--- a/drivers/net/hinic3/src/hinic3_driver_adapter/hiovs/hiovs_api.h
107++++ b/drivers/net/hinic3/src/hinic3_driver_adapter/hiovs/hiovs_api.h
108+@@ -862,6 +862,16 @@ int hovs_global_cfg_set(const struct nlattr *args, size_t args_len, struct nlatt
109+
110+ int hovs_global_cfg_get(struct nlattr *args, size_t *args_len);
111+
112++/**
113++ * Get the the device feature, include default feature, support feature.
114++ *
115++ * @param[out] stats Output default feature, support feature.
116++ * @return
117++ * - HIOVS_OK: if successful.
118++ * - HIOVS_ERROR: if the parameter check fails or the execute fails.
119++ */
120++int hovs_global_device_feature_get(uint64_t *default_device_feature, uint64_t *support_device_feature);
121++
122+ /**
123+ * Get the the global statistics, include offload stats, upcall stats, other drop stats.
124+ *
125+diff --git a/drivers/net/hinic3/src/hinic3_init/comm/hinic3_init.c b/drivers/net/hinic3/src/hinic3_init/comm/hinic3_init.c
126+index 8b76577cb5..5abd51cab1 100644
127+--- a/drivers/net/hinic3/src/hinic3_init/comm/hinic3_init.c
128++++ b/drivers/net/hinic3/src/hinic3_init/comm/hinic3_init.c
129+@@ -74,6 +74,7 @@ static struct hinic3_drv_ops_map g_hinic3_drv_ops_map[] = {
130+ HINIC3_DRV_ADD_FUNC(g_hinic3_drv_ops, hovs_flow_callback_register),
131+ HINIC3_DRV_ADD_FUNC(g_hinic3_drv_ops, hovs_global_cfg_set),
132+ HINIC3_DRV_ADD_FUNC(g_hinic3_drv_ops, hovs_global_cfg_get),
133++ HINIC3_DRV_ADD_FUNC(g_hinic3_drv_ops, hovs_global_device_feature_get),
134+ HINIC3_DRV_ADD_FUNC(g_hinic3_drv_ops, hovs_global_statistics_get),
135+ HINIC3_DRV_ADD_FUNC(g_hinic3_drv_ops, hovs_global_statistics_flush),
136+ HINIC3_DRV_ADD_FUNC(g_hinic3_drv_ops, hovs_mml_lib),
137+--
138+2.47.0.windows.2
139+ 
@@ -0,0 +1,37 @@
1+From b03da19934166533e88ffd23642cae80c27be253 Mon Sep 17 00:00:00 2001
2+From: zry6666 <zhangruiyu2@huawei.com>
3+Date: Thu, 26 Jun 2025 11:27:27 +0800
4+Subject: [PATCH] fix_error_log
5+ 
6+---
7+ .../net/hinic3/src/hinic3_driver_adapter/hinic3_iface_global.c | 1 +
8+ drivers/net/hinic3/src/hinic3_driver_adapter/hiovs/hiovs_api.h | 1 +
9+ 2 files changed, 2 insertions(+)
10+ 
11+diff --git a/drivers/net/hinic3/src/hinic3_driver_adapter/hinic3_iface_global.c b/drivers/net/hinic3/src/hinic3_driver_adapter/hinic3_iface_global.c
12+index c292fc62d1..8ee1b5a343 100644
13+--- a/drivers/net/hinic3/src/hinic3_driver_adapter/hinic3_iface_global.c
14++++ b/drivers/net/hinic3/src/hinic3_driver_adapter/hinic3_iface_global.c
15+@@ -649,6 +649,7 @@ static void hinic3_lib_arg_init(struct rte_mempool *mempool, uint32_t data_room_
16+ arg->ext_cb_ops.hovs_memzone_reserve = hinic3_adapt_memzone_reserve;
17+ arg->ext_cb_ops.hovs_memzone_reserve_aligned = hinic3_adapt_memzone_reserve_aligned;
18+ arg->ext_cb_ops.hovs_memzone_free = hinic3_adapt_memzone_free;
19++ arg->ext_cb_ops.hovs_memzone_lookup = rte_memzone_lookup;
20+ arg->bond_rx_depth = hinic3_bond_rx_depth_get();
21+ arg->bond_tx_depth = hinic3_bond_tx_depth_get();
22+ arg->vport_rx_depth = hinic3_vport_rx_depth();
23+diff --git a/drivers/net/hinic3/src/hinic3_driver_adapter/hiovs/hiovs_api.h b/drivers/net/hinic3/src/hinic3_driver_adapter/hiovs/hiovs_api.h
24+index df1cfe0e47..53758e9266 100644
25+--- a/drivers/net/hinic3/src/hinic3_driver_adapter/hiovs/hiovs_api.h
26++++ b/drivers/net/hinic3/src/hinic3_driver_adapter/hiovs/hiovs_api.h
27+@@ -218,6 +218,7 @@ struct hovs_callback_ext_ops {
28+ const void *(*hovs_memzone_reserve_aligned)(const char *name, size_t len,
29+ int socket_id, uint32_t flags, uint32_t align);
30+ int (*hovs_memzone_free)(void *mz);
31++ const struct rte_memzone *(*hovs_memzone_lookup)(const char *name);
32+ };
33+
34+ struct hiovs_lib_arg {
35+--
36+2.47.0.windows.2
37+ 
@@ -0,0 +1,148 @@
1+From ec181f7fc7f18353b21550299c618424620a9276 Mon Sep 17 00:00:00 2001
2+From: Feifei Wang <wff_light@vip.163.com>
3+Date: Wed, 2 Jul 2025 16:44:48 +0800
4+Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=8E=A5=E5=8F=A3=E8=B0=83?=
5+ =?UTF-8?q?=E7=94=A8?=
6+MIME-Version: 1.0
7+Content-Type: text/plain; charset=UTF-8
8+Content-Transfer-Encoding: 8bit
9+ 
10+---
11+ drivers/net/hinic3/include/rte_pmd_hinic3.h | 10 ++++++++++
12+ drivers/net/hinic3/meson.build | 5 +++++
13+ drivers/net/hinic3/scripts/dpak_ovs_completion_ovs.sh | 4 ++--
14+ .../src/hinic3_cmds/comm/hinic3_agent_flow_cmd_dump.c | 4 ++--
15+ .../net/hinic3/src/hinic3_cmds/server/hinic3_command.c | 2 +-
16+ drivers/net/hinic3/src/hinic3_init/comm/hinic3_agent.c | 5 +++--
17+ 6 files changed, 23 insertions(+), 7 deletions(-)
18+ create mode 100644 drivers/net/hinic3/include/rte_pmd_hinic3.h
19+ 
20+diff --git a/drivers/net/hinic3/include/rte_pmd_hinic3.h b/drivers/net/hinic3/include/rte_pmd_hinic3.h
21+new file mode 100644
22+index 0000000000..c97c01bcb0
23+--- /dev/null
24++++ b/drivers/net/hinic3/include/rte_pmd_hinic3.h
25+@@ -0,0 +1,10 @@
26++/* SPDX-License-Identifier: BSD-3-Clause
27++ * Copyright(c) 2022 Huawei Technologies Co., Ltd
28++ */
29++#ifndef RTE_PMD_HINIC3_H
30++#define RTE_PMD_HINIC3_H
31++
32++int hinic3_agent_construct(void);
33++void hinic3_agent_destruct(void);
34++
35++#endif
36+ 
37+diff --git a/drivers/net/hinic3/meson.build b/drivers/net/hinic3/meson.build
38+index 77916f79e1..cbb26cdf2f 100644
39+--- a/drivers/net/hinic3/meson.build
40++++ b/drivers/net/hinic3/meson.build
41+@@ -109,6 +109,9 @@ sources = files(
42+ )
43+
44+ includes += include_directories(
45++ '../../../lib/distributor/',
46++ '../../../build',
47++ '../../../config',
48+ 'include',
49+ 'src/',
50+ 'src/hinic3_capture',
51+@@ -181,5 +184,7 @@ executable('dpak-ovs-ctl',
52+ install: true
53+ )
54+
55++install_headers('include/rte_pmd_hinic3.h')
56++
57+ install_data('cfg/ovs_dpu_virt/agent_config.ini', install_dir: '/etc/dpak/net')
58+ install_data('scripts/dpak_ovs_completion_ovs.sh', install_dir: '/etc/bash_completion.d')
59+diff --git a/drivers/net/hinic3/scripts/dpak_ovs_completion_ovs.sh b/drivers/net/hinic3/scripts/dpak_ovs_completion_ovs.sh
60+index f18e1f2c0d..488dc5e2fc 100644
61+--- a/drivers/net/hinic3/scripts/dpak_ovs_completion_ovs.sh
62++++ b/drivers/net/hinic3/scripts/dpak_ovs_completion_ovs.sh
63+@@ -10,7 +10,7 @@ TOP_LEVEL_OPTS=(
64+ hwoff/show-forward-mode
65+ hwoff/set-forward-mode
66+ hwoff/show-global-api
67+- hwoff/dump-hinic3-flows
68++ hwoff/dump-hwoff-flows
69+ hwoff/dump-upcall-queue-info
70+ hwoff/dump-bond-slave-info
71+ hwoff/show-port-api
72+@@ -649,7 +649,7 @@ _dpak_ovs_ctl() {
73+ _complete_show_global_api
74+ return 0
75+ ;;
76+- hwoff/dump-hinic3-flows)
77++ hwoff/dump-hwoff-flows)
78+ _complete_dump_hinic3_flows
79+ return 0
80+ ;;
81+diff --git a/drivers/net/hinic3/src/hinic3_cmds/comm/hinic3_agent_flow_cmd_dump.c b/drivers/net/hinic3/src/hinic3_cmds/comm/hinic3_agent_flow_cmd_dump.c
82+index 3e0b10b2a7..4b289dbd54 100644
83+--- a/drivers/net/hinic3/src/hinic3_cmds/comm/hinic3_agent_flow_cmd_dump.c
84++++ b/drivers/net/hinic3/src/hinic3_cmds/comm/hinic3_agent_flow_cmd_dump.c
85+@@ -291,7 +291,7 @@ hinic3_agent_dump_specific_flow(int argc, const char *argv[], struct ds *ds)
86+ static void
87+ hinic3_agent_dump_flows_help(struct ds *ds)
88+ {
89+- hinic3_ds_put_format(ds, "%2s%sdpak-ovs-ctl hwoff/dump-hinic3-flows [ ufid <hw-ufid> | -n |"
90++ hinic3_ds_put_format(ds, "%2s%sdpak-ovs-ctl hwoff/dump-hwoff-flows [ ufid <hw-ufid> | -n |"
91+ " -f <file-name> | -i <block-id> | check | stop | { -h | --help } ]\n\n", HINIC3_UI_INDENT_SPACE,
92+ HINIC3_UI_CMD_USAGE_STRING);
93+ hinic3_ds_put_format(ds, "%2s%s\n", HINIC3_UI_INDENT_SPACE, HINIC3_UI_FLOW_OPTION_LIST_STRING);
94+@@ -547,7 +547,7 @@ unixctl_hinic3_flow_dump_cmd_init(void)
95+ DUMP_HINIC3_FLOWS_PARAM = 2,
96+ };
97+
98+- hinic3_command_register("hwoff/dump-hinic3-flows",
99++ hinic3_command_register("hwoff/dump-hwoff-flows",
100+ "[ ufid <hw-ufid> | -n | -f <file-name> | -i <block-id> | check | stop | { -h | --help } ]", 0,
101+ DUMP_HINIC3_FLOWS_PARAM, hinic3_agent_dump_hinic3_emc_flows, NULL);
102+ hinic3_pthread_mutex_init(&dump_flows_mgmt.mutex_lock);
103+diff --git a/drivers/net/hinic3/src/hinic3_cmds/server/hinic3_command.c b/drivers/net/hinic3/src/hinic3_cmds/server/hinic3_command.c
104+index 7fdf61fc46..c120e0c130 100644
105+--- a/drivers/net/hinic3/src/hinic3_cmds/server/hinic3_command.c
106++++ b/drivers/net/hinic3/src/hinic3_cmds/server/hinic3_command.c
107+@@ -310,7 +310,7 @@ static struct hinic3_command_info g_hinic3_command_info[] = {
108+ {"hwoff/exec-cmd", "This command is used to issue or query OVS driver information for debugging."},
109+ {"hwoff/show-flow-api", "This API is used to query the hardware flow table."},
110+ {"hwoff/show-error-stats", "Indicates the error information recorded during flow table unloading."},
111+- {"hwoff/dump-hinic3-flows", "Queries hardware flow table information."},
112++ {"hwoff/dump-hwoff-flows", "Queries hardware flow table information."},
113+ {"hwoff/flow-offload-speed-stat", "Collects statistics on or queries the flow table offloading rate."},
114+ {"hwoff/show-offload-flow-num",
115+ "This command is used to query the number of flow tables that are unloaded (software statistics)."},
116+diff --git a/drivers/net/hinic3/src/hinic3_init/comm/hinic3_agent.c b/drivers/net/hinic3/src/hinic3_init/comm/hinic3_agent.c
117+index a7d57b47ff..460a316fd8 100644
118+--- a/drivers/net/hinic3/src/hinic3_init/comm/hinic3_agent.c
119++++ b/drivers/net/hinic3/src/hinic3_init/comm/hinic3_agent.c
120+@@ -39,6 +39,7 @@
121+ #include "hinic3_agent_cmd.h"
122+ #include "hinic3_error_stats.h"
123+ #include "hinic3_agent.h"
124++#include "rte_pmd_hinic3.h"
125+
126+ static bool g_agent_construct_init = false;
127+
128+@@ -286,7 +287,7 @@ static void hinic3_post_uninit(void)
129+ (void)hinic3_command_mgr_uninit();
130+ }
131+
132+-__attribute__((constructor(HINIC3_PRIORITY_LAST))) int hinic3_agent_construct(void)
133++int hinic3_agent_construct(void)
134+ {
135+ int ret;
136+
137+@@ -326,7 +327,7 @@ __attribute__((constructor(HINIC3_PRIORITY_LAST))) int hinic3_agent_construct(vo
138+ return -1;
139+ }
140+
141+-__attribute__((destructor(HINIC3_PRIORITY_LAST))) void hinic3_agent_destruct(void)
142++void hinic3_agent_destruct(void)
143+ {
144+ hinic3_net_qos_clear();
145+ hinic3_post_uninit();
146+--
147+2.47.0.windows.2
148+ 
@@ -0,0 +1,124 @@
1+From 2f3252084c9358b5ab3eca93241b2dab82f8a5c1 Mon Sep 17 00:00:00 2001
2+From: zry6666 <zhangruiyu2@huawei.com>
3+Date: Tue, 8 Jul 2025 11:13:20 +0800
4+Subject: [PATCH] add-collect-info-script
5+ 
6+---
7+ .../scripts/network_info_collect_ovs.sh | 104 ++++++++++++++++++
8+ 1 file changed, 104 insertions(+)
9+ create mode 100644 drivers/net/hinic3/scripts/network_info_collect_ovs.sh
10+ 
11+diff --git a/drivers/net/hinic3/scripts/network_info_collect_ovs.sh b/drivers/net/hinic3/scripts/network_info_collect_ovs.sh
12+new file mode 100644
13+index 0000000000..cae772cbb1
14+--- /dev/null
15++++ b/drivers/net/hinic3/scripts/network_info_collect_ovs.sh
16+@@ -0,0 +1,104 @@
17++#!/bin/bash
18++# Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
19++# Description: 巡检信息收集脚本
20++# Create: 2023-10-19
21++
22++set -e
23++function get_info() {
24++ #版本号
25++ echo "------------------------------Version info------------------------------"
26++ dpak-ovs-ctl hwoff-agent-version
27++ echo ""
28++ dpak-ovs-ctl -v
29++ echo ""
30++
31++ #内存占用情况
32++ echo "------------------------------Memory info-------------------------------"
33++ cat /proc/$(pidof -s ovs-vswitchd)/status | grep VmRSS 2>/dev/null
34++ echo ""
35++
36++ #端口个数
37++ echo "------------------------------Port num----------------------------------"
38++ dpak-ovs-ctl hwoff/show-function-flavor
39++ echo ""
40++
41++ #收发队列信息
42++ echo "-------------------------Dump unpcall queue info-------------------------"
43++ dpak-ovs-ctl hwoff/dump-upcall-queue-info
44++ echo ""
45++
46++ #丢包统计信息
47++ echo "---------------------------Dump info------------------------------------"
48++ #获取端口大名称
49++ port_name_str=$(ovs-vsctl show | awk '/^ +Port/ { port=$2; getline; getline; \
50++ if ($1 == "type:") { if ($2 == "dpdk") { gsub(/^"|"$/, "", port); print port } } }')
51++ # echo "$port_name_str"
52++ for i in $port_name_str
53++ do
54++ port_name=$i
55++ # echo $port_name
56++ echo "Port $port_name dump info:"
57++ dpak-ovs-ctl hwoff/dump-ports $port_name
58++ echo ""
59++ done
60++ echo ""
61++
62++ #回调线程个数
63++ echo "--------------------------Flow offload thread num-----------------------"
64++ cat /etc/dpak/net/agent_config.ini | grep offload_thread_num
65++ echo ""
66++
67++ #当前抓包任务列表
68++ echo "-------------------------------Capture probe info-----------------------"
69++ dpak-ovs-ctl hwoff/capture-probe show all
70++ echo ""
71++
72++ #收集网络卸载相关日志
73++ echo "-----------------------------Collecting log-----------------------------"
74++ if [ -d "$1/dpak-snic_log" ];then
75++ rm -rf $1/dpak-snic_log #收集日志存放位置
76++ fi
77++ mkdir -p $1/dpak-snic_log
78++ cp $(find /var/log/openvswitch/ -name 'ovs-vswitchd*') $1/dpak-snic_log 2>/dev/null
79++ logname=$1/dpak-snic-$(date +%Y_%m_%d_%H_%M_%S).tar.gz
80++ tar czvf $logname -C $1 dpak-snic_log --remove-files
81++ if [ ! -d "$1/logs" ];then
82++ mkdir -p $1/logs
83++ fi
84++ mv $logname $1/logs
85++ echo "Collecting log finished. The log is stored in \"$1/logs\""
86++ echo ""
87++
88++ #收集异常分支统计信息
89++ echo "--------------------------Error stats info-------------------------------"
90++ dpak-ovs-ctl hwoff/show-error-stats
91++ echo ""
92++
93++ #已卸载流表个数信息
94++ echo "--------------------------Flow num-----------------------------------------"
95++ dpak-ovs-ctl hwoff/show-offload-flow-num #软件流表
96++ dpak-ovs-ctl hwoff/dump-hwoff-flows -n #硬件流表
97++ echo ""
98++}
99++
100++function check_input() {
101++ if [[ $# == 0 || $# > 1]];then
102++ echo "Please input a parameter as the output file path."
103++ exit 1
104++ fi
105++
106++ if [ ! -d "$1" ];then
107++ echo "The path does not exist, please input a valid path."
108++ exit 1
109++ fi
110++}
111++
112++function main() {
113++ check_input $@
114++
115++ info_file_path=$1
116++ file_name="network_info.txt"
117++ get_info $1 > $info_file_path/$file_name
118++}
119++
120++main $@
121+ 
122+--
123+2.47.0.windows.2
124+ 
@@ -0,0 +1,87 @@
1+From 19d0a807f6e848669858bb23dae54b1493aa2108 Mon Sep 17 00:00:00 2001
2+From: zry6666 <zhangruiyu2@huawei.com>
3+Date: Mon, 21 Jul 2025 21:07:31 +0800
4+Subject: [PATCH] prohibit-mp-extention
5+ 
6+---
7+ .../hinic3/src/common/hinic3_mpool_mgmt/hinic3_mpool.c | 8 +++++---
8+ .../hinic3/src/common/hinic3_mpool_mgmt/hinic3_mpool.h | 3 ++-
9+ .../hinic3/src/hinic3_ufid_map/hinic3_mpool_rte_flow.c | 4 ++--
10+ 3 files changed, 9 insertions(+), 6 deletions(-)
11+ 
12+diff --git a/drivers/net/hinic3/src/common/hinic3_mpool_mgmt/hinic3_mpool.c b/drivers/net/hinic3/src/common/hinic3_mpool_mgmt/hinic3_mpool.c
13+index 461ccfa3b8..12b3ee0625 100644
14+--- a/drivers/net/hinic3/src/common/hinic3_mpool_mgmt/hinic3_mpool.c
15++++ b/drivers/net/hinic3/src/common/hinic3_mpool_mgmt/hinic3_mpool.c
16+@@ -145,7 +145,9 @@ static void *dpak_mp_alloc_mem_from_blocks(struct dpak_mempool *mp, uint32_t nee
17+ }
18+
19+ HINIC3_LOG(WARNING, FLOW, "mempool of ele_size %u no enough memory, start alloc new block", need_size);
20+- (void)dpak_mp_insert_blocks(mp, need_size, mp->per_block_ele_count, module_id);
21++ if (mp->is_extend) {
22++ (void)dpak_mp_insert_blocks(mp, need_size, mp->per_block_ele_count, module_id);
23++ }
24+ return NULL;
25+ }
26+
27+@@ -276,7 +278,7 @@ void *dpak_mempool_alloc(struct dpak_mempool *mp, enum hinic3_module module_id)
28+ }
29+
30+ struct dpak_mempool *hinic3_create_single_mpool(const char *pool_name, uint32_t ele_size, uint32_t ele_num,
31+- enum hinic3_module module_id)
32++ enum hinic3_module module_id, bool is_extend)
33+ {
34+ if (pool_name == NULL) {
35+ HINIC3_LOG(ERR, FLOW, "pool_name is NULL.");
36+@@ -294,7 +296,7 @@ struct dpak_mempool *hinic3_create_single_mpool(const char *pool_name, uint32_t
37+ hinic3_free(pool);
38+ return NULL;
39+ }
40+-
41++ pool->is_extend = is_extend;
42+ ret = dpak_mempool_create(pool, ele_size, ele_num, module_id);
43+ if (ret != 0) {
44+ dpak_mempool_destroy(pool);
45+diff --git a/drivers/net/hinic3/src/common/hinic3_mpool_mgmt/hinic3_mpool.h b/drivers/net/hinic3/src/common/hinic3_mpool_mgmt/hinic3_mpool.h
46+index ad40415f5c..2409f4429d 100644
47+--- a/drivers/net/hinic3/src/common/hinic3_mpool_mgmt/hinic3_mpool.h
48++++ b/drivers/net/hinic3/src/common/hinic3_mpool_mgmt/hinic3_mpool.h
49+@@ -40,13 +40,14 @@ struct dpak_mempool {
50+ struct dpak_mp_block *blk_list;
51+ pthread_mutex_t lock;
52+ bool is_valid;
53++ bool is_extend;
54+ };
55+
56+ int dpak_mempool_flush(struct dpak_mempool *mp);
57+ void dpak_mempool_free(struct dpak_mempool *mp, void *ptr);
58+ void dpak_mempool_destroy(struct dpak_mempool *mp);
59+ struct dpak_mempool *hinic3_create_single_mpool(const char *pool_name, uint32_t ele_size, uint32_t ele_num,
60+- enum hinic3_module module_id);
61++ enum hinic3_module module_id, bool is_extend);
62+ void *dpak_mempool_alloc(struct dpak_mempool *mp, enum hinic3_module module_id);
63+ void hinic3_show_one_mpool(const struct dpak_mempool *mpool, struct ds *ds, bool is_end);
64+ #endif
65+diff --git a/drivers/net/hinic3/src/hinic3_ufid_map/hinic3_mpool_rte_flow.c b/drivers/net/hinic3/src/hinic3_ufid_map/hinic3_mpool_rte_flow.c
66+index 6469e95dde..cd08680120 100644
67+--- a/drivers/net/hinic3/src/hinic3_ufid_map/hinic3_mpool_rte_flow.c
68++++ b/drivers/net/hinic3/src/hinic3_ufid_map/hinic3_mpool_rte_flow.c
69+@@ -34,13 +34,13 @@ static int hinic3_init_flow_mpool(void)
70+ uint32_t max_flow_num = hinic3_max_flow_num_get();
71+
72+ g_mpool_mgmt.rte_flow_mpool = hinic3_create_single_mpool(HINIC3_RTE_FLOW_ELE_MPOOL_NAME, sizeof(struct rte_flow),
73+- max_flow_num * HINIC3_RTE_FLOW_SINGLE_BLOCK_NUM, HINIC3_UFID_MAP);
74++ max_flow_num * HINIC3_RTE_FLOW_SINGLE_BLOCK_NUM, HINIC3_UFID_MAP, false);
75+ if (g_mpool_mgmt.rte_flow_mpool == NULL) {
76+ return -1;
77+ }
78+
79+ g_mpool_mgmt.ufid_map_mpool = hinic3_create_single_mpool(HINIC3_UFID_MAP_MPOOL_NAME,
80+- sizeof(struct hinic3_ufid_hmap_node), max_flow_num * HINIC3_RTE_FLOW_SINGLE_BLOCK_NUM, HINIC3_UFID_MAP);
81++ sizeof(struct hinic3_ufid_hmap_node), max_flow_num * HINIC3_RTE_FLOW_SINGLE_BLOCK_NUM, HINIC3_UFID_MAP, false);
82+ if (g_mpool_mgmt.ufid_map_mpool == NULL) {
83+ dpak_mempool_destroy(g_mpool_mgmt.rte_flow_mpool);
84+ g_mpool_mgmt.rte_flow_mpool = NULL;
85+--
86+2.47.0.windows.2
87+ 
@@ -0,0 +1,26 @@
1+From 3ed40b72bfeb8bddbdf977c25a7f8621052c5826 Mon Sep 17 00:00:00 2001
2+From: zry6666 <zhangruiyu2@huawei.com>
3+Date: Thu, 24 Jul 2025 21:28:06 +0800
4+Subject: [PATCH] fix build rpm problem
5+ 
6+---
7+ drivers/net/hinic3/meson.build | 3 ---
8+ 1 file changed, 3 deletions(-)
9+ 
10+diff --git a/drivers/net/hinic3/meson.build b/drivers/net/hinic3/meson.build
11+index 178e82193b..83cce4fbf0 100644
12+--- a/drivers/net/hinic3/meson.build
13++++ b/drivers/net/hinic3/meson.build
14+@@ -109,9 +109,6 @@ sources = files(
15+ )
16+
17+ includes += include_directories(
18+- '../../../lib/distributor/',
19+- '../../../build',
20+- '../../../config',
21+ 'include',
22+ 'src/',
23+ 'src/hinic3_capture',
24+--
25+2.47.0.windows.2
26+ 
Mdpdk.spec+15-1
@@ -11,7 +11,7 @@
11 11 
12Name: dpdk12Name: dpdk
13Version: 23.1113Version: 23.11
14-Release: 3214+Release: 33
15URL: http://dpdk.org15URL: http://dpdk.org
16Source: https://fast.dpdk.org/rel/dpdk-%{version}.tar.xz16Source: https://fast.dpdk.org/rel/dpdk-%{version}.tar.xz
17 17 
@@ -127,6 +127,17 @@ Patch6093: 0093-net-hns3-fix-unrelease-some-resources-on-reset-case.patch
127 127 
128Patch6094: 0094-net-xsc-optimize-rx.patch128Patch6094: 0094-net-xsc-optimize-rx.patch
129 129 
130+Patch6095: 0095-Upstream-hinic3-DPDK-driver.patch
131+Patch6096: 0096-remove-macro-HAVE_OVS_DPDK.patch
132+Patch6097: 0097-Support-set-mtu-feature.patch
133+Patch6098: 0098-fix-error-log.patch
134+Patch6099: 0099-add-interface.patch
135+Patch6100: 0100-fix-warning.patch
136+Patch6101: 0101-add-collect-info-script.patch
137+Patch6102: 0102-eliminate-warning.patch
138+Patch6103: 0103-prohibit-mp-extention.patch
139+Patch6104: 0104-fix-build-rpm-problem.patch
140+ 
130BuildRequires: meson141BuildRequires: meson
131BuildRequires: python3-pyelftools142BuildRequires: python3-pyelftools
132BuildRequires: diffutils143BuildRequires: diffutils
@@ -330,6 +341,9 @@ fi
330/usr/sbin/depmod341/usr/sbin/depmod
331 342 
332%changelog343%changelog
344+* Thu July 24 2025 zhangruiyu <zhangruiyu2@huawei.com> - 23.11-33
345+- Kunpeng hinic3 patch
346+ 
333* Tue May 27 2025 qianrong <qianr@yunsilicon.com> - 23.11-32347* Tue May 27 2025 qianrong <qianr@yunsilicon.com> - 23.11-32
334- optimize xsc rx348- optimize xsc rx
335 349