From 5174205de5ad204c9bda373c3ee63e688762a85c Mon Sep 17 00:00:00 2001 From: Navdeep Parhar Date: Thu, 10 May 2018 00:04:14 +0000 Subject: [PATCH] cxgbe(4): Determine whether the firmware supports the FILTER2 work request, which can be used to configure hardware NAT and swapmac. All firmwares released after Jan 2017 support this work request. Sponsored by: Chelsio Communications --- sys/dev/cxgbe/common/common.h | 1 + sys/dev/cxgbe/t4_main.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/sys/dev/cxgbe/common/common.h b/sys/dev/cxgbe/common/common.h index 74d995c5c85..b2907ec41af 100644 --- a/sys/dev/cxgbe/common/common.h +++ b/sys/dev/cxgbe/common/common.h @@ -371,6 +371,7 @@ struct adapter_params { unsigned int bypass:1; /* this is a bypass card */ unsigned int ethoffload:1; unsigned int hash_filter:1; + unsigned int filter2_wr_support:1; unsigned int ofldq_wr_cred; unsigned int eo_wr_cred; diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index e2c2dd2e312..338e357fe02 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -3631,6 +3631,18 @@ get_params__post_init(struct adapter *sc) else sc->params.mps_bg_map = 0; + /* + * Determine whether the firmware supports the filter2 work request. + * This is queried separately for the same reason as MPSBGMAP above. + */ + param[0] = FW_PARAM_DEV(FILTER2_WR); + val[0] = 0; + rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 1, param, val); + if (rc == 0) + sc->params.filter2_wr_support = val[0] != 0; + else + sc->params.filter2_wr_support = 0; + /* get capabilites */ bzero(&caps, sizeof(caps)); caps.op_to_write = htobe32(V_FW_CMD_OP(FW_CAPS_CONFIG_CMD) |