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


Revision 1.325 / (download) - annotate - [select for diffs], Fri Feb 3 05:43:55 2023 UTC (24 hours ago) by msaitoh
Branch: MAIN
CVS Tags: HEAD
Changes since 1.324: +8 -5 lines
Diff to previous 1.324 (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.88.2.54 / (download) - annotate - [select for diffs], Mon Jan 23 14:07:24 2023 UTC (11 days, 15 hours ago) by martin
Branch: netbsd-8
Changes since 1.88.2.53: +8 -7 lines
Diff to previous 1.88.2.53 (colored) to branchpoint 1.88 (colored) next main 1.89 (colored)

Pull up the following revisions, requested by msaitoh in ticket #1796:

	sys/dev/pci/files.pci				1.442
	sys/dev/pci/ixgbe/ix_txrx.c			1.99-1.100
	sys/dev/pci/ixgbe/ixgbe.c			1.320-1.324 via patch
	sys/dev/pci/ixgbe/ixgbe_82598.c 		1.19
	sys/dev/pci/ixgbe/ixgbe_api.c			1.28
	sys/dev/pci/ixgbe/ixgbe_common.c		1.43
	sys/dev/pci/ixgbe/ixgbe_netbsd.h		1.17
	sys/dev/pci/ixgbe/ixv.c 			1.183

- Add an option for Tx to use deferred softint regardless of whether
  can get txq lock or not. It's off by default.
- Call txeof first, then rxeof for the consistency.
- Make three "Unsupported SFP+ module..." messages the same.
- KNF. Modify comment. Fix typo.

Revision 1.199.2.25 / (download) - annotate - [select for diffs], Mon Jan 23 14:04:42 2023 UTC (11 days, 15 hours ago) by martin
Branch: netbsd-9
Changes since 1.199.2.24: +11 -11 lines
Diff to previous 1.199.2.24 (colored) to branchpoint 1.199 (colored) next main 1.200 (colored)

Pull up the following revisions, requested by msaitoh in ticket #1579:

	sys/dev/pci/files.pci				1.442
	sys/dev/pci/ixgbe/ix_txrx.c			1.99-1.100
	sys/dev/pci/ixgbe/ixgbe.c			1.320-1.324 via patch
	sys/dev/pci/ixgbe/ixgbe_82598.c 		1.19
	sys/dev/pci/ixgbe/ixgbe_api.c			1.28
	sys/dev/pci/ixgbe/ixgbe_common.c		1.43
	sys/dev/pci/ixgbe/ixgbe_netbsd.h		1.17
	sys/dev/pci/ixgbe/ixv.c 			1.183

- Add an option for Tx to use deferred softint regardless of whether
  can get txq lock or not. It's off by default.
- Call txeof first, then rxeof for the consistency.
- Make three "Unsupported SFP+ module..." messages the same.
- KNF. Modify comment. Fix typo.

Revision 1.324 / (download) - annotate - [select for diffs], Fri Oct 28 01:10:41 2022 UTC (3 months, 1 week ago) by msaitoh
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10
Changes since 1.323: +4 -3 lines
Diff to previous 1.323 (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 (7 months 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)

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 (7 months, 2 weeks ago) by skrll
Branch: MAIN
Changes since 1.321: +3 -3 lines
Diff to previous 1.321 (colored)

aprintf_normal -> aprint_normal

Revision 1.88.2.53 / (download) - annotate - [select for diffs], Mon Jun 6 11:09:16 2022 UTC (7 months, 4 weeks ago) by martin
Branch: netbsd-8
Changes since 1.88.2.52: +3 -3 lines
Diff to previous 1.88.2.52 (colored) to branchpoint 1.88 (colored)

Apply patch, requested by msaitoh in ticket #1746:

	sys/dev/pci/ixgbe/ixgbe.c	(apply patch)

Fix the location of "break" statement. No functional change intended.

Revision 1.88.2.52 / (download) - annotate - [select for diffs], Fri Jun 3 12:31:10 2022 UTC (8 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.51: +367 -406 lines
Diff to previous 1.88.2.51 (colored) to branchpoint 1.88 (colored)

Pull up the following revisions, requestes by msaitoh in ticket #1746:

	sys/dev/pci/ixgbe/ix_txrx.c			1.95
	sys/dev/pci/ixgbe/ixgbe.c			1.261,1.263,
							1.265-1.268,1.273,
							1.275-1.277,1.305,
							1.312,
							1.316-1.321 via patch
	sys/dev/pci/ixgbe/ixgbe.h			1.85 via patch
	sys/dev/pci/ixgbe/ixgbe_mbx.c			1.19
	sys/dev/pci/ixgbe/ixgbe_netbsd.h		1.15-1.16
	sys/dev/pci/ixgbe/ixgbe_type.h			1.46-1.47
	sys/dev/pci/ixgbe/ixgbe_x550.c			1.26
	sys/dev/pci/ixgbe/ixv.c				1.178,1.182 via patch

- Reduce code duplication between ixgbe_msix_admin() and
  ixgbe_legacy_irq().
  - Add missing code which was not in ixgbe_msix_admin() from
    ixgbe_legacy_irq() and vice versa.
  - Reorder code.
- Disable/enable the OTHER interrupts correctly.
- 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.
- Print ECC, PHY and temp error log using with ratecheck().
- Correctly re-enable queue interrupt in ixgbe_legacy_irq().
- Correctly enter the recovery mode.
- No functional change:
  - Add some debug printf()s.
  - Don't use "more" flag for simplify.
  - Use macro.
  - Fix typos in comment.
  - KNF.

Revision 1.199.2.24 / (download) - annotate - [select for diffs], Fri Jun 3 04:00:49 2022 UTC (8 months ago) by snj
Branch: netbsd-9
CVS Tags: netbsd-9-3-RELEASE
Changes since 1.199.2.23: +3 -3 lines
Diff to previous 1.199.2.23 (colored) to branchpoint 1.199 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #1460):
	sys/dev/pci/ixgbe/ixgbe.c: patch
Fix previous to re-enable legacy interrupt correctly. It's a part of
ixgbe.c rev. 1.273.

Revision 1.321 / (download) - annotate - [select for diffs], Thu Jun 2 17:20:21 2022 UTC (8 months ago) by msaitoh
Branch: MAIN
Changes since 1.320: +3 -3 lines
Diff to previous 1.320 (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 (8 months ago) by msaitoh
Branch: MAIN
Changes since 1.319: +5 -6 lines
Diff to previous 1.319 (colored)

KNF. Modify comment. No functional change.

Revision 1.199.2.23 / (download) - annotate - [select for diffs], Thu Jun 2 10:45:12 2022 UTC (8 months ago) by martin
Branch: netbsd-9
Changes since 1.199.2.22: +177 -195 lines
Diff to previous 1.199.2.22 (colored) to branchpoint 1.199 (colored)

Pull up the following revisions, all via patch, requested by msaitoh
in ticket #1459:

	sys/dev/pci/ixgbe/ixgbe.c	1.261,1.265-1.268,1.273,1.275-1.277,
					1.312,1.316-1.319 via patch
	sys/dev/pci/ixgbe/ixgbe.h	1.85 via patch
	sys/dev/pci/ixgbe/ixgbe_type.h	1.46-1.47
	sys/dev/pci/ixgbe/ixgbe_x550.c	1.26
	sys/dev/pci/ixgbe/ixv.c		1.182

- Reduce code duplication between ixgbe_msix_admin() and
  ixgbe_legacy_irq().
  - Add missing code which was not in ixgbe_msix_admin() from
    ixgbe_legacy_irq() and vice versa.
  - Reorder code.
- Disable/enable the OTHER interrupts correctly.
- 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.
- Print ECC, PHY and temp error log using with ratecheck().
- Correctly re-enable queue interrupt in ixgbe_legacy_irq().
- Correctly enter the recovery mode.
- No functional change:
  - Add some debug printf()s.
  - Don't use "more" flag for simplify.
  - Fix typos in comment.
  - KNF.

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

KNF. No functional change.

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

Correctly enter the recovery mode. Not tested.

Revision 1.317 / (download) - annotate - [select for diffs], Wed Jun 1 04:15:41 2022 UTC (8 months ago) by msaitoh
Branch: MAIN
Changes since 1.316: +3 -3 lines
Diff to previous 1.316 (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 (8 months ago) by msaitoh
Branch: MAIN
Changes since 1.315: +3 -14 lines
Diff to previous 1.315 (colored)

Simplify ixgbe_msix_que(). No functional change.

Revision 1.88.2.51 / (download) - annotate - [select for diffs], Tue May 31 14:07:51 2022 UTC (8 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.50: +7 -7 lines
Diff to previous 1.88.2.50 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #1745):

	sys/dev/pci/ixgbe/ix_txrx.c: revision 1.98
	sys/dev/pci/ixgbe/ixv.c: revision 1.181
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.315
	sys/dev/pci/ixgbe/ixgbe.h: revision 1.86

bus_dmamem_unmap() before bus_dmamem_free(), otherwise we may give back meomry
which is still (and will stay) mapped.

Fixes one instance of "panic: HYPERVISOR_mmu_update failed" on Xen.
There may be others.

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

Remove unused adapter->msix_mem.

Revision 1.199.2.22 / (download) - annotate - [select for diffs], Tue May 31 14:03:26 2022 UTC (8 months ago) by martin
Branch: netbsd-9
Changes since 1.199.2.21: +7 -7 lines
Diff to previous 1.199.2.21 (colored) to branchpoint 1.199 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #1458):

	sys/dev/pci/ixgbe/ixv.c: revision 1.181
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.315
	sys/dev/pci/ixgbe/ixgbe.h: revision 1.86

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

Remove unused adapter->msix_mem.

Revision 1.88.2.50 / (download) - annotate - [select for diffs], Mon May 30 17:05:51 2022 UTC (8 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.49: +110 -55 lines
Diff to previous 1.88.2.49 (colored) to branchpoint 1.88 (colored)

Pull up the following revisions, requested by msaitoh in ticket #1744:

	sys/dev/pci/ixgbe/ixgbe.c			1.270,1.280,1.307-1.311,
							1.313-1.314 via patch
	sys/dev/pci/ixgbe/ix_txrx.c			1.96-1.97
	sys/dev/pci/ixgbe/ixv.c				1.179-1.180 via patch


- ixg(4): Print Printed Board Assembly (PBA) number.
- ixg(4): Add IFF_RUNNING check in ixgbe_legacy_irq() again. this might
  fix small race but it's not so dangerous.
- Add value check for {tx,rx}_process_limit sysctl to avoid setting
  wrong value.
- Add missing num_tx_desc sysctl.
- No functional change:
  - KNF a bit.
  - Simplify setting of EIAC register.
  - Move the definition of eicr_mask variable.
  - Enclose flow director stuff in ixgbe_intr_admin_common() with
    IXGBE_FIR which is not defined in NetBSD.
  - Modify comment for consistency.
  - Use cached rx_copy_len in ixgbe_rxeof().

Revision 1.199.2.21 / (download) - annotate - [select for diffs], Mon May 30 17:01:06 2022 UTC (8 months ago) by martin
Branch: netbsd-9
Changes since 1.199.2.20: +111 -56 lines
Diff to previous 1.199.2.20 (colored) to branchpoint 1.199 (colored)

Pull up the following revisions, requested by msaitoh:

	sys/dev/pci/ixgbe/ixgbe.c	1.270,1.280,1.307-1.311,
					1.313-1.314 via patch
	sys/dev/pci/ixgbe/ix_txrx.c	1.96-1.97
	sys/dev/pci/ixgbe/ixv.c		1.158,1.179-1.180 via patch


- ixg(4): Print Printed Board Assembly (PBA) number.
- ixg(4): Add IFF_RUNNING check in ixgbe_legacy_irq() again. this might
  fix small race but it's not so dangerous.
- Add value check for {tx,rx}_process_limit sysctl to avoid setting
  wrong value.
- Add missing num_tx_desc sysctl.
- No functional change:
  - KNF a bit.
  - Simplify setting of EIAC register.
  - Move the definition of eicr_mask variable.
  - Enclose flow director stuff in ixgbe_intr_admin_common() with
    IXGBE_FIR which is not defined in NetBSD.
  - Modify comment for consistency.
  - Use cached rx_copy_len in ixgbe_rxeof().

Revision 1.315 / (download) - annotate - [select for diffs], Mon May 30 05:07:38 2022 UTC (8 months ago) by msaitoh
Branch: MAIN
Changes since 1.314: +7 -7 lines
Diff to previous 1.314 (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 (9 months, 1 week ago) by msaitoh
Branch: MAIN
Changes since 1.313: +9 -3 lines
Diff to previous 1.313 (colored)

Add missing num_tx_desc sysctl.

Revision 1.313 / (download) - annotate - [select for diffs], Mon Apr 25 07:54:42 2022 UTC (9 months, 1 week ago) by msaitoh
Branch: MAIN
Changes since 1.312: +76 -42 lines
Diff to previous 1.312 (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 (10 months, 3 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.311: +38 -33 lines
Diff to previous 1.311 (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 (10 months, 3 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.310: +4 -2 lines
Diff to previous 1.310 (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 (10 months, 3 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.309: +4 -3 lines
Diff to previous 1.309 (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 (10 months, 3 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.308: +5 -4 lines
Diff to previous 1.308 (colored)

 Modify comment to clarify EIAC setting.

Revision 1.308 / (download) - annotate - [select for diffs], Thu Mar 10 03:53:46 2022 UTC (10 months, 3 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.307: +5 -3 lines
Diff to previous 1.307 (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 (11 months, 2 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.306: +7 -2 lines
Diff to previous 1.306 (colored)

Print Printed Board Assembly (PBA) number.

Revision 1.199.2.20 / (download) - annotate - [select for diffs], Wed Feb 2 14:25:49 2022 UTC (12 months ago) by martin
Branch: netbsd-9
Changes since 1.199.2.19: +194 -214 lines
Diff to previous 1.199.2.19 (colored) to branchpoint 1.199 (colored)

Pull up the following revisions (requested by msaitoh in ticket #1424):

	sys/dev/pci/ixgbe/ix_txrx.c			1.95
	sys/dev/pci/ixgbe/ixgbe.c			1.305 via patch
	sys/dev/pci/ixgbe/ixgbe_mbx.c			1.19
	sys/dev/pci/ixgbe/ixgbe_netbsd.h		1.15-1.16
	sys/dev/pci/ixgbe/ixv.c				1.178 via patch

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

Revision 1.88.2.49 / (download) - annotate - [select for diffs], Tue Feb 1 11:38:29 2022 UTC (12 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.48: +16 -10 lines
Diff to previous 1.88.2.48 (colored) to branchpoint 1.88 (colored)

Pull up the following revisions, requested by msaitoh in ticket #1734:

	sys/dev/pci/ixgbe/ixgbe.c			1.264,1.269,1.272,
							1.306 via patch

Four INTx related fixes:
- Fix a bug that the all interrupt sources are enabled when the
  interface is UP and the INTx line is shared with other devices.
- Fix a bug that it might incorrectly enable interrupt when
  IFF_RUNNING is not set.
- Don't process TX/RX if a queue interrupt isn't occurred.
- Increment legacy interrupt counter after checking INTx sharing.

Revision 1.199.2.19 / (download) - annotate - [select for diffs], Tue Feb 1 11:35:45 2022 UTC (12 months ago) by martin
Branch: netbsd-9
Changes since 1.199.2.18: +16 -10 lines
Diff to previous 1.199.2.18 (colored) to branchpoint 1.199 (colored)

Pull up the following revisions, requested by msaitoh in ticket #1420:

	sys/dev/pci/ixgbe/ixgbe.c			1.264,1.269,1.272,
							1.306 via patch

Four INTx related fixes:
- Fix a bug that the all interrupt sources are enabled when the
  interface is UP and the INTx line is shared with other devices.
- Fix a bug that it might incorrectly enable interrupt when
  IFF_RUNNING is not set.
- Don't process TX/RX if a queue interrupt isn't occurred.
- Increment legacy interrupt counter after checking INTx sharing.

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

Increment legacy interrupt counter after checking INTx sharing.

Revision 1.88.2.48 / (download) - annotate - [select for diffs], Mon Jan 31 17:38:36 2022 UTC (12 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.47: +3 -3 lines
Diff to previous 1.88.2.47 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #1730):

	sys/dev/pci/ixgbe/ixgbe_mbx.h: revision 1.19
	sys/dev/pci/ixgbe/ixgbe_vf.c: revision 1.31
	sys/dev/pci/ixgbe/ixgbe_x540.c: revision 1.23
	sys/dev/pci/ixgbe/if_sriov.c: revision 1.17
	sys/dev/pci/ixgbe/ixv.c: revision 1.172
	sys/dev/pci/ixgbe/ixv.c: revision 1.173
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.301
	sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.55
	sys/dev/pci/ixgbe/ixgbe_82599.c: revision 1.29
	sys/dev/pci/ixgbe/ixgbe_mbx.c: revision 1.16
	sys/dev/pci/ixgbe/ixgbe_mbx.c: revision 1.17
	sys/dev/pci/ixgbe/ixgbe_mbx.c: revision 1.18

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.

Enable mailbox API 1.5 support. Tested on ESXi with ixgben 1.10.3.0.

Don't clear mailbox related counters in ixgbe_upgrade_mbx_params_vf().
Don't clear mailbox related counters in ixgbe_upgrade_mbx_params_pf().

Revision 1.199.2.18 / (download) - annotate - [select for diffs], Mon Jan 31 17:36:25 2022 UTC (12 months ago) by martin
Branch: netbsd-9
Changes since 1.199.2.17: +3 -3 lines
Diff to previous 1.199.2.17 (colored) to branchpoint 1.199 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #1416):

	sys/dev/pci/ixgbe/ixgbe_mbx.h: revision 1.19
	sys/dev/pci/ixgbe/ixgbe_vf.c: revision 1.31
	sys/dev/pci/ixgbe/ixgbe_x540.c: revision 1.23
	sys/dev/pci/ixgbe/if_sriov.c: revision 1.17
	sys/dev/pci/ixgbe/ixv.c: revision 1.172
	sys/dev/pci/ixgbe/ixv.c: revision 1.173
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.301
	sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.55
	sys/dev/pci/ixgbe/ixgbe_82599.c: revision 1.29
	sys/dev/pci/ixgbe/ixgbe_mbx.c: revision 1.16
	sys/dev/pci/ixgbe/ixgbe_mbx.c: revision 1.17
	sys/dev/pci/ixgbe/ixgbe_mbx.c: revision 1.18

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.

Enable mailbox API 1.5 support. Tested on ESXi with ixgben 1.10.3.0.

Don't clear mailbox related counters in ixgbe_upgrade_mbx_params_vf().
Don't clear mailbox related counters in ixgbe_upgrade_mbx_params_pf().

Revision 1.88.2.47 / (download) - annotate - [select for diffs], Sun Jan 30 16:06:35 2022 UTC (12 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.46: +40 -26 lines
Diff to previous 1.88.2.46 (colored) to branchpoint 1.88 (colored)

Pull up the following, requested by msaitoh in ticket #1729:

	sys/dev/pci/ixgbe/if_sriov.c			1.12-1.16
	sys/dev/pci/ixgbe/ixgbe.c			1.295-1.297,1.300,1.304 via patch
	sys/dev/pci/ixgbe/ixgbe.h			1.84
	sys/dev/pci/ixgbe/ixgbe_82598.c			1.17-1.18
	sys/dev/pci/ixgbe/ixgbe_82598.h			1.9
	sys/dev/pci/ixgbe/ixgbe_82599.c			1.24-1.28
	sys/dev/pci/ixgbe/ixgbe_82599.h			1.8
	sys/dev/pci/ixgbe/ixgbe_api.c			1.26-1.27
	sys/dev/pci/ixgbe/ixgbe_api.h			1.16
	sys/dev/pci/ixgbe/ixgbe_bypass.h		1.3
	sys/dev/pci/ixgbe/ixgbe_common.c		1.34-1.42
	sys/dev/pci/ixgbe/ixgbe_common.h		1.15-1.16
	sys/dev/pci/ixgbe/ixgbe_dcb.c			1.12-1.13
	sys/dev/pci/ixgbe/ixgbe_dcb.h			1.8-1.9
	sys/dev/pci/ixgbe/ixgbe_dcb_82598.c		1.10-1.12
	sys/dev/pci/ixgbe/ixgbe_dcb_82598.h		1.8
	sys/dev/pci/ixgbe/ixgbe_dcb_82599.c		1.10-1.11
	sys/dev/pci/ixgbe/ixgbe_dcb_82599.h		1.8
	sys/dev/pci/ixgbe/ixgbe_fdir.h			1.4
	sys/dev/pci/ixgbe/ixgbe_features.h		1.4
	sys/dev/pci/ixgbe/ixgbe_mbx.c			1.13-1.15
	sys/dev/pci/ixgbe/ixgbe_mbx.h			1.15-1.18
	sys/dev/pci/ixgbe/ixgbe_netmap.c		1.5
	sys/dev/pci/ixgbe/ixgbe_osdep.c			1.8
	sys/dev/pci/ixgbe/ixgbe_osdep.h			1.31
	sys/dev/pci/ixgbe/ixgbe_phy.c			1.25-1.29
	sys/dev/pci/ixgbe/ixgbe_phy.h			1.13
	sys/dev/pci/ixgbe/ixgbe_rss.h			1.6
	sys/dev/pci/ixgbe/ixgbe_sriov.h			1.5
	sys/dev/pci/ixgbe/ixgbe_type.h			1.51-1.54
	sys/dev/pci/ixgbe/ixgbe_vf.c			1.28-1.29
	sys/dev/pci/ixgbe/ixgbe_vf.h			1.15
	sys/dev/pci/ixgbe/ixgbe_x540.c			1.20-1.22
	sys/dev/pci/ixgbe/ixgbe_x540.h			1.10
	sys/dev/pci/ixgbe/ixgbe_x550.c			1.21-1.25
	sys/dev/pci/ixgbe/ixgbe_x550.h			1.7
	sys/dev/pci/ixgbe/ixv.c				1.170, 1.174-1.175 via patch

- Add typecast for type mismatch.
- Fix retry count calculation of I2C read/write.
- Wait longer for link after fiber MAC setup.
- ixv(4): Use adapter->mta for the multicast array memory instead of
  the on-stack array.
- Match X550_PHY_ID correctly on X550.
- Print NVM image version on 82598.
- Use 64bit for lxon + lxoff.
- Don't expose garbage data of hw.ixvN.debug.
- Some NetBSD unrelated changes:
  - Fix infinite recursion on PCIe link down if VMDQ is used.
  - Move PF mailbox initialization from ixgbe_attach() to
    ixgbe_init_iov().
  - Add IPv6 mask for flow director.
  - Change error level in ixgbe_fc_autoneg().
  - Check host interface return status when writing NVM.
  - Change DCB credit parameters.
- Restore some mailbox related functions. Revert part of ixgbe_mbx.c
  rev. 1.7 and ixgbe_mbx.h rev. 1.11. No functional change.
- Rename IXGBE_VT_MSGTYPE_{ACK,NACK} to
  IXGBE_VT_MSGTYPE_{SUCCESS,FAILURE}. No functional change.
- Remove unused argument. Change argument.
- Remove unnecessary return value check.
- Remove debug error message.
- Remove dead code.
- Add some unused macros.
- Fix typo in comment.
- Rename some functions.
- Sort lines, modify comment.
- Whitespace fix.

Revision 1.199.2.17 / (download) - annotate - [select for diffs], Sun Jan 30 15:58:28 2022 UTC (12 months ago) by martin
Branch: netbsd-9
Changes since 1.199.2.16: +40 -26 lines
Diff to previous 1.199.2.16 (colored) to branchpoint 1.199 (colored)

Pull up the following revisions, requested by msaitoh in ticket #1414:

	sys/dev/pci/ixgbe/if_sriov.c			1.12-1.16
	sys/dev/pci/ixgbe/ixgbe.c			1.295-1.297,1.300,1.304 via patch
	sys/dev/pci/ixgbe/ixgbe.h			1.84
	sys/dev/pci/ixgbe/ixgbe_82598.c			1.17-1.18
	sys/dev/pci/ixgbe/ixgbe_82598.h			1.9
	sys/dev/pci/ixgbe/ixgbe_82599.c			1.24-1.28
	sys/dev/pci/ixgbe/ixgbe_82599.h			1.8
	sys/dev/pci/ixgbe/ixgbe_api.c			1.26-1.27
	sys/dev/pci/ixgbe/ixgbe_api.h			1.16
	sys/dev/pci/ixgbe/ixgbe_bypass.h		1.3
	sys/dev/pci/ixgbe/ixgbe_common.c		1.34-1.42
	sys/dev/pci/ixgbe/ixgbe_common.h		1.15-1.16
	sys/dev/pci/ixgbe/ixgbe_dcb.c			1.12-1.13
	sys/dev/pci/ixgbe/ixgbe_dcb.h			1.8-1.9
	sys/dev/pci/ixgbe/ixgbe_dcb_82598.c		1.10-1.12
	sys/dev/pci/ixgbe/ixgbe_dcb_82598.h		1.8
	sys/dev/pci/ixgbe/ixgbe_dcb_82599.c		1.10-1.11
	sys/dev/pci/ixgbe/ixgbe_dcb_82599.h		1.8
	sys/dev/pci/ixgbe/ixgbe_fdir.h			1.4
	sys/dev/pci/ixgbe/ixgbe_features.h		1.4
	sys/dev/pci/ixgbe/ixgbe_mbx.c			1.13-1.15
	sys/dev/pci/ixgbe/ixgbe_mbx.h			1.15-1.18
	sys/dev/pci/ixgbe/ixgbe_netmap.c		1.5
	sys/dev/pci/ixgbe/ixgbe_osdep.c			1.8
	sys/dev/pci/ixgbe/ixgbe_osdep.h			1.31
	sys/dev/pci/ixgbe/ixgbe_phy.c			1.25-1.29
	sys/dev/pci/ixgbe/ixgbe_phy.h			1.13
	sys/dev/pci/ixgbe/ixgbe_rss.h			1.6
	sys/dev/pci/ixgbe/ixgbe_sriov.h			1.5
	sys/dev/pci/ixgbe/ixgbe_type.h			1.51-1.54
	sys/dev/pci/ixgbe/ixgbe_vf.c			1.28-1.29
	sys/dev/pci/ixgbe/ixgbe_vf.h			1.15
	sys/dev/pci/ixgbe/ixgbe_x540.c			1.20-1.22
	sys/dev/pci/ixgbe/ixgbe_x540.h			1.10
	sys/dev/pci/ixgbe/ixgbe_x550.c			1.21-1.25
	sys/dev/pci/ixgbe/ixgbe_x550.h			1.7
	sys/dev/pci/ixgbe/ixv.c				1.170, 1.174-1.175 via patch

- Add typecast for type mismatch.
- Fix retry count calculation of I2C read/write.
- Wait longer for link after fiber MAC setup.
- ixv(4): Use adapter->mta for the multicast array memory instead of
  the on-stack array.
- Match X550_PHY_ID correctly on X550.
- Print NVM image version on 82598.
- Use 64bit for lxon + lxoff.
- Don't expose garbage data of hw.ixvN.debug.
- Some NetBSD unrelated changes:
  - Fix infinite recursion on PCIe link down if VMDQ is used.
  - Move PF mailbox initialization from ixgbe_attach() to
    ixgbe_init_iov().
  - Add IPv6 mask for flow director.
  - Change error level in ixgbe_fc_autoneg().
  - Check host interface return status when writing NVM.
  - Change DCB credit parameters.
- Restore some mailbox related functions. Revert part of ixgbe_mbx.c
  rev. 1.7 and ixgbe_mbx.h rev. 1.11. No functional change.
- Rename IXGBE_VT_MSGTYPE_{ACK,NACK} to
  IXGBE_VT_MSGTYPE_{SUCCESS,FAILURE}. No functional change.
- Remove unused argument. Change argument.
- Remove unnecessary return value check.
- Remove debug error message.
- Remove dead code.
- Add some unused macros.
- Fix typo in comment.
- Rename some functions.
- Sort lines, modify comment.
- Whitespace fix.

Revision 1.88.2.46 / (download) - annotate - [select for diffs], Sat Jan 29 16:36:07 2022 UTC (12 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.45: +33 -13 lines
Diff to previous 1.88.2.45 (colored) to branchpoint 1.88 (colored)

Pull up the following revisions, requested by msaitoh in ticket #1724:

	sys/dev/pci/ixgbe/ixgbe.c			1.298, 1.303 via patch

Add some missing error counters to ierror.

Revision 1.199.2.16 / (download) - annotate - [select for diffs], Sat Jan 29 16:33:10 2022 UTC (12 months ago) by martin
Branch: netbsd-9
Changes since 1.199.2.15: +33 -13 lines
Diff to previous 1.199.2.15 (colored) to branchpoint 1.199 (colored)

Pullup the following revisions, requested by msaitoh:

	sys/dev/pci/ixgbe/ixgbe.c			1.298, 1.303 via patch

Add some missing error counters to ierror.

Revision 1.305 / (download) - annotate - [select for diffs], Tue Jan 25 01:56:22 2022 UTC (12 months, 1 week ago) by msaitoh
Branch: MAIN
Changes since 1.304: +194 -214 lines
Diff to previous 1.304 (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 (12 months, 2 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.303: +4 -4 lines
Diff to previous 1.303 (colored)

Use 64bit for lxon + lxoff.

Revision 1.303 / (download) - annotate - [select for diffs], Mon Jan 17 08:45:10 2022 UTC (12 months, 2 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.302: +21 -18 lines
Diff to previous 1.302 (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 (13 months ago) by riastradh
Branch: MAIN
Changes since 1.301: +4 -4 lines
Diff to previous 1.301 (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 (13 months, 1 week ago) by msaitoh
Branch: MAIN
Changes since 1.300: +3 -3 lines
Diff to previous 1.300 (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 (13 months, 2 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.299: +19 -2 lines
Diff to previous 1.299 (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 (13 months, 2 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.298: +4 -5 lines
Diff to previous 1.298 (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 (13 months, 3 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.297: +26 -8 lines
Diff to previous 1.297 (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 (13 months, 3 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.296: +2 -5 lines
Diff to previous 1.296 (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 (13 months, 3 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.295: +20 -20 lines
Diff to previous 1.295 (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 (13 months, 3 weeks ago) by andvar
Branch: MAIN
Changes since 1.294: +3 -3 lines
Diff to previous 1.294 (colored)

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

Revision 1.88.2.45 / (download) - annotate - [select for diffs], Sat Nov 20 15:21:31 2021 UTC (14 months, 2 weeks ago) by martin
Branch: netbsd-8
Changes since 1.88.2.44: +9 -8 lines
Diff to previous 1.88.2.44 (colored) to branchpoint 1.88 (colored)

Pull up the following, requested by msaitoh in ticket #1708:

	sys/dev/pci/ixgbe/ixgbe.h			1.81-1.83
	sys/dev/pci/ixgbe/ixgbe.c			1.291-1.292 via patch
	sys/dev/pci/ixgbe/ixgbe_type.h			1.50
	sys/dev/pci/ixgbe/ixv.c				1.167-1.168 via patch
	sys/dev/pci/ixgbe/ix_txrx.c			1.94

- Fix a bug that a near 64KB TSO segment can't send.
- Reduce bus_dmamap_sync() cost.
- Use macro. Fix typos in comment.

Revision 1.199.2.15 / (download) - annotate - [select for diffs], Sat Nov 20 15:16:53 2021 UTC (14 months, 2 weeks ago) by martin
Branch: netbsd-9
Changes since 1.199.2.14: +9 -8 lines
Diff to previous 1.199.2.14 (colored) to branchpoint 1.199 (colored)

Pull up the following, requested by msaitoh in ticket #1374:

	sys/dev/pci/ixgbe/ixgbe.h			1.81-1.83
	sys/dev/pci/ixgbe/ixgbe.c			1.291-1.292 via patch
	sys/dev/pci/ixgbe/ixgbe_type.h			1.50
	sys/dev/pci/ixgbe/ixv.c				1.167-1.168 via patch
	sys/dev/pci/ixgbe/ix_txrx.c			1.94

- Fix a bug that a near 64KB TSO segment can't send.
- Reduce bus_dmamap_sync() cost.
- Use macro. Fix typos in comment.

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

KNF

Revision 1.293 / (download) - annotate - [select for diffs], Thu Sep 30 04:06:50 2021 UTC (16 months ago) by yamaguchi
Branch: MAIN
Changes since 1.292: +6 -13 lines
Diff to previous 1.292 (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 (16 months, 2 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.291: +8 -7 lines
Diff to previous 1.291 (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 (16 months, 2 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.290: +3 -3 lines
Diff to previous 1.290 (colored)

Use IXGBE_TXDCTL_WTHRESH_SHIFT macro. No functional change.

Revision 1.88.2.44 / (download) - annotate - [select for diffs], Wed Sep 15 16:38:00 2021 UTC (16 months, 2 weeks ago) by martin
Branch: netbsd-8
Changes since 1.88.2.43: +148 -77 lines
Diff to previous 1.88.2.43 (colored) to branchpoint 1.88 (colored)

Pull up the following (all via patch), requested by msaitoh in ticket #1696:

	sysdev/pci/ixgbe/ixgbe.c			1.252, 1.280-1.283, 1.286-1.287, 1.289-1.290 via patch
	sysdev/pci/ixgbe/ixgbe.h			1.73, 1.76-1.80 via patch
	sysdev/pci/ixgbe/ix_txrx.c			1.68-1.93
	sysdev/pci/ixgbe/ixv.c				1.153, 1.157-1.161, 1.163-1.166 via patch
	sysdev/pci/ixgbe/if_bypass.c			1.7-1.9
	sysdev/pci/ixgbe/if_fdir.c			1.4-1.5
	sysdev/pci/ixgbe/if_sriov.c			1.10-1.11
	sysdev/pci/ixgbe/ixgbe_82598.c			1.16
	sysdev/pci/ixgbe/ixgbe_82599.c			1.23
	sysdev/pci/ixgbe/ixgbe_api.c			1.25
	sysdev/pci/ixgbe/ixgbe_bypass.h			1.2
	sysdev/pci/ixgbe/ixgbe_common.c			1.30-1.33
	sysdev/pci/ixgbe/ixgbe_dcb.c			1.10-1.11
	sysdev/pci/ixgbe/ixgbe_dcb.h			1.7
	sysdev/pci/ixgbe/ixgbe_dcb_82598.c		1.8-1.9
	sysdev/pci/ixgbe/ixgbe_dcb_82598.h		1.7
	sysdev/pci/ixgbe/ixgbe_dcb_82599.c		1.8-1.9
	sysdev/pci/ixgbe/ixgbe_dcb_82599.h		1.7
	sysdev/pci/ixgbe/ixgbe_fdir.h			1.3
	sysdev/pci/ixgbe/ixgbe_features.h		1.3
	sysdev/pci/ixgbe/ixgbe_mbx.c			1.12
	sysdev/pci/ixgbe/ixgbe_netbsd.c			1.16-1.17
	sysdev/pci/ixgbe/ixgbe_netbsd.h			1.13-1.14
	sysdev/pci/ixgbe/ixgbe_netmap.c			1.3-1.4
	sysdev/pci/ixgbe/ixgbe_netmap.h			1.2
	sysdev/pci/ixgbe/ixgbe_osdep.c			1.7
	sysdev/pci/ixgbe/ixgbe_osdep.h			1.29-1.30
	sysdev/pci/ixgbe/ixgbe_phy.c			1.24
	sysdev/pci/ixgbe/ixgbe_rss.h			1.5
	sysdev/pci/ixgbe/ixgbe_sriov.h			1.4
	sysdev/pci/ixgbe/ixgbe_type.h			1.49
	sysdev/pci/ixgbe/ixgbe_vf.c			1.27
	sysdev/pci/ixgbe/ixgbe_x540.c			1.18-1.19
	sysdev/pci/ixgbe/ixgbe_x540.h			1.9
	sysdev/pci/ixgbe/ixgbe_x550.c			1.19-1.20
	sysdev/pci/ixgbe/ixgbe_x550.h			1.6
	sysdev/pci/files.pci				1.438
	share/man/man4/ixg.4				1.15
	share/man/man4/ixv.4				1.8

- 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.
- Improve performance:
  - Use m_adj(ETHER_ALIGN) more.
  - Sprinkle __predict_false() in the RX path.
  - Don't pre-allocate a cluster for RXCOPY case to improve short
    packet's performance.
- Call bus_dmamap_unload(9) via ixgbe_dmamap_unload(), before freeing
  DMA buffer. Also, when the buffer is already freed, do not call
  bus_dmamap_unload(9) (no resource leaks with this change). This
  change is required to make ixg(4) work on alpha.
- Keep m_len and m_pkthdr.len consistent to prevent panic on arm.
- Fix panic when bus_dmamap_load_mbuf() failed in
  ixgbe_setup_receive_ring().
- Added BUS_DMA_COHERENT flag to bus_dmamem_map() to improve stability
  on aarch64.
- Use uint64_t instead of bus_addr_t for the TX descriptor's buffer
  address. At least, this change is required for macppc
  (sizeof(bus_addr_t) == 4) to make TX work.
- Fix little-endian dependence.
- Set rxr->next_to_refresh correctly in ixgbe_setup_receive_ring().
- Refresh unrefreshed descriptors' buffers correctly.
- Don't call bus_dmamap_sync with rx_mbuf_sz(== MCLBYTES) to prevent
  panic.
- Save the discard_multidesc state to not to forget the state by
  exiting rxeof().
- Add missing increment of no_mbuf error counter.
- Don't increment no_mbuf evcnt(9) when discarding multi-descriptor
  packet.
- ixv: Modify error message to sync with ixgbe.c
- Print the error value of ixgbe_reset_hw() for debugging.
- Remove extra unlock/lock processing around if_percpuq_enqueue().
- Refactor rxr->next_to_check updating.
- Add new sysctl "rx_copy_len".
- Add a new sysctl to read rxr->next_to_refresh.
- Print error number when error occurred.
- Rename ix{gbe,v}_stop() with ix{gbe,v}_stop_locked(). No functional
  change.
- Don't use fixed value.
- Comment out flow director processing in fast path.
- Add missing NetBSD RCS IDs and __KERNEL_RCSID()s.
- KNF.
- Fix typos.

Revision 1.199.2.14 / (download) - annotate - [select for diffs], Wed Sep 15 16:30:50 2021 UTC (16 months, 2 weeks ago) by martin
Branch: netbsd-9
Changes since 1.199.2.13: +148 -77 lines
Diff to previous 1.199.2.13 (colored) to branchpoint 1.199 (colored)

Pull up the following (via patch), requested by msaitoh in ticket #1346:

	sys/dev/pci/ixgbe/ixgbe.c			1.252, 1.280-1.283, 1.286-1.287, 1.289-1.290 via patch
	sys/dev/pci/ixgbe/ixgbe.h			1.73, 1.76-1.80 via patch
	sys/dev/pci/ixgbe/ix_txrx.c			1.68-1.93
	sys/dev/pci/ixgbe/ixv.c				1.153, 1.157-1.161, 1.163-1.166 via patch
	sys/dev/pci/ixgbe/if_bypass.c			1.7-1.9
	sys/dev/pci/ixgbe/if_fdir.c			1.4-1.5
	sys/dev/pci/ixgbe/if_sriov.c			1.10-1.11
	sys/dev/pci/ixgbe/ixgbe_82598.c			1.16
	sys/dev/pci/ixgbe/ixgbe_82599.c			1.23
	sys/dev/pci/ixgbe/ixgbe_api.c			1.25
	sys/dev/pci/ixgbe/ixgbe_bypass.h		1.2
	sys/dev/pci/ixgbe/ixgbe_common.c		1.30-1.33
	sys/dev/pci/ixgbe/ixgbe_dcb.c			1.10-1.11
	sys/dev/pci/ixgbe/ixgbe_dcb.h			1.7
	sys/dev/pci/ixgbe/ixgbe_dcb_82598.c		1.8-1.9
	sys/dev/pci/ixgbe/ixgbe_dcb_82598.h		1.7
	sys/dev/pci/ixgbe/ixgbe_dcb_82599.c		1.8-1.9
	sys/dev/pci/ixgbe/ixgbe_dcb_82599.h		1.7
	sys/dev/pci/ixgbe/ixgbe_fdir.h			1.3
	sys/dev/pci/ixgbe/ixgbe_features.h		1.3
	sys/dev/pci/ixgbe/ixgbe_mbx.c			1.12
	sys/dev/pci/ixgbe/ixgbe_netbsd.c		1.13, 1.16-1.17
	sys/dev/pci/ixgbe/ixgbe_netbsd.h		1.13-1.14
	sys/dev/pci/ixgbe/ixgbe_netmap.c		1.3-1.4
	sys/dev/pci/ixgbe/ixgbe_netmap.h		1.2
	sys/dev/pci/ixgbe/ixgbe_osdep.c			1.7
	sys/dev/pci/ixgbe/ixgbe_osdep.h			1.29-1.30
	sys/dev/pci/ixgbe/ixgbe_phy.c			1.24
	sys/dev/pci/ixgbe/ixgbe_rss.h			1.5
	sys/dev/pci/ixgbe/ixgbe_sriov.h			1.4
	sys/dev/pci/ixgbe/ixgbe_type.h			1.49
	sys/dev/pci/ixgbe/ixgbe_vf.c			1.27
	sys/dev/pci/ixgbe/ixgbe_x540.c			1.18-1.19
	sys/dev/pci/ixgbe/ixgbe_x540.h			1.9
	sys/dev/pci/ixgbe/ixgbe_x550.c			1.19-1.20
	sys/dev/pci/ixgbe/ixgbe_x550.h			1.6
	sys/dev/pci/files.pci				1.438
	share/man/man4/ixg.4				1.15
	share/man/man4/ixv.4				1.8

- 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.
- Improve performance:
  - Use m_adj(ETHER_ALIGN) more.
  - Sprinkle __predict_false() in the RX path.
  - Don't pre-allocate a cluster for RXCOPY case to improve short
    packet's performance.
- Call bus_dmamap_unload(9) via ixgbe_dmamap_unload(), before freeing
  DMA buffer. Also, when the buffer is already freed, do not call
  bus_dmamap_unload(9) (no resource leaks with this change). This
  change is required to make ixg(4) work on alpha.
- Keep m_len and m_pkthdr.len consistent to prevent panic on arm.
- Fix panic when bus_dmamap_load_mbuf() failed in
  ixgbe_setup_receive_ring().
- Added BUS_DMA_COHERENT flag to bus_dmamem_map() to improve stability
  on aarch64.
- Use uint64_t instead of bus_addr_t for the TX descriptor's buffer
  address. At least, this change is required for macppc
  (sizeof(bus_addr_t) == 4) to make TX work.
- Fix little-endian dependence.
- Set rxr->next_to_refresh correctly in ixgbe_setup_receive_ring().
- Refresh unrefreshed descriptors' buffers correctly.
- Don't call bus_dmamap_sync with rx_mbuf_sz(== MCLBYTES) to prevent
  panic.
- Save the discard_multidesc state to not to forget the state by
  exiting rxeof().
- Add missing increment of no_mbuf error counter.
- Don't increment no_mbuf evcnt(9) when discarding multi-descriptor
  packet.
- ixv: Modify error message to sync with ixgbe.c
- Print the error value of ixgbe_reset_hw() for debugging.
- Remove extra unlock/lock processing around if_percpuq_enqueue().
- Refactor rxr->next_to_check updating.
- Add new sysctl "rx_copy_len".
- Add a new sysctl to read rxr->next_to_refresh.
- Print error number when error occurred.
- Rename ix{gbe,v}_stop() with ix{gbe,v}_stop_locked(). No functional
  change.
- Don't use fixed value.
- Comment out flow director processing in fast path.
- Add missing NetBSD RCS IDs and __KERNEL_RCSID()s.
- KNF.
- Fix typos.

Revision 1.290 / (download) - annotate - [select for diffs], Thu Aug 26 09:03:47 2021 UTC (17 months, 1 week ago) by msaitoh
Branch: MAIN
Changes since 1.289: +6 -6 lines
Diff to previous 1.289 (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 (17 months, 1 week ago) by msaitoh
Branch: MAIN
Changes since 1.288: +4 -17 lines
Diff to previous 1.288 (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 (17 months, 2 weeks ago) by andvar
Branch: MAIN
Changes since 1.287: +3 -3 lines
Diff to previous 1.287 (colored)

fix various typos in comments and log messages.

Revision 1.280.2.3 / (download) - annotate - [select for diffs], Sun Aug 1 22:42:30 2021 UTC (18 months ago) by thorpej
Branch: thorpej-i2c-spi-conf
Changes since 1.280.2.2: +75 -4 lines
Diff to previous 1.280.2.2 (colored) to branchpoint 1.280 (colored) next main 1.281 (colored)

Sync with HEAD.

Revision 1.287 / (download) - annotate - [select for diffs], Thu Jul 15 08:09:31 2021 UTC (18 months, 3 weeks 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)

 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 (18 months, 4 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.285: +38 -2 lines
Diff to previous 1.285 (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 (19 months ago) by pgoyette
Branch: MAIN
Changes since 1.284: +5 -4 lines
Diff to previous 1.284 (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.280.2.2 / (download) - annotate - [select for diffs], Thu Jun 17 04:46:29 2021 UTC (19 months, 2 weeks ago) by thorpej
Branch: thorpej-i2c-spi-conf
Changes since 1.280.2.1: +10 -13 lines
Diff to previous 1.280.2.1 (colored) to branchpoint 1.280 (colored)

Sync w/ HEAD.

Revision 1.284 / (download) - annotate - [select for diffs], Wed Jun 16 00:21:18 2021 UTC (19 months, 2 weeks ago) by riastradh
Branch: MAIN
Changes since 1.283: +3 -8 lines
Diff to previous 1.283 (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.282.2.1 / (download) - annotate - [select for diffs], Mon May 31 22:15:18 2021 UTC (20 months ago) by cjep
Branch: cjep_staticlib_x
Changes since 1.282: +9 -7 lines
Diff to previous 1.282 (colored) next main 1.283 (colored)

sync with head

Revision 1.283 / (download) - annotate - [select for diffs], Tue May 18 05:29:16 2021 UTC (20 months, 2 weeks 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)

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

Revision 1.280.2.1 / (download) - annotate - [select for diffs], Thu May 13 00:47:31 2021 UTC (20 months, 3 weeks ago) by thorpej
Branch: thorpej-i2c-spi-conf
Changes since 1.280: +6 -2 lines
Diff to previous 1.280 (colored)

Sync with HEAD.

Revision 1.282 / (download) - annotate - [select for diffs], Fri May 7 09:15:52 2021 UTC (20 months, 4 weeks 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)

 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 (21 months ago) by msaitoh
Branch: MAIN
Changes since 1.280: +4 -1 lines
Diff to previous 1.280 (colored)

 Add missing __KERNEL_RCSID().

Revision 1.258.2.3 / (download) - annotate - [select for diffs], Sat Apr 3 22:28:49 2021 UTC (22 months ago) by thorpej
Branch: thorpej-futex
Changes since 1.258.2.2: +62 -42 lines
Diff to previous 1.258.2.2 (colored) next main 1.259 (colored)

Sync with HEAD.

Revision 1.279.2.1 / (download) - annotate - [select for diffs], Sat Apr 3 21:44:53 2021 UTC (22 months ago) by thorpej
Branch: thorpej-cfargs
Changes since 1.279: +51 -41 lines
Diff to previous 1.279 (colored) next main 1.280 (colored)

Sync with HEAD.

Revision 1.280 / (download) - annotate - [select for diffs], Wed Mar 31 07:53:53 2021 UTC (22 months 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)

KNF a bit. No functional change.

Revision 1.88.2.43 / (download) - annotate - [select for diffs], Thu Mar 11 16:04:25 2021 UTC (22 months, 3 weeks ago) by martin
Branch: netbsd-8
Changes since 1.88.2.42: +14 -4 lines
Diff to previous 1.88.2.42 (colored) to branchpoint 1.88 (colored)

Pull up the following (all via patch), requested by msaitoh in ticket #1663:

	sys/dev/pci/ixgbe/ixgbe.c			1.259, 1.278-1.279
	sys/dev/pci/ixgbe/ixgbe.h			1.75
	sys/dev/pci/ixgbe/ixgbe_netbsd.h		1.12
	sys/dev/pci/ixgbe/ixgbe_vf.c			1.24-1.26
	sys/dev/pci/ixgbe/ixgbe_x550.c			1.17
	sys/dev/pci/ixgbe/ixv.c				1.155-1.156
	sys/dev/pci/ixgbe/ix_txrx.c			1.64-67
	sys/dev/pci/files.pci				1.436
	share/man/man4/ixg.4				1.13-1.14
	share/man/man4/ixv.4				1.3, 1.6-1.7

- Fix a problem that the RX path stalled when the mbuf cluster is
  exhausted.
- Modify some parameters to reduce packet dropping. See also the
  manual's OPTIONS section for the detail.
- ixv(4): The max number of queue(pair) is not 7 but 8. Correctly
  reset the hardware.
- Add "TX " to "Queue No Descriptor Available" evcnt(9) name to make
  it more understandable.
- 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.
- Fix typo in comment or debug message.

Revision 1.199.2.13 / (download) - annotate - [select for diffs], Thu Mar 11 16:00:24 2021 UTC (22 months, 3 weeks ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-2-RELEASE
Changes since 1.199.2.12: +14 -4 lines
Diff to previous 1.199.2.12 (colored) to branchpoint 1.199 (colored)

Pull up the following (all via patch) requested by msaitoh in ticket #1231:

	sys/dev/pci/ixgbe/ixgbe.c			1.259, 1.278-1.279
	sys/dev/pci/ixgbe/ixgbe.h			1.75
	sys/dev/pci/ixgbe/ixgbe_netbsd.h		1.12
	sys/dev/pci/ixgbe/ixgbe_vf.c			1.24-1.26
	sys/dev/pci/ixgbe/ixgbe_x550.c			1.17
	sys/dev/pci/ixgbe/ixv.c				1.155-1.156
	sys/dev/pci/ixgbe/ix_txrx.c			1.64-67
	sys/dev/pci/files.pci				1.436
	share/man/man4/ixg.4				1.13-1.14
	share/man/man4/ixv.4				1.6-1.7

- Fix a problem that the RX path stalled when the mbuf cluster is
  exhausted.
- Modify some parameters to reduce packet dropping. See also the
  manual's OPTIONS section for the detail.
- ixv(4): The max number of queue(pair) is not 7 but 8. Correctly
  reset the hardware.
- Add "TX " to "Queue No Descriptor Available" evcnt(9) name to make
  it more understandable.
- 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.
- Fix typo in comment or debug message.

Revision 1.279 / (download) - annotate - [select for diffs], Tue Mar 9 10:03:18 2021 UTC (22 months, 3 weeks ago) by msaitoh
Branch: MAIN
Branch point for: thorpej-cfargs
Changes since 1.278: +11 -1 lines
Diff to previous 1.278 (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 (2 years ago) by msaitoh
Branch: MAIN
Changes since 1.277: +2 -2 lines
Diff to previous 1.277 (colored)

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

Revision 1.258.2.2 / (download) - annotate - [select for diffs], Sun Jan 3 16:35:01 2021 UTC (2 years, 1 month ago) by thorpej
Branch: thorpej-futex
Changes since 1.258.2.1: +135 -146 lines
Diff to previous 1.258.2.1 (colored)

Sync w/ HEAD.

Revision 1.277 / (download) - annotate - [select for diffs], Thu Dec 31 12:34:33 2020 UTC (2 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.276: +34 -136 lines
Diff to previous 1.276 (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 (2 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.275: +56 -1 lines
Diff to previous 1.275 (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 (2 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.274: +6 -7 lines
Diff to previous 1.274 (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 (2 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.273: +25 -6 lines
Diff to previous 1.273 (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 (2 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.272: +73 -42 lines
Diff to previous 1.272 (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 (2 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.271: +5 -4 lines
Diff to previous 1.271 (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 (2 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.270: +5 -14 lines
Diff to previous 1.270 (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 (2 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.269: +6 -8 lines
Diff to previous 1.269 (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 (2 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.268: +8 -2 lines
Diff to previous 1.268 (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 (2 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.267: +2 -5 lines
Diff to previous 1.267 (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 (2 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.266: +1 -10 lines
Diff to previous 1.266 (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 (2 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.265: +15 -15 lines
Diff to previous 1.265 (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 (2 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.264: +11 -6 lines
Diff to previous 1.264 (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 (2 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.263: +1 -3 lines
Diff to previous 1.263 (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 (2 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.262: +2 -2 lines
Diff to previous 1.262 (colored)

 Correctly ACK the fan failure interrupt in ixgbe_legacy_irq().

Revision 1.258.2.1 / (download) - annotate - [select for diffs], Mon Dec 14 14:38:09 2020 UTC (2 years, 1 month ago) by thorpej
Branch: thorpej-futex
Changes since 1.258: +76 -73 lines
Diff to previous 1.258 (colored)

Sync w/ HEAD.

Revision 1.262 / (download) - annotate - [select for diffs], Fri Dec 11 05:01:19 2020 UTC (2 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.261: +7 -13 lines
Diff to previous 1.261 (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 (2 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.260: +14 -6 lines
Diff to previous 1.260 (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 (2 years, 2 months ago) by knakahara
Branch: MAIN
Changes since 1.259: +55 -54 lines
Diff to previous 1.259 (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 (2 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.258: +3 -3 lines
Diff to previous 1.258 (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 (2 years, 4 months ago) by knakahara
Branch: MAIN
Branch point for: thorpej-futex
Changes since 1.257: +8 -2 lines
Diff to previous 1.257 (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 (2 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.256: +16 -10 lines
Diff to previous 1.256 (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 (2 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.255: +3 -3 lines
Diff to previous 1.255 (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 (2 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.254: +6 -4 lines
Diff to previous 1.254 (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.199.2.12 / (download) - annotate - [select for diffs], Wed Sep 2 12:34:55 2020 UTC (2 years, 5 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-1-RELEASE
Changes since 1.199.2.11: +2 -2 lines
Diff to previous 1.199.2.11 (colored) to branchpoint 1.199 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #1070):

	sys/dev/pci/ixgbe/if_bypass.c: revision 1.6
	sys/dev/pci/ixgbe/ixgbe_common.c: revision 1.28
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.246

Fix checking return value of atomic_cas_uint().

This change fixes a bug that extra delay() is called only once even if
atomic_cas_uint() isn't failed or delay() isn't called when atomic_cas_uint()
failed.

The reason of this bug was that I simply converted FreeBSD' atomic_cmpset_int()
to atomic_cas_uint(). The return value's semantics is different.

 -

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

Revision 1.88.2.42 / (download) - annotate - [select for diffs], Wed Sep 2 12:27:54 2020 UTC (2 years, 5 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.41: +51 -32 lines
Diff to previous 1.88.2.41 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #1601):

	sys/dev/pci/ixgbe/ixgbe_82598.c: revision 1.13
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.219
	sys/dev/pci/ixgbe/ixgbe_phy.c: revision 1.20
	sys/dev/pci/ixgbe/ixgbe_x550.c: revision 1.17
	sys/dev/pci/ixgbe/ixgbe_82599.c: revision 1.22
	sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.44

Add recovery code for unsupported SFP+.

Before this commit:
   If an unsupported SFP module is inserted before booting, the driver attach
   failed and there was no way to recover form it without rebooting or
   detaching/reattaching driver (drvctl -d && drvctl -r pciN).

After this commit:
   We can automatically recover any time by replacing it with a supported
   module.

Revision 1.88.2.41 / (download) - annotate - [select for diffs], Wed Sep 2 12:24:08 2020 UTC (2 years, 5 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.40: +2 -2 lines
Diff to previous 1.88.2.40 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #1600):

	sys/dev/pci/ixgbe/if_bypass.c: revision 1.6
	sys/dev/pci/ixgbe/ixgbe_common.c: revision 1.28
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.246

Fix checking return value of atomic_cas_uint().

This change fixes a bug that extra delay() is called only once even if
atomic_cas_uint() isn't failed or delay() isn't called when atomic_cas_uint()
failed.

The reason of this bug was that I simply converted FreeBSD' atomic_cmpset_int()
to atomic_cas_uint(). The return value's semantics is different.

 -

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

Revision 1.254 / (download) - annotate - [select for diffs], Tue Sep 1 04:19:16 2020 UTC (2 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.253: +9 -5 lines
Diff to previous 1.253 (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 (2 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.252: +9 -14 lines
Diff to previous 1.252 (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 (2 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.251: +16 -15 lines
Diff to previous 1.251 (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 (2 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.250: +7 -55 lines
Diff to previous 1.250 (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 (2 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.249: +3 -3 lines
Diff to previous 1.249 (colored)

 Fix typo in comment.

Revision 1.249 / (download) - annotate - [select for diffs], Mon Aug 31 06:20:06 2020 UTC (2 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.248: +39 -9 lines
Diff to previous 1.248 (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 (2 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.247: +20 -13 lines
Diff to previous 1.247 (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 (2 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.246: +2 -2 lines
Diff to previous 1.246 (colored)

 Fix compile error.

Revision 1.246 / (download) - annotate - [select for diffs], Thu Aug 27 03:57:52 2020 UTC (2 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.245: +2 -2 lines
Diff to previous 1.245 (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 (2 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.244: +33 -5 lines
Diff to previous 1.244 (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 (2 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.243: +4 -2 lines
Diff to previous 1.243 (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 (2 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.242: +5 -8 lines
Diff to previous 1.242 (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 (2 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.241: +13 -2 lines
Diff to previous 1.241 (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 (2 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.240: +20 -14 lines
Diff to previous 1.240 (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 (2 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.239: +4 -2 lines
Diff to previous 1.239 (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 (2 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.238: +6 -8 lines
Diff to previous 1.238 (colored)

 Simplify SFP+ check. No functional change.

Revision 1.238 / (download) - annotate - [select for diffs], Mon Aug 17 07:59:06 2020 UTC (2 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.237: +12 -7 lines
Diff to previous 1.237 (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 (2 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.236: +27 -39 lines
Diff to previous 1.236 (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 (2 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.235: +8 -1 lines
Diff to previous 1.235 (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 (2 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.234: +3 -1 lines
Diff to previous 1.234 (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 (2 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.233: +11 -15 lines
Diff to previous 1.233 (colored)

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

Revision 1.88.2.40 / (download) - annotate - [select for diffs], Wed Aug 5 15:58:02 2020 UTC (2 years, 6 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.39: +20 -18 lines
Diff to previous 1.88.2.39 (colored) to branchpoint 1.88 (colored)

Pull up the following revisions, requested by msaitoh in ticket #1587:

	sys/dev/pci/ixgbe/ix_txrx.c			1.62-1.63 via patch
	sys/dev/pci/ixgbe/ixgbe.c			1.225, 1.228-1.229,
							1.232 via patch
	sys/dev/pci/ixgbe/ixgbe.h			1.64, 1.66
	sys/dev/pci/ixgbe/ixv.c				1.146, 1.148-1.150
							via patch
	sys/dev/pci/ixgbe/ixgbe_common.c		1.27
	sys/dev/pci/ixgbe/ixgbe_vf.c			1.23
	sys/dev/pci/ixgbe/ixgbe_82598.c			1.15
	sys/dev/pci/ixgbe/ixgbe_x550.c			1.18
	sys/dev/pci/ixgbe/ixgbe_netbsd.c		1.14
	sys/dev/pci/ixgbe/ixgbe_phy.c			1.21
	sys/dev/pci/ixgbe/ixgbe_osdep.h			1.26

- Fix IXGBE_LE32_TO_CPUS() macro for big endian machine. This problem
  was only on X550.
- Add debug printf()s.
- Use unsigned to avoid undefined behavior in
  ixgbe_fc_enable_generic().
- Modify a little to reduce diff between ixgbe.c and ixv.c.
  No functional change.
- Modify comment.
- Remove unused macros.
- Whitespace fix.
- Fix typos.

Revision 1.199.2.11 / (download) - annotate - [select for diffs], Fri Jul 10 11:35:51 2020 UTC (2 years, 6 months ago) by martin
Branch: netbsd-9
Changes since 1.199.2.10: +20 -18 lines
Diff to previous 1.199.2.10 (colored) to branchpoint 1.199 (colored)

Pull up the following revisions, requested by msaitoh in ticket #997:

	sys/dev/pci/ixgbe/ix_txrx.c			1.62-1.63 via patch
	sys/dev/pci/ixgbe/ixgbe.c			1.225, 1.228-1.229,
							1.232 via patch
	sys/dev/pci/ixgbe/ixgbe.h			1.64, 1.66
	sys/dev/pci/ixgbe/ixv.c				1.146, 1.148-1.150
	sys/dev/pci/ixgbe/ixgbe_common.c		1.27
	sys/dev/pci/ixgbe/ixgbe_vf.c			1.23
	sys/dev/pci/ixgbe/ixgbe_82598.c			1.15
	sys/dev/pci/ixgbe/ixgbe_x550.c			1.18
	sys/dev/pci/ixgbe/ixgbe_netbsd.c		1.14
	sys/dev/pci/ixgbe/ixgbe_phy.c			1.21
	sys/dev/pci/ixgbe/ixgbe_osdep.h			1.26

- Fix IXGBE_LE32_TO_CPUS() macro for big endian machine. This problem
  was only on X550*.
- Add debug printf()s.
- Use unsigned to avoid undefined behavior in
  ixgbe_fc_enable_generic().
- Modify a little to reduce diff between ixgbe.c and ixv.c.
  No functional change.
- Modify comment.
- Remove unused macros.
- Whitespace fix.
- Fix typos.

Revision 1.233 / (download) - annotate - [select for diffs], Thu Jun 25 07:53:01 2020 UTC (2 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.232: +236 -170 lines
Diff to previous 1.232 (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 (2 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.231: +5 -5 lines
Diff to previous 1.231 (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 (2 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.230: +9 -2 lines
Diff to previous 1.230 (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 (2 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.229: +5 -7 lines
Diff to previous 1.229 (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 (2 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.228: +12 -12 lines
Diff to previous 1.228 (colored)

 Fix typo. No functional change.

Revision 1.161.2.3 / (download) - annotate - [select for diffs], Tue Apr 21 18:42:37 2020 UTC (2 years, 9 months ago) by martin
Branch: phil-wifi
Changes since 1.161.2.2: +1 -1 lines
Diff to previous 1.161.2.2 (colored) to branchpoint 1.161 (colored) next main 1.162 (colored)

Sync with HEAD

Revision 1.227.2.1 / (download) - annotate - [select for diffs], Mon Apr 20 11:29:07 2020 UTC (2 years, 9 months ago) by bouyer
Branch: bouyer-xenpvh
Changes since 1.227: +2 -2 lines
Diff to previous 1.227 (colored) next main 1.228 (colored)

Sync with HEAD

Revision 1.228 / (download) - annotate - [select for diffs], Fri Apr 17 02:21:25 2020 UTC (2 years, 9 months 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)

No functional change:
 - modify comment
 - whitespace fix

Revision 1.161.2.2 / (download) - annotate - [select for diffs], Mon Apr 13 08:04:46 2020 UTC (2 years, 9 months ago) by martin
Branch: phil-wifi
Changes since 1.161.2.1: +354 -253 lines
Diff to previous 1.161.2.1 (colored) to branchpoint 1.161 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.227 / (download) - annotate - [select for diffs], Sun Mar 15 23:04:50 2020 UTC (2 years, 10 months 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)

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.220.2.2 / (download) - annotate - [select for diffs], Sat Feb 29 20:19:14 2020 UTC (2 years, 11 months ago) by ad
Branch: ad-namecache
Changes since 1.220.2.1: +69 -24 lines
Diff to previous 1.220.2.1 (colored) to branchpoint 1.220 (colored) next main 1.221 (colored)

Sync with head.

Revision 1.226 / (download) - annotate - [select for diffs], Thu Feb 6 06:28:49 2020 UTC (2 years, 11 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)

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 (2 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.224: +3 -1 lines
Diff to previous 1.224 (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 (3 years ago) by msaitoh
Branch: MAIN
Changes since 1.223: +4 -8 lines
Diff to previous 1.223 (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 (3 years ago) by thorpej
Branch: MAIN
Changes since 1.222: +52 -14 lines
Diff to previous 1.222 (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 (3 years ago) by thorpej
Branch: MAIN
Changes since 1.221: +6 -4 lines
Diff to previous 1.221 (colored)

Adopt <net/if_stats.h>.

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

Revision 1.199.2.10 / (download) - annotate - [select for diffs], Tue Jan 28 11:09:27 2020 UTC (3 years ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-0-RELEASE, netbsd-9-0-RC2
Changes since 1.199.2.9: +51 -32 lines
Diff to previous 1.199.2.9 (colored) to branchpoint 1.199 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #664):

	sys/dev/pci/ixgbe/ixgbe_82598.c: revision 1.13
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.219
	sys/dev/pci/ixgbe/ixgbe_phy.c: revision 1.20
	sys/dev/pci/ixgbe/ixgbe_x550.c: revision 1.17
	sys/dev/pci/ixgbe/ixgbe_82599.c: revision 1.22
	sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.44

Add recovery code for unsupported SFP+.

Before this commit:
   If an unsupported SFP module is inserted before booting, the driver attach
   failed and there was no way to recover form it without rebooting or
   detaching/reattaching driver (drvctl -d && drvctl -r pciN).

After this commit:
   We can automatically recover any time by replacing it with a supported
   module.

Revision 1.199.2.9 / (download) - annotate - [select for diffs], Sun Jan 26 11:03:17 2020 UTC (3 years ago) by martin
Branch: netbsd-9
Changes since 1.199.2.8: +5 -15 lines
Diff to previous 1.199.2.8 (colored) to branchpoint 1.199 (colored)

Pull up the following (via patch), requested by msaitoh in ticket #648

	sys/dev/pci/ixgbe/if_bypass.c		1.5
	sys/dev/pci/ixgbe/ixgbe_osdep.c		1.5
	sys/dev/pci/ixgbe/ix_txrx.c		1.58-1.60
	sys/dev/pci/ixgbe/ixgbe.c		1.220-1.221
	sys/dev/pci/ixgbe/ixgbe.h		1.60-1.2
	sys/dev/pci/ixgbe/ixgbe_api.c		1.24
	sys/dev/pci/ixgbe/ixgbe_common.c	1.26
	sys/dev/pci/ixgbe/ixgbe_netbsd.c	1.11-1.12
	sys/dev/pci/ixgbe/ixgbe_osdep.h		1.24
	sys/dev/pci/ixgbe/ixgbe_phy.c		1.19
	sys/dev/pci/ixgbe/ixgbe_82598.c		1.14
	sys/dev/pci/ixgbe/ixv.c			1.142,1.144

- Free RX structure correctly when detaching.
- Remove unused code.
- Fix some typos in comment.
- Remove extra spaces.
- KNF.

Revision 1.220.2.1 / (download) - annotate - [select for diffs], Sat Jan 25 22:38:49 2020 UTC (3 years ago) by ad
Branch: ad-namecache
Changes since 1.220: +4 -14 lines
Diff to previous 1.220 (colored)

Sync with head.

Revision 1.88.2.39 / (download) - annotate - [select for diffs], Fri Jan 24 18:37:31 2020 UTC (3 years ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-2-RELEASE
Changes since 1.88.2.38: +7 -17 lines
Diff to previous 1.88.2.38 (colored) to branchpoint 1.88 (colored)

Pull up the following, requested by msaitoh in ticket #1490:

	sys/dev/pci/ixgbe/if_bypass.c		1.5
	sys/dev/pci/ixgbe/ixgbe_osdep.c		1.5
	sys/dev/pci/ixgbe/ix_txrx.c		1.58-1.60
	sys/dev/pci/ixgbe/ixgbe.c		1.195,1.220-1.221 via patch
	sys/dev/pci/ixgbe/ixgbe.h		1.60-1.2
	sys/dev/pci/ixgbe/ixgbe_api.c		1.24
	sys/dev/pci/ixgbe/ixgbe_common.c	1.26
	sys/dev/pci/ixgbe/ixgbe_netbsd.c	1.11-1.12
	sys/dev/pci/ixgbe/ixgbe_osdep.h		1.24
	sys/dev/pci/ixgbe/ixgbe_phy.c		1.19
	sys/dev/pci/ixgbe/ixgbe_82598.c		1.14
	sys/dev/pci/ixgbe/ixv.c			1.122,1.142,1.144 via patch

- Use unsigned to avoid undefined behavior in
  ix{gbe,v}_[un]register_vlan().
- Free RX structure correctly when detaching.
- Remove unused code.
- Remove extra spaces.
- Fix some typos in comment.
- KNF.

Revision 1.221 / (download) - annotate - [select for diffs], Tue Jan 21 14:55:55 2020 UTC (3 years ago) by msaitoh
Branch: MAIN
CVS Tags: ad-namecache-base2
Changes since 1.220: +4 -14 lines
Diff to previous 1.220 (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 (3 years, 1 month 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)

Fix some typos in comments.

From vezhlys on freenode IRC.

Revision 1.88.2.38 / (download) - annotate - [select for diffs], Thu Dec 26 20:25:07 2019 UTC (3 years, 1 month ago) by martin
Branch: netbsd-8
Changes since 1.88.2.37: +7 -4 lines
Diff to previous 1.88.2.37 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #1478):

	sys/dev/pci/ixgbe/ixgbe.c: revision 1.218

 Add missing core lock in ixgbe_handle_mod().

Revision 1.199.2.8 / (download) - annotate - [select for diffs], Tue Dec 24 17:44:22 2019 UTC (3 years, 1 month ago) by martin
Branch: netbsd-9
Changes since 1.199.2.7: +8 -5 lines
Diff to previous 1.199.2.7 (colored) to branchpoint 1.199 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #580):

	sys/dev/pci/ixgbe/ixgbe.c: revision 1.217
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.218
	sys/dev/pci/ixgbe/ixgbe_osdep.c: revision 1.6
	sys/dev/pci/ixgbe/ixv.c: revision 1.143
	sys/dev/pci/ixgbe/ixgbe_osdep.h: revision 1.25

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

 Add missing core lock in ixgbe_handle_mod().

Revision 1.219 / (download) - annotate - [select for diffs], Mon Dec 23 09:36:17 2019 UTC (3 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.218: +51 -32 lines
Diff to previous 1.218 (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 (3 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.217: +7 -4 lines
Diff to previous 1.217 (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 (3 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.216: +2 -2 lines
Diff to previous 1.216 (colored)

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

Revision 1.199.2.7 / (download) - annotate - [select for diffs], Tue Nov 19 13:17:44 2019 UTC (3 years, 2 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-0-RC1
Changes since 1.199.2.6: +3 -1 lines
Diff to previous 1.199.2.6 (colored) to branchpoint 1.199 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #453):

	sys/dev/pci/ixgbe/ixgbe.c: revision 1.216
	sys/dev/pci/ixgbe/ixv.c: revision 1.141

Print MAC address.

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

Revision 1.88.2.37 / (download) - annotate - [select for diffs], Tue Nov 19 10:48:15 2019 UTC (3 years, 2 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.36: +3 -1 lines
Diff to previous 1.88.2.36 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #1451):

	sys/dev/pci/ixgbe/ixgbe.c: revision 1.216
	sys/dev/pci/ixgbe/ixv.c: revision 1.141

Print MAC address.

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

Revision 1.216 / (download) - annotate - [select for diffs], Mon Nov 18 03:17:51 2019 UTC (3 years, 2 months ago) by msaitoh
Branch: MAIN
CVS Tags: phil-wifi-20191119
Changes since 1.215: +3 -1 lines
Diff to previous 1.215 (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 (3 years, 2 months ago) by chs
Branch: MAIN
Changes since 1.214: +2 -7 lines
Diff to previous 1.214 (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.199.2.6 / (download) - annotate - [select for diffs], Thu Oct 17 19:09:14 2019 UTC (3 years, 3 months ago) by martin
Branch: netbsd-9
Changes since 1.199.2.5: +2 -4 lines
Diff to previous 1.199.2.5 (colored) to branchpoint 1.199 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #348):

	sys/dev/pci/ixgbe/ixgbe.c: revision 1.214

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.88.2.36 / (download) - annotate - [select for diffs], Thu Oct 17 18:39:41 2019 UTC (3 years, 3 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.35: +2 -4 lines
Diff to previous 1.88.2.35 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #1408):

	sys/dev/pci/ixgbe/ixgbe.c: revision 1.214

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.214 / (download) - annotate - [select for diffs], Wed Oct 16 04:07:42 2019 UTC (3 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.213: +2 -4 lines
Diff to previous 1.213 (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.199.2.5 / (download) - annotate - [select for diffs], Thu Sep 26 19:07:22 2019 UTC (3 years, 4 months ago) by martin
Branch: netbsd-9
Changes since 1.199.2.4: +23 -63 lines
Diff to previous 1.199.2.4 (colored) to branchpoint 1.199 (colored)

Pull up the following revisions, requested by msaitoh in ticket #246:

	sys/dev/pci/ixgbe/ixgbe_type.h			1.42-1.43
	sys/dev/pci/ixgbe/ixgbe.c			1.209-1.213
	sys/dev/pci/ixgbe/ixgbe_x550.c			1.16
	sys/dev/pci/ixgbe/ixv.c				1.131-1.138
	sys/dev/pci/ixgbe/ixgbe_vf.c			1.19-1.22
	sys/dev/pci/ixgbe/ixgbe_vf.h			1.14
	sys/dev/pci/ixgbe/ixgbe.h			1.57-1.58
	share/man/man4/ixv.4				1.5

- Fix a bug that MBSDC (Bad SFD Count) isn't counted on X550EM_X and
  X550EM_A. The register is for X550 and newer.
- ixv(4): Make SIOCADDMULTI returns ENOSPC and print error message
  when the Ethernet multicast address list exceeds the limit(30) and
  can't be ALLMULTI.
- ixv(4): SIOCZIFDATA clear the event counters as ixgbe.c.
- Reduce ixv(4)'s multicast table array size in ixv_set_multi from
  MAX_NUM_MULTICAST_ADDRESSES(128) to IXGBE_MAX_VF_MC(30).
- ixv(4): Add support ALLMULTI and PROMISC.
- if_flags is neither int nor short. It's unsigned short.
- ixg(4): Fix a bug that the multicast filter isn't correctly
  initialized when the total number of the Ethernet multicast
  addresses is just 128.
- Make ixv_set_multi() work correctly (especially for PROMISC) when the
  function is called from if_init().
- Remove *_set_promisc() and use *_set_multi(). And then, rename
  *_set_multi() to *_set_rxfilter().
- ixv(4): If a multicast entry has range, use ALLMULTI like others.
- Fix typo in comment. Found by Wataru Ashihara.

Revision 1.88.2.35 / (download) - annotate - [select for diffs], Thu Sep 26 18:19:26 2019 UTC (3 years, 4 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.34: +19 -61 lines
Diff to previous 1.88.2.34 (colored) to branchpoint 1.88 (colored)

Pull up the following revisions, requested by msaitoh in ticket #1389:

	sys/dev/pci/ixgbe/ixgbe_type.h			1.42-1.43
	sys/dev/pci/ixgbe/ixgbe.c			1.209-1.213 via patch
	sys/dev/pci/ixgbe/ixv.c				1.131-1.138 via patch
	sys/dev/pci/ixgbe/ixgbe_vf.c			1.19-1.22
	sys/dev/pci/ixgbe/ixgbe_vf.h			1.14
	sys/dev/pci/ixgbe/ixgbe.h			1.57-1.58 via patch
	share/man/man4/ixv.4				1.5 via patch

- Fix a bug that MBSDC (Bad SFD Count) isn't counted on X550EM_X and
  X550EM_A. The register is for X550 and newer.
- ixv(4): Make SIOCADDMULTI returns ENOSPC and print error message
  when the Ethernet multicast address list exceeds the limit(30) and
  can't be ALLMULTI.
- ixv(4): SIOCZIFDATA clear the event counters as ixgbe.c.
- Reduce ixv(4)'s multicast table array size in ixv_set_multi from
  MAX_NUM_MULTICAST_ADDRESSES(128) to IXGBE_MAX_VF_MC(30).
- ixv(4): Add support ALLMULTI and PROMISC.
- if_flags is neither int nor short. It's unsigned short.
- Fix a bug that the multicast filter isn't correctly initialized when
  the total number of the Ethernet multicast addresses is just 128.
- Make ixv_set_multi() work correctly (especially for PROMISC) when the
  function is called from if_init().
- Remove *_set_promisc() and use *_set_multi(). And then, rename
  *_set_multi() to *_set_rxfilter().
- ixv(4): If a multicast entry has range, use ALLMULTI like others.

Revision 1.213 / (download) - annotate - [select for diffs], Wed Sep 18 10:42:44 2019 UTC (3 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.212: +10 -10 lines
Diff to previous 1.212 (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 (3 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.211: +5 -49 lines
Diff to previous 1.211 (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 (3 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.210: +6 -4 lines
Diff to previous 1.210 (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 (3 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.209: +3 -2 lines
Diff to previous 1.209 (colored)

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

Revision 1.88.2.34 / (download) - annotate - [select for diffs], Fri Sep 6 13:44:36 2019 UTC (3 years, 4 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.33: +2 -1 lines
Diff to previous 1.88.2.33 (colored) to branchpoint 1.88 (colored)

Apply patch, requested by msaitoh in ticket #1367:

fix mistake in previous.

Revision 1.199.2.4 / (download) - annotate - [select for diffs], Thu Sep 5 09:11:03 2019 UTC (3 years, 5 months ago) by martin
Branch: netbsd-9
Changes since 1.199.2.3: +4 -4 lines
Diff to previous 1.199.2.3 (colored) to branchpoint 1.199 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #180):

	sys/dev/pci/ixgbe/ixv.c: revision 1.130
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.207
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.208
	sys/dev/pci/ixgbe/ix_txrx.c: revision 1.55
	sys/dev/pci/ixgbe/ixv.c: revision 1.129
	sys/dev/pci/ixgbe/ixgbe_netbsd.c: revision 1.10

 printf -> device_printf

 Set IFM_1000_BX10 correctly.

 Use aprint_*() in the attach function.

Revision 1.88.2.33 / (download) - annotate - [select for diffs], Thu Sep 5 09:06:07 2019 UTC (3 years, 5 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.32: +36 -31 lines
Diff to previous 1.88.2.32 (colored) to branchpoint 1.88 (colored)

Apply patch, requested by msaitoh in ticket #1367, to pull up the following
revisions:

	sys/dev/pci/ixgbe/ixgbe_x550.c                  1.16
	sys/dev/pci/ixgbe/ixgbe.c                       1.180,1.203-1.204,
							1.207-1.208 via patch
	sys/dev/pci/ixgbe/ix_txrx.c                     1.55
	sys/dev/pci/ixgbe/ixgbe_netbsd.c                1.10
	sys/dev/pci/ixgbe/ixgbe_common.c                1.25
	sys/dev/pci/ixgbe/ixv.c                         1.129-1.130

- X550EM supports QSFP, so check ixgbe_media_type_fiber_qsfp 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 softint.
- Add 10000BASE-LX media if it's 1000BASE-BX.
- printf -> device_printf
- Avoid undefined behavior of VLAN filter setting.
- Simplify code.
- Fix typo in unused code.
- Fix typo in comment. Found by Wataru Ashihara.

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

 Set IFM_1000_BX10 correctly.

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

 printf -> device_printf

Revision 1.199.2.3 / (download) - annotate - [select for diffs], Sun Sep 1 13:08:12 2019 UTC (3 years, 5 months ago) by martin
Branch: netbsd-9
Changes since 1.199.2.2: +17 -3 lines
Diff to previous 1.199.2.2 (colored) to branchpoint 1.199 (colored)

Pull up following revision(s) (requested by knakahara in ticket #136):

	sys/dev/pci/ixgbe/ixgbe.c: revision 1.205
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.206

fix typo in error handling of ixgbe_allocate_legacy().
ok by msaitoh@n.o

pullup-8, pullup-9

 -

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.199.2.2 / (download) - annotate - [select for diffs], Sun Sep 1 11:12:45 2019 UTC (3 years, 5 months ago) by martin
Branch: netbsd-9
Changes since 1.199.2.1: +37 -40 lines
Diff to previous 1.199.2.1 (colored) to branchpoint 1.199 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #134):

	sys/dev/pci/ixgbe/ixgbe.c: revision 1.202
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.203
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.204
	sys/dev/pci/ixgbe/ixv.c: revision 1.128

Simplify ix{gbe,v}_[un]register_vlan() API suggested 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.
X550EM supports QSFP, so check ixgbe_media_type_fiber_qsfp 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, 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.199.2.1 / (download) - annotate - [select for diffs], Sun Sep 1 11:07:05 2019 UTC (3 years, 5 months ago) by martin
Branch: netbsd-9
Changes since 1.199: +52 -18 lines
Diff to previous 1.199 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #133):

	sys/dev/pci/ixgbe/ixgbe.c: revision 1.200
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.201
	sys/dev/pci/ixgbe/ixv.c: revision 1.126
	sys/dev/pci/ixgbe/ixv.c: revision 1.127
	sys/net/if_vlan.c: revision 1.142
	sys/net/if_vlan.c: revision 1.143
	sys/net/if_vlan.c: revision 1.144
	sys/net/if_vlan.c: revision 1.145
	sys/net/if_vlan.c: revision 1.146

 Check ec_capenable instead of ec_capabilities to control TX side of VLAN HW
tagging correctly.
XXX pullup-9

 Add missing IFNET_LOCK() and IFNET_UNLOCK() in vlan_config().
XXX pullup-9

 Fix a bug that VLAN HW "tagging" enable/disable may not reflect 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

 Use ETHER_LOCK()/ETHER_UNLOCK() suggested by knakahara.
- kmem_alloc(,KM_SLEEP) never return NULL, so remove NULL check.
- VLAN ID is never duplicated, so break the loop when found. Also move
  kmen_free() outside of ETHER_LOCK(ec)/ETHER_UNLOCK(ec) to reduce the hold
  time. suggested by ozaki-r.
- Whitespace fix.

Revision 1.88.2.32 / (download) - annotate - [select for diffs], Thu Aug 29 16:31:53 2019 UTC (3 years, 5 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.31: +17 -3 lines
Diff to previous 1.88.2.31 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by knakahara in ticket #1347):

	sys/dev/pci/ixgbe/ixgbe.c: revision 1.205
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.206

fix typo in error handling of ixgbe_allocate_legacy().
ok by msaitoh@n.o
pullup-8, pullup-9

 -

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.206 / (download) - annotate - [select for diffs], Thu Aug 29 09:45:22 2019 UTC (3 years, 5 months ago) by knakahara
Branch: MAIN
Changes since 1.205: +17 -3 lines
Diff to previous 1.205 (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 (3 years, 5 months ago) by knakahara
Branch: MAIN
Changes since 1.204: +2 -2 lines
Diff to previous 1.204 (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 (3 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.203: +29 -21 lines
Diff to previous 1.203 (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 (3 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.202: +3 -6 lines
Diff to previous 1.202 (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 (3 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.201: +7 -15 lines
Diff to previous 1.201 (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 (3 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.200: +3 -3 lines
Diff to previous 1.200 (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 (3 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.199: +50 -16 lines
Diff to previous 1.199 (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.88.2.31 / (download) - annotate - [select for diffs], Thu Aug 1 14:14:30 2019 UTC (3 years, 6 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.30: +17 -16 lines
Diff to previous 1.88.2.30 (colored) to branchpoint 1.88 (colored)

Pull up the following revisions, requested by msaitoh in ticket #1313:

	sys/dev/pci/ixgbe/ixgbe_type.h			1.41
	sys/dev/pci/ixgbe/ixgbe.c			1.194,1.197-1.199
							via patch
	sys/dev/pci/ixgbe/ixgbe_common.c		1.24
	sys/dev/pci/ixgbe/ixv.c				1.121,1.124-1.125

 - Avoid undefined behavior of interrupt vector setting.
 - Avoid undefined behavior of TX/RX queue statistics calculation.
 - Avoid undefined behavior of X550EM's PHY accesses.
 - Avoid undefined behavior of Flow Control Transmit Timer setting.
 - Don't call {ixgbe,ixv}_stop() twice while detaching.

Revision 1.199 / (download) - annotate - [select for diffs], Tue Jul 30 08:44:28 2019 UTC (3 years, 6 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)

 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 (3 years, 6 months ago) by msaitoh
Branch: MAIN
Changes since 1.197: +3 -3 lines
Diff to previous 1.197 (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 (3 years, 6 months ago) by msaitoh
Branch: MAIN
Changes since 1.196: +3 -3 lines
Diff to previous 1.196 (colored)

 Simplify code. No functional change intended.

Revision 1.196 / (download) - annotate - [select for diffs], Thu Jul 25 09:28:07 2019 UTC (3 years, 6 months ago) by msaitoh
Branch: MAIN
Changes since 1.195: +2 -2 lines
Diff to previous 1.195 (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 (3 years, 6 months ago) by msaitoh
Branch: MAIN
Changes since 1.194: +3 -3 lines
Diff to previous 1.194 (colored)

 Fix VLAN filter setting. Found by KUBSan.

Revision 1.194 / (download) - annotate - [select for diffs], Wed Jul 24 06:07:57 2019 UTC (3 years, 6 months ago) by msaitoh
Branch: MAIN
Changes since 1.193: +7 -7 lines
Diff to previous 1.193 (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.88.2.30 / (download) - annotate - [select for diffs], Mon Jul 22 17:53:35 2019 UTC (3 years, 6 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.29: +410 -251 lines
Diff to previous 1.88.2.29 (colored) to branchpoint 1.88 (colored)

Pull up the following revisions (via patch), requested by msaitoh in
ticket #1301:

	sys/dev/pci/ixgbe/if_sriov.c			1.5-1.6
	sys/dev/pci/ixgbe/ix_txrx.c			1.53-1.54
	sys/dev/pci/ixgbe/ixgbe_x550.h			1.5
	sys/dev/pci/ixgbe/ixgbe.c			1.169-1.170,1.176,1.179,1.181,1.185-1.186,1.188-1.192 via patch
	sys/dev/pci/ixgbe/ixgbe.h			1.53,1.55
	sys/dev/pci/ixgbe/ixgbe_82599.c			1.21
	sys/dev/pci/ixgbe/ixgbe_api.c			1.22-1.23
	sys/dev/pci/ixgbe/ixgbe_api.h			1.14-1.15
	sys/dev/pci/ixgbe/ixgbe_x550.c			1.14-1.15
	sys/dev/pci/ixgbe/ixgbe_common.c		1.23
	sys/dev/pci/ixgbe/ixgbe_common.h		1.14
	sys/dev/pci/ixgbe/ixgbe_mbx.c			1.11
	sys/dev/pci/ixgbe/ixgbe_mbx.h			1.14
	sys/dev/pci/ixgbe/ixgbe_netmap.c		1.2
	sys/dev/pci/ixgbe/ixgbe_features.h		1.2
	sys/dev/pci/ixgbe/ixgbe_netbsd.c		1.9
	sys/dev/pci/ixgbe/ixgbe_netbsd.h		1.9-1.10
	sys/dev/pci/ixgbe/ixgbe_phy.c			1.18
	sys/dev/pci/ixgbe/ixgbe_type.h			1.37,1.39-1.40
	sys/dev/pci/ixgbe/ixgbe_vf.c			1.18
	sys/dev/pci/ixgbe/ixv.c				1.112-1.114,1.117,1.119 via patch

Sync ixgbe up to 20190717 except ETHERCAP or ixv's VLAN stuff:
- Add firmware recovery mode for X550, X550A(Xeon D) and X550EM(C3000).
- Remove IXGBE_DEV_ID_82599_LS(0x154f) support again.
- 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).
- It's not required to calculate unused queues' statistics.
- Remove ETHERCAP_VLAN_HWFILTER's definition.
- Match 82598_BX(0x1508), 82599_KR(0x1517), 82599_SFP_EM(0x1507),
  X550EM_X_XFI(0x15b0), X550EM_A_QSFP(0x15ca) and
  X550EM_A_QSFP_N(0x15cc)
- Add missing XFI support into ixgbe_get_link_capabilities_X550em().
- Other than IXGBE_VF_RESET should wait ACK, so use
  ixgbevf_write_msg_read_ack() instead of write_posted() in
  ixgbe_update_mc_addr_list_vf().
- When ixv_check_link() failed in the watchdog function, reset the
  interface.
- Remove RXCSUM register modification in
  ixv_initialize_receive_units(). It seems it's not required.
- Remove some debug printf in ixv_print_debug_info().
- Calculate vector's bit location correctly when the vector >= 31
  in ixgbe_allocate_msix().
- Fix hung queue check when the queue number >= 31.
- On ENETRESET case, not continue and quit the ifflags_cb() function
  because if_init() will do the same thing.
- Fix bugs in unused code.
- Fix typo in comment.
- Fix typo in unused code.
- Whitespace fixes. KNF.

Revision 1.193 / (download) - annotate - [select for diffs], Wed Jul 17 03:26:24 2019 UTC (3 years, 6 months ago) by msaitoh
Branch: MAIN
Changes since 1.192: +73 -24 lines
Diff to previous 1.192 (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 (3 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.191: +8 -6 lines
Diff to previous 1.191 (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 (3 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.190: +2 -2 lines
Diff to previous 1.190 (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 (3 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.189: +6 -6 lines
Diff to previous 1.189 (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 (3 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.188: +3 -3 lines
Diff to previous 1.188 (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.161.2.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:07:28 2019 UTC (3 years, 7 months ago) by christos
Branch: phil-wifi
Changes since 1.161: +573 -406 lines
Diff to previous 1.161 (colored)

Sync with HEAD

Revision 1.188 / (download) - annotate - [select for diffs], Tue Jun 4 09:43:15 2019 UTC (3 years, 8 months ago) by msaitoh
Branch: MAIN
CVS Tags: phil-wifi-20190609
Changes since 1.187: +7 -1 lines
Diff to previous 1.187 (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 (3 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.186: +2 -4 lines
Diff to previous 1.186 (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 (3 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.185: +198 -198 lines
Diff to previous 1.185 (colored)

 Whitespace fix (mainly tabify).

Revision 1.185 / (download) - annotate - [select for diffs], Thu May 23 10:57:28 2019 UTC (3 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.184: +26 -26 lines
Diff to previous 1.184 (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 (3 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.183: +1 -24 lines
Diff to previous 1.183 (colored)

 Use new media types.

Revision 1.183 / (download) - annotate - [select for diffs], Wed May 15 02:56:47 2019 UTC (3 years, 8 months ago) by ozaki-r
Branch: MAIN
Changes since 1.182: +9 -9 lines
Diff to previous 1.182 (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 (3 years, 8 months ago) by ozaki-r
Branch: MAIN
Changes since 1.181: +2 -2 lines
Diff to previous 1.181 (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 (3 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.180: +4 -5 lines
Diff to previous 1.180 (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 (3 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.179: +2 -2 lines
Diff to previous 1.179 (colored)

 Fix typo. This code is not used yet.

Revision 1.88.2.29 / (download) - annotate - [select for diffs], Mon Apr 1 12:35:38 2019 UTC (3 years, 10 months ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-1-RELEASE, netbsd-8-1-RC1
Changes since 1.88.2.28: +34 -28 lines
Diff to previous 1.88.2.28 (colored) to branchpoint 1.88 (colored)

Pull up the following, requested by msaitohin ticket #1225:

	sys/dev/pci/ixgbe/ixgbe.c		1.175-1.178
	sys/dev/pci/ixgbe/ixv.c			1.110-1.111 via patch

- 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().
- It's not required to calculate unused queues' statistics.
- 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. Note that currently
  VLAN HW filter function doesn't work because NetBSD doesn't support
  it yet.
- 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.179 / (download) - annotate - [select for diffs], Mon Mar 18 11:38:03 2019 UTC (3 years, 10 months 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)

 s/pakcet/packet/ in comment.

Revision 1.178 / (download) - annotate - [select for diffs], Fri Mar 15 02:38:20 2019 UTC (3 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.177: +6 -4 lines
Diff to previous 1.177 (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 (3 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.176: +27 -23 lines
Diff to previous 1.176 (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 (3 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.175: +9 -9 lines
Diff to previous 1.175 (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 (3 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.174: +6 -6 lines
Diff to previous 1.174 (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.88.2.28 / (download) - annotate - [select for diffs], Fri Mar 1 17:33:24 2019 UTC (3 years, 11 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.27: +13 -8 lines
Diff to previous 1.88.2.27 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #1199):

	sys/dev/pci/ixgbe/ixv.c: revision 1.109
	sys/dev/pci/ixgbe/ixgbe.h: revision 1.54
	sys/dev/pci/ixgbe/ix_txrx.c: revision 1.52
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.174

  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.174 / (download) - annotate - [select for diffs], Fri Feb 22 06:49:15 2019 UTC (3 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.173: +13 -8 lines
Diff to previous 1.173 (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.88.2.27 / (download) - annotate - [select for diffs], Mon Jan 28 13:03:02 2019 UTC (4 years ago) by martin
Branch: netbsd-8
Changes since 1.88.2.26: +99 -77 lines
Diff to previous 1.88.2.26 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #1171):

	sys/dev/pci/ixgbe/ixgbe.c: revision 1.168
	sys/dev/pci/ixgbe/ixgbe.h: revision 1.52
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.172
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.173

  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.

 -

  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.

 -

- 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.88.2.26 / (download) - annotate - [select for diffs], Sun Jan 27 18:35:19 2019 UTC (4 years ago) by martin
Branch: netbsd-8
Changes since 1.88.2.25: +11 -2 lines
Diff to previous 1.88.2.25 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #1172):

	sys/dev/pci/nvme_pci.c: revision 1.26
	sys/dev/pci/xhci_pci.c: revision 1.21
	sys/dev/pci/ixgbe/ixv.c: revision 1.108
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.171
	sys/dev/pci/if_fxp_pci.c: revision 1.84
	sys/dev/pci/if_fxp_pci.c: revision 1.85
	sys/dev/pci/xhci_pci.c: revision 1.16

remove #ifdef DEBUG printf, it seems to have outlived it's usefulness

 -

  KNF. No functional change.

 -

  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 explicitly 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.128.2.13 / (download) - annotate - [select for diffs], Sat Jan 26 22:00:23 2019 UTC (4 years ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.128.2.12: +24 -9 lines
Diff to previous 1.128.2.12 (colored) to branchpoint 1.128 (colored) next main 1.129 (colored)

Sync with HEAD

Revision 1.173 / (download) - annotate - [select for diffs], Wed Jan 23 09:47:52 2019 UTC (4 years ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-compat-20190127
Changes since 1.172: +11 -5 lines
Diff to previous 1.172 (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 (4 years ago) by msaitoh
Branch: MAIN
Changes since 1.171: +4 -4 lines
Diff to previous 1.171 (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 (4 years ago) by msaitoh
Branch: MAIN
Changes since 1.170: +11 -2 lines
Diff to previous 1.170 (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.128.2.12 / (download) - annotate - [select for diffs], Wed Dec 26 14:02:01 2018 UTC (4 years, 1 month ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.128.2.11: +245 -77 lines
Diff to previous 1.128.2.11 (colored) to branchpoint 1.128 (colored)

Sync with HEAD, resolve a few conflicts

Revision 1.170 / (download) - annotate - [select for diffs], Sat Dec 8 14:57:11 2018 UTC (4 years, 1 month 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)

 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 (4 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.168: +159 -8 lines
Diff to previous 1.168 (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 (4 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.167: +86 -70 lines
Diff to previous 1.167 (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.88.2.25 / (download) - annotate - [select for diffs], Thu Nov 8 12:04:48 2018 UTC (4 years, 2 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.24: +2 -3 lines
Diff to previous 1.88.2.24 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #1084):

	sys/dev/pci/ixgbe/ixv.c: revision 1.107
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.167

  Don't set LRO capability flag because we don't support it yet.

This doesn't change any behavior other than if_capabilities' visibility
(e.g. ifconfig).

Revision 1.128.2.11 / (download) - annotate - [select for diffs], Sun Sep 30 01:45:51 2018 UTC (4 years, 4 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.128.2.10: +5 -6 lines
Diff to previous 1.128.2.10 (colored) to branchpoint 1.128 (colored)

Ssync with HEAD

Revision 1.167 / (download) - annotate - [select for diffs], Thu Sep 27 05:40:27 2018 UTC (4 years, 4 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)

 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.88.2.24 / (download) - annotate - [select for diffs], Sun Sep 23 17:43:36 2018 UTC (4 years, 4 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.23: +4 -4 lines
Diff to previous 1.88.2.23 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #1029):

	sys/dev/pci/ixgbe/ixgbe.c: revision 1.166

- 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.166 / (download) - annotate - [select for diffs], Fri Sep 14 09:51:09 2018 UTC (4 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.165: +4 -4 lines
Diff to previous 1.165 (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.128.2.10 / (download) - annotate - [select for diffs], Thu Sep 6 06:56:02 2018 UTC (4 years, 4 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.128.2.9: +10 -6 lines
Diff to previous 1.128.2.9 (colored) to branchpoint 1.128 (colored)

Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)

Revision 1.88.2.23 / (download) - annotate - [select for diffs], Wed Sep 5 08:42:22 2018 UTC (4 years, 5 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.22: +5 -1 lines
Diff to previous 1.88.2.22 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #1006):

	sys/dev/pci/ixgbe/ixgbe.c: revision 1.164

  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.165 / (download) - annotate - [select for diffs], Mon Sep 3 16:29:33 2018 UTC (4 years, 5 months ago) by riastradh
Branch: MAIN
CVS Tags: pgoyette-compat-0906
Changes since 1.164: +6 -6 lines
Diff to previous 1.164 (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 (4 years, 5 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)

 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.88.2.22 / (download) - annotate - [select for diffs], Tue Aug 7 13:33:23 2018 UTC (4 years, 5 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.21: +10 -1 lines
Diff to previous 1.88.2.21 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #961):

	sys/dev/pci/ixgbe/ixgbe_x550.c: revision 1.13
	sys/dev/pci/ixgbe/ixgbe.h: revision 1.51
	sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.36
	sys/dev/pci/ixgbe/ixgbe_osdep.h: revision 1.23
	sys/dev/pci/ixgbe/ixgbe_netbsd.c: revision 1.8
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.163
	sys/dev/pci/ixgbe/ix_txrx.c: revision 1.49

  Add force_10_100_autonego sysctl. The default value is 0(false).

This sysctl is only for 550EM_a with PHY firmware for a while.

  Make jcl allocation per queue to reduce mutex spin. Tested by me and
knakahara.

Revision 1.128.2.9 / (download) - annotate - [select for diffs], Sat Jul 28 04:37:56 2018 UTC (4 years, 6 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.128.2.8: +10 -20 lines
Diff to previous 1.128.2.8 (colored) to branchpoint 1.128 (colored)

Sync with HEAD

Revision 1.88.2.21 / (download) - annotate - [select for diffs], Thu Jul 26 23:21:54 2018 UTC (4 years, 6 months ago) by snj
Branch: netbsd-8
Changes since 1.88.2.20: +1 -20 lines
Diff to previous 1.88.2.20 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #935):
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.162
	sys/dev/pci/ixgbe/ixgbe_82599.c: revision 1.20
	sys/dev/pci/ixgbe/ixgbe_api.c: revision 1.21
	sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.35
	sys/dev/pci/ixgbe/ixgbe_x540.c: revision 1.16
Apply changes of FreeBSD ix-3.2.18.tgz:
  - Add IXGBE_DEV_ID_82599_LS(0x154f) support.
  - Increase timeout for newer than ixgbe_mac_X550 (i.e. Xeon-D and Denverton)
    in ixgbe_acquire_swfw_sync_X540().
  - Add some unused macros (IXGBE_FW_LESM_*).
--
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.163 / (download) - annotate - [select for diffs], Fri Jul 6 02:36:35 2018 UTC (4 years, 7 months ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-compat-0728
Changes since 1.162: +10 -1 lines
Diff to previous 1.162 (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 (4 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.161: +1 -20 lines
Diff to previous 1.161 (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.128.2.8 / (download) - annotate - [select for diffs], Mon Jun 25 07:26:01 2018 UTC (4 years, 7 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.128.2.7: +167 -9 lines
Diff to previous 1.128.2.7 (colored) to branchpoint 1.128 (colored)

Sync with HEAD

Revision 1.88.2.20 / (download) - annotate - [select for diffs], Sat Jun 9 14:59:43 2018 UTC (4 years, 7 months ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-0-RELEASE, netbsd-8-0-RC2
Changes since 1.88.2.19: +228 -43 lines
Diff to previous 1.88.2.19 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #864):

	sys/dev/pci/ixgbe/ix_txrx.c			1.40-1.47 (patch)
	sys/dev/pci/ixgbe/ixgbe.c			1.148,1.149,1.151,
							1.152,1.154,
							1.155,1.157-1.160 (patch)
	sys/dev/pci/ixgbe/ixgbe.h			1.43,1.44,1.46,1.49 (patch)
	sys/dev/pci/ixgbe/ixgbe_netbsd.c		1.7 (patch)
	sys/dev/pci/ixgbe/ixgbe_netbsd.h		1.8 (patch)
	sys/dev/pci/ixgbe/ixgbe_osdep.h			1.22 (patch)
	sys/dev/pci/ixgbe/ixv.c				1.100-1.104 (patch)
	sys/dev/pci/ixgbe/ixv.c				1.94,1.95,1.99 (patch)

 Remove unused structure entries. No functional change.
 -
 Remove unused IXGBE_FC_HI and IXGBE_FC_LO. The watermark of the flow control
is automatically calculated from the size of the packet buffer.
 -
 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().
 -
 Don't free and reallocate bus_dmamem when it's not required. Currently,
the watchdog timer is completely broken and never fire (it's from FreeBSD
(pre iflib)). If the problem is fixed and watchdog fired, ixgbe_init() always
calls ixgbe_jcl_reinit() and it causes panic. The reason is that
ixgbe_local_timer1(it includes watchdog function) is softint and
xgbe_jcl_reinit() calls bus_dmamem*() functions. bus_dmamem*() can't be called
from interrupt context.

 One of the way to prevent panic is use worqueue for the timer, but it's
not a small change. (I'll do it in future).

 Another way is not reallocate dmamem if it's not required. If both the MTU
(rx_mbuf_sz in reality) and the number of RX descriptors are not changed, it's
not required to call bus_dmamem_{unmap,free}(). Even if we use workque, this
change save time of ixgbe_init().

 I have a code to fix broken watchdog timer but it sometime causes watchdog
timeout, so I don't commit it yet.
 -
Count some register correctly:
- QPRDC register is only for 82599 and newer.
- Count IXGBE_QPRDC, PX{ON,OFF}{T,R}XC[NT].
 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.
 -
 Whitespace fix. No functional change.
 -
 Add rxd_nxck (Receive Descriptor next to check) read only sysctl.
 Don't check IFF_RUNNING in ixgbe_rxeof(). Doing break and leaving a deacriptor
with DD bit is worse than just processing the entry. And it's also racy to
check IFF_RUNNING in rxeof(). If you'd like to strictly obey IFF_RUNNING,
it would be better to do it in the upper layer.
 Same as DragonFly (a part of 79251f5ebe4cf9dd2f3e6aed590e09d756d39922).
 Add "bool txr_no_space" for TX descriptor shortage. Use it like IFF_OACTIVE.
 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.
 -
 Add hw.ixgN.debug sysctl. "sysctl -w hw.ixgN.debug=1" dumps some registers
to console.
 -
Constify several variables in ixgbe/ so that they land in .rodata (1038
bytes).
 -
 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.88.2.19 / (download) - annotate - [select for diffs], Thu Jun 7 17:42:24 2018 UTC (4 years, 7 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.18: +3 -2 lines
Diff to previous 1.88.2.18 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by ozaki-r in ticket #843):

	sys/dev/pci/ixgbe/ixv.c: revision 1.101
	sys/net/if_bridge.c: revision 1.156
	sys/net/if_pppoe.c: revision 1.138
	sys/dev/pci/if_wm.c: revision 1.580
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.156
	sys/net/if_gif.c: revision 1.142

Ensure to call if_register after interface initializations finish

Revision 1.161 / (download) - annotate - [select for diffs], Wed Jun 6 20:02:31 2018 UTC (4 years, 8 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)

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 (4 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.159: +4 -2 lines
Diff to previous 1.159 (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 (4 years, 8 months ago) by maxv
Branch: MAIN
Changes since 1.158: +7 -7 lines
Diff to previous 1.158 (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 (4 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.157: +117 -1 lines
Diff to previous 1.157 (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 (4 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.156: +4 -1 lines
Diff to previous 1.156 (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 (4 years, 8 months ago) by ozaki-r
Branch: MAIN
Changes since 1.155: +3 -2 lines
Diff to previous 1.155 (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 (4 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.154: +3 -1 lines
Diff to previous 1.154 (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 (4 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.153: +31 -1 lines
Diff to previous 1.153 (colored)

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

Revision 1.128.2.7 / (download) - annotate - [select for diffs], Mon May 21 04:36:12 2018 UTC (4 years, 8 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.128.2.6: +61 -27 lines
Diff to previous 1.128.2.6 (colored) to branchpoint 1.128 (colored)

Sync with HEAD

Revision 1.153 / (download) - annotate - [select for diffs], Fri May 18 10:09:02 2018 UTC (4 years, 8 months ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-compat-0521
Changes since 1.152: +54 -92 lines
Diff to previous 1.152 (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 (4 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.151: +18 -16 lines
Diff to previous 1.151 (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 (4 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.150: +44 -12 lines
Diff to previous 1.150 (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 (4 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.149: +92 -54 lines
Diff to previous 1.149 (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.128.2.6 / (download) - annotate - [select for diffs], Sun Apr 22 07:20:26 2018 UTC (4 years, 9 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.128.2.5: +30 -11 lines
Diff to previous 1.128.2.5 (colored) to branchpoint 1.128 (colored)

Sync with HEAD

Revision 1.149 / (download) - annotate - [select for diffs], Thu Apr 19 07:40:12 2018 UTC (4 years, 9 months 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)

 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 (4 years, 9 months ago) by msaitoh
Branch: MAIN
Changes since 1.147: +1 -2 lines
Diff to previous 1.147 (colored)

 Remove unused structure entries. No functional change.

Revision 1.88.2.18 / (download) - annotate - [select for diffs], Tue Apr 17 08:20:06 2018 UTC (4 years, 9 months ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-0-RC1
Changes since 1.88.2.17: +23 -2 lines
Diff to previous 1.88.2.17 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by knakahara in ticket #769):

	sys/dev/pci/ixgbe/ixgbe.c: revision 1.147
	sys/dev/pci/ixgbe/ixgbe.h: revision 1.42

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.147 / (download) - annotate - [select for diffs], Tue Apr 17 05:23:58 2018 UTC (4 years, 9 months ago) by knakahara
Branch: MAIN
Changes since 1.146: +23 -2 lines
Diff to previous 1.146 (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.128.2.5 / (download) - annotate - [select for diffs], Mon Apr 16 02:00:02 2018 UTC (4 years, 9 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.128.2.4: +3 -2 lines
Diff to previous 1.128.2.4 (colored) to branchpoint 1.128 (colored)

Sync with HEAD, resolve some conflicts

Revision 1.88.2.17 / (download) - annotate - [select for diffs], Sat Apr 14 10:25:11 2018 UTC (4 years, 9 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.16: +35 -37 lines
Diff to previous 1.88.2.16 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #750):

	sys/dev/pci/ixgbe/ixgbe_x540.h: revision 1.8
	sys/dev/pci/ixgbe/ixgbe_82598.c: revision 1.11
	sys/dev/pci/ixgbe/ixgbe_dcb_82599.c: revision 1.6
	sys/dev/pci/ixgbe/ixgbe_82598.c: revision 1.12
	sys/dev/pci/ixgbe/ixgbe_dcb_82599.c: revision 1.7
	sys/dev/pci/ixgbe/ixgbe_dcb_82598.h: revision 1.6
	sys/dev/pci/ixgbe/ixgbe_fdir.h: revision 1.2
	sys/dev/pci/ixgbe/ixgbe_dcb_82599.h: revision 1.6
	sys/dev/pci/ixgbe/ixgbe_dcb_82598.c: revision 1.6
	sys/dev/pci/ixgbe/ixgbe_82599.c: revision 1.18
	sys/dev/pci/ixgbe/if_sriov.c: revision 1.3
	sys/dev/pci/ixgbe/ixgbe_dcb_82598.c: revision 1.7
	sys/dev/pci/ixgbe/ixgbe_82599.c: revision 1.19
	sys/dev/pci/ixgbe/ixgbe_mbx.h: revision 1.13
	sys/dev/pci/ixgbe/ixgbe_dcb.c: revision 1.7
	sys/dev/pci/ixgbe/ixgbe_api.c: revision 1.19
	sys/dev/pci/ixgbe/ixgbe_vf.c: revision 1.16
	sys/dev/pci/ixgbe/ixgbe_dcb.c: revision 1.8
	sys/dev/pci/ixgbe/ixgbe_vf.c: revision 1.17
	sys/dev/pci/ixgbe/ixgbe_dcb.h: revision 1.6
	sys/dev/pci/ixgbe/if_bypass.c: revision 1.4
	sys/dev/pci/ixgbe/ixv.c: revision 1.91
	sys/dev/pci/ixgbe/ixgbe_rss.h: revision 1.4
	sys/dev/pci/ixgbe/ixv.c: revision 1.92
	sys/dev/pci/ixgbe/ixv.c: revision 1.93
	sys/dev/pci/ixgbe/ixgbe_osdep.c: revision 1.4
	sys/dev/pci/ixgbe/ixgbe_common.h: revision 1.12
	sys/dev/pci/ixgbe/ixgbe_common.h: revision 1.13
	sys/dev/pci/ixgbe/ixgbe_api.h: revision 1.13
	sys/dev/pci/ixgbe/ixgbe_x550.c: revision 1.12
	sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.33
	sys/dev/pci/ixgbe/if_fdir.c: revision 1.2
	sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.34
	sys/dev/pci/ixgbe/ix_txrx.c: revision 1.39
	sys/dev/pci/ixgbe/ixgbe_vf.h: revision 1.13
	sys/dev/pci/ixgbe/ixgbe_api.c: revision 1.20
	sys/dev/pci/ixgbe/ixgbe_sriov.h: revision 1.3
	sys/dev/pci/ixgbe/ixgbe_common.c: revision 1.21
	sys/dev/pci/ixgbe/ixgbe_osdep.h: revision 1.21
	sys/dev/pci/ixgbe/ixgbe_common.c: revision 1.22
	sys/dev/pci/ixgbe/ixgbe_82599.h: revision 1.7
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.144
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.145
	sys/dev/pci/ixgbe/ixgbe_phy.c: revision 1.16
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.146
	sys/dev/pci/ixgbe/ixgbe_phy.c: revision 1.17
	sys/dev/pci/ixgbe/ixgbe_82598.h: revision 1.8
	sys/dev/pci/ixgbe/ixgbe.h: revision 1.41
	sys/dev/pci/ixgbe/ixgbe_mbx.c: revision 1.10
	sys/dev/pci/ixgbe/ixgbe_x540.c: revision 1.14
	sys/dev/pci/ixgbe/ixgbe_x540.c: revision 1.15
	sys/dev/pci/ixgbe/ixgbe_phy.h: revision 1.11

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.

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.

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

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

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

Revision 1.128.2.4 / (download) - annotate - [select for diffs], Sat Apr 7 04:12:18 2018 UTC (4 years, 9 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.128.2.3: +52 -38 lines
Diff to previous 1.128.2.3 (colored) to branchpoint 1.128 (colored)

Sync with HEAD.  77 conflicts resolved - all of them $NetBSD$

Revision 1.88.2.16 / (download) - annotate - [select for diffs], Wed Apr 4 16:18:49 2018 UTC (4 years, 10 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.15: +86 -19 lines
Diff to previous 1.88.2.15 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #690):
	sys/dev/pci/ixgbe/ixgbe_82599.c: revision 1.17
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.138
	sys/dev/pci/ixgbe/ixv.c: revision 1.90
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.139
	sys/dev/pci/ixgbe/ixgbe_common.c: revision 1.19
	sys/dev/pci/ixgbe/ixgbe_common.h: revision 1.11
	sys/dev/pci/ixgbe/ixgbe.h: revision 1.38
	sys/dev/pci/ixgbe/ixgbe_api.h: revision 1.12
	sys/dev/pci/ixgbe/ixgbe.h: revision 1.39
	sys/dev/pci/ixgbe/ixgbe_x550.c: revision 1.10
	sys/dev/pci/ixgbe/ixgbe_x550.c: revision 1.11
	sys/dev/pci/ixgbe/ix_txrx.c: revision 1.37
	sys/dev/pci/ixgbe/ix_txrx.c: revision 1.38
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.140
	sys/dev/pci/ixgbe/ixgbe_common.c: revision 1.20
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.141
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.142
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.143
	sys/dev/pci/ixgbe/ixgbe.h: revision 1.40
	sys/dev/pci/ixgbe/ixgbe_x550.h: revision 1.4

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

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

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

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.

 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.

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.145 / (download) - annotate - [select for diffs], Wed Apr 4 08:59:22 2018 UTC (4 years, 10 months ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-compat-0407
Changes since 1.144: +3 -3 lines
Diff to previous 1.144 (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 (4 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.143: +33 -36 lines
Diff to previous 1.143 (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 (4 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.142: +10 -2 lines
Diff to previous 1.142 (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 (4 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.141: +6 -2 lines
Diff to previous 1.141 (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 (4 years, 10 months ago) by knakahara
Branch: MAIN
Changes since 1.140: +2 -1 lines
Diff to previous 1.140 (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.88.2.15 / (download) - annotate - [select for diffs], Fri Mar 30 12:07:34 2018 UTC (4 years, 10 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.14: +37 -17 lines
Diff to previous 1.88.2.14 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #673):

	sys/dev/pci/ixgbe/if_sriov.c: revision 1.2
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.135
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.136
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.137
	sys/dev/pci/ixgbe/ixgbe_common.c: revision 1.17
	sys/dev/pci/ixgbe/if_bypass.c: revision 1.3
	sys/dev/pci/ixgbe/ixgbe_common.c: revision 1.18
	sys/dev/pci/ixgbe/ixgbe_common.h: revision 1.10
	sys/dev/pci/ixgbe/ixgbe.h: revision 1.36
	sys/dev/pci/ixgbe/ixgbe_osdep.c: revision 1.3
	sys/dev/pci/ixgbe/ixgbe.h: revision 1.37
	sys/dev/pci/ixgbe/ix_txrx.c: revision 1.36
	sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.32
	sys/dev/pci/ixgbe/ixgbe_vf.h: revision 1.12
	sys/dev/pci/ixgbe/ixgbe_sriov.h: revision 1.2
	sys/dev/pci/ixgbe/ixgbe_osdep.h: revision 1.20
	sys/dev/pci/ixgbe/ixv.c: revision 1.88
	sys/dev/pci/ixgbe/ixgbe_phy.c: revision 1.15
	sys/dev/pci/ixgbe/ixv.c: revision 1.89
	sys/dev/pci/ixgbe/ixgbe_x540.c: revision 1.13
	sys/dev/pci/ixgbe/ixgbe_x550.c: revision 1.8
	sys/dev/pci/ixgbe/ixgbe_x550.c: revision 1.9

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.
- Check offset correctly in ixgbe_get_oem_prod_version(). Note that this
  function is not used.
- Set PHY correctly in ixgbe_setup_mac_link_sfp_x550a() if a device is a
  C3000 KR SFP+.

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.

Fix race about writing adapter->link_active for ixv(4).
adapter->link_active is updated by ixv_update_link_status() only.

The function is called from the following two functions.
    - ixv_media_status()
    - ixv_handle_link()

ixv_media_status() calls ixv_update_link_status() with holding
IXGBE_CORE_LOCK, however ixv_handle_link() calls it without
holding IXGBE_CORE_LOCK, the same as ixg(4).

ok by msaitoh@n.o.

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

Revision 1.140 / (download) - annotate - [select for diffs], Fri Mar 30 06:44:30 2018 UTC (4 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.139: +5 -1 lines
Diff to previous 1.139 (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.128.2.3 / (download) - annotate - [select for diffs], Fri Mar 30 06:20:15 2018 UTC (4 years, 10 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.128.2.2: +88 -19 lines
Diff to previous 1.128.2.2 (colored) to branchpoint 1.128 (colored)

Resolve conflicts between branch and HEAD

Revision 1.139 / (download) - annotate - [select for diffs], Fri Mar 30 03:58:20 2018 UTC (4 years, 10 months ago) by knakahara
Branch: MAIN
CVS Tags: pgoyette-compat-0330
Changes since 1.138: +52 -17 lines
Diff to previous 1.138 (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 (4 years, 10 months 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 - [select for diffs], Mon Mar 26 06:40:28 2018 UTC (4 years, 10 months 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.128.2.2 / (download) - annotate - [select for diffs], Thu Mar 22 01:44:50 2018 UTC (4 years, 10 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.128.2.1: +7 -1 lines
Diff to previous 1.128.2.1 (colored) to branchpoint 1.128 (colored)

Synch with HEAD, resolve conflicts

Revision 1.136 / (download) - annotate - [select for diffs], Tue Mar 20 09:46:25 2018 UTC (4 years, 10 months ago) by knakahara
Branch: MAIN
CVS Tags: pgoyette-compat-0322
Changes since 1.135: +7 -1 lines
Diff to previous 1.135 (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.128.2.1 / (download) - annotate - [select for diffs], Thu Mar 15 09:12:05 2018 UTC (4 years, 10 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.128: +105 -74 lines
Diff to previous 1.128 (colored)

Synch with HEAD

Revision 1.135 / (download) - annotate - [select for diffs], Thu Mar 15 06:48:51 2018 UTC (4 years, 10 months ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-compat-0315
Changes since 1.134: +11 -16 lines
Diff to previous 1.134 (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.88.2.14 / (download) - annotate - [select for diffs], Tue Mar 13 14:59:06 2018 UTC (4 years, 10 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.13: +39 -4 lines
Diff to previous 1.88.2.13 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #626):
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.134
	sys/dev/pci/ixgbe/ixgbe.h: revision 1.35
	sys/dev/pci/ixgbe/ix_txrx.c: revision 1.35
	sys/dev/pci/ixgbe/ixv.c: revision 1.87
  Make some event counters MP safe. Now all of the event counters are
MP safe.

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

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

Revision 1.88.2.13 / (download) - annotate - [select for diffs], Thu Mar 8 12:31:25 2018 UTC (4 years, 10 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.12: +58 -57 lines
Diff to previous 1.88.2.12 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by knakahara in ticket #612):
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.129-1.133
	sys/dev/pci/ixgbe/ixgbe.h: revision 1.34
	sys/dev/pci/ixgbe/ixv.c: revision 1.85,1.86

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

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

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.

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

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

Revision 1.133 / (download) - annotate - [select for diffs], Thu Mar 8 02:41:27 2018 UTC (4 years, 10 months ago) by knakahara
Branch: MAIN
Changes since 1.132: +36 -45 lines
Diff to previous 1.132 (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 (4 years, 10 months ago) by knakahara
Branch: MAIN
Changes since 1.131: +11 -2 lines
Diff to previous 1.131 (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 (4 years, 11 months ago) by knakahara
Branch: MAIN
Changes since 1.130: +9 -2 lines
Diff to previous 1.130 (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 (4 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.129: +1 -2 lines
Diff to previous 1.129 (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 (4 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.128: +16 -21 lines
Diff to previous 1.128 (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.88.2.12 / (download) - annotate - [select for diffs], Tue Mar 6 11:12:41 2018 UTC (4 years, 11 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.11: +92 -8 lines
Diff to previous 1.88.2.11 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by knakahara in ticket #605):
	sys/dev/pci/ixgbe/ixgbe.h: revision 1.32
	sys/dev/pci/ixgbe/ixgbe.h: revision 1.33
	sys/dev/pci/ixgbe/ix_txrx.c: revision 1.34
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.128
	sys/dev/pci/ixgbe/ixv.c: revision 1.83
	sys/dev/pci/ixgbe/ixv.c: revision 1.84

Add hw.ixvM.q[01].{interrupt_rate,[tr]xd_head,[tr]xd_tail} sysctls as ixg(4).

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.

ixv(4) also supports workqueue poll mode, but not enabled by default yet, either.
ok by msaitoh@n.o.

Move the location of "struct work" as FreeBSD's "struct task" in ixgbe.h.
No functional change.

Revision 1.128 / (download) - annotate - [select for diffs], Fri Mar 2 10:19:20 2018 UTC (4 years, 11 months 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)

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.88.2.11 / (download) - annotate - [select for diffs], Thu Mar 1 19:02:15 2018 UTC (4 years, 11 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.10: +28 -8 lines
Diff to previous 1.88.2.10 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by knakahara in ticket #597):
	sys/dev/pci/ixgbe/ixgbe.h: revision 1.31
	sys/dev/pci/ixgbe/ix_txrx.c: revision 1.33
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.127
	sys/dev/pci/ixgbe/ixv.c: revision 1.82
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.
Apply ixgbe.c:r1.127 to ixv.c. Pointed out by msaitoh@n.o.

Revision 1.88.2.10 / (download) - annotate - [select for diffs], Mon Feb 26 13:55:54 2018 UTC (4 years, 11 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.9: +67 -20 lines
Diff to previous 1.88.2.9 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #592):
	sys/dev/pci/ixgbe/ixv.c: revision 1.79
	sys/dev/pci/ixgbe/ixgbe.h: revision 1.30
	sys/dev/pci/ixgbe/ix_txrx.c: revision 1.31
	sys/dev/pci/ixgbe/ix_txrx.c: revision 1.32
	sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.31
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.120
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.121
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.123
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.124
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.125
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.126
	sys/dev/pci/ixgbe/ixv.c: revision 1.80
	sys/dev/pci/ixgbe/ixv.c: revision 1.81
 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).
 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
 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)
- 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
 Increment rxr->packets correctly in ixgbe_rxeof() to calculate ITR value
of AIM (Auto Interrupt Moderation) correctly. See also ixgbe.c rev. 1.124.
XXX pullup-8
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.
- Apply ixgbe.c rev. 1.124 to ixv.c. Fix a bug that RX may stall on heavy load
 on ixv(4) derived from FreeBSD's AIM (Auto Interrupt Moderation) bug.
 ITR_INTERVAL value must be larger than 4us.
- The bitfield of EITR register is different between 82598 and others.
 ixv.c had a bug that it accessed 82598's way even though only 82599 and
 newer support virtual function. Fix it using with new ixv_eitr_write()
 function.
 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.127 / (download) - annotate - [select for diffs], Mon Feb 26 04:19:00 2018 UTC (4 years, 11 months ago) by knakahara
Branch: MAIN
Changes since 1.126: +28 -8 lines
Diff to previous 1.126 (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.88.2.9 / (download) - annotate - [select for diffs], Mon Feb 26 00:25:16 2018 UTC (4 years, 11 months ago) by snj
Branch: netbsd-8
Changes since 1.88.2.8: +6 -1 lines
Diff to previous 1.88.2.8 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by knakahara in ticket #567):
	distrib/sets/lists/comp/mi: 1.2182-1.2183
	sys/dev/pci/if_wm.c: 1.564
	sys/dev/pci/ixgbe/ixgbe.c: 1.122
	sys/dev/pci/ixgbe/ixgbe_rss.h: 1.3
	sys/dev/pci/ixgbe/ixv.c: 1.78
	sys/net/Makefile: 1.35-1.36
	sys/net/files.net: 1.15
	sys/net/rss_config.c: 1.1
	sys/net/rss_config.h: 1.1
Introduce very simple Receive Side Scaling (RSS) utility.
ok by msaitoh@n.o.
--
Apply RSS utility to wm(4).
ok by msaitoh@n.o.
--
Apply RSS utility to ixg(4) and ixv(4).
ok by msaitoh@n.o.
--
Fix build failure, sorry.
--
Currently, it is not necessary to install rss_config.h. Pointed out by msaitoh@n.o.

Revision 1.126 / (download) - annotate - [select for diffs], Thu Feb 22 10:02:08 2018 UTC (4 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.125: +2 -2 lines
Diff to previous 1.125 (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 (4 years, 11 months ago) by knakahara
Branch: MAIN
Changes since 1.124: +7 -1 lines
Diff to previous 1.124 (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 (4 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.123: +48 -13 lines
Diff to previous 1.123 (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 (4 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.122: +4 -1 lines
Diff to previous 1.122 (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 (4 years, 11 months ago) by knakahara
Branch: MAIN
Changes since 1.121: +6 -1 lines
Diff to previous 1.121 (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 (4 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.120: +8 -5 lines
Diff to previous 1.120 (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 (5 years ago) by msaitoh
Branch: MAIN
Changes since 1.119: +3 -3 lines
Diff to previous 1.119 (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.88.2.8 / (download) - annotate - [select for diffs], Sat Jan 13 21:40:01 2018 UTC (5 years ago) by snj
Branch: netbsd-8
Changes since 1.88.2.7: +181 -86 lines
Diff to previous 1.88.2.7 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #490):
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.116-1.119
	sys/dev/pci/ixgbe/ixv.c: revision 1.76-1.77
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).
--
Don't panic when resource shortage occured. Like ixgbe.c rev. 1.116.
 - 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).
--
Fix panic when only link interrupt can't be established.
--
- 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.
--
Fallback from MSI-X to MSI or INTx if MSI-X setup failed.

Revision 1.88.2.7 / (download) - annotate - [select for diffs], Tue Jan 2 10:20:33 2018 UTC (5 years, 1 month ago) by snj
Branch: netbsd-8
Changes since 1.88.2.6: +2 -2 lines
Diff to previous 1.88.2.6 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by ozaki-r in ticket #456):
	sys/arch/arm/sunxi/sunxi_emac.c: 1.9
	sys/dev/ic/dwc_gmac.c: 1.43-1.44
	sys/dev/pci/if_iwm.c: 1.75
	sys/dev/pci/if_wm.c: 1.543
	sys/dev/pci/ixgbe/ixgbe.c: 1.112
	sys/dev/pci/ixgbe/ixv.c: 1.74
	sys/kern/sys_socket.c: 1.75
	sys/net/agr/if_agr.c: 1.43
	sys/net/bpf.c: 1.219
	sys/net/if.c: 1.397, 1.399, 1.401-1.403, 1.406-1.410, 1.412-1.416
	sys/net/if.h: 1.242-1.247, 1.250, 1.252-1.257
	sys/net/if_bridge.c: 1.140 via patch, 1.142-1.146
	sys/net/if_etherip.c: 1.40
	sys/net/if_ethersubr.c: 1.243, 1.246
	sys/net/if_faith.c: 1.57
	sys/net/if_gif.c: 1.132
	sys/net/if_l2tp.c: 1.15, 1.17
	sys/net/if_loop.c: 1.98-1.101
	sys/net/if_media.c: 1.35
	sys/net/if_pppoe.c: 1.131-1.132
	sys/net/if_spppsubr.c: 1.176-1.177
	sys/net/if_tun.c: 1.142
	sys/net/if_vlan.c: 1.107, 1.109, 1.114-1.121
	sys/net/npf/npf_ifaddr.c: 1.3
	sys/net/npf/npf_os.c: 1.8-1.9
	sys/net/rtsock.c: 1.230
	sys/netcan/if_canloop.c: 1.3-1.5
	sys/netinet/if_arp.c: 1.255
	sys/netinet/igmp.c: 1.65
	sys/netinet/in.c: 1.210-1.211
	sys/netinet/in_pcb.c: 1.180
	sys/netinet/ip_carp.c: 1.92, 1.94
	sys/netinet/ip_flow.c: 1.81
	sys/netinet/ip_input.c: 1.362
	sys/netinet/ip_mroute.c: 1.147
	sys/netinet/ip_output.c: 1.283, 1.285, 1.287
	sys/netinet6/frag6.c: 1.61
	sys/netinet6/in6.c: 1.251, 1.255
	sys/netinet6/in6_pcb.c: 1.162
	sys/netinet6/ip6_flow.c: 1.35
	sys/netinet6/ip6_input.c: 1.183
	sys/netinet6/ip6_output.c: 1.196
	sys/netinet6/mld6.c: 1.90
	sys/netinet6/nd6.c: 1.239-1.240
	sys/netinet6/nd6_nbr.c: 1.139
	sys/netinet6/nd6_rtr.c: 1.136
	sys/netipsec/ipsec_output.c: 1.65
	sys/rump/net/lib/libnetinet/netinet_component.c: 1.9-1.10
kmem_intr_free kmem_intr_[z]alloced memory
the underlying pools are the same but api-wise those should match
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@
Provide macros for softnet_lock and KERNEL_LOCK hiding NET_MPSAFE switch
It reduces C&P codes such as "#ifndef NET_MPSAFE KERNEL_LOCK(1, NULL); ..."
scattered all over the source code and makes it easy to identify remaining
KERNEL_LOCK and/or softnet_lock that are held even if NET_MPSAFE.
No functional change
Hold KERNEL_LOCK on if_ioctl selectively based on IFEF_MPSAFE
If IFEF_MPSAFE is set, hold the lock and otherwise don't hold.
This change requires additions of KERNEL_LOCK to subsequence functions from
if_ioctl such as ifmedia_ioctl and ifioctl_common to protect non-MP-safe
components.
Proposed on tech-kern@ and tech-net@
Ensure to hold if_ioctl_lock when calling if_flags_set
Fix locking against myself on ifpromisc
vlan_unconfig_locked could be called with holding if_ioctl_lock.
Ensure to not turn on IFF_RUNNING of an interface until its initialization completes
And ensure to turn off it before destruction as per IFF_RUNNING's description
"resource allocated". (The description is a bit doubtful though, I believe the
change is still proper.)
Ensure to hold if_ioctl_lock on if_up and if_down
One exception for if_down is if_detach; in the case the lock isn't needed
because it's guaranteed that no other one can access ifp at that point.
Make if_link_queue MP-safe if IFEF_MPSAFE
if_link_queue is a queue to store events of link state changes, which is
used to pass events from (typically) an interrupt handler to
if_link_state_change softint. The queue was protected by KERNEL_LOCK so far,
but if IFEF_MPSAFE is enabled, it becomes unsafe because (perhaps) an interrupt
handler of an interface with IFEF_MPSAFE doesn't take KERNEL_LOCK. Protect it
by a spin mutex.
Additionally with this change KERNEL_LOCK of if_link_state_change softint is
omitted if NET_MPSAFE is enabled.
Note that the spin mutex is now ifp->if_snd.ifq_lock as well as the case of
if_timer (see the comment).
Use IFADDR_WRITER_FOREACH instead of IFADDR_READER_FOREACH
At that point no other one modifies the list so IFADDR_READER_FOREACH
is unnecessary. Use of IFADDR_READER_FOREACH is harmless in general though,
if we try to detect contract violations of pserialize, using it violates
the contract. So avoid using it makes life easy.
Ensure to call if_addr_init with holding if_ioctl_lock
Get rid of outdated comments
Fix build of kernels without ether
By throwing out if_enable_vlan_mtu and if_disable_vlan_mtu that
created a unnecessary dependency from if.c to if_ethersubr.c.
PR kern/52790
Rename IFNET_LOCK to IFNET_GLOBAL_LOCK
IFNET_LOCK will be used in another lock, if_ioctl_lock (might be renamed then).
Wrap if_ioctl_lock with IFNET_* macros (NFC)
Also if_ioctl_lock perhaps needs to be renamed to something because it's now
not just for ioctl...
Reorder some destruction routines in if_detach
- Destroy if_ioctl_lock at the end of the if_detach because it's used in various
  destruction routines
- Move psref_target_destroy after pr_purgeif because we want to use psref in
  pr_purgeif (otherwise destruction procedures can be tricky)
Ensure to call if_mcast_op with holding IFNET_LOCK
Note that CARP doesn't deal with IFNET_LOCK yet.
Remove IFNET_GLOBAL_LOCK where it's unnecessary because IFNET_LOCK is held
Describe which lock is used to protect each member variable of struct ifnet
Requested by skrll@
Write a guideline for converting an interface to IFEF_MPSAFE
Requested by skrll@
Note that IFNET_LOCK must not be held in softint
Don't set IFEF_MPSAFE unless NET_MPSAFE at this point
Because recent investigations show that interfaces with IFEF_MPSAFE need to
follow additional restrictions to work with the flag safely. We should enable it
on an interface by default only if the interface surely satisfies the
restrictions, which are described in if.h.
Note that enabling IFEF_MPSAFE solely gains a few benefit on performance because
the network stack is still serialized by the big kernel locks by default.

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

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

Revision 1.88.2.6 / (download) - annotate - [select for diffs], Thu Dec 21 19:28:54 2017 UTC (5 years, 1 month ago) by snj
Branch: netbsd-8
Changes since 1.88.2.5: +4791 -5344 lines
Diff to previous 1.88.2.5 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #441):
	sys/dev/pci/files.pci: 1.390
	sys/dev/pci/ixgbe/if_bypass.c: new
	sys/dev/pci/ixgbe/if_fdir.c: new
	sys/dev/pci/ixgbe/if_sriov.c: new
	sys/dev/pci/ixgbe/ixgbe_bypass.h: new
	sys/dev/pci/ixgbe/ixgbe_fdir.h: new
	sys/dev/pci/ixgbe/ixgbe_features.h: new
	sys/dev/pci/ixgbe/ixgbe_netmap.c: new
	sys/dev/pci/ixgbe/ixgbe_netmap.h: new
	sys/dev/pci/ixgbe/ixgbe_rss.h: new
	sys/dev/pci/ixgbe/ixgbe_sriov.h: new
	sys/dev/pci/ixgbe/ix_txrx.c: 1.28, 1.30 via patch
	sys/dev/pci/ixgbe/ixgbe.c: 1.97-1.105, 1.107-1.111, 1.113-1.115
	sys/dev/pci/ixgbe/ixgbe.h: 1.26-1.29 via patch
	sys/dev/pci/ixgbe/ixv.c: 1.57-1.58, 1.60-1.61, 1.63-1.64, 1.66-1.72, 1.75 via patch
	sys/dev/pci/ixgbe/ixgbe_api.c: 1.17-1.18 via patch
	sys/dev/pci/ixgbe/ixgbe_type.h: 1.26-1.30 via patch
	sys/dev/pci/ixgbe/ixgbe_82598.c: 1.9-1.10 via patch
	sys/dev/pci/ixgbe/ixgbe_82598.h: 1.6-1.7
	sys/dev/pci/ixgbe/ixgbe_82599.c: 1.15-1.16 via patch
	sys/dev/pci/ixgbe/ixgbe_82599.h: 1.5-1.6
	sys/dev/pci/ixgbe/ixgbe_api.h: 1.10-1.11 via patch
	sys/dev/pci/ixgbe/ixgbe_common.c: 1.14-1.16 via patch
	sys/dev/pci/ixgbe/ixgbe_common.h: 1.8-1.9 via patch
	sys/dev/pci/ixgbe/ixgbe_dcb.c: 1.5-1.6
	sys/dev/pci/ixgbe/ixgbe_dcb.h: 1.4-1.5
	sys/dev/pci/ixgbe/ixgbe_dcb_82598.c: 1.4-1.5
	sys/dev/pci/ixgbe/ixgbe_dcb_82598.h: 1.4-1.5
	sys/dev/pci/ixgbe/ixgbe_dcb_82599.c: 1.4-1.5
	sys/dev/pci/ixgbe/ixgbe_dcb_82599.h: 1.4-1.5
	sys/dev/pci/ixgbe/ixgbe_mbx.c: 1.7-1.9 via patch
	sys/dev/pci/ixgbe/ixgbe_mbx.h: 1.11-1.12 via patch
	sys/dev/pci/ixgbe/ixgbe_osdep.c: 1.2
	sys/dev/pci/ixgbe/ixgbe_osdep.h: 1.18-1.19 via patch
	sys/dev/pci/ixgbe/ixgbe_phy.c: 1.12-1.14 via patch
	sys/dev/pci/ixgbe/ixgbe_phy.h: 1.9-1.10 via patch
	sys/dev/pci/ixgbe/ixgbe_vf.c: 1.13-1.15 via patch
	sys/dev/pci/ixgbe/ixgbe_vf.h: 1.9-1.11 via patch
	sys/dev/pci/ixgbe/ixgbe_x540.c: 1.10-1.12
	sys/dev/pci/ixgbe/ixgbe_x540.h: 1.6-1.7
	sys/dev/pci/ixgbe/ixgbe_x550.c: 1.6-1.7
	sys/dev/pci/ixgbe/ixgbe_x550.h: 1.3
Sync with FreeBSD's up to r326022, fix bugs and some improvements:
- Don't limit number of queue pair to 8. Take chip's max TX queues and
  max RX queues into account.
- Add C3000 (Denverton) support.
- Add bypass function support for bypass adapters.
- Change EEE sysctl.
- Remove thermal test sysctl.
- ixv(4): set RSS mapping.
- ixv(4): Add TSOv6.
- ixv(4): Fix hardware counter.
- ixv(4): Make TX/RX descriptors size the same as ixg(4).
- ixv(4): Print device name in ixv_attach().
- ixv(4): Make mailbox statistic counters evcnt(9).
- ixv(4): Fix a problem that mailbox interrupt never occurred.
- ixv(4): Don't check neither VTEICR nor VTEICS same as Linux. It
  seems that both registers can't be used to check which MSI-X vector
  is triggered.
- ixv(4): Print Mailbox API version.
- Print driver feature capabilities and enable bits when verbose boot.
- Fix a bug that X550EM_A (Denverton) can't force 10BaseT.
- Remove all half-duplex setting because of the chip specification.
- Add 2.5GBASE-T and 5GBASE-T support.
- Set ifm_baudrate correctly.
- Protect ec_multi* with mutex like other MP safe Ethernet drivers.
- On X550 and newer, print NVM Image Version with %u.%02x.
- On X540, print PHY FW Revision with %u.%x. 0x4030 will be printed
  as "Revision 4.3 ID 0x0"
- Fix value check of OEM_NVM_IMAGE_VER.
- Print PHY ID only for copper PHY.
- Fix a bug that X550 and newer didn't linkup if it forces
  100BaseTX-FDX or 10BaseT-FDX.
- Fix a bug that RX may accesses freed area. It also fixes a problem
  that if_init() takes long time on many core machine.
- 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.
- Whitespace fix.

Revision 1.118 / (download) - annotate - [select for diffs], Thu Dec 21 09:24:45 2017 UTC (5 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.117: +16 -3 lines
Diff to previous 1.117 (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 (5 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.116: +2 -2 lines
Diff to previous 1.116 (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 (5 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.115: +5 -7 lines
Diff to previous 1.115 (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.88.2.5 / (download) - annotate - [select for diffs], Sun Dec 10 10:10:24 2017 UTC (5 years, 1 month ago) by snj
Branch: netbsd-8
Changes since 1.88.2.4: +7 -2 lines
Diff to previous 1.88.2.4 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #427):
	sys/arch/amiga/dev/if_bah_zbus.c: 1.17
	sys/arch/arm/broadcom/bcm53xx_eth.c: 1.30
	sys/arch/powerpc/booke/dev/pq3etsec.c: 1.32
	sys/arch/usermode/dev/if_veth.c: 1.9
	sys/dev/ic/an.c: 1.66
	sys/dev/ic/athn.c: 1.17
	sys/dev/ic/atw.c: 1.162
	sys/dev/ic/bwi.c: 1.33
	sys/dev/ic/dwc_gmac.c: 1.41-1.42
	sys/dev/ic/malo.c: 1.10
	sys/dev/ic/rt2560.c: 1.31
	sys/dev/ic/rt2661.c: 1.36
	sys/dev/ic/rt2860.c: 1.29
	sys/dev/ic/rtw.c: 1.127
	sys/dev/ic/rtwvar.h: 1.46
	sys/dev/ic/smc90cx6.c: 1.71
	sys/dev/ic/smc90cx6var.h: 1.12
	sys/dev/ic/wi.c: 1.244
	sys/dev/pci/if_ipw.c: 1.66
	sys/dev/pci/if_iwi.c: 1.104
	sys/dev/pci/if_iwm.c: 1.76
	sys/dev/pci/if_iwn.c: 1.86
	sys/dev/pci/if_rtwn.c: 1.13
	sys/dev/pci/if_wm.c: 1.541
	sys/dev/pci/if_wpi.c: 1.79
	sys/dev/pci/ixgbe/ixgbe.c: 1.106
	sys/dev/pci/ixgbe/ixv.c: 1.73 via patch
	sys/dev/pcmcia/if_malo_pcmcia.c: 1.15
	sys/dev/scsipi/if_se.c: 1.95
	sys/dev/usb/if_upl.c: 1.60
	sys/net/if.c: 1.396
	sys/net/if.h: 1.241
	sys/net/if_arc.h: 1.23
	sys/net/if_arcsubr.c: 1.78
	sys/net/if_bridge.c: 1.136-1.137
	sys/net/if_etherip.c: 1.39
	sys/net/if_faith.c: 1.56
	sys/net/if_gif.c: 1.131
	sys/net/if_loop.c: 1.96
	sys/net/if_mpls.c: 1.30
	sys/net/if_pppoe.c: 1.129
	sys/net/if_srt.c: 1.27
	sys/net/if_stf.c: 1.102
	sys/net/if_tap.c: 1.100
	sys/net/if_vlan.c: 1.105
	sys/netinet/ip_carp.c: 1.91
	sys/rump/net/lib/libshmif/if_shmem.c: 1.73-1.74
	sys/rump/net/lib/libvirtif/if_virt.c: 1.55-1.56
 if_initalize() and if_attach() failed when resource allocation failed
(e.g. allocating softint). Without this change, it panics. It's bad because
resource shortage really occured when a lot of pseudo interface is created.
To avoid this problem, don't panic and change return value of if_initialize()
and if_attach() to int. Caller fanction will be recover from error cleanly by
checking the return value.
 Return if bah_attach_subr() failed.
 If if_attach() failed in the attach function, return.
- If if_initialize() failed in the attach function, free resources and return.
- Add some missing frees in bridge_clone_destroy().
- KNF
 If error occured in bcmeth_ccb_attach(), free resources and return.
 If error occured in pq3etsec_attach(), free resources and return.
 If error occured in the attach function, free resources and return.
- If if_initialize() failed in athn_attach(), free resources and return.
- Add missing pmf_event_deregister() in athn_detach().
- Free resources correctly on some errors in atw_attach().
- Use apint*() insread of printf() in the attach function.
 If if_initialize() failed in the attach function, return.
- If if_initialize() failed in the attach function, free resources and return.
- Add missing dwc_gmac_free_dma_rings() and mutex_destroy() when attach
   failed.
- If if_initialize() failed in the attach function, free resources and return.
- ifp is always not NULL in iwi_detach(). Check correctly with ifp->if_softc.
- If if_initialize() failed in the attach function, free resources and return.
- Fix error path in the attach function correctly.
 If if_initialize() failed in the attach function, free resources and return.
 If if_attach() failed in the attach function, free resources and return.
 - If if_initialize() failed in the attach function, free resources and return.
 - KNF
 - If if_attach() failed in the attach function, free resources and return.
 - KNF
 Fix compile error.
 Fix compile error.
We don't need '&mii', but just 'mii' for mii_detach().
Don't free sc_rthash twice

Revision 1.115 / (download) - annotate - [select for diffs], Wed Dec 6 04:08:50 2017 UTC (5 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.114: +14 -12 lines
Diff to previous 1.114 (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.5.2.2 / (download) - annotate - [select for diffs], Sun Dec 3 11:37:29 2017 UTC (5 years, 2 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.5.2.1: +5092 -4798 lines
Diff to previous 1.5.2.1 (colored) to branchpoint 1.5 (colored) next main 1.6 (colored)

update from HEAD

Revision 1.114 / (download) - annotate - [select for diffs], Fri Nov 24 08:36:22 2017 UTC (5 years, 2 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)

 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 (5 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.112: +2 -2 lines
Diff to previous 1.112 (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.88.2.4 / (download) - annotate - [select for diffs], Tue Nov 21 11:38:19 2017 UTC (5 years, 2 months ago) by martin
Branch: netbsd-8
Changes since 1.88.2.3: +3 -5 lines
Diff to previous 1.88.2.3 (colored) to branchpoint 1.88 (colored)

Revert the pullup of the following revision(s) (requested by msaitoh in ticket #361):
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.97
Revert a part of ticket #248 because it panics when attaching.
It is hard to fix with a small change.

Revision 1.112 / (download) - annotate - [select for diffs], Thu Nov 16 03:07:18 2017 UTC (5 years, 2 months ago) by ozaki-r
Branch: MAIN
Changes since 1.111: +2 -2 lines
Diff to previous 1.111 (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 (5 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.110: +1 -2 lines
Diff to previous 1.110 (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 (5 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.109: +6 -2 lines
Diff to previous 1.109 (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 (5 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.108: +4 -5 lines
Diff to previous 1.108 (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 (5 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.107: +1 -10 lines
Diff to previous 1.107 (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 (5 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.106: +11 -6 lines
Diff to previous 1.106 (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 (5 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.105: +7 -2 lines
Diff to previous 1.105 (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 (5 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.104: +7 -1 lines
Diff to previous 1.104 (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 (5 years, 3 months ago) by msaitoh
Branch: MAIN
Changes since 1.103: +3 -1 lines
Diff to previous 1.103 (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 (5 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.102: +56 -27 lines
Diff to previous 1.102 (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 (5 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.101: +2 -2 lines
Diff to previous 1.101 (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 (5 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.100: +1 -16 lines
Diff to previous 1.100 (colored)

 Print device name in ixv_attach().

Revision 1.88.2.3 / (download) - annotate - [select for diffs], Thu Aug 31 11:37:37 2017 UTC (5 years, 5 months ago) by martin
Branch: netbsd-8
CVS Tags: matt-nb8-mediatek-base, matt-nb8-mediatek
Changes since 1.88.2.2: +5 -15 lines
Diff to previous 1.88.2.2 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #248):
	sys/dev/pci/ixgbe/ixgbe.h: revision 1.25
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.96
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.97
  Remove unused counters.
  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.100 / (download) - annotate - [select for diffs], Thu Aug 31 02:48:55 2017 UTC (5 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.99: +2 -2 lines
Diff to previous 1.99 (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 (5 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.98: +1806 -2397 lines
Diff to previous 1.98 (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 (5 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.97: +4090 -4081 lines
Diff to previous 1.97 (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 (5 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.96: +5 -3 lines
Diff to previous 1.96 (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.14.4.9 / (download) - annotate - [select for diffs], Mon Aug 28 17:52:25 2017 UTC (5 years, 5 months ago) by skrll
Branch: nick-nhusb
Changes since 1.14.4.8: +501 -216 lines
Diff to previous 1.14.4.8 (colored) to branchpoint 1.14 (colored) next main 1.15 (colored)

Sync with HEAD

Revision 1.96 / (download) - annotate - [select for diffs], Thu Aug 24 10:43:42 2017 UTC (5 years, 5 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)

 Remove unused counters.

Revision 1.88.2.2 / (download) - annotate - [select for diffs], Sat Aug 5 03:49:35 2017 UTC (5 years, 6 months ago) by snj
Branch: netbsd-8
Changes since 1.88.2.1: +44 -7 lines
Diff to previous 1.88.2.1 (colored) to branchpoint 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #175):
	sys/dev/pci/ixgbe/ix_txrx.c: 1.25-1.27
	sys/dev/pci/ixgbe/ixgbe.c: 1.91-1.95
	sys/dev/pci/ixgbe/ixgbe_type.h: 1.23-1.25
	sys/dev/pci/ixgbe/ixgbe_api.c: 1.16
sync ixg(4) up to ixgbe.c rev. 1.95:
- Increase total number of RX buffers on multiqueue.
- Fix the partial chain check in ixgbe_rx_discard(). This bug was
  added in ixgbe.c rev. 1.33.
- Fix a double free in ixgbe_rxeof().
- Print verbose output in ixgbe_update_link_status() correctly on 5Gbps
  and 2.5Gbps (NBASE-T) for X550T[12] and newer.
- Change hw.ixgN.ts to hw.ixgN.thermal_test. Same as FreeBSD.
- Fix a bug that ifconfig ixgN media 1000baseT and 10Gbase-T advertised
  additional unwanted speeds.
- Print PHY ID.
- Remove unused variable.

Revision 1.88.2.1 / (download) - annotate - [select for diffs], Tue Jul 4 14:57:19 2017 UTC (5 years, 7 months ago) by martin
Branch: netbsd-8
Changes since 1.88: +13 -62 lines
Diff to previous 1.88 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #81):
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.89
	sys/dev/pci/if_wm.c: revision 1.509
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.90
Use IFM_1000_KX and IFM_2500_KX.
 Use IFM_1000_KX more.

Revision 1.95 / (download) - annotate - [select for diffs], Mon Jul 3 08:29:58 2017 UTC (5 years, 7 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)

 Print PHY ID.

Revision 1.94 / (download) - annotate - [select for diffs], Tue Jun 27 10:33:09 2017 UTC (5 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.93: +14 -5 lines
Diff to previous 1.93 (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 (5 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.92: +2 -2 lines
Diff to previous 1.92 (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 (5 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.91: +2 -2 lines
Diff to previous 1.91 (colored)

 Reduce diff against FreeBSD. No functional change.

Revision 1.91 / (download) - annotate - [select for diffs], Fri Jun 23 06:33:35 2017 UTC (5 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.90: +7 -1 lines
Diff to previous 1.90 (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 (5 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.89: +7 -36 lines
Diff to previous 1.89 (colored)

 Use IFM_1000_KX more.

Revision 1.89 / (download) - annotate - [select for diffs], Mon Jun 12 03:03:22 2017 UTC (5 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.88: +7 -27 lines
Diff to previous 1.88 (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 (5 years, 8 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)

- 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 (5 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.86: +3 -1 lines
Diff to previous 1.86 (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 (5 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.85: +9 -1 lines
Diff to previous 1.85 (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 (5 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.84: +120 -2 lines
Diff to previous 1.84 (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 (5 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.83: +22 -6 lines
Diff to previous 1.83 (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 (5 years, 8 months ago) by msaitoh
Branch: MAIN
Changes since 1.82: +20 -3 lines
Diff to previous 1.82 (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.80.4.2 / (download) - annotate - [select for diffs], Fri May 19 00:22:57 2017 UTC (5 years, 8 months ago) by pgoyette
Branch: prg-localcount2
Changes since 1.80.4.1: +56 -2 lines
Diff to previous 1.80.4.1 (colored) to branchpoint 1.80 (colored) next main 1.81 (colored)

Resolve conflicts from previous merge (all resulting from $NetBSD
keywork expansion)

Revision 1.82 / (download) - annotate - [select for diffs], Thu May 18 08:27:19 2017 UTC (5 years, 8 months ago) by msaitoh
Branch: MAIN
CVS Tags: prg-localcount2-base3
Changes since 1.81: +56 -2 lines
Diff to previous 1.81 (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.80.4.1 / (download) - annotate - [select for diffs], Tue May 2 03:19:20 2017 UTC (5 years, 9 months ago) by pgoyette
Branch: prg-localcount2
Changes since 1.80: +2 -2 lines
Diff to previous 1.80 (colored)

Sync with HEAD - tag prg-localcount2-base1

Revision 1.81 / (download) - annotate - [select for diffs], Fri Apr 28 10:24:45 2017 UTC (5 years, 9 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)

 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.59.2.1 / (download) - annotate - [select for diffs], Fri Apr 21 16:53:52 2017 UTC (5 years, 9 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.59: +250 -180 lines
Diff to previous 1.59 (colored) next main 1.60 (colored)

Sync with HEAD

Revision 1.2.4.1 / (download) - annotate - [select for diffs], Sat Mar 25 17:35:56 2017 UTC (5 years, 10 months ago) by snj
Branch: netbsd-6
Changes since 1.2: +5 -1 lines
Diff to previous 1.2 (colored) next main 1.3 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #1439):
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.60 via patch
Use 64bit DMA tag. If not, a lot of bounce buffer is allocated.
Fixes PR#49968 reported by Hauke.

Revision 1.39.2.3 / (download) - annotate - [select for diffs], Mon Mar 20 06:57:37 2017 UTC (5 years, 10 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.39.2.2: +250 -180 lines
Diff to previous 1.39.2.2 (colored) to branchpoint 1.39 (colored) next main 1.40 (colored)

Sync with HEAD

Revision 1.14.2.6.2.1 / (download) - annotate - [select for diffs], Mon Mar 13 07:41:27 2017 UTC (5 years, 10 months ago) by skrll
Branch: netbsd-7-nhusb
Changes since 1.14.2.6: +5 -2 lines
Diff to previous 1.14.2.6 (colored) next main 1.14.2.7 (colored)

Sync with netbsd-7-1-RELEASE

Revision 1.14.2.7 / (download) - annotate - [select for diffs], Thu Mar 9 06:19:37 2017 UTC (5 years, 10 months ago) by snj
Branch: netbsd-7
CVS Tags: netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1
Changes since 1.14.2.6: +5 -2 lines
Diff to previous 1.14.2.6 (colored) to branchpoint 1.14 (colored) next main 1.15 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #1370):
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.60
  Use 64bit DMA tag. If not, a lot of bounce buffer is allocated.
Fixes PR#49968 reported by Hauke.

Revision 1.80 / (download) - annotate - [select for diffs], Fri Mar 3 04:37:05 2017 UTC (5 years, 11 months 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)

 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 (5 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.78: +42 -2 lines
Diff to previous 1.78 (colored)

 Print mac.type and the TrackID.

Revision 1.78 / (download) - annotate - [select for diffs], Thu Feb 16 08:01:11 2017 UTC (5 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.77: +5 -4 lines
Diff to previous 1.77 (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 (5 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.76: +1 -5 lines
Diff to previous 1.76 (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 (5 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.75: +1 -12 lines
Diff to previous 1.75 (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 (5 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.74: +3 -1 lines
Diff to previous 1.74 (colored)

Use percpuq.

Revision 1.74 / (download) - annotate - [select for diffs], Mon Feb 13 06:38:45 2017 UTC (5 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.73: +5 -9 lines
Diff to previous 1.73 (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 (5 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.72: +5 -8 lines
Diff to previous 1.72 (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 (5 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.71: +43 -52 lines
Diff to previous 1.71 (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 (5 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.70: +4 -4 lines
Diff to previous 1.70 (colored)

 Print CPU number correctly.

Revision 1.70 / (download) - annotate - [select for diffs], Wed Feb 8 08:13:53 2017 UTC (5 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.69: +3 -7 lines
Diff to previous 1.69 (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 (5 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.68: +4 -4 lines
Diff to previous 1.68 (colored)

Add queue number into interrupt name.

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

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

Revision 1.14.4.8 / (download) - annotate - [select for diffs], Sun Feb 5 13:40:45 2017 UTC (5 years, 11 months ago) by skrll
Branch: nick-nhusb
Changes since 1.14.4.7: +307 -171 lines
Diff to previous 1.14.4.7 (colored) to branchpoint 1.14 (colored)

Sync with HEAD

Revision 1.67 / (download) - annotate - [select for diffs], Wed Feb 1 10:47:13 2017 UTC (6 years ago) by msaitoh
Branch: MAIN
CVS Tags: nick-nhusb-base-20170204
Changes since 1.66: +45 -13 lines
Diff to previous 1.66 (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 (6 years ago) by msaitoh
Branch: MAIN
Changes since 1.65: +3 -3 lines
Diff to previous 1.65 (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 (6 years ago) by msaitoh
Branch: MAIN
Changes since 1.64: +2 -3 lines
Diff to previous 1.64 (colored)

Remove debug printf()s.

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

 Fix SFP+ insersion or replacement stuff.

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

Reduce diff against FreeBSD. No functional change.

Revision 1.62 / (download) - annotate - [select for diffs], Wed Jan 18 10:22:09 2017 UTC (6 years ago) by msaitoh
Branch: MAIN
Changes since 1.61: +9 -8 lines
Diff to previous 1.61 (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 (6 years ago) by msaitoh
Branch: MAIN
Changes since 1.60: +4 -1 lines
Diff to previous 1.60 (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 (6 years ago) by msaitoh
Branch: MAIN
Changes since 1.59: +5 -2 lines
Diff to previous 1.59 (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.39.2.2 / (download) - annotate - [select for diffs], Sat Jan 7 08:56:40 2017 UTC (6 years ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.39.2.1: +2808 -2985 lines
Diff to previous 1.39.2.1 (colored) to branchpoint 1.39 (colored)

Sync with HEAD.  (Note that most of these changes are simply $NetBSD$
tag issues.)

Revision 1.59 / (download) - annotate - [select for diffs], Thu Jan 5 05:53:23 2017 UTC (6 years, 1 month 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)

 Fix INIT_DEBUGOUT() messages.

Revision 1.58 / (download) - annotate - [select for diffs], Wed Dec 28 09:29:35 2016 UTC (6 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.57: +19 -15 lines
Diff to previous 1.57 (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 (6 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.56: +14 -13 lines
Diff to previous 1.56 (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 (6 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.55: +3 -1 lines
Diff to previous 1.55 (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 (6 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.54: +65 -34 lines
Diff to previous 1.54 (colored)

Add missing IFM_FDX.

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

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

Revision 1.14.4.7 / (download) - annotate - [select for diffs], Mon Dec 5 10:55:16 2016 UTC (6 years, 2 months ago) by skrll
Branch: nick-nhusb
Changes since 1.14.4.6: +2736 -3000 lines
Diff to previous 1.14.4.6 (colored) to branchpoint 1.14 (colored)

Sync with HEAD

Revision 1.53 / (download) - annotate - [select for diffs], Mon Dec 5 10:05:11 2016 UTC (6 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.52: +7 -8 lines
Diff to previous 1.52 (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 (6 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.51: +104 -47 lines
Diff to previous 1.51 (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 (6 years, 2 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)

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 (6 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.49: +3 -3 lines
Diff to previous 1.49 (colored)

Fix ix{gbe,v}_set_sysctlvalue().

Revision 1.49 / (download) - annotate - [select for diffs], Fri Dec 2 10:46:58 2016 UTC (6 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.48: +7 -5 lines
Diff to previous 1.48 (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 (6 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.47: +337 -141 lines
Diff to previous 1.47 (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 (6 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.46: +40 -7 lines
Diff to previous 1.46 (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 (6 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.45: +10 -5 lines
Diff to previous 1.45 (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 (6 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.44: +992 -138 lines
Diff to previous 1.44 (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 (6 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.43: +963 -299 lines
Diff to previous 1.43 (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 (6 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.42: +540 -325 lines
Diff to previous 1.42 (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 (6 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.41: +47 -2289 lines
Diff to previous 1.41 (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 (6 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.40: +2 -41 lines
Diff to previous 1.40 (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.39.2.1 / (download) - annotate - [select for diffs], Fri Nov 4 14:49:15 2016 UTC (6 years, 3 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.39: +16 -9 lines
Diff to previous 1.39 (colored)

Sync with HEAD

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

provide intr xname

Revision 1.14.4.6 / (download) - annotate - [select for diffs], Wed Oct 5 20:55:56 2016 UTC (6 years, 4 months ago) by skrll
Branch: nick-nhusb
Changes since 1.14.4.5: +3 -2 lines
Diff to previous 1.14.4.5 (colored) to branchpoint 1.14 (colored)

Sync with HEAD

Revision 1.39 / (download) - annotate - [select for diffs], Mon Jul 11 06:14:51 2016 UTC (6 years, 6 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)

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

pointed out by nonaka@n.o.

Revision 1.14.4.5 / (download) - annotate - [select for diffs], Sat Jul 9 20:25:14 2016 UTC (6 years, 6 months ago) by skrll
Branch: nick-nhusb
Changes since 1.14.4.4: +2 -2 lines
Diff to previous 1.14.4.4 (colored) to branchpoint 1.14 (colored)

Sync with HEAD

Revision 1.14.2.6 / (download) - annotate - [select for diffs], Tue Jun 14 08:42:34 2016 UTC (6 years, 7 months ago) by snj
Branch: netbsd-7
CVS Tags: netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-1-RC2, netbsd-7-1-RC1
Branch point for: netbsd-7-nhusb
Changes since 1.14.2.5: +609 -264 lines
Diff to previous 1.14.2.5 (colored) to branchpoint 1.14 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #1174):
	sys/dev/pci/ixgbe/README: 1.2
	sys/dev/pci/ixgbe/ixgbe.c: 1.30-1.33, 1.35 via patch
	sys/dev/pci/ixgbe/ixgbe.h: 1.8 via patch
	sys/dev/pci/ixgbe/ixgbe_82598.c: 1.5 via patch
	sys/dev/pci/ixgbe/ixgbe_82599.c: 1.10 via patch
	sys/dev/pci/ixgbe/ixgbe_api.c: 1.8-1.11 via patch
	sys/dev/pci/ixgbe/ixgbe_api.h: 1.5-1.6 via patch
	sys/dev/pci/ixgbe/ixgbe_common.c: 1.6-1.7 via patch
	sys/dev/pci/ixgbe/ixgbe_common.h: 1.5 via patch
	sys/dev/pci/ixgbe/ixgbe_osdep.h: 1.9 via patch
	sys/dev/pci/ixgbe/ixgbe_phy.c: 1.6 via patch
	sys/dev/pci/ixgbe/ixgbe_phy.h: 1.5 via patch
	sys/dev/pci/ixgbe/ixgbe_type.h: 1.11, 1.13 via patch
	sys/dev/pci/ixgbe/ixgbe_vf.c: 1.5-1.6 via patch
	sys/dev/pci/ixgbe/ixv.c: 1.9-1.10, 1.12-1.14 via patch
	sys/dev/pci/ixgbe/ixv.h: 1.6 via patch
	sys/dev/pci/ixgbe/ixgbe_dcb.c: 1.1
	sys/dev/pci/ixgbe/ixgbe_dcb.h: 1.1
	sys/dev/pci/ixgbe/ixgbe_dcb_82598.c: 1.1
	sys/dev/pci/ixgbe/ixgbe_dcb_82598.h: 1.1
	sys/dev/pci/ixgbe/ixgbe_dcb_82599.c: 1.1
	sys/dev/pci/ixgbe/ixgbe_dcb_82599.h: 1.1
Sync ixg(4) up to ixgbe.c rev. 1.35 except MSI/MSI-X and NET_MPSAFE:
- Sync ixg(4) up to FreeBSD r279805 (or r280181) which include some
  bugfixes.
- Add missing evcnt_detach(&rxr->rx_copies) in ixgbe_detach().
- Fix error path in ixgbe_attach() and ixgbe_detatch() to prevent
  panic.
- Remove unreachable code.
- Remove duplicated assignment of mh->m_len.
- Reduce the diff against FreeBSD (tabs, spaces and comments)
- ixv.c: Fix unintialized data. Include vlan.h and check NVLAN.
- Avoid shadowing global `min'.

Revision 1.38 / (download) - annotate - [select for diffs], Fri Jun 10 13:27:14 2016 UTC (6 years, 7 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)

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.14.4.4 / (download) - annotate - [select for diffs], Sat Mar 19 11:30:18 2016 UTC (6 years, 10 months ago) by skrll
Branch: nick-nhusb
Changes since 1.14.4.3: +14 -3 lines
Diff to previous 1.14.4.3 (colored) to branchpoint 1.14 (colored)

Sync with HEAD

Revision 1.37 / (download) - annotate - [select for diffs], Tue Feb 9 08:32:11 2016 UTC (6 years, 11 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)

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.14.4.3 / (download) - annotate - [select for diffs], Tue Sep 22 12:05:59 2015 UTC (7 years, 4 months ago) by skrll
Branch: nick-nhusb
Changes since 1.14.4.2: +805 -447 lines
Diff to previous 1.14.4.2 (colored) to branchpoint 1.14 (colored)

Sync with HEAD

Revision 1.36 / (download) - annotate - [select for diffs], Mon Aug 17 06:16:03 2015 UTC (7 years, 5 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)

Add kernel code to support intrctl(8).

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

 Reduce diff against FreeBSD r280181.

Revision 1.34 / (download) - annotate - [select for diffs], Thu Aug 13 04:56:43 2015 UTC (7 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.33: +175 -163 lines
Diff to previous 1.33 (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 (7 years, 6 months ago) by msaitoh
Branch: MAIN
Changes since 1.32: +591 -255 lines
Diff to previous 1.32 (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 (7 years, 6 months ago) by msaitoh
Branch: MAIN
Changes since 1.31: +7 -2 lines
Diff to previous 1.31 (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 (7 years, 6 months ago) by msaitoh
Branch: MAIN
Changes since 1.30: +2 -1 lines
Diff to previous 1.30 (colored)

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

Revision 1.14.4.2 / (download) - annotate - [select for diffs], Sat Jun 6 14:40:12 2015 UTC (7 years, 8 months ago) by skrll
Branch: nick-nhusb
Changes since 1.14.4.1: +615 -713 lines
Diff to previous 1.14.4.1 (colored) to branchpoint 1.14 (colored)

Sync with HEAD

Revision 1.30 / (download) - annotate - [select for diffs], Sat May 9 13:08:26 2015 UTC (7 years, 8 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)

remove unreachable code.

Revision 1.14.2.5 / (download) - annotate - [select for diffs], Wed May 6 23:29:21 2015 UTC (7 years, 9 months ago) by riz
Branch: netbsd-7
CVS Tags: netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0
Changes since 1.14.2.4: +412 -401 lines
Diff to previous 1.14.2.4 (colored) to branchpoint 1.14 (colored)

Pull up following revisions (requested by msaitoh in ticket #734):
sys/dev/pci/ixgbe/LICENSE			1.2
sys/dev/pci/ixgbe/ixgbe.c			1.28-1.29
sys/dev/pci/ixgbe/ixgbe.h			1.7
sys/dev/pci/ixgbe/ixgbe_82598.c			1.4
sys/dev/pci/ixgbe/ixgbe_82598.h			1.3
sys/dev/pci/ixgbe/ixgbe_82599.c			1.9
sys/dev/pci/ixgbe/ixgbe_82599.h			1.2
sys/dev/pci/ixgbe/ixgbe_api.c			1.7
sys/dev/pci/ixgbe/ixgbe_api.h			1.4
sys/dev/pci/ixgbe/ixgbe_common.c		1.5
sys/dev/pci/ixgbe/ixgbe_common.h		1.4
sys/dev/pci/ixgbe/ixgbe_mbx.h			1.4
sys/dev/pci/ixgbe/ixgbe_netbsd.h		1.3
sys/dev/pci/ixgbe/ixgbe_osdep.h			1.7
sys/dev/pci/ixgbe/ixgbe_phy.c			1.5
sys/dev/pci/ixgbe/ixgbe_phy.h			1.4
sys/dev/pci/ixgbe/ixgbe_type.h			1.10
sys/dev/pci/ixgbe/ixgbe_vf.c			1.4
sys/dev/pci/ixgbe/ixgbe_vf.h			1.5
sys/dev/pci/ixgbe/ixgbe_x540.c			1.3
sys/dev/pci/ixgbe/ixgbe_x540.h			1.2
sys/dev/pci/ixgbe/ixv.c				1.8

	- 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.
	- Fixes link error without vlan. PR#49879 reported by Hauke Fath.
	[msaitoh, ticket #734]

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

 Fixes link error without vlan. PR#49879.

Revision 1.28 / (download) - annotate - [select for diffs], Fri Apr 24 07:00:51 2015 UTC (7 years, 9 months ago) by msaitoh
Branch: MAIN
Changes since 1.27: +409 -401 lines
Diff to previous 1.27 (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.14.2.4 / (download) - annotate - [select for diffs], Sun Apr 19 06:45:17 2015 UTC (7 years, 9 months ago) by riz
Branch: netbsd-7
Changes since 1.14.2.3: +588 -494 lines
Diff to previous 1.14.2.3 (colored) to branchpoint 1.14 (colored)

Apply patch (requested by msaitoh in ticket #697):
sys/dev/pci/files.pci				1.375 via patch
sys/dev/pci/ixgbe/ixgbe.c			1.24-1.27 via patch
sys/dev/pci/ixgbe/ixgbe.h			1.4-1.6 via patch
sys/dev/pci/ixgbe/ixgbe_82598.c			1.2-1.3 via patch
sys/dev/pci/ixgbe/ixgbe_82598.h			1.1-1.2 via patch
sys/dev/pci/ixgbe/ixgbe_82599.c			1.6-1.8 via patch
sys/dev/pci/ixgbe/ixgbe_82599.h			1.1 via patch
sys/dev/pci/ixgbe/ixgbe_api.c			1.5-1.6 via patch
sys/dev/pci/ixgbe/ixgbe_api.h			1.2-1.3 via patch
sys/dev/pci/ixgbe/ixgbe_common.c		1.3-1.4 via patch
sys/dev/pci/ixgbe/ixgbe_common.h		1.2-1.3 via patch
sys/dev/pci/ixgbe/ixgbe_mbx.c			1.2-1.3 via patch
sys/dev/pci/ixgbe/ixgbe_mbx.h			1.2-1.3 via patch
sys/dev/pci/ixgbe/ixgbe_osdep.h			1.4-1.6 via patch
sys/dev/pci/ixgbe/ixgbe_phy.c			1.3-1.4 via patch
sys/dev/pci/ixgbe/ixgbe_phy.h			1.2-1.3 via patch
sys/dev/pci/ixgbe/ixgbe_type.h			1.8-1.9 via patch
sys/dev/pci/ixgbe/ixgbe_vf.c			1.2-1.3 via patch
sys/dev/pci/ixgbe/ixgbe_vf.h			1.3-1.4 via patch
sys/dev/pci/ixgbe/ixgbe_x540.c			1.1-1.2 via patch
sys/dev/pci/ixgbe/ixgbe_x540.h			1.1 via patch
sys/dev/pci/ixgbe/ixv.c				1.5-1.7 via patch
sys/dev/pci/ixgbe/ixv.h				1.4-1.5 via patch

	Synchronize our ixg(4) driver up to FreeBSD r243716:
	 - Add X540 support.
	 - Add TSO6 support.
	 - Add 100BaseTX 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.
	 - Show 1000Base-SX correctly.
	 - Fix if_baudrate from 1G to 10G.
	 - Fix a bug that ifconfig -z (SOICZIFDATA) doesn't work.
	 - Fix a lot of bugs.
	 - Improve performance.
	[msaitoh, ticket #697]

Revision 1.27 / (download) - annotate - [select for diffs], Tue Apr 14 07:41:52 2015 UTC (7 years, 9 months ago) by msaitoh
Branch: MAIN
Changes since 1.26: +14 -13 lines
Diff to previous 1.26 (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 (7 years, 9 months ago) by msaitoh
Branch: MAIN
Changes since 1.25: +258 -366 lines
Diff to previous 1.25 (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.14.4.1 / (download) - annotate - [select for diffs], Mon Apr 6 15:18:12 2015 UTC (7 years, 10 months ago) by skrll
Branch: nick-nhusb
Changes since 1.14: +596 -181 lines
Diff to previous 1.14 (colored)

Sync with HEAD

Revision 1.25 / (download) - annotate - [select for diffs], Thu Apr 2 09:26:55 2015 UTC (7 years, 10 months ago) by msaitoh
Branch: MAIN
CVS Tags: nick-nhusb-base-20150406
Changes since 1.24: +154 -73 lines
Diff to previous 1.24 (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 (7 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.23: +212 -92 lines
Diff to previous 1.23 (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.14.2.3 / (download) - annotate - [select for diffs], Thu Mar 26 13:39:34 2015 UTC (7 years, 10 months ago) by martin
Branch: netbsd-7
Changes since 1.14.2.2: +227 -25 lines
Diff to previous 1.14.2.2 (colored) to branchpoint 1.14 (colored)

Pull up the following revisions (via patch), requested by msaitoh in #641:

	sys/dev/pci/files.pci				1.374
	sys/dev/pci/ixgbe/ixgbe.h			1.3
	sys/dev/pci/ixgbe/ixgbe.c			1.20-1.23
	sys/dev/pci/ixgbe/ixgbe_type.h			1.3-1.7
	sys/dev/pci/ixgbe/ixgbe_82599.c			1.4-1.5
	sys/dev/pci/ixgbe/ixgbe_api.c			1.3-1.4
	sys/dev/pci/ixgbe/ixgbe_vf.h			1.2
	sys/dev/pci/ixgbe/ixv.c				1.3-1.4
	sys/dev/pci/ixgbe/ixv.h				1.3

 - 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.
 - Fix a bug that vlan setting may not apply to the parent interface correctly.
 - Add 82599EN_SFP and 82599_SFP_SF_QP.
 - Modify to make Intel Intel 10G Ethernet (ixg(4)) virtual function ixv(4)
   compilable. Not completed yet. It's required to use MSI-X.
 - Change comments, tabs and spaces to make difference among *BSDs small.
 - Enclose macro argument correctly. Same as *BSDs. No binary change.
 - Add missing parenthesis in IXGBE_CORE_LOCK_ASSERT() macro. No binary change.

Revision 1.23 / (download) - annotate - [select for diffs], Wed Mar 25 12:53:55 2015 UTC (7 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.22: +4 -1 lines
Diff to previous 1.22 (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 (7 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.21: +221 -24 lines
Diff to previous 1.21 (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 (7 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.20: +4 -2 lines
Diff to previous 1.20 (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 (7 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (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.14.2.2 / (download) - annotate - [select for diffs], Tue Feb 24 10:41:09 2015 UTC (7 years, 11 months ago) by martin
Branch: netbsd-7
Changes since 1.14.2.1: +14 -5 lines
Diff to previous 1.14.2.1 (colored) to branchpoint 1.14 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #545):
	sys/dev/pci/ixgbe/ixgbe.h: revision 1.2
	sys/dev/pci/ixgbe/ixgbe_netbsd.c: revision 1.3
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.16
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.17
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.18
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.19
 Add missing IXGBE_RX_LOCK_DESTROY() for the detach path.
 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.
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.
disable preemption while scheduling the softint to configure the link.

Revision 1.14.2.1 / (download) - annotate - [select for diffs], Tue Feb 17 14:54:37 2015 UTC (7 years, 11 months ago) by martin
Branch: netbsd-7
Changes since 1.14: +14 -11 lines
Diff to previous 1.14 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #527):
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.15
  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.19 / (download) - annotate - [select for diffs], Sat Feb 7 00:02:09 2015 UTC (7 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.18: +9 -3 lines
Diff to previous 1.18 (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 (8 years ago) by msaitoh
Branch: MAIN
Changes since 1.17: +5 -1 lines
Diff to previous 1.17 (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 (8 years ago) by msaitoh
Branch: MAIN
Changes since 1.16: +1 -3 lines
Diff to previous 1.16 (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 (8 years ago) by msaitoh
Branch: MAIN
Changes since 1.15: +2 -1 lines
Diff to previous 1.15 (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 (8 years ago) by msaitoh
Branch: MAIN
Changes since 1.14: +14 -11 lines
Diff to previous 1.14 (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.5.2.1 / (download) - annotate - [select for diffs], Wed Aug 20 00:03:48 2014 UTC (8 years, 5 months ago) by tls
Branch: tls-maxphys
Changes since 1.5: +31 -44 lines
Diff to previous 1.5 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.9.2.1 / (download) - annotate - [select for diffs], Sun Aug 10 06:54:57 2014 UTC (8 years, 5 months ago) by tls
Branch: tls-earlyentropy
Changes since 1.9: +17 -15 lines
Diff to previous 1.9 (colored) next main 1.10 (colored)

Rebase.

Revision 1.1.2.3 / (download) - annotate - [select for diffs], Thu May 22 11:40:34 2014 UTC (8 years, 8 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.1.2.2: +31 -44 lines
Diff to previous 1.1.2.2 (colored) to branchpoint 1.1 (colored) next main 1.2 (colored)

sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision 1.5.4.1 / (download) - annotate - [select for diffs], Sun May 18 17:45:45 2014 UTC (8 years, 8 months ago) by rmind
Branch: rmind-smpnet
Changes since 1.5: +31 -44 lines
Diff to previous 1.5 (colored) next main 1.6 (colored)

sync with head

Revision 1.14 / (download) - annotate - [select for diffs], Mon Apr 21 16:35:06 2014 UTC (8 years, 9 months 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)

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 (8 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.12: +11 -7 lines
Diff to previous 1.12 (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 (8 years, 9 months ago) by hannken
Branch: MAIN
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

Add __diagused.

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

Mark ixgbe_disable_queue as unused.

Revision 1.10 / (download) - annotate - [select for diffs], Tue Apr 8 19:39:06 2014 UTC (8 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.9: +2 -1 lines
Diff to previous 1.9 (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 (8 years, 10 months 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)

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 (8 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.7: +3 -2 lines
Diff to previous 1.7 (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 (8 years, 11 months ago) by pooka
Branch: MAIN
CVS Tags: riastradh-drm2-base3
Changes since 1.6: +2 -7 lines
Diff to previous 1.6 (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 (8 years, 11 months ago) by njoly
Branch: MAIN
Changes since 1.5: +1 -14 lines
Diff to previous 1.5 (colored)

Remove a few noisy debug printf.

Revision 1.1.2.2 / (download) - annotate - [select for diffs], Tue Oct 30 17:21:56 2012 UTC (10 years, 3 months ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.1.2.1: +9 -9 lines
Diff to previous 1.1.2.1 (colored) to branchpoint 1.1 (colored)

sync with head

Revision 1.5 / (download) - annotate - [select for diffs], Mon Jun 18 06:21:11 2012 UTC (10 years, 7 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)

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 (10 years, 7 months ago) by dsl
Branch: MAIN
Changes since 1.3: +5 -5 lines
Diff to previous 1.3 (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 (10 years, 8 months ago) by dsl
Branch: MAIN
Changes since 1.2: +3 -3 lines
Diff to previous 1.2 (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.1.2.1 / (download) - annotate - [select for diffs], Tue Apr 17 00:07:59 2012 UTC (10 years, 9 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.1: +2 -2 lines
Diff to previous 1.1 (colored)

sync with head

Revision 1.2 / (download) - annotate - [select for diffs], Sat Nov 19 22:51:24 2011 UTC (11 years, 2 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)

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 (11 years, 5 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

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>