git: eed1cc6cdfa7 - main - Support COM3 and COM4 serial ports.

2021-01-19 Thread Peter Grehan
The branch main has been updated by grehan:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=eed1cc6cdfa743e52ac3ea0b788e95b069a5f2f3

commit eed1cc6cdfa743e52ac3ea0b788e95b069a5f2f3
Author: Peter Grehan 
AuthorDate: 2021-01-19 17:30:22 +
Commit: Peter Grehan 
CommitDate: 2021-01-19 17:30:22 +

Support COM3 and COM4 serial ports.

Submitted by: Jan Poctavek , otis
Reviewed by: grehan (bhyve), imp, 0mp (manpages)
Differential Revision: https://reviews.freebsd.org/D28207
---
 usr.sbin/bhyve/bhyve.8 | 6 +++---
 usr.sbin/bhyve/pci_lpc.c   | 4 ++--
 usr.sbin/bhyve/uart_emul.c | 6 ++
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8
index a3ea7be0b579..5d8f37813e7f 100644
--- a/usr.sbin/bhyve/bhyve.8
+++ b/usr.sbin/bhyve/bhyve.8
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 23, 2020
+.Dd January 18, 2021
 .Dt BHYVE 8
 .Os
 .Sh NAME
@@ -153,8 +153,8 @@ If this option is not specified, virtual CPUs will use 100% 
of a host CPU.
 Allow devices behind the LPC PCI-ISA bridge to be configured.
 The only supported devices are the TTY-class devices
 .Ar com1
-and
-.Ar com2 ,
+through
+.Ar com4 ,
 the boot ROM device
 .Ar bootrom ,
 and the debug/test device
diff --git a/usr.sbin/bhyve/pci_lpc.c b/usr.sbin/bhyve/pci_lpc.c
index 3f7df55b5ffd..aa5997848f24 100644
--- a/usr.sbin/bhyve/pci_lpc.c
+++ b/usr.sbin/bhyve/pci_lpc.c
@@ -70,7 +70,7 @@ static struct pci_devinst *lpc_bridge;
 
 static const char *romfile;
 
