net: revert whatever is left from "virtio: batch transmitted packets" commit.

Revert remains of commit 503f1bf4 since there is no need to batch
packets inside virtio any more. Upper layer does it already.
This commit is contained in:
Gleb Natapov
2015-01-05 11:18:32 +02:00
parent 72324f02e2
commit aae617f9f5

View File

@@ -277,7 +277,6 @@ private:
semaphore _available_descriptors = { 0 };
int _free_head = -1;
int _free_last = -1;
std::vector<uint16_t> _batch;
reactor::poller _poller;
public:
@@ -304,8 +303,6 @@ public:
template <typename Iterator>
void post(Iterator begin, Iterator end);
void flush_batch();
semaphore& available_descriptors() { return _available_descriptors; }
private:
bool notifications_disabled() {
@@ -373,7 +370,6 @@ vring<BufferChain, Completion>::vring(ring_config conf, Completion complete)
, _avail_event(reinterpret_cast<std::atomic<uint16_t>*>(&_used._shared->_used_elements[conf.size]))
, _used_event(reinterpret_cast<std::atomic<uint16_t>*>(&_avail._shared->_ring[conf.size]))
, _poller([this] {
flush_batch();
do_complete();
return true;
})
@@ -391,19 +387,6 @@ void vring<BufferChain, Completion>::setup() {
_available_descriptors.signal(_config.size);
}
template <typename BufferChain, typename Completion>
void vring<BufferChain, Completion>::flush_batch() {
if (_batch.empty()) {
return;
}
for (auto desc_head : _batch) {
_avail._shared->_ring[masked(_avail._head++)] = desc_head;
}
_batch.clear();
_avail._shared->_idx.store(_avail._head, std::memory_order_release);
kick();
}
// Iterator: points at a buffer_chain
template <typename BufferChain, typename Completion>
template <typename Iterator>
@@ -426,12 +409,11 @@ void vring<BufferChain, Completion>::post(Iterator begin, Iterator end) {
}
auto desc_head = pseudo_head._next;
_buffer_chains[desc_head] = std::move(bc);
_batch.push_back(desc_head);
_avail._shared->_ring[masked(_avail._head++)] = desc_head;
_avail._avail_added_since_kick++;
}
if (_batch.size() >= 16) {
flush_batch();
}
_avail._shared->_idx.store(_avail._head, std::memory_order_release);
kick();
}
template <typename BufferChain, typename Completion>