Skip to content

Commit

Permalink
refs #17: Apply the API changes to the offloading path as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
achimnol committed Aug 9, 2015
1 parent c4135d1 commit bf6c9b2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/datablock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,9 @@ void DataBlock::postprocess(OffloadableElement *elem, int input_port, PacketBatc
(char*) host_out_ptr + offset,
elemsz);
Packet *pkt = Packet::from_base(batch->packets[p]);
batch->results[p] = elem->postproc(input_port, nullptr, pkt);
pkt->output = -1;
elem->postproc(input_port, nullptr, pkt);
batch->results[p] = pkt->output;
batch->excluded[p] = (batch->results[p] == DROP);
}
batch->has_results = true;
Expand All @@ -290,12 +292,12 @@ void DataBlock::postprocess(OffloadableElement *elem, int input_port, PacketBatc
/* Run postporcessing only. */
for (unsigned p = 0; p < batch->count; p++) {
if (batch->excluded[p]) continue;
unsigned elemsz = t->aligned_item_sizes.size;
unsigned offset = elemsz * p;
uintptr_t elemsz = t->aligned_item_sizes.size;
uintptr_t offset = elemsz * p;
Packet *pkt = Packet::from_base(batch->packets[p]);
batch->results[p] = elem->postproc(input_port,
(char*) host_out_ptr + offset,
pkt);
pkt->output = -1;
elem->postproc(input_port, (char*) host_out_ptr + offset, pkt);
batch->results[p] = pkt->output;
batch->excluded[p] = (batch->results[p] == DROP);
}
batch->has_results = true;
Expand Down
1 change: 1 addition & 0 deletions lib/packet.hh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ private:
int output;

friend class Element;
friend class DataBlock;

public:
struct annotation_set anno;
Expand Down

0 comments on commit bf6c9b2

Please sign in to comment.