Commit Graph

9441 Commits

Author SHA1 Message Date
chs
fd34ea77eb remove checks for failure after memory allocation calls that cannot fail:
kmem_alloc() with KM_SLEEP
  kmem_zalloc() with KM_SLEEP
  percpu_alloc()
  pserialize_create()
  psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.
2017-06-01 02:45:05 +00:00
msaitoh
64b17b2a86 Print MSI Message data in 32bits when the Extended Message Data Capable bit
is set.
2017-05-29 07:09:20 +00:00
macallan
8e9e89c07f g/c some unused / #if 0-ed goop, support firmware-provided EDID, get rid of
private list of video modes
tested on macppc, should Just Work(tm) on sparc64
2017-05-28 05:27:13 +00:00
msaitoh
7bf1852420 Add missing {ixgbe,ixv}_stop() in the detach function. Without this change,
shutdown won't finish or panic on heay traffic.
2017-05-26 09:17:32 +00:00
msaitoh
eccb5e67a7 Count Bad SFD (Start Frame Delimiter). X550 and newer have this register. 2017-05-26 08:36:41 +00:00
msaitoh
493fc8cfd3 Clear all event counters when SIOCZIFDATA(ifconfig -z) is called. 2017-05-26 07:42:15 +00:00
msaitoh
7cd8be93cc Decode TPH Requester Control register. 2017-05-24 06:51:27 +00:00
nonaka
1d6b1544e7 regen 2017-05-23 07:13:11 +00:00
nonaka
94940de272 Add some AMD entries. 2017-05-23 07:12:56 +00:00
ozaki-r
a1d5203de1 Apply deferred if_start to more drivers
And annotate some XXX_start as it runs in softint to clarify that
it doesn't need deferred if_start.
2017-05-23 02:19:14 +00:00
msaitoh
43b1989483 Fix a bug that the driver prints "Link is up 1 Gbps" even if the link is
100Mbps. This change is the same as a part of ixv.c rev. 1.42.
2017-05-22 07:35:14 +00:00
msaitoh
2f13da0c4a Document says M[LR]FC are valid when link is up and 10Gbps, so:
- Add those values when link is up and 10Gbps
 - Discard those vaules when link becomes up and the speed is 10Gbps
2017-05-22 07:23:55 +00:00
msaitoh
551ee3e68c - The Captured Slot Power Limit value is only for device which has upsteam
port.
- The following three registers are the same encoding, so use the same
  function:
   - the Captured Slot Power Limit in the Device Capability register of PICe
     capability.
   - the Slot Power Limit in Slot Capability register of PCIe capability.
   - the Base Power and Data Scale in the Data Register of Power Budgeting
     capability.
- Fix the alternative encoding check of power limit as document. Add check if
  scale equals to 0.
2017-05-22 04:21:20 +00:00
nonaka
5c7478bf3c iwm(4): match Wireless 8265 device. 2017-05-19 14:18:10 +00:00
jakllsch
de002c399b Re-enable RTKQ_IM_HW. Timeout issues appear to be fixed since
src/sys/dev/ic/rtl8169.c r1.151
2017-05-18 18:33:48 +00:00
msaitoh
5783872703 - Count "Total Packets Missed" by evcnt(9)
- Call evcnt_attach_dynamic()/detach() for stats->mngpdc
  (Management Packets Dropped).
- Make stats->rnbc (Receive No Buffers) evcnt(9). Only 82598 has this register.
- Set RQSMR, TQSM (or TQSMR on 82598) to count qprc, qptc, qbrc, qbtc and qprdc
  in each queue counter. Without this change, all queue's counts are counted in
  queue 0's. Even if with this change, only MPC[0] is counted and other MPCs
  are not counted.
