From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-0016ce01.pphosted.com (mx0b-0016ce01.pphosted.com [67.231.156.153]) by dpdk.org (Postfix) with ESMTP id BE9923979 for ; Tue, 10 Nov 2015 00:57:18 +0100 (CET) Received: from pps.filterd (m0085408.ppops.net [127.0.0.1]) by mx0b-0016ce01.pphosted.com (8.15.0.59/8.15.0.59) with SMTP id tA9NvGfq002802; Mon, 9 Nov 2015 15:57:16 -0800 Received: from avcashub1.qlogic.com (avcashub1.qlogic.com [198.70.193.115]) by mx0b-0016ce01.pphosted.com with ESMTP id 1y1h5uk04n-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 09 Nov 2015 15:57:16 -0800 Received: from avluser05.qlc.com (10.1.113.115) by qlc.com (10.1.4.190) with Microsoft SMTP Server id 14.3.235.1; Mon, 9 Nov 2015 15:57:15 -0800 Received: (from rmody@localhost) by avluser05.qlc.com (8.14.4/8.14.4/Submit) id tA9NvFnA019443; Mon, 9 Nov 2015 15:57:15 -0800 X-Authentication-Warning: avluser05.qlc.com: rmody set sender to rasesh.mody@qlogic.com using -f From: Rasesh Mody To: Date: Mon, 9 Nov 2015 15:56:23 -0800 Message-ID: <1447113386-19346-9-git-send-email-rasesh.mody@qlogic.com> X-Mailer: git-send-email 1.7.10.3 In-Reply-To: <1447113386-19346-1-git-send-email-rasesh.mody@qlogic.com> References: <1447113386-19346-1-git-send-email-rasesh.mody@qlogic.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=nai engine=5700 definitions=7980 signatures=670655 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1507310000 definitions=main-1511090403 Cc: dev@dpdk.org, sony.chacko@qlogic.com Subject: [dpdk-dev] [PATCH v2 08/11] bnx2x: Handle zlib compatibility error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 23:57:19 -0000 Following error will be reported: PMD: ecore_gunzip(): Newer version of zlib required, 1.2.5.2 or higher EAL: Error - exiting with code: 1 Cause: rte_eth_dev_start:err=-1, port=0 Signed-off-by: Rasesh Mody --- doc/guides/nics/bnx2x.rst | 4 ++++ drivers/net/bnx2x/bnx2x.c | 10 +++++++++- drivers/net/bnx2x/ecore_init_ops.h | 18 ++++++++++++------ 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/doc/guides/nics/bnx2x.rst b/doc/guides/nics/bnx2x.rst index b70de04..d3912ed 100644 --- a/doc/guides/nics/bnx2x.rst +++ b/doc/guides/nics/bnx2x.rst @@ -86,6 +86,10 @@ Prerequisites `QLogic Driver Download Center ` to get the required firmware. +- This driver relies on external zlib library for unzipping the firmware image. + The zlib library is not part of DPDK and must be installed separately. The + minimum version of zlib library required is v1.2.5.2. + Pre-Installation Configuration ------------------------------ diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index f125c79..088c041 100644 --- a/drivers/net/bnx2x/bnx2x.c +++ b/drivers/net/bnx2x/bnx2x.c @@ -10029,6 +10029,7 @@ static int bnx2x_init_hw_common(struct bnx2x_softc *sc) { uint8_t abs_func_id; uint32_t val; + int ret = 0; PMD_DRV_LOG(DEBUG, "starting common init for func %d", SC_ABS_FUNC(sc)); @@ -10328,7 +10329,9 @@ static int bnx2x_init_hw_common(struct bnx2x_softc *sc) DELAY(20000); } - ecore_init_block(sc, BLOCK_TSEM, PHASE_COMMON); + ret = ecore_init_block(sc, BLOCK_TSEM, PHASE_COMMON); + if (ret != 0) + return ret; ecore_init_block(sc, BLOCK_USEM, PHASE_COMMON); ecore_init_block(sc, BLOCK_CSEM, PHASE_COMMON); ecore_init_block(sc, BLOCK_XSEM, PHASE_COMMON); @@ -11567,7 +11570,12 @@ static int ecore_gunzip(struct bnx2x_softc *sc, const uint8_t * zbuf, int len) } memset(&zlib_stream, 0, sizeof(zlib_stream)); +#if ZLIB_VERNUM < 0x1252 + PMD_INIT_LOG(ERR, "Newer version of zlib required, 1.2.5.2 or higher"); + return Z_VERSION_ERROR; +#else zlib_stream.next_in = zbuf + data_begin; +#endif zlib_stream.avail_in = len - data_begin; zlib_stream.next_out = sc->gz_buf; zlib_stream.avail_out = FW_BUF_SIZE; diff --git a/drivers/net/bnx2x/ecore_init_ops.h b/drivers/net/bnx2x/ecore_init_ops.h index b6f9832..cd042bb 100644 --- a/drivers/net/bnx2x/ecore_init_ops.h +++ b/drivers/net/bnx2x/ecore_init_ops.h @@ -150,18 +150,18 @@ static void ecore_wr_64(struct bnx2x_softc *sc, uint32_t reg, uint32_t val_lo, REG_WR_DMAE_LEN(sc, reg, wb_write, 2); } -static void ecore_init_wr_zp(struct bnx2x_softc *sc, uint32_t addr, uint32_t len, +static int ecore_init_wr_zp(struct bnx2x_softc *sc, uint32_t addr, uint32_t len, uint32_t blob_off) { const uint8_t *data = NULL; - int rc; + int rc = 0; uint32_t i; data = ecore_sel_blob(sc, addr, data) + blob_off*4; rc = ecore_gunzip(sc, data, len); if (rc) - return; + return rc; /* gunzip_outlen is in dwords */ len = GUNZIP_OUTLEN(sc); @@ -170,9 +170,11 @@ static void ecore_init_wr_zp(struct bnx2x_softc *sc, uint32_t addr, uint32_t len ECORE_CPU_TO_LE32(((uint32_t *)GUNZIP_BUF(sc))[i]); ecore_write_big_buf_wb(sc, addr, len); + + return rc; } -static void ecore_init_block(struct bnx2x_softc *sc, uint32_t block, uint32_t stage) +static int ecore_init_block(struct bnx2x_softc *sc, uint32_t block, uint32_t stage) { uint16_t op_start = INIT_OPS_OFFSETS(sc)[BLOCK_OPS_IDX(block, stage, @@ -183,10 +185,11 @@ static void ecore_init_block(struct bnx2x_softc *sc, uint32_t block, uint32_t st const union init_op *op; uint32_t op_idx, op_type, addr, len; const uint32_t *data, *data_base; + int ret = 0; /* If empty block */ if (op_start == op_end) - return; + return ret; data_base = INIT_DATA(sc); @@ -221,7 +224,9 @@ static void ecore_init_block(struct bnx2x_softc *sc, uint32_t block, uint32_t st ecore_init_fill(sc, addr, 0, op->zero.len); break; case OP_ZP: - ecore_init_wr_zp(sc, addr, len, op->arr_wr.data_off); + ret = ecore_init_wr_zp(sc, addr, len, op->arr_wr.data_off); + if (ret != 0) + return ret; break; case OP_WR_64: ecore_init_wr_64(sc, addr, data, len); @@ -254,6 +259,7 @@ static void ecore_init_block(struct bnx2x_softc *sc, uint32_t block, uint32_t st break; } } + return ret; } -- 1.7.10.3