The NetBSD Project

CVS log for src/sys/dev/pci/ixgbe/ixgbe.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / dev / pci / ixgbe

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.349 / (download) - annotate - [select for diffs], Wed Jan 24 05:18:59 2024 UTC (2 months, 3 weeks ago) by msaitoh
Branch: MAIN
CVS Tags: HEAD
Changes since 1.348: +10 -5 lines
Diff to previous 1.348 (colored) to selected 1.137 (colored)

ixgbe: Add QPRDC into iqdrops.

 A receive packet might drop at two different locations.
One is the packet buffer that packets are received into the chip first.
If the packet buffer is overflowed, the MPC register is incremented.
It's currently added to iqdrops. It's no problem.
Another is descriptor ring(s). A packet from the packet buffer is DMA'ed
into main memory base on the descriptor ring. If the ring is full, the packet
is dropped and the QPRDC register is incremented. It should be added to
iqdrops but it was not done. Fix it.
Reported by ozaki-r@.

Revision 1.348 / (download) - annotate - [select for diffs], Wed Nov 15 03:50:22 2023 UTC (5 months ago) by msaitoh
Branch: MAIN
Changes since 1.347: +3 -2 lines
Diff to previous 1.347 (colored) to selected 1.137 (colored)

ixgbe: Clear the WTHRESH bit field before writing it.

Revision 1.347 / (download) - annotate - [select for diffs], Thu Nov 2 09:40:47 2023 UTC (5 months, 2 weeks ago) by yamaguchi
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation
Changes since 1.346: +7 -6 lines
Diff to previous 1.346 (colored) to selected 1.137 (colored)

Use ether_bpf_mtap only when the device supports vlan harware tagging

The function is bpf_mtap() for ethernet devices and *currently*
it is just handling VLAN tag stripped by the hardware.