2017-05-18 08:27:19 +00:00
msaitoh
1c6a4127ff Fix a bug that number of input packet counted twice. This bug was added
since sys/net/if.c rev.1.368.
http://mail-index.netbsd.org/source-changes/2016/12/15/msg079882.html
2017-05-18 08:25:37 +00:00
nonaka
decfd26536 Fixed m is not freed if m_defrag() fails. 2017-05-18 01:32:46 +00:00
jdolecek
3ff587bd49 more precise m_freem() on error paths, and update m after the m_defrag() call 2017-05-17 20:13:02 +00:00
jdolecek
d54fac4a0b simplify vioif_start() - remove the delivery attempts on failure and retries,
leave that for the dedicated thread

if dma map load fails, retry after m_defrag(), but continue processing
other queue items regardless

set interface queue length according to the length of virtio queue, so that
higher layer won't queue more than interface can manage to keep in flight

use the mutexes always, not just with NET_MPSAFE, so they continue
being exercised and hence working; they also enforce proper IPL level

inspired by discussion around PR kern/52211, thanks to Masanobu SAITOH
for the m_defrag() idea and code
2017-05-17 20:04:50 +00:00
jdolecek
55f3f83e9c do not set IFF_OACTIVE if dma map load or the virtio reserve fails;
this causes interface to ignore any further TX requests if this happens
when there are no other TX requests in progress

fixes kern/52211 by Juergen Hannken-Illjes
2017-05-17 18:21:40 +00:00
jdolecek
91791fcb95 free the virtio slot _before_ calling scsipi_done(), so that driver is able
to accept another request immediatelly and doesn't trigger spurious
XS_RESOURCE_SHORTAGE

part of fix for PR kern/52199
2017-05-15 21:30:37 +00:00
jdolecek
7b999ff997 refactor error handling in vioscsi_scsipi_request() to avoid the goto maze,
and add missing virtio_enqueue_abort() call when bus_dmamap_load() fails;
abort is only done implicitely when virtio_enqueue_reserve() fails,
must do it explicitely if there is other reason

also now always print error when bus_dmamap_load() or virtio_enqueue_reserve()
fail - the former shouldn't fail due to BUS_DMA_ALLOCNOW, and the latter
shouldn't ever fail now after the maxnsegs fix for virtio_alloc_vq(), so
error there means driver bug
2017-05-13 20:35:20 +00:00
jdolecek
173733511a fix number of maximum segments in the queue allocation so that
MAXPHYS-sized tranfer fits inside the indirect descriptor; avoids the
!indirect path in virtio_enqueue_reserve() for these transfers,
which runs out of the vq_entries and triggers XS_RESOURCE_SHORTAGE for
bigger number of outstanding tranfers

fixes PR kern/52199 by MB
2017-05-13 20:17:42 +00:00
msaitoh
54b0121fed Fix typos. 2017-05-10 03:24:31 +00:00
msaitoh
c4659e5b0a Use pci_intr_establish_xname(). 2017-05-10 02:46:33 +00:00
msaitoh
da419f9608 - Use pci_intr_establish_xname().
- Style change.
2017-05-10 02:46:06 +00:00
msaitoh
a2616f414a A device except Root Complex integrated has a link, so print link related
registers on device except Root Complex Integrated Endpoint and Root Complex
Event Collector.
2017-05-09 11:17:07 +00:00
msaitoh
feb6d69f6c - Fix a bug that a device which has no PCIe capability incorrectly
accessess the PCI config area in ppbdetach().
- Don't add event counters if slot interrupt isn't used.
2017-05-09 06:29:20 +00:00
msaitoh
879a63dd87 Fix a bug that if_obytes and if_omcasts aren't counted. This bug was added
in ixgbe.c rev. 1.27 by me. Reported by Uwe Toenjes.
2017-05-08 10:00:41 +00:00
msaitoh
a84a926d28 - Add RICOH R5C576 SD Card Controller.
- Add some SiS devices. Taken from OpenBSD.
- Change SiS 0x6325 from 6325 AGP VGA to 650 AGP VGA.
2017-05-08 07:34:33 +00:00
jakllsch
acb8fa93fa Disable interrupt moderation, as it is it causes watchdog timeouts on
some chips/systems.
2017-05-01 12:29:40 +00:00
msaitoh
331aaa06fa Fix a bug that reading hw.ixgM.qN.interrupt_rate cause the interrupt
throtting rate register to 0. Check sysctl read/write correctly...
2017-04-28 10:24:45 +00:00
msaitoh
b8e169d62e Use {isa,pci}_intr_establish"_xname"() for intrctl(8). 2017-04-27 10:01:53 +00:00
msaitoh
714b2af146 Make ppb(4) interrupt support stable:
- Disable all interrupts in the beginning of attach. Without this, interrupt
  storm occurs while cold == 1 on some environment.
- Disable command complete interrput for a while to prevent hangup on some
  enviroment. I'm sorry, I don't know what this bit is :-|
- Check all status bits and return 0 if an interrupt is not for me. It's
  required for INTx. Tested on XEN3_DOM0 because it doesn't support MSI yet.
- Return 1 when a interrupt is processed.
2017-04-27 04:44:02 +00:00
msaitoh
8b231a4cfb Check slot registers if a device is PCI/PCI-X to PCI Express Bridge. Tested
with Pericom Semiconductors(Diodes) PI7C9X111SL PCIe to PCI Reverse Bridge.
2017-04-27 04:26:12 +00:00
msaitoh
565f97853e regen. 2017-04-27 03:57:37 +00:00
msaitoh
2c805d1509 - Add some Pericom (Diodes) devices.
- s/P17C9/PI7C9/
2017-04-27 03:57:17 +00:00
msaitoh
b4bafc1cd0 Disable ppb(4)'s interrupt for a while. It causes hangup on some environment.
Define PPB_USEINTR if you'd like to use interrupt.
2017-04-26 08:00:03 +00:00
msaitoh
5cf0c5d4c5 Disable and disestablish interrupt in ppbdetach(). 2017-04-26 03:54:37 +00:00
snj
35b2078af2 fix typo 2017-04-25 17:11:47 +00:00
chs
af56b75b7d in ppbdetach(), try to detach the children before tearing down our own state,
to avoid trouble if detaching the children fails.
2017-04-24 23:01:45 +00:00
kre
bfbd326990 For want of a comma, the compiler was lost. 2017-04-21 11:49:31 +00:00
msaitoh
4ed5b7c993 Add Flattening Portal Bridge capability ID and Hierarchy ID extended
capability ID.
2017-04-21 09:01:52 +00:00
msaitoh
26079ea3f0 5776[0156], 5778[02568] and 5779[015] are not Fast Ethernet but
Gigabit Ethernet.
2017-04-20 09:18:05 +00:00
msaitoh
07f767d482 Fix device timeout problem when MSI is used on BCM57762, BCM57765 and
BCM57785. Check correctly for BGEF_TAGGED_STATUS. These devices' ASCI core is
BCM5776[56]. Other BSD's BGE_IS_5717_PLUS() include BCM5776[56] but ours
doesn't (because Linux tg3 does so).

 Tested with snj's MacBook (BCM57765 (BCM57765 B0 ASIC)) and my Acer Aspire
One 756 (BCM57785(BCM57765 B0 ASIC)). Also Thunderbolt Ethernet
(BCM57762 (BCM57766 A0 ASIC)) should work.
2017-04-20 09:03:04 +00:00
msaitoh
c6ed37c2be Add Downstream Port Containment (DPC) ECN and Enhanced DPC(eDPC) ECN. 2017-04-20 08:45:25 +00:00
msaitoh
5b60743311 Add 0x for register output. 2017-04-20 05:48:38 +00:00
msaitoh
32cc977d83 Add another BCM4401 chip support. 2017-04-19 07:35:44 +00:00
msaitoh
6bddabc9e6 regen. 2017-04-19 06:54:14 +00:00
msaitoh
85ce0132f1 Add BCM4401 B0 step. Old BCM4401 B0 entry is changed to B1. From OpenBSD. 2017-04-19 06:53:52 +00:00
msaitoh
28ec51dec1 Use macro. No binary change. 2017-04-19 06:52:11 +00:00
jmcneill
cf1efaaa6a Performance improvements for PCIe and 8168 based devices:
- When using the countdown timer for interrupt moderation on PCIe devices,
   use a timer rate value based on a 125MHz PCIe reference clock instead of
   33 MHz.
 - For 8168 based devices, ditch the countdown timer and instead use the
   (undocumented) hardware interrupt moderation feature.
 - Support TSOv4 on 8168D and later devices.
2017-04-19 00:20:02 +00:00
msaitoh
61b9e2edb2 Add missing ':' 2017-04-18 10:00:26 +00:00
msaitoh
a607c0a0a4 Enable PCIe's interrupt as much as possilbe in ppb(4) to detect and count
status change event. HotPlug function itself have not implemented yet.

 - Interrupt and each event are counted by evcnt(9). Example:

   ppb0 Interrupt                                                0    0 intr
   ppb0 Attention Button Pressed                                 0    0 misc
   ppb0 Power Fault Detected                                     0    0 misc
   ppb0 MRL Sensor Changed                                       0    0 misc
   ppb0 Presence Detect Changed                                  0    0 misc
   ppb0 Command Completed                                        0    0 misc
   ppb0 Data Link Layer State Changed                            0    0 misc

 - Print message if ppb_printevent is not zero. The default vaule is 0.
   The output messages:

   Attention Button Pressed
   Power Fault Detected
   MRL Sensor Changed
   Presence Detect Changed
   Command Completed
   Data Link Layer State Changed

 - Remove workaround code to disable interrupt (ppb.c rev. 1.35).

 Tested with Dell Latitude 2120 without if_bge.c rev. 1.304's workaround.
dmesg when bge's device timeout occured:

   ppb3: Presence Detect Changed
   ppb3: Data Link Layer State Changed
   ppb3: Presence Detect Changed

vmstat -e |grep ppb

   ppb3 Interrupt                                             2    0 intr
   ppb3 Presence Detect Changed                               2    0 misc
   ppb3 Data Link Layer State Changed                         1    0 misc
2017-04-18 05:21:34 +00:00
msaitoh
d081c6306b Use macro. No functional change. 2017-04-17 09:33:00 +00:00
knakahara
54559a2194 wm(4) can disable msi/msix by build option and ddb command.
suggested by nonaka@n.o.
reviewed by msaitoh@n.o and nonaka@n.o.
2017-04-13 10:37:36 +00:00
msaitoh
233ee5301d Add forgotten BGE_EVCNT_INCR() for spurious interrupt. 2017-04-13 09:25:33 +00:00
msaitoh
b734e166a9 - Read chip ID correctly on BCM57782 and BCM57786.
- Add BXCM57766 A0 string.
- Add comment for BCM5776[56]'s workaround.
2017-04-13 04:27:46 +00:00
msaitoh
414cfa3e2c regen. 2017-04-13 04:04:39 +00:00
msaitoh
490bdb899e Add Broadcom BCM577x5 SDMMC, Memstic and xD. 2017-04-13 04:04:13 +00:00
msaitoh
92a8537b4b Add a workaround for BCM57780 to prevent device timeout. This change prevent
L1PM feature do wrongy. Tested with Dell latitude 2120.
2017-04-12 06:22:16 +00:00
msaitoh
44790b71a1 Fix a bug that BCM5785 write wrongly to the PCI config area. 2017-04-12 06:04:34 +00:00
msaitoh
6d4127c9b8 Add counters for spurious interrupts. 2017-04-12 05:59:43 +00:00
msaitoh
56d0e2153c Detach sysctl and event counters in bge_release_resources(). 2017-04-12 05:50:52 +00:00
knakahara
c053c2614b improve comments about the difference between legacy/msi and msix.
pointed out by msaitoh@n.o.
2017-04-12 05:08:00 +00:00
msaitoh
a84408c82d Fix typos:
- s/Readness/Readiness/
- s/Presense/Presence/
- s/supportted/supported/
- s/Rquester/Requester/
- s/Check Enab/Check Enable/
2017-04-06 08:57:01 +00:00
msaitoh
c930008140 Fix a bug that non-GMII devices don't send a routing message when the link
status is changed. Call if_link_state_change(). Tested with 82572EI(TBI) and
I350(SERDES).

XXX pullup-[67].
2017-04-05 10:44:35 +00:00
msaitoh
2f14115136 IF PCIe's Alternative Routing-ID Interpretation (ARI) is enabled in a bridge,
all area under the bus should be checked in pci_enumerate_bus() to enumerate
all existing devices.

 The similar code also be required for "pcictl pciN list". (not yet)
2017-04-05 04:04:54 +00:00
msaitoh
b74dbb8635 Move struct ppb_softc into ppbvar.h. 2017-04-05 03:51:36 +00:00
skrll
dac30f2486 regen 2017-03-31 09:28:18 +00:00
skrll
a454174abc Fix BCM4727 entry 2017-03-31 09:27:30 +00:00
msaitoh
1a130f7e42 regen. 2017-03-31 08:54:51 +00:00
msaitoh
880cbbf7d3 - Add BROADCOM BCM4313 802.11b/g/n
- Add Intel's another Pineview Integrated Graphics Device
- Add Realtek RTS5208 PCI-E Card Reader
2017-03-31 08:53:56 +00:00
msaitoh
eabd5e1de9 Remove extra 0x. This bug was added when replacing bitmask_snprintf(9) with
snprintb(3) (in between NetBSD 5 and 6). Old bitmask_snprint(9) didn't add
0x" automatically for hexadecimal value, so old code used it with "0x%s".
2017-03-31 08:38:13 +00:00
msaitoh
4e4a66f80c Fix a bug that SR-IOV's system page size was doubled. ffs()'s bit are
numbered starting from 1.
2017-03-30 08:44:33 +00:00
msaitoh
9842222b6c Fix 0x%d and 0x%u. 2017-03-29 09:04:35 +00:00
msaitoh
43a0a12a2b Sort & indent. No functional change. 2017-03-28 10:47:44 +00:00
msaitoh
213d5a45e6 Use macro. No functional change. 2017-03-28 10:30:27 +00:00
msaitoh
615a458937 Use correct macro "PCI_SATA_REV" instead of PCI_MSIX_CTL for SATA revision
register. This is not a real bug because PCI_SATA_REV and PCI_MSIX_CTL have
the same value.
2017-03-28 10:28:59 +00:00
msaitoh
307562a402 Indent. No functional change. 2017-03-28 10:25:11 +00:00
msaitoh
e6ece14757 Lowercase for consistency. No functional change. 2017-03-28 10:23:40 +00:00
ozaki-r
bf81d6dd39 Handle config change interrupts to inhibit sending packets while link down
PR kern/52103 by s-yamaguchi@IIJ
2017-03-28 04:10:33 +00:00
ozaki-r
9ae5ce46b5 Don't write to read-only VIRTIO_NET_S_LINK_UP bit
The bit is defined as read-only in the Virtio PCI Card Specification.
The fix is inspired by FreeBSD.

PR kern/52103 by s-yamaguchi@IIJ
2017-03-28 04:09:52 +00:00
jdolecek
964ace2483 fix pasto for nbo_bus_space_write_4() - value needs to be uint32_t 2017-03-26 16:53:36 +00:00
martin
143651f2b6 Duh, remove accidently left over debug printfs 2017-03-26 13:51:45 +00:00
martin
1b48c05d9b Backout previous, no need for these accessor in MD code 2017-03-26 12:36:43 +00:00
martin
20dd8ad809 Provide an accessor for the pci attach args of a virtio device (if
available - future non-pci attachments may return NULL).
Sparc64 MD code needs this to match the OF node of the virtio device
for boot device recognition.
2017-03-26 10:36:10 +00:00
christos
04fa6d2436 fix printf format. 2017-03-25 23:58:35 +00:00
jdolecek
bdf17da623 add support for loading vioscsi driver dynamically 2017-03-25 18:15:31 +00:00
jdolecek
8aadb0b68c cap also adapt_nchannels to 1, we only attach one 2017-03-25 18:13:53 +00:00
jdolecek
e5f11f866e cap adapt_openings to minimum of cmd_per_lun and qsize, so that we don't
overpromise to the upper layer

