From: Jerin Jacob <jerinjacobk@gmail.com>
To: Rasesh Mody <rmody@marvell.com>
Cc: dev@dpdk.org, ferruh.yigit@intel.com,
Jerin Jacob <jerinj@marvell.com>,
GR-Everest-DPDK-Dev@marvell.com
Subject: Re: [dpdk-dev] [PATCH 1/5] net/bnx2x: update and reorganize HW registers
Date: Thu, 12 Sep 2019 17:47:53 +0530 [thread overview]
Message-ID: <CALBAE1Nvy7AwxbNKdP3p6t0-thetNLe4chWab828i5_rtAO5EA@mail.gmail.com> (raw)
In-Reply-To: <20190906072548.12304-2-rmody@marvell.com>
On Fri, Sep 6, 2019 at 12:57 PM Rasesh Mody <rmody@marvell.com> wrote:
>
> Update and reorganize HW registers in preparation to update the firmware
> to version 7.13.11.
> Move HW_INTERRUT_ASSERT_SET_0 out from ecore_reg.h to bnx2x.h.
>
> Signed-off-by: Rasesh Mody <rmody@marvell.com>
> ---
> drivers/net/bnx2x/bnx2x.c | 3 +-
> drivers/net/bnx2x/bnx2x.h | 67 +
> drivers/net/bnx2x/ecore_reg.h | 6246 ++++++++++++++++++++++-----------
> 3 files changed, 4183 insertions(+), 2133 deletions(-)
>
+/******************************************************************************
> + * Description:
> + * Calculates crc 8 on a word value: polynomial 0-1-2-8
> + * Code was translated from Verilog.
Not relevant comment.
> + * Return:
> + *****************************************************************************/
> +static inline uint8_t calc_crc8(uint32_t data, uint8_t crc)
> +{
If is used in slow-path code then move to .c file.
If it is standard crc function then please think about reusing dpdk;s CRC lib.
> + uint8_t D[32];
> + uint8_t NewCRC[8];
> + uint8_t C[8];
> + uint8_t crc_res;
> + uint8_t i;
> +
> + /* split the data into 31 bits */
> + for (i = 0; i < 32; i++) {
> + D[i] = (uint8_t)(data & 1);
> + data = data >> 1;
> + }
> +
> + /* split the crc into 8 bits */
> + for (i = 0; i < 8; i++) {
> + C[i] = crc & 1;
> + crc = crc >> 1;
> + }
> +
> + NewCRC[0] = D[31] ^ D[30] ^ D[28] ^ D[23] ^ D[21] ^ D[19] ^ D[18] ^
> + D[16] ^ D[14] ^ D[12] ^ D[8] ^ D[7] ^ D[6] ^ D[0] ^ C[4] ^
> + C[6] ^ C[7];
> + NewCRC[1] = D[30] ^ D[29] ^ D[28] ^ D[24] ^ D[23] ^ D[22] ^ D[21] ^
> + D[20] ^ D[18] ^ D[17] ^ D[16] ^ D[15] ^ D[14] ^ D[13] ^
> + D[12] ^ D[9] ^ D[6] ^ D[1] ^ D[0] ^ C[0] ^ C[4] ^ C[5] ^ C[6];
> + NewCRC[2] = D[29] ^ D[28] ^ D[25] ^ D[24] ^ D[22] ^ D[17] ^ D[15] ^
> + D[13] ^ D[12] ^ D[10] ^ D[8] ^ D[6] ^ D[2] ^ D[1] ^ D[0] ^
> + C[0] ^ C[1] ^ C[4] ^ C[5];
> + NewCRC[3] = D[30] ^ D[29] ^ D[26] ^ D[25] ^ D[23] ^ D[18] ^ D[16] ^
> + D[14] ^ D[13] ^ D[11] ^ D[9] ^ D[7] ^ D[3] ^ D[2] ^ D[1] ^
> + C[1] ^ C[2] ^ C[5] ^ C[6];
> + NewCRC[4] = D[31] ^ D[30] ^ D[27] ^ D[26] ^ D[24] ^ D[19] ^ D[17] ^
> + D[15] ^ D[14] ^ D[12] ^ D[10] ^ D[8] ^ D[4] ^ D[3] ^ D[2] ^
> + C[0] ^ C[2] ^ C[3] ^ C[6] ^ C[7];
> + NewCRC[5] = D[31] ^ D[28] ^ D[27] ^ D[25] ^ D[20] ^ D[18] ^ D[16] ^
> + D[15] ^ D[13] ^ D[11] ^ D[9] ^ D[5] ^ D[4] ^ D[3] ^ C[1] ^
> + C[3] ^ C[4] ^ C[7];
> + NewCRC[6] = D[29] ^ D[28] ^ D[26] ^ D[21] ^ D[19] ^ D[17] ^ D[16] ^
> + D[14] ^ D[12] ^ D[10] ^ D[6] ^ D[5] ^ D[4] ^ C[2] ^ C[4] ^ C[5];
> + NewCRC[7] = D[30] ^ D[29] ^ D[27] ^ D[22] ^ D[20] ^ D[18] ^ D[17] ^
> + D[15] ^ D[13] ^ D[11] ^ D[7] ^ D[6] ^ D[5] ^ C[3] ^ C[5] ^ C[6];
> +
> + crc_res = 0;
> + for (i = 0; i < 8; i++) {
> + crc_res |= (NewCRC[i] << i);
> + }
> +
> + return crc_res;
> +}
> +
> +
> #endif /* ECORE_REG_H */
> --
> 2.18.0
>
next prev parent reply other threads:[~2019-09-12 12:18 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-06 7:25 [dpdk-dev] [PATCH 0/5] net/bnx2x: update to latest FW Rasesh Mody
2019-09-06 7:25 ` [dpdk-dev] [PATCH 1/5] net/bnx2x: update and reorganize HW registers Rasesh Mody
2019-09-12 12:17 ` Jerin Jacob [this message]
2019-09-19 21:28 ` [dpdk-dev] [EXT] " Rasesh Mody
2019-09-23 10:47 ` [dpdk-dev] " Jerin Jacob
2019-09-06 7:25 ` [dpdk-dev] [PATCH 2/5] net/bnx2x: update HSI code Rasesh Mody
2019-09-06 7:25 ` [dpdk-dev] [PATCH 3/5] net/bnx2x: update to latest FW 7.13.11 Rasesh Mody
2019-09-12 12:25 ` Jerin Jacob
2019-09-06 7:25 ` [dpdk-dev] [PATCH 4/5] doc: cleanup SPDX license id usage in bnx2x guide Rasesh Mody
2019-09-06 7:25 ` [dpdk-dev] [PATCH 5/5] net/bnx2x: change PMD version to 1.1.0.1 Rasesh Mody
2019-09-12 12:11 ` [dpdk-dev] [PATCH 0/5] net/bnx2x: update to latest FW Jerin Jacob
2019-09-12 22:00 ` [dpdk-dev] [EXT] " Rasesh Mody
2019-09-19 21:11 ` [dpdk-dev] [PATCH v2 0/4] " Rasesh Mody
2019-09-23 16:33 ` Ferruh Yigit
2019-09-24 15:39 ` Jerin Jacob
2019-09-24 15:57 ` Ferruh Yigit
2019-09-24 16:30 ` Jerin Jacob
2019-09-24 16:51 ` Rasesh Mody
2019-09-19 21:11 ` [dpdk-dev] [PATCH v2 1/4] net/bnx2x: update and reorganize HW registers Rasesh Mody
2019-09-19 21:11 ` [dpdk-dev] [PATCH v2 2/4] net/bnx2x: update HSI code Rasesh Mody
2019-09-19 21:11 ` [dpdk-dev] [PATCH v2 3/4] net/bnx2x: update to latest FW 7.13.11 Rasesh Mody
2019-09-19 21:11 ` [dpdk-dev] [PATCH v2 4/4] doc: cleanup SPDX license id usage in bnx2x guide Rasesh Mody
2019-10-02 19:14 ` [dpdk-dev] [PATCH v3 0/3] net/bnx2x: update to latest FW Rasesh Mody
2019-10-03 5:57 ` Jerin Jacob
2019-10-03 6:48 ` Rasesh Mody
2019-10-04 9:32 ` Jerin Jacob
2019-10-02 19:14 ` [dpdk-dev] [PATCH v3 1/3] net/bnx2x: update and reorganize HW registers Rasesh Mody
2019-10-02 19:14 ` [dpdk-dev] [PATCH v3 2/3] net/bnx2x: update HSI code Rasesh Mody
2019-10-02 19:14 ` [dpdk-dev] [PATCH v3 3/3] net/bnx2x: update to latest FW 7.13.11 Rasesh Mody
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CALBAE1Nvy7AwxbNKdP3p6t0-thetNLe4chWab828i5_rtAO5EA@mail.gmail.com \
--to=jerinjacobk@gmail.com \
--cc=GR-Everest-DPDK-Dev@marvell.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=jerinj@marvell.com \
--cc=rmody@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).