The NetBSD Project

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

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.24.6.26 / (download) - annotate - [select for diffs], Fri Jun 3 12:31:10 2022 UTC (7 months, 3 weeks ago) by martin
Branch: netbsd-8
Changes since 1.24.6.25: +3 -2 lines
Diff to previous 1.24.6.25 (colored) to branchpoint 1.24 (colored) next main 1.25 (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.56.2.9 / (download) - annotate - [select for diffs], Thu Jun 2 10:45:12 2022 UTC (7 months, 4 weeks ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-3-RELEASE
Changes since 1.56.2.8: +3 -2 lines
Diff to previous 1.56.2.8 (colored) to branchpoint 1.56 (colored) next main 1.57 (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.24.6.25 / (download) - annotate - [select for diffs], Tue May 31 14:07:52 2022 UTC (7 months, 4 weeks ago) by martin
Branch: netbsd-8
Changes since 1.24.6.24: +1 -2 lines
Diff to previous 1.24.6.24 (colored) to branchpoint 1.24 (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.56.2.8 / (download) - annotate - [select for diffs], Tue May 31 14:03:27 2022 UTC (7 months, 4 weeks ago) by martin
Branch: netbsd-9
Changes since 1.56.2.7: +1 -2 lines
Diff to previous 1.56.2.7 (colored) to branchpoint 1.56 (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.86 / (download) - annotate - [select for diffs], Mon May 30 05:08:17 2022 UTC (8 months ago) by msaitoh
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm, HEAD
Changes since 1.85: +1 -2 lines
Diff to previous 1.85 (colored)

Remove unused adapter->msix_mem.

Revision 1.85 / (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.84: +2 -1 lines
Diff to previous 1.84 (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.24.6.24 / (download) - annotate - [select for diffs], Sun Jan 30 16:06:35 2022 UTC (11 months, 4 weeks ago) by martin
Branch: netbsd-8
Changes since 1.24.6.23: +5 -5 lines
Diff to previous 1.24.6.23 (colored) to branchpoint 1.24 (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.56.2.7 / (download) - annotate - [select for diffs], Sun Jan 30 15:58:28 2022 UTC (11 months, 4 weeks ago) by martin
Branch: netbsd-9
Changes since 1.56.2.6: +5 -5 lines
Diff to previous 1.56.2.6 (colored) to branchpoint 1.56 (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.84 / (download) - annotate - [select for diffs], Fri Dec 10 11:33:11 2021 UTC (13 months, 2 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.83: +5 -5 lines
Diff to previous 1.83 (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.24.6.23 / (download) - annotate - [select for diffs], Sat Nov 20 15:21:31 2021 UTC (14 months, 1 week ago) by martin
Branch: netbsd-8
Changes since 1.24.6.22: +18 -3 lines
Diff to previous 1.24.6.22 (colored) to branchpoint 1.24 (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.56.2.6 / (download) - annotate - [select for diffs], Sat Nov 20 15:16:53 2021 UTC (14 months, 1 week ago) by martin
Branch: netbsd-9
Changes since 1.56.2.5: +18 -3 lines
Diff to previous 1.56.2.5 (colored) to branchpoint 1.56 (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.83 / (download) - annotate - [select for diffs], Wed Nov 17 06:37:44 2021 UTC (14 months, 1 week ago) by msaitoh
Branch: MAIN
Changes since 1.82: +2 -2 lines
Diff to previous 1.82 (colored)

s/dataseet/datasheet/ in comment.

Revision 1.82 / (download) - annotate - [select for diffs], Sun Sep 19 10:34:09 2021 UTC (16 months, 1 week ago) by andvar
Branch: MAIN
Changes since 1.81: +2 -2 lines
Diff to previous 1.81 (colored)

fix various typos in comments, messages and documentation.

Revision 1.81 / (download) - annotate - [select for diffs], Thu Sep 16 09:55:28 2021 UTC (16 months, 1 week ago) by msaitoh
Branch: MAIN
Changes since 1.80: +18 -3 lines
Diff to previous 1.80 (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.24.6.22 / (download) - annotate - [select for diffs], Wed Sep 15 16:38:01 2021 UTC (16 months, 2 weeks ago) by martin
Branch: netbsd-8
Changes since 1.24.6.21: +8 -17 lines
Diff to previous 1.24.6.21 (colored) to branchpoint 1.24 (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.56.2.5 / (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.56.2.4: +8 -17 lines
Diff to previous 1.56.2.4 (colored) to branchpoint 1.56 (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.80 / (download) - annotate - [select for diffs], Fri Sep 3 08:57:58 2021 UTC (16 months, 3 weeks ago) by msaitoh
Branch: MAIN
Changes since 1.79: +2 -1 lines
Diff to previous 1.79 (colored)

Save the discard_multidesc state to not to forget the state by exiting rxeof().

Revision 1.79 / (download) - annotate - [select for diffs], Thu Aug 26 09:03:47 2021 UTC (17 months ago) by msaitoh
Branch: MAIN
Changes since 1.78: +2 -2 lines
Diff to previous 1.78 (colored)

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

Revision 1.78 / (download) - annotate - [select for diffs], Wed Aug 25 09:06:02 2021 UTC (17 months ago) by msaitoh
Branch: MAIN
Changes since 1.77: +1 -8 lines
Diff to previous 1.77 (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.77 / (download) - annotate - [select for diffs], Thu Aug 19 22:17:56 2021 UTC (17 months, 1 week ago) by msaitoh
Branch: MAIN
Changes since 1.76: +2 -5 lines
Diff to previous 1.76 (colored)

 Add forgotten commit for previous. Change IXGBE_RX_COPY_LEN_MAX.

Revision 1.75.4.1 / (download) - annotate - [select for diffs], Sun Aug 1 22:42:30 2021 UTC (17 months, 4 weeks ago) by thorpej
Branch: thorpej-i2c-spi-conf
Changes since 1.75: +3 -2 lines
Diff to previous 1.75 (colored) next main 1.76 (colored)

Sync with HEAD.

Revision 1.76 / (download) - annotate - [select for diffs], Wed Jul 7 08:58:19 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.75: +3 -2 lines
Diff to previous 1.75 (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.71.2.3 / (download) - annotate - [select for diffs], Sat Apr 3 22:28:49 2021 UTC (21 months, 3 weeks ago) by thorpej
Branch: thorpej-futex
Changes since 1.71.2.2: +3 -2 lines
Diff to previous 1.71.2.2 (colored) next main 1.72 (colored)

Sync with HEAD.

Revision 1.24.6.21 / (download) - annotate - [select for diffs], Thu Mar 11 16:04:25 2021 UTC (22 months, 2 weeks ago) by martin
Branch: netbsd-8
Changes since 1.24.6.20: +3 -2 lines
Diff to previous 1.24.6.20 (colored) to branchpoint 1.24 (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.56.2.4 / (download) - annotate - [select for diffs], Thu Mar 11 16:00:24 2021 UTC (22 months, 2 weeks ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-2-RELEASE
Changes since 1.56.2.3: +3 -2 lines
Diff to previous 1.56.2.3 (colored) to branchpoint 1.56 (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.75 / (download) - annotate - [select for diffs], Tue Mar 9 10:03:18 2021 UTC (22 months, 3 weeks ago) by msaitoh
Branch: MAIN
CVS Tags: thorpej-futex-base, thorpej-cfargs-base, thorpej-cfargs, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Branch point for: thorpej-i2c-spi-conf
Changes since 1.74: +3 -2 lines
Diff to previous 1.74 (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.71.2.2 / (download) - annotate - [select for diffs], Sun Jan 3 16:35:01 2021 UTC (2 years ago) by thorpej
Branch: thorpej-futex
Changes since 1.71.2.1: +8 -7 lines
Diff to previous 1.71.2.1 (colored)

Sync w/ HEAD.

Revision 1.74 / (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.73: +8 -7 lines
Diff to previous 1.73 (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.71.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.71: +9 -3 lines
Diff to previous 1.71 (colored)

Sync w/ HEAD.

Revision 1.73 / (download) - annotate - [select for diffs], Thu Nov 19 02:23:24 2020 UTC (2 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.72: +3 -3 lines
Diff to previous 1.72 (colored)

 Add comment.

Revision 1.72 / (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.71: +7 -1 lines
Diff to previous 1.71 (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.71 / (download) - annotate - [select for diffs], Mon Aug 31 11:19:54 2020 UTC (2 years, 4 months ago) by msaitoh
Branch: MAIN
Branch point for: thorpej-futex
Changes since 1.70: +1 -6 lines
Diff to previous 1.70 (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.70 / (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.69: +6 -1 lines
Diff to previous 1.69 (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.69 / (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.68: +2 -1 lines
Diff to previous 1.68 (colored)

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

Revision 1.68 / (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.67: +1 -4 lines
Diff to previous 1.67 (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.24.6.20 / (download) - annotate - [select for diffs], Wed Aug 5 15:58:02 2020 UTC (2 years, 5 months ago) by martin
Branch: netbsd-8
Changes since 1.24.6.19: +47 -68 lines
Diff to previous 1.24.6.19 (colored) to branchpoint 1.24 (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.56.2.3 / (download) - annotate - [select for diffs], Fri Jul 10 11:35:51 2020 UTC (2 years, 6 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-1-RELEASE
Changes since 1.56.2.2: +47 -68 lines
Diff to previous 1.56.2.2 (colored) to branchpoint 1.56 (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.67 / (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.66: +26 -16 lines
Diff to previous 1.66 (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.66 / (download) - annotate - [select for diffs], Tue Jun 23 05:50:01 2020 UTC (2 years, 7 months ago) by msaitoh
Branch: MAIN
Changes since 1.65: +47 -43 lines
Diff to previous 1.65 (colored)

 KNF. No functional change.

Revision 1.50.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.50.2.1: +23 -43 lines
Diff to previous 1.50.2.1 (colored) to branchpoint 1.50 (colored) next main 1.51 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.60.2.2 / (download) - annotate - [select for diffs], Sat Feb 29 20:19:15 2020 UTC (2 years, 11 months ago) by ad
Branch: ad-namecache
Changes since 1.60.2.1: +6 -25 lines
Diff to previous 1.60.2.1 (colored) to branchpoint 1.60 (colored) next main 1.61 (colored)

Sync with head.

Revision 1.65 / (download) - annotate - [select for diffs], Thu Feb 6 06:28:49 2020 UTC (2 years, 11 months ago) by thorpej
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, is-mlppp-base, is-mlppp, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh, ad-namecache-base3
Changes since 1.64: +2 -1 lines
Diff to previous 1.64 (colored)

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

Revision 1.64 / (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.63: +1 -24 lines
Diff to previous 1.63 (colored)

No functional change:

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

Revision 1.63 / (download) - annotate - [select for diffs], Tue Feb 4 19:42:55 2020 UTC (2 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.62: +5 -2 lines
Diff to previous 1.62 (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.56.2.2 / (download) - annotate - [select for diffs], Sun Jan 26 11:03:17 2020 UTC (3 years ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-0-RELEASE, netbsd-9-0-RC2
Changes since 1.56.2.1: +6 -4 lines
Diff to previous 1.56.2.1 (colored) to branchpoint 1.56 (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.60.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.60: +3 -1 lines
Diff to previous 1.60 (colored)

Sync with head.

Revision 1.24.6.19 / (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.24.6.18: +6 -4 lines
Diff to previous 1.24.6.18 (colored) to branchpoint 1.24 (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.62 / (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.61: +2 -1 lines
Diff to previous 1.61 (colored)

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

Revision 1.61 / (download) - annotate - [select for diffs], Mon Jan 20 07:19:04 2020 UTC (3 years ago) by msaitoh
Branch: MAIN
Changes since 1.60: +2 -1 lines
Diff to previous 1.60 (colored)

 Free jumbo mem structure correctly. Found by yamaguchi@ using with LOCKDEBUG.

Revision 1.60 / (download) - annotate - [select for diffs], Mon Dec 16 02:50:54 2019 UTC (3 years, 1 month ago) by msaitoh
Branch: MAIN
CVS Tags: ad-namecache-base1, ad-namecache-base
Branch point for: ad-namecache
Changes since 1.59: +4 -4 lines
Diff to previous 1.59 (colored)

No functional change:

 - Remove unused code.
 - Remove extra spaces.
 - KNF.

Revision 1.59 / (download) - annotate - [select for diffs], Wed Oct 30 07:27:51 2019 UTC (3 years, 3 months ago) by msaitoh
Branch: MAIN
CVS Tags: phil-wifi-20191119
Changes since 1.58: +1 -3 lines
Diff to previous 1.58 (colored)

G.C. (if_ipackets)

Revision 1.56.2.1 / (download) - annotate - [select for diffs], Thu Sep 26 19:07:22 2019 UTC (3 years, 4 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-0-RC1
Changes since 1.56: +2 -4 lines
Diff to previous 1.56 (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.24.6.18 / (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.24.6.17: +2 -4 lines
Diff to previous 1.24.6.17 (colored) to branchpoint 1.24 (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.58 / (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.57: +2 -2 lines
Diff to previous 1.57 (colored)

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

Revision 1.57 / (download) - annotate - [select for diffs], Thu Sep 12 06:19:47 2019 UTC (3 years, 4 months ago) by msaitoh
Branch: MAIN
Changes since 1.56: +1 -3 lines
Diff to previous 1.56 (colored)

- Make SIOCADDMULTI returns ENOSPC when the Ethenet multicast address list
  exceeds the limit.
- State "Ethernet" multicast address.
- Use macro.

Revision 1.24.6.17 / (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.24.6.16: +27 -11 lines
Diff to previous 1.24.6.16 (colored) to branchpoint 1.24 (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.56 / (download) - annotate - [select for diffs], Wed Jul 17 03:26:24 2019 UTC (3 years, 6 months ago) by msaitoh
Branch: MAIN
CVS Tags: netbsd-9-base
Branch point for: netbsd-9
Changes since 1.55: +3 -2 lines
Diff to previous 1.55 (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.55 / (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.54: +11 -11 lines
Diff to previous 1.54 (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.50.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.50: +34 -4 lines
Diff to previous 1.50 (colored)

Sync with HEAD

Revision 1.24.6.16 / (download) - annotate - [select for diffs], Fri Mar 1 17:33:24 2019 UTC (3 years, 11 months ago) by martin
Branch: netbsd-8
CVS Tags: netbsd-8-1-RELEASE, netbsd-8-1-RC1
Changes since 1.24.6.15: +2 -2 lines
Diff to previous 1.24.6.15 (colored) to branchpoint 1.24 (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.54 / (download) - annotate - [select for diffs], Fri Feb 22 06:49:15 2019 UTC (3 years, 11 months ago) by msaitoh
Branch: MAIN
CVS Tags: phil-wifi-20190609, isaki-audio2-base, isaki-audio2
Changes since 1.53: +2 -2 lines
Diff to previous 1.53 (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.24.6.15 / (download) - annotate - [select for diffs], Mon Jan 28 13:03:02 2019 UTC (4 years ago) by martin
Branch: netbsd-8
Changes since 1.24.6.14: +12 -1 lines
Diff to previous 1.24.6.14 (colored) to branchpoint 1.24 (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.32.2.9 / (download) - annotate - [select for diffs], Wed Dec 26 14:02:01 2018 UTC (4 years, 1 month ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.32.2.8: +28 -1 lines
Diff to previous 1.32.2.8 (colored) to branchpoint 1.32 (colored) next main 1.33 (colored)

Sync with HEAD, resolve a few conflicts

Revision 1.53 / (download) - annotate - [select for diffs], Thu Dec 6 13:25:02 2018 UTC (4 years, 1 month ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226
Changes since 1.52: +17 -1 lines
Diff to previous 1.52 (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.52 / (download) - annotate - [select for diffs], Mon Dec 3 04:39:44 2018 UTC (4 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.51: +12 -1 lines
Diff to previous 1.51 (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.32.2.8 / (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.32.2.7: +6 -3 lines
Diff to previous 1.32.2.7 (colored) to branchpoint 1.32 (colored)

Sync with HEAD

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

Revision 1.24.6.14 / (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.24.6.13: +6 -3 lines
Diff to previous 1.24.6.13 (colored) to branchpoint 1.24 (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.51 / (download) - annotate - [select for diffs], Tue Jul 31 09:19:34 2018 UTC (4 years, 6 months ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, jdolecek-ncqfixes-base, jdolecek-ncqfixes
Changes since 1.50: +6 -3 lines
Diff to previous 1.50 (colored)

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

Revision 1.24.6.13 / (download) - annotate - [select for diffs], Thu Jul 26 23:55:30 2018 UTC (4 years, 6 months ago) by snj
Branch: netbsd-8
Changes since 1.24.6.12: +1 -2 lines
Diff to previous 1.24.6.12 (colored) to branchpoint 1.24 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #938):
	sys/arch/acorn32/podulebus/if_ie.c: revision 1.41
	sys/arch/amiga/dev/if_es.c: revision 1.58
	sys/arch/amiga/dev/if_qn.c: revision 1.45
	sys/arch/arm/at91/at91emac.c: revision 1.20
	sys/arch/arm/ep93xx/epe.c: revision 1.37
	sys/arch/emips/ebus/if_le_ebus.c: revision 1.14
	sys/arch/emips/ebus/if_le_ebus.c: revision 1.15
	sys/arch/mac68k/dev/if_mc.c: revision 1.46
	sys/arch/macppc/dev/am79c950.c: revision 1.39
	sys/arch/newsmips/apbus/if_sn.c: revision 1.40
	sys/arch/next68k/dev/mb8795.c: revision 1.59
	sys/arch/playstation2/dev/if_smap.c: revision 1.25
	sys/arch/playstation2/dev/if_smap.c: revision 1.26
	sys/arch/sun2/dev/if_ec.c: revision 1.28
	sys/arch/sun3/dev/if_ie.c: revision 1.63
	sys/arch/x68k/dev/if_ne_intio.c: revision 1.19
	sys/arch/xen/xen/if_xennet_xenbus.c: revision 1.75
	sys/arch/xen/xen/xennetback_xenbus.c: revision 1.63
	sys/dev/bi/if_ni.c: revision 1.45
	sys/dev/cadence/if_cemac.c: revision 1.12
	sys/dev/ic/am7990.c: revision 1.78
	sys/dev/ic/am79900.c: revision 1.27
	sys/dev/ic/an.c: revision 1.67
	sys/dev/ic/cs89x0.c: revision 1.40
	sys/dev/ic/dm9000.c: revision 1.13
	sys/dev/ic/dm9000.c: revision 1.14
	sys/dev/ic/dp8390.c: revision 1.88
	sys/dev/ic/elink3.c: revision 1.141
	sys/dev/ic/elinkxl.c: revision 1.122
	sys/dev/ic/hme.c: revision 1.98
	sys/dev/ic/i82586.c: revision 1.77
	sys/dev/ic/lance.c: revision 1.53
	sys/dev/ic/mb86950.c: revision 1.27
	sys/dev/ic/mb86960.c: revision 1.86
	sys/dev/ic/mtd803.c: revision 1.34
	sys/dev/ic/pdq_ifsubr.c: revision 1.59
	sys/dev/ic/rrunner.c: revision 1.86
	sys/dev/ic/seeq8005.c: revision 1.58
	sys/dev/ic/sgec.c: revision 1.47
	sys/dev/ic/smc90cx6.c: revision 1.72
	sys/dev/ic/smc91cxx.c: revision 1.96
	sys/dev/ic/tropic.c: revision 1.49
	sys/dev/ic/wi.c: revision 1.245
	sys/dev/isa/if_eg.c: revision 1.93
	sys/dev/isa/if_el.c: revision 1.95
	sys/dev/isa/if_iy.c: revision 1.101
	sys/dev/ofw/ofnet.c: revision 1.58
	sys/dev/pci/if_alc.c: revision 1.27
	sys/dev/pci/if_de.c: revision 1.152
	sys/dev/pci/if_fpa.c: revision 1.61
	sys/dev/pci/if_jme.c: revision 1.34
	sys/dev/pci/if_tl.c: revision 1.108
	sys/dev/pci/if_vte.c: revision 1.19
	sys/dev/pci/ixgbe/ixgbe.h: revision 1.50
	sys/dev/pcmcia/if_cnw.c: revision 1.62
	sys/dev/pcmcia/if_malo_pcmcia.c: revision 1.17
	sys/dev/pcmcia/if_ray.c: revision 1.89
	sys/dev/pcmcia/if_xi.c: revision 1.81
	sys/dev/pcmcia/mhzc.c: revision 1.51
	sys/dev/pcmcia/xirc.c: revision 1.34
	sys/dev/qbus/if_de.c: revision 1.33
	sys/dev/qbus/if_qe.c: revision 1.78
	sys/dev/qbus/if_qt.c: revision 1.22
	sys/dev/sbus/be.c: revision 1.87
	sys/dev/sbus/qe.c: revision 1.68
	sys/dev/scsipi/if_se.c: revision 1.96
	sys/dev/usb/if_atu.c: revision 1.59
	sys/net/if_l2tp.c: revision 1.28 via patch
	sys/net/if_ppp.c: revision 1.160
It's not required to include net/bpfdesc.h. Remove it.
--
Simplify like other drivers. NULL check of ifp->if_bpf is done in
bpf_mtap(), so it's not required to do it here.
--
Remove duplicated inclusion of net/bpf.h.
--
Remove duplicated inclusion of net/bpf.h.
--
Simplify bpf_mtap() call. No functional change.

Revision 1.32.2.7 / (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.32.2.6: +2 -2 lines
Diff to previous 1.32.2.6 (colored) to branchpoint 1.32 (colored)

Sync with HEAD

Revision 1.50 / (download) - annotate - [select for diffs], Mon Jun 25 05:06:10 2018 UTC (4 years, 7 months ago) by msaitoh
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-0728, pgoyette-compat-0625
Branch point for: phil-wifi
Changes since 1.49: +1 -2 lines
Diff to previous 1.49 (colored)

 Remove duplicated inclusion of net/bpf.h.

Revision 1.24.6.12 / (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.24.6.11: +12 -16 lines
Diff to previous 1.24.6.11 (colored) to branchpoint 1.24 (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.49 / (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.48: +2 -1 lines
Diff to previous 1.48 (colored)

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

Revision 1.32.2.6 / (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.32.2.5: +1 -1 lines
Diff to previous 1.32.2.5 (colored) to branchpoint 1.32 (colored)

Sync with HEAD

Revision 1.48 / (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.47: +6 -4 lines
Diff to previous 1.47 (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.47 / (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.46: +3 -5 lines
Diff to previous 1.46 (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.32.2.5 / (download) - annotate - [select for diffs], Wed May 2 07:20:11 2018 UTC (4 years, 8 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.32.2.4: +4 -1 lines
Diff to previous 1.32.2.4 (colored) to branchpoint 1.32 (colored)

Synch with HEAD

Revision 1.46 / (download) - annotate - [select for diffs], Wed Apr 25 08:46:19 2018 UTC (4 years, 9 months ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-compat-0502
Changes since 1.45: +4 -1 lines
Diff to previous 1.45 (colored)

 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.

Revision 1.32.2.4 / (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.32.2.3: +13 -20 lines
Diff to previous 1.32.2.3 (colored) to branchpoint 1.32 (colored)

Sync with HEAD

Revision 1.45 / (download) - annotate - [select for diffs], Thu Apr 19 21:50:09 2018 UTC (4 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: pgoyette-compat-0422
Changes since 1.44: +5 -5 lines
Diff to previous 1.44 (colored)

s/static inline/static __inline/g for consistency.

Revision 1.44 / (download) - annotate - [select for diffs], Thu Apr 19 06:04:31 2018 UTC (4 years, 9 months ago) by msaitoh
Branch: MAIN
Changes since 1.43: +1 -3 lines
Diff to previous 1.43 (colored)

 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.

Revision 1.43 / (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.42: +8 -14 lines
Diff to previous 1.42 (colored)

 Remove unused structure entries. No functional change.

Revision 1.24.6.11 / (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.24.6.10: +2 -1 lines
Diff to previous 1.24.6.10 (colored) to branchpoint 1.24 (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.42 / (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.41: +2 -1 lines
Diff to previous 1.41 (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.24.6.10 / (download) - annotate - [select for diffs], Sat Apr 14 10:25:12 2018 UTC (4 years, 9 months ago) by martin
Branch: netbsd-8
Changes since 1.24.6.9: +2 -2 lines
Diff to previous 1.24.6.9 (colored) to branchpoint 1.24 (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.32.2.3 / (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.32.2.2: +3 -2 lines
Diff to previous 1.32.2.2 (colored) to branchpoint 1.32 (colored)

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

Revision 1.24.6.9 / (download) - annotate - [select for diffs], Wed Apr 4 16:18:49 2018 UTC (4 years, 9 months ago) by martin
Branch: netbsd-8
Changes since 1.24.6.8: +13 -7 lines
Diff to previous 1.24.6.8 (colored) to branchpoint 1.24 (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.41 / (download) - annotate - [select for diffs], Wed Apr 4 08:13:07 2018 UTC (4 years, 9 months ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-compat-0415, pgoyette-compat-0407
Changes since 1.40: +2 -2 lines
Diff to previous 1.40 (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.40 / (download) - annotate - [select for diffs], Mon Apr 2 05:02:55 2018 UTC (4 years, 9 months ago) by knakahara
Branch: MAIN
Changes since 1.39: +2 -1 lines
Diff to previous 1.39 (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.24.6.8 / (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.24.6.7: +8 -8 lines
Diff to previous 1.24.6.7 (colored) to branchpoint 1.24 (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.32.2.2 / (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.32.2.1: +16 -7 lines
Diff to previous 1.32.2.1 (colored) to branchpoint 1.32 (colored)

Resolve conflicts between branch and HEAD

Revision 1.39 / (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.38: +8 -3 lines
Diff to previous 1.38 (colored)

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

XXX pullup-8

Revision 1.38 / (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.37: +5 -5 lines
Diff to previous 1.37 (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.37 / (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.36: +5 -1 lines
Diff to previous 1.36 (colored)

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

Revision 1.32.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.32: +20 -16 lines
Diff to previous 1.32 (colored)

Synch with HEAD

Revision 1.36 / (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-0322, pgoyette-compat-0315
Changes since 1.35: +4 -8 lines
Diff to previous 1.35 (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.24.6.7 / (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.24.6.6: +15 -5 lines
Diff to previous 1.24.6.6 (colored) to branchpoint 1.24 (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.35 / (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.34: +15 -5 lines
Diff to previous 1.34 (colored)

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

Revision 1.24.6.6 / (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.24.6.5: +3 -3 lines
Diff to previous 1.24.6.5 (colored) to branchpoint 1.24 (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.34 / (download) - annotate - [select for diffs], Wed Mar 7 03:29:10 2018 UTC (4 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.33: +3 -3 lines
Diff to previous 1.33 (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.24.6.5 / (download) - annotate - [select for diffs], Tue Mar 6 11:12:40 2018 UTC (4 years, 10 months ago) by martin
Branch: netbsd-8
Changes since 1.24.6.4: +17 -1 lines
Diff to previous 1.24.6.4 (colored) to branchpoint 1.24 (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.33 / (download) - annotate - [select for diffs], Tue Mar 6 03:47:23 2018 UTC (4 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.32: +3 -5 lines
Diff to previous 1.32 (colored)

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

Revision 1.32 / (download) - annotate - [select for diffs], Fri Mar 2 10:19:20 2018 UTC (4 years, 10 months ago) by knakahara
Branch: MAIN
CVS Tags: pgoyette-compat-base
Branch point for: pgoyette-compat
Changes since 1.31: +19 -1 lines
Diff to previous 1.31 (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.24.6.4 / (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.24.6.3: +4 -1 lines
Diff to previous 1.24.6.3 (colored) to branchpoint 1.24 (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.24.6.3 / (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.24.6.2: +2 -2 lines
Diff to previous 1.24.6.2 (colored) to branchpoint 1.24 (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.31 / (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.30: +4 -1 lines
Diff to previous 1.30 (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.30 / (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.29: +2 -2 lines
Diff to previous 1.29 (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.24.6.2 / (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.24.6.1: +202 -390 lines
Diff to previous 1.24.6.1 (colored) to branchpoint 1.24 (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.29 / (download) - annotate - [select for diffs], Wed Dec 6 04:08:50 2017 UTC (5 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.28: +2 -1 lines
Diff to previous 1.28 (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.1.12.1 / (download) - annotate - [select for diffs], Sun Dec 3 11:37:29 2017 UTC (5 years, 1 month ago) by jdolecek
Branch: tls-maxphys
Changes since 1.1: +372 -180 lines
Diff to previous 1.1 (colored) next main 1.2 (colored)

update from HEAD

Revision 1.28 / (download) - annotate - [select for diffs], Wed Nov 22 15:15:09 2017 UTC (5 years, 2 months ago) by msaitoh
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202
Changes since 1.27: +3 -1 lines
Diff to previous 1.27 (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.27 / (download) - annotate - [select for diffs], Thu Nov 2 08:41:15 2017 UTC (5 years, 2 months ago) by msaitoh
Branch: MAIN
Changes since 1.26: +8 -6 lines
Diff to previous 1.26 (colored)

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

Revision 1.24.6.1 / (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.24: +1 -4 lines
Diff to previous 1.24 (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.26 / (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.25: +195 -388 lines
Diff to previous 1.25 (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.1.30.6 / (download) - annotate - [select for diffs], Mon Aug 28 17:52:26 2017 UTC (5 years, 5 months ago) by skrll
Branch: nick-nhusb
Changes since 1.1.30.5: +2 -10 lines
Diff to previous 1.1.30.5 (colored) to branchpoint 1.1 (colored) next main 1.2 (colored)

Sync with HEAD

Revision 1.25 / (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.24: +1 -4 lines
Diff to previous 1.24 (colored)

 Remove unused counters.

Revision 1.18.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.18: +19 -19 lines
Diff to previous 1.18 (colored) next main 1.19 (colored)

Sync with HEAD

Revision 1.9.2.2 / (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.9.2.1: +19 -19 lines
Diff to previous 1.9.2.1 (colored) to branchpoint 1.9 (colored) next main 1.10 (colored)

Sync with HEAD

Revision 1.24 / (download) - annotate - [select for diffs], Mon Feb 13 10:13:54 2017 UTC (5 years, 11 months ago) by msaitoh
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, pgoyette-localcount-20170320, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-8-base, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1
Branch point for: netbsd-8
Changes since 1.23: +2 -1 lines
Diff to previous 1.23 (colored)

Use percpuq.

Revision 1.23 / (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.22: +1 -7 lines
Diff to previous 1.22 (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.1.30.5 / (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.1.30.4: +20 -14 lines
Diff to previous 1.1.30.4 (colored) to branchpoint 1.1 (colored)

Sync with HEAD

Revision 1.22 / (download) - annotate - [select for diffs], Wed Feb 1 10:47:13 2017 UTC (5 years, 11 months ago) by msaitoh
Branch: MAIN
CVS Tags: nick-nhusb-base-20170204
Changes since 1.21: +9 -11 lines
Diff to previous 1.21 (colored)

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

Revision 1.21 / (download) - annotate - [select for diffs], Mon Jan 30 05:02:43 2017 UTC (6 years ago) by msaitoh
Branch: MAIN
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

- Count tso_err again. It was accidentally removed in ixgbe.c rev. 1.28.
- ixgbe.h: Sort entries to reduce diff against FreeBSD.

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

 Fix SFP+ insersion or replacement stuff.

Revision 1.19 / (download) - annotate - [select for diffs], Wed Jan 18 10:18:40 2017 UTC (6 years ago) by msaitoh
Branch: MAIN
Changes since 1.18: +2 -1 lines
Diff to previous 1.18 (colored)

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

Revision 1.9.2.1 / (download) - annotate - [select for diffs], Sat Jan 7 08:56:40 2017 UTC (6 years ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.9: +383 -29 lines
Diff to previous 1.9 (colored)

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

Revision 1.1.30.4 / (download) - annotate - [select for diffs], Mon Dec 5 10:55:16 2016 UTC (6 years, 1 month ago) by skrll
Branch: nick-nhusb
Changes since 1.1.30.3: +382 -29 lines
Diff to previous 1.1.30.3 (colored) to branchpoint 1.1 (colored)

Sync with HEAD

Revision 1.18 / (download) - annotate - [select for diffs], Mon Dec 5 08:50:29 2016 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.17: +3 -2 lines
Diff to previous 1.17 (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.17 / (download) - annotate - [select for diffs], Fri Dec 2 10:46:58 2016 UTC (6 years, 1 month ago) by msaitoh
Branch: MAIN
CVS Tags: nick-nhusb-base-20161204
Changes since 1.16: +2 -2 lines
Diff to previous 1.16 (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.16 / (download) - annotate - [select for diffs], Fri Dec 2 10:42:04 2016 UTC (6 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.15: +11 -14 lines
Diff to previous 1.15 (colored)

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

Revision 1.15 / (download) - annotate - [select for diffs], Fri Dec 2 10:34:23 2016 UTC (6 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.14: +7 -3 lines
Diff to previous 1.14 (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.14 / (download) - annotate - [select for diffs], Fri Dec 2 10:24:31 2016 UTC (6 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.13: +2 -1 lines
Diff to previous 1.13 (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.13 / (download) - annotate - [select for diffs], Fri Dec 2 10:21:43 2016 UTC (6 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.12: +214 -5 lines
Diff to previous 1.12 (colored)

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

Revision 1.12 / (download) - annotate - [select for diffs], Thu Dec 1 06:56:28 2016 UTC (6 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.11: +34 -5 lines
Diff to previous 1.11 (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.11 / (download) - annotate - [select for diffs], Thu Dec 1 06:27:18 2016 UTC (6 years, 1 month ago) by msaitoh
Branch: MAIN
Changes since 1.10: +114 -24 lines
Diff to previous 1.10 (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.10 / (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.9: +24 -1 lines
Diff to previous 1.9 (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.1.28.5 / (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-nhusb, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1
Changes since 1.1.28.4: +10 -7 lines
Diff to previous 1.1.28.4 (colored) to branchpoint 1.1 (colored) next main 1.2 (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.1.30.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.1.30.2: +11 -7 lines
Diff to previous 1.1.30.2 (colored) to branchpoint 1.1 (colored)

Sync with HEAD

Revision 1.9 / (download) - annotate - [select for diffs], Mon Aug 17 06:16:03 2015 UTC (7 years, 5 months ago) by knakahara
Branch: MAIN
CVS Tags: pgoyette-localcount-base, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20161004, nick-nhusb-base-20160907, nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226, nick-nhusb-base-20150921, localcount-20160914
Branch point for: pgoyette-localcount
Changes since 1.8: +2 -1 lines
Diff to previous 1.8 (colored)

Add kernel code to support intrctl(8).

Revision 1.8 / (download) - annotate - [select for diffs], Wed Aug 5 04:08:44 2015 UTC (7 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.7: +10 -7 lines
Diff to previous 1.7 (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.1.30.2 / (download) - annotate - [select for diffs], Sat Jun 6 14:40:12 2015 UTC (7 years, 7 months ago) by skrll
Branch: nick-nhusb
Changes since 1.1.30.1: +83 -61 lines
Diff to previous 1.1.30.1 (colored) to branchpoint 1.1 (colored)

Sync with HEAD

Revision 1.1.28.4 / (download) - annotate - [select for diffs], Wed May 6 23:29:21 2015 UTC (7 years, 8 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.1.28.3: +37 -28 lines
Diff to previous 1.1.28.3 (colored) to branchpoint 1.1 (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.7 / (download) - annotate - [select for diffs], Fri Apr 24 07:00:51 2015 UTC (7 years, 9 months ago) by msaitoh
Branch: MAIN
CVS Tags: nick-nhusb-base-20150606
Changes since 1.6: +36 -27 lines
Diff to previous 1.6 (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.1.28.3 / (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.1.28.2: +33 -16 lines
Diff to previous 1.1.28.2 (colored) to branchpoint 1.1 (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.6 / (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.5: +28 -15 lines
Diff to previous 1.5 (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.1.30.1 / (download) - annotate - [select for diffs], Mon Apr 6 15:18:12 2015 UTC (7 years, 9 months ago) by skrll
Branch: nick-nhusb
Changes since 1.1: +13 -9 lines
Diff to previous 1.1 (colored)

Sync with HEAD

Revision 1.5 / (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.4: +2 -2 lines
Diff to previous 1.4 (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.4 / (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.3: +9 -5 lines
Diff to previous 1.3 (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.1.28.2 / (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.1.28.1: +2 -2 lines
Diff to previous 1.1.28.1 (colored) to branchpoint 1.1 (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.3 / (download) - annotate - [select for diffs], Tue Mar 10 08:54:17 2015 UTC (7 years, 10 months ago) by msaitoh
Branch: MAIN
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

 Add missing parenthesis in IXGBE_CORE_LOCK_ASSERT() macro. No binary change.

Revision 1.1.28.1 / (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.1: +2 -2 lines
Diff to previous 1.1 (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.2 / (download) - annotate - [select for diffs], Wed Feb 4 09:05:53 2015 UTC (7 years, 11 months ago) by msaitoh
Branch: MAIN
Changes since 1.1: +2 -2 lines
Diff to previous 1.1 (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.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-tag8, yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, yamt-pagecache, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, rmind-smpnet-nbase, rmind-smpnet-base, rmind-smpnet, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, nick-nhusb-base, netbsd-7-base, 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, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, khorben-n900, 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, jmcneill-audiomp3-base, jmcneill-audiomp3, agc-symver-base, agc-symver
Branch point for: tls-maxphys, nick-nhusb, netbsd-7

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>