usnistgov / ndn-dpdk

NDN-DPDK: High-Speed Named Data Networking Forwarder
https://www.nist.gov/publications/ndn-dpdk-ndn-forwarding-100-gbps-commodity-hardware
Other
131 stars 26 forks source link

Reached maximum number of Ethernet ports #51

Closed Pesa closed 2 years ago

Pesa commented 2 years ago

This is with v0.0.0-20211025195105-7686941f2f7f after opening and closing a few memif faces several times.

 {"level":"error","ts":1637199382.8344665,"logger":"DPDK","msg":"Reached maximum number of Ethernet ports"}
 {"level":"error","ts":1637199382.8345115,"logger":"DPDK","msg":"memif_create(): net_memifK00000000000007a3: Unable to allocate device struct."}
 {"level":"warn","ts":1637199383.2160726,"logger":"DPDK","msg":"rte_pmd_memif_probe(): Failed to register mp action callback: Operation not supported"}
 {"level":"error","ts":1637199383.2161741,"logger":"DPDK","msg":"Reached maximum number of Ethernet ports"}
 {"level":"error","ts":1637199383.2160673,"logger":"eal","msg":"rte_vdev_init error","name":"net_memifK00000000000007a4","args":"rsize=12,socket=/run/ndn/ndnc-memif-38621-1637199383212803193.sock,socket-abstract=no,mac=F2:6D:65:6D:69:66,id=0,role=server,bsize=9000","socket":"any","error":"1 Operation not permitted"}
 {"level":"error","ts":1637199383.2163484,"logger":"DPDK","msg":"memif_create(): net_memifK00000000000007a4: Unable to allocate device struct."}
 {"level":"error","ts":1637199383.5958595,"logger":"eal","msg":"rte_vdev_init error","name":"net_memifK00000000000007a5","args":"id=0,role=server,bsize=9000,rsize=12,socket=/run/ndn/ndnc-memif-38624-1637199383594050082.sock,socket-abstract=no,mac=F2:6D:65:6D:69:66","socket":"any","error":"1 Operation not permitted"}
 {"level":"warn","ts":1637199383.5959022,"logger":"DPDK","msg":"rte_pmd_memif_probe(): Failed to register mp action callback: Operation not supported"}
 {"level":"error","ts":1637199383.5959642,"logger":"DPDK","msg":"Reached maximum number of Ethernet ports"}
 {"level":"error","ts":1637199383.5960066,"logger":"DPDK","msg":"memif_create(): net_memifK00000000000007a5: Unable to allocate device struct."}
 {"level":"warn","ts":1637199383.9736578,"logger":"DPDK","msg":"rte_pmd_memif_probe(): Failed to register mp action callback: Operation not supported"}
 {"level":"error","ts":1637199383.9736602,"logger":"eal","msg":"rte_vdev_init error","name":"net_memifK00000000000007a6","args":"role=server,bsize=9000,rsize=12,socket=/run/ndn/ndnc-memif-38627-1637199383971739170.sock,socket-abstract=no,mac=F2:6D:65:6D:69:66,id=0","socket":"any","error":"1 Operation not permitted"}
 {"level":"error","ts":1637199383.9737294,"logger":"DPDK","msg":"Reached maximum number of Ethernet ports"}
 {"level":"error","ts":1637199383.9737716,"logger":"DPDK","msg":"memif_create(): net_memifK00000000000007a6: Unable to allocate device struct."}
yoursunny commented 2 years ago

DPDK supports up to RTE_MAX_ETHPORTS (default to 32) Ethernet ports. Each Ethernet adapter (PCI, XDP, or AF_PACKET) or memif interface is considered an Ethernet port.

Are the previous memif faces closed, or are they still open? You can see it from the entirety of NDN-DPDK service logs since it started.

yoursunny commented 2 years ago

I did some tests and I can confirm that NDN-DPDK can support 32 EthDevs simultaneously, and the EthDev ID can be reused if it's closed properly. The reported error was caused by not properly closing memif faces, which is a bug in application / agent.

Additionally, a method to increase RTE_MAX_ETHPORTS is provided in a8c7ef627293b86fc5b15cfb9481c1e01c36af41.

yoursunny commented 2 years ago

This issue wasn't so much about what the app is doing or not doing, but rather the fact that the error message "Reached maximum number of Ethernet ports" is entirely counterintuitive and does not point to the real problem, since nobody would expect that a memif face counts as "ethernet port" (it's not ethernet and it's not a port). So, can we make the error more useful?

No. Messages from "logger":"DPDK" are emitted by DPDK libraries and drivers. NDN-DPDK cannot control these messages.

There's a note in ndn-dpdk/docs/face.md:

DPDK supports up to 32 Ethernet devices by default. Both Ethernet ports and memif faces count toward this limit.

Pesa commented 2 years ago

This issue wasn't so much about what the app is doing or not doing, but rather the fact that the error message "Reached maximum number of Ethernet ports" is entirely counterintuitive and does not point to the real problem, since nobody would expect that a memif face counts as "ethernet port" (it's not ethernet and it's not a port). So, can we make the error more useful?

No. Messages from "logger":"DPDK" are emitted by DPDK libraries and drivers. NDN-DPDK cannot control these messages.

That's a lame excuse. NDN-DPDK can log a better warning/error before calling into DPDK.

There's a note in ndn-dpdk/docs/face.md:

DPDK supports up to 32 Ethernet devices by default. Both Ethernet ports and memif faces count toward this limit.

Yeah, maybe this will be enough... let's see how many more users get confused by this.

yoursunny commented 2 years ago

NDN-DPDK can log a better warning/error before calling into DPDK.

It is unreasonable to expect NDN-DPDK to check for every error condition in which DPDK would emit an error message that you don't understand.