cap ntargets and nluns to 16 and 1024 as avoid spending excessive time
probing for nonexistent devices; e.g. qemu defaults to 255/16383 causing
the probe to take about a minute
2017-03-25 18:09:44 +00:00
jdolecek
ebf5774892 reorganize the attachment process for virtio child devices, so that
more common code is shared among the drivers, and it's possible for
the drivers to be correctly dynamically loaded; forbid direct access
to struct virtio_softc from the child driver code
2017-03-25 18:02:06 +00:00
jdolecek
96b62882c1 use ipl level specified by child when attaching interrupts, instead of always
using IPL_NET
2017-03-25 17:50:51 +00:00
martin
cf37d93b8f PR kern/52107: for now (while we still use the legacy virtio spec) at least
hack around the endianess issues with that.
2017-03-25 13:05:09 +00:00
macallan
306ca4c7a7 support screen blanking 2017-03-24 21:28:03 +00:00
knakahara
f2bb9561cc fix typo
pointed out by ozaki-r@n.o.
2017-03-24 10:39:10 +00:00
knakahara
62450b3c22 remove extra "+" 2017-03-24 10:18:55 +00:00
knakahara
f335890b69 add comments about the situation wm(4) use MSI-X but does not use multiqueue. 2017-03-24 10:02:35 +00:00
knakahara
fe71a311d1 make self-describing function the code reading sc->sc_nintrs or sc->sc_nqueues directly. 2017-03-24 10:01:55 +00:00
knakahara
214ae92931 add prototype.
I have forgotten the fix by wm_softint_establish(). Thank you christos@n.o!
2017-03-24 09:59:05 +00:00
macallan
22d10373e7 missed one line of debug spam... 2017-03-24 00:52:49 +00:00
macallan
ae92f52b37 - clean up some testing & debugging goop
- 0xff is transparent, so restrict ourself to just 4 bit colour, all we need
  for wscons
- support WSDISPLAYIO_GET_FBINFO etc. for wsfb, allow mmap()ing the fb etc.
2017-03-24 00:51:43 +00:00
msaitoh
14412c9646 regen. 2017-03-23 03:15:15 +00:00
msaitoh
4a8068643d Add Huawei Hi1710 BMC 2017-03-23 03:14:03 +00:00
knakahara
ac9c43ed03 add comments about transmit context descriptor 2017-03-22 08:44:41 +00:00
knakahara
f604adfd29 make kernel config flag WM_EVENT_COUNTERS.
suggested by msaitoh@n.o.
2017-03-22 03:32:09 +00:00
knakahara
550fe07e9f missing M_CSUM_IPv4 checking. It does not cause problems, but it is wrong.
The implementations of M_CSUM_DATA_IPv4_IPHL() and M_CSUM_DATA_IPv6_HL()
is the same, so that does not cause problems.
2017-03-22 02:56:12 +00:00
knakahara
9d434f8937 fix PR kern/52068 (82574 Tx csum offload bug in not only i386 but also amd64).
The packets sent from txq[1] could not be enabled any tx offload.
This has been enbugged since r1.454.
2017-03-21 10:39:52 +00:00
msaitoh
b433fb1d4e Modify some variables to make code more understandable. 2017-03-17 11:21:45 +00:00
msaitoh
42830d88d8 Don't print BAR's window size on pcictl pciN dump again
because there is no way to know it's correct value from
userland now.
2017-03-17 11:20:16 +00:00
msaitoh
8d1f742a02 - Don't try to sizing a BAR not if a device is host bridge but a device's
PCI_COMMAND_MEM_ENABLE is set.
- Fix 17 years old bug that all effective BARs are marked "not sized" on
  pcictl pciN dump.
