Skip to content

Commit 2364700

Browse files
sil-plvshemminger
authored andcommitted
net/ntnic: add nthw function name prefix
Add nthw prefix to functions with abstract names to avoid exposing global symbols Signed-off-by: Serhii Iliushyk <[email protected]>
1 parent 336893b commit 2364700

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+404
-382
lines changed

drivers/net/ntnic/adapter/nt4ga_adapter.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info)
168168
nt4ga_filter_t *p_filter = &p_adapter_info->nt4ga_filter;
169169

170170
if (flow_filter_ops != NULL) {
171-
res = flow_filter_ops->flow_filter_init(p_fpga, &p_filter->mp_flow_device,
171+
res = flow_filter_ops->nthw_flow_filter_init(p_fpga, &p_filter->mp_flow_device,
172172
p_adapter_info->adapter_no);
173173

174174
if (res != 0) {
@@ -266,7 +266,7 @@ static int nt4ga_adapter_deinit(struct adapter_info_s *p_adapter_info)
266266
nt4ga_filter_t *p_filter = &p_adapter_info->nt4ga_filter;
267267

268268
if (flow_filter_ops != NULL) {
269-
res = flow_filter_ops->flow_filter_done(p_filter->mp_flow_device);
269+
res = flow_filter_ops->nthw_flow_filter_done(p_filter->mp_flow_device);
270270

271271
if (res != 0) {
272272
NT_LOG(ERR, NTNIC, "Cannot deinitialize filter");
@@ -309,7 +309,7 @@ static const struct adapter_ops ops = {
309309
.show_info = nt4ga_adapter_show_info,
310310
};
311311

312-
void adapter_init(void)
312+
void nthw_adapter_init(void)
313313
{
314314
register_adapter_ops(&ops);
315315
}

drivers/net/ntnic/adapter/nt4ga_stat/nt4ga_stat.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,11 +558,13 @@ static int nt4ga_stat_collect_cap_v1_stats(struct adapter_info_s *p_adapter_info
558558
}
559559

560560
/* Update and get FLM stats */
561-
flow_filter_ops->flow_get_flm_stats(ndev, (uint64_t *)p_nt4ga_stat->mp_stat_structs_flm,
561+
flow_filter_ops->nthw_flow_get_flm_stats(ndev,
562+
(uint64_t *)p_nt4ga_stat->mp_stat_structs_flm,
562563
sizeof(struct flm_counters_v1) / sizeof(uint64_t));
563564

564565
/* Update and get IFR stats */
565-
flow_filter_ops->flow_get_ifr_stats(ndev, (uint64_t *)p_nt4ga_stat->mp_stat_structs_ifr,
566+
flow_filter_ops->nthw_flow_get_ifr_stats(ndev,
567+
(uint64_t *)p_nt4ga_stat->mp_stat_structs_ifr,
566568
p_nt4ga_stat->mn_ifr_counters - 1);
567569

568570
/*

drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,13 @@ static void dbs_init_rx_queue(nthw_dbs_t *p_nthw_dbs, uint32_t queue, uint32_t s
177177
uint32_t dummy;
178178

179179
do {
180-
get_rx_init(p_nthw_dbs, &init, &dummy, &busy);
180+
nthw_get_rx_init(p_nthw_dbs, &init, &dummy, &busy);
181181
} while (busy != 0);
182182

183-
set_rx_init(p_nthw_dbs, start_idx, start_ptr, INIT_QUEUE, queue);
183+
nthw_set_rx_init(p_nthw_dbs, start_idx, start_ptr, INIT_QUEUE, queue);
184184

185185
do {
186-
get_rx_init(p_nthw_dbs, &init, &dummy, &busy);
186+
nthw_get_rx_init(p_nthw_dbs, &init, &dummy, &busy);
187187
} while (busy != 0);
188188
}
189189

@@ -195,13 +195,13 @@ static void dbs_init_tx_queue(nthw_dbs_t *p_nthw_dbs, uint32_t queue, uint32_t s
195195
uint32_t dummy;
196196

197197
do {
198-
get_tx_init(p_nthw_dbs, &init, &dummy, &busy);
198+
nthw_get_tx_init(p_nthw_dbs, &init, &dummy, &busy);
199199
} while (busy != 0);
200200

201201
set_tx_init(p_nthw_dbs, start_idx, start_ptr, INIT_QUEUE, queue);
202202

203203
do {
204-
get_tx_init(p_nthw_dbs, &init, &dummy, &busy);
204+
nthw_get_tx_init(p_nthw_dbs, &init, &dummy, &busy);
205205
} while (busy != 0);
206206
}
207207

@@ -250,18 +250,18 @@ static int nthw_virt_queue_init(struct fpga_info_s *p_fpga_info)
250250
for (i = 0; i < NT_DBS_TX_QUEUES_MAX; ++i)
251251
dbs_init_tx_queue(p_nthw_dbs, i, 0, 0);
252252

253-
set_rx_control(p_nthw_dbs, LAST_QUEUE, RX_AM_DISABLE, RX_AM_POLL_SPEED, RX_UW_DISABLE,
253+
nthw_set_rx_control(p_nthw_dbs, LAST_QUEUE, RX_AM_DISABLE, RX_AM_POLL_SPEED, RX_UW_DISABLE,
254254
RX_UW_POLL_SPEED, RX_Q_DISABLE);
255-
set_rx_control(p_nthw_dbs, LAST_QUEUE, RX_AM_ENABLE, RX_AM_POLL_SPEED, RX_UW_ENABLE,
255+
nthw_set_rx_control(p_nthw_dbs, LAST_QUEUE, RX_AM_ENABLE, RX_AM_POLL_SPEED, RX_UW_ENABLE,
256256
RX_UW_POLL_SPEED, RX_Q_DISABLE);
257-
set_rx_control(p_nthw_dbs, LAST_QUEUE, RX_AM_ENABLE, RX_AM_POLL_SPEED, RX_UW_ENABLE,
257+
nthw_set_rx_control(p_nthw_dbs, LAST_QUEUE, RX_AM_ENABLE, RX_AM_POLL_SPEED, RX_UW_ENABLE,
258258
RX_UW_POLL_SPEED, RX_Q_ENABLE);
259259

260-
set_tx_control(p_nthw_dbs, LAST_QUEUE, TX_AM_DISABLE, TX_AM_POLL_SPEED, TX_UW_DISABLE,
260+
nthw_set_tx_control(p_nthw_dbs, LAST_QUEUE, TX_AM_DISABLE, TX_AM_POLL_SPEED, TX_UW_DISABLE,
261261
TX_UW_POLL_SPEED, TX_Q_DISABLE);
262-
set_tx_control(p_nthw_dbs, LAST_QUEUE, TX_AM_ENABLE, TX_AM_POLL_SPEED, TX_UW_ENABLE,
262+
nthw_set_tx_control(p_nthw_dbs, LAST_QUEUE, TX_AM_ENABLE, TX_AM_POLL_SPEED, TX_UW_ENABLE,
263263
TX_UW_POLL_SPEED, TX_Q_DISABLE);
264-
set_tx_control(p_nthw_dbs, LAST_QUEUE, TX_AM_ENABLE, TX_AM_POLL_SPEED, TX_UW_ENABLE,
264+
nthw_set_tx_control(p_nthw_dbs, LAST_QUEUE, TX_AM_ENABLE, TX_AM_POLL_SPEED, TX_UW_ENABLE,
265265
TX_UW_POLL_SPEED, TX_Q_ENABLE);
266266

267267
return 0;
@@ -464,10 +464,10 @@ static int dbs_wait_on_busy(struct nthw_virt_queue *vq, uint32_t *idle, int rx)
464464

465465
do {
466466
if (rx)
467-
err = get_rx_idle(p_nthw_dbs, idle, &queue, &busy);
467+
err = nthw_get_rx_idle(p_nthw_dbs, idle, &queue, &busy);
468468

469469
else
470-
err = get_tx_idle(p_nthw_dbs, idle, &queue, &busy);
470+
err = nthw_get_tx_idle(p_nthw_dbs, idle, &queue, &busy);
471471
} while (!err && busy);
472472

473473
return err;
@@ -492,10 +492,10 @@ static int dbs_wait_hw_queue_shutdown(struct nthw_virt_queue *vq, int rx)
492492

493493
do {
494494
if (rx)
495-
err = set_rx_idle(p_nthw_dbs, 1, vq->index);
495+
err = nthw_set_rx_idle(p_nthw_dbs, 1, vq->index);
496496

497497
else
498-
err = set_tx_idle(p_nthw_dbs, 1, vq->index);
498+
err = nthw_set_tx_idle(p_nthw_dbs, 1, vq->index);
499499

500500
if (err)
501501
return -1;
@@ -1424,7 +1424,7 @@ static struct sg_ops_s sg_ops = {
14241424
.nthw_virt_queue_init = nthw_virt_queue_init
14251425
};
14261426

1427-
void sg_init(void)
1427+
void nthw_sg_init(void)
14281428
{
14291429
NT_LOG(INF, NTNIC, "SG ops initialized");
14301430
register_sg_ops(&sg_ops);

drivers/net/ntnic/include/create_elements.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ enum nt_rte_flow_item_type {
6060

6161
extern rte_spinlock_t flow_lock;
6262

63-
int interpret_raw_data(uint8_t *data, uint8_t *preserve, int size, struct rte_flow_item *out);
64-
int create_attr(struct cnv_attr_s *attribute, const struct rte_flow_attr *attr);
65-
int create_match_elements(struct cnv_match_s *match, const struct rte_flow_item items[],
63+
int nthw_interpret_raw_data(uint8_t *data, uint8_t *preserve, int size, struct rte_flow_item *out);
64+
int nthw_create_attr(struct cnv_attr_s *attribute, const struct rte_flow_attr *attr);
65+
int nthw_create_match_elements(struct cnv_match_s *match, const struct rte_flow_item items[],
6666
int max_elem);
67-
int create_action_elements_inline(struct cnv_action_s *action,
67+
int nthw_create_action_elements_inline(struct cnv_action_s *action,
6868
const struct rte_flow_action actions[],
6969
int max_elem,
7070
uint32_t queue_offset);

drivers/net/ntnic/include/flow_api.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct hw_mod_resource_s {
2727
/*
2828
* Device Management API
2929
*/
30-
int flow_delete_eth_dev(struct flow_eth_dev *eth_dev);
30+
int nthw_flow_delete_eth_dev(struct flow_eth_dev *eth_dev);
3131

3232
/**
3333
* A structure used to configure the Receive Side Scaling (RSS) feature
@@ -167,7 +167,7 @@ enum flow_nic_err_msg_e {
167167
ERR_MSG_END
168168
};
169169

170-
void flow_nic_set_error(enum flow_nic_err_msg_e msg, struct rte_flow_error *error);
170+
void nthw_flow_nic_set_error(enum flow_nic_err_msg_e msg, struct rte_flow_error *error);
171171

172172
/*
173173
* Resources
@@ -219,17 +219,17 @@ extern const char *dbg_res_descr[];
219219
#define flow_nic_is_resource_used(_ndev, res_type, index) \
220220
(!!flow_nic_is_bit_set((_ndev)->res[res_type].alloc_bm, index))
221221

222-
int flow_nic_alloc_resource(struct flow_nic_dev *ndev, enum res_type_e res_type,
222+
int nthw_flow_nic_alloc_resource(struct flow_nic_dev *ndev, enum res_type_e res_type,
223223
uint32_t alignment);
224224

225-
int flow_nic_alloc_resource_config(struct flow_nic_dev *ndev, enum res_type_e res_type,
225+
int nthw_flow_nic_alloc_resource_config(struct flow_nic_dev *ndev, enum res_type_e res_type,
226226
unsigned int num, uint32_t alignment);
227-
void flow_nic_free_resource(struct flow_nic_dev *ndev, enum res_type_e res_type, int idx);
227+
void nthw_flow_nic_free_resource(struct flow_nic_dev *ndev, enum res_type_e res_type, int idx);
228228

229-
int flow_nic_ref_resource(struct flow_nic_dev *ndev, enum res_type_e res_type, int index);
230-
int flow_nic_deref_resource(struct flow_nic_dev *ndev, enum res_type_e res_type, int index);
229+
int nthw_flow_nic_ref_resource(struct flow_nic_dev *ndev, enum res_type_e res_type, int index);
230+
int nthw_flow_nic_deref_resource(struct flow_nic_dev *ndev, enum res_type_e res_type, int index);
231231

232-
int flow_get_flm_stats(struct flow_nic_dev *ndev, uint64_t *data, uint64_t size);
233-
int flow_get_ifr_stats(struct flow_nic_dev *ndev, uint64_t *data, uint8_t port_count);
232+
int nthw_flow_get_flm_stats(struct flow_nic_dev *ndev, uint64_t *data, uint64_t size);
233+
int nthw_flow_get_ifr_stats(struct flow_nic_dev *ndev, uint64_t *data, uint8_t port_count);
234234

235235
#endif

drivers/net/ntnic/include/flow_api_engine.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -420,12 +420,12 @@ void kcc_free_ndev_resource_management(void **handle);
420420
/*
421421
* Group management
422422
*/
423-
int flow_group_handle_create(void **handle, uint32_t group_count);
424-
int flow_group_handle_destroy(void **handle);
423+
int nthw_flow_group_handle_create(void **handle, uint32_t group_count);
424+
int nthw_flow_group_handle_destroy(void **handle);
425425

426-
int flow_group_translate_get(void *handle, uint8_t owner_id, uint8_t port_id, uint32_t group_in,
427-
uint32_t *group_out);
428-
int flow_group_translate_get_orig_group(void *handle, uint32_t translated_group,
426+
int nthw_flow_group_translate_get(void *handle, uint8_t owner_id, uint8_t port_id,
427+
uint32_t group_in, uint32_t *group_out);
428+
int nthw_flow_group_translate_get_orig_group(void *handle, uint32_t translated_group,
429429
uint32_t *group_orig);
430430

431431
#endif /* _FLOW_API_ENGINE_H_ */

drivers/net/ntnic/include/flow_filter.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#include "flow_api.h"
1010
#include "nthw_fpga_model.h"
1111

12-
int flow_filter_init(nthw_fpga_t *p_fpga, struct flow_nic_dev **p_flow_device, int adapter_no);
13-
int flow_filter_done(struct flow_nic_dev *dev);
14-
int flow_get_flm_stats(struct flow_nic_dev *ndev, uint64_t *data, uint64_t size);
12+
int nthw_flow_filter_init(nthw_fpga_t *p_fpga, struct flow_nic_dev **p_flow_device, int adapter_no);
13+
int nthw_flow_filter_done(struct flow_nic_dev *dev);
14+
int nthw_flow_get_flm_stats(struct flow_nic_dev *ndev, uint64_t *data, uint64_t size);
1515

1616
#endif /* __FLOW_FILTER_HPP__ */

drivers/net/ntnic/include/hw_mod_backend.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
struct flow_api_backend_s;
3030
struct common_func_s;
3131

32-
void *callocate_mod(struct common_func_s *mod, int sets, ...);
33-
void zero_module_cache(struct common_func_s *mod);
32+
void *nthw_callocate_mod(struct common_func_s *mod, int sets, ...);
33+
void nthw_zero_module_cache(struct common_func_s *mod);
3434

3535
#define ALL_ENTRIES -1000
3636
#define ALL_BANK_ENTRIES -1001
@@ -1164,8 +1164,8 @@ struct flow_api_backend_s {
11641164
unsigned int max_queues;
11651165
};
11661166

1167-
int flow_api_backend_init(struct flow_api_backend_s *dev, const struct flow_api_backend_ops *iface,
1168-
void *be_dev);
1169-
int flow_api_backend_done(struct flow_api_backend_s *dev);
1167+
int nthw_flow_api_backend_init(struct flow_api_backend_s *dev,
1168+
const struct flow_api_backend_ops *iface, void *be_dev);
1169+
int nthw_flow_api_backend_done(struct flow_api_backend_s *dev);
11701170

11711171
#endif /* _HW_MOD_BACKEND_H_ */

drivers/net/ntnic/include/ntnic_dbs.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -236,30 +236,30 @@ nthw_dbs_t *nthw_dbs_new(void);
236236
int dbs_init(nthw_dbs_t *p, nthw_fpga_t *p_fpga, int n_instance);
237237
void dbs_reset(nthw_dbs_t *p);
238238

239-
int set_rx_control(nthw_dbs_t *p,
239+
int nthw_set_rx_control(nthw_dbs_t *p,
240240
uint32_t last_queue,
241241
uint32_t avail_monitor_enable,
242242
uint32_t avail_monitor_speed,
243243
uint32_t used_write_enable,
244244
uint32_t used_write_speed,
245245
uint32_t rx_queue_enable);
246-
int set_tx_control(nthw_dbs_t *p,
246+
int nthw_set_tx_control(nthw_dbs_t *p,
247247
uint32_t last_queue,
248248
uint32_t avail_monitor_enable,
249249
uint32_t avail_monitor_speed,
250250
uint32_t used_write_enable,
251251
uint32_t used_write_speed,
252252
uint32_t tx_queue_enable);
253-
int set_rx_init(nthw_dbs_t *p, uint32_t start_idx, uint32_t start_ptr, uint32_t init,
253+
int nthw_set_rx_init(nthw_dbs_t *p, uint32_t start_idx, uint32_t start_ptr, uint32_t init,
254254
uint32_t queue);
255-
int get_rx_init(nthw_dbs_t *p, uint32_t *init, uint32_t *queue, uint32_t *busy);
255+
int nthw_get_rx_init(nthw_dbs_t *p, uint32_t *init, uint32_t *queue, uint32_t *busy);
256256
int set_tx_init(nthw_dbs_t *p, uint32_t start_idx, uint32_t start_ptr, uint32_t init,
257257
uint32_t queue);
258-
int get_tx_init(nthw_dbs_t *p, uint32_t *init, uint32_t *queue, uint32_t *busy);
259-
int set_rx_idle(nthw_dbs_t *p, uint32_t idle, uint32_t queue);
260-
int get_rx_idle(nthw_dbs_t *p, uint32_t *idle, uint32_t *queue, uint32_t *busy);
261-
int set_tx_idle(nthw_dbs_t *p, uint32_t idle, uint32_t queue);
262-
int get_tx_idle(nthw_dbs_t *p, uint32_t *idle, uint32_t *queue, uint32_t *busy);
258+
int nthw_get_tx_init(nthw_dbs_t *p, uint32_t *init, uint32_t *queue, uint32_t *busy);
259+
int nthw_set_rx_idle(nthw_dbs_t *p, uint32_t idle, uint32_t queue);
260+
int nthw_get_rx_idle(nthw_dbs_t *p, uint32_t *idle, uint32_t *queue, uint32_t *busy);
261+
int nthw_set_tx_idle(nthw_dbs_t *p, uint32_t idle, uint32_t queue);
262+
int nthw_get_tx_idle(nthw_dbs_t *p, uint32_t *idle, uint32_t *queue, uint32_t *busy);
263263
int set_rx_am_data(nthw_dbs_t *p,
264264
uint32_t index,
265265
uint64_t guest_physical_address,

drivers/net/ntnic/link_mgmt/link_100g/nt4ga_link_100g.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -304,28 +304,28 @@ static int _create_nim(adapter_info_t *drv, int port, bool enable)
304304
return -1;
305305
}
306306

307-
res = construct_and_preinit_nim(nim_ctx, NULL);
307+
res = nthw_construct_and_preinit_nim(nim_ctx, NULL);
308308

309309
if (res)
310310
return res;
311311

312-
res = nim_state_build(nim_ctx, &nim);
312+
res = nthw_nim_state_build(nim_ctx, &nim);
313313

314314
if (res)
315315
return res;
316316

317317
NT_LOG(DBG, NTHW, "%s: NIM id = %u (%s), br = %u, vendor = '%s', pn = '%s', sn='%s'",
318-
drv->mp_port_id_str[port], nim_ctx->nim_id, nim_id_to_text(nim_ctx->nim_id), nim.br,
319-
nim_ctx->vendor_name, nim_ctx->prod_no, nim_ctx->serial_no);
318+
drv->mp_port_id_str[port], nim_ctx->nim_id, nthw_nim_id_to_text(nim_ctx->nim_id),
319+
nim.br, nim_ctx->vendor_name, nim_ctx->prod_no, nim_ctx->serial_no);
320320

321321
/*
322322
* Does the driver support the NIM module type?
323323
*/
324324
if (nim_ctx->nim_id != valid_nim_id) {
325325
NT_LOG(ERR, NTHW, "%s: The driver does not support the NIM module type %s",
326-
drv->mp_port_id_str[port], nim_id_to_text(nim_ctx->nim_id));
326+
drv->mp_port_id_str[port], nthw_nim_id_to_text(nim_ctx->nim_id));
327327
NT_LOG(DBG, NTHW, "%s: The driver supports the NIM module type %s",
328-
drv->mp_port_id_str[port], nim_id_to_text(valid_nim_id));
328+
drv->mp_port_id_str[port], nthw_nim_id_to_text(valid_nim_id));
329329
return -1;
330330
}
331331

@@ -371,7 +371,7 @@ static int _port_init(adapter_info_t *drv, nthw_fpga_t *fpga, int port)
371371

372372
/*
373373
* Phase 1. Pre-state machine (`port init` functions)
374-
* 1.1) nt4ga_adapter::port_init()
374+
* 1.1) nt4ga_adapter::nthw_port_init()
375375
*/
376376

377377
/* No adapter set-up here, only state variables */
@@ -597,7 +597,7 @@ static int _common_ptp_nim_state_machine(void *data)
597597
continue;
598598
}
599599

600-
if (nim_state_build(&nim_ctx[i], &new_state)) {
600+
if (nthw_nim_state_build(&nim_ctx[i], &new_state)) {
601601
NT_LOG(ERR, NTNIC, "%s: Cannot read basic NIM data",
602602
drv->mp_port_id_str[i]);
603603
continue;
@@ -607,8 +607,9 @@ static int _common_ptp_nim_state_machine(void *data)
607607
NT_LOG(DBG, NTNIC,
608608
"%s: NIM id = %u (%s), br = %u, vendor = '%s', pn = '%s', sn='%s'",
609609
drv->mp_port_id_str[i], nim_ctx->nim_id,
610-
nim_id_to_text(nim_ctx->nim_id), (unsigned int)new_state.br,
611-
nim_ctx->vendor_name, nim_ctx->prod_no, nim_ctx->serial_no);
610+
nthw_nim_id_to_text(nim_ctx->nim_id),
611+
(unsigned int)new_state.br, nim_ctx->vendor_name,
612+
nim_ctx->prod_no, nim_ctx->serial_no);
612613

613614
(void)_link_state_build(drv, &mac_pcs[i], &gpio_phy[i], i,
614615
&link_state[i], is_port_disabled);
@@ -725,7 +726,7 @@ static struct link_ops_s link_100g_ops = {
725726
.link_init = nt4ga_link_100g_ports_init,
726727
};
727728

728-
void link_100g_init(void)
729+
void nthw_link_100g_init(void)
729730
{
730731
register_100g_link_ops(&link_100g_ops);
731732
}

0 commit comments

Comments
 (0)