netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Chan <michael.chan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Sathya Perla <sathya.perla@broadcom.com>
Subject: [PATCH net-next 1/3] bnxt_en: include bnxt_vfr.c code under CONFIG_BNXT_SRIOV switch
Date: Tue, 25 Jul 2017 13:28:39 -0400	[thread overview]
Message-ID: <1501003721-12407-2-git-send-email-michael.chan@broadcom.com> (raw)
In-Reply-To: <1501003721-12407-1-git-send-email-michael.chan@broadcom.com>

From: Sathya Perla <sathya.perla@broadcom.com>

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: kbuild test robot <lkp@intel.com>
Fixes: 4ab0c6a8ffd7 ("bnxt_en: add support to enable VF-representors")
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c |  4 ++++
 drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.h | 30 +++++++++++++++++++++++++++
 2 files changed, 34 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
index 83478e9..a52e292 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
@@ -16,6 +16,8 @@
 #include "bnxt.h"
 #include "bnxt_vfr.h"
 
+#ifdef CONFIG_BNXT_SRIOV
+
 #define CFA_HANDLE_INVALID		0xffff
 #define VF_IDX_INVALID			0xffff
 
@@ -487,3 +489,5 @@ void bnxt_dl_unregister(struct bnxt *bp)
 	devlink_unregister(dl);
 	devlink_free(dl);
 }
+
+#endif
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.h
index c6cd55a..e55a3b6 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.h
@@ -10,6 +10,8 @@
 #ifndef BNXT_VFR_H
 #define BNXT_VFR_H
 
+#ifdef CONFIG_BNXT_SRIOV
+
 #define	MAX_CFA_CODE			65536
 
 /* Struct to hold housekeeping info needed by devlink interface */
@@ -39,4 +41,32 @@ static inline void bnxt_link_bp_to_dl(struct devlink *dl, struct bnxt *bp)
 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);
 
+#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 */
-- 
1.8.3.1

  reply	other threads:[~2017-07-25 17:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-25 17:28 [PATCH net-next 0/3] bnxt_en: Fix kbuild errors and rename phys_port_name Michael Chan
2017-07-25 17:28 ` Michael Chan [this message]
2017-07-25 17:28 ` [PATCH net-next 2/3] bnxt_en: use SWITCHDEV_SET_OPS() for setting vf_rep_switchdev_ops Michael Chan
2017-07-25 17:28 ` [PATCH net-next 3/3] bnxt_en: fix switchdev port naming for external-port-rep and vf-reps Michael Chan
2017-07-25 19:48 ` [PATCH net-next 0/3] bnxt_en: Fix kbuild errors and rename phys_port_name David Miller
  -- strict thread matches above, loose matches on Subject: below --
2017-07-25 10:49 [PATCH net-next 1/3] bnxt_en: include bnxt_vfr.c code under CONFIG_BNXT_SRIOV switch Sathya Perla
2017-07-25 16:34 ` Michael Chan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1501003721-12407-2-git-send-email-michael.chan@broadcom.com \
    --to=michael.chan@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=sathya.perla@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).