Type of arguments passed to usdpaa_netcfg_acquire()?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Type of arguments passed to usdpaa_netcfg_acquire()?

973 次查看
priyaagarwal
Contributor III

Do I have to pass filename of config file and policy file as arguments or the pointer to file? Is this code right or should I pass only the filename?

Here I am passing pointer to the file:

FILE *pcd_file, *cfg_file;   

cfg_file = fopen("/usr/etc/usdpaa_config_t4_serdes_1_1_6_6.xml", "a+");

pcd_file = fopen("/usr/etc/usdpaa_policy_hash_ipv4.xml", "a+");

netcfg = usdpaa_netcfg_acquire( (const char *)pcd_file, (const char *)cfg_file);

Or should I pass the filenames:

const char * cfg_file, *pcd_file;

cfg_file = "/usr/etc/usdpaa_config_t4_serdes_1_1_6_6.xml";

pcd_file = "/usr/etc/usdpaa_policy_hash_ipv4.xml";

netcfg = usdpaa_netcfg_acquire( (pcd_file,cfg_file);

标记 (4)
0 项奖励
回复
2 回复数

861 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Hello Priya Agarwal,


It's not a good method to hard code the configuration file path to your source code. I assume that you are using PPAC/PPAM programming structure, and usdpaa_netcfg_acquire is invoked in apps/ppac/main.c, you need to to specify the configuration and policy files as parameters of your application, then the file path is passed to usdpaa_netcfg_acquire.

For example,

cd /usr/etc

fmc -c usdpaa_config_t4_serdes_1_1_6_6.xml -p usdpaa_policy_hash_ipv4.xml -a

reflector -c usdpaa_config_t4_serdes_1_1_6_6.xml -p usdpaa_policy_hash_ipv4.xml


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

861 次查看
adeel
Contributor III

You should pass file path. The libxml will open and parse it.

0 项奖励
回复