net/bnxt: move function check zero bytes
Move check_zero_bytes into new bnxt_util.h file. Signed-off-by: Scott Branden <scott.branden@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
This commit is contained in:
parent
14255b3515
commit
4a2361df8f
@ -38,6 +38,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_txq.c
|
|||||||
SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_txr.c
|
SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_txr.c
|
||||||
SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_vnic.c
|
SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_vnic.c
|
||||||
SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_irq.c
|
SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_irq.c
|
||||||
|
SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_util.c
|
||||||
SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += rte_pmd_bnxt.c
|
SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += rte_pmd_bnxt.c
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include "bnxt_vnic.h"
|
#include "bnxt_vnic.h"
|
||||||
#include "hsi_struct_def_dpdk.h"
|
#include "hsi_struct_def_dpdk.h"
|
||||||
#include "bnxt_nvm_defs.h"
|
#include "bnxt_nvm_defs.h"
|
||||||
|
#include "bnxt_util.h"
|
||||||
|
|
||||||
#define DRV_MODULE_NAME "bnxt"
|
#define DRV_MODULE_NAME "bnxt"
|
||||||
static const char bnxt_version[] =
|
static const char bnxt_version[] =
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#include "bnxt.h"
|
#include "bnxt.h"
|
||||||
#include "bnxt_filter.h"
|
#include "bnxt_filter.h"
|
||||||
#include "bnxt_hwrm.h"
|
#include "bnxt_hwrm.h"
|
||||||
|
#include "bnxt_util.h"
|
||||||
#include "bnxt_vnic.h"
|
#include "bnxt_vnic.h"
|
||||||
#include "hsi_struct_def_dpdk.h"
|
#include "hsi_struct_def_dpdk.h"
|
||||||
|
|
||||||
@ -231,15 +232,6 @@ nxt_non_void_action(const struct rte_flow_action *cur)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int bnxt_check_zero_bytes(const uint8_t *bytes, int len)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < len; i++)
|
|
||||||
if (bytes[i] != 0x00)
|
|
||||||
return 0;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
bnxt_filter_type_check(const struct rte_flow_item pattern[],
|
bnxt_filter_type_check(const struct rte_flow_item pattern[],
|
||||||
struct rte_flow_error *error __rte_unused)
|
struct rte_flow_error *error __rte_unused)
|
||||||
|
@ -69,7 +69,6 @@ struct bnxt_filter_info *bnxt_get_unused_filter(struct bnxt *bp);
|
|||||||
void bnxt_free_filter(struct bnxt *bp, struct bnxt_filter_info *filter);
|
void bnxt_free_filter(struct bnxt *bp, struct bnxt_filter_info *filter);
|
||||||
struct bnxt_filter_info *bnxt_get_l2_filter(struct bnxt *bp,
|
struct bnxt_filter_info *bnxt_get_l2_filter(struct bnxt *bp,
|
||||||
struct bnxt_filter_info *nf, struct bnxt_vnic_info *vnic);
|
struct bnxt_filter_info *nf, struct bnxt_vnic_info *vnic);
|
||||||
int bnxt_check_zero_bytes(const uint8_t *bytes, int len);
|
|
||||||
|
|
||||||
#define NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_MACADDR \
|
#define NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_MACADDR \
|
||||||
HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR
|
HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR
|
||||||
|
18
drivers/net/bnxt/bnxt_util.c
Normal file
18
drivers/net/bnxt/bnxt_util.c
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
* Copyright(c) 2014-2018 Broadcom
|
||||||
|
* All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
|
#include "bnxt_util.h"
|
||||||
|
|
||||||
|
int bnxt_check_zero_bytes(const uint8_t *bytes, int len)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < len; i++)
|
||||||
|
if (bytes[i] != 0x00)
|
||||||
|
return 0;
|
||||||
|
return 1;
|
||||||
|
}
|
11
drivers/net/bnxt/bnxt_util.h
Normal file
11
drivers/net/bnxt/bnxt_util.h
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
/* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
* Copyright(c) 2014-2018 Broadcom
|
||||||
|
* All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _BNXT_UTIL_H_
|
||||||
|
#define _BNXT_UTIL_H_
|
||||||
|
|
||||||
|
int bnxt_check_zero_bytes(const uint8_t *bytes, int len);
|
||||||
|
|
||||||
|
#endif /* _BNXT_UTIL_H_ */
|
@ -14,5 +14,6 @@ sources = files('bnxt_cpr.c',
|
|||||||
'bnxt_stats.c',
|
'bnxt_stats.c',
|
||||||
'bnxt_txq.c',
|
'bnxt_txq.c',
|
||||||
'bnxt_txr.c',
|
'bnxt_txr.c',
|
||||||
|
'bnxt_util.c',
|
||||||
'bnxt_vnic.c',
|
'bnxt_vnic.c',
|
||||||
'rte_pmd_bnxt.c')
|
'rte_pmd_bnxt.c')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user