Commit 34c8c10a authored by David S. Miller's avatar David S. Miller

Merge branch 'bnxt_en-Fix-kbuild-errors-and-rename-phys_port_name'

Michael Chan says:

====================
bnxt_en: Fix kbuild errors and rename phys_port_name.

Fix 2 more kbuild errors (the first one already fixed by DaveM), and rename
the physical port name.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 51e3ea3f 53f70b8b
...@@ -7552,11 +7552,7 @@ static int bnxt_get_phys_port_name(struct net_device *dev, char *buf, ...@@ -7552,11 +7552,7 @@ static int bnxt_get_phys_port_name(struct net_device *dev, char *buf,
if (!BNXT_PF(bp)) if (!BNXT_PF(bp))
return -EOPNOTSUPP; return -EOPNOTSUPP;
/* The switch-id that the pf belongs to is exported by rc = snprintf(buf, len, "p%d", bp->pf.port_id);
* the switchdev ndo. This name is just to distinguish from the
* vf-rep ports.
*/
rc = snprintf(buf, len, "pf%d", bp->pf.port_id);
if (rc >= len) if (rc >= len)
return -EOPNOTSUPP; return -EOPNOTSUPP;
......
...@@ -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
...@@ -139,9 +141,11 @@ static int bnxt_vf_rep_get_phys_port_name(struct net_device *dev, char *buf, ...@@ -139,9 +141,11 @@ static int bnxt_vf_rep_get_phys_port_name(struct net_device *dev, char *buf,
size_t len) size_t len)
{ {
struct bnxt_vf_rep *vf_rep = netdev_priv(dev); struct bnxt_vf_rep *vf_rep = netdev_priv(dev);
struct pci_dev *pf_pdev = vf_rep->bp->pdev;
int rc; 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) if (rc >= len)
return -EOPNOTSUPP; return -EOPNOTSUPP;
return 0; return 0;
...@@ -302,7 +306,7 @@ static void bnxt_vf_rep_netdev_init(struct bnxt *bp, struct bnxt_vf_rep *vf_rep, ...@@ -302,7 +306,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->netdev_ops = &bnxt_vf_rep_netdev_ops;
dev->ethtool_ops = &bnxt_vf_rep_ethtool_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 /* Just inherit all the featues of the parent PF as the VF-R
* uses the RX/TX rings of the parent PF * uses the RX/TX rings of the parent PF
*/ */
...@@ -487,3 +491,5 @@ void bnxt_dl_unregister(struct bnxt *bp) ...@@ -487,3 +491,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