Revision 1.346 / (download) - annotate - [select for diffs], Thu Nov 2 05:07:57 2023 UTC (5 months, 2 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.345: +3 -3 lines
Diff to previous 1.345 (colored) to selected 1.137 (colored)

ixgbe: Whitespace. No functional change.

Revision 1.345 / (download) - annotate - [select for diffs], Mon Oct 30 02:46:28 2023 UTC (5 months, 2 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.344: +3 -3 lines
Diff to previous 1.344 (colored) to selected 1.137 (colored)

ixgbe: Fix comment. No functional change.

Revision 1.344 / (download) - annotate - [select for diffs], Wed Oct 18 03:52:55 2023 UTC (6 months ago) by msaitoh
Branch: MAIN
Changes since 1.343: +4 -4 lines
Diff to previous 1.343 (colored) to selected 1.137 (colored)

ixgbe: Whitespace. No functional change.

Revision 1.343 / (download) - annotate - [select for diffs], Thu Oct 12 08:06:13 2023 UTC (6 months, 1 week ago) by msaitoh
Branch: MAIN
Changes since 1.342: +7 -6 lines
Diff to previous 1.342 (colored) to selected 1.137 (colored)

ixgbe: Don't override the {ixgbe,ixv}_max_interrupt_rate global variable.

 Fix a bug that changing hw.ix[gv]X.qY.interrupt_rate would change all
devices all queues default interrupt rate.

Revision 1.342 / (download) - annotate - [select for diffs], Thu Oct 12 05:50:55 2023 UTC (6 months, 1 week ago) by msaitoh
Branch: MAIN
Changes since 1.341: +2 -5 lines
Diff to previous 1.341 (colored) to selected 1.137 (colored)

ixg(4): Don't print wrong error message about ixgbe_num_queues.

 Don't override the ixgbe_num_queues global variable. It's the default
value of the number of queues and should not override it because it
will be referenced by later device attach. For example, the number of
MSI-X vector is 64 on X540 and 18 on 82599. When both cards are inserted
to a machine that the number of CPU is 24 and X540 is probed earlier,
ixgbe_num_queues is overridden to 24 and the following error message is
printed when attaching 82599:

	ixg2: autoconfiguration error: ixgbe_num_queues (24) is too large,
	using reduced amount (17).

Note that the number of queues is in sc->num_queuss and referenced
by hw.ixgN.num_queues sysctl.

Revision 1.341 / (download) - annotate - [select for diffs], Thu Oct 12 03:43:55 2023 UTC (6 months, 1 week ago) by msaitoh
Branch: MAIN
Changes since 1.340: +5 -5 lines
Diff to previous 1.340 (colored) to selected 1.137 (colored)

ixgbe: Whitespace. No functional change.

Revision 1.340 / (download) - annotate - [select for diffs], Wed Oct 11 09:43:17 2023 UTC (6 months, 1 week ago) by msaitoh
Branch: MAIN
Changes since 1.339: +8 -3 lines
Diff to previous 1.339 (colored) to selected 1.137 (colored)

ixg(4): Print DEVICE_CAPS register.

Revision 1.339 / (download) - annotate - [select for diffs], Wed Oct 11 03:48:35 2023 UTC (6 months, 1 week ago) by msaitoh
Branch: MAIN
Changes since 1.338: +10 -10 lines
Diff to previous 1.338 (colored) to selected 1.137 (colored)

ixg(4): Whitespace. No functional change.

Revision 1.338 / (download) - annotate - [select for diffs], Fri Oct 6 14:48:08 2023 UTC (6 months, 1 week ago) by msaitoh
Branch: MAIN
Changes since 1.337: +2 -4 lines
Diff to previous 1.337 (colored) to selected 1.137 (colored)

ixgbe: Cleanup. No fucntional change.

 Remove unused code, fix whitespace and modify comment to reduce against
FreeBSD(mainly from ix-3.3.35).

Revision 1.337 / (download) - annotate - [select for diffs], Fri Oct 6 14:46:31 2023 UTC (6 months, 1 week ago) by msaitoh
Branch: MAIN
Changes since 1.336: +6 -6 lines
Diff to previous 1.336 (colored) to selected 1.137 (colored)

ixgbe: Enable interrupt after setting IFF_RUNNING. Same as FreeBSD x-3.3.35.

Revision 1.336 / (download) - annotate - [select for diffs], Fri Oct 6 14:44:08 2023 UTC (6 months, 1 week ago) by msaitoh
Branch: MAIN
Changes since 1.335: +16 -4 lines
Diff to previous 1.335 (colored) to selected 1.137 (colored)

ixgbe: Modify error message of wrong TX/RX descriptor size.

  - Based from FreeBSD ix-3.3.35. I think ix-3.3.35's RING_INCREMENT(== 32)
    is wrong. It should be 8(DBA_ALIGN / sizeof(union ixgbe_adv_[tr]x_desc)).
    Linux also uses 8.

Revision 1.335 / (download) - annotate - [select for diffs], Fri Oct 6 14:42:51 2023 UTC (6 months, 1 week ago) by msaitoh
Branch: MAIN
Changes since 1.334: +4 -4 lines
Diff to previous 1.334 (colored) to selected 1.137 (colored)

ixgbe: Simplify definitions. No functional change.

 Both DEFAULT_{TX,RX}D and PERFORM_{TX,RX}D are 2048. Use DEFAULT_{TX,RX}D.
Same as FreeBSD.

Revision 1.334 / (download) - annotate - [select for diffs], Fri Oct 6 14:40:06 2023 UTC (6 months, 1 week ago) by msaitoh
Branch: MAIN
Changes since 1.333: +3 -2 lines
Diff to previous 1.333 (colored) to selected 1.137 (colored)

ixg(4): Add 82599 LS once again.

 - From:
        FreeBSD: 9228ac3a69c4c7401a743e6465e118101a2beeb0
        DPDK:    549ccd3dc01539e060597b503f2b65b272de3347
 - This was removed 5 years ago. From the commit message:
   > Remove IXGBE_DEV_ID_82599_LS(0x154f) support again. I don't know why. This
   > was added in ix-3.2.18.tar.gz(NetBSD: ixgbe_82599.c rev. 1.20) and
   > removed in ix-3.3.6.tar.gz.

Revision 1.333 / (download) - annotate - [select for diffs], Fri Oct 6 14:37:04 2023 UTC (6 months, 1 week ago) by msaitoh
Branch: MAIN
Changes since 1.332: +1154 -1156 lines
Diff to previous 1.332 (colored) to selected 1.137 (colored)

ixgbe: Rename some definitions, modify comment. No functional change.

 Apply changes from FreeBSD's ix-3.3.31 and ixv-1.5.32.
    - struct adapter *adapter -> struct ixgbe_softc *sc
    - master -> primary
    - black -> block

Revision 1.332 / (download) - annotate - [select for diffs], Fri Oct 6 14:35:25 2023 UTC (6 months, 1 week ago) by msaitoh
Branch: MAIN
Changes since 1.331: +4 -4 lines
Diff to previous 1.331 (colored) to selected 1.137 (colored)

ixg(4): Update FCTRL after writing multicast filter. Same as other OSes.

 From FreeBSD 395cc55d896654b8f75071e71e856b22aed87da5.

Revision 1.331 / (download) - annotate - [select for diffs], Thu Sep 14 08:48:29 2023 UTC (7 months ago) by msaitoh
Branch: MAIN
Changes since 1.330: +7 -7 lines
Diff to previous 1.330 (colored) to selected 1.137 (colored)

ixg(4): Rename some descriptions of flow control related event conters.

Revision 1.330 / (download) - annotate - [select for diffs], Thu Sep 14 08:47:24 2023 UTC (7 months ago) by msaitoh
Branch: MAIN
Changes since 1.329: +10 -10 lines
Diff to previous 1.329 (colored) to selected 1.137 (colored)

ixg(4): Reorder some flow control related event counters for readability.

Revision 1.329 / (download) - annotate - [select for diffs], Wed Sep 13 08:05:23 2023 UTC (7 months ago) by msaitoh
Branch: MAIN
Changes since 1.328: +14 -3 lines
Diff to previous 1.328 (colored) to selected 1.137 (colored)

ixg(4): Count Queue Bytes {Transmit, Receive} counter.

Revision 1.328 / (download) - annotate - [select for diffs], Wed Sep 13 07:38:31 2023 UTC (7 months ago) by msaitoh
Branch: MAIN
Changes since 1.327: +10 -10 lines
Diff to previous 1.327 (colored) to selected 1.137 (colored)

ixg(4): Rename some descriptions of event counters.

 - Rename some descriptions from register name to the meaning.
 - For the same meaning's counters, add "(soft)" or "(reg)".
   The former is for a software level counter and the latter is for a
   statistics counter register based.

Revision 1.327 / (download) - annotate - [select for diffs], Wed Sep 13 07:28:51 2023 UTC (7 months ago) by msaitoh
Branch: MAIN
Changes since 1.326: +54 -46 lines
Diff to previous 1.326 (colored) to selected 1.137 (colored)

ixgbe: Reorder some event counters for readability.

Revision 1.326 / (download) - annotate - [select for diffs], Mon May 15 08:01:22 2023 UTC (11 months ago) by msaitoh
Branch: MAIN
Changes since 1.325: +11 -2 lines
Diff to previous 1.325 (colored) to selected 1.137 (colored)

Count the number of link down events in the MAC using with LINK_DN_CNT.

 - Add new event counter "link_dn_cnt" to count the number of link down
   events in the MAC.
 - The LINK_DN_CNT register (at 0x0403c) is described only in the
   Denverton's datasheet, so use it only on ixgbe_mac_X550EM_a.

Revision 1.325 / (download) - annotate - [select for diffs], Fri Feb 3 05:43:55 2023 UTC (14 months, 2 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.324: +8 -5 lines
Diff to previous 1.324 (colored) to selected 1.137 (colored)

Use thermal sensor code for IXGBE_DEV_ID_X550EM_A_10G_T, too.

 PCI device ID 0x15c8 also use X557-AT PHY, so create the thermal sensor
sysctl for it, too.

Revision 1.324 / (download) - annotate - [select for diffs], Fri Oct 28 01:10:41 2022 UTC (17 months, 3 weeks ago) by msaitoh
Branch: MAIN
CVS Tags: netbsd-10-base
Branch point for: netbsd-10
Changes since 1.323: +4 -3 lines
Diff to previous 1.323 (colored) to selected 1.137 (colored)

Make three "Unsupported SFP+ module..." messages the same.

Revision 1.323 / (download) - annotate - [select for diffs], Wed Jul 6 06:31:47 2022 UTC (21 months, 1 week ago) by msaitoh
Branch: MAIN
CVS Tags: bouyer-sunxi-drm-base, bouyer-sunxi-drm
Changes since 1.322: +4 -4 lines
Diff to previous 1.322 (colored) to selected 1.137 (colored)

Call txeof first, then rxeof for the consistency.

 There are three functions where the txeof and rxeof are called. The legacy
interrupt function and MSI-X function call rxeof first, then rxeof.
For the workqueue function. rxeof is called first. Modify it to match with
other two.

Revision 1.322 / (download) - annotate - [select for diffs], Sat Jun 18 08:20:56 2022 UTC (22 months ago) by skrll
Branch: MAIN
Changes since 1.321: +3 -3 lines
Diff to previous 1.321 (colored) to selected 1.137 (colored)

aprintf_normal -> aprint_normal

Revision 1.321 / (download) - annotate - [select for diffs], Thu Jun 2 17:20:21 2022 UTC (22 months, 2 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.320: +3 -3 lines
Diff to previous 1.320 (colored) to selected 1.137 (colored)

Modify comment. ixgbe_enable_queue() can be used on both MSI-X and legacy intr.

Revision 1.320 / (download) - annotate - [select for diffs], Thu Jun 2 16:56:22 2022 UTC (22 months, 2 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.319: +5 -6 lines
Diff to previous 1.319 (colored) to selected 1.137 (colored)

KNF. Modify comment. No functional change.

Revision 1.319 / (download) - annotate - [select for diffs], Thu Jun 2 01:57:27 2022 UTC (22 months, 2 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.318: +70 -72 lines
Diff to previous 1.318 (colored) to selected 1.137 (colored)

KNF. No functional change.

Revision 1.318 / (download) - annotate - [select for diffs], Wed Jun 1 05:06:45 2022 UTC (22 months, 2 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.317: +3 -3 lines
Diff to previous 1.317 (colored) to selected 1.137 (colored)

Correctly enter the recovery mode. Not tested.

Revision 1.317 / (download) - annotate - [select for diffs], Wed Jun 1 04:15:41 2022 UTC (22 months, 2 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.316: +3 -3 lines
Diff to previous 1.316 (colored) to selected 1.137 (colored)

Correctly re-enable queue interrupt in ixgbe_legacy_irq().

- Don't enable queue 1-15 interrupt.
- Don't enable queue 0 interrupt when the queue work is being scheduled.
- OK'd by knakahara.

Revision 1.316 / (download) - annotate - [select for diffs], Wed Jun 1 02:07:24 2022 UTC (22 months, 2 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.315: +3 -14 lines
Diff to previous 1.315 (colored) to selected 1.137 (colored)

Simplify ixgbe_msix_que(). No functional change.

Revision 1.315 / (download) - annotate - [select for diffs], Mon May 30 05:07:38 2022 UTC (22 months, 2 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.314: +7 -7 lines
Diff to previous 1.314 (colored) to selected 1.137 (colored)

Fix a bug that the legacy interrupt doesn't work when MSI-X allocation failed.
Fixes PR kern/56857.

Revision 1.314 / (download) - annotate - [select for diffs], Mon Apr 25 07:56:47 2022 UTC (23 months, 3 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.313: +9 -3 lines
Diff to previous 1.313 (colored) to selected 1.137 (colored)

Add missing num_tx_desc sysctl.

Revision 1.313 / (download) - annotate - [select for diffs], Mon Apr 25 07:54:42 2022 UTC (23 months, 3 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.312: +76 -42 lines
Diff to previous 1.312 (colored) to selected 1.137 (colored)

Limit {tx,rx}_process_limit sysctl values from 1 to num_{tx,rx}_desc.

Revision 1.312 / (download) - annotate - [select for diffs], Thu Mar 10 04:14:34 2022 UTC (2 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.311: +38 -33 lines
Diff to previous 1.311 (colored) to selected 1.137 (colored)

Print ECC, PHY and temp error log using with ratecheck().

 - The ratecheck() is for just in case. All of the interrupts might occur
   only once, but I don't know whether it's true or not. For the fan failure,
   it seems it occurs only once.
 - All of the interval is 60s.

Revision 1.311 / (download) - annotate - [select for diffs], Thu Mar 10 04:00:32 2022 UTC (2 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.310: +4 -2 lines
Diff to previous 1.310 (colored) to selected 1.137 (colored)

 Enclose flow director stuff in ixgbe_intr_admin_common() with IXGBE_FIR.

Revision 1.310 / (download) - annotate - [select for diffs], Thu Mar 10 03:58:52 2022 UTC (2 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.309: +4 -3 lines
Diff to previous 1.309 (colored) to selected 1.137 (colored)

 Move the definition of eicr_mask variable. No functional change.

Revision 1.309 / (download) - annotate - [select for diffs], Thu Mar 10 03:57:33 2022 UTC (2 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.308: +5 -4 lines
Diff to previous 1.308 (colored) to selected 1.137 (colored)

 Modify comment to clarify EIAC setting.

Revision 1.308 / (download) - annotate - [select for diffs], Thu Mar 10 03:53:46 2022 UTC (2 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.307: +5 -3 lines
Diff to previous 1.307 (colored) to selected 1.137 (colored)

Add IFF_RUNNING check in ixgbe_legacy_irq() again.

 - This change might fix small race between ifconfig down and an interrupt.
   If the race really exists, txeof() is called and it's not so dangerous.
   The rxeof is blocked in the beginning of ixgbe_handle_que().
 - This change makes consistent with ixgbe_handle_que().
 - Found and OK'd by knakahara.

Revision 1.307 / (download) - annotate - [select for diffs], Wed Feb 16 10:29:13 2022 UTC (2 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.306: +7 -2 lines
Diff to previous 1.306 (colored) to selected 1.137 (colored)

Print Printed Board Assembly (PBA) number.

Revision 1.306 / (download) - annotate - [select for diffs], Tue Feb 1 04:59:16 2022 UTC (2 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.305: +3 -3 lines
Diff to previous 1.305 (colored) to selected 1.137 (colored)

Increment legacy interrupt counter after checking INTx sharing.

Revision 1.305 / (download) - annotate - [select for diffs], Tue Jan 25 01:56:22 2022 UTC (2 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.304: +194 -214 lines
Diff to previous 1.304 (colored) to selected 1.137 (colored)

Use atomic_{load,store}_relaxed() for event counters.

Revision 1.304 / (download) - annotate - [select for diffs], Tue Jan 18 04:35:49 2022 UTC (2 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.303: +4 -4 lines
Diff to previous 1.303 (colored) to selected 1.137 (colored)

Use 64bit for lxon + lxoff.

Revision 1.303 / (download) - annotate - [select for diffs], Mon Jan 17 08:45:10 2022 UTC (2 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.302: +21 -18 lines
Diff to previous 1.302 (colored) to selected 1.137 (colored)

Fix ierror counting again.

  ixgbe.c rev. 1.298 added total values kept in evcnt(9) instead of
  incremental values read from registers. Fix it.

Revision 1.302 / (download) - annotate - [select for diffs], Fri Dec 31 14:25:23 2021 UTC (2 years, 3 months ago) by riastradh
Branch: MAIN
Changes since 1.301: +4 -4 lines
Diff to previous 1.301 (colored) to selected 1.137 (colored)

sys: Use if_init wrapper function.

Exception: Not in kern_pmf.c, for the kind of silly reason that it
avoids having kern_pmf.c refer to symbols defined only in net; this
avoids a pain in the rump.

Revision 1.301 / (download) - annotate - [select for diffs], Fri Dec 24 05:11:04 2021 UTC (2 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.300: +3 -3 lines
Diff to previous 1.300 (colored) to selected 1.137 (colored)

Add code to support API version 1.5. No functional change.

  - This change adds almost all code to support API 1.5 except real negotiation
    and upgrade mailbox functions.
  - From ix-3.3.18, ix-3.3.22 and ixv-1.5.24.

Revision 1.300 / (download) - annotate - [select for diffs], Thu Dec 16 10:48:49 2021 UTC (2 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.299: +19 -2 lines
Diff to previous 1.299 (colored) to selected 1.137 (colored)

Print NVM image version on 82598.

  FreeBSD ix-3.3.29 added code to decode NVM version. On 82598, the NVM
  offset is NVM_EEP_OFFSET_82598(== 0x2a). My own three different 82598
  cards' value in NVM_EEP_OFFSET_82598 are 0xffff. Instead, the dev starter
  version (0x29) has the value. Two of them have 0x1070 and another has 0x2090.
  The 82598 specification update notes about 2.9.0.

Revision 1.299 / (download) - annotate - [select for diffs], Wed Dec 15 08:42:48 2021 UTC (2 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.298: +4 -5 lines
Diff to previous 1.298 (colored) to selected 1.137 (colored)

Improve PHY's dmesg output for non-MIIVERBOSE case.

Revision 1.298 / (download) - annotate - [select for diffs], Tue Dec 14 05:31:12 2021 UTC (2 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.297: +26 -8 lines
Diff to previous 1.297 (colored) to selected 1.137 (colored)

Add some missing error counters to ierror.

  - FreeBSD: afb1aa4e6df245d38fd2ba683fa521d5dabe8392 or ix-ix-3.3.22
  - Note that the checksum error is not added to the ierror.

Revision 1.297 / (download) - annotate - [select for diffs], Fri Dec 10 11:39:48 2021 UTC (2 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.296: +2 -5 lines
Diff to previous 1.296 (colored) to selected 1.137 (colored)

Move PF mailbox initialization from ixgbe_attach() to ixgbe_init_iov().

  From FreeBSD ix-3.3.18. No functional change.

Revision 1.296 / (download) - annotate - [select for diffs], Fri Dec 10 11:33:11 2021 UTC (2 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.295: +20 -20 lines
Diff to previous 1.295 (colored) to selected 1.137 (colored)

No functional change.

  - Sync with FreeBSD ix-3.3.18.
    - Rename ixgbe_get_advertise() to ixgbe_get_default_advertise.
    - Sort lines, modify comment and whitespace to reduce diff against FreeBSD.

Revision 1.295 / (download) - annotate - [select for diffs], Tue Dec 7 22:13:56 2021 UTC (2 years, 4 months ago) by andvar
Branch: MAIN
Changes since 1.294: +3 -3 lines
Diff to previous 1.294 (colored) to selected 1.137 (colored)

fix typos in word "instead", mainly in log messages.

Revision 1.294 / (download) - annotate - [select for diffs], Fri Nov 12 06:56:50 2021 UTC (2 years, 5 months ago) by skrll
Branch: MAIN
Changes since 1.293: +3 -3 lines
Diff to previous 1.293 (colored) to selected 1.137 (colored)

KNF

Revision 1.293 / (download) - annotate - [select for diffs], Thu Sep 30 04:06:50 2021 UTC (2 years, 6 months ago) by yamaguchi
Branch: MAIN
Changes since 1.292: +6 -13 lines
Diff to previous 1.292 (colored) to selected 1.137 (colored)

Remove vlan_ifdetach() from ixgbe_detach()

The removed function is called in ether_ifdetach().
And ether_ifdetach is changed to be called before a device
is stopped, because vlan_ifdetach called from ether_ifdetach
configures VLAN settings.

Revision 1.292 / (download) - annotate - [select for diffs], Thu Sep 16 09:55:28 2021 UTC (2 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.291: +8 -7 lines
Diff to previous 1.291 (colored) to selected 1.137 (colored)

 Fix a bug that an mbuf chain which has more than 63488bytes MAY fail on TX.

 - Currently, The TX buffer dmamap's max number of segments is set to 32.
   MCLBYTES(== 2048) * 32 = 65536 and it's enough for IP_MAXPACKET(65535).
   If an mbuf chain has more than 32 mbufs, we call m_defrag() to make
   it lower than equal to 32, but it might not work. The reason is that
   our m_defrag() don't modify the first mbuf entry of the chain. e.g.:
   if an mbuf chain contains 63600bytes data and the first mbuf has 100bytes
   in the m_data, the new chain has 100+2048+2048+...+12 and the total number
   of the chain is not 32 but 33. It result in 43 TCP packets will drop.
 - One of the way to fix this problem is to change m_defrag() which add a
   new mbuf cluster to the first mbuf. It's need discussion.
 - Another solution is to change the max number of the TX DMA segment.
   It should be at least 33 to avoid the m_defrag()'s current limitation.
   The document (82599-X550 DS 7.2.1.1 "Transmit Storage in system Memory")
   says that a packet can be fragmented into 40 - WTHRESH - 2 (for 82598,
   the document say nothing and some people and code says it's unlimited).
   Currently WTHRESH is set to 8. 40 - 8 - 2 = 30. !?!?!? {Net,Free,Open}BSD
   and Linux use 32. Is that safe? Anyway, we change WTHRESH from 8 to 5
   to fit it. The added comment in ixgbe.h is based on DragonFly's
   though they don't use WTHRESH.
 - Yet another solution is to use the Tx Head Pointer Write Back function
   instead of WTHRESH based write back (see 82599-X550 DS 7.2.3.5.2
   "Tx Head Pointer Write Back" or 82598 "Transmit Completions Head Write Back"
   ). DragonFly, illumos and DPDK use it.
 - Yet yet another solution is to add tso_maxsize entry to struct ifnet
   and use it in the TCP stack.

Revision 1.291 / (download) - annotate - [select for diffs], Thu Sep 16 07:08:26 2021 UTC (2 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.290: +3 -3 lines
Diff to previous 1.290 (colored) to selected 1.137 (colored)

Use IXGBE_TXDCTL_WTHRESH_SHIFT macro. No functional change.

Revision 1.290 / (download) - annotate - [select for diffs], Thu Aug 26 09:03:47 2021 UTC (2 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.289: +6 -6 lines
Diff to previous 1.289 (colored) to selected 1.137 (colored)

 Remove "j" or "jumbo" because we always use MCLBYTES sized buffer.

Revision 1.289 / (download) - annotate - [select for diffs], Wed Aug 25 09:06:02 2021 UTC (2 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.288: +4 -17 lines
Diff to previous 1.288 (colored) to selected 1.137 (colored)

 Use MCLGET() instead of homegrown cluster (jcl) allocation mechanism.

- Before this commit, resource shortage was easily occurred because the total
  number of the clusters is small.

- Reviewed by knakahara and ryo.

Revision 1.288 / (download) - annotate - [select for diffs], Fri Aug 20 20:25:28 2021 UTC (2 years, 7 months ago) by andvar
Branch: MAIN
Changes since 1.287: +3 -3 lines
Diff to previous 1.287 (colored) to selected 1.137 (colored)

fix various typos in comments and log messages.

Revision 1.287 / (download) - annotate - [select for diffs], Thu Jul 15 08:09:31 2021 UTC (2 years, 9 months ago) by msaitoh
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-futex2-base, thorpej-futex2, thorpej-cfargs2-base, thorpej-cfargs2
Changes since 1.286: +36 -2 lines
Diff to previous 1.286 (colored) to selected 1.137 (colored)

 Add a new sysctl to read rxr->next_to_refresh.

Revision 1.286 / (download) - annotate - [select for diffs], Wed Jul 7 08:58:19 2021 UTC (2 years, 9 months ago) by msaitoh
Branch: MAIN
Changes since 1.285: +38 -2 lines
Diff to previous 1.285 (colored) to selected 1.137 (colored)

Add new sysctl "rx_copy_len".

 ixgbe_rxeof() has an optimization "RX_COPY" to reduce costs of
bus_dmamap_load_mbuf() and bus_dmamap_unload() by copying a mbuf cluster's
memory to a newly allocated mbuf's MH_databuf[] and recycle the original map.
The optimization is used when a length of a packet is smaller than a specific
value. The value is calculated based on MHLEN. The size of MHLEN is
architecture specific. It's 256 or 512. Make the threshold controllable by
adding a new sysctl.

Revision 1.285 / (download) - annotate - [select for diffs], Tue Jun 29 21:03:36 2021 UTC (2 years, 9 months ago) by pgoyette
Branch: MAIN
Changes since 1.284: +5 -4 lines
Diff to previous 1.284 (colored) to selected 1.137 (colored)

Rework the xxxVERBOSE option to share the common module-hook-based
verbose mechanism with MIIVERBOSE.  This reduces some duplicated code
and allows us to once again permit auto-unload of MIIVERBOSE.

Change details:
* Update dev/devlist2h.awk to accomodate miidevs, including generation
  of MII_STR_oui_model definitions and use of oui and model rather than
  vendor and product.  This also changes the compressed data in the
  xxxdevs_data.h files to uint32_t (since mii oui's are up to 6 hex
  digits long)
* Update a couple of phy drivers to use new calls to get verbose data
* Regen all of the xxxdevs{,_data}.h files (separate commit, coming
  very soon)
* Update mii/mii_verbose.[ch] and mii/mii_physubr.c to use the various
  DEV_VERBOSE_xxx macros
* Update the pci, usb, and hdaudio code as needed, to #include the
  xxxdevs.h files (in order to get the proper printf format strings)
* Since dev/dev_verbose.c now uses non-literal printf format strings,
  (to deal with the vendor/product vs oui/model issue), we need to
  make sure it gets compiled with -Wno-error=format-nonliteral, even
  in userland's libpci and librumpdev!
* Bump kernel version for the change in module interfaces

Welcome to 9.99.86!

XXX It might be useful in the future to extend the MII_STR_oui_model
XXX definitions to PCI as well (and perhaps USB and HDAUDIO).  This
XXX would allow for a single centralized location for the products'
XXX descriptions, rather than being dispersed among individual
XXX drivers' xxx_match tables.

Revision 1.284 / (download) - annotate - [select for diffs], Wed Jun 16 00:21:18 2021 UTC (2 years, 10 months ago) by riastradh
Branch: MAIN
Changes since 1.283: +3 -8 lines
Diff to previous 1.283 (colored) to selected 1.137 (colored)

if_attach and if_initialize cannot fail, don't test return value

These were originally made failable back in 2017 when if_initialize
allocated a softint in every interface for link state changes, so
that it could fail gracefully instead of panicking:

https://mail-index.NetBSD.org/source-changes/2017/10/23/msg089053.html

However, this spawned many seldom- or never-tested error branches,
which are risky to have around.  And that softint in every interface
has since been replaced by a single global workqueue, because link
state changes require thread context but not low latency or high
throughput:

https://mail-index.NetBSD.org/source-changes/2020/02/06/msg113759.html

So there is no longer any reason for if_initialize to fail.  (The
subroutine if_stats_init can't fail because percpu_alloc can't fail
either.)

There is a snag: the softint_establish in if_percpuq_create could
fail, potentially leading to bad consequences later on trying to use
the softint.  This change doesn't introduce any new bugs because of
the snag -- if_percpuq_attach was already broken.  However, the snag
can be better addressed without spawning error branches, either by
using a single softint or making softints less scarce.

(Separate commit will change the signatures of if_attach and
if_initialize to return void, scheduled to ride whatever is the next
convenient kernel bump.)

Patch and testing on amd64 and evbmips64-eb by maya@; commit message
soliloquy, and compile-testing on evbppc/i386/earmv7hf, by me.

Revision 1.283 / (download) - annotate - [select for diffs], Tue May 18 05:29:16 2021 UTC (2 years, 11 months ago) by msaitoh
Branch: MAIN
CVS Tags: cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1
Changes since 1.282: +9 -7 lines
Diff to previous 1.282 (colored) to selected 1.137 (colored)

- Cleanup an rxbuf entry when bus_dmamap_load_mbuf() failed to prevent panic.
- Print error number when error occurred.

Revision 1.282 / (download) - annotate - [select for diffs], Fri May 7 09:15:52 2021 UTC (2 years, 11 months ago) by msaitoh
Branch: MAIN
CVS Tags: cjep_staticlib_x-base
Branch point for: cjep_staticlib_x
Changes since 1.281: +4 -3 lines
Diff to previous 1.281 (colored) to selected 1.137 (colored)

 Print the error value of ixgbe_reset_hw() for debugging.

Revision 1.281 / (download) - annotate - [select for diffs], Fri Apr 30 06:55:32 2021 UTC (2 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.280: +4 -1 lines
Diff to previous 1.280 (colored) to selected 1.137 (colored)

 Add missing __KERNEL_RCSID().

Revision 1.280 / (download) - annotate - [select for diffs], Wed Mar 31 07:53:53 2021 UTC (3 years ago) by msaitoh
Branch: MAIN
CVS Tags: thorpej-futex-base, thorpej-cfargs-base
Branch point for: thorpej-i2c-spi-conf
Changes since 1.279: +51 -41 lines
Diff to previous 1.279 (colored) to selected 1.137 (colored)

KNF a bit. No functional change.

Revision 1.279 / (download) - annotate - [select for diffs], Tue Mar 9 10:03:18 2021 UTC (3 years, 1 month ago) by msaitoh
Branch: MAIN
Branch point for: thorpej-cfargs
Changes since 1.278: +11 -1 lines
Diff to previous 1.278 (colored) to selected 1.137 (colored)

Modify some parameters to reduce packet dropping.

 - Background: ixgbe doesn't use common MCLGET() interface and use the
   driver specific cluster allocation mechanism (jcl). The cluster is
   pre-allocated with a fixed number and the current number per queue
   is num_rx_desc * 2 (2048*2=4096). It's too small. It also has a problem
   that the max length of the pcq which is used in the TX path is big
   (4096). Example:

    100M <----- [ixg0                                      ixg1] <----- 1G
                2048 TX descs <--- 4096 pcqs <---- 2048 RX descs

   If a machine forwards a traffic from 1G interface to 100M interface,
   It would require 2048+4096+2048=8192 descriptors, but the current number
   is 2048*2=4096. It's too small. Even if the both interface's link speed
   is the same and only small number of packet is queued in the pcq, 4096
   jcl is small because 2048(RX)+TX(2048)=4096. If jcl is exhausted, not only
   forwarding from ixg1 to ixg0 is dropped, but also another forwarding path
   from ixg1 to another interface(e.g. wm0) is also dropped. Sockets also
   queue packets, so if a lot of sockets are used and/or a socket buffer
   size is changed to bigger one, it'll also become a problem. If the jcl
   is exhausted, evcnt(9) counter "ixgX qY Rx no jumbo mbuf" is incremented.
   Example:
     vmstat -ev | grep ixg1 | grep "no jumbo"
     ixg1 q0 Rx no jumbo mbuf                           0     0 misc
     ixg1 q1 Rx no jumbo mbuf                           0     0 misc
     ixg1 q2 Rx no jumbo mbuf                      141326     0 misc
     ixg1 q3 Rx no jumbo mbuf                           0     0 misc


 - To solve this problem:
   - Add new config parameter IXGBE_JCLNUM_MULTI and set the default to 3
     (2048 * 3). The minimum number is 2. The total number of jcl per queue
     is available with hw.ixgN.num_jcl_per_queue sysctl.
   - Reduce the max length of the pcq() which is used in the TX path from
     4096 to 2048.

 - Reviewed by knakahara@ and ozaki-r@.

 - TODO: Use MCLGET().

Revision 1.278 / (download) - annotate - [select for diffs], Thu Jan 14 05:47:35 2021 UTC (3 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.277: +2 -2 lines
Diff to previous 1.277 (colored) to selected 1.137 (colored)

 Add "TX " to "Queue No Descriptor Available" to make it more understandable.

Revision 1.277 / (download) - annotate - [select for diffs], Thu Dec 31 12:34:33 2020 UTC (3 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.276: +34 -136 lines
Diff to previous 1.276 (colored) to selected 1.137 (colored)

Reduce code duplication. No functional change.

   Add new ixgbe_intr_admin_common() and use it in both ixgbe_msix_admin()
  and ixgbe_legacy_irq().

Revision 1.276 / (download) - annotate - [select for diffs], Sat Dec 26 06:27:38 2020 UTC (3 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.275: +56 -1 lines
Diff to previous 1.275 (colored) to selected 1.137 (colored)

 Copy & paste some missing part (flow director, ECC and temp sensor) from
ixgbe_msix_admin() to ixgbe_legacy_irq(). Now it's ready to make a new
function to share the common part. It'll be done in near future.

Revision 1.275 / (download) - annotate - [select for diffs], Sat Dec 26 06:17:55 2020 UTC (3 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.274: +6 -7 lines
Diff to previous 1.274 (colored) to selected 1.137 (colored)

 Don't return in the middle of ixgbe_msix_admin() when an flow director reinit
failed. NetBSD currently doesn't support flow director, so this is not a real
bug.

Revision 1.274 / (download) - annotate - [select for diffs], Sat Dec 26 06:10:17 2020 UTC (3 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.273: +25 -6 lines
Diff to previous 1.273 (colored) to selected 1.137 (colored)

Disable some interrupt in ixgbe_{legacy_irq,msix_admin}() to prevent log spam.

Revision 1.273 / (download) - annotate - [select for diffs], Sat Dec 26 06:07:16 2020 UTC (3 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.272: +73 -42 lines
Diff to previous 1.272 (colored) to selected 1.137 (colored)

Disable/enable the OTHER interrupts correctly.

     The OTHER interrupt was not blocked correctly when MSI-X is used.
    ixgbe.c rev. 1.260 added new mutex to avoid the race but it didn't
    disable the interrupt itself.

     Calling ixgbe_enable_intr() enables all interrupts, so it's not good to
    call it when some interrupt sources should not be enabled (e.g.:
    calling ixgbe_enable_intr() in ixgbe_handle_admin() enables queue
    interrupt).

     IXGBE_REQUEST_TASK_NEED_ACKINTR doesn't work as expected because
    ixgbe_handle_admin() can't know which task is enqueued from the
    interrupt context and can't re-enable a specific EIMS bit.

     Solve the above three problems by the following two changes:

      - MSI-X: Disable the OTHER interrupts in the biginning of
        ixgbe_msix_admin().

      - Set mask bits correctly at the end of ixgbe_legacy_irq() and
        ixgbe_msix_admin() using with eim_orig, eims_enable and eims_disable.

      - Remove IXGBE_REQUEST_TASK_NEED_ACKINTR and add
        IXGBE_REQUEST_TASK_{MOD,MSF}_WOI.

Revision 1.272 / (download) - annotate - [select for diffs], Sat Dec 26 06:02:42 2020 UTC (3 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.271: +5 -4 lines
Diff to previous 1.271 (colored) to selected 1.137 (colored)

 Check EICR's queue bit instead of IFF_RUNNING. This change fixes a bug that
it might incorrectly enable interrupt when IFF_RUNNING is not set. It also
changes that the TX/RX is not processed if a queue interrupt isn't occurred.

Revision 1.271 / (download) - annotate - [select for diffs], Sat Dec 26 06:01:22 2020 UTC (3 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.270: +5 -14 lines
Diff to previous 1.270 (colored) to selected 1.137 (colored)


 Don't use "more" flag for simplify in ixgbe_legacy_irq().
No functional change intended.

Revision 1.270 / (download) - annotate - [select for diffs], Thu Dec 24 22:36:43 2020 UTC (3 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.269: +6 -8 lines
Diff to previous 1.269 (colored) to selected 1.137 (colored)

 Simplify setting of EIAC register. No functional change intended.

Revision 1.269 / (download) - annotate - [select for diffs], Thu Dec 24 18:32:53 2020 UTC (3 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.268: +8 -2 lines
Diff to previous 1.268 (colored) to selected 1.137 (colored)

 Fix a bug that INTx is disabled if the INTx line is shared with other device.
ixgbe.c rev. 1.264 was not correct.

     Restore EIMS before return. To read ECIR, clearing EIMC is required for
    an errata, so
        0) save the original EIMS value
        1) clear EIMS
	2) read EICR
	3) restore with the saved value.

Revision 1.268 / (download) - annotate - [select for diffs], Thu Dec 24 15:51:33 2020 UTC (3 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.267: +2 -5 lines
Diff to previous 1.267 (colored) to selected 1.137 (colored)

 The EICR register are cleared in the beginning of the ixgbe_legacy_irq(),
so it's not required to clear each bit later in the function.

Revision 1.267 / (download) - annotate - [select for diffs], Thu Dec 24 15:51:04 2020 UTC (3 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.266: +1 -10 lines
Diff to previous 1.266 (colored) to selected 1.137 (colored)

 The EICR register's all OTHER interrupt bits are cleared in the beginning of
the ixgbe_msix_admin(), so it's not required to clear each bit later in the
function.

Revision 1.266 / (download) - annotate - [select for diffs], Thu Dec 24 10:37:47 2020 UTC (3 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.265: +15 -15 lines
Diff to previous 1.265 (colored) to selected 1.137 (colored)

 Reorder some code to reduce diff between ixgbe_legacy_irq() and
ixgbe_msix_admin. No functional change intended.

Revision 1.265 / (download) - annotate - [select for diffs], Thu Dec 24 10:00:36 2020 UTC (3 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.264: +11 -6 lines
Diff to previous 1.264 (colored) to selected 1.137 (colored)

Add some debug printf()s and modify comments.

Revision 1.264 / (download) - annotate - [select for diffs], Thu Dec 24 06:14:41 2020 UTC (3 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.263: +1 -3 lines
Diff to previous 1.263 (colored) to selected 1.137 (colored)

 Remove strange ixgbe_enable_intr() in ixgbe_legacy_irq().

 If the interface is UP and the INTx line is shared with other devices,
it result in enabling all interrupt sources even if some of them are
disabled for the workqueue. Delete ixgbe_enable_intr() in ixgbe_legacy_irq().

Revision 1.263 / (download) - annotate - [select for diffs], Tue Dec 22 07:16:23 2020 UTC (3 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.262: +2 -2 lines
Diff to previous 1.262 (colored) to selected 1.137 (colored)

 Correctly ACK the fan failure interrupt in ixgbe_legacy_irq().

Revision 1.262 / (download) - annotate - [select for diffs], Fri Dec 11 05:01:19 2020 UTC (3 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.261: +7 -13 lines
Diff to previous 1.261 (colored) to selected 1.137 (colored)

 Don't use EIMC_OTHER bit because it's read only other than 82598.

 Documents say:

  82598:
     All of bit 31(OTHER bit) of EIxx are reserved. In reality, at least
    EIMS_OTHER and EIMC_OTHER exist and the OTHER interrupt doesn't work
    without EIMS_OTHER.

  Other than 82598:
     EIMS_OTHER is read only and EIMC_OTHER doesn't exist. If one of
    bit 29..16 is set, EIMS_OTHER is set to 1 (Note that bit 30(TCP timer
    isn't included)). Even if write bit 31 of EIMC to 1, it's ignored
    (EIMS_OTHER doesn't set).

 We introduced new spin mutex in ixgbe.c rev. 1.260, so it's OK to remove
EIMC_OTHER stuff. We already set EIMS_OTHER in if_init(), so keep it for
82598. No functional change other than 82598.

 Another solution is to control bit 30..16 directly to mask/unmask interrupt
instead of the mutex.

TODO:
  Some MSI-X interrupt(LSC, module insertion/removal etc.)'s mask/unmask
  code between ixgbe_msix_admin() and ixgbe_handle_admin() may be wrong.
  It'll be fixed later.

Revision 1.261 / (download) - annotate - [select for diffs], Mon Nov 30 07:53:42 2020 UTC (3 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.260: +14 -6 lines
Diff to previous 1.260 (colored) to selected 1.137 (colored)

 Apply ixgbe.c rev. 1.204 which was for ixgbe_msix_admin() to
ixgbe_legacy_irq(), too.

 >  An interrupt might not arrive when a module is inserted. When an link
 > status change interrupt occurred and the driver still regard SFP as
 > unplugged, issue the module softint before issuing LSC interrupt.

TODO: Reduce duplicated code.

Revision 1.260 / (download) - annotate - [select for diffs], Tue Nov 17 04:50:29 2020 UTC (3 years, 5 months ago) by knakahara
Branch: MAIN
Changes since 1.259: +55 -54 lines
Diff to previous 1.259 (colored) to selected 1.137 (colored)

Add new spin mutex to avoid race between ixgbe_msix_admin() and ixgbe_handle_admin().

At first, it seems "IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_EIMC_OTHER)"
cannot stop interrupts, because 31th bit is reserved for 82598, 82599,
X540 and X550.  So, the current following design
    (1) ixgbe_msix_admin() disables interrupts
    (2) ixgbe_msix_admin() calls workqueue_enqueue() for ixgbe_handle_admin()
    (3) ixgbe_handle_admin() does interrupt processing
    (4) after ixgbe_handle_admin() has done all interrupt processings,
        ixgbe_handle_admin() enables interrupts
does not work correctly, that is, interrupts can be lost while
ixgbe_handle_admin() is running.

To fix that, add new spin mutex(adapter->admmin_mtx) which protects
atomically the following two members.
    - adapter->admin_pending
    - adapter->task_requests

The unnecessary "IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_EIMC_OTHER)"
code will be removed later.

Reviewed and tested by hikaru@n.o and msaitoh@n.o, thanks.

Revision 1.259 / (download) - annotate - [select for diffs], Fri Nov 13 05:53:36 2020 UTC (3 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.258: +3 -3 lines
Diff to previous 1.258 (colored) to selected 1.137 (colored)

 Fix a bug that some advertise speeds can't be set with hw.ixgN.advertise_speed
if both 2.5G and 5G are set. Fix the error message, too.

Revision 1.258 / (download) - annotate - [select for diffs], Mon Sep 7 09:14:53 2020 UTC (3 years, 7 months ago) by knakahara
Branch: MAIN
Branch point for: thorpej-futex
Changes since 1.257: +8 -2 lines
Diff to previous 1.257 (colored) to selected 1.137 (colored)

Fix race between ixgbe_msix_admin() and ixgbe_handle_admin(), pointed out by ozaki-r@n.o.

The race is caused by the following.
CPU#A processes workqueue, CPU#B processes admin interrupt.
    (0) one of CPUs already calls ixgbe_schedule_admin_tasklet()
        such as ixgbe_handle_timer()
    (1) CPU#A: read adapter->task_requests
    (2) CPU#B: set adapter->task_requests
    (3) CPU#B: read(and try to set) adapter->admin_pending
               but adapter->admin_pending is set, so does not
               call workqueue_enqueue()
    (4) CPU#A: clear adapter->admin_pending
that is, the tasks set by (2) is not processed as missfire workqueue by (3).

Revision 1.257 / (download) - annotate - [select for diffs], Mon Sep 7 05:50:58 2020 UTC (3 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.256: +16 -10 lines
Diff to previous 1.256 (colored) to selected 1.137 (colored)

- Remove extra callout_stop() in ixgbe_detach(). Found by knakahara@.
- Rename ix{gbe,v}_free_workqueue() to ix{gbe,v}_free_deferred_handlers().
- Add KASSERT() to functions who are called from ixgbe_handle_admin().

Revision 1.256 / (download) - annotate - [select for diffs], Mon Sep 7 04:15:12 2020 UTC (3 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.255: +3 -3 lines
Diff to previous 1.255 (colored) to selected 1.137 (colored)

__predict_false() should be __predict_true() for adapter->osdep.detaching
== false check.

Revision 1.255 / (download) - annotate - [select for diffs], Mon Sep 7 03:57:27 2020 UTC (3 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.254: +6 -4 lines
Diff to previous 1.254 (colored) to selected 1.137 (colored)

 Don't schedule admin work while shutdown like the recovery mode timer.

 The admin workqueue also runs while !IFF_UP like the recovery mode timer.
Apply the same change of ixgbe.c 1.254 to ixgbe_schedule_admin_tasklet()
to prevent panic. Found by ozaki-r@.

Revision 1.254 / (download) - annotate - [select for diffs], Tue Sep 1 04:19:16 2020 UTC (3 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.253: +9 -5 lines
Diff to previous 1.253 (colored) to selected 1.137 (colored)

 Fix a panic on shutdown on a machine which use the recovery mode timer.

 The recovery mode timer is first issued by the callout and it schedule
the workqueue. The workqueue then reschedule the callout. It's hard to
stop both of them without race only with callout_stop() and workqueue_wait.
To solve this problem. add new "detaching" flag and use it.

 The situation is almost the same as schedule_wqs_ok for the local_timer's
callout and workqueue, but the difference is that the local_timer isn't
required to run if the interface is not up. If it's not important to prevent
running timer while !IFF_UP, the flag can be integrated into one.

Revision 1.253 / (download) - annotate - [select for diffs], Tue Sep 1 04:06:56 2020 UTC (3 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.252: +9 -14 lines
Diff to previous 1.252 (colored) to selected 1.137 (colored)

 Call ixgbe_ifstop() instead of ixgbe_stop_locked() in
ixgbe_setup_low_power_mode() to stop the timer workqueue.

Revision 1.252 / (download) - annotate - [select for diffs], Mon Aug 31 14:12:50 2020 UTC (3 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.251: +16 -15 lines
Diff to previous 1.251 (colored) to selected 1.137 (colored)

 Rename ix{gbe,v}_stop() with ix{gbe,v}_stop_locked(). No functional change.

Revision 1.251 / (download) - annotate - [select for diffs], Mon Aug 31 11:19:54 2020 UTC (3 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.250: +7 -55 lines
Diff to previous 1.250 (colored) to selected 1.137 (colored)

If an SFP+ module is not inserted, don't try to access SFP+ EEPROM.
This change eliminate long timeout.

 Reduce code duplication using with ixgbe_sfp_cage_full(hw).

Revision 1.250 / (download) - annotate - [select for diffs], Mon Aug 31 06:23:19 2020 UTC (3 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.249: +3 -3 lines
Diff to previous 1.249 (colored) to selected 1.137 (colored)

 Fix typo in comment.

Revision 1.249 / (download) - annotate - [select for diffs], Mon Aug 31 06:20:06 2020 UTC (3 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.248: +39 -9 lines
Diff to previous 1.248 (colored) to selected 1.137 (colored)

 Fix 82598 SFP+ problems.

 On 82598, SFP+'s MOD_ABS isn't connected to the MAC's GPIO pin, so we can't
call ixgbe_sfp_cage_full(). Always issue TASK_MOD from ixgbe_handle_timer()
on 82598.

 Fix ixgbe_identify_sfp_module_generic() for ixgbe_phy_nl. In the driver,
hw->phy.type sometimes be compared with ixgbe_phy_nl.
In ixgbe_identify_sfp_module_generic(), hw->phy.type may be overridden with
another value. For ixgbe_phy_nl, some code don't override phy.type but others
were not. Make it consistently keep ixgbe_phy_nl. This change fixes a problem
that ixgbe_is_sfp() change the return value true to false when any SFP+
devices are connected to the cage on 82598 and never recover from it.

 Don't schedule MSF(multi speed fiber) task from ixgbe_handle_mod() on 82598.
This task is only for devices which support multi speed fiber and 82598
doesn't support it. Before ixgbe.c rev. 1.237, ixgbe_handle_mod() isn't
called on 82598 because 82598 has no SFP+ module insertion/removal interrupt.
ixgbe.c rev. 1.237 changed to call the function via timer on 82598.
This change fixes a bug that 82598 DA interface's link flaps.

Revision 1.248 / (download) - annotate - [select for diffs], Thu Aug 27 04:54:43 2020 UTC (3 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.247: +20 -13 lines
Diff to previous 1.247 (colored) to selected 1.137 (colored)

Limit MA10-ST0's quirk only for on-chip devices.

Revision 1.247 / (download) - annotate - [select for diffs], Thu Aug 27 04:49:52 2020 UTC (3 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.246: +2 -2 lines
Diff to previous 1.246 (colored) to selected 1.137 (colored)

 Fix compile error.

Revision 1.246 / (download) - annotate - [select for diffs], Thu Aug 27 03:57:52 2020 UTC (3 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.245: +2 -2 lines
Diff to previous 1.245 (colored) to selected 1.137 (colored)

Minor change.

 - Print "X550EM X" instead of "X550EM" for Xeon D devices.
 - Fix typo in comment. Same as FreeBSD.

Revision 1.245 / (download) - annotate - [select for diffs], Thu Aug 27 00:07:56 2020 UTC (3 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.244: +33 -5 lines
Diff to previous 1.244 (colored) to selected 1.137 (colored)

 ADD SFP+ MOD_ABS inversion quirk.

 On X550 EM, GPIO(SDP) and SFP+'s MOD_ABS is directly connected. It has
no inverter. GIGABYTE MA10-ST0 has a inverter, so add new quirk for it.

Revision 1.244 / (download) - annotate - [select for diffs], Mon Aug 24 19:03:27 2020 UTC (3 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.243: +4 -2 lines
Diff to previous 1.243 (colored) to selected 1.137 (colored)

 Fix handling of IXGBE_REQUEST_TASK_NEED_ACKINTR again...

Revision 1.243 / (download) - annotate - [select for diffs], Mon Aug 24 18:42:17 2020 UTC (3 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.242: +5 -8 lines
Diff to previous 1.242 (colored) to selected 1.137 (colored)

 The admin workqueue can be used even if the interface is not up.
OK'd by thorpej@. Will fixes PR#55534 reported by Shinichi Doyashiki

Revision 1.242 / (download) - annotate - [select for diffs], Mon Aug 24 18:31:14 2020 UTC (3 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.241: +13 -2 lines
Diff to previous 1.241 (colored) to selected 1.137 (colored)

 Fix ixgbe_sfp_cage_full() on X550EM_A.

In ixgbe_handle_mod():

		switch (hw->mac.type) {
		case ixgbe_mac_82599EB:
			cage_full = IXGBE_READ_REG(hw, IXGBE_ESDP) &
			    IXGBE_ESDP_SDP2;
			break;
		case ixgbe_mac_X550EM_x:
		case ixgbe_mac_X550EM_a:
			cage_full = IXGBE_READ_REG(hw, IXGBE_ESDP) &
			    IXGBE_ESDP_SDP0;
			break;
		default:
			break;
		}

so I had thought that IXGBE_ESDP_SDP0 bit is 1 on cage is full.
In reality, at least, X550EM_A's SFP+ cage is 0 on cage is full.
So invert the logic of ixgbe_sfp_cage_full() on X550EM_A

Revision 1.241 / (download) - annotate - [select for diffs], Mon Aug 24 18:21:59 2020 UTC (3 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.240: +20 -14 lines
Diff to previous 1.240 (colored) to selected 1.137 (colored)

 Fix race in ixgbe_detach() to prevent panic on shutdown.

Revision 1.240 / (download) - annotate - [select for diffs], Mon Aug 24 18:16:04 2020 UTC (3 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.239: +4 -2 lines
Diff to previous 1.239 (colored) to selected 1.137 (colored)

 Fix handling of IXGBE_REQUEST_TASK_NEED_ACKINTR in ixgbe_handle_admin().

Revision 1.239 / (download) - annotate - [select for diffs], Mon Aug 17 08:23:30 2020 UTC (3 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.238: +6 -8 lines
Diff to previous 1.238 (colored) to selected 1.137 (colored)

 Simplify SFP+ check. No functional change.

Revision 1.238 / (download) - annotate - [select for diffs], Mon Aug 17 07:59:06 2020 UTC (3 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.237: +12 -7 lines
Diff to previous 1.237 (colored) to selected 1.137 (colored)

 Re-enabling interrupt is required only when a work is scheduled form the
interrput context.

Revision 1.237 / (download) - annotate - [select for diffs], Mon Aug 17 07:26:55 2020 UTC (3 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.236: +27 -39 lines
Diff to previous 1.236 (colored) to selected 1.137 (colored)

Fix a bug that the driver sometimes missed module insertion.

 The ixgbe_sfp_probe() function was only for 82598 and other chips had no
way to poll SFP+ cage. The ixgbe_handle_mod() already has function to treat
module insertion/removal for all chips, so enqueue the work if the cage
status changed. All of ixgbe chips' SFP+ module interrupt is only on the
inserstion. This change also detect the removal by the timer.

Revision 1.236 / (download) - annotate - [select for diffs], Mon Aug 17 06:30:25 2020 UTC (3 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.235: +8 -1 lines
Diff to previous 1.235 (colored) to selected 1.137 (colored)

 Add missing workqueue_wait() for the recovery_mode_timer workqueue.

Revision 1.235 / (download) - annotate - [select for diffs], Thu Aug 13 08:42:18 2020 UTC (3 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.234: +3 -1 lines
Diff to previous 1.234 (colored) to selected 1.137 (colored)

 Set recovery_mode_timer workqueue's name correctly.

Revision 1.234 / (download) - annotate - [select for diffs], Thu Aug 13 08:38:50 2020 UTC (3 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.233: +11 -15 lines
Diff to previous 1.233 (colored) to selected 1.137 (colored)

 Use atomic_cas_uint() and atomic_store_relaxed(). Advised by thorpej@.
Tested by me. OK'd by knakahara.

Revision 1.233 / (download) - annotate - [select for diffs], Thu Jun 25 07:53:01 2020 UTC (3 years, 9 months ago) by msaitoh
Branch: MAIN
Changes since 1.232: +236 -170 lines
Diff to previous 1.232 (colored) to selected 1.137 (colored)

Reduce ixgbe's busy loop using with workqueue and kpause.

- Use workqueue instead of softint to make some functions sleepable.
- Use new workqueue and enqueue it in ixgbe_local_timer() and
  ixgbe_recovery_mode_timer() to make them sleepable.
- Make new ixgbe_delay() and use it. This functions sleeps if the time is
  more than equals 1 tick. If it's not, do delay().

Revision 1.232 / (download) - annotate - [select for diffs], Thu Jun 18 09:00:11 2020 UTC (3 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.231: +5 -5 lines
Diff to previous 1.231 (colored) to selected 1.137 (colored)

Modify a liitle to reduce diff between ixgbe.c and ixv.c. No functional change.

Revision 1.231 / (download) - annotate - [select for diffs], Wed Jun 17 09:11:13 2020 UTC (3 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.230: +9 -2 lines
Diff to previous 1.230 (colored) to selected 1.137 (colored)

Add missing callout_stop() for recovery_mode_timer.

NOTE: One of the difference between the local_timer and recovery_mode_timer
is that local_timer runs only when IFF_UP and recovery_mode_timer always runs
(it's enabled on attach).

Revision 1.230 / (download) - annotate - [select for diffs], Fri Jun 12 09:28:48 2020 UTC (3 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.229: +5 -7 lines
Diff to previous 1.229 (colored) to selected 1.137 (colored)

-  Remove extra kpreempt_disable() -> kpreempt_enable() because
  ixgbe_handle_msf() was changed from softint to workqueue.
- Set schedule_wqs_ok before enabling interrupt to prevent the race.
- Fix comment.

Revision 1.229 / (download) - annotate - [select for diffs], Thu Jun 11 09:16:05 2020 UTC (3 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.228: +12 -12 lines
Diff to previous 1.228 (colored) to selected 1.137 (colored)

 Fix typo. No functional change.

Revision 1.228 / (download) - annotate - [select for diffs], Fri Apr 17 02:21:25 2020 UTC (4 years ago) by msaitoh
Branch: MAIN
CVS Tags: phil-wifi-20200421, bouyer-xenpvh-base2, bouyer-xenpvh-base1
Changes since 1.227: +2 -2 lines
Diff to previous 1.227 (colored) to selected 1.137 (colored)

No functional change:
 - modify comment
 - whitespace fix

Revision 1.227 / (download) - annotate - [select for diffs], Sun Mar 15 23:04:50 2020 UTC (4 years, 1 month ago) by thorpej
Branch: MAIN
CVS Tags: phil-wifi-20200411, phil-wifi-20200406, bouyer-xenpvh-base
Branch point for: bouyer-xenpvh
Changes since 1.226: +3 -11 lines
Diff to previous 1.226 (colored) to selected 1.137 (colored)

Define and implement a locking protocol for the ifmedia / mii layers:
- MP-safe drivers provide a mutex to ifmedia that is used to serialize
  access to media-related structures / hardware regsiters.  Converted
  drivers use the new ifmedia_init_with_lock() function for this.  The
  new name is provided to ease the transition.
- Un-converted drivers continue to call ifmedia_init(), which will supply
  a compatibility lock to be used instead.  Several media-related entry
  points must be aware of this compatibility lock, and are able to acquire
  it recursively a limited number of times, if needed.  This is a SPIN
  mutex with priority IPL_NET.
- This same lock is used to serialize access to PHY registers and other
  MII-related data structures.

The PHY drivers are modified to acquire and release the lock, as needed,
and assert the lock is held as a diagnostic aid.

The "usbnet" framework has had an overhaul of its internal locking
protocols to fit in with the media / mii changes, and the drivers adapted.

USB wifi drivers have been changed to provide their own adaptive mutex
to the ifmedia later via a new ieee80211_media_init_with_lock() function.
This is required because the USB drivers need an adaptive mutex.

Besised "usbnet", a few other drivers are converted: vmx, wm, ixgbe / ixv.

mcx also now calls ifmedia_init_with_lock() because it needs to also use
an adaptive mutex.  The mcx driver still needs to be fully converted to
NET_MPSAFE.

Revision 1.226 / (download) - annotate - [select for diffs], Thu Feb 6 06:28:49 2020 UTC (4 years, 2 months ago) by thorpej
Branch: MAIN
CVS Tags: is-mlppp-base, is-mlppp, ad-namecache-base3
Changes since 1.225: +19 -12 lines
Diff to previous 1.225 (colored) to selected 1.137 (colored)

Ensure we don't call workqueue_enqueue() if the pluggable optics
handler is already pending.

Revision 1.225 / (download) - annotate - [select for diffs], Wed Feb 5 07:45:46 2020 UTC (4 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.224: +3 -1 lines
Diff to previous 1.224 (colored) to selected 1.137 (colored)

No functional change:

 - Add debug printf()s.
 - Remove unused macros.
 - Remove extra newline.

Revision 1.224 / (download) - annotate - [select for diffs], Wed Feb 5 01:44:53 2020 UTC (4 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.223: +4 -8 lines
Diff to previous 1.223 (colored) to selected 1.137 (colored)

 Update comment in ixgbe_update_stats_counters() to clarify why we update
if_iqdrops and if_ierrors only. No functional change.
OK'd by knakahara and thorpej.

Revision 1.223 / (download) - annotate - [select for diffs], Tue Feb 4 19:42:55 2020 UTC (4 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.222: +52 -14 lines
Diff to previous 1.222 (colored) to selected 1.137 (colored)

- Fix locking problem with optics module interrupts: ifmedia_add()
  may block on memory allocation, and so it cannot be safely done from
  a softint nor can it be done while holding a spin lock.  Fix this by
  using a workqueue rather than a softint, and hold the IFNET_LOCK
  across the entire handler, and the CORE_LOCK only across the code that
  needs to serialize access to the hardware state.
- Use ifmedia_fini().

Tested in a variety of devices by msaitoh@.  (Thanks!)

Revision 1.222 / (download) - annotate - [select for diffs], Sat Feb 1 12:55:22 2020 UTC (4 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.221: +6 -4 lines
Diff to previous 1.221 (colored) to selected 1.137 (colored)

Adopt <net/if_stats.h>.

XXX This driver needs some work in this regard (practually no
stats are reported).

Revision 1.221 / (download) - annotate - [select for diffs], Tue Jan 21 14:55:55 2020 UTC (4 years, 2 months ago) by msaitoh
Branch: MAIN
CVS Tags: ad-namecache-base2
Changes since 1.220: +4 -14 lines
Diff to previous 1.220 (colored) to selected 1.137 (colored)

 Fix the freeing code for some error paths. Found and tested by Patrick Welche.

Revision 1.220 / (download) - annotate - [select for diffs], Fri Jan 3 12:59:46 2020 UTC (4 years, 3 months ago) by pgoyette
Branch: MAIN
CVS Tags: ad-namecache-base1, ad-namecache-base
Branch point for: ad-namecache
Changes since 1.219: +2 -2 lines
Diff to previous 1.219 (colored) to selected 1.137 (colored)

Fix some typos in comments.

From vezhlys on freenode IRC.

Revision 1.219 / (download) - annotate - [select for diffs], Mon Dec 23 09:36:17 2019 UTC (4 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.218: +51 -32 lines
Diff to previous 1.218 (colored) to selected 1.137 (colored)

Add recovery code for unsupported SFP+.

Before this commit:
   If an unsuppored SFP module is inserted before booting, the driver attach
   failed and there was no way to recover form it without rebooting or
   detaching/reattaching drvier (drvctl -d && drvctl -r pciN).
After this commit:
   We can automatically recover any time by replacing it with a supported
   module.

Revision 1.218 / (download) - annotate - [select for diffs], Mon Dec 23 09:19:40 2019 UTC (4 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.217: +7 -4 lines
Diff to previous 1.217 (colored) to selected 1.137 (colored)

 Add missing core lock in ixgbe_handle_mod().

Revision 1.217 / (download) - annotate - [select for diffs], Tue Dec 17 05:49:01 2019 UTC (4 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.216: +2 -2 lines
Diff to previous 1.216 (colored) to selected 1.137 (colored)

 Use bus_space_barrier() instead of x86 specific *fence instruction.
Written by riastradh@.

Revision 1.216 / (download) - annotate - [select for diffs], Mon Nov 18 03:17:51 2019 UTC (4 years, 5 months ago) by msaitoh
Branch: MAIN
CVS Tags: phil-wifi-20191119
Changes since 1.215: +3 -1 lines
Diff to previous 1.215 (colored) to selected 1.137 (colored)

 Print MAC address.

 XXX Should we move such type of printf() to ether_ifattach?

Revision 1.215 / (download) - annotate - [select for diffs], Sun Nov 10 21:16:36 2019 UTC (4 years, 5 months ago) by chs
Branch: MAIN
Changes since 1.214: +2 -7 lines
Diff to previous 1.214 (colored) to selected 1.137 (colored)

in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.

Revision 1.214 / (download) - annotate - [select for diffs], Wed Oct 16 04:07:42 2019 UTC (4 years, 6 months ago) by msaitoh
Branch: MAIN
Changes since 1.213: +2 -4 lines
Diff to previous 1.213 (colored) to selected 1.137 (colored)

Apply FreeBSD r353599:

 > ixgbe: Disable EEE for backplane X550EM_X
 >
 > From Zach:
 > Intel documentation indicates that backplane X550EM_X KR devices do not
 > support Energy Efficient Ethernet. Prior to this patch, X552 devices
 > (device ID 0x15AB) will crash the system when transitioning EEE state
 > via sysctl.
 >
 > Signed-off-by: Zach Vargas <zvargas@xes-inc.com>
 >
 > PR:		240320
 > Submitted by:	Zach Vargas <zvargas@xes-inc.com>
 > Reviewed by:	erj@
 > MFC after:	3 days
 > Differential Revision:	https://reviews.freebsd.org/D21673

Revision 1.213 / (download) - annotate - [select for diffs], Wed Sep 18 10:42:44 2019 UTC (4 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.212: +10 -10 lines
Diff to previous 1.212 (colored) to selected 1.137 (colored)

s/ixgbe_set_multi/ixgbe_set_rxfilter/. No functional change.

Revision 1.212 / (download) - annotate - [select for diffs], Wed Sep 18 06:06:59 2019 UTC (4 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.211: +5 -49 lines
Diff to previous 1.211 (colored) to selected 1.137 (colored)

 Remove ixgbe_set_promisc() and use ixgbe_set_multi() to reduce code
duplication.

Revision 1.211 / (download) - annotate - [select for diffs], Wed Sep 18 05:32:15 2019 UTC (4 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.210: +6 -4 lines
Diff to previous 1.210 (colored) to selected 1.137 (colored)

 Fix a bug that the multicast filter isn't correctly initialized when
the total number of the Ethernet multicast addresses is just 128.
 Changing "<" with "<=" fixes this problem, but it's better to check
ETHER_F_ALLMULTI than it because it's straightforward.

Revision 1.210 / (download) - annotate - [select for diffs], Fri Sep 13 07:55:07 2019 UTC (4 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.209: +3 -2 lines
Diff to previous 1.209 (colored) to selected 1.137 (colored)

 if_flags is neither int nor short. It's unsigned short.

Revision 1.209 / (download) - annotate - [select for diffs], Thu Sep 5 08:06:51 2019 UTC (4 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.208: +4 -3 lines
Diff to previous 1.208 (colored) to selected 1.137 (colored)

 Fix a bug that MBSDC (Bad SFD Count) isn't counted on X550EM_X and X550EM_A.
The register is for X550 and newer.

Revision 1.208 / (download) - annotate - [select for diffs], Wed Sep 4 08:13:43 2019 UTC (4 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.207: +2 -3 lines
Diff to previous 1.207 (colored) to selected 1.137 (colored)

 Set IFM_1000_BX10 correctly.

Revision 1.207 / (download) - annotate - [select for diffs], Wed Sep 4 07:29:34 2019 UTC (4 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.206: +3 -2 lines
Diff to previous 1.206 (colored) to selected 1.137 (colored)

 printf -> device_printf

Revision 1.206 / (download) - annotate - [select for diffs], Thu Aug 29 09:45:22 2019 UTC (4 years, 7 months ago) by knakahara
Branch: MAIN
Changes since 1.205: +17 -3 lines
Diff to previous 1.205 (colored) to selected 1.137 (colored)

Fix panic when ncpu == 1 && sysctl -w hw.ixg0.txrx_workqueue=1. Reported by nonaka@n.o.

ok by msaitoh@n.o and nonaka@n.o

pullup-8, pullup-9

Revision 1.205 / (download) - annotate - [select for diffs], Thu Aug 29 09:35:18 2019 UTC (4 years, 7 months ago) by knakahara
Branch: MAIN
Changes since 1.204: +2 -2 lines
Diff to previous 1.204 (colored) to selected 1.137 (colored)

fix typo in error handling of ixgbe_allocate_legacy().

ok by msaitoh@n.o

pullup-8, pullup-9

Revision 1.204 / (download) - annotate - [select for diffs], Wed Aug 28 08:54:21 2019 UTC (4 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.203: +29 -21 lines
Diff to previous 1.203 (colored) to selected 1.137 (colored)

 An interrupt might not arrive when a module is inserted. When an link status
change interrupt occurred and the driver still regard SFP as unplugged, link
becomes up and the real media type is unknown. e.g:

 % ifconfig -m ixg0
 (snip)
         media: Ethernet autoselect (autoselect rxpause,txpause)
         status: active
         supported Ethernet media:
                 media none
                 media autoselect
 (snip)

To resolve this problem, when an link status change interrupt occurred and the
driver still regard SFP as unplugged, issue the module softint before issuing
LSC interrupt.

Revision 1.203 / (download) - annotate - [select for diffs], Wed Aug 28 08:23:35 2019 UTC (4 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.202: +3 -6 lines
Diff to previous 1.202 (colored) to selected 1.137 (colored)

X550EM supports QSFP, so check ixgbe_media_type_fiber_qsfp too.

Revision 1.202 / (download) - annotate - [select for diffs], Wed Aug 21 10:01:53 2019 UTC (4 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.201: +7 -15 lines
Diff to previous 1.201 (colored) to selected 1.137 (colored)

Simplify ix{gbe,v}_[un]register_vlan() API suggestesd by knakahara.

 The API was the same as FreeBSD's pre-iflib's. They use iflib now and it's
not required for us to keep the old API.

Revision 1.201 / (download) - annotate - [select for diffs], Wed Aug 21 06:00:07 2019 UTC (4 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.200: +3 -3 lines
Diff to previous 1.200 (colored) to selected 1.137 (colored)

 Use ETHER_LOCK()/ETHER_UNLOCK() suggested by knakahara.

Revision 1.200 / (download) - annotate - [select for diffs], Tue Aug 20 04:11:22 2019 UTC (4 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.199: +50 -16 lines
Diff to previous 1.199 (colored) to selected 1.137 (colored)

 Fix a bug that VLAN HW "tagging" enable/disable may not refrect correctly.

  - Always call ec_vlan_cb() if it exists.
  - Some (or all?) ethernet drivers don't enable HW tagging if no any vlan is
    attached. ixgbe is one of them. Check the the transition and update
    VLAN HW tagging function.

XXX pullup-9

Revision 1.199 / (download) - annotate - [select for diffs], Tue Jul 30 08:44:28 2019 UTC (4 years, 8 months ago) by msaitoh
Branch: MAIN
CVS Tags: netbsd-9-base
Branch point for: netbsd-9
Changes since 1.198: +8 -7 lines
Diff to previous 1.198 (colored) to selected 1.137 (colored)

 ixgbe_setup_low_power_mode() calls ixgbe_stop() in it. ixgbe_detach() first
called ixgbe_stop() and then called ixgbe_setup_low_power_mode() which resulted
in calling ixgbe_stop() twice. Call only ixgbe_setup_low_power_mode() first to
remove extra ixgbe_stop() call.

Revision 1.198 / (download) - annotate - [select for diffs], Fri Jul 26 04:08:39 2019 UTC (4 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.197: +3 -3 lines
Diff to previous 1.197 (colored) to selected 1.137 (colored)

 Set IVAR (Interrupt Vector Allocation Register) correctly for 82598 in
ixgbe_set_ivar(). Found by KUBSan.

Revision 1.197 / (download) - annotate - [select for diffs], Fri Jul 26 03:28:13 2019 UTC (4 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.196: +3 -3 lines
Diff to previous 1.196 (colored) to selected 1.137 (colored)

 Simplify code. No functional change intended.

Revision 1.196 / (download) - annotate - [select for diffs], Thu Jul 25 09:28:07 2019 UTC (4 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.195: +2 -2 lines
Diff to previous 1.195 (colored) to selected 1.137 (colored)

 Fix VLAN hardware filter initialization. Use unsigned. Found by KUBSan.

Revision 1.195 / (download) - annotate - [select for diffs], Thu Jul 25 09:01:56 2019 UTC (4 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.194: +3 -3 lines
Diff to previous 1.194 (colored) to selected 1.137 (colored)

 Fix VLAN filter setting. Found by KUBSan.

Revision 1.194 / (download) - annotate - [select for diffs], Wed Jul 24 06:07:57 2019 UTC (4 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.193: +7 -7 lines
Diff to previous 1.193 (colored) to selected 1.137 (colored)

Fix some problems found by KUBSan:
- Set TQSM and RQSM (TX/RX queue statistics mapping) correctly.
- Set IVAR (Interrupt Vector Allocation Register) correctly in
  ixgbe_set_ivar().
- Define IXGBE_KRM_LINK_CTRL_1_TETH_AN_RESTART correctly. This macro is used
  in ixgbe_restart_an_internal_phy_x550em().
- Define IXGBE_KRM_TX_COEFF_CTRL_1_OVRRD_EN correctly. This macro is used
  in ixgbe_setup_ixfi_x550em_x().
- Define IXGBE_SB_IOSF_CTRL_BUSY correctly. This macro is used in
  ixgbe_iosf_wait() (X550EM only).

Revision 1.193 / (download) - annotate - [select for diffs], Wed Jul 17 03:26:24 2019 UTC (4 years, 9 months ago) by msaitoh
Branch: MAIN
Changes since 1.192: +73 -24 lines
Diff to previous 1.192 (colored) to selected 1.137 (colored)

 Implement VLAN hardware filter function(ETHERCAP_VLAN_HWFILTER).
First proposed by jmcneill in 2017 and modified by me.

How to use:

 - Set callback function:

	ether_set_vlan_cb(struct ethercom *, ether_vlancb_t)

 - Callback. This function is called when a vlan is attached/detached to the
   parent interface:

	int (*ether_vlancb_t)(struct ethercom *ec, uint16_t vlanid, bool set);

 - ifconfig(8)

	ifconfig ixg0 [-]vlan-hwfilter

 Note that ETHERCAP_VLAN_HWFILTER is set by default on ixg(4) because
the PF driver usually enable "all block" filter by default.

Revision 1.192 / (download) - annotate - [select for diffs], Thu Jul 4 09:02:24 2019 UTC (4 years, 9 months ago) by msaitoh
Branch: MAIN
Changes since 1.191: +8 -6 lines
Diff to previous 1.191 (colored) to selected 1.137 (colored)

 On ENETRESET case, not continue and quit the ifflags_cb() function because
if_init() will do the same thing.

Revision 1.191 / (download) - annotate - [select for diffs], Tue Jul 2 08:38:48 2019 UTC (4 years, 9 months ago) by msaitoh
Branch: MAIN
Changes since 1.190: +2 -2 lines
Diff to previous 1.190 (colored) to selected 1.137 (colored)

Sync with FreeBSD ix-3.3.10 part 2:
- Calculate vector's bit location correctly when the vector >= 31
  in ixgbe_allocate_msix().

Revision 1.190 / (download) - annotate - [select for diffs], Tue Jul 2 08:32:18 2019 UTC (4 years, 9 months ago) by msaitoh
Branch: MAIN
Changes since 1.189: +6 -6 lines
Diff to previous 1.189 (colored) to selected 1.137 (colored)

Sync with FreeBSD ix-3.3.10 part 1. No functional change in this part:
 - "(u64)1" -> "1ULL"
 - Add some not-yet-used register definitions.

Revision 1.189 / (download) - annotate - [select for diffs], Thu Jun 27 05:55:40 2019 UTC (4 years, 9 months ago) by msaitoh
Branch: MAIN
Changes since 1.188: +3 -3 lines
Diff to previous 1.188 (colored) to selected 1.137 (colored)

Sync with FreeBSD ix-3.3.8 part 1. No functional change in this part:
 - Move ixgbe_toggle_txdctl() to ixgbe_common.c and modify a bit.
   No functional change because this function is currently used for SR-IOV
   and it's not used in NetBSD.
 - Some modification to match the latest netmap API.
 - Modify ixgbe_hic_unlocked(). No functional change because neither
   IXGBE_HOST_INTERFACE_APPLY_UPDATE_CMD(0x38) nor
   IXGBE_HOST_INTERFACE_SHADOW_RAM_READ_CMD(0x31) are used.
 - Add ixgbe_clear_mbx(). No functional change because this function is not
   used yet.
 - Add some not-yet-used register definitions.
 - Whitespace fixes.

Revision 1.188 / (download) - annotate - [select for diffs], Tue Jun 4 09:43:15 2019 UTC (4 years, 10 months ago) by msaitoh
Branch: MAIN
CVS Tags: phil-wifi-20190609
Changes since 1.187: +7 -1 lines
Diff to previous 1.187 (colored) to selected 1.137 (colored)

Match the follwing devices:

 82598_BX	(0x1508)
 82599_KR	(0x1517)
 82599_SFP_EM	(0x1507)
 X550EM_X_XFI	(0x15b0)
 X550EM_A_QSFP	(0x15ca)
 X550EM_A_QSFP_N(0x15cc)

Revision 1.187 / (download) - annotate - [select for diffs], Wed May 29 10:07:30 2019 UTC (4 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.186: +2 -4 lines
Diff to previous 1.186 (colored) to selected 1.137 (colored)

Even if we don't use MII(4), use the common path of SIOC[GS]IFMEDIA in
sys/net/if_ethersubr.c if we can.
 - Add ec_ifmedia into struct ethercom.
 - ec_mii in struct ethercom is kept and used as it is. It might be used in
   future. Note that some Ethernet drivers which _DOESN'T_ use mii(4) use
   ec_mii for keeping the if_media. Those should be changed in future.

Revision 1.186 / (download) - annotate - [select for diffs], Thu May 23 13:10:52 2019 UTC (4 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.185: +198 -198 lines
Diff to previous 1.185 (colored) to selected 1.137 (colored)

 Whitespace fix (mainly tabify).

Revision 1.185 / (download) - annotate - [select for diffs], Thu May 23 10:57:28 2019 UTC (4 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.184: +26 -26 lines
Diff to previous 1.184 (colored) to selected 1.137 (colored)

-No functional change:
  - KNF
  - u_int*_t -> uint*_t.

Revision 1.184 / (download) - annotate - [select for diffs], Fri May 17 07:39:33 2019 UTC (4 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.183: +1 -24 lines
Diff to previous 1.183 (colored) to selected 1.137 (colored)

 Use new media types.

Revision 1.183 / (download) - annotate - [select for diffs], Wed May 15 02:56:47 2019 UTC (4 years, 11 months ago) by ozaki-r
Branch: MAIN
Changes since 1.182: +9 -9 lines
Diff to previous 1.182 (colored) to selected 1.137 (colored)

Store IFF_ALLMULTI in ec_flags instead of if_flags to avoid data races

IFF_ALLMULTI is set/unset to if_flags via if_mcast_op.  To avoid data races on
if_flags, IFNET_LOCK was added for if_mcast_op.  Unfortunately it produces
a deadlock so we want to remove added IFNET_LOCK by avoiding the data races by
another approach.

This fix introduces ec_flags to struct ethercom and stores IFF_ALLMULTI to it.
ec_flags is protected by ETHER_LOCK and thus IFNET_LOCK is no longer necessary
for if_mcast_op.  Note that the fix is applied only to MP-safe drivers that
the data races matter.

In the kernel, IFF_ALLMULTI is set by a driver and used by the driver itself.
So changing the storing place doesn't break anything.  One exception is
ioctl(SIOCGIFFLAGS); we have to include IFF_ALLMULTI in a result if needed to
export the flag as well as before.

A upcoming commit will remove IFNET_LOCK.

PR kern/54189

Revision 1.182 / (download) - annotate - [select for diffs], Tue May 14 09:43:55 2019 UTC (4 years, 11 months ago) by ozaki-r
Branch: MAIN
Changes since 1.181: +2 -2 lines
Diff to previous 1.181 (colored) to selected 1.137 (colored)

Remove unnecessary checks of IFF_ALLMULTI

IFF_ALLMULTI is changed by only driver itself, so we don't need to check its
change on ec_ifflags_cb.

This is part of PR kern/54189. NFCI.

Revision 1.181 / (download) - annotate - [select for diffs], Mon May 13 05:04:17 2019 UTC (4 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.180: +4 -5 lines
Diff to previous 1.180 (colored) to selected 1.137 (colored)

 Fix a bug that manual setting of 10GBASE-SR or 10GBASE-CX4 didn't work
if IFM_ETH_XTYPE was set. We don't use IFM_ETH_XTYPE macro, so this was not a
real bug.

Revision 1.180 / (download) - annotate - [select for diffs], Fri May 10 02:56:08 2019 UTC (4 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.179: +2 -2 lines
Diff to previous 1.179 (colored) to selected 1.137 (colored)

 Fix typo. This code is not used yet.

Revision 1.179 / (download) - annotate - [select for diffs], Mon Mar 18 11:38:03 2019 UTC (5 years, 1 month ago) by msaitoh
Branch: MAIN
CVS Tags: isaki-audio2-base, isaki-audio2
Changes since 1.178: +2 -2 lines
Diff to previous 1.178 (colored) to selected 1.137 (colored)

 s/pakcet/packet/ in comment.

Revision 1.178 / (download) - annotate - [select for diffs], Fri Mar 15 02:38:20 2019 UTC (5 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.177: +6 -4 lines
Diff to previous 1.177 (colored) to selected 1.137 (colored)

- Simplily. Suggested by knakahara.
- Modify comment. Per queue VLAN enable flags is on 82599 and later.
- Fix typo in comment.

Revision 1.177 / (download) - annotate - [select for diffs], Wed Mar 13 10:02:13 2019 UTC (5 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.176: +27 -23 lines
Diff to previous 1.176 (colored) to selected 1.137 (colored)

- Fix a bug that the VLAN HW tagging function is not correctly disabled
  when all vlan is detached.
- Fix a bug that VLAN HW tagging function is not correctly controlled on 82598.
- Control VLAN HW filter function correctly.
- Don't clear IXGBE_VLNCTRL_CFIEN bit When ETHERCAP_VLAN_HWFILTER is set.
  I think it's not required (and Linux doesn't do it). This change has no
  effect to NetBSD because ETHERCAP_VLAN_HWFILTER is not supported yet.

Revision 1.176 / (download) - annotate - [select for diffs], Tue Mar 5 10:26:08 2019 UTC (5 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.175: +9 -9 lines
Diff to previous 1.175 (colored) to selected 1.137 (colored)

 It's not required to calculate unused queues' statistics.

Revision 1.175 / (download) - annotate - [select for diffs], Tue Mar 5 09:42:36 2019 UTC (5 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.174: +6 -6 lines
Diff to previous 1.174 (colored) to selected 1.137 (colored)

 NetBSD currently uses traffic class 0 only. Other traffic classes aren't used
yet. When IXGBE_TC_COUNTER_NUM is set to lower than IXGBE_DCB_MAX_TRAFFIC_CLASS
(e.g. 1), other traffic classes' counters are not used. It means we don't
generate evcnt for them and don't add the values in
ixgbe_update_stats_counters().

Revision 1.174 / (download) - annotate - [select for diffs], Fri Feb 22 06:49:15 2019 UTC (5 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.173: +13 -8 lines
Diff to previous 1.173 (colored) to selected 1.137 (colored)

 Fix a bug that if_link_state_change(ifp, LINK_STATE_DOWN) isn't called unless
link goes up at least one time. Without this change, never linkup-ed media
keeps LINK_STATE_UNKNOWN instead of LINK_STATE_DOWN.

Revision 1.173 / (download) - annotate - [select for diffs], Wed Jan 23 09:47:52 2019 UTC (5 years, 2 months ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-compat-20190127
Changes since 1.172: +11 -5 lines
Diff to previous 1.172 (colored) to selected 1.137 (colored)

- Move the location of calling setup_eee() in ixgbe_attach(). The previous
  location was too early. The new location is before calling
  ixgbe_set_phy_power().
- Restore call of setup_eee() in ixgbe_init_locked(). It was removed in
  rev. 1.99 (FreeBSD r320688).
- When calling setup_eee(), pass enable/disable correctly.

Revision 1.172 / (download) - annotate - [select for diffs], Wed Jan 23 09:01:24 2019 UTC (5 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.171: +4 -4 lines
Diff to previous 1.171 (colored) to selected 1.137 (colored)

 Call ixgbe_init_swfw_semaphore(hw) before calling ixgbe_check_wol_support()
because ixgbe_check_wol_support()->ixgbe_check_wol_support()->
ixgbe_get_device_caps() accesses semaphore.

Revision 1.171 / (download) - annotate - [select for diffs], Wed Jan 23 06:56:19 2019 UTC (5 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.170: +11 -2 lines
Diff to previous 1.170 (colored) to selected 1.137 (colored)

 Nowadays some UEFI BIOSes don't enable some PCI devices' address decoding.
To resolve this problem, pci_map.c rev. 1.34-1.36 changed the
pci_mapreg_(sub)map()'s to set the decode bit if it's not set. It's good for
almost all drivers, but some other drivers don't use pci_mapreg_map().
In drivers which don't use pci_mapreg_map(), some of them expilicitly enable
decoding but others don't. Add code to enable decoding to them.

 See also the following discussion:
	http://mail-index.netbsd.org/tech-kern/2017/03/22/msg021678.html

Revision 1.170 / (download) - annotate - [select for diffs], Sat Dec 8 14:57:11 2018 UTC (5 years, 4 months ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-compat-20190118, pgoyette-compat-1226
Changes since 1.169: +3 -2 lines
Diff to previous 1.169 (colored) to selected 1.137 (colored)

 Don't call callout_halt() if it's not initialzied.

Revision 1.169 / (download) - annotate - [select for diffs], Thu Dec 6 13:25:02 2018 UTC (5 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.168: +159 -8 lines
Diff to previous 1.168 (colored) to selected 1.137 (colored)

 Apply FreeBSD ix-3.3.6.tar.gz's change to NetBSD. Tested on C3000 and X550-T1,
but not tested on Xeon D:
- Add firmware recovery mode for X550, X550A(Xeon D) and X550EM (C3000):
  - FreeBSD always set IXGBE_FEATURE_RECOVERY_MODE without checking the
    NVM image version. We compare it against 2.0 to not to make new callout and
    not to call extra atomic operations.
  - In some FreeBSD's sysctl functions, atomic_load_acq_int() is called
    before a null pointer check. We call it after null pointer check.
  - Before calling atomic_load_acq_uint(), check adapter->feat_en flags
    to save atomic operation call.
  - We don't check recovery_mode in ixgbe_set_sysctl_value() because this
    function doesn't touch any hardware register.
  - NetBSD don't have FreeBSD's atomic_load_acq_int()-like function, so do it
    with membar_sync(). Thanks riastradh@ for the advice.
- FreeBSD's ix-3.3.6 changed ixgbe_enable_aim from TRUE to FALSE, but we will
  keep it as TRUE because we have already fixed some bugs.
- Remove IXGBE_DEV_ID_82599_LS(0x154f) support again. I don't know why. This
  was added in ix-3.2.18.tar.gz(NetBSD: ixgbe_82599.c rev. 1.20) and removed in
  ix-3.3.6.tar.gz.
- On X550EMU, use ixgbe_identify_sfp_module_X550em() instead of
  ixgbe_identify_module_generic(). ixgbe_identify_sfp_module_X550em() has
  extra check (e.g. exclude 1G copper).
- if_sriov.c's change doesn't affect to NetBSD because we don't support
  SR-IOV PF function.

Revision 1.168 / (download) - annotate - [select for diffs], Mon Dec 3 04:39:44 2018 UTC (5 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.167: +86 -70 lines
Diff to previous 1.167 (colored) to selected 1.137 (colored)

 Some counters are not per queue but per traffic class. Make new evcnt group
"ixgM tcN" (N = 0..7) and move those counters into it. We are using only
traffic class 0, so we will see only tc0's counter are updated.

Revision 1.167 / (download) - annotate - [select for diffs], Thu Sep 27 05:40:27 2018 UTC (5 years, 6 months ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930
Changes since 1.166: +2 -3 lines
Diff to previous 1.166 (colored) to selected 1.137 (colored)

 Don't set LRO capability flags because we don't support it yet.
This doesn't change any behavior other than if_capabilities' visibility
(e.g. ifconfig).

Revision 1.166 / (download) - annotate - [select for diffs], Fri Sep 14 09:51:09 2018 UTC (5 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.165: +4 -4 lines
Diff to previous 1.165 (colored) to selected 1.137 (colored)

- Fix a bug that Denverton accessed wrong register in
  ixgbe_setup_low_power_mode(). The location of some registers in Denverton
  were changed. The GRC register is one of them, so use IXGBE_GRC_BY_MAC(hw)
  instead of IXGBE_GRC.
- ixgbe_check_wol_support() tests the capability of WOL, but the sysctl
  knobs for WOL were added only for IXGBE_DEV_ID_X550EM_X_10G_T. Add the
  knobs when adapter->wol_support is not 0.

XXX pullup-8

Revision 1.165 / (download) - annotate - [select for diffs], Mon Sep 3 16:29:33 2018 UTC (5 years, 7 months ago) by riastradh
Branch: MAIN
CVS Tags: pgoyette-compat-0906
Changes since 1.164: +6 -6 lines
Diff to previous 1.164 (colored) to selected 1.137 (colored)

Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int.  The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER!  Some subsystems have

	#define min(a, b)	((a) < (b) ? (a) : (b))
	#define max(a, b)	((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX.  Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate.  But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all.  (Who knows, maybe in some cases integer
truncation is actually intended!)

Revision 1.164 / (download) - annotate - [select for diffs], Wed Aug 29 09:03:14 2018 UTC (5 years, 7 months ago) by msaitoh
Branch: MAIN
CVS Tags: jdolecek-ncqfixes-base, jdolecek-ncqfixes
Changes since 1.163: +5 -1 lines
Diff to previous 1.163 (colored) to selected 1.137 (colored)

 Fix a bug that media change may fail. I noticed that ifconfig ixgN media XXX
took a 10 or more seconds on a Denverton machie. I occurred by trying take a
lock and timed out. The reason was that ixgbe_media_change() didn't take
CORE_LOCK. Do it.

 This problem was from FreeBSD's pre-iflib ixgbe (I don't know whether this
problem really occurs on FreeBSD or not). Post-iflib ixgbe has no problem
because iflib_media_change() takes a lock.

XXX pullup-8

Revision 1.163 / (download) - annotate - [select for diffs], Fri Jul 6 02:36:35 2018 UTC (5 years, 9 months ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-compat-0728
Changes since 1.162: +10 -1 lines
Diff to previous 1.162 (colored) to selected 1.137 (colored)

 Add force_10_100_autonego sysctl. The default vaule is 0(false).
This sysctl is only for 550EM_a with PHY firmware for a while.

Revision 1.162 / (download) - annotate - [select for diffs], Tue Jul 3 04:02:06 2018 UTC (5 years, 9 months ago) by msaitoh
Branch: MAIN
Changes since 1.161: +1 -20 lines
Diff to previous 1.161 (colored) to selected 1.137 (colored)

 Remove nmbclusters check. We don't use the mbuf cluster. The old code also had
a bug that ixgbe_total_ports adds two every port and never decrement in
the detach path. Found by hikaru@.

 The code was removed in FreeBSD when it switched to use iflib and OpenBSD
removed the code 8 years ago.

Revision 1.161 / (download) - annotate - [select for diffs], Wed Jun 6 20:02:31 2018 UTC (5 years, 10 months ago) by kamil
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-0625
Branch point for: phil-wifi
Changes since 1.160: +5 -1 lines
Diff to previous 1.160 (colored) to selected 1.137 (colored)

Comment out unused functions in order to fix Clang build

ixv_rearm_queues() and ixgbe_rearm_queues() are unused.

Sponsored by <The NetBSD Foundation>

Revision 1.160 / (download) - annotate - [select for diffs], Mon Jun 4 02:42:23 2018 UTC (5 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.159: +4 -2 lines
Diff to previous 1.159 (colored) to selected 1.137 (colored)

 Don't call ixgbe_rearm_queues() in ixgbe_local_timer1().

   ixgbe_enable_queue() and ixgbe_disable_queue() try to enable/disable queue
  interrupt safely. It has the internal counter. When a queue's MSI-X is
  received, ixgbe_msix_que() is called (IPL_NET). This function disable the
  queue's interrupt by ixgbe_disable_queue() and issues an softint.
  ixgbe_handle() queue is called by the softint (IPL_SOFTNET), process TX, RX
  and call ixgbe_enable_queue() at the end.

   ixgbe_local_timer1() is a callout and run always on CPU 0 (IPL_SOFTCLOCK).
  When ixgbe_rearm_queues() called, an MSI-X interrupt is issued for a specific
  queue. It may not CPU 0. If this interrupt's ixgbe_msix_que() is called and
  sofint_schedule() is called before the last sofint's softint_execute() is not
  called, the softint_schedule() fails because of SOFTINT_PENDING. It result
  in breaking ixgbe_{enable,disable}_queue()'s internal counter.

   ixgbe_local_timer1() is written not to call ixgbe_rearm_queues() if
  the interrupt is disabled, but it's called because of unknown bug or a race.
  One solution to avoid this problem is to not to use the internal counter,
  but it's little difficult. Another solution is stop using
  ixgbe_rearm_queues() at all. Essentially, ixgbe_rearm_queues() is not
  required (it was added in ixgbe.c rev. 1.43 (2016/12/01)).
  ixgbe_rearm_queues() helps for lost interrupt problem but I've never seen it
  other than ixgbe_rearm_queues() problem.

XXX pullup-8.

Revision 1.159 / (download) - annotate - [select for diffs], Sun Jun 3 10:24:24 2018 UTC (5 years, 10 months ago) by maxv
Branch: MAIN
Changes since 1.158: +7 -7 lines
Diff to previous 1.158 (colored) to selected 1.137 (colored)

Constify several variables in ixgbe/ so that they land in .rodata (1038
bytes).

Revision 1.158 / (download) - annotate - [select for diffs], Wed May 30 09:17:17 2018 UTC (5 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.157: +117 -1 lines
Diff to previous 1.157 (colored) to selected 1.137 (colored)

 Add hw.ixgN.debug sysctl. "sysctl -w hw.ixgN.debug=1" dumps some registers
to console.

Revision 1.157 / (download) - annotate - [select for diffs], Wed May 30 08:35:26 2018 UTC (5 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.156: +4 -1 lines
Diff to previous 1.156 (colored) to selected 1.137 (colored)

 Clear que->disabled_count in {ixgbe,ixv}_init_locked(). Without this,
interrupt mask state and EIMS may mismatch and if_init doesn't recover
from TX/RX stall problem.

 This change itself doesn't fix PR#53294.

Revision 1.156 / (download) - annotate - [select for diffs], Fri May 25 04:40:27 2018 UTC (5 years, 10 months ago) by ozaki-r
Branch: MAIN
Changes since 1.155: +3 -2 lines
Diff to previous 1.155 (colored) to selected 1.137 (colored)

Ensure to call if_register after interface initializations finish

Revision 1.155 / (download) - annotate - [select for diffs], Wed May 23 10:11:07 2018 UTC (5 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.154: +3 -1 lines
Diff to previous 1.154 (colored) to selected 1.137 (colored)

 Add "bool txr_no_space" for TX descriptor shortage. Use it like IFF_OACTIVE.

Revision 1.154 / (download) - annotate - [select for diffs], Wed May 23 04:37:13 2018 UTC (5 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.153: +31 -1 lines
Diff to previous 1.153 (colored) to selected 1.137 (colored)

 Add rxd_nxck (Receive Descriptor next to check) read only sysctl.

Revision 1.153 / (download) - annotate - [select for diffs], Fri May 18 10:09:02 2018 UTC (5 years, 11 months ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-compat-0521
Changes since 1.152: +54 -92 lines
Diff to previous 1.152 (colored) to selected 1.137 (colored)

 Revert new watchdog timer commits. The new watchdog timer made stability
worse than before. It seems unknown problems exists.

http://mail-index.netbsd.org/source-changes/2018/05/08/msg095020.html
http://mail-index.netbsd.org/source-changes/2018/05/16/msg095240.html

Revision 1.152 / (download) - annotate - [select for diffs], Tue May 15 09:30:56 2018 UTC (5 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.151: +18 -16 lines
Diff to previous 1.151 (colored) to selected 1.137 (colored)

 The TQSMR register is not for receiving but for transmitting, so move the
initialization from ixgbe_initialize_receive_units() to
ixgbe_initialize_transmit_units(). No functional change.

Revision 1.151 / (download) - annotate - [select for diffs], Thu May 10 03:15:28 2018 UTC (5 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.150: +44 -12 lines
Diff to previous 1.150 (colored) to selected 1.137 (colored)

Count some register correctly:
- QPRDC register is only for 82599 and newer.
- Count IXGBE_QPRDC, PX{ON,OFF}{T,R}XC[NT].

Revision 1.150 / (download) - annotate - [select for diffs], Tue May 8 09:45:54 2018 UTC (5 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.149: +92 -54 lines
Diff to previous 1.149 (colored) to selected 1.137 (colored)

- Fix broken watchdog timer. This change detects TX device timeout correctly.
  NOTE: It's supporsed not to be called {ixgbe,ixv}_rearm_queues() in the
  timer. Those are not required if any chip have no bug. In reality,
  ixgbe_rearm_queues() is required on 82599 and newer chip AND other than
  queue 0 to prevent device timeout. When it occured, packet was sent but the
  descriptor's DD bit wasn't set even though IXGBE_TXD_CMD_EOP and
  IXGBE_TXD_CMD_RS were set. After forcing interrupt by writing EICS register
  in ixgbe_rearm_queues(), DD is set. Why? Is this an undocumented errata? It
  might be possible not call rearm_queues on 82598 or queue 0, we call in any
  cases in case the problem occurs. On ixv(4), I have not seen this problem yet
  (though I tested only on X550_X(Xeon D 12xx)'s virtual function), but we
  do rearm in case TX device timeout happen.
- ixv(4): Call callout_stop() earlier in ixv_stop() like ixgbe_stop().
- KNF.

Revision 1.149 / (download) - annotate - [select for diffs], Thu Apr 19 07:40:12 2018 UTC (6 years ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-compat-0502, pgoyette-compat-0422
Changes since 1.148: +8 -9 lines
Diff to previous 1.148 (colored) to selected 1.137 (colored)

 Use ixgbe_eitr_write() when writing the EITR for the link interrupt like
queue's EITR to write the register safely. This change is not relatively
so important than queue's EITR because link's EITR is written in if_init().

Revision 1.148 / (download) - annotate - [select for diffs], Tue Apr 17 08:38:05 2018 UTC (6 years ago) by msaitoh
Branch: MAIN
Changes since 1.147: +1 -2 lines
Diff to previous 1.147 (colored) to selected 1.137 (colored)

 Remove unused structure entries. No functional change.

Revision 1.147 / (download) - annotate - [select for diffs], Tue Apr 17 05:23:58 2018 UTC (6 years ago) by knakahara
Branch: MAIN
Changes since 1.146: +23 -2 lines
Diff to previous 1.146 (colored) to selected 1.137 (colored)

Fix panic when "sysctl -w hw.ixg0.txrx_workqueue=[01]" while there is traffic.

The operation is not supported, however causing panic is problem.

Revision 1.146 / (download) - annotate - [select for diffs], Thu Apr 12 08:03:55 2018 UTC (6 years ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-compat-0415
Changes since 1.145: +3 -2 lines
Diff to previous 1.145 (colored) to selected 1.137 (colored)

Read sc_if_flags after taking core lock. Same as if_wm.c rev. 1.418.

Revision 1.145 / (download) - annotate - [select for diffs], Wed Apr 4 08:59:22 2018 UTC (6 years ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-compat-0407
Changes since 1.144: +3 -3 lines
Diff to previous 1.144 (colored) to selected 1.137 (colored)

Sync with FreeBSD r331224 except ixv_if_update_admin_status()'s change:
 - Fix length of reading buffer when the command is Read Flash in
   ixgbe_host_interface_command().
 - Add missing start_hw() call in ixv_init_locked(). This is not a real bug
   because start_hw just set hw->adapter_stopped to false and anyone refer it.
 - Style change.
 - Update comment.

Revision 1.144 / (download) - annotate - [select for diffs], Wed Apr 4 08:13:07 2018 UTC (6 years ago) by msaitoh
Branch: MAIN
Changes since 1.143: +33 -36 lines
Diff to previous 1.143 (colored) to selected 1.137 (colored)

Sync with the remaining part of FreeBSD r328265 except sfp_reinit stuff:
 - Always schedule module intterrupt in ixgbe_config_link() when a device is
   SFP+ based.
 - Use not loop index but txr->me in ixv_initialize_{transmit,receive}_units().
   It's required for VMDQ but NetBSD doesn't use it, so it's not a bug in
   NetBSD.
 - Simplify ixgbe_bp_wd_set(). No functional change.
 - Whitespace.

Revision 1.143 / (download) - annotate - [select for diffs], Wed Apr 4 06:30:09 2018 UTC (6 years ago) by msaitoh
Branch: MAIN
Changes since 1.142: +10 -2 lines
Diff to previous 1.142 (colored) to selected 1.137 (colored)

Fix a bug that "ifconfig ixgN down up" forgot IFM_NONE setting.
 - Don't assume autoneg == 0 is the first call of ixgbe_config_link().
   Check ifm_media, too.
 - Don't override autoneg_advertised in ixgbe_get_phy_id_fw() to not to
   be inconsistent with if_media value.

Revision 1.142 / (download) - annotate - [select for diffs], Mon Apr 2 10:51:35 2018 UTC (6 years ago) by msaitoh
Branch: MAIN
Changes since 1.141: +6 -2 lines
Diff to previous 1.141 (colored) to selected 1.137 (colored)

 Fix long standing bug that 82598 SFP+ panics in ixgbe_handle_mod() because
hw->mac.ops.setup_sfp is NULL. This change is a part of FreeBSD r327031.

Revision 1.141 / (download) - annotate - [select for diffs], Mon Apr 2 05:02:55 2018 UTC (6 years ago) by knakahara
Branch: MAIN
Changes since 1.140: +2 -1 lines
Diff to previous 1.140 (colored) to selected 1.137 (colored)

Avoid issues caused by sending old packets at next link-up time.

This modification consists by the following two parts.
    - drain packets in if_snd queue or corresponding txr->txr_interq
      when link_active == false in ifp->if_start(), ifp->if_transmit(),
      and deferred Tx processing
    - drain packets in if_snd queue and all of txr->txr_interq's
      at link-down time

ok by msaitoh@n.o.

Revision 1.140 / (download) - annotate - [select for diffs], Fri Mar 30 06:44:30 2018 UTC (6 years ago) by msaitoh
Branch: MAIN
Changes since 1.139: +5 -1 lines
Diff to previous 1.139 (colored) to selected 1.137 (colored)

-  Add missing IFM_NONE support. If a interface support linkdown,
  "ifconfig ixgN media none" drpos link.  Not all interface can do link down.

 Tested:
 	82598 AT2 (T)
	92599 SF+(SFI) (X520-DA2)
	X540
	X550-T1
	X550EM_x (X10SDV-8C-TLN4F)
	X550EM_a (A2SDi-H-TP4F port 0, 1 (T))

 Doesn't work:
	X550EM_a (A2SDi-H-TP4F port 2, 3 (SFP+ (KR)))
	X550EM_a (MA10-ST0 port 2, 3 (SFP+ (SFI)))
	(Denverton SFP+ can't force link down because SFP+'s TX_DISABLE pin is
	pull down. Is there a way to shutdown SFP+ cage's power?)
 Not tested:
 	82598 fiber.

- Change some functions static.

Revision 1.139 / (download) - annotate - [select for diffs], Fri Mar 30 03:58:20 2018 UTC (6 years ago) by knakahara
Branch: MAIN
CVS Tags: pgoyette-compat-0330
Changes since 1.138: +52 -17 lines
Diff to previous 1.138 (colored) to selected 1.137 (colored)

Don't write EIMC directly. It is required to manage with struct ix_queue status.

XXX pullup-8

Revision 1.138 / (download) - annotate - [select for diffs], Fri Mar 30 03:56:38 2018 UTC (6 years ago) by knakahara
Branch: MAIN
Changes since 1.137: +16 -1 lines
Diff to previous 1.137 (colored)

Fix the problem between eitr and link_speed.

In ixgbe_msix_que(), que->eitr_setting is limited to IXGBE_MIN_RSC_EITR_10G1G
when link_speed is 1Gbps or 10Gbps. However, que->eitr_setting is set to EITR
register in the *next* Tx/Rx interrupt. If link_speed changes from 100Mbps to
1Gbps ro 10Gbps, que->eitr_setting which is not limited can be set to EITR
register, that is, the problem fixed by ixgbe.c:r1.124 can occur in this case.

To fix this case, que->eitr_setting should be clear when link_speed is changed
or link state is changed.

Furthermore, expand the variants used for AIM (txr->bytes, txr->packets,
rxr->bytes and rxr->packets) from u32 to u64 to avoid wraparound which causes
que->eitr_setting calculation mistake.

XXX pullup-8

Revision 1.137 / (download) - annotate - [selected], Mon Mar 26 06:40:28 2018 UTC (6 years ago) by msaitoh
Branch: MAIN
Changes since 1.136: +22 -3 lines
Diff to previous 1.136 (colored)

- Add link related softint's counter.
- Fix indent.

Revision 1.136 / (download) - annotate - [select for diffs], Tue Mar 20 09:46:25 2018 UTC (6 years, 1 month ago) by knakahara
Branch: MAIN
CVS Tags: pgoyette-compat-0322
Changes since 1.135: +7 -1 lines
Diff to previous 1.135 (colored) to selected 1.137 (colored)

Fix race about writing adapter->link_active for ixg(4).

adapter->link_active is updated by ixgbe_update_link_status() only.
The function is called from the following four functions.
    - ixgbe_media_status()
    - ixgbe_local_timer1()
    - ixgbe_stop()
    - ixgbe_handle_link()

The functions other than ixgbe_handle_link() call ixgbe_update_link_status()
with holding IXGBE_CORE_LOCK, however ixgbe_handle_link() calls it without
holding IXGBE_CORE_LOCK. That can cause race. So, add IXGBE_CORE_LOCK to
ixgbe_handle_link().

Tested by msaitoh@n.o and me.

Revision 1.135 / (download) - annotate - [select for diffs], Thu Mar 15 06:48:51 2018 UTC (6 years, 1 month ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-compat-0315
Changes since 1.134: +11 -16 lines
Diff to previous 1.134 (colored) to selected 1.137 (colored)

 Add some changes from ix-3.2.17.tar.gz and r328265. Not fully synchronized.
Some others (e.g. sfp cage interrupt and bypass adapter  stuff) will be merged
later:
- Initialize firmware command buffer correctly in ixgbe_read_ee_hostif_X550()
  and ixgbe_read_ee_hostif_buffer_X550(). These functions are used when reading
  NVM.
- Fix a bug that ixgbe_mng_present() misunderstand management capability on
  X550 and newer on some environment. X550 changed FWSM bit definition.
  See X540 document and X550's document and compare them.
- Fix checksum calculation in ixgbe_set_fw_drv_ver_generic(). This function is
  not used in NetBSD.
- Add some unused funtions.
- Whitespace fix.

Revision 1.134 / (download) - annotate - [select for diffs], Fri Mar 9 06:27:53 2018 UTC (6 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.133: +39 -4 lines
Diff to previous 1.133 (colored) to selected 1.137 (colored)

 Make some event counters MP safe. Now all of the event counters are
MP safe.

Revision 1.133 / (download) - annotate - [select for diffs], Thu Mar 8 02:41:27 2018 UTC (6 years, 1 month ago) by knakahara
Branch: MAIN
Changes since 1.132: +36 -45 lines
Diff to previous 1.132 (colored) to selected 1.137 (colored)

Reduce duplicated code which schedule deferred packet processing. No functional change.

Revision 1.132 / (download) - annotate - [select for diffs], Thu Mar 8 02:39:42 2018 UTC (6 years, 1 month ago) by knakahara
Branch: MAIN
Changes since 1.131: +11 -2 lines
Diff to previous 1.131 (colored) to selected 1.137 (colored)

Fix INTx/MSI handler did not schedule workqueue. Pointed out by msaitoh@n.o.

Revision 1.131 / (download) - annotate - [select for diffs], Wed Mar 7 11:18:29 2018 UTC (6 years, 1 month ago) by knakahara
Branch: MAIN
Changes since 1.130: +9 -2 lines
Diff to previous 1.130 (colored) to selected 1.137 (colored)

Fix another poll mode assumption breaking. Implemented by msaitoh@n.o, I just commit by proxy.

ixgbe_rearm_queues() writes EICS register(s). 82599, X540 and X550
specifications say "Following a write of 1b to any bit in the EICS register
(interrupt cause set), its corresponding bit in the EIMS register is auto
set as well enabling its interrupt." in "Extended Interrupt Auto Mask Enable
(EIAM) Register" section. That is, ixgbe_rearm_queues() causes interrupts
regardless of the status managed by ixgbe_enable_queue()/ixgbe_disable_queue().
That can break poll mode assumption.

In fact, the problem occurs in the following situation
    - CPU#A has high load traffic, in contrast, CPU#B has not so high load traffic
    - CPU#A is occurred interrupt by its NIC queue
      - CPU#A calls ixgbe_disable_queue() in interrupt handler(ixgbe_msix_que())
      - CPU#A kick softint handler(ixgbe_handle_que())
        - CPU#A begins softint
        - CPU#A's NIC queue is set que->txr->busy flag
        - With some reason, CPU#A can do ixg interrupt handler
          E.g. when one of CPU#A's softnet handlers sleeps, ipl is lowered
    - CPU#B starts callout
      - CPU#B calls ixgbe_local_timer1()
        - CPU#B writes EICS bit corresponding CPU#A's NIC queue bit
    - CPU#A's NIC queue causes interrupt whie CPU#A is running in poll mode
      - CPU#A calls ixgbe_disable_queue() in interrupt handler *again*
    - CPU#A has done polling, and then CPU#A calls ixgbe_enable_queue() *once*
    - CPU#A's NIC queue interrupt is disabled until ixg is detached as
      ixgbe_disable_queue() is called twice though ixgbe_disable_queue() is
      called once only

NOTE:
82598 does not say so, but it is treated in the same way because of no harm.

By the way, we will refactor ixgbe_local_timer(watchdog processing) later.

XXX pullup-8

Revision 1.130 / (download) - annotate - [select for diffs], Wed Mar 7 08:01:32 2018 UTC (6 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.129: +1 -2 lines
Diff to previous 1.129 (colored) to selected 1.137 (colored)

 Don't increment que->req.ev_count in MSI-X interrupt because it's not
reschedule.

Revision 1.129 / (download) - annotate - [select for diffs], Wed Mar 7 03:29:10 2018 UTC (6 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.128: +16 -21 lines
Diff to previous 1.128 (colored) to selected 1.137 (colored)

- Make "Handled queue in softint" and "Requeued in softint" evcnt(9) per queue
  and count them correctly.
- Remove #if 0'ed code.

Revision 1.128 / (download) - annotate - [select for diffs], Fri Mar 2 10:19:20 2018 UTC (6 years, 1 month ago) by knakahara
Branch: MAIN
CVS Tags: pgoyette-compat-base
Branch point for: pgoyette-compat
Changes since 1.127: +92 -8 lines
Diff to previous 1.127 (colored) to selected 1.137 (colored)

ixg(4) supports workqueue poll mode, but not enabled by default yet. (that is, the default behavior is *not* changed)

At the time of high load near the wire rate, the turnaround time
of update/delete processing such as "ifconfig ixg0 inet XXX" or
"ifconfig ixg0 delete" is very long. The main reason is CPU
starvation caused by ixg(4)'s softint poll mode. ixg(4) uses
workqueue poll mode instead of softint poll mode, so that this
problem will be fix.

This change may cause performance issues, so it is not enabled
by default yet. Although there are that issues, if you want to use
workqueue poll mode, do "sysctl -w hw.ixgXX.txrx_workqueue=1" while
there is no traffic on the ixgXX.

ok by msaitoh@n.o.

Revision 1.127 / (download) - annotate - [select for diffs], Mon Feb 26 04:19:00 2018 UTC (6 years, 1 month ago) by knakahara
Branch: MAIN
Changes since 1.126: +28 -8 lines
Diff to previous 1.126 (colored) to selected 1.137 (colored)

Fix poll mode assumption breaking.

ixgbe_{enable,disable}_intr() forcibly enable/disable all interrupts
regardless of current state. That can break poll mode assumption,
that is, queue interrupts must not occur while polling Tx/Rx rings.

E.g. "ifconfig ixg0 delete && ifconfig ixg0 192.168.0.1" on heavy
load traffic can causes this issue.

This fix may have 1% or 2% performance impact at short packets.

XXX
ixgbe_rearm_queues() which is called only via watchdog can also break
this poll mode assumption because writing EICS casues interrupts
immediately when interrupt auto mask enabled.
We will fix it with other issues about watchdog later.

ok by msaitoh@n.o.

Revision 1.126 / (download) - annotate - [select for diffs], Thu Feb 22 10:02:08 2018 UTC (6 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.125: +2 -2 lines
Diff to previous 1.125 (colored) to selected 1.137 (colored)

 Fix a potential bug that TX/RX might stall when TX rate limit reached.
This change is almost the same as the RX rate limit bug fix in ixgbe.c
rev. 1.121. I've never got any stall, but this must be a bug.

Revision 1.125 / (download) - annotate - [select for diffs], Tue Feb 20 08:49:23 2018 UTC (6 years, 1 month ago) by knakahara
Branch: MAIN
Changes since 1.124: +7 -1 lines
Diff to previous 1.124 (colored) to selected 1.137 (colored)

Improve a comment about reading EICS register defined write-only by spec.

It seems that is workaround for silicon errata.

ok by msaitoh@n.o.

Revision 1.124 / (download) - annotate - [select for diffs], Tue Feb 20 07:24:37 2018 UTC (6 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.123: +48 -13 lines
Diff to previous 1.123 (colored) to selected 1.137 (colored)

- Fix a bug that RX may stall on heavy load on ixg(4) derived from FreeBSD's
 AIM (Auto Interrupt Moderation) bug.
 When I use a machine as a NFS client, sometimes one of queue pairs doesn't
 get any interrupt other than every second tick via ixgbe_local_timer1().
 When the problem occured, the queue pair's hw.ixgM.qN.interrupt_rate is
 always 500000. When this problem occuring, set hw.ixgM.qN.interrupt_rate lower
 than 166667 recover from stall. i.e.:

  sysctl -w hw.ixgM.qN.interrupt_rate=166667 (don't revocer)
  sysctl -w hw.ixgM.qN.interrupt_rate=166666 (recover)

  Relatios between the interrupt_rate and EICR's ITR_INTERVAL field is as
 follows:

 int_rate | EICR[11:0]   | interval in us | recover |
          |(ITR_INTERVAL)| (10G and 1G)   |         |
 ---------+--------------+----------------+---------+
   500000 | 0x008(0)     |              2 |     not |
   166667 | 0x010(1)     |              4 |     not |
   166666 | 0x018(2)     |              6 | recover |

  The reason why int_rate becomes 500000 is that xgbe_tx_eof() doesn't
 increment rxr->packets(*1). Even if we fix rxr->packets' bug, interrupt_rate
 might become greater than 166666 and it might cause stall.

  While reading datasheets, knakahara noticed a section titled with "ITR
 Affect on RSC Functionality". It says "When RSC is enabled on specific RX
 queues, the associated ITR interval with these queus must be enabled and must
 be larger (in time uints) than RSC delay". Currently, RSC_DELAY field in the
 GPIE register is 0 and it means 4us for 10G and 1G. The greater ITR_INTERVAL
 value of 4us is 6us == 166666. Yes, BINGO!

  This description is noted in 82599 and newer datasheets and not in 82598
 datasheet. I don't know if 82598 has this limitation but, I apply this
 limitation all of chips.

 (*1) Note that this bug is going to be fixed in the next commit to distinct
 between two different bugs.

- The bitfield of EITR register is different between 82598 and others.
 Only ixgbe_msix_que() taken care of it. Make new function ixgbe_eitr_write()
 and use it in all of functions which modify ITR_INTERVAL.

XXX pullup-8

Revision 1.123 / (download) - annotate - [select for diffs], Fri Feb 16 10:11:21 2018 UTC (6 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.122: +4 -1 lines
Diff to previous 1.122 (colored) to selected 1.137 (colored)

 Fix a bug that the first call of ifflags_cb() causes linkdown. The first
call of ix(gbe|v)_ifflags_cb() refered uninitialized adapter->if_flags.
adapter->if_flags should be initialized in the end of xxx_init().

XXX pullup-[678] (ixgbe)
XXX pullup-8 (ixv)

Revision 1.122 / (download) - annotate - [select for diffs], Fri Feb 16 04:50:19 2018 UTC (6 years, 2 months ago) by knakahara
Branch: MAIN
Changes since 1.121: +6 -1 lines
Diff to previous 1.121 (colored) to selected 1.137 (colored)

Apply RSS utility to ixg(4) and ixv(4).

ok by msaitoh@n.o.

Revision 1.121 / (download) - annotate - [select for diffs], Wed Feb 14 10:38:28 2018 UTC (6 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.120: +8 -5 lines
Diff to previous 1.120 (colored) to selected 1.137 (colored)

 Fix a bug that RX may stall on heavy load on ixg(4). ixgbe_rxeof() has loop
limit and the function returns true if a packet are still in the RX ring.
ixgbe_handle_que() didn't check the return value. Check the return vaule
and issue a softint.

 This bug is derived from FreeBSD and ixv(4) has no this bug.

XXX pullup-8

Revision 1.120 / (download) - annotate - [select for diffs], Fri Jan 26 09:07:46 2018 UTC (6 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.119: +3 -3 lines
Diff to previous 1.119 (colored) to selected 1.137 (colored)

 CID-1427719: Integer handling issues  (BAD_SHIFT). Print bus/slot info
correctly on 82599_SFP_SF_QP(DID 0x154a) and 82599_QSFP_SF_QP(DID 0x1558).

Revision 1.119 / (download) - annotate - [select for diffs], Thu Dec 28 06:10:01 2017 UTC (6 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.118: +161 -77 lines
Diff to previous 1.118 (colored) to selected 1.137 (colored)

 Fallback from MSI-X to MSI or INTx if MSI-X setup failed.

Revision 1.118 / (download) - annotate - [select for diffs], Thu Dec 21 09:24:45 2017 UTC (6 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.117: +16 -3 lines
Diff to previous 1.117 (colored) to selected 1.137 (colored)

- If MSI can't be used on some environment, fallback to INTx correctly.
- Use single vector MSI when number of CPU is 1 to save interrupt slot.

Revision 1.117 / (download) - annotate - [select for diffs], Thu Dec 21 06:49:26 2017 UTC (6 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.116: +2 -2 lines
Diff to previous 1.116 (colored) to selected 1.137 (colored)

 Fix panic when only link interrupt can't be established.

Revision 1.116 / (download) - annotate - [select for diffs], Wed Dec 20 08:51:42 2017 UTC (6 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.115: +5 -7 lines
Diff to previous 1.115 (colored) to selected 1.137 (colored)

 Don't panic when resource shortage occured. Fixes PR#52820 reported by
kardel@:
 - Don't use if_free() because ixgbe(4) don't use if_alloc().
 - Move location of {ixgbe,ixv}_setup_interface() call at a position that
   any error don't occur. One of the reason is that it should be. Another
   reason is that it's hard to call ether_ifdetach() and if_detach() when
   cold == 1 (because of pserialize_perform, xc_wait, timing of domaininit
   and maybe more).

Revision 1.115 / (download) - annotate - [select for diffs], Wed Dec 6 04:08:50 2017 UTC (6 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.114: +14 -12 lines
Diff to previous 1.114 (colored) to selected 1.137 (colored)

Sync with FreeBSD's r326022. All of the following changes have no influence
to netbsd:
- Check ETHERCAP_VLAN_HWTAGGING in ixgbe_setup_vlan_hw_support(). This change
  has no influence to netbsd because it's enabled by default and NetBSD has
  no API to disable it.
- Fix for netmap module.
- Remove never defined UDP_IPV4_EX
- Add SPDX-License-Identifier

Revision 1.114 / (download) - annotate - [select for diffs], Fri Nov 24 08:36:22 2017 UTC (6 years, 4 months ago) by msaitoh
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202
Changes since 1.113: +8 -3 lines
Diff to previous 1.113 (colored) to selected 1.137 (colored)

 On X540, print PHY FW Revision with %u.%x. 0x4030 will be printed
as "Revision 4.3 ID 0x0"

Revision 1.113 / (download) - annotate - [select for diffs], Wed Nov 22 15:15:09 2017 UTC (6 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.112: +2 -2 lines
Diff to previous 1.112 (colored) to selected 1.137 (colored)

Fix a bug that bypass adapter's sysctls aren't set. Tested with non-genuine
X550-T2 bypass adapter:
- Call ixgbe_sysctl_instance() in ixgbe_bypass_init() to get sysctl's top node
  correctly.
- ixgbe_init_device_features() refers adapter->hw.bus.func for bypass adapter.
  Call set_lan_id() to set adapter->hw.bus.func before calling
  ixgbe_init_device_features(). Without this, bypass sysctl's are added to
  both the first and second port.
- Initalize node.sysctl_data before calling sysctl_lookup() to read correct
  value.

Revision 1.112 / (download) - annotate - [select for diffs], Thu Nov 16 03:07:18 2017 UTC (6 years, 5 months ago) by ozaki-r
Branch: MAIN
Changes since 1.111: +2 -2 lines
Diff to previous 1.111 (colored) to selected 1.137 (colored)

Unify IFEF_*_MPSAFE into IFEF_MPSAFE

There are already two flags for if_output and if_start, however, it seems such
MPSAFE flags are eventually needed for all if_XXX operations. Having discrete
flags for each operation is wasteful of if_extflags bits. So let's unify
the flags into one: IFEF_MPSAFE.

Fortunately IFEF_*_MPSAFE flags have never been included in any releases, so
we can change them without breaking backward compatibility of the releases
(though the kernel version of -current should be bumped).

Note that if an interface have both MP-safe and non-MP-safe operations at a
time, we have to set the IFEF_MPSAFE flag and let callees of non-MP-safe
opeartions take the kernel lock.

Proposed on tech-kern@ and tech-net@

Revision 1.111 / (download) - annotate - [select for diffs], Sun Nov 12 05:11:36 2017 UTC (6 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.110: +1 -2 lines
Diff to previous 1.110 (colored) to selected 1.137 (colored)

 Remove obsoleted comment. This comment should have been removed in rev. 1.97.

Revision 1.110 / (download) - annotate - [select for diffs], Thu Nov 9 09:33:28 2017 UTC (6 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.109: +6 -2 lines
Diff to previous 1.109 (colored) to selected 1.137 (colored)

 On device which has SFP(+) cage and a module is inserted, hw->phy.id is not
MII PHY id but SFF 8024 ID. So checking hw->phy.id with 0 doesn't work.
Print PHY ID only for copper PHY.

Revision 1.109 / (download) - annotate - [select for diffs], Thu Nov 2 08:41:15 2017 UTC (6 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.108: +4 -5 lines
Diff to previous 1.108 (colored) to selected 1.137 (colored)

- Handle hw.ixgN.advertise_speed correctly.
- Fix hw.ixgN.advertise_speed sysctl's description.

Revision 1.108 / (download) - annotate - [select for diffs], Thu Oct 26 01:40:33 2017 UTC (6 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.107: +1 -10 lines
Diff to previous 1.107 (colored) to selected 1.137 (colored)

- Remove all half duplex setting.
- Remove special handling of IXGBE_DEV_ID_82598AT's 1000BaseT. The PHY is
  compliant with clause 45, so the media is added in the beginning of
  ixgbe_add_media_types().

Revision 1.107 / (download) - annotate - [select for diffs], Wed Oct 25 04:45:41 2017 UTC (6 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.106: +11 -6 lines
Diff to previous 1.106 (colored) to selected 1.137 (colored)

- For X550 and newer, print NVM Image Version with %u.%02x (e.g. "0.05").
- Fix value check of OEM_NVM_IMAGE_VER.

Revision 1.106 / (download) - annotate - [select for diffs], Mon Oct 23 09:31:18 2017 UTC (6 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.105: +7 -2 lines
Diff to previous 1.105 (colored) to selected 1.137 (colored)

 If if_initialize() failed in the attach function, free resources and return.

Revision 1.105 / (download) - annotate - [select for diffs], Wed Oct 18 10:43:32 2017 UTC (6 years, 6 months ago) by msaitoh
Branch: MAIN
Changes since 1.104: +7 -1 lines
Diff to previous 1.104 (colored) to selected 1.137 (colored)

 Protect ec_multi* with mutex like other MP safe Ethernet drivers.
See if_ether.h rev. 1.66 and related stuff:
http://mail-index.netbsd.org/source-changes/2016/12/28/msg080289.html

Revision 1.104 / (download) - annotate - [select for diffs], Fri Oct 13 04:52:40 2017 UTC (6 years, 6 months ago) by msaitoh
Branch: MAIN
Changes since 1.103: +3 -1 lines
Diff to previous 1.103 (colored) to selected 1.137 (colored)

 Set baudrate correctly. A device which use mii(4) interface can set
if_baudrate atomatically by mii_phy_statusmsg(). ixg(4) and ixv(4) don't
use mii(4), so calling ifmedia_baudrate() directly is required.

 XXX need the same same work for wm(4)'s TBI and SERDEV devices.

Revision 1.103 / (download) - annotate - [select for diffs], Wed Oct 4 07:13:00 2017 UTC (6 years, 6 months ago) by msaitoh
Branch: MAIN
Changes since 1.102: +56 -27 lines
Diff to previous 1.102 (colored) to selected 1.137 (colored)

- Remove half-duplex setting for more than 1000Mbps in ixgbe_add_media_types()
  because those medias are not in the spec.
- Add 2.5GBASE-T and 5GBASE-T support. Tested with X550-T1.

Example:
ixg0: flags=0x8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	capabilities=fff80<TSO4,IP4CSUM_Rx,IP4CSUM_Tx,TCP4CSUM_Rx>
	capabilities=fff80<TCP4CSUM_Tx,UDP4CSUM_Rx,UDP4CSUM_Tx,TCP6CSUM_Rx>
	capabilities=fff80<TCP6CSUM_Tx,UDP6CSUM_Rx,UDP6CSUM_Tx,TSO6,LRO>
	enabled=7ff80<TSO4,IP4CSUM_Rx,IP4CSUM_Tx,TCP4CSUM_Rx>
	enabled=7ff80<TCP4CSUM_Tx,UDP4CSUM_Rx,UDP4CSUM_Tx,TCP6CSUM_Rx>
	enabled=7ff80<TCP6CSUM_Tx,UDP6CSUM_Rx,UDP6CSUM_Tx,TSO6>
	ec_capabilities=7<VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU>
	ec_enabled=7<VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU>
	address: a0:36:9f:b0:f5:b0
	media: Ethernet 2.5GBASE-T full-duplex
	status: active
	supported Ethernet media:
		media 10Gbase-T
		media 10Gbase-T mediaopt full-duplex
		media 1000baseT
		media 1000baseT mediaopt full-duplex
		media 100baseTX
		media 100baseTX mediaopt full-duplex
		media 2.5GBASE-T mediaopt full-duplex
		media 5GBASE-T mediaopt full-duplex
		media autoselect
	inet 172.16.0.1/24 broadcast 172.16.0.255 flags 0x0
	inet6 fe80::a236:9fff:feb0:f5b0%ixg0/64 flags 0x0 scopeid 0x1

Revision 1.102 / (download) - annotate - [select for diffs], Wed Oct 4 06:19:47 2017 UTC (6 years, 6 months ago) by msaitoh
Branch: MAIN
Changes since 1.101: +2 -2 lines
Diff to previous 1.101 (colored) to selected 1.137 (colored)

 Fix a bug that X550EM (Denverton) can't force 10BaseT.

Revision 1.101 / (download) - annotate - [select for diffs], Wed Sep 27 10:31:29 2017 UTC (6 years, 6 months ago) by msaitoh
Branch: MAIN
Changes since 1.100: +1 -16 lines
Diff to previous 1.100 (colored) to selected 1.137 (colored)

 Print device name in ixv_attach().

Revision 1.100 / (download) - annotate - [select for diffs], Thu Aug 31 02:48:55 2017 UTC (6 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.99: +2 -2 lines
Diff to previous 1.99 (colored) to selected 1.137 (colored)

 Fix 2500 KX media setting in last commit.

Revision 1.99 / (download) - annotate - [select for diffs], Wed Aug 30 08:49:18 2017 UTC (6 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.98: +1806 -2397 lines
Diff to previous 1.98 (colored) to selected 1.137 (colored)

- Sync with FreeBSD r320688 (and up to r322865):
  - Add C3000(Denvertion(-NS)) support.
  - Add bypass function support for bypass adapters. Sysctls are provided.
    Not tested because I have no any bypass adapter.
  - ixv(4): set RSS mapping.
  - Change EEE sysctl.
  - ixv(4): Add TSOv6.
  - ixv(4): Mailbox API 1.2 and more are implemented and comment says it
    negotiate with 1.2 but it really does 1.1...
  - Remove thermal test sysctl.
  - Fix unknown bugs.
- Print driver feature capabilities and enable bits when verbose boot.

Revision 1.98 / (download) - annotate - [select for diffs], Wed Aug 30 08:24:57 2017 UTC (6 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.97: +4090 -4081 lines
Diff to previous 1.97 (colored) to selected 1.137 (colored)

 FreeBSD r320688 sorted a lot of functions. Merging that change by one commit
makes difficult to know what was really changed. To make change understandable,
commit only function sort and white space changes before real change.

Revision 1.97 / (download) - annotate - [select for diffs], Wed Aug 30 01:25:07 2017 UTC (6 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.96: +5 -3 lines
Diff to previous 1.96 (colored) to selected 1.137 (colored)

 Don't limit number of queue pair to 8. Take max TX queues and max RX queues
into account. 82598 has 32 TX queue and 64 RX queues. Others has 128 TX queues
and 128 RX queues. Number of MSI-X table entries is 64, so the max queue pairs
is 63 (64 minus the Others (e.g. link status change)).

Revision 1.96 / (download) - annotate - [select for diffs], Thu Aug 24 10:43:42 2017 UTC (6 years, 7 months ago) by msaitoh
Branch: MAIN
CVS Tags: nick-nhusb-base-20170825
Changes since 1.95: +1 -13 lines
Diff to previous 1.95 (colored) to selected 1.137 (colored)

 Remove unused counters.

Revision 1.95 / (download) - annotate - [select for diffs], Mon Jul 3 08:29:58 2017 UTC (6 years, 9 months ago) by msaitoh
Branch: MAIN
CVS Tags: perseant-stdc-iso10646-base, perseant-stdc-iso10646
Changes since 1.94: +23 -1 lines
Diff to previous 1.94 (colored) to selected 1.137 (colored)

 Print PHY ID.

Revision 1.94 / (download) - annotate - [select for diffs], Tue Jun 27 10:33:09 2017 UTC (6 years, 9 months ago) by msaitoh
Branch: MAIN
Changes since 1.93: +14 -5 lines
Diff to previous 1.93 (colored) to selected 1.137 (colored)

 Fix a bug of ixg(4)'s media setting.

Before:
 ifconfig ixg0 media 100baseTX	-> advertise 100Mbps only
 ifconfig ixg0 media 1000baseT	-> advertise 1Gbps and 1000Mbps (NG)
 ifconfig ixg0 media 10Gbase-T	-> advertise all (NG)
 ifconfig ixg0 media auto	-> advertise all

After:
 ifconfig ixg0 media 100baseTX	-> advertise 100Mbps only
 ifconfig ixg0 media 1000baseT	-> advertise 1Gbps only
 ifconfig ixg0 media 10Gbase-T	-> advertise 10Gbps only
 ifconfig ixg0 media auto	-> advertise all

Revision 1.93 / (download) - annotate - [select for diffs], Tue Jun 27 05:17:54 2017 UTC (6 years, 9 months ago) by msaitoh
Branch: MAIN
Changes since 1.92: +2 -2 lines
Diff to previous 1.92 (colored) to selected 1.137 (colored)

 Reduce diff against FreeBSD. change hw.ixgN.ts to hw.ixgN.thermal_test
(FreeBSD r282289).

Revision 1.92 / (download) - annotate - [select for diffs], Tue Jun 27 05:01:51 2017 UTC (6 years, 9 months ago) by msaitoh
Branch: MAIN
Changes since 1.91: +2 -2 lines
Diff to previous 1.91 (colored) to selected 1.137 (colored)

 Reduce diff against FreeBSD. No functional change.

Revision 1.91 / (download) - annotate - [select for diffs], Fri Jun 23 06:33:35 2017 UTC (6 years, 9 months ago) by msaitoh
Branch: MAIN
Changes since 1.90: +7 -1 lines
Diff to previous 1.90 (colored) to selected 1.137 (colored)

 Print verbose outout in ixgbe_update_link_status() correctly on 5Gbps and
2.5Gbps (NBASE-T) for X550T[12] and newer.

Revision 1.90 / (download) - annotate - [select for diffs], Fri Jun 23 04:36:48 2017 UTC (6 years, 9 months ago) by msaitoh
Branch: MAIN
Changes since 1.89: +7 -36 lines
Diff to previous 1.89 (colored) to selected 1.137 (colored)

 Use IFM_1000_KX more.

Revision 1.89 / (download) - annotate - [select for diffs], Mon Jun 12 03:03:22 2017 UTC (6 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.88: +7 -27 lines
Diff to previous 1.88 (colored) to selected 1.137 (colored)

Use IFM_1000_KX and IFM_2500_KX.

Revision 1.88 / (download) - annotate - [select for diffs], Fri Jun 2 08:16:52 2017 UTC (6 years, 10 months ago) by msaitoh
Branch: MAIN
CVS Tags: netbsd-8-base
Branch point for: netbsd-8
Changes since 1.87: +72 -6 lines
Diff to previous 1.87 (colored) to selected 1.137 (colored)

- Print NVM Image Version, PHY FW Revision, NVM Map version and OEM NVM
  Image version
- s/TrackID/ETrackID/

Revision 1.87 / (download) - annotate - [select for diffs], Fri May 26 09:17:32 2017 UTC (6 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.86: +3 -1 lines
Diff to previous 1.86 (colored) to selected 1.137 (colored)

 Add missing {ixgbe,ixv}_stop() in the detach function. Without this change,
shutdown won't finish or panic on heay traffic.

Revision 1.86 / (download) - annotate - [select for diffs], Fri May 26 08:36:41 2017 UTC (6 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.85: +9 -1 lines
Diff to previous 1.85 (colored) to selected 1.137 (colored)

 Count Bad SFD (Start Frame Delimiter). X550 and newer have this register.

Revision 1.85 / (download) - annotate - [select for diffs], Fri May 26 07:42:15 2017 UTC (6 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.84: +120 -2 lines
Diff to previous 1.84 (colored) to selected 1.137 (colored)

 Clear all event counters when SIOCZIFDATA(ifconfig -z) is called.

Revision 1.84 / (download) - annotate - [select for diffs], Mon May 22 07:35:14 2017 UTC (6 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.83: +22 -6 lines
Diff to previous 1.83 (colored) to selected 1.137 (colored)

 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.

Revision 1.83 / (download) - annotate - [select for diffs], Mon May 22 07:23:55 2017 UTC (6 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.82: +20 -3 lines
Diff to previous 1.82 (colored) to selected 1.137 (colored)

 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

Revision 1.82 / (download) - annotate - [select for diffs], Thu May 18 08:27:19 2017 UTC (6 years, 11 months ago) by msaitoh
Branch: MAIN
CVS Tags: prg-localcount2-base3
Changes since 1.81: +56 -2 lines
Diff to previous 1.81 (colored) to selected 1.137 (colored)

- 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.

Revision 1.81 / (download) - annotate - [select for diffs], Fri Apr 28 10:24:45 2017 UTC (6 years, 11 months ago) by msaitoh
Branch: MAIN
CVS Tags: prg-localcount2-base2, prg-localcount2-base1
Changes since 1.80: +2 -2 lines
Diff to previous 1.80 (colored) to selected 1.137 (colored)

 Fix a bug that reading hw.ixgM.qN.interrupt_rate cause the interrupt
throtting rate register to 0. Check sysctl read/write correctly...

Revision 1.80 / (download) - annotate - [select for diffs], Fri Mar 3 04:37:05 2017 UTC (7 years, 1 month ago) by msaitoh
Branch: MAIN
CVS Tags: prg-localcount2-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1
Branch point for: prg-localcount2
Changes since 1.79: +49 -30 lines
Diff to previous 1.79 (colored) to selected 1.137 (colored)

 Set PCI_INTR_MPSAFE, SOFTINT_MPSAFE, CALLOUT_MPSAFE and IFEF_START_MPSAFE
if NET_MPSAFE is defined.

Revision 1.79 / (download) - annotate - [select for diffs], Fri Feb 24 05:38:30 2017 UTC (7 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.78: +42 -2 lines
Diff to previous 1.78 (colored) to selected 1.137 (colored)

 Print mac.type and the TrackID.

Revision 1.78 / (download) - annotate - [select for diffs], Thu Feb 16 08:01:11 2017 UTC (7 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.77: +5 -4 lines
Diff to previous 1.77 (colored) to selected 1.137 (colored)

 Do if_snd check even if IXGBE_LEGACY_TX is used. It's used by ALTQ.

Revision 1.77 / (download) - annotate - [select for diffs], Thu Feb 16 07:58:21 2017 UTC (7 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.76: +1 -5 lines
Diff to previous 1.76 (colored) to selected 1.137 (colored)

 txt_si softint is used only for multiqueue (ixgbe_mq_start_locked()), so don't
schedule it in ixgbe_legacy_irq().

Revision 1.76 / (download) - annotate - [select for diffs], Mon Feb 13 10:37:37 2017 UTC (7 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.75: +1 -12 lines
Diff to previous 1.75 (colored) to selected 1.137 (colored)

Remove more ix*_start_locked() from interrupt context like previous commit.
 > Fix a bug that ix*_start_locked() is called in interrput context
 > (ix*_msix_que). The function is called in softint(ix*_handle_que()). OK'd by
 >k-nakahara.

Revision 1.75 / (download) - annotate - [select for diffs], Mon Feb 13 10:13:54 2017 UTC (7 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.74: +3 -1 lines
Diff to previous 1.74 (colored) to selected 1.137 (colored)

Use percpuq.

Revision 1.74 / (download) - annotate - [select for diffs], Mon Feb 13 06:38:45 2017 UTC (7 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.73: +5 -9 lines
Diff to previous 1.73 (colored) to selected 1.137 (colored)

 Fix a bug that ix*_start_locked() is called in interrput context
(ix*_msix_que). The function is called in softint(ix*_handle_que()). OK'd by
k-nakahara.

Revision 1.73 / (download) - annotate - [select for diffs], Fri Feb 10 08:41:13 2017 UTC (7 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.72: +5 -8 lines
Diff to previous 1.72 (colored) to selected 1.137 (colored)

 Change the Interrupt Moderation flag from global variable to per device.

Revision 1.72 / (download) - annotate - [select for diffs], Fri Feb 10 06:35:22 2017 UTC (7 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.71: +43 -52 lines
Diff to previous 1.71 (colored) to selected 1.137 (colored)

- Both mbuf_defrag_failed and m_defrag_failed existed. Remove m_defrag_failed.
- rx_irq, dropped_pkts, morerx, moretx and txloops counters are uncounted, so
  remove them.
- Count handleq in ixv_handle_que().
- Detach event counters correctly.
- Set some per-queue event names correctly.

Revision 1.71 / (download) - annotate - [select for diffs], Wed Feb 8 09:00:37 2017 UTC (7 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.70: +4 -4 lines
Diff to previous 1.70 (colored) to selected 1.137 (colored)

 Print CPU number correctly.

Revision 1.70 / (download) - annotate - [select for diffs], Wed Feb 8 08:13:53 2017 UTC (7 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.69: +3 -7 lines
Diff to previous 1.69 (colored) to selected 1.137 (colored)

 Call IFQ_SET_MAXLEN() even if TX multiqueue is used. ALTQ uses it.

Revision 1.69 / (download) - annotate - [select for diffs], Wed Feb 8 04:05:13 2017 UTC (7 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.68: +4 -4 lines
Diff to previous 1.68 (colored) to selected 1.137 (colored)

Add queue number into interrupt name.

Revision 1.68 / (download) - annotate - [select for diffs], Wed Feb 8 03:59:12 2017 UTC (7 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.67: +2 -1 lines
Diff to previous 1.67 (colored) to selected 1.137 (colored)

 Set ifm_active to IFM_NONE when the physical interface's link is down.
Now ifconfig shows "media: Ethernet autoselect '(none)'".

Revision 1.67 / (download) - annotate - [select for diffs], Wed Feb 1 10:47:13 2017 UTC (7 years, 2 months ago) by msaitoh
Branch: MAIN
CVS Tags: nick-nhusb-base-20170204
Changes since 1.66: +45 -13 lines
Diff to previous 1.66 (colored) to selected 1.137 (colored)

 TX multiqueue. If you want to disable it, enable IXGBE_LEGACY_TX
in ixgbe_netbsd.h

Revision 1.66 / (download) - annotate - [select for diffs], Wed Jan 25 13:08:31 2017 UTC (7 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.65: +3 -3 lines
Diff to previous 1.65 (colored) to selected 1.137 (colored)

 Call ixgbe_get_supported_physical_layer() before ixgbe_add_media_types() to
set new media types correctly.

Revision 1.65 / (download) - annotate - [select for diffs], Wed Jan 25 07:49:23 2017 UTC (7 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.64: +2 -3 lines
Diff to previous 1.64 (colored) to selected 1.137 (colored)

Remove debug printf()s.

Revision 1.64 / (download) - annotate - [select for diffs], Wed Jan 25 07:46:53 2017 UTC (7 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.63: +13 -11 lines
Diff to previous 1.63 (colored) to selected 1.137 (colored)

 Fix SFP+ insersion or replacement stuff.

Revision 1.63 / (download) - annotate - [select for diffs], Thu Jan 19 09:42:08 2017 UTC (7 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.62: +37 -35 lines
Diff to previous 1.62 (colored) to selected 1.137 (colored)

Reduce diff against FreeBSD. No functional change.

Revision 1.62 / (download) - annotate - [select for diffs], Wed Jan 18 10:22:09 2017 UTC (7 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.61: +9 -8 lines
Diff to previous 1.61 (colored) to selected 1.137 (colored)

 Now we can use multiqueue. It's default on ixg(4). Not yet for ixv(4).

Revision 1.61 / (download) - annotate - [select for diffs], Wed Jan 18 10:18:40 2017 UTC (7 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.60: +4 -1 lines
Diff to previous 1.60 (colored) to selected 1.137 (colored)

 Fix sysctl stuff. Make the top sysctl node and keep the pointer.

Revision 1.60 / (download) - annotate - [select for diffs], Wed Jan 18 08:23:03 2017 UTC (7 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.59: +5 -2 lines
Diff to previous 1.59 (colored) to selected 1.137 (colored)

 Use 64bit DMA tag. If not, a lot of bounce buffer is allocated.
Fixes PR#49968 reported by Hauke.

XXX pullup-[67].

Revision 1.59 / (download) - annotate - [select for diffs], Thu Jan 5 05:53:23 2017 UTC (7 years, 3 months ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-localcount-20170107, bouyer-socketcan-base
Branch point for: bouyer-socketcan
Changes since 1.58: +2 -2 lines
Diff to previous 1.58 (colored) to selected 1.137 (colored)

 Fix INIT_DEBUGOUT() messages.

Revision 1.58 / (download) - annotate - [select for diffs], Wed Dec 28 09:29:35 2016 UTC (7 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.57: +19 -15 lines
Diff to previous 1.57 (colored) to selected 1.137 (colored)

 Fix a bug that hw.ixgN.wol_enable=0 doesn't work correctly. Clear the WUC
and WUFC register if wol_enable is 0. ixgbe_setup_low_power_mode() calls
ixgbe_stop() and it resets the chip. The reset change WUC and WUFC registers to
the default, so clearing WUC and WUFC should be done after ixgbe_stop().

Revision 1.57 / (download) - annotate - [select for diffs], Wed Dec 28 07:05:11 2016 UTC (7 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.56: +14 -13 lines
Diff to previous 1.56 (colored) to selected 1.137 (colored)

 Allow 0 as the defalut of hw.ixgN.advertise_speed sysctl.

Revision 1.56 / (download) - annotate - [select for diffs], Tue Dec 27 10:01:39 2016 UTC (7 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.55: +3 -1 lines
Diff to previous 1.55 (colored) to selected 1.137 (colored)

  Fix flow control setting sysctl. I don't know why disabling autonego when
the flow control parameter is changed. Now the ixgN.fc sysctl works as
expected.

Revision 1.55 / (download) - annotate - [select for diffs], Fri Dec 16 08:41:01 2016 UTC (7 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.54: +65 -34 lines
Diff to previous 1.54 (colored) to selected 1.137 (colored)

Add missing IFM_FDX.

Revision 1.54 / (download) - annotate - [select for diffs], Fri Dec 16 08:30:20 2016 UTC (7 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.53: +2 -2 lines
Diff to previous 1.53 (colored) to selected 1.137 (colored)

Remove extra newline in debug printfs. ixgbe's *DEBUGOUT* macros automatically
add newline.

Revision 1.53 / (download) - annotate - [select for diffs], Mon Dec 5 10:05:11 2016 UTC (7 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.52: +7 -8 lines
Diff to previous 1.52 (colored) to selected 1.137 (colored)

- Fix wol_enable, fc and wufc sysctls to work correctly.
- Fix RCS Id.

Revision 1.52 / (download) - annotate - [select for diffs], Mon Dec 5 08:50:29 2016 UTC (7 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.51: +104 -47 lines
Diff to previous 1.51 (colored) to selected 1.137 (colored)

Update ixg(4) and ixv(4) up to FreeBSD r303890:
- Configure ixgbe phy & gbic power.
  Setup phy and gbic power as per Linux 4.3.13 driver.
  This fixes link not detected on X540-AT2 after booting to Linux which
  turns the phy power off on detach. (FreeBSD r295093)
- Fixup DA cable detection routine. (FreeBSD r303032)
- Some minor changes

Revision 1.51 / (download) - annotate - [select for diffs], Fri Dec 2 12:14:37 2016 UTC (7 years, 4 months ago) by msaitoh
Branch: MAIN
CVS Tags: nick-nhusb-base-20161204
Changes since 1.50: +61 -20 lines
Diff to previous 1.50 (colored) to selected 1.137 (colored)

Update ixg(4) and ixv(4) up to FreeBSD r294578:
- Fixup SFP module insertion on the 82599 when insertion happens after
  the system is booted and running. Add PHY detection logic to
  ixgbe_handle_mod() and add locking to ixgbe_handle_msf() as well.
  FreeBSD r293334.
- Fix ix advertise value after media change. When ifconfig sets media then the
  values displayed by the advertise_speed value are invalidated.
  Fix this by setting the bits correctly including setting advertise to 0 for
  media = auto. FreeBSD r294578.
- Some others (e.g. LRO(not used by NetBSD)).

Revision 1.50 / (download) - annotate - [select for diffs], Fri Dec 2 11:56:55 2016 UTC (7 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.49: +3 -3 lines
Diff to previous 1.49 (colored) to selected 1.137 (colored)

Fix ix{gbe,v}_set_sysctlvalue().

Revision 1.49 / (download) - annotate - [select for diffs], Fri Dec 2 10:46:58 2016 UTC (7 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.48: +7 -5 lines
Diff to previous 1.48 (colored) to selected 1.137 (colored)

- Add missing pmf_device_deregister() in ixgbe_detach()
- Remove extra newline from an sysctl description.
- Fix dmesg output when the number of PCIe lane can't get.

Revision 1.48 / (download) - annotate - [select for diffs], Fri Dec 2 10:42:04 2016 UTC (7 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.47: +337 -141 lines
Diff to previous 1.47 (colored) to selected 1.137 (colored)

Update ixg(4) and ixv(4) up to FreeBSD r292674:
- Add X552 SFP+ and X550T single port.
- Bug fixes.

Revision 1.47 / (download) - annotate - [select for diffs], Fri Dec 2 10:34:23 2016 UTC (7 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.46: +40 -7 lines
Diff to previous 1.46 (colored) to selected 1.137 (colored)

Update ixg(4) and ixv(4) up to FreeBSD r289238:
- Add support for sysctl knobs to live tune the per interrupt rx/tx packet
  processing limits in ixgbe(4)
- Some others (netmap, etc.)

Revision 1.46 / (download) - annotate - [select for diffs], Fri Dec 2 10:24:31 2016 UTC (7 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.45: +10 -5 lines
Diff to previous 1.45 (colored) to selected 1.137 (colored)

Update ixg(4) and ixv(4) up to FreeBSD r285590:
- Fix igxbe SRIOV VF (if_ixv) initialization bugs.  The MAC address for
  an if_ixv instance can now set at creation time, and the receive ring
  tail pointer is correctly initialized (previously, things still worked
  because the receive ring tail pointer was being fixed up as a side
  effect of other activity).

Revision 1.45 / (download) - annotate - [select for diffs], Fri Dec 2 10:21:43 2016 UTC (7 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.44: +992 -138 lines
Diff to previous 1.44 (colored) to selected 1.137 (colored)

Update ixg(4) and ixv(4) up to FreeBSD r283881:
- SRIOV support (not enabled because NetBSD doesn't support it).

Revision 1.44 / (download) - annotate - [select for diffs], Thu Dec 1 06:56:28 2016 UTC (7 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.43: +963 -299 lines
Diff to previous 1.43 (colored) to selected 1.137 (colored)

Update ixg(4) and ixv(4) up to FreeBSD r282299:
- Add support for X55x.
- ADD EEE support (not tested).
- Add WOL support (not tested).
- Add suspend/resume support (not testd).
- Add LPLU support (not tested).
- Add DMA Coalescing (note verified).
- Not tested well for sysctls.
- Fix ixgbe_set_advertise() a bit. At least, FreeBSD r294578 is required
  to work hw.ixg0.advertise_speed sysctl correctly.

Revision 1.43 / (download) - annotate - [select for diffs], Thu Dec 1 06:27:18 2016 UTC (7 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.42: +540 -325 lines
Diff to previous 1.42 (colored) to selected 1.137 (colored)

Update ixg(4) and ixv(4) up to FreeBSD r280197:
- Add support for 82599_QSFP_SF_QP and X540T1.
- Add partial support for X55x. It's required to sync with FreeBSD r282299
  to support X55x.
- Bugfixes.

Revision 1.42 / (download) - annotate - [select for diffs], Mon Nov 28 02:23:33 2016 UTC (7 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.41: +47 -2289 lines
Diff to previous 1.41 (colored) to selected 1.137 (colored)

 FreeBSD r280182 made new file ix_txrx.c and moved ixgbe.c and ixv's common
code into it. Before sync with whole of them, just move ixgbe.c and ixv.c's
common code into ix_txrx.c from ixgbe.c. In this commit, only ixgbe.c is split
into the device dependent part and the common part. ixv.c isn't change to make
this commit no functional change. To use ixv.c with ix_txrx.c, it's required
to modify the common part's API and functions themselves.

 This commit is done to make the next change easy to understand.

Revision 1.41 / (download) - annotate - [select for diffs], Fri Nov 25 13:33:24 2016 UTC (7 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.40: +2 -41 lines
Diff to previous 1.40 (colored) to selected 1.137 (colored)

 Remove #ifdef NETBSD_MSI_OR_MSIX to be simple. ixv(4) isn't attached if
__HAVE_PCI_MSI_MSIX isn't set because MSI-X must be used.

Revision 1.40 / (download) - annotate - [select for diffs], Thu Oct 13 20:05:06 2016 UTC (7 years, 6 months ago) by jdolecek
Branch: MAIN
CVS Tags: pgoyette-localcount-20161104
Changes since 1.39: +16 -9 lines
Diff to previous 1.39 (colored) to selected 1.137 (colored)

provide intr xname

Revision 1.39 / (download) - annotate - [select for diffs], Mon Jul 11 06:14:51 2016 UTC (7 years, 9 months ago) by knakahara
Branch: MAIN
CVS Tags: pgoyette-localcount-base, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20161004, localcount-20160914
Branch point for: pgoyette-localcount
Changes since 1.38: +3 -2 lines
Diff to previous 1.38 (colored) to selected 1.137 (colored)

pci_intr_type() is required pci_chipset_tag_t argument by other than x86.

pointed out by nonaka@n.o.

Revision 1.38 / (download) - annotate - [select for diffs], Fri Jun 10 13:27:14 2016 UTC (7 years, 10 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20160907
Changes since 1.37: +2 -2 lines
Diff to previous 1.37 (colored) to selected 1.137 (colored)

Introduce m_set_rcvif and m_reset_rcvif

The API is used to set (or reset) a received interface of a mbuf.
They are counterpart of m_get_rcvif, which will come in another
commit, hide internal of rcvif operation, and reduce the diff of
the upcoming change.

No functional change.

Revision 1.37 / (download) - annotate - [select for diffs], Tue Feb 9 08:32:11 2016 UTC (8 years, 2 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319
Changes since 1.36: +14 -3 lines
Diff to previous 1.36 (colored) to selected 1.137 (colored)

Introduce softint-based if_input

This change intends to run the whole network stack in softint context
(or normal LWP), not hardware interrupt context. Note that the work is
still incomplete by this change; to that end, we also have to softint-ify
if_link_state_change (and bpf) which can still run in hardware interrupt.

This change softint-ifies at ifp->if_input that is called from
each device driver (and ieee80211_input) to ensure Layer 2 runs
in softint (e.g., ether_input and bridge_input). To this end,
we provide a framework (called percpuq) that utlizes softint(9)
and percpu ifqueues. With this patch, rxintr of most drivers just
queues received packets and schedules a softint, and the softint
dequeues packets and does rest packet processing.

To minimize changes to each driver, percpuq is allocated in struct
ifnet for now and that is initialized by default (in if_attach).
We probably have to move percpuq to softc of each driver, but it's
future work. At this point, only wm(4) has percpuq in its softc
as a reference implementation.

Additional information including performance numbers can be found
in the thread at tech-kern@ and tech-net@:
http://mail-index.netbsd.org/tech-kern/2016/01/14/msg019997.html

Acknowledgment: riastradh@ greatly helped this work.
Thank you very much!

Revision 1.36 / (download) - annotate - [select for diffs], Mon Aug 17 06:16:03 2015 UTC (8 years, 8 months ago) by knakahara
Branch: MAIN
CVS Tags: nick-nhusb-base-20151226, nick-nhusb-base-20150921
Changes since 1.35: +3 -3 lines
Diff to previous 1.35 (colored) to selected 1.137 (colored)

Add kernel code to support intrctl(8).

Revision 1.35 / (download) - annotate - [select for diffs], Thu Aug 13 10:03:37 2015 UTC (8 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.34: +22 -18 lines
Diff to previous 1.34 (colored) to selected 1.137 (colored)

 Reduce diff against FreeBSD r280181.

Revision 1.34 / (download) - annotate - [select for diffs], Thu Aug 13 04:56:43 2015 UTC (8 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.33: +175 -163 lines
Diff to previous 1.33 (colored) to selected 1.137 (colored)

 - Add MSI/MSI-X support. The multiqueue function is not supported yet.
 - Make ixv.c compilable. _NOT_TESTED_YET_

Revision 1.33 / (download) - annotate - [select for diffs], Wed Aug 5 04:08:44 2015 UTC (8 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.32: +591 -255 lines
Diff to previous 1.32 (colored) to selected 1.137 (colored)

 Sync ixg(4) up to FreeBSD r279805 (or r280181) which include some bugfixes.
TODO:
 - Merge r280182 and newer. It's required to support X55x.
 - MSI/MSI-X support.

Revision 1.32 / (download) - annotate - [select for diffs], Wed Aug 5 03:42:11 2015 UTC (8 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.31: +7 -2 lines
Diff to previous 1.31 (colored) to selected 1.137 (colored)

 Fix error path in ixgbe_attach() and ixgbe_detatch() to prevent panic.

Revision 1.31 / (download) - annotate - [select for diffs], Mon Aug 3 05:43:01 2015 UTC (8 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.30: +2 -1 lines
Diff to previous 1.30 (colored) to selected 1.137 (colored)

 Add missing evcnt_detach(&rxr->rx_copies) in ixgbe_detach().

Revision 1.30 / (download) - annotate - [select for diffs], Sat May 9 13:08:26 2015 UTC (8 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: nick-nhusb-base-20150606
Changes since 1.29: +1 -3 lines
Diff to previous 1.29 (colored) to selected 1.137 (colored)

remove unreachable code.

Revision 1.29 / (download) - annotate - [select for diffs], Wed May 6 09:21:22 2015 UTC (8 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.28: +4 -1 lines
Diff to previous 1.28 (colored) to selected 1.137 (colored)

 Fixes link error without vlan. PR#49879.

Revision 1.28 / (download) - annotate - [select for diffs], Fri Apr 24 07:00:51 2015 UTC (8 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.27: +409 -401 lines
Diff to previous 1.27 (colored) to selected 1.137 (colored)

Sync ixg(4) up to FreeBSD r250108:
 - Cleanup some unused counters and some unused code.
 - Improve performance.
 - Fix flow control - don't override user value on re-init
 - Fix to make 1G optics work correctly
 - Change to interrupt enabling - some bits were incorrect
   for certain hardware.
 - Certain stats fixes, remove a duplicate increment of
   ierror, thanks to Scott Long for pointing these out.
 - Fix the setting of RX which related to multicast.
 - Some netmap related fixes.

Revision 1.27 / (download) - annotate - [select for diffs], Tue Apr 14 07:41:52 2015 UTC (9 years ago) by msaitoh
Branch: MAIN
Changes since 1.26: +14 -13 lines
Diff to previous 1.26 (colored) to selected 1.137 (colored)

 Fix a bug that ifconfig -z (SOICZIFDATA) doesn't work.

Revision 1.26 / (download) - annotate - [select for diffs], Tue Apr 14 07:17:06 2015 UTC (9 years ago) by msaitoh
Branch: MAIN
Changes since 1.25: +258 -366 lines
Diff to previous 1.25 (colored) to selected 1.137 (colored)

Sync ixg(4) up to FreeBSD r243716:
 - A lot of bugfixes. Some of them are realted to multi queue and those
   have not affected in NetBSD because we have not used it yet.
 - Show 1000Base-SX correctly.
 - Fix if_baudrate from 1G to 10G.
 - Improve performance.

Revision 1.25 / (download) - annotate - [select for diffs], Thu Apr 2 09:26:55 2015 UTC (9 years ago) by msaitoh
Branch: MAIN
CVS Tags: nick-nhusb-base-20150406
Changes since 1.24: +154 -73 lines
Diff to previous 1.24 (colored) to selected 1.137 (colored)

Update our ixg(4) driver up to FreeBSD r238149:
- Add TSO6 support.
- The max size in dma tag is changed from 65535 to 262140 (IXGBE_TSO_SIZE).
  The value is the same as other *BSDs. The change might cause a address
  space shortage (ixgbe_dmamap_create() might fail) on some machines.
- Fix a lot of bugs.
- Improve performance.

Revision 1.24 / (download) - annotate - [select for diffs], Fri Mar 27 05:57:28 2015 UTC (9 years ago) by msaitoh
Branch: MAIN
Changes since 1.23: +212 -92 lines
Diff to previous 1.23 (colored) to selected 1.137 (colored)

Synchronize our ixg(4) driver up to FreeBSD r230775:
 - Add X540 support.
 - Add 100BaseTX support.
 - Fix a lot of bugs.
 - Improve performance.

Revision 1.23 / (download) - annotate - [select for diffs], Wed Mar 25 12:53:55 2015 UTC (9 years ago) by msaitoh
Branch: MAIN
Changes since 1.22: +4 -1 lines
Diff to previous 1.22 (colored) to selected 1.137 (colored)

 Fix a bug that vlan setting may not apply to the parent interface correctly.

Revision 1.22 / (download) - annotate - [select for diffs], Thu Mar 19 14:22:23 2015 UTC (9 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.21: +221 -24 lines
Diff to previous 1.21 (colored) to selected 1.137 (colored)

Sync ixg(4) up to FreeBSD r230572.

 - Fix in the interrupt handler to make sure the stack TX queue is processed.
   (FreeBSD r222588)
 - The maximum read size of incoming packets is done in 1024-byte increments.
   The current code was rounding down the maximum frame size instead of
   routing up, resulting in a read size of 1024 bytes, in the non-jumbo
   frame case, and splitting the packets across multiple mbufs.
   (FreeBSD r225045)
 - Consequently the above problem exposed another issue, which is when
   packets were splitted across multiple mbufs, and all of the mbufs in the
   chain have the M_PKTHDR flag set. (FreeBSD r225045)
 - Use the correct constant for conversion between interrupt rate
   and EITR values (the previous values were off by a factor of 2)
   (FreeBSD r230572)
 - Make dev.ix.N.queueM.interrupt_rate a RW sysctl variable. Changing
   individual values affects the queue immediately, and propagates to all
   interfaces at the next reinit. (FreeBSD r230572)
 - Add dev.ix.N.queueM.irqs rdonly sysctl, to export the actual interrupt
   counts. (FreeBSD r230572)
 - Some netmap related changes.

Revision 1.21 / (download) - annotate - [select for diffs], Tue Feb 24 14:49:28 2015 UTC (9 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.20: +4 -2 lines
Diff to previous 1.20 (colored) to selected 1.137 (colored)

 Add 82599EN_SFP and 82599_SFP_SF_QP. Not tested.

Revision 1.20 / (download) - annotate - [select for diffs], Tue Feb 24 14:14:50 2015 UTC (9 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored) to selected 1.137 (colored)

 Change macro name IXGBE_DEV_ID_82599_SFP_DELL to IXGBE_DEV_ID_82599_SFP_SF2.
Same as OpenBSD and Linux. No binary change.

Revision 1.19 / (download) - annotate - [select for diffs], Sat Feb 7 00:02:09 2015 UTC (9 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.18: +9 -3 lines
Diff to previous 1.18 (colored) to selected 1.137 (colored)

disable preemption while scheduling the softint to configure the link.

Revision 1.18 / (download) - annotate - [select for diffs], Wed Feb 4 09:05:53 2015 UTC (9 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.17: +5 -1 lines
Diff to previous 1.17 (colored) to selected 1.137 (colored)

Fix mutex related problem reported by Uwe Toenjes in PR#49328:
 - Revert ixgbe_netbsd.c rev. 1.2
 - make CORE_LOCK adaptive
 - Release spin lock while reinitializing the jumb buffer structure.

Revision 1.17 / (download) - annotate - [select for diffs], Wed Feb 4 04:37:13 2015 UTC (9 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.16: +1 -3 lines
Diff to previous 1.16 (colored) to selected 1.137 (colored)

 Remove extra IXGBE_TX_LOCK()/IXGBE_TX_UNLOCK() from
ixgbe_free_transmit_structures(). This function is called in the end of
the detach function. if_stop was called and almost all resources were
freed, so it's not required to block the TX stuff.

Revision 1.16 / (download) - annotate - [select for diffs], Wed Feb 4 03:17:29 2015 UTC (9 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.15: +2 -1 lines
Diff to previous 1.15 (colored) to selected 1.137 (colored)

 Add missing IXGBE_RX_LOCK_DESTROY() for the detach path.

Revision 1.15 / (download) - annotate - [select for diffs], Tue Jan 13 03:11:34 2015 UTC (9 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.14: +14 -11 lines
Diff to previous 1.14 (colored) to selected 1.137 (colored)

 Fix a legacy interrupt problem. If the INTx line was shared with another
device, the ixgbe_legacy_irq() enabled the interrupt even if the interface
was down. Check the interface state and call functions appropriately.

Revision 1.14 / (download) - annotate - [select for diffs], Mon Apr 21 16:35:06 2014 UTC (10 years ago) by chs
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, rmind-smpnet-nbase, rmind-smpnet-base, nick-nhusb-base, netbsd-7-base
Branch point for: nick-nhusb, netbsd-7
Changes since 1.13: +4 -7 lines
Diff to previous 1.13 (colored) to selected 1.137 (colored)

only attach/detach stats->mngptc once.
remove a low-value printf().

Revision 1.13 / (download) - annotate - [select for diffs], Thu Apr 17 16:22:48 2014 UTC (10 years ago) by christos
Branch: MAIN
Changes since 1.12: +11 -7 lines
Diff to previous 1.12 (colored) to selected 1.137 (colored)

CID/1008347, CID/1008348, CID/1008349:  overflow before widen
CID/1203198, CID/1203199:  Uninitialized scalar variable

Revision 1.12 / (download) - annotate - [select for diffs], Tue Apr 15 12:37:59 2014 UTC (10 years ago) by hannken
Branch: MAIN
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored) to selected 1.137 (colored)

Add __diagused.

Revision 1.11 / (download) - annotate - [select for diffs], Fri Apr 11 06:50:26 2014 UTC (10 years ago) by joerg
Branch: MAIN
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored) to selected 1.137 (colored)

Mark ixgbe_disable_queue as unused.

Revision 1.10 / (download) - annotate - [select for diffs], Tue Apr 8 19:39:06 2014 UTC (10 years ago) by christos
Branch: MAIN
Changes since 1.9: +2 -1 lines
Diff to previous 1.9 (colored) to selected 1.137 (colored)

Add dell's flavor (from uwe, in current-users@)

Revision 1.9 / (download) - annotate - [select for diffs], Sun Mar 30 13:14:40 2014 UTC (10 years ago) by skrll
Branch: MAIN
CVS Tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
Branch point for: tls-earlyentropy
Changes since 1.8: +15 -13 lines
Diff to previous 1.8 (colored) to selected 1.137 (colored)

Make this compile

	- Fix pci_intr_string usage
	- Remove ununsed
	- define variables with their usage

kern/48690: ixg* driver doesn't compile

Untested.

Revision 1.8 / (download) - annotate - [select for diffs], Sat Mar 29 19:28:25 2014 UTC (10 years ago) by christos
Branch: MAIN
Changes since 1.7: +3 -2 lines
Diff to previous 1.7 (colored) to selected 1.137 (colored)

make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Feb 25 18:30:10 2014 UTC (10 years, 1 month ago) by pooka
Branch: MAIN
CVS Tags: riastradh-drm2-base3
Changes since 1.6: +2 -7 lines
Diff to previous 1.6 (colored) to selected 1.137 (colored)

Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.

Revision 1.6 / (download) - annotate - [select for diffs], Sun Feb 9 12:27:37 2014 UTC (10 years, 2 months ago) by njoly
Branch: MAIN
Changes since 1.5: +1 -14 lines
Diff to previous 1.5 (colored) to selected 1.137 (colored)

Remove a few noisy debug printf.

Revision 1.5 / (download) - annotate - [select for diffs], Mon Jun 18 06:21:11 2012 UTC (11 years, 10 months ago) by dsl
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, khorben-n900, agc-symver-base, agc-symver
Branch point for: tls-maxphys, rmind-smpnet
Changes since 1.4: +3 -3 lines
Diff to previous 1.4 (colored) to selected 1.137 (colored)

Missed one of the (void *) casts on the args to sysctl_createv().

Revision 1.4 / (download) - annotate - [select for diffs], Sat Jun 16 19:54:01 2012 UTC (11 years, 10 months ago) by dsl
Branch: MAIN
Changes since 1.3: +5 -5 lines
Diff to previous 1.3 (colored) to selected 1.137 (colored)

Add explicit (void *) casts for when sysctl_createv() is passed
CTLTYPE_INT but the address of a structure (and a function).

Revision 1.3 / (download) - annotate - [select for diffs], Sat Jun 2 21:36:45 2012 UTC (11 years, 10 months ago) by dsl
Branch: MAIN
Changes since 1.2: +3 -3 lines
Diff to previous 1.2 (colored) to selected 1.137 (colored)

Add some pre-processor magic to verify that the type of the data item
  passed to sysctl_createv() actually matches the declared type for
  the item itself.
In the places where the caller specifies a function and a structure
  address (typically the 'softc') an explicit (void *) cast is now needed.
Fixes bugs in sys/dev/acpi/asus_acpi.c sys/dev/bluetooth/bcsp.c
  sys/kern/vfs_bio.c sys/miscfs/syncfs/sync_subr.c and setting
  AcpiGbl_EnableAmlDebugObject.
(mostly passing the address of a uint64_t when typed as CTLTYPE_INT).
I've test built quite a few kernels, but there may be some unfixed MD
  fallout. Most likely passing &char[] to char *.
Also add CTLFLAG_UNSIGNED for unsiged decimals - not set yet.

Revision 1.2 / (download) - annotate - [select for diffs], Sat Nov 19 22:51:24 2011 UTC (12 years, 5 months ago) by tls
Branch: MAIN
CVS Tags: yamt-pagecache-base5, yamt-pagecache-base4, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base10, jmcneill-usbmp-base, jmcneill-usbmp
Branch point for: netbsd-6
Changes since 1.1: +2 -2 lines
Diff to previous 1.1 (colored) to selected 1.137 (colored)

First step of random number subsystem rework described in
<20111022023242.BA26F14A158@mail.netbsd.org>.  This change includes
the following:

	An initial cleanup and minor reorganization of the entropy pool
	code in sys/dev/rnd.c and sys/dev/rndpool.c.  Several bugs are
	fixed.  Some effort is made to accumulate entropy more quickly at
	boot time.

	A generic interface, "rndsink", is added, for stream generators to
	request that they be re-keyed with good quality entropy from the pool
	as soon as it is available.

	The arc4random()/arc4randbytes() implementation in libkern is
	adjusted to use the rndsink interface for rekeying, which helps
	address the problem of low-quality keys at boot time.

	An implementation of the FIPS 140-2 statistical tests for random
	number generator quality is provided (libkern/rngtest.c).  This
	is based on Greg Rose's implementation from Qualcomm.

	A new random stream generator, nist_ctr_drbg, is provided.  It is
	based on an implementation of the NIST SP800-90 CTR_DRBG by
	Henric Jungheim.  This generator users AES in a modified counter
	mode to generate a backtracking-resistant random stream.

	An abstraction layer, "cprng", is provided for in-kernel consumers
	of randomness.  The arc4random/arc4randbytes API is deprecated for
	in-kernel use.  It is replaced by "cprng_strong".  The current
	cprng_fast implementation wraps the existing arc4random
	implementation.  The current cprng_strong implementation wraps the
	new CTR_DRBG implementation.  Both interfaces are rekeyed from
	the entropy pool automatically at intervals justifiable from best
	current cryptographic practice.

	In some quick tests, cprng_fast() is about the same speed as
	the old arc4randbytes(), and cprng_strong() is about 20% faster
	than rnd_extract_data().  Performance is expected to improve.

	The AES code in src/crypto/rijndael is no longer an optional
	kernel component, as it is required by cprng_strong, which is
	not an optional kernel component.

	The entropy pool output is subjected to the rngtest tests at
	startup time; if it fails, the system will reboot.  There is
	approximately a 3/10000 chance of a false positive from these
	tests.  Entropy pool _input_ from hardware random numbers is
	subjected to the rngtest tests at attach time, as well as the
	FIPS continuous-output test, to detect bad or stuck hardware
	RNGs; if any are detected, they are detached, but the system
	continues to run.

	A problem with rndctl(8) is fixed -- datastructures with
	pointers in arrays are no longer passed to userspace (this
	was not a security problem, but rather a major issue for
	compat32).  A new kernel will require a new rndctl.

	The sysctl kern.arandom() and kern.urandom() nodes are hooked
	up to the new generators, but the /dev/*random pseudodevices
	are not, yet.

	Manual pages for the new kernel interfaces are forthcoming.

Revision 1.1 / (download) - annotate - [select for diffs], Fri Aug 12 21:55:29 2011 UTC (12 years, 8 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: yamt-pagecache
Diff to selected 1.137 (colored)

Add sources for ixgbe(4), a Intel 82599 10-gigabit ethernet driver
ported from FreeBSD.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>