[dpdk-dev] [EXT] Re: [PATCH 1/5] net/bnx2x: update and reorganize HW registers

Rasesh Mody rmody at marvell.com
Thu Sep 19 23:28:03 CEST 2019


Hi Jerin,

>From: Jerin Jacob <jerinjacobk at gmail.com>
>Sent: Thursday, September 12, 2019 5:18 AM
>
>----------------------------------------------------------------------
>On Fri, Sep 6, 2019 at 12:57 PM Rasesh Mody <rmody at 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 at 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.
>

Removed calc_crc8() from this patch in v2 series, we use ecore_calc_crc8().
It's non-standard crc function, unavailable in dpdk's CRC lib.

Thanks!
-Rasesh

>
>> +    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
>>



More information about the dev mailing list