Commit d3e3bece authored by Sathya Perla's avatar Sathya Perla Committed by David S. Miller

bnxt_en: include bnxt_vfr.c code under CONFIG_BNXT_SRIOV switch

And define empty functions in bnxt_vfr.h when CONFIG_BNXT_SRIOV is not
defined.

This fixes build error when CONFIG_BNXT_SRIOV is switched off:
>> drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c:165:16: error: 'struct
>> bnxt' has no member named 'sriov_lock'
Reported-by: default avatarkbuild test robot <lkp@intel.com>
Fixes: 4ab0c6a8 ("bnxt_en: add support to enable VF-representors")
Signed-off-by: default avatarSathya Perla <sathya.perla@broadcom.com>
Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 51e3ea3f
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#include "bnxt.h" #include "bnxt.h"
#include "bnxt_vfr.h" #include "bnxt_vfr.h"
#ifdef CONFIG_BNXT_SRIOV
#define CFA_HANDLE_INVALID 0xffff #define CFA_HANDLE_INVALID 0xffff
#define VF_IDX_INVALID 0xffff #define VF_IDX_INVALID 0xffff
...@@ -487,3 +489,5 @@ void bnxt_dl_unregister(struct bnxt *bp) ...@@ -487,3 +489,5 @@ void bnxt_dl_unregister(struct bnxt *bp)
devlink_unregister(dl); devlink_unregister(dl);
devlink_free(dl); devlink_free(dl);
} }
#endif
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#ifndef BNXT_VFR_H #ifndef BNXT_VFR_H
#define BNXT_VFR_H #define BNXT_VFR_H
#ifdef CONFIG_BNXT_SRIOV
#define MAX_CFA_CODE 65536 #define MAX_CFA_CODE 65536
/* Struct to hold housekeeping info needed by devlink interface */ /* Struct to hold housekeeping info needed by devlink interface */
...@@ -39,4 +41,32 @@ void bnxt_vf_reps_open(struct bnxt *bp); ...@@ -39,4 +41,32 @@ void bnxt_vf_reps_open(struct bnxt *bp);
void bnxt_vf_rep_rx(struct bnxt *bp, struct sk_buff *skb); void bnxt_vf_rep_rx(struct bnxt *bp, struct sk_buff *skb);
struct net_device *bnxt_get_vf_rep(struct bnxt *bp, u16 cfa_code); struct net_device *bnxt_get_vf_rep(struct bnxt *bp, u16 cfa_code);
#else
static inline int bnxt_dl_register(struct bnxt *bp)
{
return 0;
}
static inline void bnxt_dl_unregister(struct bnxt *bp)
{
}
static inline void bnxt_vf_reps_close(struct bnxt *bp)
{
}
static inline void bnxt_vf_reps_open(struct bnxt *bp)
{
}
static inline void bnxt_vf_rep_rx(struct bnxt *bp, struct sk_buff *skb)
{
}
static inline struct net_device *bnxt_get_vf_rep(struct bnxt *bp, u16 cfa_code)
{
return NULL;
}
#endif /* CONFIG_BNXT_SRIOV */
#endif /* BNXT_VFR_H */ #endif /* BNXT_VFR_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment