Commit a9615b17 authored by Franck Messaoudi's avatar Franck Messaoudi

Update: cleaning code

parent 846cfacd
...@@ -12,21 +12,3 @@ BPFMap::~BPFMap() {} ...@@ -12,21 +12,3 @@ BPFMap::~BPFMap() {}
std::string BPFMap::getName() const { std::string BPFMap::getName() const {
return mName; return mName;
} }
//---------------------------------------------------------------------------------------------------------------
int BPFMap::resize(uint32_t max_entries) {
if (!mpBPFMap) return -EINVAL;
if (bpf_map__fd(mpBPFMap) >= 0) // Ensure map is not already loaded
return -EBUSY;
int ret = bpf_map__set_max_entries(mpBPFMap, max_entries);
if (ret != 0) {
Logger::upf_app().error("Failed to resize BPF map: %s", mName.c_str());
return ret;
}
Logger::upf_app().info(
"Resized BPF map: %s to %u entries", mName.c_str(), max_entries);
return 0;
}
\ No newline at end of file
...@@ -75,8 +75,6 @@ class BPFMap { ...@@ -75,8 +75,6 @@ class BPFMap {
template<class KeyType> template<class KeyType>
int remove(KeyType& key); int remove(KeyType& key);
// Resize function (newly added)
int resize(uint32_t max_entries);
//--------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------
/** /**
* @brief Get the Name of the BPF Map. * @brief Get the Name of the BPF Map.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment