LCOV - code coverage report
Current view: top level - drivers/net/bnxt - bnxt_util.c (source / functions) Hit Total Coverage
Test: Code coverage Lines: 0 15 0.0 %
Date: 2025-02-01 18:54:23 Functions: 0 3 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 4 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* SPDX-License-Identifier: BSD-3-Clause
       2                 :            :  * Copyright(c) 2014-2023 Broadcom
       3                 :            :  * All rights reserved.
       4                 :            :  */
       5                 :            : 
       6                 :            : #include <inttypes.h>
       7                 :            : #include <rte_ether.h>
       8                 :            : 
       9                 :            : #include "bnxt_util.h"
      10                 :            : 
      11                 :          0 : int bnxt_check_zero_bytes(const uint8_t *bytes, int len)
      12                 :            : {
      13                 :            :         int i;
      14                 :            : 
      15         [ #  # ]:          0 :         for (i = 0; i < len; i++)
      16         [ #  # ]:          0 :                 if (bytes[i] != 0x00)
      17                 :            :                         return 0;
      18                 :            :         return 1;
      19                 :            : }
      20                 :            : 
      21                 :          0 : void bnxt_eth_hw_addr_random(uint8_t *mac_addr)
      22                 :            : {
      23                 :          0 :         rte_eth_random_addr(mac_addr);
      24                 :            : 
      25                 :            :         /* Set Organizationally Unique Identifier (OUI) prefix */
      26                 :          0 :         mac_addr[0] = 0x00;
      27                 :          0 :         mac_addr[1] = 0x0a;
      28                 :          0 :         mac_addr[2] = 0xf7;
      29                 :          0 : }
      30                 :            : 
      31                 :          0 : uint8_t hweight32(uint32_t word32)
      32                 :            : {
      33                 :          0 :         uint32_t res = word32 - ((word32 >> 1) & 0x55555555);
      34                 :            : 
      35                 :          0 :         res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
      36                 :          0 :         res = (res + (res >> 4)) & 0x0F0F0F0F;
      37                 :          0 :         res = res + (res >> 8);
      38                 :          0 :         return (res + (res >> 16)) & 0x000000FF;
      39                 :            : }

Generated by: LCOV version 1.14