summaryrefslogtreecommitdiffstats
path: root/src/plugins/memif
AgeCommit message (Expand)AuthorFilesLines
2021-05-01vlib: refactor trajectory trace debug featureBenoît Ganne1-2/+0
2021-04-18vppinfra: remove linux/syscall.hDamjan Marion1-1/+0
2021-04-16tests: cpus awarenessKlement Sekera1-1/+14
2021-04-08memif: Use log_debug for clib_file_add and clib_file_delSteven Luong1-15/+24
2021-03-26vlib: introduce vlib_get_main_by_index(), vlib_get_n_threads()Damjan Marion3-4/+4
2021-03-19interface: add capabilities flagsMohsin Kazmi1-1/+1
2021-03-04memif: Validate descriptors within process boudarySteven Luong1-20/+27
2021-01-22tests: add generalized tags for tests, use them for run-solo testsAndrew Yourtchenko1-4/+2
2021-01-21memif: adapt to new rxq frameworkMohammed Hawari3-61/+59
2021-01-20memif: fix vpp to go link up immediately on admin upEd Warnicke3-16/+23
2020-12-14misc: move to new pool_foreach macrosDamjan Marion3-8/+7
2020-12-04libmemif: clean up typosPaul Vinciguerra4-4/+4
2020-12-03tests: remove py2/py3 six compatability libraryPaul Vinciguerra2-3/+0
2020-11-09vlib: fix trace number accountingBenoît Ganne1-8/+11
2020-10-26memif: handle unexpected EPOLLOUT for RX queueSteven Luong1-0/+12
2020-10-12misc: clang-11 and gcc-10 supportDamjan Marion1-1/+1
2020-10-08interface: shorten vnet_hw_if_rx_modeDamjan Marion2-5/+5
2020-10-02memif: map shared memory with clib_mem_vm_map_shared(...)Damjan Marion1-10/+25
2020-08-27tests: "force solo" testcase supportAndrew Yourtchenko1-0/+4
2020-08-06memif: wrong interface counter is incrementedSteven Luong1-2/+2
2020-05-14memif: 14 bytes extra overhead issue fixed.Mrityunjay Kumar1-2/+2
2020-02-26api: improve api string safetyJakub Grajciar1-5/+2
2019-12-23tests: vpp_memif fix formatting error in exceptionPaul Vinciguerra1-5/+2
2019-12-07lacp: fix control_ping from pluginsOle Troan1-0/+4
2019-11-24vppapigen: clean up typos in c generated codePaul Vinciguerra1-1/+1
2019-11-15tests: Remove the unrequired VPP IP address/prefix class wrappersNeale Ranns2-7/+10
2019-10-23memif: memif buffer leaks during disconnecting zero copy interface.Changqian Wang1-0/+36
2019-10-18memif: add python3 support to testOle Troan2-20/+13
2019-10-14memif: Revert "memif buffer leaks during disconnect."Andrew Yourtchenko1-36/+2
2019-10-10memif: remove api boilerplateOle Troan6-252/+15
2019-10-03memif: memif buffer leaks during disconnect.Padma Ram1-2/+36
2019-09-24vlib: add flag to explicitelly mark nodes which can init per-node packet traceDamjan Marion1-0/+1
2019-09-16api: autogenerate api trace print/endianOle Troan1-0/+4
2019-09-11memif: fix zero-copy arg overwriteJakub Grajciar1-3/+0
2019-09-09memif: API cleanupJakub Grajciar6-67/+122
2019-09-04memif: always enable zero-copy when creating memif using APIJakub Grajciar1-0/+3
2019-08-22tests: move plugin tests to src/plugins/*/testDave Wallace2-0/+430
2019-07-25memif: Fix uninitialized variable as reported by coveritySteven Luong1-1/+2
2019-07-24memif: fix vector overflow when copying stringsBenoît Ganne1-19/+27
2019-07-23api: binary api cleanupDave Barach2-3/+6
2019-07-18vlib: convert frame_index into real pointersAndreas Schultz1-1/+1
2019-07-09vat: unload unused vat pluginsDave Barach1-2/+4
2019-05-03plugins: clean up plugin descriptionsDave Wallace1-1/+1
2019-03-07Remove local REPLY_MACRO so that socket transport works.Ole Troan1-36/+2
2019-02-22Add no-append flag to vlib_frame_tDamjan Marion1-0/+1
2019-02-14Add -fno-common compile optionBenoît Ganne1-1/+1
2019-02-09buffers: fix typoDamjan Marion1-2/+2
2019-02-06buffers: make buffer data size configurable from startup configDamjan Marion1-2/+2
2019-02-01memif: fix buffer prefetchDamjan Marion1-4/+5
2019-01-30buffers: add missing ref_count = 1 in driversDamjan Marion1-0/+1
="p">) self._test.registry.register(self, self.test.logger) def object_id(self): return 'lisp-locator-%s-%d' % (self._ls_name, self._sw_if_index) class LispEIDType(object): IP4 = 0 IP6 = 1 MAC = 2 class LispKeyIdType(object): NONE = 0 SHA1 = 1 SHA256 = 2 class LispEID(object): """ Lisp endpoint identifier """ def __init__(self, eid): self.eid = eid # find out whether EID is ip4 prefix, ip6 prefix or MAC if self.eid.find("/") != -1: if self.eid.find(":") == -1: self.eid_type = LispEIDType.IP4 self.data_length = 4 else: self.eid_type = LispEIDType.IP6 self.data_length = 16 self.eid_address = self.eid.split("/")[0] self.prefix_length = int(self.eid.split("/")[1]) elif self.eid.count(":") == 5: # MAC address self.eid_type = LispEIDType.MAC self.eid_address = self.eid self.prefix_length = 0 self.data_length = 6 else: raise Exception('Unsupported EID format {}!'.format(eid)) def __str__(self): if self.eid_type == LispEIDType.IP4: return socket.inet_pton(socket.AF_INET, self.eid_address) elif self.eid_type == LispEIDType.IP6: return socket.inet_pton(socket.AF_INET6, self.eid_address) elif self.eid_type == LispEIDType.MAC: return Exception('Unimplemented') raise Exception('Unknown EID type {}!'.format(self.eid_type)) class VppLispMapping(VppObject): """ Represents common features for remote and local LISP mapping in VPP """ def __init__(self, test, eid, vni=0, priority=1, weight=1): self._eid = LispEID(eid) self._test = test self._priority = priority self._weight = weight self._vni = vni @property def test(self): return self._test @property def vni(self): return self._vni @property def eid(self): return self._eid @property def priority(self): return self._priority @property def weight(self): return self._weight def get_lisp_mapping_dump_entry(self): return self.test.vapi.lisp_eid_table_dump( eid_set=1, prefix_length=self._eid.prefix_length, vni=self._vni, eid_type=self._eid.eid_type, eid=str(self._eid)) def query_vpp_config(self): mapping = self.get_lisp_mapping_dump_entry() return mapping def object_id(self): return 'lisp-mapping-[%s]-%s-%s-%s' % ( self.vni, self.eid, self.priority, self.weight) class VppLocalMapping(VppLispMapping): """ LISP Local mapping """ def __init__(self, test, eid, ls_name, vni=0, priority=1, weight=1, key_id=LispKeyIdType.NONE, key=''): super(VppLocalMapping, self).__init__(test, eid, vni, priority, weight) self._ls_name = ls_name self._key_id = key_id self._key = key @property def ls_name(self): return self._ls_name @property def key_id(self): return self._key_id @property def key(self): return self._key def add_vpp_config(self): self.test.vapi.lisp_local_mapping( ls_name=self._ls_name, eid_type=self._eid.eid_type, eid=str(self._eid), prefix_len=self._eid.prefix_length, vni=self._vni, key_id=self._key_id, key=self._key) self._test.registry.register(self, self.test.logger) def remove_vpp_config(self): self.test.vapi.lisp_local_mapping( ls_name=self._ls_name, eid_type=self._eid.eid_type, eid=str(self._eid), prefix_len=self._eid.prefix_length, vni=self._vni, is_add=0) def object_id(self): return 'lisp-eid-local-mapping-%s[%d]' % (self._eid, self._vni) class VppRemoteMapping(VppLispMapping): def __init__(self, test, eid, rlocs=None, vni=0, priority=1, weight=1): super(VppRemoteMapping, self).__init__(test, eid, vni, priority, weight) self._rlocs = rlocs @property def rlocs(self): return self._rlocs def add_vpp_config(self): self.test.vapi.lisp_remote_mapping( rlocs=self._rlocs, eid_type=self._eid.eid_type, eid=str(self._eid), eid_prefix_len=self._eid.prefix_length, vni=self._vni, rlocs_num=len(self._rlocs)) self._test.registry.register(self, self.test.logger) def remove_vpp_config(self): self.test.vapi.lisp_remote_mapping( eid_type=self._eid.eid_type, eid=str(self._eid), eid_prefix_len=self._eid.prefix_length, vni=self._vni, is_add=0, rlocs_num=0) def object_id(self): return 'lisp-eid-remote-mapping-%s[%d]' % (self._eid, self._vni) class VppLispAdjacency(VppObject): """ Represents LISP adjacency in VPP """ def __init__(self, test, leid, reid, vni=0): self._leid = LispEID(leid) self._reid = LispEID(reid) if self._leid.eid_type != self._reid.eid_type: raise Exception('remote and local EID are different types!') self._vni = vni self._test = test @property def test(self): return self._test @property def leid(self): return self._leid @property def reid(self): return self._reid @property def vni(self): return self._vni def add_vpp_config(self): self.test.vapi.lisp_adjacency( leid=str(self._leid), reid=str(self._reid), eid_type=self._leid.eid_type, leid_len=self._leid.prefix_length, reid_len=self._reid.prefix_length, vni=self._vni) self._test.registry.register(self, self.test.logger) @staticmethod def eid_equal(eid, eid_type, eid_data, prefix_len): if eid.eid_type != eid_type: return False if eid_type == LispEIDType.IP4 or eid_type == LispEIDType.IP6: if eid.prefix_length != prefix_len: return False if str(eid) != eid_data[0:eid.data_length]: return False return True def query_vpp_config(self): res = self.test.vapi.lisp_adjacencies_get(vni=self._vni) for adj in res.adjacencies: if self.eid_equal(self._leid, adj.eid_type, adj.leid, adj.leid_prefix_len) and \ self.eid_equal(self._reid, adj.eid_type, adj.reid, adj.reid_prefix_len): return True return False def remove_vpp_config(self): self.test.vapi.lisp_adjacency( leid=str(self._leid), reid=str(self._reid), eid_type=self._leid.eid_type, leid_len=self._leid.prefix_length, reid_len=self._reid.prefix_length, vni=self._vni, is_add=0) def object_id(self): return 'lisp-adjacency-%s-%s[%d]' % (self._leid, self._reid, self._vni)