aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVipul Pandya <vipul@chelsio.com>2013-04-29 00:04:41 -0400
committerDavid S. Miller <davem@davemloft.net>2013-04-29 15:24:44 -0400
commit94dace10142790ddeb0a3a7b8b33d9540d30c79f (patch)
tree3fdd26a665b6b47dca4afc75d1c83494a2d07fda
parentb407a4a90800ff4a89b7280302602245806bf498 (diff)
cxgb4vf: Support CPL_SGE_EGR_UPDATEs encapsulated in a CPL_FW4_MSG
Newer firmware can post CPL_SGE_EGR_UPDATE message encapsulated in a CPL_FW4_MSG as follows flit0 rss_header (if DropRSS == 0 in IQ context) flit1 CPL_FW4_MSG cpl flit2 rss_header w/opcode CPL_SGE_EGR_UPDATE flit3 CPL_SGE_EGR_UPDATE cpl So FW4_MSG CPLs with a newly created type of FW_TYPE_RSSCPL have the CPL_SGE_EGR_UPDATE CPL message in flit 2 of the FW4_MSG. Firmware can still post regular CPL_SGE_EGR_UPDATE messages, so the drivers need to handle both. This patch also writes a new parameter to firmware requesting encapsulated EGR_UPDATE. This allows firmware with this support to not break older drivers. Signed-off-by: Vipul Pandya <vipul@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/t4_msg.h1
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c25
2 files changed, 26 insertions, 0 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h b/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h
index 357e297df1ab..01d484441200 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h
@@ -158,6 +158,7 @@ union opcode_tid {
158}; 158};
159 159
160#define CPL_OPCODE(x) ((x) << 24) 160#define CPL_OPCODE(x) ((x) << 24)
161#define G_CPL_OPCODE(x) (((x) >> 24) & 0xFF)
161#define MK_OPCODE_TID(opcode, tid) (CPL_OPCODE(opcode) | (tid)) 162#define MK_OPCODE_TID(opcode, tid) (CPL_OPCODE(opcode) | (tid))
162#define OPCODE_TID(cmd) ((cmd)->ot.opcode_tid) 163#define OPCODE_TID(cmd) ((cmd)->ot.opcode_tid)
163#define GET_TID(cmd) (ntohl(OPCODE_TID(cmd)) & 0xFFFFFF) 164#define GET_TID(cmd) (ntohl(OPCODE_TID(cmd)) & 0xFFFFFF)
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
index 73aef76a526c..40c22e7de15c 100644
--- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
@@ -409,6 +409,20 @@ static int fwevtq_handler(struct sge_rspq *rspq, const __be64 *rsp,
409 break; 409 break;
410 } 410 }
411 411
412 case CPL_FW4_MSG: {
413 /* FW can send EGR_UPDATEs encapsulated in a CPL_FW4_MSG.
414 */
415 const struct cpl_sge_egr_update *p = (void *)(rsp + 3);
416 opcode = G_CPL_OPCODE(ntohl(p->opcode_qid));
417 if (opcode != CPL_SGE_EGR_UPDATE) {
418 dev_err(adapter->pdev_dev, "unexpected FW4/CPL %#x on FW event queue\n"
419 , opcode);
420 break;
421 }
422 cpl = (void *)p;
423 /*FALLTHROUGH*/
424 }
425
412 case CPL_SGE_EGR_UPDATE: { 426 case CPL_SGE_EGR_UPDATE: {
413 /* 427 /*
414 * We've received an Egress Queue Status Update message. We 428 * We've received an Egress Queue Status Update message. We
@@ -2072,6 +2086,7 @@ static int adap_init0(struct adapter *adapter)
2072 struct sge *s = &adapter->sge; 2086 struct sge *s = &adapter->sge;
2073 unsigned int ethqsets; 2087 unsigned int ethqsets;
2074 int err; 2088 int err;
2089 u32 param, val = 0;
2075 2090
2076 /* 2091 /*
2077 * Wait for the device to become ready before proceeding ... 2092 * Wait for the device to become ready before proceeding ...
@@ -2153,6 +2168,16 @@ static int adap_init0(struct adapter *adapter)
2153 return err; 2168 return err;
2154 } 2169 }
2155 2170
2171 /* If we're running on newer firmware, let it know that we're
2172 * prepared to deal with encapsulated CPL messages. Older
2173 * firmware won't understand this and we'll just get
2174 * unencapsulated messages ...
2175 */
2176 param = FW_PARAMS_MNEM(FW_PARAMS_MNEM_PFVF) |
2177 FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_PFVF_CPLFW4MSG_ENCAP);
2178 val = 1;
2179 (void) t4vf_set_params(adapter, 1, &param, &val);
2180
2156 /* 2181 /*
2157 * Retrieve our RX interrupt holdoff timer values and counter 2182 * Retrieve our RX interrupt holdoff timer values and counter
2158 * threshold values from the SGE parameters. 2183 * threshold values from the SGE parameters.