summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOphir Munk <ophirmu@mellanox.com>2018-05-14 10:07:31 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2018-05-14 22:32:23 +0100
commitcbd737416c34c2f71227ac450db2c85a789dac30 (patch)
tree19c7bf5e0aa60833df81e110b2f0ad8f817f8680
parentc9ec2192ffa7e3f5926acc13c6fc6f553d1a59a6 (diff)
downloaddpdk-cbd737416c34c2f71227ac450db2c85a789dac30.zip
dpdk-cbd737416c34c2f71227ac450db2c85a789dac30.tar.gz
dpdk-cbd737416c34c2f71227ac450db2c85a789dac30.tar.xz
net/mlx4: avoid constant recreations in function
Function mlx4_conv_rss_types() contains constant arrays variables which are recreated with every call to the function. By changing the arrays definitions from "const" to "static const" these recreations can be saved. Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
-rw-r--r--drivers/net/mlx4/mlx4_flow.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
index 3f754b4..26a92e9 100644
--- a/drivers/net/mlx4/mlx4_flow.c
+++ b/drivers/net/mlx4/mlx4_flow.c
@@ -94,7 +94,7 @@ uint64_t
mlx4_conv_rss_types(struct priv *priv, uint64_t types)
{
enum { IPV4, IPV6, TCP, UDP, };
- const uint64_t in[] = {
+ static const uint64_t in[] = {
[IPV4] = (ETH_RSS_IPV4 |
ETH_RSS_FRAG_IPV4 |
ETH_RSS_NONFRAG_IPV4_TCP |
@@ -115,7 +115,7 @@ mlx4_conv_rss_types(struct priv *priv, uint64_t types)
ETH_RSS_NONFRAG_IPV6_UDP |
ETH_RSS_IPV6_UDP_EX),
};
- const uint64_t out[RTE_DIM(in)] = {
+ static const uint64_t out[RTE_DIM(in)] = {
[IPV4] = IBV_RX_HASH_SRC_IPV4 | IBV_RX_HASH_DST_IPV4,
[IPV6] = IBV_RX_HASH_SRC_IPV6 | IBV_RX_HASH_DST_IPV6,
[TCP] = IBV_RX_HASH_SRC_PORT_TCP | IBV_RX_HASH_DST_PORT_TCP,