Commit 2ef3c253 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

nfp: abm: expose all PF queues

Allocate the PF representor as multi-queue to allow setting
the configuration per-queue.
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0a8b7019
...@@ -255,14 +255,18 @@ nfp_abm_spawn_repr(struct nfp_app *app, struct nfp_abm_link *alink, ...@@ -255,14 +255,18 @@ nfp_abm_spawn_repr(struct nfp_app *app, struct nfp_abm_link *alink,
struct nfp_reprs *reprs; struct nfp_reprs *reprs;
struct nfp_repr *repr; struct nfp_repr *repr;
struct nfp_port *port; struct nfp_port *port;
unsigned int txqs;
int err; int err;
if (ptype == NFP_PORT_PHYS_PORT) if (ptype == NFP_PORT_PHYS_PORT) {
rtype = NFP_REPR_TYPE_PHYS_PORT; rtype = NFP_REPR_TYPE_PHYS_PORT;
else txqs = 1;
} else {
rtype = NFP_REPR_TYPE_PF; rtype = NFP_REPR_TYPE_PF;
txqs = alink->vnic->max_rx_rings;
}
netdev = nfp_repr_alloc(app); netdev = nfp_repr_alloc_mqs(app, txqs, 1);
if (!netdev) if (!netdev)
return -ENOMEM; return -ENOMEM;
repr = netdev_priv(netdev); repr = netdev_priv(netdev);
......
...@@ -360,12 +360,13 @@ void nfp_repr_free(struct net_device *netdev) ...@@ -360,12 +360,13 @@ void nfp_repr_free(struct net_device *netdev)
__nfp_repr_free(netdev_priv(netdev)); __nfp_repr_free(netdev_priv(netdev));
} }
struct net_device *nfp_repr_alloc(struct nfp_app *app) struct net_device *
nfp_repr_alloc_mqs(struct nfp_app *app, unsigned int txqs, unsigned int rxqs)
{ {
struct net_device *netdev; struct net_device *netdev;
struct nfp_repr *repr; struct nfp_repr *repr;
netdev = alloc_etherdev(sizeof(*repr)); netdev = alloc_etherdev_mqs(sizeof(*repr), txqs, rxqs);
if (!netdev) if (!netdev)
return NULL; return NULL;
......
...@@ -126,7 +126,8 @@ int nfp_repr_init(struct nfp_app *app, struct net_device *netdev, ...@@ -126,7 +126,8 @@ int nfp_repr_init(struct nfp_app *app, struct net_device *netdev,
u32 cmsg_port_id, struct nfp_port *port, u32 cmsg_port_id, struct nfp_port *port,
struct net_device *pf_netdev); struct net_device *pf_netdev);
void nfp_repr_free(struct net_device *netdev); void nfp_repr_free(struct net_device *netdev);
struct net_device *nfp_repr_alloc(struct nfp_app *app); struct net_device *
nfp_repr_alloc_mqs(struct nfp_app *app, unsigned int txqs, unsigned int rxqs);
void nfp_repr_clean_and_free(struct nfp_repr *repr); void nfp_repr_clean_and_free(struct nfp_repr *repr);
void nfp_reprs_clean_and_free(struct nfp_app *app, struct nfp_reprs *reprs); void nfp_reprs_clean_and_free(struct nfp_app *app, struct nfp_reprs *reprs);
void nfp_reprs_clean_and_free_by_type(struct nfp_app *app, void nfp_reprs_clean_and_free_by_type(struct nfp_app *app,
...@@ -134,4 +135,8 @@ void nfp_reprs_clean_and_free_by_type(struct nfp_app *app, ...@@ -134,4 +135,8 @@ void nfp_reprs_clean_and_free_by_type(struct nfp_app *app,
struct nfp_reprs *nfp_reprs_alloc(unsigned int num_reprs); struct nfp_reprs *nfp_reprs_alloc(unsigned int num_reprs);
int nfp_reprs_resync_phys_ports(struct nfp_app *app); int nfp_reprs_resync_phys_ports(struct nfp_app *app);
static inline struct net_device *nfp_repr_alloc(struct nfp_app *app)
{
return nfp_repr_alloc_mqs(app, 1, 1);
}
#endif /* NFP_NET_REPR_H */ #endif /* NFP_NET_REPR_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