| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
OK dlg@, bluhm@
No Opinion mpi@
Not against it claudio@
|
|
|
|
| |
ok dlg@ tobhe@
|
|
|
|
|
|
| |
so we pass INTRMAP_POWEROF2 to intrmap_create and things are better.
reported by and fixed by mark patruck. thanks :)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the counters happen to be a series of uint64_t values in memory,
so we treat them as arrays that get mapped to a series of kstat_kv
structs that are set up as 64 bit counters with either packet or
byte counters as appropriate. this helps keep the code size down.
while we export the counters as separate kstats per rx and tx ring,
you request an update from the hypervisor at the controller level.
this code ratelimits these requests to 1 per second per interface
to try and debounce this a bit so each kstat read doesnt cause a
vmexit.
here's an example of the stats. note that we get to see how many
packets that rx ring moderation drops for the first time. see the
"no buffers" stat.
vmx0:0:rxq:5
packets: 2372483 packets
bytes: 3591909057 bytes
qdrops: 0 packets
errors: 0 packets
qlen: 0 packets
...
vmx0:0:txq:5
packets: 1316856 packets
bytes: 86961577 bytes
qdrops: 0 packets
errors: 0 packets
qlen: 1 packets
maxqlen: 512 packets
oactive: false
...
vmx0:0:vmx-rxstats:5
LRO packets: 0 packets
LRO bytes: 0 bytes
ucast packets: 2372483 packets
ucast bytes: 3591909053 bytes
mcast packets: 0 packets
mcast bytes: 0 bytes
bcast packets: 0 packets
bcast bytes: 0 bytes
no buffers: 696 packets
errors: 0 packets
...
vmx0:0:vmx-txstats:5
TSO packets: 0 packets
TSO bytes: 0 bytes
ucast packets: 1316839 packets
ucast bytes: 86960455 bytes
mcast packets: 0 packets
mcast bytes: 0 bytes
bcast packets: 0 packets
bcast bytes: 0 bytes
errors: 0 packets
discards: 0 packets
|
|
|
|
| |
systat mbuf looks a bit better now.
|
|
|
|
|
|
| |
sigh, i don't know how i forgot this.
yes jmatthew@
|
|
|
|
| |
another sniped commit from jmatthew@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
im doing this with vmx(4) because it only exists on two archs (well,
one and a half archs really) so any impact is localised. most other
drivers i'm working on are enabled on 3 or 4 archs, and we're still
working on the interrupt code on those archs.
in the meantime vmx(4) can be used as a reference driver on how to
implement multiq. it shows the use of rss, toeplitz, intrmap, and
interrupts on multiple cpus. it's also a relatively simple device,
which makes it easier to understand the above features.
note that vmx(4) seems to advertise 25 msi-x vectors. it appears
that the intention is that 16 of these vectors are supposed to be
used for rx, 8 for tx, and 1 for events (eg, link up and down).
we're keeping things simple for now and using a maximum of 8 vectors
for both tx and rx, and one for events.
this is mostly based on work that jmatthew@ did, but it's simplified
now cos intrmap makes things easier.
|
|
|
|
|
|
|
|
| |
"if needed" basically means if more than 1 queue is set up, then
set up rss.
again, i think jmatthew@ wrote most of this, but im sniping it cos
of the stoeplitz integration.
|
|
|
|
|
|
|
|
| |
for multi-queue operation. Vector 0 is used for events, and the
subsequent vectors are mapped to a tx and rx queue each.
tested on esxi 6.7 and qemu by me, and on vmware fusion by dlg@
ok dlg@
|
|
|
|
|
| |
it's a bit shorter, and a bit more correct wrt use of bus_dma. still
a bit to go though.
|
|
|
|
|
|
|
| |
if gen is toggled per packet, then it needs to be toggled before
each packet, not before the loop. also, if 0 out the right offload.
brad pointed out the if 0 bit.
|
| |
|
|
|
|
|
| |
to make mpsafetey a bit easier to figure out i disabled checksum
and vlan offload. i'll put them back in soon though.
|
|
|
|
|
|
|
|
|
|
|
|
| |
vmx "hardware" seems to be able to use rx descriptors as soon as
theyre filled in, which means filling the ring from a timeout can
run conccurently with an isr that's pulling stuff off the ring.
this is mostly a problem with the rxr accounting, so we serialise
updates to the alive counter by running rxfill in a mutex.
most of the investigation was done by claudio@ and mathieu@
an earlier version of this diff was tested hard by mathieu@ and was
ok@ claudio
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
vmx has an interesting feature where config in the hypervisor can
say what type of interrupts the guest should configure for the nic,
with the options of auto, msix, msi, and intx. depending on this,
the driver should try to map the type specified and fall back from
there.
also interesting is that my guest gets "auto" from the hypervisor,
which i fall through to msi with, but an msi interrupt cannot be
mapped. i cannot see any msi interrupts in this guest actually.
there must be something funky at the platform level that we don't
like, and that prevents msi from being mapped.
if msi does get mapped, we should be able to avoid a register read
on every interrupt. that should probably provide a noticable
performance improvement if we can ever take advantage of it.
|
| |
|
|
|
|
|
|
| |
there have been several reports that vmx gets stuck sometimes and
only comes good after it's taken down and up again. hopefully this
fixes that issue.
|
| |
|
|
|
|
|
|
|
| |
this means packets are consistently counted in one place, unlike the
many and various ways that drivers thought they should do it.
ok mpi@ deraadt@
|
| |
|
|
|
|
|
|
|
|
| |
the generation bit to pass the tx descriptor and mbuf to the "hardware".
This way bpf is not called if vmxnet3_load_mbuf dropped the mbuf.
Tested by me
OK mikeb@
|
|
|
|
|
|
|
|
|
|
|
|
| |
the hardware. This could have resulted in a page fault when the mbuf
has already been freed by the TX interrupt handler on another CPU.
This has the slight drawback that bpf can be called before the packet
is eventually dropped by vmxnet3_load_mbuf() - but I'm getting this
simple and verified fix in before doing further optimizations on the
start handler.
As discussed with mikeb@ jsg@ dlg@
|
|
|
|
|
|
|
|
|
| |
Keep the modified chain pointer and pass it back to the calling code
so that it will get properly accounted for. Change it to m_pullup
since m_pulldown with a zero offset is just as good.
Tested by yasuoka@, myself and mxb at alumni ! chalmers ! se, thanks!
ok yasuoka, mpi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
there are two things shared between the network stack and drivers
in the send path: the send queue and the IFF_OACTIVE flag. the send
queue is now protected by a mutex. this diff makes the oactive
functionality mpsafe too.
IFF_OACTIVE is part of if_flags. there are two problems with that.
firstly, if_flags is a short and we dont have any MI atomic operations
to manipulate a short. secondly, while we could make the IFF_OACTIVE
operates mpsafe, all changes to other flags would have to be made
safe at the same time, otherwise a read-modify-write cycle on their
updates could clobber the oactive change.
instead, this moves the oactive mark into struct ifqueue and provides
an API for changing it. there's ifq_set_oactive, ifq_clr_oactive,
and ifq_is_oactive. these are modelled on ifsq_set_oactive,
ifsq_clr_oactive, and ifsq_is_oactive in dragonflybsd.
this diff includes changes to all the drivers manipulating IFF_OACTIVE
to now use the ifsq_{set,clr_is}_oactive API too.
ok kettenis@ mpi@ jmatthew@ deraadt@
|
| |
|
|
|
|
|
|
|
|
|
| |
This header is only needed because <netinet/if_ether.h> declares a
structure that needs it. But it turns out that <net/if.h> already
includes it as workaround.
A proper solution would be to stop declarting "struct ether_arp"
there. But no driver should need this header.
|
| |
|
|
|
|
|
|
| |
This has been masked because <sys/srp.h> is pulled unconditionally.
ok dlg@
|
|
|
|
|
|
| |
Because of the VLAN hacks in mpw(4) this file still contains the definition
of "struct ifvlan" which depends on <sys/refcnt.h> which in turns pull
<sys/atomic.h>...
|
| |
|
| |
|
|
|
|
| |
noticed by brad
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the vmx rx path is only touched in the interrupt handler, so it is
already guaranteed to be accessed by only one cpu at a time.
the tx path has been massaged so the the producer is only touched
by the start routine, and the consumer is only touched by the
interrupt path, and can therefore be run concurrently. the only
interlock is a count of the free descriptors.
if txintr clears IFF_OACTIVE, it takes the kernel lock before running
the start routine.
other interrupts, eg, link state handling, take the kernel lock.
|
|
|
|
|
|
|
| |
Note that pseudo-drivers not using if_input() are not affected by this
conversion.
ok mikeb@, kettenis@, claudio@, dlg@
|
|
|
|
|
| |
Report & tests by mxb@alumni.chalmers.se, thanks!
OK deraadt, chris
|
| |
|
|
|
|
|
|
| |
mfi(4). Based on FreeBSD, but done without mfiutil(8).
OK deraadt@
|
| |
|
|
|
|
|
|
|
| |
have any direct symbols used. Tested for indirect use by compiling
amd64/i386/sparc64 kernels.
ok tedu@ deraadt@
|
|
|
|
| |
ok dlg reyk
|
|
|
|
| |
ok reyk
|
| |
|
|
|
|
| |
ok reyk@
|
|
|
|
|
|
| |
hardware can do (9k). implement the rxr ioctl while here.
ok jsg@
|
| |
|
|
|
|
| |
ok mpi
|
|
|
|
|
|
|
|
|
|
| |
to using if_rxr.
cut the reporting systat did over to the rxr ioctl.
tested as much as i can on alpha, amd64, and sparc64.
mpi@ has run it on macppc.
ok mpi@
|
|
|
|
|
|
|
|
| |
- Bring the receive filter handling in line with other drivers
- Simplify the RX checksum code a bit and only set the flags when the
RX checksum is Ok
ok uebayasi@
|