| .. | .. |
|---|
| 1334 | 1334 | uplink_priv = &rpriv->uplink_priv; |
|---|
| 1335 | 1335 | |
|---|
| 1336 | 1336 | mutex_lock(&uplink_priv->unready_flows_lock); |
|---|
| 1337 | | - unready_flow_del(flow); |
|---|
| 1337 | + if (flow_flag_test(flow, NOT_READY)) |
|---|
| 1338 | + unready_flow_del(flow); |
|---|
| 1338 | 1339 | mutex_unlock(&uplink_priv->unready_flows_lock); |
|---|
| 1339 | 1340 | } |
|---|
| 1340 | 1341 | |
|---|
| .. | .. |
|---|
| 1344 | 1345 | struct netlink_ext_ack *extack) |
|---|
| 1345 | 1346 | { |
|---|
| 1346 | 1347 | struct mlx5_eswitch *esw = priv->mdev->priv.eswitch; |
|---|
| 1347 | | - struct net_device *out_dev, *encap_dev = NULL; |
|---|
| 1348 | 1348 | struct mlx5e_tc_flow_parse_attr *parse_attr; |
|---|
| 1349 | 1349 | struct mlx5_flow_attr *attr = flow->attr; |
|---|
| 1350 | + struct net_device *encap_dev = NULL; |
|---|
| 1350 | 1351 | struct mlx5_esw_flow_attr *esw_attr; |
|---|
| 1351 | 1352 | struct mlx5_fc *counter = NULL; |
|---|
| 1352 | 1353 | struct mlx5e_rep_priv *rpriv; |
|---|
| .. | .. |
|---|
| 1391 | 1392 | esw_attr = attr->esw_attr; |
|---|
| 1392 | 1393 | |
|---|
| 1393 | 1394 | for (out_index = 0; out_index < MLX5_MAX_FLOW_FWD_VPORTS; out_index++) { |
|---|
| 1395 | + struct net_device *out_dev; |
|---|
| 1394 | 1396 | int mirred_ifindex; |
|---|
| 1395 | 1397 | |
|---|
| 1396 | 1398 | if (!(esw_attr->dests[out_index].flags & MLX5_ESW_DEST_ENCAP)) |
|---|
| 1397 | 1399 | continue; |
|---|
| 1398 | 1400 | |
|---|
| 1399 | 1401 | mirred_ifindex = parse_attr->mirred_ifindex[out_index]; |
|---|
| 1400 | | - out_dev = __dev_get_by_index(dev_net(priv->netdev), |
|---|
| 1401 | | - mirred_ifindex); |
|---|
| 1402 | + out_dev = dev_get_by_index(dev_net(priv->netdev), mirred_ifindex); |
|---|
| 1403 | + if (!out_dev) { |
|---|
| 1404 | + NL_SET_ERR_MSG_MOD(extack, "Requested mirred device not found"); |
|---|
| 1405 | + err = -ENODEV; |
|---|
| 1406 | + return err; |
|---|
| 1407 | + } |
|---|
| 1402 | 1408 | err = mlx5e_attach_encap(priv, flow, out_dev, out_index, |
|---|
| 1403 | 1409 | extack, &encap_dev, &encap_valid); |
|---|
| 1410 | + dev_put(out_dev); |
|---|
| 1404 | 1411 | if (err) |
|---|
| 1405 | 1412 | return err; |
|---|
| 1406 | 1413 | |
|---|
| .. | .. |
|---|
| 1469 | 1476 | |
|---|
| 1470 | 1477 | mlx5e_put_flow_tunnel_id(flow); |
|---|
| 1471 | 1478 | |
|---|
| 1472 | | - if (flow_flag_test(flow, NOT_READY)) |
|---|
| 1473 | | - remove_unready_flow(flow); |
|---|
| 1479 | + remove_unready_flow(flow); |
|---|
| 1474 | 1480 | |
|---|
| 1475 | 1481 | if (mlx5e_is_offloaded_flow(flow)) { |
|---|
| 1476 | 1482 | if (flow_flag_test(flow, SLOW)) |
|---|