summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/linux
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-09-30 08:13:44 -0700
committerDamjan Marion <dmarion@me.com>2020-10-01 15:51:37 +0000
commit459a0c4e3be1473c4c2b93811280c738e60d0524 (patch)
tree23899cc401a5986256ab769703740fd013511410 /src/vppinfra/linux
parent98d6f2971e2ed40b5c5bb96a9d6c769225a302c4 (diff)
svm: simplify memfd client segment mapping
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I33c6a5d1686cc32a6cde149083256d6cf0770fc5
Diffstat (limited to 'src/vppinfra/linux')
-rw-r--r--src/vppinfra/linux/mem.c58
1 files changed, 0 insertions, 58 deletions
diff --git a/src/vppinfra/linux/mem.c b/src/vppinfra/linux/mem.c
index c20de9c2103..1b3694b1af4 100644
--- a/src/vppinfra/linux/mem.c
+++ b/src/vppinfra/linux/mem.c
@@ -750,64 +750,6 @@ done:
return r;
}
-clib_error_t *
-clib_mem_vm_ext_map (clib_mem_vm_map_t * a)
-{
- long unsigned int old_mask[16] = { 0 };
- int mmap_flags = MAP_SHARED;
- clib_error_t *err = 0;
- int old_mpol = -1;
- void *addr;
- int rv;
-
- if (a->numa_node)
- {
- rv = get_mempolicy (&old_mpol, old_mask, sizeof (old_mask) * 8 + 1, 0,
- 0);
-
- if (rv == -1)
- {
- err = clib_error_return_unix (0, "get_mempolicy");
- goto done;
- }
- }
-
- if (a->requested_va)
- mmap_flags |= MAP_FIXED;
-
- if (old_mpol != -1)
- {
- long unsigned int mask[16] = { 0 };
- mask[0] = 1 << a->numa_node;
- rv = set_mempolicy (MPOL_BIND, mask, sizeof (mask) * 8 + 1);
- if (rv == -1)
- {
- err = clib_error_return_unix (0, "set_mempolicy");
- goto done;
- }
- }
-
- addr = (void *) mmap (uword_to_pointer (a->requested_va, void *), a->size,
- PROT_READ | PROT_WRITE, mmap_flags, a->fd, 0);
-
- if (addr == MAP_FAILED)
- return clib_error_return_unix (0, "mmap");
-
- /* re-apply old numa memory policy */
- if (old_mpol != -1 &&
- set_mempolicy (old_mpol, old_mask, sizeof (old_mask) * 8 + 1) == -1)
- {
- err = clib_error_return_unix (0, "set_mempolicy");
- goto done;
- }
-
- a->addr = addr;
- CLIB_MEM_UNPOISON (addr, a->size);
-
-done:
- return err;
-}
-
int
clib_mem_set_numa_affinity (u8 numa_node, int force)
{
light .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
# Copyright (c) 2020 Cisco Systems and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

add_vpp_plugin(adl
  SOURCES
  adl_api.c
  adl.c
  adl.h
  ip4_allowlist.c
  ip6_allowlist.c
  node.c

  MULTIARCH_SOURCES
  node.c

  API_FILES
  adl.api

  API_TEST_SOURCES
  adl_test.c
)