Commit 1e04efde authored by shengjh's avatar shengjh 🇨🇳
Browse files

packet tag are removed before leaving the host. so homa tag must use...

packet tag are removed before leaving the host. so homa tag must use regiontag. but region tag cannot be changed.
parent ec72e1e6
......@@ -82,13 +82,11 @@ void WorkloadSynthesizer::registerTemplatedStats(const char* msgSizeRanges)
getEnvir()->addResultRecorders(this, latencySignal, latencyStatsName, statisticTemplate);
char queueDelaySignalName[50];
sprintf(queueDelaySignalName, "msg%sQueuingDelay",
sizeUpperBound.c_str());
sprintf(queueDelaySignalName, "msg%sQueuingDelay", sizeUpperBound.c_str());
simsignal_t queueDelaySignal = registerSignal(queueDelaySignalName);
msgQueueDelaySignalVec.push_back(queueDelaySignal);
char queueDelayStatsName[50];
sprintf(queueDelayStatsName, "msg%sQueuingDelay",
sizeUpperBound.c_str());
sprintf(queueDelayStatsName, "msg%sQueuingDelay", sizeUpperBound.c_str());
statisticTemplate = getProperties()->get("statisticTemplate",
"msgRangesQueuingDelay");
getEnvir()->addResultRecorders(this, queueDelaySignal, queueDelayStatsName,
......@@ -153,7 +151,7 @@ void WorkloadSynthesizer::initialize(int stage)
// Setup templated statistics ans signals
const char* msgSizeRanges = par("msgSizeRanges").stringValue();
//registerTemplatedStats(msgSizeRanges);
registerTemplatedStats(msgSizeRanges);
// Find host id for parent host module of this app
cModule* parentHost = this->getParentModule();
......
......@@ -42,7 +42,7 @@ HomaMsgSizeFilter::receiveSignal(cResultFilter *prev, simtime_t_cref t,
case PktType::GRANT: {
HomaTransport::InboundMessage* inbndMsg;
const HomaTransport::OutboundMessage* outMsg;
auto transport = homaPkt->getTag<Homa>()->getHomaTransport();
auto transport = homaChunk->getTag<Homa>()->getHomaTransport();
if ((inbndMsg = transport->rxScheduler.lookupInboundMesg(homaChunk))) {
msgSize = inbndMsg->getMsgSize();
} else {
......
......@@ -294,7 +294,8 @@ void HomaTransport::handleRecvdPkt(Packet* pkt)
{
Enter_Method_Silent();
//HomaPkt* rxPkt = check_and_cast<HomaPkt*>(pkt);
auto rxChunk = pkt->peekAtFront<HomaPkt>();
//auto rxChunk = pkt->peekAtFront<HomaPkt>();
auto& rxChunk = pkt->removeDataAt<HomaPkt>(b(0));
// check and set the localAddr
if (localAddr == L3Address()) {
localAddr = rxChunk->getDestAddr();
......@@ -305,9 +306,11 @@ void HomaTransport::handleRecvdPkt(Packet* pkt)
// update the owner transport for this packet
//rxPkt->ownerTransport = this;
//SJH: I don't know if this is ok.
pkt->findTagForUpdate<Homa>()->setHomaTransport(this) ;
//auto ht = rxChunk->getTag<Homa>();//->setHomaTransport(this);
rxChunk->removeTagIfPresent<Homa>(b(0),b(-1));
rxChunk->addTag<Homa>()->setHomaTransport(this);
emit(priorityStatsSignals[rxChunk->getPriority()], pkt);
// emit(priorityStatsSignals[rxChunk->getPriority()], pkt);
//uint32_t pktLenOnWire = HomaPkt::getBytesOnWire(rxPkt->getDataBytes(), (PktType)rxPkt->getPktType());
uint32_t pktLenOnWire = HomaPktHelper::getBytesOnWire( HomaPktHelper::getDataBytes(rxChunk), (PktType)rxChunk->getPktType() );
......@@ -322,7 +325,7 @@ void HomaTransport::handleRecvdPkt(Packet* pkt)
rxScheduler.rcvdBytesPerActivePeriod = 0;
}
rxScheduler.rcvdBytesPerActivePeriod += pktLenOnWire;
pkt->insertAtFront(rxChunk);
// handle data or grant packets appropriately
switch (rxChunk->getPktType()) {
case PktType::REQUEST:
......@@ -1009,10 +1012,10 @@ HomaTransport::OutboundMessage::prepareRequestAndUnsched()
}
unschedDataPart->setUnschedFields(unschedFields);
unschedDataPart->setChunkLength(b(B(HomaPktHelper::getHeaderSize(unschedDataPart) + HomaPktHelper::getDataBytes(unschedDataPart) )));
//unschedDataPart->addTagIfAbsent<Homa>()->setHomaTransport(sxController->transport);//SJH: is it right to add tag to chunk?
unschedDataPart->addTagIfAbsent<Homa>()->setHomaTransport(sxController->transport);//SJH: is it right to add tag to chunk?
packet->insertAtBack(unschedDataPart);
packet->addTagIfAbsent<UserPriorityReq>()->setUserPriority(unschedPrioVec[i]);
packet->addTagIfAbsent<Homa>()->setHomaTransport(sxController->transport);
//packet->addTagIfAbsent<Homa>()->setHomaTransport(sxController->transport);
txPkts.push(packet);
/**
EV << "Unsched pkt with msgId " << this->msgId << " ready for"
......@@ -1125,7 +1128,7 @@ HomaTransport::OutboundMessage::OutbndPktSorter::operator()(const Packet* pkt1,
{
auto chunk1 = pkt1->peekAtFront<HomaPkt>();
auto chunk2 = pkt2->peekAtFront<HomaPkt>();
HomaConfigDepot::SenderScheme txScheme = pkt1->getTag<Homa>()->getHomaTransport()->homaConfig->getSenderScheme();
HomaConfigDepot::SenderScheme txScheme = chunk1->getTag<Homa>()->getHomaTransport()->homaConfig->getSenderScheme();
switch (txScheme) {
case HomaConfigDepot::SenderScheme::OBSERVE_PKT_PRIOS:
case HomaConfigDepot::SenderScheme::SRBF:
......@@ -2746,7 +2749,7 @@ HomaTransport::InboundMessage::prepareGrant(uint16_t grantSize, uint16_t schedPr
// prepare a grant
//HomaPkt* grantPkt = new HomaPkt(rxScheduler->transport);
//grantPkt->addTag<Homa>()->setHomaTransport(rxScheduler->transport);
grantPkt->addTag<Homa>()->setHomaTransport(rxScheduler->transport);
grantPkt->setPktType(PktType::GRANT);
GrantFields grantFields;
grantFields.offset = offset;
......@@ -2760,7 +2763,7 @@ HomaTransport::InboundMessage::prepareGrant(uint16_t grantSize, uint16_t schedPr
grantPkt->setPriority(0);
packet->insertAtBack(grantPkt);
packet->addTagIfAbsent<UserPriorityReq>()->setUserPriority(0);
packet->addTagIfAbsent<Homa>()->setHomaTransport(rxScheduler->transport);
//packet->addTagIfAbsent<Homa>()->setHomaTransport(rxScheduler->transport);
int grantedBytesOnWire = HomaPktHelper::getBytesOnWire(grantSize, PktType::SCHED_DATA);
rxScheduler->transport->outstandingGrantBytes += grantedBytesOnWire;
......
......@@ -92,13 +92,13 @@ simple HomaTransport like ITransportScheme
@signal[stabilitySignal](type=unsigned long);
@signal[bytesLeftToSend](type=unsigned long);
@signal[bytesNeedGrant](type=unsigned long);
@signal[totalOutstandingBytes](type=long);
@signal[outstandingGrantBytes](type=long);
@signal[totalOutstandingBytes](type=unsigned long);
@signal[outstandingGrantBytes](type=unsigned long);
//@singal[homaPktPrio*Signal](type=HomaPkt);
@signal[rxActiveTime](type=simtime_t);
@signal[higherRxSelfWasteTime](type=simtime_t);
@signal[lowerRxSelfWasteTime](type=simtime_t);
@signal[rxActiveBytes](type=long);
@signal[rxActiveBytes](type=unsigned long);
@signal[oversubscriptionTime](type=simtime_t);
@signal[oversubscriptionBytes](type=unsigned long);
@signal[sxActiveTime](type=simtime_t);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment