Commit e6df625d authored by 's avatar

Added disable_dsm option to mapi.conf to not use DSM at all for DAG cards.

Also bad setting of parameter dsm_loader_bin disables DSM at the beginning.


git-svn-id: file:///home/svn/mapi/trunk@1234 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent a35c35a9
......@@ -11,3 +11,4 @@ description=Offline dag-capture
[dag]
ipf_loader_bin=dag_ipf_loader.sh
dsm_loader_bin=/path/to/dsm_loader
disable_dsm=0
......@@ -103,7 +103,7 @@ mapidrv_apply_function (int devid,int fd, int flags, char* function, mapiFunctAr
rc_err = MFUNCT_INVALID_ARGUMENT_1;
if (di->is_dsm_filtering == 0) {
DEBUG_CMD(fprintf(stderr, "dagflib:bpffilter: DSM not supported by hardware.\n"));
DEBUG_CMD(fprintf(stderr, "dagflib:bpffilter: DSM is not available.\n"));
rc_err = MFUNCT_COULD_NOT_APPLY_FUNCT;
}
......@@ -641,10 +641,29 @@ mapidrv_create_flow (int devid, int fd, char **devtype)
switch (di->is_dsm_filtering) {
case 1:
/* It seems that there are 8 hw filters for all DSM DAGs. */
di->dsm_filter_count = 8;
DEBUG_CMD(printf("DAG: Data Stream Management (DSM) supported and will be used for BPF_FILTER functions. [%s:%d]\n",__FILE__,__LINE__));
if (pc_load(CONFDIR "/" CONF_FILE)) {
char *disable_dsm = pc_get_param(pc_get_category("dag"), "disable_dsm");
char *binpath = pc_get_param(pc_get_category("dag"), "dsm_loader_bin");
if (disable_dsm && *disable_dsm && !strcmp(disable_dsm, "1")) {
di->is_dsm_filtering = 0;
DEBUG_CMD(printf("DAG: Data Stream Management (DSM) supported by hardware, but disabled in configuration file %s. [%s:%d]\n", CONF_FILE, __FILE__,__LINE__));
} else if (!binpath || !*binpath || (access(binpath, X_OK) != 0)) {
di->is_dsm_filtering = 0;
DEBUG_CMD(printf("DAG: Data Stream Management (DSM) supported by hardware, but disabled due to bad setting of parameter dsm_loader_bin in %s. [%s:%d]\n", CONF_FILE, __FILE__,__LINE__));
}
pc_close();
} else {
di->is_dsm_filtering = 0;
DEBUG_CMD(printf("Error opening configuration file %s, disabling DAG DSM. [%s:%d]\n", CONF_FILE, __FILE__,__LINE__));
}
if (di->is_dsm_filtering) {
/* It seems that there are 8 hw filters for all DSM DAGs. */
di->dsm_filter_count = 8;
DEBUG_CMD(printf("DAG: Data Stream Management (DSM) supported and will be used for BPF_FILTER functions. [%s:%d]\n",__FILE__,__LINE__));
}
break;
case 0:
DEBUG_CMD(printf("DAG: Data Stream Management (DSM) unavailable, wrong firmware loaded. [%s:%d]\n",__FILE__,__LINE__));
......@@ -673,7 +692,11 @@ mapidrv_connect (int devid,int fd)
ret=mapid_connect(&i->mapidlib,fd);
#ifdef PRECLASSIFICATION
dagdsm_build_bpffilter(FALSE, NULL, &i->hwinfo); /* build the preclassification scheme */
{
dag_adapterinfo_t *di = i->hwinfo.adapterinfo;
if (di->is_dsm_filtering)
dagdsm_build_bpffilter(FALSE, NULL, &i->hwinfo); /* build the preclassification scheme */
}
#endif
if(i->hwinfo.offline==4) {
......@@ -722,7 +745,11 @@ mapidrv_close_flow (int devid,int fd)
int rc = mapid_close_flow(&i->mapidlib,fd);
#ifdef PRECLASSIFICATION
dagdsm_build_bpffilter(FALSE, NULL, &i->hwinfo); /* rebuild the preclassification scheme */
{
dag_adapterinfo_t *di = i->hwinfo.adapterinfo;
if (di->is_dsm_filtering)
dagdsm_build_bpffilter(FALSE, NULL, &i->hwinfo); /* rebuild the preclassification scheme */
}
#endif
return rc;
......@@ -893,6 +920,7 @@ int dagdsm_build_bpffilter(boolean_t check_only, char *new_filter_string, mapid_
free(xml_filter);
} else reason = "problem generating the XML filter";
} else reason = "missing or invalid path dsm_loader_bin (category [dag]) in the configuration file";
pc_close();
} else reason = "problem opening the mapid configuration file";
if (rc_err) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment