Skip to content

Commit

Permalink
mvpp2: take care of xdp_features when reconfiguring queues
Browse files Browse the repository at this point in the history
XDP is supported only if enough queues are present, so when reconfiguring
the queues set xdp_features accordingly.

Fixes: 66c0e13 ("drivers: net: turn on XDP features")
Suggested-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Matteo Croce <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
teknoraver authored and kuba-moo committed Mar 11, 2023
1 parent 4d5ab0a commit 481e96f
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4996,6 +4996,14 @@ static int mvpp2_bm_switch_buffers(struct mvpp2 *priv, bool percpu)

for (i = 0; i < priv->port_count; i++) {
port = priv->port_list[i];
if (percpu && port->ntxqs >= num_possible_cpus() * 2)
xdp_set_features_flag(port->dev,
NETDEV_XDP_ACT_BASIC |
NETDEV_XDP_ACT_REDIRECT |
NETDEV_XDP_ACT_NDO_XMIT);
else
xdp_clear_features_flag(port->dev);

mvpp2_swf_bm_pool_init(port);
if (status[i])
mvpp2_open(port->dev);
Expand Down Expand Up @@ -6863,13 +6871,14 @@ static int mvpp2_port_probe(struct platform_device *pdev,

if (!port->priv->percpu_pools)
mvpp2_set_hw_csum(port, port->pool_long->id);
else if (port->ntxqs >= num_possible_cpus() * 2)
dev->xdp_features = NETDEV_XDP_ACT_BASIC |
NETDEV_XDP_ACT_REDIRECT |
NETDEV_XDP_ACT_NDO_XMIT;

dev->vlan_features |= features;
netif_set_tso_max_segs(dev, MVPP2_MAX_TSO_SEGS);

dev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
NETDEV_XDP_ACT_NDO_XMIT;

dev->priv_flags |= IFF_UNICAST_FLT;

/* MTU range: 68 - 9704 */
Expand Down

0 comments on commit 481e96f

Please sign in to comment.