Skip to contentSkip to conversation

net/bnxt: use bnxt_ prefix on global function

PATCH In review Stephen Hemminger 2 participants 2 messages Apr 23, 2021 – Apr 24, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/bnxt: use bnxt_ prefix on global function

When statically linked the function prandom_bytes is exposed and might conflict with something in application. All driver functions should use same prefix.

Fixes 9738793f28ec ("net/bnxt: add VNIC functions and structs")
---
 drivers/net/bnxt/bnxt_flow.c | 4 ++--
 drivers/net/bnxt/bnxt_vnic.c | 4 ++--
 drivers/net/bnxt/bnxt_vnic.h | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/net/bnxt/bnxt_flow.c +2 -2
index e3906b47791b..844bf1520f50 100644
@@ -1404,8 +1404,8 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev,
 				/* If hash key has not been specified,
 				 * use random hash key.
 				 */
-				prandom_bytes(vnic->rss_hash_key,
-					      HW_HASH_KEY_SIZE);
+				bnxt_prandom_bytes(vnic->rss_hash_key,
+						   HW_HASH_KEY_SIZE);
 			} else {
 				if (rss->key_len > HW_HASH_KEY_SIZE)
 					memcpy(vnic->rss_hash_key,
drivers/net/bnxt/bnxt_vnic.c +2 -2
index 14ad33b4e86c..de5c14566deb 100644
@@ -16,7 +16,7 @@
  * VNIC Functions
  */
 
-void prandom_bytes(void *dest_ptr, size_t len)
+void bnxt_prandom_bytes(void *dest_ptr, size_t len)
 {
 	char *dest = (char *)dest_ptr;
 	uint64_t rb;
@@ -172,7 +172,7 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)
 				HW_HASH_KEY_SIZE);
 		vnic->mc_list_dma_addr = vnic->rss_hash_key_dma_addr +
 				HW_HASH_KEY_SIZE;
-		prandom_bytes(vnic->rss_hash_key, HW_HASH_KEY_SIZE);
+		bnxt_prandom_bytes(vnic->rss_hash_key, HW_HASH_KEY_SIZE);
 	}
 
 	return 0;
drivers/net/bnxt/bnxt_vnic.h +1 -1
index 00a664c8b839..37b452f28170 100644
@@ -68,7 +68,7 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp);
 void bnxt_free_vnic_mem(struct bnxt *bp);
 int bnxt_alloc_vnic_mem(struct bnxt *bp);
 int bnxt_vnic_grp_alloc(struct bnxt *bp, struct bnxt_vnic_info *vnic);
-void prandom_bytes(void *dest_ptr, size_t len);
+void bnxt_prandom_bytes(void *dest_ptr, size_t len);
 uint16_t bnxt_rte_to_hwrm_hash_types(uint64_t rte_type);
 int bnxt_rte_to_hwrm_hash_level(struct bnxt *bp, uint64_t hash_f, uint32_t lvl);
 uint64_t bnxt_hwrm_to_rte_rss_level(struct bnxt *bp, uint32_t mode);
Signature · 1 line
2.30.2
#1 lore raw
Quoted 7 lines · Stephen Hemminger

When statically linked the function prandom_bytes is exposed and might conflict with something in application. All driver functions should use same prefix.

Fixes 9738793f28ec ("net/bnxt: add VNIC functions and structs")

Patch applied to dpdk-next-net-brcm. Thanks

Quoted 59 lines
---
 drivers/net/bnxt/bnxt_flow.c | 4 ++--
 drivers/net/bnxt/bnxt_vnic.c | 4 ++--
 drivers/net/bnxt/bnxt_vnic.h | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/net/bnxt/bnxt_flow.c +2 -2
index e3906b47791b..844bf1520f50 100644
@@ -1404,8 +1404,8 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev,
                                /* If hash key has not been specified,
                                 * use random hash key.
                                 */
-                               prandom_bytes(vnic->rss_hash_key,
-                                             HW_HASH_KEY_SIZE);
+                               bnxt_prandom_bytes(vnic->rss_hash_key,
+                                                  HW_HASH_KEY_SIZE);
                        } else {
                                if (rss->key_len > HW_HASH_KEY_SIZE)
                                        memcpy(vnic->rss_hash_key,
drivers/net/bnxt/bnxt_vnic.c +2 -2
index 14ad33b4e86c..de5c14566deb 100644
@@ -16,7 +16,7 @@
  * VNIC Functions
  */
 
-void prandom_bytes(void *dest_ptr, size_t len)
+void bnxt_prandom_bytes(void *dest_ptr, size_t len)
 {
        char *dest = (char *)dest_ptr;
        uint64_t rb;
@@ -172,7 +172,7 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)
                                HW_HASH_KEY_SIZE);
                vnic->mc_list_dma_addr = vnic->rss_hash_key_dma_addr +
                                HW_HASH_KEY_SIZE;
-               prandom_bytes(vnic->rss_hash_key, HW_HASH_KEY_SIZE);
+               bnxt_prandom_bytes(vnic->rss_hash_key, HW_HASH_KEY_SIZE);
        }
 
        return 0;
drivers/net/bnxt/bnxt_vnic.h +1 -2
index 00a664c8b839..37b452f28170 100644
@@ -68,7 +68,7 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp);
 void bnxt_free_vnic_mem(struct bnxt *bp);
 int bnxt_alloc_vnic_mem(struct bnxt *bp);
 int bnxt_vnic_grp_alloc(struct bnxt *bp, struct bnxt_vnic_info *vnic);
-void prandom_bytes(void *dest_ptr, size_t len);
+void bnxt_prandom_bytes(void *dest_ptr, size_t len);
 uint16_t bnxt_rte_to_hwrm_hash_types(uint64_t rte_type);
 int bnxt_rte_to_hwrm_hash_level(struct bnxt *bp, uint64_t hash_f, uint32_t lvl);
 uint64_t bnxt_hwrm_to_rte_rss_level(struct bnxt *bp, uint32_t mode);
--

2.30.2