[libc-commits] [PATCH] D150327: [libc] Fix RPC interface when sending and recieving aribtrary packets

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed May 10 16:19:24 PDT 2023


jhuber6 created this revision.
jhuber6 added reviewers: JonChesterfield, jdoerfert, tianshilei1992, sivachandra.
Herald added subscribers: libc-commits, ecnelises, tschuett.
Herald added projects: libc-project, All.
jhuber6 requested review of this revision.

The interface exported by the RPC library allows users to simply send
and recieve fixed sized packets without worrying about the data motion
underneath. However, this was broken in the current implementation. We
can think of the send and recieve implementations in terms of waiting
for ownership of the buffer, using the buffer, and posting ownership to
the other side. Our implementation of `recv` was incorrect in the
following scenarios.

recv -> send // we still own the buffer and should give away ownership
recv -> close // The other side is not waiting for data, this will

  result in multiple openings of the same port

This patch attempts to fix this with an admittedly hacky fix where we
track if the previous implementation was a recv and post conditionally.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D150327

Files:
  libc/src/__support/RPC/rpc.h
  libc/test/integration/startup/gpu/CMakeLists.txt
  libc/test/integration/startup/gpu/rpc_interface_test.cpp
  libc/utils/gpu/loader/Server.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150327.521147.patch
Type: text/x-patch
Size: 6418 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230510/cc579320/attachment-0001.bin>


More information about the libc-commits mailing list