maskit commented on code in PR #9765:
URL: https://github.com/apache/trafficserver/pull/9765#discussion_r1213380891


##########
iocore/net/UnixUDPNet.cc:
##########
@@ -134,9 +134,40 @@ UDPPacket::free()
   if (p.conn)
     p.conn->Release();
   p.conn = nullptr;
+
+  if (this->_payload) {
+    _payload.release();
+  }
   udpPacketAllocator.free(this);
 }
 
+uint8_t *
+UDPPacket::get_entire_chain_buffer(size_t *buf_len)
+{
+  if (this->_payload == nullptr) {
+    IOBufferBlock *block = this->getIOBlockChain();
+
+    // No need to allocate, we will use the first slice. With the current 
slice size
+    // 2048 more likely we will using this block most of the time.
+    if (block && block->next.get() == nullptr) {
+      *buf_len = this->getPktLength();
+      return reinterpret_cast<uint8_t *>(block->buf());
+    }
+
+    // Store it. Should we try to avoid allocating here?

Review Comment:
   > Should we try to avoid allocating here?
   
   Yes, it's very unfortunate to alloc another buffer and copy data. But as we 
talked offline, let's fix the bug for now and improve it with a GRO friendly 
design.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to