- Print  BAR's window size on pcictl pciN dump.
- remove extra "(?)"
2017-03-17 08:51:44 +00:00
msaitoh
714ce0a4d5 Add another 100 Series SMBus (100SERIES_LP_SMB) 2017-03-15 06:40:34 +00:00
nonaka
dd5512aafe iwm(4): update firmware to maintained core release.
firmware from https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/linux-firmware.git/tree/?id=4b9559fb0565f582a21a4070a81a3b6a7d77610b
2017-03-14 23:59:24 +00:00
msaitoh
244e971ddb ECN: Change Root Complex Event Collector Class Code
- Old RCEC has subclass 0x06. It's the same as IOMMU. Read the type in PCIe
   extend capability to know whether it's RCEC or IOMMU.
2017-03-14 08:27:13 +00:00
msaitoh
40be40fe5a Pint PCI Interface name if available. 2017-03-14 08:25:35 +00:00
msaitoh
e85fe190cb Add two new PCI classes:
- processing accelerators
 - non-essential instrumentation
2017-03-14 08:20:11 +00:00
msaitoh
fb4ab79cfd No functional change:
- modify variable names
 - KNF
2017-03-14 08:09:31 +00:00
nonaka
89e11e0339 regen 2017-03-14 04:07:43 +00:00
nonaka
369a9e782a Added Intel Wireless 3168 entry. 2017-03-14 04:06:58 +00:00
jdolecek
03093d2152 several small tweaks:
- use MSIX if available
- fix off-by-one for nluns/ntargets (code inspection, not actual effect)
- when virtio_enqueue_reserve() fails, do not execute vioscsi_req_put()
  and hence virtio_dequeue_commit() as there is nothing to commit, just
  unload the xs and return; also report XS_RESOURCE_SHORTAGE, it's
  semi-normal situation
- set status/resid in vioscsi_req_done() before the switch, so that
  the override for VIRTIO_SCSI_S_BAD_TARGET actually has effect
- g/c vioscsi_req_put(), call the appropriate cleanup routines directly
- stop initializing id/task_attr in vioscsi_req_get(), it's overwritten
  in vioscsi_scsipi_request() anyway
2017-03-13 21:06:50 +00:00
jdolecek
44a3d36b7c replace req queue offset with define, only set & start the req interrupt for
that queue; add some masks for the lun for visibility; use slot as tag number

no actual functional change, just small cleanup
2017-03-13 20:47:38 +00:00
maya
eff1f7430f Add missing comma, else the strings are concatenated (and possibly the
wrong message is used). noted by coverity.

Linux iwlwifi strings seem similar.
2017-03-11 21:23:36 +00:00
kardel
b6ca960363 PR kern/52039: use same safeguard as for the 82578 2017-03-08 08:00:09 +00:00
jdolecek
edbde8245d allocate bus dma maps during attachment, rather than creating and destroying
them for each request; besides being faster, bus_dmamap_destroy() is not
safe to be called from interrupt context

adresses PR kern/52034 by Benny Siegert
2017-03-07 22:03:04 +00:00
macallan
8facbdfbe6 print out the actual stride value 2017-03-06 16:49:26 +00:00
knakahara
3b864806d6 fix r1.492 bug, sorry 2017-03-03 16:48:55 +00:00
knakahara
44ae67faf0 implement AIM(Adaptive Interrupt Moderation), but not enable yet.
Currently, it causes performance degration if enabled.
More ITR calcuration tuning is required...
2017-03-03 07:57:49 +00:00
knakahara
495b9e44cf make kernel config option WM_RX_PROCESS_LIMIT_DEFAULT and WM_RX_INTR_PROCESS_LIMIT_DEFAULT
e.g. if
    - WM_RX_PROCESS_LIMIT_DEFAULT is set 0
    - WM_RX_INTR_PROCESS_LIMIT_DEFAULT is set -1 (means almost infinite)
that means wm(4) does not use polling mode.
2017-03-03 07:38:52 +00:00
knakahara
ae5f0e6023 implement polling mode for multiqueue. It can suppress performance degration at high load.
e.g. I354 IP forwarding throughput performance
    + before
      - 133Mbps forwarding performance at 200Mbps input load
      - 41Mbps forwarding performance at 800Mbps input load
    + after
      - 150Mbps forwarding performance at 200Mbps input load
      - 150Mbps forwarding performance at 800Mbps input load
