git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sched: update subport rate dynamically
[dpdk.git]
/
drivers
/
net
/
mlx5
/
mlx5_flow_meter.c
diff --git
a/drivers/net/mlx5/mlx5_flow_meter.c
b/drivers/net/mlx5/mlx5_flow_meter.c
index
86c334b
..
b36bc7b
100644
(file)
--- a/
drivers/net/mlx5/mlx5_flow_meter.c
+++ b/
drivers/net/mlx5/mlx5_flow_meter.c
@@
-10,6
+10,7
@@
#include <rte_mtr_driver.h>
#include <mlx5_devx_cmds.h>
#include <rte_mtr_driver.h>
#include <mlx5_devx_cmds.h>
+#include <mlx5_malloc.h>
#include "mlx5.h"
#include "mlx5_flow.h"
#include "mlx5.h"
#include "mlx5_flow.h"
@@
-356,8
+357,8
@@
mlx5_flow_meter_profile_add(struct rte_eth_dev *dev,
if (ret)
return ret;
/* Meter profile memory allocation. */
if (ret)
return ret;
/* Meter profile memory allocation. */
- fmp =
rte_calloc(__func__, 1
, sizeof(struct mlx5_flow_meter_profile),
- RTE_CACHE_LINE_SIZE);
+ fmp =
mlx5_malloc(MLX5_MEM_ZERO
, sizeof(struct mlx5_flow_meter_profile),
+ RTE_CACHE_LINE_SIZE
, SOCKET_ID_ANY
);
if (fmp == NULL)
return -rte_mtr_error_set(error, ENOMEM,
RTE_MTR_ERROR_TYPE_UNSPECIFIED,
if (fmp == NULL)
return -rte_mtr_error_set(error, ENOMEM,
RTE_MTR_ERROR_TYPE_UNSPECIFIED,
@@
-374,7
+375,7
@@
mlx5_flow_meter_profile_add(struct rte_eth_dev *dev,
TAILQ_INSERT_TAIL(fmps, fmp, next);
return 0;
error:
TAILQ_INSERT_TAIL(fmps, fmp, next);
return 0;
error:
-
rte
_free(fmp);
+
mlx5
_free(fmp);
return ret;
}
return ret;
}
@@
-417,7
+418,7
@@
mlx5_flow_meter_profile_delete(struct rte_eth_dev *dev,
NULL, "Meter profile is in use.");
/* Remove from list. */
TAILQ_REMOVE(&priv->flow_meter_profiles, fmp, next);
NULL, "Meter profile is in use.");
/* Remove from list. */
TAILQ_REMOVE(&priv->flow_meter_profiles, fmp, next);
-
rte
_free(fmp);
+
mlx5
_free(fmp);
return 0;
}
return 0;
}
@@
-1220,6
+1221,7
@@
error:
void
mlx5_flow_meter_detach(struct mlx5_flow_meter *fm)
{
void
mlx5_flow_meter_detach(struct mlx5_flow_meter *fm)
{
+#ifdef HAVE_MLX5_DR_CREATE_ACTION_FLOW_METER
MLX5_ASSERT(fm->ref_cnt);
if (--fm->ref_cnt)
return;
MLX5_ASSERT(fm->ref_cnt);
if (--fm->ref_cnt)
return;
@@
-1229,6
+1231,9
@@
mlx5_flow_meter_detach(struct mlx5_flow_meter *fm)
fm->ingress = 0;
fm->egress = 0;
fm->transfer = 0;
fm->ingress = 0;
fm->egress = 0;
fm->transfer = 0;
+#else
+ (void)fm;
+#endif
}
/**
}
/**
@@
-1286,7
+1291,7
@@
mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error)
MLX5_ASSERT(!fmp->ref_cnt);
/* Remove from list. */
TAILQ_REMOVE(&priv->flow_meter_profiles, fmp, next);
MLX5_ASSERT(!fmp->ref_cnt);
/* Remove from list. */
TAILQ_REMOVE(&priv->flow_meter_profiles, fmp, next);
-
rte
_free(fmp);
+
mlx5
_free(fmp);
}
return 0;
}
}
return 0;
}