Skip to content

Commit 9a944cc

Browse files
authored
Merge pull request #1371 from fwsGonzo/dev
Gonzo's fixes
2 parents 6397732 + 343b665 commit 9a944cc

4 files changed

Lines changed: 11 additions & 9 deletions

File tree

src/drivers/virtionet.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class VirtioNet : Virtio, public net::Link_layer<net::Ethernet> {
133133
{ return 1500; }
134134

135135
uint16_t packet_len() const noexcept {
136-
return Link::Protocol::header_size() + MTU();
136+
return sizeof(net::ethernet::Header) + MTU();
137137
}
138138

139139
net::Packet_ptr create_packet(int) override;

src/drivers/vmxnet3.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ inline void mmio_write32(uintptr_t location, uint32_t value)
106106

107107
vmxnet3::vmxnet3(hw::PCI_Device& d) :
108108
Link(Link_protocol{{this, &vmxnet3::transmit}, mac()},
109-
2048, 2048 /* half-page buffer size */),
109+
1024, 2048 /* half-page buffer size */),
110110
pcidev(d)
111111
{
112112
INFO("vmxnet3", "Driver initializing (rev=%#x)", d.rev_id());
@@ -330,8 +330,7 @@ void vmxnet3::refill(rxring_state& rxq)
330330
bool added_buffers = false;
331331
int old_value = rxq.producers;
332332

333-
while (rxq.prod_count < VMXNET3_RX_FILL
334-
&& bufstore().available() != 0)
333+
while (rxq.prod_count < VMXNET3_RX_FILL)
335334
{
336335
size_t i = rxq.producers % vmxnet3::NUM_RX_DESC;
337336
const uint32_t generation =

src/drivers/vmxnet3.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ class vmxnet3 : public net::Link_layer<net::Ethernet>
3030
using Link_protocol = Link::Protocol;
3131
static const int ETH_FRAME_LEN = 1514;
3232
static const int NUM_RX_QUEUES = 1;
33-
static const int NUM_TX_DESC = 128;
34-
static const int NUM_RX_DESC = 128;
33+
static const int NUM_TX_DESC = 256;
34+
static const int NUM_RX_DESC = 256;
3535

3636
static std::unique_ptr<Nic> new_instance(hw::PCI_Device& d)
3737
{ return std::make_unique<vmxnet3>(d); }
@@ -52,8 +52,8 @@ class vmxnet3 : public net::Link_layer<net::Ethernet>
5252
}
5353

5454
uint16_t packet_len() const noexcept
55-
{ // ethernet + vlan + fcs
56-
return ETH_FRAME_LEN + 4 + 4;
55+
{
56+
return sizeof(net::ethernet::Header) + MTU();
5757
}
5858

5959
net::downstream create_physical_downstream()

src/net/tcp/connection_states.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,11 @@ bool Connection::State::check_seq(Connection& tcp, const Packet& in)
123123
if( in.seq() == tcb.RCV.NXT ) {
124124
goto acceptable;
125125
}
126+
/// TODO: FIXME: reordering issues solved by this
127+
else goto unacceptable;
128+
126129
// #2
127-
else if( tcb.RCV.NXT <= in.seq() and in.seq() < tcb.RCV.NXT + tcb.RCV.WND ) {
130+
if( tcb.RCV.NXT <= in.seq() and in.seq() < tcb.RCV.NXT + tcb.RCV.WND ) {
128131
goto acceptable;
129132
}
130133
// #3 (INVALID)

0 commit comments

Comments
 (0)