2017-03-03 07:32:36 +00:00
msaitoh
418e1bb3d4 Set PCI_INTR_MPSAFE, SOFTINT_MPSAFE, CALLOUT_MPSAFE and IFEF_START_MPSAFE
if NET_MPSAFE is defined.
2017-03-03 04:37:05 +00:00
knakahara
8f35265a4d IFEF_START_MPSAFE flag should be set only if WM_MPSAFE defined. some refactor.
pointed out and suggested by msaitoh@n.o, thanks.
2017-03-03 03:33:44 +00:00
msaitoh
c96e148c62 Fix a problem that m_defrag() isn't called in if_transmit path. Now both
if_start and if_transmit do m_defrag() correctly. This change improves the
performance of TSO.
2017-03-02 05:35:01 +00:00
msaitoh
3b94ce3722 Fix a bug that TSO doesn't work correctly. This bug was added in
ix_txrx.c rev. 1.17.
2017-03-02 04:33:56 +00:00
knakahara
7cedcca506 refactor: functionalize ITR/EITR writing processing.
tested I354 and 82545(VMware e1000).
2017-03-01 08:56:33 +00:00
knakahara
ec85308db3 divide ITR/EITR value from wm_softc to wm_queue as EITR register is bound to each H/W queue. 2017-03-01 08:31:06 +00:00
knakahara
3fd77047fb fix EITR setting.
+ 82574
      - add EITR setting, that is MSI-X mode interrupt interval
    + 82575
      - fix EITR value. 82575's EITR usage is the same as legacy (not NEWQUEUE)
        controllers
      - apply workaround which 82575's EITR does not have CNT_INGR bit
    + other NEWQUEUE controllers
      - fix interrupt interval field. NEWQUEUE (include 82575) controllers'
        interrupt interval field is 2:14
      - use CNT_INGR bit which avoid to overwrite counter

tested 82574, 82575 and I354.
ok by msaitoh@n.o.
2017-02-28 09:55:47 +00:00
jdolecek
afe4d516fc refactor the ld(4) DIOCCACHESYNC hook into general ioctl hook, so that attachments
would be able to implement arbitrary other ioctls
2017-02-27 21:32:33 +00:00
christos
5fa0ec317f fix printf formats (clang build) 2017-02-27 16:16:23 +00:00
msaitoh
c4c039fc04 Decode AGP capability. 2017-02-27 14:13:56 +00:00
knakahara
3f6ac110c5 fix Tx queue assignment when the number of H/W queues is less than ncpu. 2017-02-27 09:27:27 +00:00
msaitoh
8aea78d688 regen. 2017-02-27 03:37:16 +00:00
msaitoh
971d3c129c Add some NVIDIA devices. 2017-02-27 01:33:21 +00:00
msaitoh
a07140ca7f - Fix the base power's value in the power budget capability.
- Fix typo (s/Maximun/Maximum/)
2017-02-26 05:41:47 +00:00
knakahara
ede9d3bf43 apply 82574 RFCTL workaround the same as FreeBSD and linux.
In fact, this workaround reduces interrupt count.
2017-02-24 10:09:21 +00:00
knakahara
693595d590 82574 should follow MSI-X mode IMS manner.
Howerver some legacy interrupts occur as MSI-X other interrupt yet...
2017-02-24 10:07:33 +00:00
msaitoh
8462f6d0f2 Use macro. KNF. No functional change. 2017-02-24 06:39:54 +00:00
msaitoh
dfa7bcc213 Print mac.type and the TrackID. 2017-02-24 05:38:30 +00:00
msaitoh
94eac08e2e Fix 0x%u... 2017-02-24 05:04:46 +00:00
christos
727a2265b0 Establish a softint for legacy, otherwise BOOM! 2017-02-18 14:48:43 +00:00