This is an automated email from the ASF dual-hosted git repository.
bcall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new c843446 Remove unused LibBulkIO
c843446 is described below
commit c8434464e6842215b981737db51fcaf8cf9a7766
Author: Bryan Call <[email protected]>
AuthorDate: Mon Jul 8 09:04:17 2019 -0700
Remove unused LibBulkIO
---
iocore/net/Makefile.am | 2 -
iocore/net/P_InkBulkIO.h | 166 ---------------------------------------------
iocore/net/P_LibBulkIO.h | 172 -----------------------------------------------
iocore/net/P_Net.h | 1 -
iocore/net/UnixUDPNet.cc | 2 -
5 files changed, 343 deletions(-)
diff --git a/iocore/net/Makefile.am b/iocore/net/Makefile.am
index c70c061..cbd512f 100644
--- a/iocore/net/Makefile.am
+++ b/iocore/net/Makefile.am
@@ -101,8 +101,6 @@ libinknet_a_SOURCES = \
P_SNIActionPerformer.h \
P_CompletionUtil.h \
P_Connection.h \
- P_InkBulkIO.h \
- P_LibBulkIO.h \
P_Net.h \
P_NetAccept.h \
P_NetVConnection.h \
diff --git a/iocore/net/P_InkBulkIO.h b/iocore/net/P_InkBulkIO.h
deleted file mode 100644
index 376bf44..0000000
--- a/iocore/net/P_InkBulkIO.h
+++ /dev/null
@@ -1,166 +0,0 @@
-/** @file
-
- A brief file description
-
- @section license License
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- */
-
-#pragma once
-
-#ifndef _KERNEL_
-#include <netinet/ip.h>
-#include <netinet/udp.h>
-#endif
-
-/*
- * We are following the convention of the ioctl cmd constants:
- * - the first 8 bits contain the character representing the device
- * - bits 8-15 refer to the ioctl
- */
-#define INKBIO_IOC ('x' << 8) /* 'x' to represent 'xx' */
-
-#define INKBIO_SEND (INKBIO_IOC | 1)
-#define INKBIO_BALLOC (INKBIO_IOC | 2)
-
-#define INKBIO_GET_STATS (INKBIO_IOC | 3)
-
-#define INKBIO_NOP (INKBIO_IOC | 7)
-#define INKBIO_MEMCPY (INKBIO_IOC | 8)
-
-/* For ioctl's that are destined to the STREAMS module for getting at q ptrs */
-#define INKBIO_REGISTER 1024
-
-#define INKBIO_MAX_BLOCKS 512
-
-/* 1500 bytes of data; 100 bytes for header */
-#define INKBIO_MTU_SIZE 1500
-#define INKBIO_PKT_SIZE_WITH_UDPHDR (INKBIO_MTU_SIZE - (sizeof(struct ip) +
sizeof(struct udphdr)))
-#define INKBIO_PKT_SIZE_WO_UDPHDR (INKBIO_MTU_SIZE - sizeof(struct ip))
-/* 100 for ethernet and anything else; 20 for ip---every pkt got an ip header
*/
-#define INKBIO_PKT_HEADER_SIZE (100 + sizeof(struct ip))
-#define INKBIO_PKT_FOOTER_SIZE 0
-#define INKBIO_BLOCK_SIZE (INKBIO_MTU_SIZE + INKBIO_PKT_HEADER_SIZE +
INKBIO_PKT_FOOTER_SIZE)
-
-#define INKBIO_MAX_UMEM_SIZE (INKBIO_BLOCK_SIZE * INKBIO_MAX_BLOCKS)
-/*
- * Describes a block of BulkIO memory
- */
-struct InkBulkIOBlock {
- void *ptr; /* where is it at */
- uint32_t id;
-};
-
-typedef struct {
- uint32_t nextFreeIdx;
- uint32_t numFreeBlocks;
- uint32_t freeBlockId[INKBIO_MAX_BLOCKS];
-} InkBulkIOFreeBlockInfo_t;
-
-/*
- * Describes a packet to be sent. Found after a request header in a request
block
- */
-struct InkBulkIOPkt {
- uint32_t blockID;
- /* Set only in the first fragment of a chain. Contains the size of the
packet */
- uint32_t pktsize;
- /* If the thing is a chain, the size of the fragment */
- uint16_t fragsize;
- uint16_t inChain : 1;
- uint16_t reserved : 15;
-};
-
-struct InkBulkIOAddrInfo {
- uint32_t ip;
- uint16_t port;
-};
-
-/*
- * Format of a sendto request:
- * - sender, receiver: ip/port info.
- * - list of InkBulkIOPkt terminated by a 0xffffffff
- */
-struct InkBulkIOSendtoRequest {
- /* declarations are done so that things in a req. block are usually 4-byte
aligned */
- uint16_t pktCount;
- struct InkBulkIOAddrInfo src;
- struct InkBulkIOAddrInfo dest;
-};
-
-/*
- * Format of a split request:
- * - sender: ip/port info. and count of # of receivers; also a boolean that
- * describes if there is a per-receiver specific header that has to be
- * tacked on before each data-payload.
- * - a list of InkBulkIOPkt that describes the payload being split;
- * - a list of tuples <receiver info, {optional InkBulkIOPkt}>
- * terminate list by 0xffffffff
- */
-
-struct InkBulkIOSplitRequest {
- /* declarations are done so that things in a req. block are usually 4-byte
- * aligned */
- uint16_t recvCount;
- struct InkBulkIOAddrInfo src;
- uint16_t perDestHeader; /* boolean */
-};
-
-/*
- * Describes a request header, part of a request block
- */
-struct InkBulkIORequest {
- uint16_t reqType; /* one of sendto or split */
- union {
- struct InkBulkIOSendtoRequest sendto;
- struct InkBulkIOSplitRequest split;
- } request;
-};
-
-#define INKBIO_SENDTO_REQUEST 0x0a
-#define INKBIO_SPLIT_REQUEST 0xf1
-
-/*
- * Purposely, under specify the size; we need to leave space for the
"terminating" packet.
- * Every block contains at least 1 request.
- */
-#define INKBIO_MAX_PKTS_PER_REQ_BLOCK
\
- ((INKBIO_PKT_SIZE_WO_UDPHDR - (sizeof(struct InkBulkIORequest) +
sizeof(struct InkBulkIOPkt))) / \
- std::max((sizeof(struct InkBulkIORequest)), (sizeof(struct InkBulkIOPkt))))
-
-/*
- * Requests are just block-ids---the block id points to the inkbio-block
- * that describes the request.
- */
-#define INKBIO_MAX_REQS_PER_REQ_BLOCK ((INKBIO_PKT_SIZE_WO_UDPHDR -
sizeof(uint32_t)) / sizeof(uint32_t))
-
-#define INKBIO_MAX_FRAGS_PER_REQ_BLOCK INKBIO_MAX_PKTS_PER_REQ_BLOCK
-
-/*
- * There is always 1 req. block and 1 pkt. block. Next,
- * Leave space for 1 "nullptr" block for the Address information.
- */
-
-#define INKBIO_MAX_SPLIT_WO_HDR_PER_SPLIT_BLOCK
\
- ((INKBIO_PKT_SIZE_WO_UDPHDR -
\
- (sizeof(struct InkBulkIORequest) + sizeof(struct InkBulkIOPkt) +
sizeof(struct InkBulkIOAddrInfo))) / \
- (sizeof(struct InkBulkIOAddrInfo)))
-
-#define INKBIO_MAX_SPLIT_WITH_HDR_PER_SPLIT_BLOCK
\
- ((INKBIO_PKT_SIZE_WO_UDPHDR -
\
- (sizeof(struct InkBulkIORequest) + sizeof(struct InkBulkIOPkt) +
sizeof(struct InkBulkIOAddrInfo))) / \
- (sizeof(struct InkBulkIOPkt) + sizeof(struct InkBulkIOAddrInfo)))
diff --git a/iocore/net/P_LibBulkIO.h b/iocore/net/P_LibBulkIO.h
deleted file mode 100644
index a52866c..0000000
--- a/iocore/net/P_LibBulkIO.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/** @file
-
- A brief file description
-
- @section license License
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- */
-
-#pragma once
-
-#if defined(solaris)
-#include <stdio.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <sys/mman.h>
-
-#include <netinet/in_systm.h>
-
-#include "P_InkBulkIO.h"
-
-struct InkBulkIOState {
- int biofd;
- void *sharedBuffer;
- int sharedBufferSize;
- InkBulkIOFreeBlockInfo_t freeList;
- struct InkBulkIOBlock *blockInfo;
- int numBlocks;
-};
-
-struct InkBulkIOSplit {
- char *header;
- int nbytes;
- struct InkBulkIOAddrInfo dest;
-};
-
-struct InkBulkIOAggregator {
- InkBulkIOAggregator()
- {
- metaReqCount = 0;
- metablockInfo.ptr = nullptr;
- metablockInfo.id = 0xffffffff;
- metablockReqPtr = nullptr;
-
- lastReqFragCount = 0;
- lastReq = nullptr;
- reqblockInfo.ptr = nullptr;
- reqblockInfo.id = 0xffffffff;
- reqblockPktPtr = nullptr;
- };
- struct InkBulkIOBlock metablockInfo;
- // Location where the next req. block id should be stuffed in the meta block.
- uint32_t *metablockReqPtr;
- uint32_t metaReqCount;
- struct InkBulkIOBlock reqblockInfo;
- // Location where the next packet should be stuffed in the req. block
- struct InkBulkIOPkt *reqblockPktPtr;
- // # of fragments in the last request.
- uint32_t lastReqFragCount;
- struct InkBulkIORequest *lastReq;
- void
- ResetLastRequestInfo()
- {
- lastReqFragCount = 0;
- lastReq = nullptr;
- reqblockInfo.ptr = nullptr;
- reqblockInfo.id = 0xffffffff;
- reqblockPktPtr = nullptr;
- };
- void
- ResetMetaBlockInfo()
- {
- metaReqCount = 0;
- metablockInfo.ptr = nullptr;
- metablockInfo.id = 0xffffffff;
- metablockReqPtr = nullptr;
- };
- bool
- AppendLastRequest()
- {
- if (metaReqCount >= INKBIO_MAX_REQS_PER_REQ_BLOCK)
- return false;
-
- memcpy(metablockReqPtr, &(reqblockInfo.id), sizeof(uint32_t));
- metablockReqPtr++;
- metaReqCount++;
- return true;
- };
- void
- TerminateMetaBlock()
- {
- *metablockReqPtr = 0xffffffff;
- };
- void
- TerminateLastRequest()
- {
- reqblockPktPtr->blockID = 0xffffffff;
- reqblockPktPtr->pktsize = 0xffff;
- reqblockPktPtr->inChain = 0;
- reqblockPktPtr->reserved = 0;
- };
- void
- InitMetaBlock()
- {
- metablockReqPtr = (uint32_t *)metablockInfo.ptr;
- metaReqCount = 0;
- };
- void
- InitSendtoReqBlock()
- {
- reqblockPktPtr = (struct InkBulkIOPkt
*)((caddr_t)reqblockInfo.ptr + sizeof(InkBulkIORequest));
- lastReq = (struct InkBulkIORequest
*)reqblockInfo.ptr;
- lastReq->reqType = INKBIO_SENDTO_REQUEST;
- lastReq->request.sendto.pktCount = 0;
- lastReqFragCount = 0;
- };
- void
- InitSplitReqBlock()
- {
- reqblockPktPtr = (struct InkBulkIOPkt
*)((caddr_t)reqblockInfo.ptr + sizeof(InkBulkIORequest));
- lastReq = (struct InkBulkIORequest
*)reqblockInfo.ptr;
- lastReq->reqType = INKBIO_SPLIT_REQUEST;
- lastReq->request.split.recvCount = 0;
- lastReq->request.split.perDestHeader = 0;
- lastReqFragCount = 0;
- };
-};
-
-/*
- * Initialize the Bulk IO system and create a state cookie
- */
-struct InkBulkIOState *BulkIOInit(int blockcount);
-void BulkIOClose(struct InkBulkIOState *bioCookie);
-
-int BulkIOBlkAlloc(struct InkBulkIOState *bioCookie, int blkCount, struct
InkBulkIOBlock *bioResult);
-
-int BulkIOAddPkt(struct InkBulkIOState *bioCookie, struct InkBulkIOAggregator
*bioAggregator, UDPPacketInternal *pkt,
- int sourcePort);
-
-int BulkIOSplitPkt(struct InkBulkIOState *bioCookie, struct
InkBulkIOAggregator *bioAggregator, UDPPacketInternal *pkt,
- int sourcePort);
-
-int BulkIOAppendToReqBlock(struct InkBulkIOState *bioCookie, struct
InkBulkIOAggregator *bioAggregator, Ptr<IOBufferBlock> pkt);
-
-void BulkIORequestComplete(struct InkBulkIOState *bioCookie, struct
InkBulkIOAggregator *bioAggregator);
-
-void BulkIOFlush(struct InkBulkIOState *bioCookie, struct InkBulkIOAggregator
*bioAggregator);
-
-void CopyFromIOBufferBlock(char *dest, Ptr<IOBufferBlock> pktChain, uint32_t
nbytes);
-#endif
diff --git a/iocore/net/P_Net.h b/iocore/net/P_Net.h
index d611903..602ea38 100644
--- a/iocore/net/P_Net.h
+++ b/iocore/net/P_Net.h
@@ -103,7 +103,6 @@ extern RecRawStatBlock *net_rsb;
#include "P_Socks.h"
#include "P_CompletionUtil.h"
#include "P_NetVCTest.h"
-#include "P_LibBulkIO.h"
#include "P_SSLNetVConnection.h"
#include "P_SSLNetProcessor.h"
diff --git a/iocore/net/UnixUDPNet.cc b/iocore/net/UnixUDPNet.cc
index eb7cf2b..13ac3af 100644
--- a/iocore/net/UnixUDPNet.cc
+++ b/iocore/net/UnixUDPNet.cc
@@ -48,8 +48,6 @@ int32_t g_udp_periodicCleanupSlots;
int32_t g_udp_periodicFreeCancelledPkts;
int32_t g_udp_numSendRetries;
-#include "P_LibBulkIO.h"
-
//
// Public functions
// See header for documentation