rx: Use _CLASS_RECV_CBUF in rxi_ReadPacketmaster
commit6ca01529de46337a23a5283ed9327ebefeab97dc
authorAndrew Deason <adeason@sinenomine.net>
Wed, 1 Mar 2023 22:27:18 +0000 (1 16:27 -0600)
committerAndrew Deason <adeason@sinenomine.net>
Thu, 30 May 2024 22:38:16 +0000 (30 18:38 -0400)
tree185abd31455bf109fa97df7b9c59760f3826ec85
parent3961e416f62aa13c34786927bd1e29a8bb8ff93e
rx: Use _CLASS_RECV_CBUF in rxi_ReadPacket

Currently, the userspace rxi_ReadPacket() allocates additional space
for the incoming packet (if needed) with the RX_PACKET_CLASS_SEND_CBUF
class. But we are allocating buffers for receiving packets, and so we
should be using the RX_PACKET_CLASS_RECV_CBUF class.

This is clearly a mistake from OpenAFS 1.0, since all other
packet-receiving code uses RX_PACKET_CLASS_RECV_CBUF, and all other
users of RX_PACKET_CLASS_SEND_CBUF are for sending packets.

This mistake doesn't actually matter for most cases, since the packet
class given to rxi_AllocDataBuf() is ignored for non-KERNEL, and this
code is userspace only. The only time this is actually used is for
UKERNEL. For UKERNEL, this mistake could possibly cause us to
prematurely restrict how much space we allocate here (since the
_SEND_CBUF packet quota is larger than the _RECV_CBUF quota), and
trigger a sendCbufPktAllocFailures event.

To fix this, use the proper RX_PACKET_CLASS_RECV_CBUF class instead,
to match other packet-receiving code paths.

Change-Id: I94077d595102560375d12c766d176b87d427b735
Reviewed-on: https://gerrit.openafs.org/15336
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
src/rx/rx_packet.c