Adjust OID_GEN_TRANSMIT_BUFFER_SPACE hint properly

When transmitting, the adapter can actually take TUN_QUEUE_MAX_NBLS
packets at a time.

When receiving, the adapter gets up to TUN_EXCH_MAX_PACKETS packets at
a time.

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2019-04-05 20:19:13 +02:00
parent 5b529a9c50
commit b5cf1f927b

View File

@ -1274,6 +1274,8 @@ static NDIS_STATUS TunOidQuery(_Inout_ TUN_CTX *ctx, _Inout_ NDIS_OID_REQUEST *O
return TunOidQueryWrite(OidRequest, TUN_EXCH_MAX_IP_PACKET_SIZE); return TunOidQueryWrite(OidRequest, TUN_EXCH_MAX_IP_PACKET_SIZE);
case OID_GEN_TRANSMIT_BUFFER_SPACE: case OID_GEN_TRANSMIT_BUFFER_SPACE:
return TunOidQueryWrite(OidRequest, TUN_EXCH_MAX_IP_PACKET_SIZE * TUN_QUEUE_MAX_NBLS);
case OID_GEN_RECEIVE_BUFFER_SPACE: case OID_GEN_RECEIVE_BUFFER_SPACE:
return TunOidQueryWrite(OidRequest, TUN_EXCH_MAX_IP_PACKET_SIZE * TUN_EXCH_MAX_PACKETS); return TunOidQueryWrite(OidRequest, TUN_EXCH_MAX_IP_PACKET_SIZE * TUN_EXCH_MAX_PACKETS);