MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rss_check_cfg_handler

Function rss_check_cfg_handler

lib/ff_config.c:903–933  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

901}
902
903static int
904rss_check_cfg_handler(struct ff_config *cfg, __rte_unused const char *section,
905 const char *name, const char *value)
906{
907 if (cfg->dpdk.port_cfgs == NULL && cfg->dpdk.vlan_cfgs == NULL) {
908 fprintf(stderr, "rss_check_cfg_handler: must config dpdk.port or dpdk.vlan first\n");
909 return 0;
910 }
911
912 if (cfg->dpdk.rss_check_cfgs == NULL) {
913 struct ff_rss_check_cfg *rcc = calloc(1, sizeof(struct ff_rss_check_cfg));
914 if (rcc == NULL) {
915 fprintf(stderr, "rss_check_cfg_handler malloc failed\n");
916 return 0;
917 }
918 cfg->dpdk.rss_check_cfgs = rcc;
919 }
920
921 struct ff_rss_check_cfg *cur = cfg->dpdk.rss_check_cfgs;
922
923 if (strcmp(name, "enable") == 0) {
924 cur->enable = atoi(value);
925 } else if (strcmp(name, "rss_tbl") == 0) {
926 cur->rss_tbl_str = strdup(value);
927 if (cur->rss_tbl_str) {
928 return rss_tbl_cfg_handler(cur);
929 }
930 }
931
932 return 1;
933}
934
935static int
936ini_parse_handler(void* user, const char* section, const char* name,

Callers 1

ini_parse_handlerFunction · 0.85

Calls 4

callocFunction · 0.85
strcmpFunction · 0.85
strdupFunction · 0.85
rss_tbl_cfg_handlerFunction · 0.85

Tested by

no test coverage detected