bnxt_en: include bnxt_vfr.c code under CONFIG_BNXT_SRIOV switch
PATCH 1/3 bnxt_en: include bnxt_vfr.c code under CONFIG_BNXT_SRIOV switch
This fixes build error when CONFIG_BNXT_SRIOV is switched off:
Quoted 2 lines
Quoted 2 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c:165:16: error: 'struct bnxt' has no member named 'sriov_lock'
--- drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c +4 -0
@@ -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 /* CONFIG_BNXT_SRIOV */
Signature · 1 line
1.8.3.1
PATCH 2/3 bnxt_en: use SWITCHDEV_SET_OPS() for setting vf_rep_switchdev_ops
This fixes the build error:
‘struct net_device’ has no member named ‘switchdev_ops’
--- drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c +1 -1
@@ -304,7 +304,7 @@ static void bnxt_vf_rep_netdev_init(struct bnxt *bp, struct bnxt_vf_rep *vf_rep, dev->netdev_ops = &bnxt_vf_rep_netdev_ops; dev->ethtool_ops = &bnxt_vf_rep_ethtool_ops; - dev->switchdev_ops = &bnxt_vf_rep_switchdev_ops; +SWITCHDEV_SET_OPS (dev, &bnxt_vf_rep_switchdev_ops);/* Just inherit all the featues of the parent PF as the VF-R * uses the RX/TX rings of the parent PF */
Signature · 1 line
1.8.3.1
PATCH 3/3 bnxt_en: fix switchdev port naming for external-port-rep and vf-reps
In reply to Sathya PerlaFix the phys_port_name for the external physical port to be in "pA" format and that of VF-rep to be in "pCvfD" format as suggested by Jakub Kicinski.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 6 +----- drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c | 4 +++- 2 files changed, 4 insertions(+), 6 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +1 -5
@@ -7556,11 +7556,7 @@ static int bnxt_get_phys_port_name(struct net_device *dev, char *buf,if (!BNXT_PF (bp))return -EOPNOTSUPP ; -/* The switch-id that the pf belongs to is exported by -* the switchdev ndo. This name is just to distinguish from the -* vf-rep ports. -*/ - rc =snprintf (buf, len,"pf%d" , bp->pf.port_id); + rc =snprintf (buf, len,"p%d" , bp->pf.port_id);if (rc >= len)return -EOPNOTSUPP ;
drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c +3 -1
@@ -141,9 +141,11 @@ static int bnxt_vf_rep_get_phys_port_name(struct net_device *dev, char *buf, size_t len) {struct bnxt_vf_rep *vf_rep =netdev_priv (dev); +struct pci_dev *pf_pdev = vf_rep->bp->pdev;int rc; - rc =snprintf (buf, len,"vfr%d" , vf_rep->vf_idx); + rc =snprintf (buf, len,"pf%dvf%d" ,PCI_FUNC (pf_pdev->devfn), + vf_rep->vf_idx);if (rc >= len)return -EOPNOTSUPP ;return 0 ;
Signature · 1 line
1.8.3.1
Michael Chan
maintainerQuoted 25 lines · Sathya Perla
This fixes build error when
CONFIG_BNXT_SRIOVis switched off:Quoted 2 lines
Quoted 2 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c:165:16: error: 'struct bnxt' has no member named 'sriov_lock'Reported-by kbuild test robot <[email protected]>Fixes 4ab0c6a8ffd7 ("bnxt_en: add support to enable VF-representors")Signed-off-by Sathya Perla <[email protected]>--- drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c +2
-0@@ -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
drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c void bnxt_dl_unregister(struct bnxt *bp) · line 493
Quoted 5 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c +2
-0@@ -487,3 +489,5 @@ void bnxt_dl_unregister(struct bnxt *bp)devlink_unregister (dl); devlink_free(dl); } + +#endif /* CONFIG_BNXT_SRIOV */
This won't work. It will cause undefined symbols if CONFIG_BNXT_SRIOV is not defined. I will fix everything up and resend all 3 patches.