-#defineLPC_UART_NUM2
+#defineLPC_UART_NUM4
 static struct lpc_uart_softc {
struct uart_softc *uart_softc;
const char *opts;
@@ -79,7 +79,7 @@ static struct lpc_uart_softc {
int enabled;
 } lpc_uart_softc[LPC_UART_NUM];
 
-static const char *lpc_uart_names[LPC_UART_NUM] = { "COM1", "COM2" };
+static const char *lpc_uart_names[LPC_UART_NUM] = { "COM1", "COM2", "COM3", 
"COM4" };
 
 static bool pctestdev_present;
 
diff --git a/usr.sbin/bhyve/uart_emul.c b/usr.sbin/bhyve/uart_emul.c
index a89974590a1f..1b55231b2bf5 100644
--- a/usr.sbin/bhyve/uart_emul.c
+++ b/usr.sbin/bhyve/uart_emul.c
@@ -62,6 +62,10 @@ __FBSDID("$FreeBSD$");
 #defineCOM1_IRQ4
 #defineCOM2_BASE   0x2F8
 #defineCOM2_IRQ3
+#defineCOM3_BASE   0x3E8
+#defineCOM3_IRQ4
+#defineCOM4_BASE   0x2E8
+#defineCOM4_IRQ3
 
 #defineDEFAULT_RCLK1843200
 #defineDEFAULT_BAUD9600
@@ -89,6 +93,8 @@ static struct {
 } uart_lres[] = {
{ COM1_BASE, COM1_IRQ, false},
{ COM2_BASE, COM2_IRQ, false},
+   { COM3_BASE, COM3_IRQ, false},
+   { COM4_BASE, COM4_IRQ, false},
 };
 
 #defineUART_NLDEVS (sizeof(uart_lres) / sizeof(uart_lres[0]))
___
dev-commits-src-main@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main
To unsubscribe, send any mail to "dev-commits-src-main-unsubscr...@freebsd.org"


git: 5aaea4b99e5c - main - Always clamp curve25519 keys prior to use.

2021-02-03 Thread Peter Grehan
The branch main has been updated by grehan:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=5aaea4b99e5cc724e97e24a68876e8768d3d8012

commit 5aaea4b99e5cc724e97e24a68876e8768d3d8012
Author: Peter Grehan 
AuthorDate: 2021-02-03 09:05:09 +
Commit: Peter Grehan 
CommitDate: 2021-02-03 09:05:09 +

Always clamp curve25519 keys prior to use.

This fixes an issue where a private key contained bits that should
have been cleared by the clamping process, but were passed through
to the scalar multiplication routine and resulted in an invalid
public key.

Issue diagnosed (and an initial fix proposed) by shamaz.mazum in
PR 252894.

This fix suggested by Jason Donenfeld.

PR: 252894
Reported by:shamaz.mazum
Reviewed by:dch
MFC after:  3 days
---
 sys/dev/if_wg/module/curve25519.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/dev/if_wg/module/curve25519.c 
b/sys/dev/if_wg/module/curve25519.c
index e21d00bd2818..16f0b0337eb6 100644
--- a/sys/dev/if_wg/module/curve25519.c
+++ b/sys/dev/if_wg/module/curve25519.c
@@ -767,6 +767,7 @@ void curve25519_generic(u8 out[CURVE25519_KEY_SIZE],
u8 e[32];
 
memcpy(e, scalar, 32);
+   curve25519_clamp_secret(e);
 
/* The following implementation was transcribed to Coq and proven to
 * correspond to unary scalar multiplication in affine coordinates given
___
dev-commits-src-main@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main
To unsubscribe, send any mail to "dev-commits-src-main-unsubscr...@freebsd.org"


git: 95331c228a39 - main - Import wireguard fixes from pfSense 2.5

2021-03-01 Thread Peter Grehan
The branch main has been updated by grehan:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=95331c228a39b44cb96c4d0142ed8afec8a4d063

commit 95331c228a39b44cb96c4d0142ed8afec8a4d063
Author: Peter Grehan 
AuthorDate: 2021-02-27 04:15:04 +
Commit: Peter Grehan 
CommitDate: 2021-03-02 04:55:46 +

Import wireguard fixes from pfSense 2.5

Merge the following fixes from https://github.com/pfsense/FreeBSD-src
 1940e7d3  Save address of ingress packets to allow wg to work on HA
 8f5531f1  Fix connection to IPv6 endpoint
 825ed9ee  Fix tcpdump for wg IPv6 rx tunnel traffic
 2ec232d3  Fix issue with replying to INITIATION messages in server mode
 ec77593a  Return immediately in wg_init if in DETACH'd state
 0f0dde6f  Remove unnecessary wg debug printf on transmit
 2766dc94  Detect and fix case in wg_init() where sockets weren't cleaned up
 b62cc7ac  Close the UDP tunnel sockets when the interface has been stopped

Reviewed by:kevans
Obtained from:  pfSense 2.5
MFC after:  3 days
Relnotes:   yes
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D28962
---
 sys/dev/if_wg/module/if_wg_session.c | 45 +---
 sys/dev/if_wg/module/module.c| 23 ++
 2 files changed, 60 insertions(+), 8 deletions(-)

diff --git a/sys/dev/if_wg/module/if_wg_session.c 
b/sys/dev/if_wg/module/if_wg_session.c
index 54e63d053847..084bc789039d 100644
--- a/sys/dev/if_wg/module/if_wg_session.c
+++ b/sys/dev/if_wg/module/if_wg_session.c
@@ -1394,8 +1394,8 @@ wg_deliver_in(struct wg_peer *peer)
CURVNET_SET(inp->inp_vnet);
ip_input(m);
CURVNET_RESTORE();
-   }   else if (version == 6) {
-   af = AF_INET;
+   } else if (version == 6) {
+   af = AF_INET6;
BPF_MTAP2(sc->sc_ifp, &af, sizeof(af), m);
inp = sotoinpcb(so->so_so6);
CURVNET_SET(inp->inp_vnet);
@@ -1531,6 +1531,7 @@ wg_handshake(struct wg_softc *sc, struct mbuf *m)
peer = CONTAINER_OF(remote, struct wg_peer, p_remote);
DPRINTF(sc, "Receiving handshake initiation from peer %llu\n",
(unsigned long long)peer->p_id);
+   wg_peer_set_endpoint_from_tag(peer, t);
res = wg_send_response(peer);
if (res == 0 && noise_remote_begin_session(&peer->p_remote) == 
0)
wg_timers_event_session_derived(&peer->p_timers);
@@ -1851,6 +1852,40 @@ wg_index_drop(struct wg_softc *sc, uint32_t key0)
SLIST_INSERT_HEAD(&peer->p_unused_index, iter, i_unused_entry);
 }
 
+static int
+wg_update_endpoint_addrs(struct wg_endpoint *e, const struct sockaddr *srcsa,
+struct ifnet *rcvif)
+{
+   const struct sockaddr_in *sa4;
+   const struct sockaddr_in6 *sa6;
+   int ret = 0;
+
+   /*
+* UDP passes a 2-element sockaddr array: first element is the
+* source addr/port, second the destination addr/port.
+*/
+   if (srcsa->sa_family == AF_INET) {
+   sa4 = (const struct sockaddr_in *)srcsa;
+   e->e_remote.r_sin = sa4[0];
+   /* Only update dest if not mcast/bcast */
+   if (!(IN_MULTICAST(ntohl(sa4[1].sin_addr.s_addr)) ||
+ sa4[1].sin_addr.s_addr == INADDR_BROADCAST ||
+ in_broadcast(sa4[1].sin_addr, rcvif))) {
+   e->e_local.l_in = sa4[1].sin_addr;
+   }
+   } else if (srcsa->sa_family == AF_INET6) {
+   sa6 = (const struct sockaddr_in6 *)srcsa;
+   e->e_remote.r_sin6 = sa6[0];
+   /* Only update dest if not multicast */
+   if (!IN6_IS_ADDR_MULTICAST(&sa6[1].sin6_addr))
+   e->e_local.l_in6 = sa6[1].sin6_addr;
+   } else {
+   ret = EAFNOSUPPORT;
+   }
+
+   return (ret);
+}
+
 static void
 wg_input(struct mbuf *m0, int offset, struct inpcb *inpcb,
 const struct sockaddr *srcsa, void *_sc)
@@ -1882,7 +1917,11 @@ wg_input(struct mbuf *m0, int offset, struct inpcb 
*inpcb,
goto free;
}
e = wg_mbuf_endpoint_get(m);
-   e->e_remote.r_sa = *srcsa;
+
+   if (wg_update_endpoint_addrs(e, srcsa, m->m_pkthdr.rcvif)) {
+   DPRINTF(sc, "unknown family\n");
+   goto free;
+   }
verify_endpoint(m);
 
if_inc_counter(sc->sc_ifp, IFCOUNTER_IPACKETS, 1);
diff --git a/sys/dev/if_wg/module/module.c b/sys/dev/if_wg/module/module.c
index 76c7db01cba1..a40a304616c7 100644
--- a/sys/dev/if_wg/module/module.c
+++ b/sys/dev/if_wg/module/modul

git: ab899f8937c1 - main - Fix typo in xhci nvlist node name, and also increment device counter.

2021-04-02 Thread Peter Grehan
The branch main has been updated by grehan:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=ab899f8937c1c7c79197baf7192b727ddc9cfe54

commit ab899f8937c1c7c79197baf7192b727ddc9cfe54
Author: Peter Grehan 
AuthorDate: 2021-04-03 04:32:54 +
Commit: Peter Grehan 
CommitDate: 2021-04-03 04:32:54 +

Fix typo in xhci nvlist node name, and also increment device counter.

This allows the xhci tablet device to be recognized and a PCI device
instantiated.

Reviewed by:jhb
Fixes:  621b5090487d Refactor configuration management in bhyve.
MFC after:  3 months.
---
 usr.sbin/bhyve/pci_xhci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/usr.sbin/bhyve/pci_xhci.c b/usr.sbin/bhyve/pci_xhci.c
index dd6dfc39d014..b71d66337048 100644
--- a/usr.sbin/bhyve/pci_xhci.c
+++ b/usr.sbin/bhyve/pci_xhci.c
@@ -2720,7 +2720,7 @@ pci_xhci_parse_devices(struct pci_xhci_softc *sc, 
nvlist_t *nvl)
 
ndevices = 0;
 
-   slots_nvl = find_relative_config_node(nvl, "slots");
+   slots_nvl = find_relative_config_node(nvl, "slot");
if (slots_nvl == NULL)
goto portsfinal;
 
@@ -2806,6 +2806,7 @@ pci_xhci_parse_devices(struct pci_xhci_softc *sc, 
nvlist_t *nvl)
dev->dev_sc = devsc;
 
XHCI_SLOTDEV_PTR(sc, slot) = dev;
+   ndevices++;
}
 
 portsfinal:
