diff options
-rw-r--r-- | extras/libmemif/adapter.go | 8 | ||||
-rw-r--r-- | extras/libmemif/error.go | 71 |
2 files changed, 42 insertions, 37 deletions
diff --git a/extras/libmemif/adapter.go b/extras/libmemif/adapter.go index 8ade6bc..d238df6 100644 --- a/extras/libmemif/adapter.go +++ b/extras/libmemif/adapter.go @@ -75,6 +75,8 @@ typedef struct uint8_t role; uint8_t mode; char *socket_filename; + uint8_t regions_num; + memif_region_details_t *regions; uint8_t rx_queues_num; uint8_t tx_queues_num; memif_queue_details_t *rx_queues; @@ -167,6 +169,8 @@ govpp_memif_get_details (memif_conn_handle_t conn, govpp_memif_details_t *govpp_ govpp_md->role = md.role; govpp_md->mode = md.mode; govpp_md->socket_filename = (char *)md.socket_filename; + govpp_md->regions_num = md.regions_num; + govpp_md->regions = md.regions; govpp_md->rx_queues_num = md.rx_queues_num; govpp_md->tx_queues_num = md.tx_queues_num; govpp_md->rx_queues = md.rx_queues; @@ -415,8 +419,8 @@ type MemifQueueDetails struct { // CPacketBuffers stores an array of memif buffers for use with TxBurst or RxBurst. type CPacketBuffers struct { - buffers *C.memif_buffer_t - count int + buffers *C.memif_buffer_t + count int rxChainBuf []RawPacketData } diff --git a/extras/libmemif/error.go b/extras/libmemif/error.go index 3a2145d..58da700 100644 --- a/extras/libmemif/error.go +++ b/extras/libmemif/error.go @@ -28,44 +28,45 @@ import "C" // Error handling code should compare returned error by value against these variables. var ( ErrSyscall = newMemifError(1) - ErrAccess = newMemifError(2) - ErrNoFile = newMemifError(3) - ErrFileLimit = newMemifError(4) - ErrProcFileLimit = newMemifError(5) - ErrAlready = newMemifError(6) - ErrAgain = newMemifError(7) - ErrBadFd = newMemifError(8) - ErrNoMem = newMemifError(9) - ErrInvalArgs = newMemifError(10) - ErrNoConn = newMemifError(11) - ErrConn = newMemifError(12) - ErrClbFDUpdate = newMemifError(13) - ErrFileNotSock = newMemifError(14) - ErrNoShmFD = newMemifError(15) - ErrCookie = newMemifError(16) + ErrConnRefused = newMemifError(2) + ErrAccess = newMemifError(3) + ErrNoFile = newMemifError(4) + ErrFileLimit = newMemifError(5) + ErrProcFileLimit = newMemifError(6) + ErrAlready = newMemifError(7) + ErrAgain = newMemifError(8) + ErrBadFd = newMemifError(9) + ErrNoMem = newMemifError(10) + ErrInvalArgs = newMemifError(11) + ErrNoConn = newMemifError(12) + ErrConn = newMemifError(13) + ErrClbFDUpdate = newMemifError(14) + ErrFileNotSock = newMemifError(15) + ErrNoShmFD = newMemifError(16) + ErrCookie = newMemifError(17) // Not thrown, instead properly handled inside the golang adapter: - ErrNoBufRing = newMemifError(17) - ErrNoBuf = newMemifError(18) - ErrNoBufDetails = newMemifError(19) + ErrNoBufRing = newMemifError(18) + ErrNoBuf = newMemifError(19) + ErrNoBufDetails = newMemifError(20) - ErrIntWrite = newMemifError(20) - ErrMalformedMsg = newMemifError(21) - ErrQueueID = newMemifError(22) - ErrProto = newMemifError(23) - ErrIfID = newMemifError(24) - ErrAcceptSlave = newMemifError(25) - ErrAlreadyConn = newMemifError(26) - ErrMode = newMemifError(27) - ErrSecret = newMemifError(28) - ErrNoSecret = newMemifError(29) - ErrMaxRegion = newMemifError(30) - ErrMaxRing = newMemifError(31) - ErrNotIntFD = newMemifError(32) - ErrDisconnect = newMemifError(33) - ErrDisconnected = newMemifError(34) - ErrUnknownMsg = newMemifError(35) - ErrPollCanceled = newMemifError(36) + ErrIntWrite = newMemifError(21) + ErrMalformedMsg = newMemifError(22) + ErrQueueID = newMemifError(23) + ErrProto = newMemifError(24) + ErrIfID = newMemifError(25) + ErrAcceptSlave = newMemifError(26) + ErrAlreadyConn = newMemifError(27) + ErrMode = newMemifError(28) + ErrSecret = newMemifError(29) + ErrNoSecret = newMemifError(30) + ErrMaxRegion = newMemifError(31) + ErrMaxRing = newMemifError(32) + ErrNotIntFD = newMemifError(33) + ErrDisconnect = newMemifError(34) + ErrDisconnected = newMemifError(35) + ErrUnknownMsg = newMemifError(36) + ErrPollCanceled = newMemifError(37) // Errors added by the adapter: ErrNotInit = newMemifError(100, "libmemif is not initialized") |