/* Pad the iSCSI AHS or data segment to an integer number of 4 byte words. */
EFI_STATUS IScsiPadSegment(IN OUT NET_BUF *Pdu, IN UINT32 Len)
/* Pad the iSCSI AHS or data segment to an integer number of 4 byte words. */
EFI_STATUS IScsiPadSegment(IN OUT NET_BUF *Pdu, IN UINT32 Len)
{
  UINT32  PadLen;
  UINT8   *Data;
  PadLen = ISCSI_GET_PAD_LEN (Len);
  if (PadLen != 0) {
    Data = NetbufAllocSpace (Pdu, PadLen, NET_BUF_TAIL);
    if (Data == NULL) {
      return EFI_OUT_OF_RESOURCES;
    }
    ZeroMem (Data, PadLen);
  }
  return EFI_SUCCESS;
}