___
dev-commits-src-main@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main
To unsubscribe, send any mail to "dev-commits-src-main-unsubscr...@freebsd.org"


git: 5a3eb6207a35 - main - igc: correctly update RCTL when changing multicast filters.

2021-10-22 Thread Peter Grehan
The branch main has been updated by grehan:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=5a3eb6207a353c3a18da8abcf00a2d75276dd29e

commit 5a3eb6207a353c3a18da8abcf00a2d75276dd29e
Author: Peter Grehan 
AuthorDate: 2021-10-11 17:49:01 +
Commit: Peter Grehan 
CommitDate: 2021-10-22 11:16:12 +

igc: correctly update RCTL when changing multicast filters.

Fix clearing of bits in RCTL for the non-bpf/non-allmulti case.
Update RCTL after modifying the multicast filter registers as per
the Linux driver.

This fixes LACP on igc interfaces, where incoming LACP multicasti
control packets were being dropped.

Reviewed by:kbowling
Obtained from:  Rubicon Communications, LLC ("Netgate")
MFC after:  3 days
Differential Revision: https://reviews.freebsd.org/D32574
---
 sys/dev/igc/if_igc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c
index 6d94a7c223c7..436493185d5c 100644
--- a/sys/dev/igc/if_igc.c
+++ b/sys/dev/igc/if_igc.c
@@ -1172,12 +1172,12 @@ igc_if_multi_set(if_ctx_t ctx)
 reg_rctl |= IGC_RCTL_MPE;
reg_rctl &= ~IGC_RCTL_UPE;
 } else
-   reg_rctl = ~(IGC_RCTL_UPE | IGC_RCTL_MPE);
-
-   IGC_WRITE_REG(&adapter->hw, IGC_RCTL, reg_rctl);
+   reg_rctl &= ~(IGC_RCTL_UPE | IGC_RCTL_MPE);
 
if (mcnt < MAX_NUM_MULTICAST_ADDRESSES)
igc_update_mc_addr_list(&adapter->hw, mta, mcnt);
+
+   IGC_WRITE_REG(&adapter->hw, IGC_RCTL, reg_rctl);
 }
 
 /*



git: 561cd74b1704 - main - igc: Use hardware routine for PHY reset

2021-11-08 Thread Peter Grehan
The branch main has been updated by grehan:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=561cd74b1704ab76a3286733fb43da53b6892ea4

commit 561cd74b1704ab76a3286733fb43da53b6892ea4
Author: Peter Grehan 
AuthorDate: 2021-11-01 13:35:43 +
Commit: Peter Grehan 
CommitDate: 2021-11-08 13:33:10 +

igc: Use hardware routine for PHY reset

Summary:
The previously used software reset routine wasn't sufficient
to reset the PHY if the bootloader hadn't left the device in
an initialized state. This was seen with the onboard igc port
on an 11th-gen Intel NUC.

The software reset isn't used in the Linux driver so all related
code has been removed.

Tested on: Netgate 6100 onboard ports, a discrete PCIe I225-LM card,
and an 11th-gen Intel NUC.

Reported by:woodsb02
Tested by:  woodsb02 (NUC)
MFC after:  3 days
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Reviewed by:kbowling
Differential Revision: https://reviews.freebsd.org/D32772
---
 sys/dev/igc/igc_api.c  | 15 ---
 sys/dev/igc/igc_api.h  |  1 -
 sys/dev/igc/igc_hw.h   |  1 -
 sys/dev/igc/igc_i225.c | 11 +++
 sys/dev/igc/igc_phy.c  | 37 ++---
 sys/dev/igc/igc_phy.h  |  1 -
 6 files changed, 5 insertions(+), 61 deletions(-)

diff --git a/sys/dev/igc/igc_api.c b/sys/dev/igc/igc_api.c
index cad116c2395d..6aafc9898df8 100644
--- a/sys/dev/igc/igc_api.c
+++ b/sys/dev/igc/igc_api.c
@@ -535,21 +535,6 @@ s32 igc_phy_hw_reset(struct igc_hw *hw)
return IGC_SUCCESS;
 }
 
-/**
- *  igc_phy_commit - Soft PHY reset
- *  @hw: pointer to the HW structure
- *
- *  Performs a soft PHY reset on those that apply. This is a function pointer
- *  entry point called by drivers.
- **/
-s32 igc_phy_commit(struct igc_hw *hw)
-{
-   if (hw->phy.ops.commit)
-   return hw->phy.ops.commit(hw);
-
-   return IGC_SUCCESS;
-}
-
 /**
  *  igc_set_d0_lplu_state - Sets low power link up state for D0
  *  @hw: pointer to the HW structure
diff --git a/sys/dev/igc/igc_api.h b/sys/dev/igc/igc_api.h
index a0fc9ff21166..f9064b540c7c 100644
--- a/sys/dev/igc/igc_api.h
+++ b/sys/dev/igc/igc_api.h
@@ -42,7 +42,6 @@ s32 igc_get_phy_info(struct igc_hw *hw);
 void igc_release_phy(struct igc_hw *hw);
 s32 igc_acquire_phy(struct igc_hw *hw);
 s32 igc_phy_hw_reset(struct igc_hw *hw);
-s32 igc_phy_commit(struct igc_hw *hw);
 void igc_power_up_phy(struct igc_hw *hw);
 void igc_power_down_phy(struct igc_hw *hw);
 s32 igc_read_mac_addr(struct igc_hw *hw);
diff --git a/sys/dev/igc/igc_hw.h b/sys/dev/igc/igc_hw.h
index a07d2894f97a..a8323a8578a9 100644
--- a/sys/dev/igc/igc_hw.h
+++ b/sys/dev/igc/igc_hw.h
@@ -382,7 +382,6 @@ struct igc_phy_operations {
s32  (*init_params)(struct igc_hw *);
s32  (*acquire)(struct igc_hw *);
s32  (*check_reset_block)(struct igc_hw *);
-   s32  (*commit)(struct igc_hw *);
s32  (*force_speed_duplex)(struct igc_hw *);
s32  (*get_info)(struct igc_hw *);
s32  (*set_page)(struct igc_hw *, u16);
diff --git a/sys/dev/igc/igc_i225.c b/sys/dev/igc/igc_i225.c
index 75c4b5125a97..4c50daa16b79 100644
--- a/sys/dev/igc/igc_i225.c
+++ b/sys/dev/igc/igc_i225.c
@@ -136,7 +136,6 @@ static s32 igc_init_phy_params_i225(struct igc_hw *hw)
 {
struct igc_phy_info *phy = &hw->phy;
s32 ret_val = IGC_SUCCESS;
-   u32 ctrl_ext;
 
DEBUGFUNC("igc_init_phy_params_i225");
 
@@ -155,10 +154,10 @@ static s32 igc_init_phy_params_i225(struct igc_hw *hw)
 
phy->ops.acquire= igc_acquire_phy_base;
phy->ops.check_reset_block = igc_check_reset_block_generic;
-   phy->ops.commit = igc_phy_sw_reset_generic;
phy->ops.release= igc_release_phy_base;
-
-   ctrl_ext = IGC_READ_REG(hw, IGC_CTRL_EXT);
+   phy->ops.reset  = igc_phy_hw_reset_generic;
+   phy->ops.read_reg   = igc_read_phy_reg_gpy;
+   phy->ops.write_reg  = igc_write_phy_reg_gpy;
 
/* Make sure the PHY is in a good state. Several people have reported
 * firmware leaving the PHY's page select register set to something
@@ -169,10 +168,6 @@ static s32 igc_init_phy_params_i225(struct igc_hw *hw)
if (ret_val)
goto out;
 
-   IGC_WRITE_REG(hw, IGC_CTRL_EXT, ctrl_ext);
-   phy->ops.read_reg = igc_read_phy_reg_gpy;
-   phy->ops.write_reg = igc_write_phy_reg_gpy;
-
ret_val = igc_get_phy_id(hw);
/* Verify phy id and set remaining function pointers */
switch (phy->id) {
diff --git a/sys/dev/igc/igc_phy.c b/sys/dev/igc/igc_phy.c
index a1d71ab15829..a6823ddf7bac 100644
--- a/sys/dev/igc/igc_phy.c
+++ b/sys/dev/igc/igc_phy.c
@@ -26,7 +26,6 @@ void igc_init_phy_ops_generic(struct igc_hw *hw)
phy->ops.init_params = igc_null_ops_generic;
phy->ops.

git: 17d214c2ca9f - main - bhyve: implement rdmsr for MSR_IA32_FEATURE_CONTROL

2021-04-14 Thread Peter Grehan
The branch main has been updated by grehan:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=17d214c2ca9f110db3fa2a10d6b448d624e87774

commit 17d214c2ca9f110db3fa2a10d6b448d624e87774
Author: Corvin Köhne 
AuthorDate: 2021-04-15 03:49:19 +
Commit: Peter Grehan 
CommitDate: 2021-04-15 03:49:19 +

bhyve: implement rdmsr for MSR_IA32_FEATURE_CONTROL

Without the -w option, Windows guests crash on boot. This is caused by a 
rdmsr
of MSR_IA32_FEATURE_CONTROL. Windows checks this MSR to determine enabled 
VMX
features. This MSR isn't emulated in bhyve, so a #GP exception is injected
which causes Windows to crash.

Fix by returning a rdmsr of MSR_IA32_FEATURE_CONTROL with Lock Bit set and
VMX disabled to informWindows that VMX isn't available.

Reviewed by:jhb, grehan (bhyve)
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D29665
---
 usr.sbin/bhyve/xmsr.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/usr.sbin/bhyve/xmsr.c b/usr.sbin/bhyve/xmsr.c
index 0b87821836b7..1a7f98ee222a 100644
--- a/usr.sbin/bhyve/xmsr.c
+++ b/usr.sbin/bhyve/xmsr.c
@@ -124,6 +124,14 @@ emulate_rdmsr(struct vmctx *ctx, int vcpu, uint32_t num, 
uint64_t *val)
 */
*val = 0x000a1003;
break;
+   case MSR_IA32_FEATURE_CONTROL:
+   /*
+* Windows guests check this MSR.
+* Set the lock bit to avoid writes
+* to this MSR.
+*/
+   *val = IA32_FEATURE_CONTROL_LOCK;
+   break;
default:
error = -1;
break;
___
dev-commits-src-main@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main
To unsubscribe, send any mail to "dev-commits-src-main-unsubscr...@freebsd.org"


git: 054accac71e0 - main - Add a virtio-input device emulation.

2021-06-08 Thread Peter Grehan
The branch main has been updated by grehan:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=054accac71e0944ab588c3ab052bea6947df7885

commit 054accac71e0944ab588c3ab052bea6947df7885
Author: Corvin Köhne 
AuthorDate: 2021-06-08 08:56:43 +
Commit: Peter Grehan 
CommitDate: 2021-06-08 09:05:09 +

Add a virtio-input device emulation.

This will be used to inject keyboard/mouse input events into a guest.
The command line syntax is:
   -s ,virtio-input,/dev/input/eventX

Reviewed by:jhb (bhyve), grehan
Obtained from:  Corvin Köhne 
MFC after:  3 weeks
Relnotes:   yes
Differential Revision:  https://reviews.freebsd.org/D30020
---
 usr.sbin/bhyve/Makefile   |   1 +
 usr.sbin/bhyve/bhyve.8|  10 +
 usr.sbin/bhyve/bhyve_config.5 |  11 +
 usr.sbin/bhyve/pci_virtio_input.c | 782 ++
 usr.sbin/bhyve/virtio.c   |  10 +-
 usr.sbin/bhyve/virtio.h   |  16 +
 6 files changed, 828 insertions(+), 2 deletions(-)

diff --git a/usr.sbin/bhyve/Makefile b/usr.sbin/bhyve/Makefile
index e35d528ab605..772c0988090e 100644
--- a/usr.sbin/bhyve/Makefile
+++ b/usr.sbin/bhyve/Makefile
@@ -50,6 +50,7 @@ SRCS= \
pci_virtio_9p.c \
pci_virtio_block.c  \
pci_virtio_console.c\
+   pci_virtio_input.c  \
pci_virtio_net.c\
pci_virtio_rnd.c\
pci_virtio_scsi.c   \
diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8
index 79b6d9bfb240..fcf47ec65513 100644
--- a/usr.sbin/bhyve/bhyve.8
+++ b/usr.sbin/bhyve/bhyve.8
@@ -306,6 +306,8 @@ Virtio RNG interface.
 Virtio console interface, which exposes multiple ports
 to the guest in the form of simple char devices for simple IO
 between the guest and host userspaces.
+.It Cm virtio-input
+Virtio input interface.
 .It Cm ahci
 AHCI controller attached to arbitrary devices.
 .It Cm ahci-cd
@@ -539,6 +541,14 @@ resize at present.
 Emergency write is advertised, but no-op at present.
 .El
 .Pp
+Virtio input device backends:
+.Bl -tag -width 10n
+.It Ar /dev/input/eventX
+Send input events of
+.Ar /dev/input/eventX
+to guest by VirtIO Input Interface.
+.El
+.Pp
 Framebuffer devices backends:
 .Bl -bullet
 .Sm off
diff --git a/usr.sbin/bhyve/bhyve_config.5 b/usr.sbin/bhyve/bhyve_config.5
index 1a77b1bbacb4..a2221d5bc4bf 100644
--- a/usr.sbin/bhyve/bhyve_config.5
+++ b/usr.sbin/bhyve/bhyve_config.5
@@ -221,6 +221,8 @@ VirtIO 9p (VirtFS) interface.
 VirtIO block storage interface.
 .It Li virtio-console
 VirtIO console interface.
+.It Li virtio-input
+VirtIO input interface.
 .It Li virtio-net
 VirtIO network interface.
 .It Li virtio-rnd
@@ -528,6 +530,15 @@ The name of the port exposed to the guest.
 .It Va path Ta path Ta Ta
 The path of a UNIX domain socket providing the host connection for the port.
 .El
+.Ss VirtIO Input Interface Settings
+Each VirtIO Input device contains one input event device.
+All input events of the input event device are send to the guest by VirtIO 
Input interface.
+VirtIO Input Interfaces support the following variables:
+.Bl -column "Name" "Format" "Default"
+.It Sy Name Ta Sy Format Ta Sy Default Ta Sy Description
+.It Va path Ta path Ta Ta
+The path of the input event device exposed to the guest
+.El
 .Ss VirtIO Network Interface Settings
 In addition to the network backend settings,
 VirtIO network interfaces support the following variables:
diff --git a/usr.sbin/bhyve/pci_virtio_input.c 
b/usr.sbin/bhyve/pci_virtio_input.c
new file mode 100644
index ..4517333b1603
--- /dev/null
+++ b/usr.sbin/bhyve/pci_virtio_input.c
@@ -0,0 +1,782 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2021 Beckhoff Automation GmbH & Co. KG
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer
+ *in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEO

git: b9569ba05e20 - main - Remove myself from bhyve maintenance; ENOTIME.

2021-11-18 Thread Peter Grehan
The branch main has been updated by grehan:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=b9569ba05e20cdcf252963a0ce6d40aa2fa97848

commit b9569ba05e20cdcf252963a0ce6d40aa2fa97848
Author: Peter Grehan 
AuthorDate: 2021-11-18 21:09:30 +
Commit: Peter Grehan 
CommitDate: 2021-11-18 21:09:30 +

Remove myself from bhyve maintenance; ENOTIME.
---
 MAINTAINERS | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index caa19f1b1d25..4bcc352b1fc1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -122,12 +122,12 @@ usr.sbin/bsdconfigdteske  Pre-commit phabricator 
review requested.
 usr.sbin/dpv   dteske  Pre-commit review requested. Keep in sync with libdpv.
 usr.sbin/pkg   pkg@Please coordinate behavior or flag changes with pkg 
team.
 usr.sbin/sysrc dteske  Pre-commit phabricator review requested. Keep in sync 
with bsdconfig(8) sysrc.subr.
-vmm(4) jhb, grehan Pre-commit review requested via #bhyve
-   phabricator group.
-libvmmapi  jhb, grehan Pre-commit review requested via #bhyve
-   phabricator group.
-usr.sbin/bhyve*jhb, grehan Pre-commit review requested via #bhyve
-   phabricator group.
+vmm(4) jhb Pre-commit review requested via #bhyve
+   phabricator group.
+libvmmapi  jhb Pre-commit review requested via #bhyve
+   phabricator group.
+usr.sbin/bhyve*jhb Pre-commit review requested via #bhyve
+   phabricator group.
 autofs(5)  trasz   Pre-commit review recommended.
 iscsi(4)   trasz   Pre-commit review recommended.
 rctl(8)trasz   Pre-commit review recommended.



git: 517904de5cca - main - igc(4): Introduce new driver for the Intel I225 Ethernet controller.

2021-07-11 Thread Peter Grehan
The branch main has been updated by grehan:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=517904de5ccac643589c71ac0d2751797f89e4f9

commit 517904de5ccac643589c71ac0d2751797f89e4f9
Author: Peter Grehan 
AuthorDate: 2021-07-12 04:50:15 +
Commit: Peter Grehan 
CommitDate: 2021-07-12 04:57:18 +

igc(4): Introduce new driver for the Intel I225 Ethernet controller.

This controller supports 2.5G/1G/100MB/10MB speeds, and allows
tx/rx checksum offload, TSO, LRO, and multi-queue operation.

The driver was derived from code contributed by Intel, and modified
by Netgate to fit into the iflib framework.

Thanks to Mike Karels for testing and feedback on the driver.

Reviewed by:bcr (manpages), kbowling, scottl, erj
MFC after:  1 month
Relnotes:   yes
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D30668
---
 share/man/man4/Makefile   |2 +
 share/man/man4/igc.4  |  167 +++
 sys/amd64/conf/GENERIC|1 +
 sys/amd64/conf/NOTES  |2 +
 sys/conf/files|8 +
 sys/dev/igc/if_igc.c  | 2984 +
 sys/dev/igc/if_igc.h  |  430 +++
 sys/dev/igc/igc_api.c |  735 +++
 sys/dev/igc/igc_api.h |   58 +
 sys/dev/igc/igc_base.c|  188 +++
 sys/dev/igc/igc_base.h|  131 ++
 sys/dev/igc/igc_defines.h | 1347 
 sys/dev/igc/igc_hw.h  |  548 +
 sys/dev/igc/igc_i225.c| 1232 +++
 sys/dev/igc/igc_i225.h|  112 ++
 sys/dev/igc/igc_mac.c | 1050 
 sys/dev/igc/igc_mac.h |   48 +
 sys/dev/igc/igc_nvm.c |  721 +++
 sys/dev/igc/igc_nvm.h |   32 +
 sys/dev/igc/igc_osdep.h   |  133 ++
 sys/dev/igc/igc_phy.c | 1109 +
 sys/dev/igc/igc_phy.h |  134 ++
 sys/dev/igc/igc_regs.h|  424 +++
 sys/dev/igc/igc_txrx.c|  580 +
 sys/i386/conf/GENERIC |1 +
 sys/i386/conf/NOTES   |2 +
 sys/modules/Makefile  |2 +
 sys/modules/igc/Makefile  |   11 +
 28 files changed, 12192 insertions(+)

diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile
index 9027fe7df841..71a0d37631c5 100644
--- a/share/man/man4/Makefile
+++ b/share/man/man4/Makefile
@@ -224,6 +224,7 @@ MAN=aac.4 \
iicmux.4 \
iicsmb.4 \
iir.4 \
+   ${_igc.4} \
${_imcsmb.4} \
inet.4 \
inet6.4 \
@@ -814,6 +815,7 @@ _if_nfe.4=  if_nfe.4
 _if_urtw.4=if_urtw.4
 _if_vmx.4= if_vmx.4
 _if_wpi.4= if_wpi.4
+_igc.4=igc.4
 _imcsmb.4= imcsmb.4
 _ipmi.4=   ipmi.4
 _io.4= io.4
diff --git a/share/man/man4/igc.4 b/share/man/man4/igc.4
new file mode 100644
index ..bb79fbe5a8fa
--- /dev/null
+++ b/share/man/man4/igc.4
@@ -0,0 +1,167 @@
+.\"-
+.\" Copyright 2021 Intel Corp
+.\" Copyright 2021 Rubicon Communications, LLC (Netgate)
+.\" SPDX-License-Identifier: BSD-3-Clause
+.\"
+.\" $FreeBSD$
+.\"
+.Dd May 10, 2021
+.Dt IGC
+.Os
+.Sh NAME
+.Nm igc
+.Nd "Intel Ethernet Controller I225 driver"
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following lines in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device iflib"
+.Cd "device igc"
+.Ed
+.Pp
+Alternatively, to load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+if_igc_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for any PCI Express adapter or LOM (LAN
+On Motherboard) based on the Intel I225 Multi Gigabit Controller.
+The driver supports Transmit/Receive checksum offload, Jumbo Frames,
+MSI/MSI-X, TSO, and RSS.
+.Pp
+Support for Jumbo Frames is provided via the interface MTU setting.
+Selecting an MTU larger than 1500 bytes with the
+.Xr ifconfig 8
+utility
+configures the adapter to receive and transmit Jumbo Frames.
+The maximum MTU size for Jumbo Frames is 9216 bytes.
+.Pp
+This driver version supports VLAN hardware insertion / extraction, and
+VLAN checksum offload.
+For information on enabling VLANs, see
+.Xr ifconfig 8 .
+The
+.Nm
+driver supports the following media types:
+.Bl -tag -width ".Cm 10baseT/UTP"
+.It Cm autoselect
+Enables auto-negotiation for speed and duplex.
+.It Cm 10baseT/UTP
+Sets 10Mbps operation.
+Use the
+.Cm mediaopt
+option to select
+.Cm half-duplex
+mode.
+.It Cm 100baseTX
+Sets 100Mbps operation.
+Use the
+.Cm mediaopt
+option to select
+.Cm half-duplex
+mode.
+.It Cm 1000baseT
+Sets 1000Mbps operation.
+Only
+.Cm full-duplex
+mode is supported at this speed.
+.It Cm 2500baseT
+Sets 2500Mbps operation.
+Only
+.Cm full-duplex
+mode is supported at this speed.
+.El
+.Pp
+.Sh HARDWARE
+The
+.Nm
+driver supports the following models:
+.Pp
+.Bl -bullet -compact
+.It
+I225-LM
+.It
+I225-V
+.It
+I

git: bbe80bff7c35 - main - arm64: HWCAP/HWCAP2 aux args support for 32-bit ARM binaries.

2021-07-25 Thread Peter Grehan
The branch main has been updated by grehan:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=bbe80bff7c3549128bd19862eea7899b3def1d7f

commit bbe80bff7c3549128bd19862eea7899b3def1d7f
Author: Peter Grehan 
AuthorDate: 2021-07-25 09:34:14 +
Commit: Peter Grehan 
CommitDate: 2021-07-25 09:39:32 +

arm64: HWCAP/HWCAP2 aux args support for 32-bit ARM binaries.

This fixes build/run of golang under COMPAT32 emulation.

PR: 256897
Reviewed by:andrew, mmel, manu, jhb, cognet, Robert Clausecker
Tested by:  brd, andrew, Robert Clausecker
MFC after:  3 weeks
Relnotes:   yes
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D31175
---
 sys/arm64/arm64/elf32_machdep.c |   5 +
 sys/arm64/arm64/identcpu.c  | 302 
 sys/arm64/include/armreg.h  | 131 +
 sys/arm64/include/elf.h |  29 
 sys/arm64/include/md_var.h  |   4 +
 5 files changed, 471 insertions(+)

diff --git a/sys/arm64/arm64/elf32_machdep.c b/sys/arm64/arm64/elf32_machdep.c
index 7cedbffc4d43..ec1afd2d7b3e 100644
--- a/sys/arm64/arm64/elf32_machdep.c
+++ b/sys/arm64/arm64/elf32_machdep.c
@@ -77,6 +77,9 @@ static boolean_t elf32_arm_abi_supported(struct image_params 
*, int32_t *,
 
 extern void freebsd32_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask);
 
+u_long __read_frequently elf32_hwcap;
+u_long __read_frequently elf32_hwcap2;
+
 static struct sysentvec elf32_freebsd_sysvec = {
.sv_size= SYS_MAXSYSCALL,
.sv_table   = freebsd32_sysent,
@@ -112,6 +115,8 @@ static struct sysentvec elf32_freebsd_sysvec = {
.sv_schedtail   = NULL,
.sv_thread_detach = NULL,
.sv_trap= NULL,
+   .sv_hwcap   = &elf32_hwcap,
+   .sv_hwcap2  = &elf32_hwcap2,
.sv_onexec_old  = exec_onexec_old,
.sv_onexit  = exit_onexit,
 };
diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c
index 2afad3ea8a81..233b036f4499 100644
--- a/sys/arm64/arm64/identcpu.c
+++ b/sys/arm64/arm64/identcpu.c
@@ -50,6 +50,10 @@ __FBSDID("$FreeBSD$");
 static void print_cpu_features(u_int cpu);
 static u_long parse_cpu_features_hwcap(void);
 static u_long parse_cpu_features_hwcap2(void);
+#ifdef COMPAT_FREEBSD32
+static u_long parse_cpu_features_hwcap32(void);
+static u_long parse_cpu_features_hwcap32_2(void);
+#endif
 
 char machine[] = "arm64";
 
@@ -135,6 +139,11 @@ struct cpu_desc {
uint64_tid_aa64pfr0;
uint64_tid_aa64pfr1;
uint64_tctr;
+#ifdef COMPAT_FREEBSD32
+   uint64_tid_isar5;
+   uint64_tmvfr0;
+   uint64_tmvfr1;
+#endif
 };
 
 static struct cpu_desc cpu_desc[MAXCPU];
@@ -152,6 +161,11 @@ static u_int cpu_print_regs;
 #definePRINT_ID_AA64_MMFR2 0x4000
 #definePRINT_ID_AA64_PFR0  0x0001
 #definePRINT_ID_AA64_PFR1  0x0002
+#ifdef COMPAT_FREEBSD32
+#definePRINT_ID_ISAR5  0x0100
+#definePRINT_MVFR0 0x0200
+#definePRINT_MVFR1 0x0400
+#endif
 #definePRINT_CTR_EL0   0x1000
 
 struct cpu_parts {
@@ -987,6 +1001,167 @@ static struct mrs_field id_aa64pfr1_fields[] = {
MRS_FIELD_END,
 };
 
+#ifdef COMPAT_FREEBSD32
+/* ID_ISAR5_EL1 */
+static struct mrs_field_value id_isar5_vcma[] = {
+   MRS_FIELD_VALUE_NONE_IMPL(ID_ISAR5, VCMA, NONE, IMPL),
+   MRS_FIELD_VALUE_END,
+};
+
+static struct mrs_field_value id_isar5_rdm[] = {
+   MRS_FIELD_VALUE_NONE_IMPL(ID_ISAR5, RDM, NONE, IMPL),
+   MRS_FIELD_VALUE_END,
+};
+
+static struct mrs_field_value id_isar5_crc32[] = {
+   MRS_FIELD_VALUE_NONE_IMPL(ID_ISAR5, CRC32, NONE, IMPL),
+   MRS_FIELD_VALUE_END,
+};
+
+static struct mrs_field_value id_isar5_sha2[] = {
+   MRS_FIELD_VALUE_NONE_IMPL(ID_ISAR5, SHA2, NONE, IMPL),
+   MRS_FIELD_VALUE_END,
+};
+
+static struct mrs_field_value id_isar5_sha1[] = {
+   MRS_FIELD_VALUE_NONE_IMPL(ID_ISAR5, SHA1, NONE, IMPL),
+   MRS_FIELD_VALUE_END,
+};
+
+static struct mrs_field_value id_isar5_aes[] = {
+   MRS_FIELD_VALUE_NONE_IMPL(ID_ISAR5, AES, NONE, BASE),
+   MRS_FIELD_VALUE(ID_ISAR5_AES_VMULL, "AES+VMULL"),
+   MRS_FIELD_VALUE_END,
+};
+
+static struct mrs_field_value id_isar5_sevl[] = {
+   MRS_FIELD_VALUE_NONE_IMPL(ID_ISAR5, SEVL, NOP, IMPL),
+   MRS_FIELD_VALUE_END,
+};
+
+static struct mrs_field id_isar5_fields[] = {
+   MRS_FIELD(ID_ISAR5, VCMA, false, MRS_LOWER, id_isar5_vcma),
+   MRS_FIELD(ID_ISAR5, RDM, false, MRS_LOWER, id_isar5_rdm),
+   MRS_FIELD(ID_ISAR5, CRC32, false, MRS_LOWER, id_isar5_crc32),
+   MRS_FIELD(ID_ISAR5, SHA2, false, MRS_LOWER, id_isar5_sha2),
+   MRS_FIELD(ID_ISAR5, SHA1, false, MRS_LOWER, id_isar5_sha1),
+   MRS_FIE

git: 0c243cd4a367 - main - Fix issue with Linux guest XHCI tablet probing.

2024-01-14 Thread Peter Grehan
The branch main has been updated by grehan:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=0c243cd4a3671bf728f33378ac593c08d8367bc2

commit 0c243cd4a3671bf728f33378ac593c08d8367bc2
Author: Peter Grehan 
AuthorDate: 2024-01-14 11:27:12 +
Commit: Peter Grehan 
CommitDate: 2024-01-14 11:38:55 +

Fix issue with Linux guest XHCI tablet probing.

The USB3 spec mandates that the device-descriptor max packet size
be 512 bytes, which requires a field size of 9 since it is a
power-of-2.

Linux kernels recently started validating this field, resulting in
the table not being probed and the cursor not working in bhyve VNC.

Reviewed by:corvink
PR: 275760
MFC after:  1 week
---
 usr.sbin/bhyve/usb_mouse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.sbin/bhyve/usb_mouse.c b/usr.sbin/bhyve/usb_mouse.c
index 80f79980a98e..a37941c0cd9d 100644
--- a/usr.sbin/bhyve/usb_mouse.c
+++ b/usr.sbin/bhyve/usb_mouse.c
@@ -154,7 +154,7 @@ static struct usb_device_descriptor umouse_dev_desc = {
.bLength = sizeof(umouse_dev_desc),
.bDescriptorType = UDESC_DEVICE,
MSETW(.bcdUSB, UD_USB_3_0),
-   .bMaxPacketSize = 8,/* max packet size */
+   .bMaxPacketSize = 9,/* max pkt size, 2^9 = 512 */
MSETW(.idVendor, 0xFB5D),   /* vendor */
MSETW(.idProduct, 0x0001),  /* product */
MSETW(.bcdDevice, 0),   /* device version */



git: 43ed91e00bbb - main - igc: Increase default per-queue interrupt rate to 20000.

2023-07-10 Thread Peter Grehan
The branch main has been updated by grehan:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=43ed91e00bbb1c7edadbe1c210d8e57d66a3badd

commit 43ed91e00bbb1c7edadbe1c210d8e57d66a3badd
Author: Peter Grehan 
AuthorDate: 2023-07-07 08:23:42 +
Commit: Peter Grehan 
CommitDate: 2023-07-11 03:29:37 +

igc: Increase default per-queue interrupt rate to 2.

The default per-queue packet rate of 8000 will cause packet loss when
forwarding at 2.5G with a single stream, as is common when using e.g.
iperf3 to test a platform.

Bump this to 2 (the "low latency" value in the Linux driver) which
avoids packet loss for this type of test.

Future work will use adaptive interrupt rate in a similar fashion
to the ixgbe driver.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
Reviewed by:erj, kp
MFC after:  3 weeks
Differential Revision: https://reviews.freebsd.org/D40904
---
 sys/dev/igc/if_igc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c
index 60f796010232..1ede99eee4ae 100644
--- a/sys/dev/igc/if_igc.c
+++ b/sys/dev/igc/if_igc.c
@@ -271,7 +271,7 @@ SYSCTL_INT(_hw_igc, OID_AUTO, eee_setting, CTLFLAG_RDTUN, 
&igc_eee_setting, 0,
 /*
 ** Tuneable Interrupt rate
 */
-static int igc_max_interrupt_rate = 8000;
+static int igc_max_interrupt_rate = 2;
 SYSCTL_INT(_hw_igc, OID_AUTO, max_interrupt_rate, CTLFLAG_RDTUN,
 &igc_max_interrupt_rate, 0, "Maximum interrupts per second");