CVS commit: src/sys/dev/vmt

2024-03-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Mar 20 23:34:24 UTC 2024

Modified Files:
src/sys/dev/vmt: vmt_subr.c

Log Message:
Process all queued messages without delay immediately. From OpenBSD.

 Apply the remaining part of OpenBSD sys/dev/vmt.c rev. 1.22.

 > The VM host might send multiple messages at once but vmt(4) only
 > processed one of time per second.  Change the code to process all
 > queued messages without delay immediately.  This fixes two things: a)
 > the vmt time sensor is available on boot when ntpd -s is loaded and b)
 > the random seeding on resume (OS_Resume message) is executed almost
 > immediately and not delayed by about 20 seconds.

 Apply OpenBSD sys/dev/pv/vmt.c rev. 1.4.

 >  Merge two return branches in vmt_tclo_tick().  No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/vmt/vmt_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/vmt/vmt_subr.c
diff -u src/sys/dev/vmt/vmt_subr.c:1.7 src/sys/dev/vmt/vmt_subr.c:1.8
--- src/sys/dev/vmt/vmt_subr.c:1.7	Wed Mar 20 23:33:22 2024
+++ src/sys/dev/vmt/vmt_subr.c	Wed Mar 20 23:34:24 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: vmt_subr.c,v 1.7 2024/03/20 23:33:22 msaitoh Exp $ */
+/* $NetBSD: vmt_subr.c,v 1.8 2024/03/20 23:34:24 msaitoh Exp $ */
 /* $OpenBSD: vmt.c,v 1.11 2011/01/27 21:29:25 dtucker Exp $ */
 
 /*
@@ -774,7 +774,11 @@ vmt_tclo_tick(void *xarg)
 	struct vmt_softc *sc = xarg;
 	u_int32_t rlen;
 	u_int16_t ack;
+	int delay;
 
+	/* By default, poll every second for new messages */
+	delay = 1;
+	
 	/* reopen tclo channel if it's currently closed */
 	if (sc->sc_tclo_rpc.channel == 0 &&
 	sc->sc_tclo_rpc.cookie1 == 0 &&
@@ -782,8 +786,8 @@ vmt_tclo_tick(void *xarg)
 		if (vm_rpc_open(>sc_tclo_rpc, VM_RPC_OPEN_TCLO) != 0) {
 			device_printf(sc->sc_dev,
 			"unable to reopen TCLO channel\n");
-			callout_schedule(>sc_tclo_tick, hz * 15);
-			return;
+			delay = 15;
+			goto out;
 		}
 
 		if (vm_rpc_send_str(>sc_tclo_rpc,
@@ -829,6 +833,9 @@ vmt_tclo_tick(void *xarg)
 	}
 	sc->sc_tclo_ping = 0;
 
+	/* The VM host can queue multiple messages; continue without delay */
+	delay = 0;
+
 #ifdef VMT_DEBUG
 	printf("vmware: received message '%s'\n", sc->sc_rpc_buf);
 #endif
@@ -842,10 +849,13 @@ vmt_tclo_tick(void *xarg)
 		}
 	}
 
+	if (sc->sc_rpc_error == 1) {
+		/* On error, give time to recover and wait a second */
+		delay = 1;
+	}
+
 out:
-	/* On error, give time to recover and wait a second */
-	callout_schedule(>sc_tclo_tick,
-	(sc->sc_tclo_ping || sc->sc_rpc_error) ? hz : 1);
+	callout_schedule(>sc_tclo_tick, hz * delay);
 }
 
 static void



CVS commit: src/sys/dev/vmt

2024-03-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Mar 20 23:34:24 UTC 2024

Modified Files:
src/sys/dev/vmt: vmt_subr.c

Log Message:
Process all queued messages without delay immediately. From OpenBSD.

 Apply the remaining part of OpenBSD sys/dev/vmt.c rev. 1.22.

 > The VM host might send multiple messages at once but vmt(4) only
 > processed one of time per second.  Change the code to process all
 > queued messages without delay immediately.  This fixes two things: a)
 > the vmt time sensor is available on boot when ntpd -s is loaded and b)
 > the random seeding on resume (OS_Resume message) is executed almost
 > immediately and not delayed by about 20 seconds.

 Apply OpenBSD sys/dev/pv/vmt.c rev. 1.4.

 >  Merge two return branches in vmt_tclo_tick().  No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/vmt/vmt_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/vmt

2024-03-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Mar 20 23:33:23 UTC 2024

Modified Files:
src/sys/dev/vmt: vmt_subr.c

Log Message:
On error, give time to recover and wait a second.

Part of OpenBSD sys/dev/vmt.c rev. 1.22.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/vmt/vmt_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/vmt/vmt_subr.c
diff -u src/sys/dev/vmt/vmt_subr.c:1.6 src/sys/dev/vmt/vmt_subr.c:1.7
--- src/sys/dev/vmt/vmt_subr.c:1.6	Wed Mar 20 23:33:02 2024
+++ src/sys/dev/vmt/vmt_subr.c	Wed Mar 20 23:33:22 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: vmt_subr.c,v 1.6 2024/03/20 23:33:02 msaitoh Exp $ */
+/* $NetBSD: vmt_subr.c,v 1.7 2024/03/20 23:33:22 msaitoh Exp $ */
 /* $OpenBSD: vmt.c,v 1.11 2011/01/27 21:29:25 dtucker Exp $ */
 
 /*
@@ -843,7 +843,9 @@ vmt_tclo_tick(void *xarg)
 	}
 
 out:
-	callout_schedule(>sc_tclo_tick, sc->sc_tclo_ping ? hz : 1);
+	/* On error, give time to recover and wait a second */
+	callout_schedule(>sc_tclo_tick,
+	(sc->sc_tclo_ping || sc->sc_rpc_error) ? hz : 1);
 }
 
 static void



CVS commit: src/sys/dev/vmt

2024-03-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Mar 20 23:33:23 UTC 2024

Modified Files:
src/sys/dev/vmt: vmt_subr.c

Log Message:
On error, give time to recover and wait a second.

Part of OpenBSD sys/dev/vmt.c rev. 1.22.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/vmt/vmt_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/vmt

2024-03-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Mar 20 23:33:02 UTC 2024

Modified Files:
src/sys/dev/vmt: vmt_subr.c

Log Message:
Use a table like OpenBSD vmt.c rev. 1.27. No functional change.

 Add new vmt_tclo_rpc[] table and use it. In this change, all of
vmt_tclo_xxx()'s functionality are not changed from previous.

 Now we can understand what's the difference between OpenBSD's
sys/dev/pv/vmt.c and NetBSD's sys/dev/vmt/vmt_subr.c.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/vmt/vmt_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/vmt/vmt_subr.c
diff -u src/sys/dev/vmt/vmt_subr.c:1.5 src/sys/dev/vmt/vmt_subr.c:1.6
--- src/sys/dev/vmt/vmt_subr.c:1.5	Wed Mar 20 23:32:17 2024
+++ src/sys/dev/vmt/vmt_subr.c	Wed Mar 20 23:33:02 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: vmt_subr.c,v 1.5 2024/03/20 23:32:17 msaitoh Exp $ */
+/* $NetBSD: vmt_subr.c,v 1.6 2024/03/20 23:33:02 msaitoh Exp $ */
 /* $OpenBSD: vmt.c,v 1.11 2011/01/27 21:29:25 dtucker Exp $ */
 
 /*
@@ -79,10 +79,59 @@ static void vmt_update_guest_uptime(stru
 static void vmt_sync_guest_clock(struct vmt_softc *);
 
 static void vmt_tick(void *);
-static void vmt_tclo_tick(void *);
 static void vmt_clock_sync_tick(void *);
 static void vmt_pswitch_event(void *);
 
+static void vmt_tclo_tick(void *);
+static int vmt_tclo_process(struct vmt_softc *, const char *);
+static void vmt_tclo_reset(struct vmt_softc *);
+static void vmt_tclo_ping(struct vmt_softc *);
+static void vmt_tclo_halt(struct vmt_softc *);
+static void vmt_tclo_reboot(struct vmt_softc *);
+static void vmt_tclo_poweron(struct vmt_softc *);
+static void vmt_tclo_suspend(struct vmt_softc *);
+static void vmt_tclo_resume(struct vmt_softc *);
+static void vmt_tclo_capreg(struct vmt_softc *);
+static void vmt_tclo_broadcastip(struct vmt_softc *);
+
+struct vmt_tclo_rpc {
+	const char	*name;
+	void		(*cb)(struct vmt_softc *);
+} vmt_tclo_rpc[] = {
+	/* Keep sorted by name (case-sensitive) */
+	{ "Capabilities_Register",	vmt_tclo_capreg },
+	{ "OS_Halt",			vmt_tclo_halt },
+	{ "OS_PowerOn",			vmt_tclo_poweron },
+	{ "OS_Reboot",			vmt_tclo_reboot },
+	{ "OS_Resume",			vmt_tclo_resume },
+	{ "OS_Suspend",			vmt_tclo_suspend },
+	{ "Set_Option broadcastIP 1",	vmt_tclo_broadcastip },
+	{ "ping",			vmt_tclo_ping },
+	{ "reset",			vmt_tclo_reset },
+	{ NULL },
+#if 0
+	/* Various unsupported commands */
+	{ "Set_Option autohide 0" },
+	{ "Set_Option copypaste 1" },
+	{ "Set_Option enableDnD 1" },
+	{ "Set_Option enableMessageBusTunnel 0" },
+	{ "Set_Option linkRootHgfsShare 0" },
+	{ "Set_Option mapRootHgfsShare 0" },
+	{ "Set_Option synctime 1" },
+	{ "Set_Option synctime.period 0" },
+	{ "Set_Option time.synchronize.tools.enable 1" },
+	{ "Set_Option time.synchronize.tools.percentCorrection 0" },
+	{ "Set_Option time.synchronize.tools.slewCorrection 1" },
+	{ "Set_Option time.synchronize.tools.startup 1" },
+	{ "Set_Option toolScripts.afterPowerOn 1" },
+	{ "Set_Option toolScripts.afterResume 1" },
+	{ "Set_Option toolScripts.beforePowerOff 1" },
+	{ "Set_Option toolScripts.beforeSuspend 1" },
+	{ "Time_Synchronize 0" },
+	{ "Vix_1_Relayed_Command \"38cdcae40e075d66\"" },
+#endif
+};
+
 extern char hostname[MAXHOSTNAMELEN];
 
 static void
@@ -524,6 +573,202 @@ vmt_pswitch_event(void *xarg)
 }
 
 static void
+vmt_tclo_reset(struct vmt_softc *sc)
+{
+
+	if (sc->sc_rpc_error != 0) {
+		device_printf(sc->sc_dev, "resetting rpc\n");
+		vm_rpc_close(>sc_tclo_rpc);
+
+		/* reopen and send the reset reply next time around */
+		return;
+	}
+
+	if (vm_rpc_send_str(>sc_tclo_rpc, VM_RPC_RESET_REPLY) != 0) {
+		device_printf(sc->sc_dev, "failed to send reset reply\n");
+		sc->sc_rpc_error = 1;
+	}
+
+}
+
+static void
+vmt_tclo_ping(struct vmt_softc *sc)
+{
+
+	vmt_update_guest_info(sc);
+	if (vm_rpc_send_str(>sc_tclo_rpc, VM_RPC_REPLY_OK) != 0) {
+		device_printf(sc->sc_dev, "error sending ping response\n");
+		sc->sc_rpc_error = 1;
+	}
+}
+
+static void
+vmt_tclo_halt(struct vmt_softc *sc)
+{
+
+	vmt_do_shutdown(sc);
+}
+
+static void
+vmt_tclo_reboot(struct vmt_softc *sc)
+{
+
+	vmt_do_reboot(sc);
+}
+
+static void
+vmt_tclo_poweron(struct vmt_softc *sc)
+{
+
+	vmt_tclo_state_change_success(sc, 1, VM_STATE_CHANGE_POWERON);
+	if (vm_rpc_send_str(>sc_tclo_rpc, VM_RPC_REPLY_OK) != 0) {
+		device_printf(sc->sc_dev, "error sending poweron response\n");
+		sc->sc_rpc_error = 1;
+	}
+}
+
+static void
+vmt_tclo_suspend(struct vmt_softc *sc)
+{
+
+	log(LOG_KERN | LOG_NOTICE,
+	"VMware guest entering suspended state\n");
+
+	vmt_tclo_state_change_success(sc, 1, VM_STATE_CHANGE_SUSPEND);
+	if (vm_rpc_send_str(>sc_tclo_rpc, VM_RPC_REPLY_OK) != 0) {
+		device_printf(sc->sc_dev, "error sending suspend response\n");
+		sc->sc_rpc_error = 1;
+	}
+}
+
+static void
+vmt_tclo_resume(struct vmt_softc *sc)
+{
+
+	vmt_do_resume(sc); /* XXX msaitoh extract */
+}
+
+static 

CVS commit: src/sys/dev/vmt

2024-03-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Mar 20 23:33:02 UTC 2024

Modified Files:
src/sys/dev/vmt: vmt_subr.c

Log Message:
Use a table like OpenBSD vmt.c rev. 1.27. No functional change.

 Add new vmt_tclo_rpc[] table and use it. In this change, all of
vmt_tclo_xxx()'s functionality are not changed from previous.

 Now we can understand what's the difference between OpenBSD's
sys/dev/pv/vmt.c and NetBSD's sys/dev/vmt/vmt_subr.c.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/vmt/vmt_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/vmt

2024-03-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Mar 20 23:32:18 UTC 2024

Modified Files:
src/sys/dev/vmt: vmt_subr.c

Log Message:
Move a prototype definition. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/vmt/vmt_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/vmt

2024-03-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Mar 20 23:32:18 UTC 2024

Modified Files:
src/sys/dev/vmt: vmt_subr.c

Log Message:
Move a prototype definition. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/vmt/vmt_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/vmt/vmt_subr.c
diff -u src/sys/dev/vmt/vmt_subr.c:1.4 src/sys/dev/vmt/vmt_subr.c:1.5
--- src/sys/dev/vmt/vmt_subr.c:1.4	Wed Mar 20 23:31:54 2024
+++ src/sys/dev/vmt/vmt_subr.c	Wed Mar 20 23:32:17 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: vmt_subr.c,v 1.4 2024/03/20 23:31:54 msaitoh Exp $ */
+/* $NetBSD: vmt_subr.c,v 1.5 2024/03/20 23:32:17 msaitoh Exp $ */
 /* $OpenBSD: vmt.c,v 1.11 2011/01/27 21:29:25 dtucker Exp $ */
 
 /*
@@ -72,6 +72,7 @@ static int vm_rpci_response_successful(s
 static void vmt_tclo_state_change_success(struct vmt_softc *, int, char);
 static void vmt_do_reboot(struct vmt_softc *);
 static void vmt_do_shutdown(struct vmt_softc *);
+static bool vmt_shutdown(device_t, int);
 
 static void vmt_update_guest_info(struct vmt_softc *);
 static void vmt_update_guest_uptime(struct vmt_softc *);
@@ -80,7 +81,6 @@ static void vmt_sync_guest_clock(struct 
 static void vmt_tick(void *);
 static void vmt_tclo_tick(void *);
 static void vmt_clock_sync_tick(void *);
-static bool vmt_shutdown(device_t, int);
 static void vmt_pswitch_event(void *);
 
 extern char hostname[MAXHOSTNAMELEN];



CVS commit: src/sys/dev/vmt

2024-03-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Mar 20 23:31:54 UTC 2024

Modified Files:
src/sys/dev/vmt: vmt_subr.c

Log Message:
KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/vmt/vmt_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/vmt

2024-03-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Mar 20 23:31:54 UTC 2024

Modified Files:
src/sys/dev/vmt: vmt_subr.c

Log Message:
KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/vmt/vmt_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/vmt/vmt_subr.c
diff -u src/sys/dev/vmt/vmt_subr.c:1.3 src/sys/dev/vmt/vmt_subr.c:1.4
--- src/sys/dev/vmt/vmt_subr.c:1.3	Sat Mar 27 21:23:14 2021
+++ src/sys/dev/vmt/vmt_subr.c	Wed Mar 20 23:31:54 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: vmt_subr.c,v 1.3 2021/03/27 21:23:14 ryo Exp $ */
+/* $NetBSD: vmt_subr.c,v 1.4 2024/03/20 23:31:54 msaitoh Exp $ */
 /* $OpenBSD: vmt.c,v 1.11 2011/01/27 21:29:25 dtucker Exp $ */
 
 /*
@@ -175,14 +175,17 @@ vmt_common_attach(struct vmt_softc *sc)
 	sc->sc_rpc_buf = kmem_alloc(VMT_RPC_BUFLEN, KM_SLEEP);
 
 	if (vm_rpc_open(>sc_tclo_rpc, VM_RPC_OPEN_TCLO) != 0) {
-		aprint_error_dev(self, "failed to open backdoor RPC channel (TCLO protocol)\n");
+		aprint_error_dev(self, "failed to open backdoor RPC channel "
+		"(TCLO protocol)\n");
 		goto free;
 	}
 	sc->sc_tclo_rpc_open = true;
 
 	/* don't know if this is important at all yet */
-	if (vm_rpc_send_rpci_tx(sc, "tools.capability.hgfs_server toolbox 1") != 0) {
-		aprint_error_dev(self, "failed to set HGFS server capability\n");
+	if (vm_rpc_send_rpci_tx(sc,
+	"tools.capability.hgfs_server toolbox 1") != 0) {
+		aprint_error_dev(self,
+		"failed to set HGFS server capability\n");
 		goto free;
 	}
 
@@ -313,7 +316,7 @@ vmt_sysctl_setup_clock_sync(device_t sel
 	rv = sysctl_createv(>sc_log, 0, , _node,
 	CTLFLAG_READWRITE, CTLTYPE_INT, "period",
 	SYSCTL_DESCR("Period, in seconds, at which to update the "
-	"guest's clock"),
+		"guest's clock"),
 	vmt_sysctl_update_clock_sync_period, 0, (void *)sc, 0,
 	CTL_CREATE, CTL_EOL);
 	return rv;
@@ -380,20 +383,23 @@ vmt_update_guest_info(struct vmt_softc *
 	}
 
 	/*
-	 * we're supposed to pass the full network address information back here,
-	 * but that involves xdr (sunrpc) data encoding, which seems a bit unreasonable.
+	 * we're supposed to pass the full network address information back
+	 * here, but that involves xdr (sunrpc) data encoding, which seems
+	 * a bit unreasonable.
 	 */
 
 	if (sc->sc_set_guest_os == 0) {
 		if (vm_rpc_send_rpci_tx(sc, "SetGuestInfo  %d %s %s %s",
-		VM_GUEST_INFO_OS_NAME_FULL, ostype, osrelease, machine_arch) != 0) {
-			device_printf(sc->sc_dev, "unable to set full guest OS\n");
+		VM_GUEST_INFO_OS_NAME_FULL,
+		ostype, osrelease, machine_arch) != 0) {
+			device_printf(sc->sc_dev,
+			"unable to set full guest OS\n");
 			sc->sc_rpc_error = 1;
 		}
 
 		/*
-		 * host doesn't like it if we send an OS name it doesn't recognise,
-		 * so use "other" for i386 and "other-64" for amd64
+		 * Host doesn't like it if we send an OS name it doesn't
+		 * recognise, so use "other" for i386 and "other-64" for amd64.
 		 */
 		if (vm_rpc_send_rpci_tx(sc, "SetGuestInfo  %d %s",
 		VM_GUEST_INFO_OS_NAME, VM_OS_NAME) != 0) {
@@ -442,7 +448,8 @@ vmt_tclo_state_change_success(struct vmt
 {
 	if (vm_rpc_send_rpci_tx(sc, "tools.os.statechange.status %d %d",
 	success, state) != 0) {
-		device_printf(sc->sc_dev, "unable to send state change result\n");
+		device_printf(sc->sc_dev,
+		"unable to send state change result\n");
 		sc->sc_rpc_error = 1;
 	}
 }
@@ -493,8 +500,10 @@ vmt_shutdown(device_t self, int flags)
 {
 	struct vmt_softc *sc = device_private(self);
 
-	if (vm_rpc_send_rpci_tx(sc, "tools.capability.hgfs_server toolbox 0") != 0) {
-		device_printf(sc->sc_dev, "failed to disable hgfs server capability\n");
+	if (vm_rpc_send_rpci_tx(sc,
+	"tools.capability.hgfs_server toolbox 0") != 0) {
+		device_printf(sc->sc_dev,
+		"failed to disable hgfs server capability\n");
 	}
 
 	if (vm_rpc_send(>sc_tclo_rpc, NULL, 0) != 0) {
@@ -526,13 +535,16 @@ vmt_tclo_tick(void *xarg)
 	sc->sc_tclo_rpc.cookie1 == 0 &&
 	sc->sc_tclo_rpc.cookie2 == 0) {
 		if (vm_rpc_open(>sc_tclo_rpc, VM_RPC_OPEN_TCLO) != 0) {
-			device_printf(sc->sc_dev, "unable to reopen TCLO channel\n");
+			device_printf(sc->sc_dev,
+			"unable to reopen TCLO channel\n");
 			callout_schedule(>sc_tclo_tick, hz * 15);
 			return;
 		}
 
-		if (vm_rpc_send_str(>sc_tclo_rpc, VM_RPC_RESET_REPLY) != 0) {
-			device_printf(sc->sc_dev, "failed to send reset reply\n");
+		if (vm_rpc_send_str(>sc_tclo_rpc,
+		VM_RPC_RESET_REPLY) != 0) {
+			device_printf(sc->sc_dev,
+			"failed to send reset reply\n");
 			sc->sc_rpc_error = 1;
 			goto out;
 		} else {
@@ -542,14 +554,16 @@ vmt_tclo_tick(void *xarg)
 
 	if (sc->sc_tclo_ping) {
 		if (vm_rpc_send(>sc_tclo_rpc, NULL, 0) != 0) {
-			device_printf(sc->sc_dev, "failed to send TCLO outgoing ping\n");
+			device_printf(sc->sc_dev,
+			"failed to send TCLO 

CVS commit: src/sys/dev/pci/igc

2024-02-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Feb 21 12:39:39 UTC 2024

Modified Files:
src/sys/dev/pci/igc: if_igc.c igc_defines.h

Log Message:
igc(4): Print EtrackID.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pci/igc/if_igc.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pci/igc/igc_defines.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/igc/if_igc.c
diff -u src/sys/dev/pci/igc/if_igc.c:1.12 src/sys/dev/pci/igc/if_igc.c:1.13
--- src/sys/dev/pci/igc/if_igc.c:1.12	Wed Feb 21 12:34:06 2024
+++ src/sys/dev/pci/igc/if_igc.c	Wed Feb 21 12:39:39 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_igc.c,v 1.12 2024/02/21 12:34:06 msaitoh Exp $	*/
+/*	$NetBSD: if_igc.c,v 1.13 2024/02/21 12:39:39 msaitoh Exp $	*/
 /*	$OpenBSD: if_igc.c,v 1.13 2023/04/28 10:18:57 bluhm Exp $	*/
 /*-
  * SPDX-License-Identifier: BSD-2-Clause
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_igc.c,v 1.12 2024/02/21 12:34:06 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_igc.c,v 1.13 2024/02/21 12:39:39 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_igc.h"
@@ -3850,7 +3850,7 @@ igc_print_devinfo(struct igc_softc *sc)
 	struct igc_hw *hw = >hw;
 	struct igc_phy_info *phy = >phy;
 	u_int oui, model, rev;
-	uint16_t id1, id2, nvm_ver, phy_ver;
+	uint16_t id1, id2, nvm_ver, phy_ver, etk_lo, etk_hi;
 	char descr[MII_MAX_DESCR_LEN];
 
 	/* Print PHY Info */
@@ -3873,10 +3873,15 @@ igc_print_devinfo(struct igc_softc *sc)
 	phy->ops.read_reg(hw, 0x1e, _ver);
 	aprint_normal(", PHY FW version 0x%04hx\n", phy_ver);
 
-	/* Get NVM version */
+	/* NVM version */
 	hw->nvm.ops.read(hw, NVM_VERSION, 1, _ver);
 
-	aprint_normal_dev(dev, "ROM image version %x.%02x\n",
+	/* EtrackID */
+	hw->nvm.ops.read(hw, NVM_ETKID_LO, 1, _lo);
+	hw->nvm.ops.read(hw, NVM_ETKID_HI, 1, _hi);
+
+	aprint_normal_dev(dev,
+	"NVM image version %x.%02x, EtrackID %04hx%04hx\n",
 	(nvm_ver & NVM_VERSION_MAJOR) >> NVM_VERSION_MAJOR_SHIFT,
-	(nvm_ver & NVM_VERSION_MINOR));
+	nvm_ver & NVM_VERSION_MINOR, etk_hi, etk_lo);
 }

Index: src/sys/dev/pci/igc/igc_defines.h
diff -u src/sys/dev/pci/igc/igc_defines.h:1.2 src/sys/dev/pci/igc/igc_defines.h:1.3
--- src/sys/dev/pci/igc/igc_defines.h:1.2	Wed Oct  4 07:35:27 2023
+++ src/sys/dev/pci/igc/igc_defines.h	Wed Feb 21 12:39:39 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: igc_defines.h,v 1.2 2023/10/04 07:35:27 rin Exp $	*/
+/*	$NetBSD: igc_defines.h,v 1.3 2024/02/21 12:39:39 msaitoh Exp $	*/
 /*	$OpenBSD: igc_defines.h,v 1.1 2021/10/31 14:52:57 patrick Exp $	*/
 
 /*-
@@ -982,6 +982,8 @@
 #define NVM_CFG0x0012
 #define NVM_ALT_MAC_ADDR_PTR		0x0037
 #define NVM_CHECKSUM_REG		0x003F
+#define NVM_ETKID_LO			0x0042
+#define NVM_ETKID_HI			0x0043
 
 #define IGC_NVM_CFG_DONE_PORT_0	0x04 /* MNG config cycle done */
 #define IGC_NVM_CFG_DONE_PORT_1	0x08 /* ...for second port */



CVS commit: src/sys/dev/pci/igc

2024-02-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Feb 21 12:39:39 UTC 2024

Modified Files:
src/sys/dev/pci/igc: if_igc.c igc_defines.h

Log Message:
igc(4): Print EtrackID.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pci/igc/if_igc.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pci/igc/igc_defines.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci/igc

2024-02-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Feb 21 12:34:06 UTC 2024

Modified Files:
src/sys/dev/pci/igc: if_igc.c

Log Message:
igc(4): Modify dmesg output of PHY and NVM info.

 - Print PHY info first and then print NVM info.
 - Remove debug output.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/igc/if_igc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/igc/if_igc.c
diff -u src/sys/dev/pci/igc/if_igc.c:1.11 src/sys/dev/pci/igc/if_igc.c:1.12
--- src/sys/dev/pci/igc/if_igc.c:1.11	Thu Feb  8 09:59:35 2024
+++ src/sys/dev/pci/igc/if_igc.c	Wed Feb 21 12:34:06 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_igc.c,v 1.11 2024/02/08 09:59:35 msaitoh Exp $	*/
+/*	$NetBSD: if_igc.c,v 1.12 2024/02/21 12:34:06 msaitoh Exp $	*/
 /*	$OpenBSD: if_igc.c,v 1.13 2023/04/28 10:18:57 bluhm Exp $	*/
 /*-
  * SPDX-License-Identifier: BSD-2-Clause
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_igc.c,v 1.11 2024/02/08 09:59:35 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_igc.c,v 1.12 2024/02/21 12:34:06 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_igc.h"
@@ -3862,23 +3862,21 @@ igc_print_devinfo(struct igc_softc *sc)
 	rev = MII_REV(id2);
 	mii_get_descr(descr, sizeof(descr), oui, model);
 	if (descr[0])
-		aprint_normal_dev(dev, "PHY: %s, rev. %d\n",
+		aprint_normal_dev(dev, "PHY: %s, rev. %d",
 		descr, rev);
 	else
 		aprint_normal_dev(dev,
-		"PHY OUI 0x%06x, model 0x%04x, rev. %d\n",
+		"PHY OUI 0x%06x, model 0x%04x, rev. %d",
 		oui, model, rev);
 
+	/* PHY FW version */
+	phy->ops.read_reg(hw, 0x1e, _ver);
+	aprint_normal(", PHY FW version 0x%04hx\n", phy_ver);
+
 	/* Get NVM version */
 	hw->nvm.ops.read(hw, NVM_VERSION, 1, _ver);
 
-	/* Get PHY FW version */
-	phy->ops.read_reg(hw, 0x1e, _ver);
-
-	aprint_normal_dev(dev, "ROM image version %x.%02x",
+	aprint_normal_dev(dev, "ROM image version %x.%02x\n",
 	(nvm_ver & NVM_VERSION_MAJOR) >> NVM_VERSION_MAJOR_SHIFT,
 	(nvm_ver & NVM_VERSION_MINOR));
-	aprint_debug("(0x%04hx)", nvm_ver);
-
-	aprint_normal(", PHY FW version 0x%04hx\n", phy_ver);
 }



CVS commit: src/sys/dev/pci/igc

2024-02-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Feb 21 12:34:06 UTC 2024

Modified Files:
src/sys/dev/pci/igc: if_igc.c

Log Message:
igc(4): Modify dmesg output of PHY and NVM info.

 - Print PHY info first and then print NVM info.
 - Remove debug output.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/igc/if_igc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2024-02-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Feb 21 12:23:52 UTC 2024

Modified Files:
src/sys/dev/pci: if_wm.c

Log Message:
wm(4): Fix upper 16bit of Image Unique ID(EtrackID).

 Don't override uid1 variable while reading option ROM version
to print Image Unique ID correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.797 -r1.798 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2024-02-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Feb 21 12:23:52 UTC 2024

Modified Files:
src/sys/dev/pci: if_wm.c

Log Message:
wm(4): Fix upper 16bit of Image Unique ID(EtrackID).

 Don't override uid1 variable while reading option ROM version
to print Image Unique ID correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.797 -r1.798 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.797 src/sys/dev/pci/if_wm.c:1.798
--- src/sys/dev/pci/if_wm.c:1.797	Mon Jan 29 06:24:51 2024
+++ src/sys/dev/pci/if_wm.c	Wed Feb 21 12:23:52 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.797 2024/01/29 06:24:51 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.798 2024/02/21 12:23:52 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.797 2024/01/29 06:24:51 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.798 2024/02/21 12:23:52 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_wm.h"
@@ -15364,16 +15364,17 @@ printver:
 		/* Option ROM Version */
 		if ((off != 0x) && (off != 0x)) {
 			int rv;
+			uint16_t oid0, oid1;
 
 			off += NVM_COMBO_VER_OFF;
-			rv = wm_nvm_read(sc, off + 1, 1, );
-			rv |= wm_nvm_read(sc, off, 1, );
-			if ((rv == 0) && (uid0 != 0) && (uid0 != 0x)
-			&& (uid1 != 0) && (uid1 != 0x)) {
+			rv = wm_nvm_read(sc, off + 1, 1, );
+			rv |= wm_nvm_read(sc, off, 1, );
+			if ((rv == 0) && (oid0 != 0) && (oid0 != 0x)
+			&& (oid1 != 0) && (oid1 != 0x)) {
 /* 16bits */
-major = uid0 >> 8;
-build = (uid0 << 8) | (uid1 >> 8);
-patch = uid1 & 0x00ff;
+major = oid0 >> 8;
+build = (oid0 << 8) | (oid1 >> 8);
+patch = oid1 & 0x00ff;
 aprint_verbose(", option ROM Version %d.%d.%d",
 major, build, patch);
 			}



CVS commit: src/sys/dev/ic

2024-02-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Feb 19 14:54:04 UTC 2024

Modified Files:
src/sys/dev/ic: ciss.c

Log Message:
ciss(4): Fix panic when the number of logical drive is zero.

 Currently, this drives requires at least one logical drive.
If there is no any logical volume, don't attach the driver.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/ic/ciss.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/ciss.c
diff -u src/sys/dev/ic/ciss.c:1.55 src/sys/dev/ic/ciss.c:1.56
--- src/sys/dev/ic/ciss.c:1.55	Thu Aug 17 14:19:50 2023
+++ src/sys/dev/ic/ciss.c	Mon Feb 19 14:54:04 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ciss.c,v 1.55 2023/08/17 14:19:50 andvar Exp $	*/
+/*	$NetBSD: ciss.c,v 1.56 2024/02/19 14:54:04 msaitoh Exp $	*/
 /*	$OpenBSD: ciss.c,v 1.68 2013/05/30 16:15:02 deraadt Exp $	*/
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.55 2023/08/17 14:19:50 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.56 2024/02/19 14:54:04 msaitoh Exp $");
 
 #include "bio.h"
 
@@ -427,6 +427,14 @@ ciss_attach(struct ciss_softc *sc)
 
 	mutex_exit(>sc_mutex_scratch);
 
+	if (sc->maxunits == 0) {
+		bus_dmamem_free(sc->sc_dmat, sc->cmdseg, 1);
+		bus_dmamap_destroy(sc->sc_dmat, sc->cmdmap);
+		aprint_error_dev(sc->sc_dev,
+		"No any LD. This driver can't attach.\n");
+		return -1;
+	}
+
 	callout_init(>sc_hb, 0);
 	callout_setfunc(>sc_hb, ciss_heartbeat, sc);
 	callout_schedule(>sc_hb, hz * 3);



CVS commit: src/sys/dev/ic

2024-02-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Feb 19 14:54:04 UTC 2024

Modified Files:
src/sys/dev/ic: ciss.c

Log Message:
ciss(4): Fix panic when the number of logical drive is zero.

 Currently, this drives requires at least one logical drive.
If there is no any logical volume, don't attach the driver.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/ic/ciss.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev

2024-02-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Feb 13 14:56:52 UTC 2024

Modified Files:
src/sys/dev/ic: mfireg.h
src/sys/dev/pci: mfii.c

Log Message:
mfii(4): Apply two changes from OpenBSD to fix an unknown firmware state.

 My own MegaRAID 946N-8i 2G", firmware 50.5.0-2594 failed to attach.

mfii0: unknown firmware state 1879048192

1879048192 equals to 0x7000(== MFI_STATE_FW_INIT_2).
Apply following two OpenBSD commits to resolve this problem.


sys/dev/pci/mfii.c OpenBSD rev. 1.86
sys/dev/ic/mfireg.h OpenBSD rev. 1.52

Make mfii(4) recover from firmware FAULT state on startup.

In case firmware initially comes up in FAULT state, reset the device and
give it one more chance to attach successfully. The Linux megaraid_sas
driver applies the same workaround in this case. There seems to be a bug
in some firmware versions which can trigger this behaviour; see mainline
Linux commit 6431f5d7c6025f8b007af06ea090de308f7e6881

Problem observed by me with mfii(4) attached via KVM PCI-passthrough:
mfii0 at pci0 dev 2 function 0 "Symbios Logic MegaRAID SAS2208" rev 0x05: msi
mfii0: firmware fault

With this workaround in place, attachment succeeds and the device works:
mfii0 at pci0 dev 2 function 0 "Symbios Logic MegaRAID SAS2208" rev 0x05: msi
mfii0: firmware fault; attempting full device reset, this can take some time
mfii0: "RAID Ctrl SAS 6G 1GB (D3116C)", firmware 23.29.0-0019, 1024MB cache

Tested for regressions on bare metal by Hrvoje with two different adapters:
mfii0 at pci1 dev 0 function 0 "Symbios Logic MegaRAID SAS3508" rev 0x01: msi
mfii0: "PERC H740P Mini ", firmware 51.16.0-4076, 8192MB cache
mfii0 at pci4 dev 0 function 0 "Symbios Logic MegaRAID SAS2208" rev 0x05: msi
mfii0: "ServeRAID M5110", firmware 23.34.0-0023, 512MB cache

ok jmatthew@


sys/dev/pci/mfii.c OpenBSD rev. 1.87

Give mfii(4) firmware more time to transition out of UNDEFINED state.

Prevents occasional failure to recover from firmware FAULT state where
the driver gave up too early: mfii0: firmware stuck in state 0

ok deraadt@


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/ic/mfireg.h
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pci/mfii.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/mfireg.h
diff -u src/sys/dev/ic/mfireg.h:1.24 src/sys/dev/ic/mfireg.h:1.25
--- src/sys/dev/ic/mfireg.h:1.24	Sat Jul 16 06:52:40 2022
+++ src/sys/dev/ic/mfireg.h	Tue Feb 13 14:56:52 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: mfireg.h,v 1.24 2022/07/16 06:52:40 msaitoh Exp $ */
+/* $NetBSD: mfireg.h,v 1.25 2024/02/13 14:56:52 msaitoh Exp $ */
 /* $OpenBSD: mfireg.h,v 1.24 2006/06/19 19:05:45 marco Exp $ */
 /*
  * Copyright (c) 2006 Marco Peereboom 
@@ -110,6 +110,7 @@
 #define MFI_STATE_WAIT_HANDSHAKE	0x6000
 #define MFI_STATE_FW_INIT_2		0x7000
 #define MFI_STATE_DEVICE_SCAN		0x8000
+#define MFI_STATE_BOOT_MESSAGE_PENDING	0x9000
 #define MFI_STATE_FLUSH_CACHE		0xa000
 #define MFI_STATE_READY			0xb000
 #define MFI_STATE_OPERATIONAL		0xc000
@@ -135,6 +136,7 @@
 #define MFI_INIT_READY			0x0002
 #define MFI_INIT_MFIMODE		0x0004
 #define MFI_INIT_CLEAR_HANDSHAKE	0x0008
+#define MFI_INIT_HOTPLUG		0x0010
 #define MFI_RESET_FLAGS			MFI_INIT_READY | MFI_INIT_MFIMODE | \
 	MFI_INIT_ABORT
 #define MFI_INIT_HOTPLUG		0x0010

Index: src/sys/dev/pci/mfii.c
diff -u src/sys/dev/pci/mfii.c:1.31 src/sys/dev/pci/mfii.c:1.32
--- src/sys/dev/pci/mfii.c:1.31	Thu Oct  5 21:41:00 2023
+++ src/sys/dev/pci/mfii.c	Tue Feb 13 14:56:52 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: mfii.c,v 1.31 2023/10/05 21:41:00 christos Exp $ */
+/* $NetBSD: mfii.c,v 1.32 2024/02/13 14:56:52 msaitoh Exp $ */
 /* $OpenBSD: mfii.c,v 1.58 2018/08/14 05:22:21 jmatthew Exp $ */
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mfii.c,v 1.31 2023/10/05 21:41:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mfii.c,v 1.32 2024/02/13 14:56:52 msaitoh Exp $");
 
 #include "bio.h"
 
@@ -440,6 +440,7 @@ static void		mfii_put_ccb(struct mfii_so
 static int		mfii_init_ccb(struct mfii_softc *);
 static void		mfii_scrub_ccb(struct mfii_ccb *);
 
+static int		mfii_reset_hard(struct mfii_softc *);
 static int		mfii_transition_firmware(struct mfii_softc *);
 static int		mfii_initialise_firmware(struct mfii_softc *);
 static int		mfii_get_info(struct mfii_softc *);
@@ -1489,11 +1490,58 @@ mfii_aen_unregister(struct mfii_softc *s
 	/* XXX */
 }
 
+int
+mfii_reset_hard(struct mfii_softc *sc)
+{
+	uint16_t		i;
+
+	mfii_write(sc, MFI_OSTS, 0);
+
+	/* enable diagnostic register */
+	mfii_write(sc, MPII_WRITESEQ, MPII_WRITESEQ_FLUSH);
+	mfii_write(sc, MPII_WRITESEQ, MPII_WRITESEQ_1);
+	mfii_write(sc, MPII_WRITESEQ, MPII_WRITESEQ_2);
+	mfii_write(sc, MPII_WRITESEQ, MPII_WRITESEQ_3);
+	mfii_write(sc, MPII_WRITESEQ, MPII_WRITESEQ_4);
+	

CVS commit: src/sys/dev

2024-02-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Feb 13 14:56:52 UTC 2024

Modified Files:
src/sys/dev/ic: mfireg.h
src/sys/dev/pci: mfii.c

Log Message:
mfii(4): Apply two changes from OpenBSD to fix an unknown firmware state.

 My own MegaRAID 946N-8i 2G", firmware 50.5.0-2594 failed to attach.

mfii0: unknown firmware state 1879048192

1879048192 equals to 0x7000(== MFI_STATE_FW_INIT_2).
Apply following two OpenBSD commits to resolve this problem.


sys/dev/pci/mfii.c OpenBSD rev. 1.86
sys/dev/ic/mfireg.h OpenBSD rev. 1.52

Make mfii(4) recover from firmware FAULT state on startup.

In case firmware initially comes up in FAULT state, reset the device and
give it one more chance to attach successfully. The Linux megaraid_sas
driver applies the same workaround in this case. There seems to be a bug
in some firmware versions which can trigger this behaviour; see mainline
Linux commit 6431f5d7c6025f8b007af06ea090de308f7e6881

Problem observed by me with mfii(4) attached via KVM PCI-passthrough:
mfii0 at pci0 dev 2 function 0 "Symbios Logic MegaRAID SAS2208" rev 0x05: msi
mfii0: firmware fault

With this workaround in place, attachment succeeds and the device works:
mfii0 at pci0 dev 2 function 0 "Symbios Logic MegaRAID SAS2208" rev 0x05: msi
mfii0: firmware fault; attempting full device reset, this can take some time
mfii0: "RAID Ctrl SAS 6G 1GB (D3116C)", firmware 23.29.0-0019, 1024MB cache

Tested for regressions on bare metal by Hrvoje with two different adapters:
mfii0 at pci1 dev 0 function 0 "Symbios Logic MegaRAID SAS3508" rev 0x01: msi
mfii0: "PERC H740P Mini ", firmware 51.16.0-4076, 8192MB cache
mfii0 at pci4 dev 0 function 0 "Symbios Logic MegaRAID SAS2208" rev 0x05: msi
mfii0: "ServeRAID M5110", firmware 23.34.0-0023, 512MB cache

ok jmatthew@


sys/dev/pci/mfii.c OpenBSD rev. 1.87

Give mfii(4) firmware more time to transition out of UNDEFINED state.

Prevents occasional failure to recover from firmware FAULT state where
the driver gave up too early: mfii0: firmware stuck in state 0

ok deraadt@


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/ic/mfireg.h
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pci/mfii.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci/igc

2024-02-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Feb  8 09:59:35 UTC 2024

Modified Files:
src/sys/dev/pci/igc: if_igc.c

Log Message:
igc: Add missing igc_check_for_link() call.

 It's required to set the collision distance, configure flow control
from the negotiated result and set the LTR thresholds.
With this change, ifconfig igcN show the flow control status correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/igc/if_igc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci/igc

2024-02-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Feb  8 09:59:35 UTC 2024

Modified Files:
src/sys/dev/pci/igc: if_igc.c

Log Message:
igc: Add missing igc_check_for_link() call.

 It's required to set the collision distance, configure flow control
from the negotiated result and set the LTR thresholds.
With this change, ifconfig igcN show the flow control status correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/igc/if_igc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/igc/if_igc.c
diff -u src/sys/dev/pci/igc/if_igc.c:1.10 src/sys/dev/pci/igc/if_igc.c:1.11
--- src/sys/dev/pci/igc/if_igc.c:1.10	Thu Jan 25 05:48:56 2024
+++ src/sys/dev/pci/igc/if_igc.c	Thu Feb  8 09:59:35 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_igc.c,v 1.10 2024/01/25 05:48:56 msaitoh Exp $	*/
+/*	$NetBSD: if_igc.c,v 1.11 2024/02/08 09:59:35 msaitoh Exp $	*/
 /*	$OpenBSD: if_igc.c,v 1.13 2023/04/28 10:18:57 bluhm Exp $	*/
 /*-
  * SPDX-License-Identifier: BSD-2-Clause
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_igc.c,v 1.10 2024/01/25 05:48:56 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_igc.c,v 1.11 2024/02/08 09:59:35 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_igc.h"
@@ -2548,6 +2548,9 @@ igc_update_link_status(struct igc_softc 
 	struct ifnet *ifp = >sc_ec.ec_if;
 	struct igc_hw *hw = >hw;
 
+	if (hw->mac.get_link_status == true)
+		igc_check_for_link(hw);
+
 	if (IGC_READ_REG(>hw, IGC_STATUS) & IGC_STATUS_LU) {
 		if (sc->link_active == 0) {
 			igc_get_speed_and_duplex(hw, >link_speed,



CVS commit: src/share/man/man4

2024-02-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Feb  7 04:25:58 UTC 2024

Modified Files:
src/share/man/man4: gcscaudio.4

Log Message:
Fix date.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man4/gcscaudio.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/gcscaudio.4
diff -u src/share/man/man4/gcscaudio.4:1.4 src/share/man/man4/gcscaudio.4:1.5
--- src/share/man/man4/gcscaudio.4:1.4	Wed Feb  7 04:20:26 2024
+++ src/share/man/man4/gcscaudio.4	Wed Feb  7 04:25:58 2024
@@ -1,4 +1,4 @@
-.\" $NetBSD: gcscaudio.4,v 1.4 2024/02/07 04:20:26 msaitoh Exp $
+.\" $NetBSD: gcscaudio.4,v 1.5 2024/02/07 04:25:58 msaitoh Exp $
 .\"
 .\" Copyright (c) 2009 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd February 27, 2024
+.Dd February 7, 2024
 .Dt GCSCAUDIO 4
 .Os
 .Sh NAME



CVS commit: src/share/man/man4

2024-02-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Feb  7 04:25:58 UTC 2024

Modified Files:
src/share/man/man4: gcscaudio.4

Log Message:
Fix date.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man4/gcscaudio.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src

2024-02-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Feb  7 04:20:29 UTC 2024

Modified Files:
src/common/lib/libc/arch/aarch64/string: bcopy.S
src/common/lib/libc/arch/sh3/string: memcpy.S
src/share/man/man4: aq.4 gcscaudio.4
src/sys/arch/aarch64/aarch64: aarch32_syscall.c bus_space.c
bus_space_asm_generic.S bus_space_notimpl.S cpu.c cpufunc.c
db_disasm.c db_interface.c db_trace.c disasm.c disasm.h fault.c
kobj_machdep.c linux_syscall.c locore.S netbsd32_machdep.c
netbsd32_syscall.c pmap.c pmapboot.c procfs_machdep.c start.S
src/sys/arch/aarch64/include: cpufunc.h machdep.h
src/sys/arch/arm/amlogic: meson_pwm.c meson_thermal.c meson_usbctrl.c
mesong12_aoclkc.c mesong12_aoclkc.h mesong12_clkc.h
mesong12_usb2phy.c mesong12_usb3pciephy.c
src/sys/arch/arm/imx: if_enet.c if_enetreg.h if_enetvar.h imx51_axi.c
imx51_intr.h imx51_tzic.c imxpciereg.h imxsnvs.c imxsnvsreg.h
src/sys/arch/arm/nxp: imx6_ccmreg.h imx6_iomuxreg.h imx6_ocotp.c
imx6_ocotpreg.h imx6_ocotpvar.h imx6_srcreg.h imx6_usbreg.h
imx6var.h imx_ahcisatareg.h imx_snvs.c
src/sys/arch/arm/rockchip: rk3588_cru.c rk3588_cru.h rk3588_iomux.c
rk3588_platform.h rk_eqos.c
src/sys/arch/dreamcast/dev/g2: aica.c aicavar.h
src/sys/arch/dreamcast/dev/microcode: aica_arm.c aica_arm_locore.S
src/sys/arch/riscv/riscv: bus_space_notimpl.S
src/sys/arch/sh3/sh3: cpu_in_cksum.S
src/sys/compat/linux/arch/aarch64: linux_machdep.c
src/sys/compat/linux32/arch/aarch64: linux32_machdep.c
linux32_sigcode.S
src/sys/dev/fdt: pwmregulator.c vmt_fdt.c
src/sys/dev/pci: gcscaudio.c gcscaudioreg.h if_aq.c
src/sys/net: toeplitz.c
src/usr.sbin/cpuctl/arch: aarch64.c
src/usr.sbin/tprof: tprof_top.c

Log Message:
Remove ryo@'s mail addresses.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/common/lib/libc/arch/aarch64/string/bcopy.S
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/arch/sh3/string/memcpy.S
cvs rdiff -u -r1.5 -r1.6 src/share/man/man4/aq.4
cvs rdiff -u -r1.3 -r1.4 src/share/man/man4/gcscaudio.4
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/aarch64/aarch64/aarch32_syscall.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/aarch64/aarch64/bus_space.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/aarch64/aarch64/bus_space_asm_generic.S
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/aarch64/aarch64/bus_space_notimpl.S \
src/sys/arch/aarch64/aarch64/disasm.h \
src/sys/arch/aarch64/aarch64/netbsd32_syscall.c
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/aarch64/aarch64/cpu.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/aarch64/aarch64/cpufunc.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/aarch64/aarch64/db_disasm.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/aarch64/aarch64/db_interface.c \
src/sys/arch/aarch64/aarch64/db_trace.c \
src/sys/arch/aarch64/aarch64/netbsd32_machdep.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/aarch64/aarch64/disasm.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/aarch64/aarch64/fault.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/aarch64/aarch64/kobj_machdep.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/aarch64/aarch64/linux_syscall.c
cvs rdiff -u -r1.92 -r1.93 src/sys/arch/aarch64/aarch64/locore.S
cvs rdiff -u -r1.149 -r1.150 src/sys/arch/aarch64/aarch64/pmap.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/aarch64/aarch64/pmapboot.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/aarch64/aarch64/procfs_machdep.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/aarch64/aarch64/start.S
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/aarch64/include/cpufunc.h
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/aarch64/include/machdep.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/amlogic/meson_pwm.c \
src/sys/arch/arm/amlogic/meson_usbctrl.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/amlogic/meson_thermal.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/amlogic/mesong12_aoclkc.c \
src/sys/arch/arm/amlogic/mesong12_usb2phy.c \
src/sys/arch/arm/amlogic/mesong12_usb3pciephy.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/amlogic/mesong12_aoclkc.h \
src/sys/arch/arm/amlogic/mesong12_clkc.h
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/arm/imx/if_enet.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/imx/if_enetreg.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/imx/if_enetvar.h \
src/sys/arch/arm/imx/imx51_tzic.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/imx/imx51_axi.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/imx51_intr.h \
src/sys/arch/arm/imx/imxpciereg.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/imx/imxsnvs.c \
src/sys/arch/arm/imx/imxsnvsreg.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/nxp/imx6_ccmreg.h \
src/sys/arch/arm/nxp/imx6_ocotp.c src/sys/arch/arm/nxp/imx_snvs.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/nxp/imx6_iomuxreg.h \
src/sys/arch/arm/nxp/imx6_ocotpreg.h src/sys/arch/arm/nxp/imx6_ocotpvar.h \

CVS commit: src

2024-02-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Feb  7 04:20:29 UTC 2024

Modified Files:
src/common/lib/libc/arch/aarch64/string: bcopy.S
src/common/lib/libc/arch/sh3/string: memcpy.S
src/share/man/man4: aq.4 gcscaudio.4
src/sys/arch/aarch64/aarch64: aarch32_syscall.c bus_space.c
bus_space_asm_generic.S bus_space_notimpl.S cpu.c cpufunc.c
db_disasm.c db_interface.c db_trace.c disasm.c disasm.h fault.c
kobj_machdep.c linux_syscall.c locore.S netbsd32_machdep.c
netbsd32_syscall.c pmap.c pmapboot.c procfs_machdep.c start.S
src/sys/arch/aarch64/include: cpufunc.h machdep.h
src/sys/arch/arm/amlogic: meson_pwm.c meson_thermal.c meson_usbctrl.c
mesong12_aoclkc.c mesong12_aoclkc.h mesong12_clkc.h
mesong12_usb2phy.c mesong12_usb3pciephy.c
src/sys/arch/arm/imx: if_enet.c if_enetreg.h if_enetvar.h imx51_axi.c
imx51_intr.h imx51_tzic.c imxpciereg.h imxsnvs.c imxsnvsreg.h
src/sys/arch/arm/nxp: imx6_ccmreg.h imx6_iomuxreg.h imx6_ocotp.c
imx6_ocotpreg.h imx6_ocotpvar.h imx6_srcreg.h imx6_usbreg.h
imx6var.h imx_ahcisatareg.h imx_snvs.c
src/sys/arch/arm/rockchip: rk3588_cru.c rk3588_cru.h rk3588_iomux.c
rk3588_platform.h rk_eqos.c
src/sys/arch/dreamcast/dev/g2: aica.c aicavar.h
src/sys/arch/dreamcast/dev/microcode: aica_arm.c aica_arm_locore.S
src/sys/arch/riscv/riscv: bus_space_notimpl.S
src/sys/arch/sh3/sh3: cpu_in_cksum.S
src/sys/compat/linux/arch/aarch64: linux_machdep.c
src/sys/compat/linux32/arch/aarch64: linux32_machdep.c
linux32_sigcode.S
src/sys/dev/fdt: pwmregulator.c vmt_fdt.c
src/sys/dev/pci: gcscaudio.c gcscaudioreg.h if_aq.c
src/sys/net: toeplitz.c
src/usr.sbin/cpuctl/arch: aarch64.c
src/usr.sbin/tprof: tprof_top.c

Log Message:
Remove ryo@'s mail addresses.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/common/lib/libc/arch/aarch64/string/bcopy.S
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/arch/sh3/string/memcpy.S
cvs rdiff -u -r1.5 -r1.6 src/share/man/man4/aq.4
cvs rdiff -u -r1.3 -r1.4 src/share/man/man4/gcscaudio.4
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/aarch64/aarch64/aarch32_syscall.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/aarch64/aarch64/bus_space.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/aarch64/aarch64/bus_space_asm_generic.S
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/aarch64/aarch64/bus_space_notimpl.S \
src/sys/arch/aarch64/aarch64/disasm.h \
src/sys/arch/aarch64/aarch64/netbsd32_syscall.c
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/aarch64/aarch64/cpu.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/aarch64/aarch64/cpufunc.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/aarch64/aarch64/db_disasm.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/aarch64/aarch64/db_interface.c \
src/sys/arch/aarch64/aarch64/db_trace.c \
src/sys/arch/aarch64/aarch64/netbsd32_machdep.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/aarch64/aarch64/disasm.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/aarch64/aarch64/fault.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/aarch64/aarch64/kobj_machdep.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/aarch64/aarch64/linux_syscall.c
cvs rdiff -u -r1.92 -r1.93 src/sys/arch/aarch64/aarch64/locore.S
cvs rdiff -u -r1.149 -r1.150 src/sys/arch/aarch64/aarch64/pmap.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/aarch64/aarch64/pmapboot.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/aarch64/aarch64/procfs_machdep.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/aarch64/aarch64/start.S
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/aarch64/include/cpufunc.h
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/aarch64/include/machdep.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/amlogic/meson_pwm.c \
src/sys/arch/arm/amlogic/meson_usbctrl.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/amlogic/meson_thermal.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/amlogic/mesong12_aoclkc.c \
src/sys/arch/arm/amlogic/mesong12_usb2phy.c \
src/sys/arch/arm/amlogic/mesong12_usb3pciephy.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/amlogic/mesong12_aoclkc.h \
src/sys/arch/arm/amlogic/mesong12_clkc.h
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/arm/imx/if_enet.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/imx/if_enetreg.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/imx/if_enetvar.h \
src/sys/arch/arm/imx/imx51_tzic.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/imx/imx51_axi.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/imx51_intr.h \
src/sys/arch/arm/imx/imxpciereg.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/imx/imxsnvs.c \
src/sys/arch/arm/imx/imxsnvsreg.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/nxp/imx6_ccmreg.h \
src/sys/arch/arm/nxp/imx6_ocotp.c src/sys/arch/arm/nxp/imx_snvs.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/nxp/imx6_iomuxreg.h \
src/sys/arch/arm/nxp/imx6_ocotpreg.h src/sys/arch/arm/nxp/imx6_ocotpvar.h \

CVS commit: src

2024-02-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Feb  7 04:02:36 UTC 2024

Modified Files:
src/doc: CHANGES.prev
src/sys/arch/sparc/stand/bootxx: promlib.c
src/sys/dev/pcmcia: pcmciareg.h

Log Message:
Fix typo of "following" in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 src/doc/CHANGES.prev
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/sparc/stand/bootxx/promlib.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pcmcia/pcmciareg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES.prev
diff -u src/doc/CHANGES.prev:1.181 src/doc/CHANGES.prev:1.182
--- src/doc/CHANGES.prev:1.181	Sat Feb  3 21:25:02 2024
+++ src/doc/CHANGES.prev	Wed Feb  7 04:02:36 2024
@@ -1,4 +1,4 @@
-LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.181 $>
+LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.182 $>
 
 
 Changes from 386bsd 0.1 + patchkit 0.2.2 to NetBSD 0.8:
@@ -11753,7 +11753,7 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 	rtsold(8): Removed in favour of dhcpcd. [roy 20140911]
 	dhcpcd(8): Import dhcpcd-6.4.5. [roy 20140918]
 	arm: Add support for i.MX6 SoC. [ryo 20140925]
-	gpt(8): Completed overhaul, including adding follwing subcommands:
+	gpt(8): Completed overhaul, including adding following subcommands:
 		resize, set, unset, backup, restore, and resizedisk.
 		[jnemeth 20140926]
 	dhcpcd(8): Import dhcpcd-6.4.7. [roy 20140927]

Index: src/sys/arch/sparc/stand/bootxx/promlib.c
diff -u src/sys/arch/sparc/stand/bootxx/promlib.c:1.11 src/sys/arch/sparc/stand/bootxx/promlib.c:1.12
--- src/sys/arch/sparc/stand/bootxx/promlib.c:1.11	Sun Jul 17 20:54:47 2011
+++ src/sys/arch/sparc/stand/bootxx/promlib.c	Wed Feb  7 04:02:36 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: promlib.c,v 1.11 2011/07/17 20:54:47 joerg Exp $ */
+/*	$NetBSD: promlib.c,v 1.12 2024/02/07 04:02:36 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
  * Specially crafted scaled-down version of promlib for the first-stage
  * boot program.
  *
- * bootxx needs the follwoing PROM functions:
+ * bootxx needs the following PROM functions:
  *	prom_version()
  *	prom_getbootpath()
  *	prom_putchar()

Index: src/sys/dev/pcmcia/pcmciareg.h
diff -u src/sys/dev/pcmcia/pcmciareg.h:1.11 src/sys/dev/pcmcia/pcmciareg.h:1.12
--- src/sys/dev/pcmcia/pcmciareg.h:1.11	Sun Sep  1 00:36:52 2019
+++ src/sys/dev/pcmcia/pcmciareg.h	Wed Feb  7 04:02:36 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcmciareg.h,v 1.11 2019/09/01 00:36:52 mlelstv Exp $	*/
+/*	$NetBSD: pcmciareg.h,v 1.12 2024/02/07 04:02:36 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1997 Marc Horowitz.  All rights reserved.
@@ -61,7 +61,7 @@
 
 /*
  * the 2.1 docs have 0x02-0x07 as reserved, but the linux drivers list the
- * follwing tuple code values.  I have at least one card (3com 3c562
+ * following tuple code values.  I have at least one card (3com 3c562
  * lan+modem) which has a code 0x06 tuple, so I'm going to assume that these
  * are for real
  */



CVS commit: src

2024-02-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Feb  7 04:02:36 UTC 2024

Modified Files:
src/doc: CHANGES.prev
src/sys/arch/sparc/stand/bootxx: promlib.c
src/sys/dev/pcmcia: pcmciareg.h

Log Message:
Fix typo of "following" in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 src/doc/CHANGES.prev
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/sparc/stand/bootxx/promlib.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pcmcia/pcmciareg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src

2024-02-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Feb  7 04:00:11 UTC 2024

Modified Files:
src/sys/arch/ia64/include: pmap.h
src/usr.sbin/makefs: README

Log Message:
s/strucutre/structure/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/ia64/include/pmap.h
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/makefs/README

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/ia64/include/pmap.h
diff -u src/sys/arch/ia64/include/pmap.h:1.9 src/sys/arch/ia64/include/pmap.h:1.10
--- src/sys/arch/ia64/include/pmap.h:1.9	Fri Oct  6 11:45:37 2023
+++ src/sys/arch/ia64/include/pmap.h	Wed Feb  7 04:00:11 2024
@@ -163,7 +163,7 @@ void pmap_procwr(struct proc *, vaddr_t,
  * Note that we if we access the kernel pmap in interrupt context, it
  * is only to update statistics.  Since stats are updated using atomic
  * operations, locking the kernel pmap is not necessary.  Therefore,
- * it is not necessary to block interrupts when locking pmap strucutres.
+ * it is not necessary to block interrupts when locking pmap structures.
  */
 /* XXX
 #define	PMAP_LOCK(pmap)		mutex_enter(&(pmap)->pm_slock)

Index: src/usr.sbin/makefs/README
diff -u src/usr.sbin/makefs/README:1.8 src/usr.sbin/makefs/README:1.9
--- src/usr.sbin/makefs/README:1.8	Wed Oct 26 21:56:19 2022
+++ src/usr.sbin/makefs/README	Wed Feb  7 04:00:10 2024
@@ -1,4 +1,4 @@
-$NetBSD: README,v 1.8 2022/10/26 21:56:19 andvar Exp $
+$NetBSD: README,v 1.9 2024/02/07 04:00:10 msaitoh Exp $
 
 makefs - build a file system image from a directory tree
 
@@ -102,7 +102,7 @@ Each fs-specific module should have the 
 prepare_options and cleanup_options are optional and can be NULL.
 
 NOTE: All file system specific options are referenced via the fs_specific
-pointer from the fsinfo_t strucutre. It is up to the filesystem to allocate
+pointer from the fsinfo_t structure. It is up to the filesystem to allocate
 and free any data needed for this via the prepare and cleanup callbacks.
 
 Each fs-specific module will need to add its routines to the dispatch array



CVS commit: src

2024-02-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Feb  7 04:00:11 UTC 2024

Modified Files:
src/sys/arch/ia64/include: pmap.h
src/usr.sbin/makefs: README

Log Message:
s/strucutre/structure/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/ia64/include/pmap.h
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/makefs/README

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2024-01-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Jan 29 06:24:51 UTC 2024

Modified Files:
src/sys/dev/pci: if_wm.c

Log Message:
wm(4): Fix compile error without WM_EVENT_COUNTERS.


To generate a diff of this commit:
cvs rdiff -u -r1.796 -r1.797 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.796 src/sys/dev/pci/if_wm.c:1.797
--- src/sys/dev/pci/if_wm.c:1.796	Mon Jan 29 06:05:11 2024
+++ src/sys/dev/pci/if_wm.c	Mon Jan 29 06:24:51 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.796 2024/01/29 06:05:11 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.797 2024/01/29 06:24:51 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.796 2024/01/29 06:05:11 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.797 2024/01/29 06:24:51 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_wm.h"
@@ -6640,7 +6640,6 @@ wm_update_stats(struct wm_softc *sc)
 	uint64_t crcerrs, algnerrc, symerrc, mpc, colc,  sec, rlec, rxerrc,
 	cexterr;
 	uint64_t total_qdrop = 0;
-	int i;
 
 	crcerrs = CSR_READ(sc, WMREG_CRCERRS);
 	symerrc = CSR_READ(sc, WMREG_SYMERRC);
@@ -6789,7 +6788,8 @@ wm_update_stats(struct wm_softc *sc)
 		WM_EVCNT_ADD(>sc_ev_lenerrs, CSR_READ(sc, WMREG_LENERRS));
 		WM_EVCNT_ADD(>sc_ev_scvpc, CSR_READ(sc, WMREG_SCVPC));
 		WM_EVCNT_ADD(>sc_ev_hrmpc, CSR_READ(sc, WMREG_HRMPC));
-		for (i = 0; i < sc->sc_nqueues; i++) {
+#ifdef WM_EVENT_COUNTERS
+		for (int i = 0; i < sc->sc_nqueues; i++) {
 			struct wm_rxqueue *rxq = >sc_queue[i].wmq_rxq;
 			uint32_t rqdpc;
 
@@ -6803,6 +6803,7 @@ wm_update_stats(struct wm_softc *sc)
 			WM_Q_EVCNT_ADD(rxq, qdrop, rqdpc);
 			total_qdrop += rqdpc;
 		}
+#endif
 	}
 	if ((sc->sc_type >= WM_T_I350) && !WM_IS_ICHPCH(sc)) {
 		WM_EVCNT_ADD(>sc_ev_tlpic, CSR_READ(sc, WMREG_TLPIC));



CVS commit: src/sys/dev/pci

2024-01-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Jan 29 06:24:51 UTC 2024

Modified Files:
src/sys/dev/pci: if_wm.c

Log Message:
wm(4): Fix compile error without WM_EVENT_COUNTERS.


To generate a diff of this commit:
cvs rdiff -u -r1.796 -r1.797 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2024-01-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Jan 29 06:05:11 UTC 2024

Modified Files:
src/sys/dev/pci: if_wm.c

Log Message:
wm(4): Drop frames if the RX descriptor ring has no room on multiqueue system.

 Drop frames if the RX descriptor ring has no room. This is enabled only on
multiqueue system to avoid bad influence to other queues. The drop count
can be seen by the RQDPC counter (wmN rxqXXdrop evcnt).


To generate a diff of this commit:
cvs rdiff -u -r1.795 -r1.796 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.795 src/sys/dev/pci/if_wm.c:1.796
--- src/sys/dev/pci/if_wm.c:1.795	Mon Jan 29 05:02:06 2024
+++ src/sys/dev/pci/if_wm.c	Mon Jan 29 06:05:11 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.795 2024/01/29 05:02:06 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.796 2024/01/29 06:05:11 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.795 2024/01/29 05:02:06 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.796 2024/01/29 06:05:11 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_wm.h"
@@ -8458,6 +8458,8 @@ wm_init_rx_regs(struct wm_softc *sc, str
 		rxq->rxq_descsize * rxq->rxq_ndesc);
 
 		if ((sc->sc_flags & WM_F_NEWQUEUE) != 0) {
+			uint32_t srrctl;
+
 			if (MCLBYTES & ((1 << SRRCTL_BSIZEPKT_SHIFT) - 1))
 panic("%s: MCLBYTES %d unsupported for 82575 "
 "or higher\n", __func__, MCLBYTES);
@@ -8466,9 +8468,17 @@ wm_init_rx_regs(struct wm_softc *sc, str
 			 * Currently, support SRRCTL_DESCTYPE_ADV_ONEBUF
 			 * only.
 			 */
-			CSR_WRITE(sc, WMREG_SRRCTL(qid),
-			SRRCTL_DESCTYPE_ADV_ONEBUF
-			| (MCLBYTES >> SRRCTL_BSIZEPKT_SHIFT));
+			srrctl = SRRCTL_DESCTYPE_ADV_ONEBUF
+			| (MCLBYTES >> SRRCTL_BSIZEPKT_SHIFT);
+			/*
+			 * Drop frames if the RX descriptor ring has no room.
+			 * This is enabled only on multiqueue system to avoid
+			 * bad influence to other queues.
+			 */
+			if (sc->sc_nqueues > 1)
+srrctl |= SRRCTL_DROP_EN;
+			CSR_WRITE(sc, WMREG_SRRCTL(qid), srrctl);
+
 			CSR_WRITE(sc, WMREG_RXDCTL(qid), RXDCTL_QUEUE_ENABLE
 			| RXDCTL_PTHRESH(16) | RXDCTL_HTHRESH(8)
 			| RXDCTL_WTHRESH(1));



CVS commit: src/sys/dev/pci

2024-01-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Jan 29 06:05:11 UTC 2024

Modified Files:
src/sys/dev/pci: if_wm.c

Log Message:
wm(4): Drop frames if the RX descriptor ring has no room on multiqueue system.

 Drop frames if the RX descriptor ring has no room. This is enabled only on
multiqueue system to avoid bad influence to other queues. The drop count
can be seen by the RQDPC counter (wmN rxqXXdrop evcnt).


To generate a diff of this commit:
cvs rdiff -u -r1.795 -r1.796 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2024-01-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Jan 29 05:02:06 UTC 2024

Modified Files:
src/sys/dev/pci: if_wm.c if_wmreg.h

Log Message:
wm(4): Add RQDPC(Receive Queue Drop Packet Count) to iqdrops.

 The iqdrops counter should include not only MPC(Missed Packet Count)
but also RQDPC(Receive Queue Drop Packet Count). Same as ixgbe(4) and igc(4).

 Note that the RQDPC is not currently counted because SRRCTL_DROP_EN
is not set.


To generate a diff of this commit:
cvs rdiff -u -r1.794 -r1.795 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.130 -r1.131 src/sys/dev/pci/if_wmreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2024-01-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Jan 29 05:02:06 UTC 2024

Modified Files:
src/sys/dev/pci: if_wm.c if_wmreg.h

Log Message:
wm(4): Add RQDPC(Receive Queue Drop Packet Count) to iqdrops.

 The iqdrops counter should include not only MPC(Missed Packet Count)
but also RQDPC(Receive Queue Drop Packet Count). Same as ixgbe(4) and igc(4).

 Note that the RQDPC is not currently counted because SRRCTL_DROP_EN
is not set.


To generate a diff of this commit:
cvs rdiff -u -r1.794 -r1.795 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.130 -r1.131 src/sys/dev/pci/if_wmreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.794 src/sys/dev/pci/if_wm.c:1.795
--- src/sys/dev/pci/if_wm.c:1.794	Fri Jan 26 03:23:36 2024
+++ src/sys/dev/pci/if_wm.c	Mon Jan 29 05:02:06 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.794 2024/01/26 03:23:36 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.795 2024/01/29 05:02:06 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.794 2024/01/26 03:23:36 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.795 2024/01/29 05:02:06 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_wm.h"
@@ -460,9 +460,9 @@ struct wm_rxqueue {
 	/* RX event counters */
 	WM_Q_EVCNT_DEFINE(rxq, intr);	/* Interrupts */
 	WM_Q_EVCNT_DEFINE(rxq, defer);	/* Rx deferred processing */
-
 	WM_Q_EVCNT_DEFINE(rxq, ipsum);	/* IP checksums checked */
 	WM_Q_EVCNT_DEFINE(rxq, tusum);	/* TCP/UDP cksums checked */
+	WM_Q_EVCNT_DEFINE(rxq, qdrop);	/* Rx queue drop packet */
 #endif
 };
 
@@ -6639,6 +6639,8 @@ wm_update_stats(struct wm_softc *sc)
 	struct ifnet *ifp = >sc_ethercom.ec_if;
 	uint64_t crcerrs, algnerrc, symerrc, mpc, colc,  sec, rlec, rxerrc,
 	cexterr;
+	uint64_t total_qdrop = 0;
+	int i;
 
 	crcerrs = CSR_READ(sc, WMREG_CRCERRS);
 	symerrc = CSR_READ(sc, WMREG_SYMERRC);
@@ -6787,6 +6789,20 @@ wm_update_stats(struct wm_softc *sc)
 		WM_EVCNT_ADD(>sc_ev_lenerrs, CSR_READ(sc, WMREG_LENERRS));
 		WM_EVCNT_ADD(>sc_ev_scvpc, CSR_READ(sc, WMREG_SCVPC));
 		WM_EVCNT_ADD(>sc_ev_hrmpc, CSR_READ(sc, WMREG_HRMPC));
+		for (i = 0; i < sc->sc_nqueues; i++) {
+			struct wm_rxqueue *rxq = >sc_queue[i].wmq_rxq;
+			uint32_t rqdpc;
+
+			rqdpc = CSR_READ(sc, WMREG_RQDPC(i));
+			/*
+			 * On I210 and newer device, the RQDPC register is not
+			 * cleard on read.
+			 */
+			if ((rqdpc != 0) && (sc->sc_type >= WM_T_I210))
+CSR_WRITE(sc, WMREG_RQDPC(i), 0);
+			WM_Q_EVCNT_ADD(rxq, qdrop, rqdpc);
+			total_qdrop += rqdpc;
+		}
 	}
 	if ((sc->sc_type >= WM_T_I350) && !WM_IS_ICHPCH(sc)) {
 		WM_EVCNT_ADD(>sc_ev_tlpic, CSR_READ(sc, WMREG_TLPIC));
@@ -6815,7 +6831,7 @@ wm_update_stats(struct wm_softc *sc)
 	 * If you want to know the nubmer of WMREG_RMBC, you should use such as
 	 * own EVCNT instead of if_iqdrops.
 	 */
-	if_statadd_ref(nsr, if_iqdrops, mpc);
+	if_statadd_ref(nsr, if_iqdrops, mpc + total_qdrop);
 	IF_STAT_PUTREF(ifp);
 }
 
@@ -6833,6 +6849,8 @@ wm_clear_evcnt(struct wm_softc *sc)
 		WM_Q_EVCNT_STORE(rxq, defer, 0);
 		WM_Q_EVCNT_STORE(rxq, ipsum, 0);
 		WM_Q_EVCNT_STORE(rxq, tusum, 0);
+		if ((sc->sc_type >= WM_T_82575) && !WM_IS_ICHPCH(sc))
+			WM_Q_EVCNT_STORE(rxq, qdrop, 0);
 	}
 
 	/* TX queues */
@@ -8195,9 +8213,10 @@ wm_alloc_txrx_queues(struct wm_softc *sc
 
 		WM_Q_INTR_EVCNT_ATTACH(rxq, intr, rxq, i, xname);
 		WM_Q_INTR_EVCNT_ATTACH(rxq, defer, rxq, i, xname);
-
 		WM_Q_MISC_EVCNT_ATTACH(rxq, ipsum, rxq, i, xname);
 		WM_Q_MISC_EVCNT_ATTACH(rxq, tusum, rxq, i, xname);
+		if ((sc->sc_type >= WM_T_82575) && !WM_IS_ICHPCH(sc))
+			WM_Q_MISC_EVCNT_ATTACH(rxq, qdrop, rxq, i, xname);
 #endif /* WM_EVENT_COUNTERS */
 
 		rx_done++;
@@ -8248,6 +8267,8 @@ wm_free_txrx_queues(struct wm_softc *sc)
 		WM_Q_EVCNT_DETACH(rxq, defer, rxq, i);
 		WM_Q_EVCNT_DETACH(rxq, ipsum, rxq, i);
 		WM_Q_EVCNT_DETACH(rxq, tusum, rxq, i);
+		if ((sc->sc_type >= WM_T_82575) && !WM_IS_ICHPCH(sc))
+			WM_Q_EVCNT_DETACH(rxq, qdrop, rxq, i);
 #endif /* WM_EVENT_COUNTERS */
 
 		wm_free_rx_buffer(sc, rxq);

Index: src/sys/dev/pci/if_wmreg.h
diff -u src/sys/dev/pci/if_wmreg.h:1.130 src/sys/dev/pci/if_wmreg.h:1.131
--- src/sys/dev/pci/if_wmreg.h:1.130	Thu May 11 07:19:02 2023
+++ src/sys/dev/pci/if_wmreg.h	Mon Jan 29 05:02:06 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wmreg.h,v 1.130 2023/05/11 07:19:02 msaitoh Exp $	*/
+/*	$NetBSD: if_wmreg.h,v 1.131 2024/01/29 05:02:06 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -857,6 +857,9 @@ struct livengood_tcpip_ctxdesc {
 #define	RXDCTL_QUEUE_ENABLE  0x0200 /* Enable specific Tx Queue */
 #define	RXDCTL_SWFLSH0x0400 /* Rx Desc. write-back flushing */
 
+#define	WMREG_RQDPC(x)	(((x) < 4) ? (0x2830 + (0x100 * (x))) :		\
+	(0xc030 + (0x40 * (x /* Receive Queue Drop 

CVS commit: src/sys/dev/pci

2024-01-25 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Jan 26 03:23:36 UTC 2024

Modified Files:
src/sys/dev/pci: if_wm.c

Log Message:
wm(4): Print RX packet buffer size.


To generate a diff of this commit:
cvs rdiff -u -r1.793 -r1.794 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.793 src/sys/dev/pci/if_wm.c:1.794
--- src/sys/dev/pci/if_wm.c:1.793	Thu Jan 18 03:16:44 2024
+++ src/sys/dev/pci/if_wm.c	Fri Jan 26 03:23:36 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.793 2024/01/18 03:16:44 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.794 2024/01/26 03:23:36 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.793 2024/01/18 03:16:44 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.794 2024/01/26 03:23:36 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_wm.h"
@@ -2722,6 +2722,10 @@ alloc_retry:
 	/* Reset the chip to a known state. */
 	wm_reset(sc);
 
+	/* sc->sc_pba is set in wm_reset(). */
+	aprint_verbose_dev(sc->sc_dev, "RX packet buffer size: %uKB\n",
+	sc->sc_pba);
+
 	/*
 	 * Check for I21[01] PLL workaround.
 	 *



CVS commit: src/sys/dev/pci

2024-01-25 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Jan 26 03:23:36 UTC 2024

Modified Files:
src/sys/dev/pci: if_wm.c

Log Message:
wm(4): Print RX packet buffer size.


To generate a diff of this commit:
cvs rdiff -u -r1.793 -r1.794 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci/igc

2024-01-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 25 05:48:56 UTC 2024

Modified Files:
src/sys/dev/pci/igc: if_igc.c

Log Message:
igc(4): Count iqdrops.

 TODO: RQDPC should be visible via evcnt(9).


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/igc/if_igc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/igc/if_igc.c
diff -u src/sys/dev/pci/igc/if_igc.c:1.9 src/sys/dev/pci/igc/if_igc.c:1.10
--- src/sys/dev/pci/igc/if_igc.c:1.9	Wed Dec 20 18:09:19 2023
+++ src/sys/dev/pci/igc/if_igc.c	Thu Jan 25 05:48:56 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_igc.c,v 1.9 2023/12/20 18:09:19 skrll Exp $	*/
+/*	$NetBSD: if_igc.c,v 1.10 2024/01/25 05:48:56 msaitoh Exp $	*/
 /*	$OpenBSD: if_igc.c,v 1.13 2023/04/28 10:18:57 bluhm Exp $	*/
 /*-
  * SPDX-License-Identifier: BSD-2-Clause
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_igc.c,v 1.9 2023/12/20 18:09:19 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_igc.c,v 1.10 2024/01/25 05:48:56 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_igc.h"
@@ -1116,11 +1116,35 @@ igc_update_counters(struct igc_softc *sc
 
 	/* Mac statistics */
 	struct igc_hw *hw = >hw;
+	struct ifnet *ifp = >sc_ec.ec_if;
+	uint64_t iqdrops = 0;
 
 	for (int cnt = 0; cnt < IGC_MAC_COUNTERS; cnt++) {
-		IGC_MAC_COUNTER_ADD(sc, cnt, igc_read_mac_counter(hw,
-		igc_mac_counters[cnt].reg, igc_mac_counters[cnt].is64));
+		uint64_t val;
+		bus_size_t regaddr = igc_mac_counters[cnt].reg;
+
+		val = igc_read_mac_counter(hw, regaddr,
+		igc_mac_counters[cnt].is64);
+		IGC_MAC_COUNTER_ADD(sc, cnt, val);
+		/* XXX Count MPC to iqdrops. */
+		if (regaddr == IGC_MPC)
+			iqdrops += val;
 	}
+
+	for (int iq = 0; iq < sc->sc_nqueues; iq++) {
+		uint32_t val;
+
+		/* XXX RQDPC should be visible via evcnt(9). */
+		val = IGC_READ_REG(hw, IGC_RQDPC(iq));
+
+		/* RQDPC is not cleard on read. */
+		if (val != 0)
+			IGC_WRITE_REG(hw, IGC_RQDPC(iq), 0);
+		iqdrops += val;
+	}
+
+	if (iqdrops != 0)
+		if_statadd(ifp, if_iqdrops, iqdrops);
 #endif
 }
 



CVS commit: src/sys/dev/pci/igc

2024-01-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 25 05:48:56 UTC 2024

Modified Files:
src/sys/dev/pci/igc: if_igc.c

Log Message:
igc(4): Count iqdrops.

 TODO: RQDPC should be visible via evcnt(9).


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/igc/if_igc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci/ixgbe

2024-01-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan 24 05:18:59 UTC 2024

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c

Log Message:
ixgbe: Add QPRDC into iqdrops.

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


To generate a diff of this commit:
cvs rdiff -u -r1.348 -r1.349 src/sys/dev/pci/ixgbe/ixgbe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.348 src/sys/dev/pci/ixgbe/ixgbe.c:1.349
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.348	Wed Nov 15 03:50:22 2023
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Wed Jan 24 05:18:59 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.348 2023/11/15 03:50:22 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.349 2024/01/24 05:18:59 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.348 2023/11/15 03:50:22 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.349 2024/01/24 05:18:59 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1637,7 +1637,7 @@ ixgbe_update_stats_counters(struct ixgbe
 	struct ixgbe_hw	  *hw = >hw;
 	struct ixgbe_hw_stats *stats = >stats.pf;
 	u32		  missed_rx = 0, bprc, lxontxc, lxofftxc;
-	u64		  total, total_missed_rx = 0;
+	u64		  total, total_missed_rx = 0, total_qprdc = 0;
 	uint64_t	  crcerrs, illerrc, rlec, ruc, rfc, roc, rjc;
 	unsigned int	  queue_counters;
 	int		  i;
@@ -1656,13 +1656,18 @@ ixgbe_update_stats_counters(struct ixgbe
 		IXGBE_EVC_REGADD(hw, stats, IXGBE_QPRC(i), qprc[i]);
 		IXGBE_EVC_REGADD(hw, stats, IXGBE_QPTC(i), qptc[i]);
 		if (hw->mac.type >= ixgbe_mac_82599EB) {
+			uint32_t qprdc;
+
 			IXGBE_EVC_ADD(>qbrc[i],
 			IXGBE_READ_REG(hw, IXGBE_QBRC_L(i)) +
 			((u64)IXGBE_READ_REG(hw, IXGBE_QBRC_H(i)) << 32));
 			IXGBE_EVC_ADD(>qbtc[i],
 			IXGBE_READ_REG(hw, IXGBE_QBTC_L(i)) +
 			((u64)IXGBE_READ_REG(hw, IXGBE_QBTC_H(i)) << 32));
-			IXGBE_EVC_REGADD(hw, stats, IXGBE_QPRDC(i), qprdc[i]);
+			/* QPRDC will be added to iqdrops. */
+			qprdc = IXGBE_READ_REG(hw, IXGBE_QPRDC(i));
+			IXGBE_EVC_ADD(>qprdc[i], qprdc);
+			total_qprdc += qprdc;
 		} else {
 			/* 82598 */
 			IXGBE_EVC_REGADD(hw, stats, IXGBE_QBRC(i), qbrc[i]);
@@ -1793,7 +1798,7 @@ ixgbe_update_stats_counters(struct ixgbe
 	 * normal RX counters are prepared in ether_input().
 	 */
 	net_stat_ref_t nsr = IF_STAT_GETREF(ifp);
-	if_statadd_ref(nsr, if_iqdrops, total_missed_rx);
+	if_statadd_ref(nsr, if_iqdrops, total_missed_rx + total_qprdc);
 
 	/*
 	 * Aggregate following types of errors as RX errors:



CVS commit: src/sys/dev/pci/ixgbe

2024-01-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan 24 05:18:59 UTC 2024

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c

Log Message:
ixgbe: Add QPRDC into iqdrops.

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


To generate a diff of this commit:
cvs rdiff -u -r1.348 -r1.349 src/sys/dev/pci/ixgbe/ixgbe.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/doc

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 04:08:44 UTC 2024

Modified Files:
src/doc: CHANGES

Log Message:
doc: wm(4): Add some Meteor Lake devices (I219 V20-V21 and LM 20-21)


To generate a diff of this commit:
cvs rdiff -u -r1.3027 -r1.3028 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.3027 src/doc/CHANGES:1.3028
--- src/doc/CHANGES:1.3027	Sat Dec 23 20:49:22 2023
+++ src/doc/CHANGES	Thu Jan 18 04:08:44 2024
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.3027 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.3028 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -246,3 +246,5 @@ Changes from NetBSD 10.0 to NetBSD 11.0:
 	tzdata: Updated to 2023d (via 2023dgtz) [kre 20231223]
 	postfix(1): Import version 3.8.4. [christos 20231223]
 	tzcode: Updated to 2023d. [christos 20231223]
+	wm(4): Add some Meteor Lake devices (I219 V20-V21 and LM 20-21).
+		[msaitoh 20240118]



CVS commit: src/doc

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 04:08:44 UTC 2024

Modified Files:
src/doc: CHANGES

Log Message:
doc: wm(4): Add some Meteor Lake devices (I219 V20-V21 and LM 20-21)


To generate a diff of this commit:
cvs rdiff -u -r1.3027 -r1.3028 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/doc

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 04:02:16 UTC 2024

Modified Files:
src/doc: CHANGES.prev

Log Message:
arm: Add entry for ARM big.LITTLE done by ryo@.


To generate a diff of this commit:
cvs rdiff -u -r1.177 -r1.178 src/doc/CHANGES.prev

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES.prev
diff -u src/doc/CHANGES.prev:1.177 src/doc/CHANGES.prev:1.178
--- src/doc/CHANGES.prev:1.177	Thu Jan 18 03:59:37 2024
+++ src/doc/CHANGES.prev	Thu Jan 18 04:02:16 2024
@@ -1,4 +1,4 @@
-LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.177 $>
+LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.178 $>
 
 
 Changes from 386bsd 0.1 + patchkit 0.2.2 to NetBSD 0.8:
@@ -12440,6 +12440,7 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	mue(4): Add driver for Microchip LAN75xx/LAN78xx (Raspberry Pi 3 B+)
 		from OpenBSD. [rin 20180825]
 	OpenSSH: Imported 7.8. [christos 20180826]
+	arm: Add support multiple cpu clusters(big.LITTLE) [ryo 20180826]
 	rkpmic(4): Add driver for Rockchip RK808 Power Management IC.
 		[jmcneill 20180901]
 	nsd: Import 4.1.24. [christos 20180903]



CVS commit: src/doc

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 04:02:16 UTC 2024

Modified Files:
src/doc: CHANGES.prev

Log Message:
arm: Add entry for ARM big.LITTLE done by ryo@.


To generate a diff of this commit:
cvs rdiff -u -r1.177 -r1.178 src/doc/CHANGES.prev

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/doc

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 03:59:37 UTC 2024

Modified Files:
src/doc: CHANGES.prev

Log Message:
wm(4): It's not for V9 but for V19.


To generate a diff of this commit:
cvs rdiff -u -r1.176 -r1.177 src/doc/CHANGES.prev

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/doc

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 03:59:37 UTC 2024

Modified Files:
src/doc: CHANGES.prev

Log Message:
wm(4): It's not for V9 but for V19.


To generate a diff of this commit:
cvs rdiff -u -r1.176 -r1.177 src/doc/CHANGES.prev

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES.prev
diff -u src/doc/CHANGES.prev:1.176 src/doc/CHANGES.prev:1.177
--- src/doc/CHANGES.prev:1.176	Fri Nov 17 22:46:19 2023
+++ src/doc/CHANGES.prev	Thu Jan 18 03:59:37 2024
@@ -1,4 +1,4 @@
-LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.176 $>
+LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.177 $>
 
 
 Changes from 386bsd 0.1 + patchkit 0.2.2 to NetBSD 0.8:
@@ -13146,7 +13146,7 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		and humidity sensor [brad 20211003]
 	network: Make pktq_rps_hash() pluggable for each interface type.
 		[knakahara 20211011]
-	wm(4): Add Tiger Lake and newer devices (I219V 15-V9 and LM 16-19).
+	wm(4): Add Tiger Lake and newer devices (I219V 15-V19 and LM 16-19).
 		[msaitoh 20211013]
 	sgp40mox(4): Driver for the Sensirion SGP40 MOx gas sensor for air
 		quality [brad 20211014]



CVS commit: src/sys/dev/pci

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 03:47:26 UTC 2024

Modified Files:
src/sys/dev/pci: if_rge.c

Log Message:
rge(4): Print HW revision.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/pci/if_rge.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_rge.c
diff -u src/sys/dev/pci/if_rge.c:1.30 src/sys/dev/pci/if_rge.c:1.31
--- src/sys/dev/pci/if_rge.c:1.30	Thu Dec 21 08:50:22 2023
+++ src/sys/dev/pci/if_rge.c	Thu Jan 18 03:47:26 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_rge.c,v 1.30 2023/12/21 08:50:22 skrll Exp $	*/
+/*	$NetBSD: if_rge.c,v 1.31 2024/01/18 03:47:26 msaitoh Exp $	*/
 /*	$OpenBSD: if_rge.c,v 1.9 2020/12/12 11:48:53 jan Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_rge.c,v 1.30 2023/12/21 08:50:22 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rge.c,v 1.31 2024/01/18 03:47:26 msaitoh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_net_mpsafe.h"
@@ -198,6 +198,7 @@ rge_attach(device_t parent, device_t sel
 	uint8_t eaddr[ETHER_ADDR_LEN];
 	int offset;
 	pcireg_t command;
+	const char *revstr;
 
 	pci_set_powerstate(pa->pa_pc, pa->pa_tag, PCI_PMCSR_STATE_D0);
 
@@ -269,21 +270,26 @@ rge_attach(device_t parent, device_t sel
 	switch (hwrev) {
 	case 0x6080:
 		sc->rge_type = MAC_CFG2;
+		revstr = "Z1";
 		break;
 	case 0x6090:
 		sc->rge_type = MAC_CFG3;
+		revstr = "Z2";
 		break;
 	case 0x6400:
 		sc->rge_type = MAC_CFG4;
+		revstr = "A";
 		break;
 	case 0x6410:
 		sc->rge_type = MAC_CFG5;
+		revstr = "B";
 		break;
 	default:
 		aprint_error(": unknown version 0x%08x\n", hwrev);
 		return;
 	}
 
+	aprint_normal_dev(sc->sc_dev, "HW rev. %s\n", revstr);
 	rge_config_imtype(sc, RGE_IMTYPE_SIM);
 
 	/*



CVS commit: src/sys/dev/pci

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 03:47:26 UTC 2024

Modified Files:
src/sys/dev/pci: if_rge.c

Log Message:
rge(4): Print HW revision.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/pci/if_rge.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/riscv/riscv

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 03:36:24 UTC 2024

Modified Files:
src/sys/arch/riscv/riscv: kobj_machdep.c

Log Message:
s/FALLTHOUGH/FALLTHROUGH/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/riscv/riscv/kobj_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/riscv/riscv/kobj_machdep.c
diff -u src/sys/arch/riscv/riscv/kobj_machdep.c:1.5 src/sys/arch/riscv/riscv/kobj_machdep.c:1.6
--- src/sys/arch/riscv/riscv/kobj_machdep.c:1.5	Sun May  7 12:41:49 2023
+++ src/sys/arch/riscv/riscv/kobj_machdep.c	Thu Jan 18 03:36:24 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: kobj_machdep.c,v 1.5 2023/05/07 12:41:49 skrll Exp $	*/
+/*	$NetBSD: kobj_machdep.c,v 1.6 2024/01/18 03:36:24 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2014,2023 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__RCSID("$NetBSD: kobj_machdep.c,v 1.5 2023/05/07 12:41:49 skrll Exp $");
+__RCSID("$NetBSD: kobj_machdep.c,v 1.6 2024/01/18 03:36:24 msaitoh Exp $");
 
 #include 
 #include 
@@ -168,7 +168,7 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas
 		// XXXNH eh? what's with the symidx test?'
 		if (symidx == 0)
 			break;
-		/* FALLTHOUGH */
+		/* FALLTHROUGH */
 
 	case R_RISCV_CALL_PLT:
 	case R_RISCV_CALL:
@@ -177,7 +177,7 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas
 	case R_RISCV_RVC_JUMP:
 	case R_RISCV_32_PCREL:
 		addend -= (intptr_t)where;		/* A -= P */
-		/* FALLTHOUGH */
+		/* FALLTHROUGH */
 
 #ifdef _LP64
 	case R_RISCV_64:	/* doubleword64 S + A */



CVS commit: src/sys/arch/riscv/riscv

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 03:36:24 UTC 2024

Modified Files:
src/sys/arch/riscv/riscv: kobj_machdep.c

Log Message:
s/FALLTHOUGH/FALLTHROUGH/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/riscv/riscv/kobj_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/cpuctl/arch

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 03:19:27 UTC 2024

Modified Files:
src/usr.sbin/cpuctl/arch: i386.c

Log Message:
Add Meteor Lake and Emerald Rapids.


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/usr.sbin/cpuctl/arch/i386.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/cpuctl/arch/i386.c
diff -u src/usr.sbin/cpuctl/arch/i386.c:1.141 src/usr.sbin/cpuctl/arch/i386.c:1.142
--- src/usr.sbin/cpuctl/arch/i386.c:1.141	Wed Sep 13 06:53:23 2023
+++ src/usr.sbin/cpuctl/arch/i386.c	Thu Jan 18 03:19:26 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386.c,v 1.141 2023/09/13 06:53:23 wiz Exp $	*/
+/*	$NetBSD: i386.c,v 1.142 2024/01/18 03:19:26 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: i386.c,v 1.141 2023/09/13 06:53:23 wiz Exp $");
+__RCSID("$NetBSD: i386.c,v 1.142 2024/01/18 03:19:26 msaitoh Exp $");
 #endif /* not lint */
 
 #include 
@@ -361,10 +361,12 @@ const struct cpu_cpuid_nameclass i386_cp
 [0xa6] = "10th gen Core (Comet Lake)",
 [0xa7] = "11th gen Core (Rocket Lake)",
 [0xa8] = "11th gen Core (Rocket Lake)",
+[0xaa] = "Core Ultra 7 (Meteor Lake)",
 [0xb7] = "13th gen Core (Raptor Lake)",
 [0xba] = "13th gen Core (Raptor Lake)",
 [0xbe] = "Core i3-N3xx N[12]xx Nxx Atom x7xxxE (Alder Lake-N)",
 [0xbf] = "13th gen Core (Raptor Lake)",
+[0xcf] = "5th gen Xeon Scalable (Emerald Rapids)",
 			},
 			"Pentium Pro, II or III",	/* Default */
 			NULL,



CVS commit: src/sys/dev/pci

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 03:16:44 UTC 2024

Modified Files:
src/sys/dev/pci: if_wm.c

Log Message:
Add Intel I219-{LM,V}(20,21) support.


To generate a diff of this commit:
cvs rdiff -u -r1.792 -r1.793 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/cpuctl/arch

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 03:19:27 UTC 2024

Modified Files:
src/usr.sbin/cpuctl/arch: i386.c

Log Message:
Add Meteor Lake and Emerald Rapids.


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/usr.sbin/cpuctl/arch/i386.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 03:16:44 UTC 2024

Modified Files:
src/sys/dev/pci: if_wm.c

Log Message:
Add Intel I219-{LM,V}(20,21) support.


To generate a diff of this commit:
cvs rdiff -u -r1.792 -r1.793 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.792 src/sys/dev/pci/if_wm.c:1.793
--- src/sys/dev/pci/if_wm.c:1.792	Tue Nov 21 23:09:40 2023
+++ src/sys/dev/pci/if_wm.c	Thu Jan 18 03:16:44 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.792 2023/11/21 23:09:40 gutteridge Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.793 2024/01/18 03:16:44 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.792 2023/11/21 23:09:40 gutteridge Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.793 2024/01/18 03:16:44 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_wm.h"
@@ -1752,6 +1752,12 @@ static const struct wm_product {
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM19,
 	  "I219 LM (19) Ethernet Connection",
 	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* MTP */
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM20,
+	  "I219 LM (20) Ethernet Connection",
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* MTP */
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM21,
+	  "I219 LM (21) Ethernet Connection",
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* MTP */
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM22,
 	  "I219 LM (22) Ethernet Connection",
 	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* ADP(RPL) */
@@ -1812,6 +1818,12 @@ static const struct wm_product {
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V19,
 	  "I219 V (19) Ethernet Connection",
 	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* MTP */
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V20,
+	  "I219 V (20) Ethernet Connection",
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* MTP */
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V21,
+	  "I219 V (21) Ethernet Connection",
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* MTP */
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V22,
 	  "I219 V (22) Ethernet Connection",
 	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* ADP(RPL) */



CVS commit: src/sys/dev/pci

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 03:15:54 UTC 2024

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1481 -r1.1482 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1480 -r1.1481 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 03:15:27 UTC 2024

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add Intel I219-{LM,V}(20,21)


To generate a diff of this commit:
cvs rdiff -u -r1.1501 -r1.1502 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1501 src/sys/dev/pci/pcidevs:1.1502
--- src/sys/dev/pci/pcidevs:1.1501	Thu Dec 28 09:43:57 2023
+++ src/sys/dev/pci/pcidevs	Thu Jan 18 03:15:26 2024
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1501 2023/12/28 09:43:57 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1502 2024/01/18 03:15:26 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -6307,6 +6307,10 @@ product INTEL I219_LM18		0x550a	I219-LM 
 product INTEL I219_V18		0x550b	I219-V (18) Ethernet Connection
 product INTEL I219_LM19		0x550c	I219-LM (19) Ethernet Connection
 product INTEL I219_V19		0x550d	I219-V (19) Ethernet Connection
+product INTEL I219_LM20		0x550e	I219-LM (20) Ethernet Connection
+product INTEL I219_V20		0x550f	I219-V (20) Ethernet Connection
+product INTEL I219_LM21		0x5510	I219-LM (21) Ethernet Connection
+product INTEL I219_V21		0x5511	I219-V (21) Ethernet Connection
 product INTEL CORE7G_H_M_D_HOST_DRAM 0x5900 Core 7G (H, Mobile, Dual) Host Bridge, DRAM
 product INTEL CORE7G_PCIE_X16	0x5901	Core 7G PCIe x16
 product INTEL CORE7G_S_GT1	0x5902	HD Graphics 610 (GT1)



CVS commit: src/sys/dev/pci

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 03:15:27 UTC 2024

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add Intel I219-{LM,V}(20,21)


To generate a diff of this commit:
cvs rdiff -u -r1.1501 -r1.1502 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci/ixgbe

2023-12-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Dec 30 06:16:44 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.h

Log Message:
ixgbe: Use #ifdef RSC

 This feature (hardware receive side coalescing) has been disabled all along,
so enclose the code with #ifdef RSC.


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.97 -r1.98 src/sys/dev/pci/ixgbe/ixgbe.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.115 src/sys/dev/pci/ixgbe/ix_txrx.c:1.116
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.115	Fri Dec 29 07:36:47 2023
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Sat Dec 30 06:16:44 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.115 2023/12/29 07:36:47 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.116 2023/12/30 06:16:44 msaitoh Exp $ */
 
 /**
 
@@ -64,13 +64,14 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.115 2023/12/29 07:36:47 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.116 2023/12/30 06:16:44 msaitoh Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
 
 #include "ixgbe.h"
 
+#ifdef RSC
 /*
  * HW RSC control:
  *  this feature only works with
@@ -84,6 +85,7 @@ __KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 
  *  to enable.
  */
 static bool ixgbe_rsc_enable = FALSE;
+#endif
 
 #ifdef IXGBE_FDIR
 /*
@@ -124,8 +126,9 @@ static __inline void ixgbe_rx_input(stru
 static int   ixgbe_dma_malloc(struct ixgbe_softc *, bus_size_t,
   struct ixgbe_dma_alloc *, int);
 static void  ixgbe_dma_free(struct ixgbe_softc *, struct ixgbe_dma_alloc *);
-
+#ifdef RSC
 static void	 ixgbe_setup_hw_rsc(struct rx_ring *);
+#endif
 
 /
  * ixgbe_legacy_start_locked - Transmit entry point
@@ -1258,6 +1261,7 @@ ixgbe_txeof(struct tx_ring *txr)
 	return ((limit > 0) ? false : true);
 } /* ixgbe_txeof */
 
+#ifdef RSC
 /
  * ixgbe_rsc_count
  *
@@ -1334,6 +1338,7 @@ ixgbe_setup_hw_rsc(struct rx_ring *rxr)
 
 	rxr->hw_rsc = TRUE;
 } /* ixgbe_setup_hw_rsc */
+#endif
 
 /
  * ixgbe_refresh_mbufs
@@ -1596,10 +1601,15 @@ ixgbe_setup_receive_ring(struct rx_ring 
 	/*
 	 * Now set up the LRO interface
 	 */
+#ifdef RSC
 	if (ixgbe_rsc_enable)
 		ixgbe_setup_hw_rsc(rxr);
+#endif
 #ifdef LRO
-	else if (ifp->if_capenable & IFCAP_LRO) {
+#ifdef RSC
+	else
+#endif
+	if (ifp->if_capenable & IFCAP_LRO) {
 		device_t dev = sc->dev;
 		int err = tcp_lro_init(lro);
 		if (err) {
@@ -1867,7 +1877,10 @@ ixgbe_rxeof(struct ix_queue *que)
 
 		struct mbuf *sendmp, *mp;
 		struct mbuf *newmp;
-		u32 rsc, ptype;
+#ifdef RSC
+		u32 rsc;
+#endif
+		u32 ptype;
 		u16 len;
 		u16 vtag = 0;
 		booleop;
@@ -1902,7 +1915,9 @@ ixgbe_rxeof(struct ix_queue *que)
 		loopcount++;
 		sendmp = newmp = NULL;
 		nbuf = NULL;
+#ifdef RSC
 		rsc = 0;
+#endif
 		cur->wb.upper.status_error = 0;
 		rbuf = >rx_buffers[i];
 		mp = rbuf->buf;
@@ -1988,6 +2003,7 @@ ixgbe_rxeof(struct ix_queue *que)
 			 * Figure out the next descriptor
 			 * of this frame.
 			 */
+#ifdef RSC
 			if (rxr->hw_rsc == TRUE) {
 rsc = ixgbe_rsc_count(cur);
 rxr->rsc_num += (rsc - 1);
@@ -1995,7 +2011,9 @@ ixgbe_rxeof(struct ix_queue *que)
 			if (rsc) { /* Get hardware index */
 nextp = ((staterr & IXGBE_RXDADV_NEXTP_MASK) >>
 IXGBE_RXDADV_NEXTP_SHIFT);
-			} else { /* Just sequential */
+			} else
+#endif
+			{ /* Just sequential */
 nextp = i + 1;
 if (nextp == sc->num_rx_desc)
 	nextp = 0;

Index: src/sys/dev/pci/ixgbe/ixgbe.h
diff -u src/sys/dev/pci/ixgbe/ixgbe.h:1.97 src/sys/dev/pci/ixgbe/ixgbe.h:1.98
--- src/sys/dev/pci/ixgbe/ixgbe.h:1.97	Sat Dec 30 06:16:03 2023
+++ src/sys/dev/pci/ixgbe/ixgbe.h	Sat Dec 30 06:16:44 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.h,v 1.97 2023/12/30 06:16:03 msaitoh Exp $ */
+/* $NetBSD: ixgbe.h,v 1.98 2023/12/30 06:16:44 msaitoh Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -415,7 +415,9 @@ struct rx_ring {
 	struct lro_ctrl		lro;
 	bool			lro_enabled;
 #endif /* LRO */
+#ifdef RSC
 	bool			hw_rsc;
+#endif
 	bool			vtag_strip;
 	bool			discard_multidesc;
 	u16			next_to_refresh;
@@ -437,7 +439,9 @@ struct rx_ring {
 	struct evcnt		rx_bytes;
 	struct evcnt		rx_discarded;
 	struct evcnt		no_mbuf;
+#ifdef RSC
 	u64			rsc_num;
+#endif
 };
 
 struct ixgbe_vf {



CVS commit: src/sys/dev/pci/ixgbe

2023-12-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Dec 30 06:16:44 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.h

Log Message:
ixgbe: Use #ifdef RSC

 This feature (hardware receive side coalescing) has been disabled all along,
so enclose the code with #ifdef RSC.


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.97 -r1.98 src/sys/dev/pci/ixgbe/ixgbe.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci/ixgbe

2023-12-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Dec 30 06:16:03 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.h

Log Message:
ixgbe: Change "me" from 32bit to 8bit because the max is 128.

 This commit doesn't change the real size of ix_queue, tx_ring and rx_ring
because of the alignment.


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/sys/dev/pci/ixgbe/ixgbe.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.h
diff -u src/sys/dev/pci/ixgbe/ixgbe.h:1.96 src/sys/dev/pci/ixgbe/ixgbe.h:1.97
--- src/sys/dev/pci/ixgbe/ixgbe.h:1.96	Fri Dec 29 07:36:47 2023
+++ src/sys/dev/pci/ixgbe/ixgbe.h	Sat Dec 30 06:16:03 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.h,v 1.96 2023/12/29 07:36:47 msaitoh Exp $ */
+/* $NetBSD: ixgbe.h,v 1.97 2023/12/30 06:16:03 msaitoh Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -325,7 +325,7 @@ struct ix_queue {
 	struct ixgbe_softc *sc;
 	u32  msix;   /* This queue's MSI-X vector */
 	u32  eitr_setting;
-	u32  me;
+	u8   me;
 	struct resource  *res;
 	int  busy;
 	struct tx_ring   *txr;
@@ -357,7 +357,7 @@ struct ix_queue {
 struct tx_ring {
 	struct ixgbe_softc	*sc;
 	kmutex_t		tx_mtx;
-	u32			me;
+	u8			me;
 	u32			tail;
 	int			busy;
 	union ixgbe_adv_tx_desc	*tx_base;
@@ -407,7 +407,7 @@ struct tx_ring {
 struct rx_ring {
 	struct ixgbe_softc	*sc;
 	kmutex_t		rx_mtx;
-	u32			me;
+	u8			me;
 	u32			tail;
 	union ixgbe_adv_rx_desc	*rx_base;
 	struct ixgbe_dma_alloc	rxdma;



CVS commit: src/sys/dev/pci/ixgbe

2023-12-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Dec 30 06:16:03 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.h

Log Message:
ixgbe: Change "me" from 32bit to 8bit because the max is 128.

 This commit doesn't change the real size of ix_queue, tx_ring and rx_ring
because of the alignment.


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/sys/dev/pci/ixgbe/ixgbe.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci/ixgbe

2023-12-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 29 07:36:47 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.h

Log Message:
ixgbe: Use #ifdef LRO more to reduce the size of struct rx_ring.


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.95 -r1.96 src/sys/dev/pci/ixgbe/ixgbe.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.114 src/sys/dev/pci/ixgbe/ix_txrx.c:1.115
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.114	Thu Dec 28 10:13:51 2023
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Fri Dec 29 07:36:47 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.114 2023/12/28 10:13:51 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.115 2023/12/29 07:36:47 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.114 2023/12/28 10:13:51 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.115 2023/12/29 07:36:47 msaitoh Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1577,7 +1577,9 @@ ixgbe_setup_receive_ring(struct rx_ring 
 	/* Setup our descriptor indices */
 	rxr->next_to_check = 0;
 	rxr->next_to_refresh = sc->num_rx_desc - 1; /* Fully allocated */
+#ifdef LRO
 	rxr->lro_enabled = FALSE;
+#endif
 	rxr->discard_multidesc = false;
 	IXGBE_EVC_STORE(>rx_copies, 0);
 #if 0 /* NetBSD */

Index: src/sys/dev/pci/ixgbe/ixgbe.h
diff -u src/sys/dev/pci/ixgbe/ixgbe.h:1.95 src/sys/dev/pci/ixgbe/ixgbe.h:1.96
--- src/sys/dev/pci/ixgbe/ixgbe.h:1.95	Fri Dec 29 07:34:20 2023
+++ src/sys/dev/pci/ixgbe/ixgbe.h	Fri Dec 29 07:36:47 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.h,v 1.95 2023/12/29 07:34:20 msaitoh Exp $ */
+/* $NetBSD: ixgbe.h,v 1.96 2023/12/29 07:36:47 msaitoh Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -413,8 +413,8 @@ struct rx_ring {
 	struct ixgbe_dma_alloc	rxdma;
 #ifdef LRO
 	struct lro_ctrl		lro;
-#endif /* LRO */
 	bool			lro_enabled;
+#endif /* LRO */
 	bool			hw_rsc;
 	bool			vtag_strip;
 	bool			discard_multidesc;



CVS commit: src/sys/dev/pci/ixgbe

2023-12-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 29 07:36:47 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.h

Log Message:
ixgbe: Use #ifdef LRO more to reduce the size of struct rx_ring.


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.95 -r1.96 src/sys/dev/pci/ixgbe/ixgbe.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci/ixgbe

2023-12-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 29 07:34:20 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.h

Log Message:
ixgbe: Remove unused to reduce the size of struct rx_ring.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/dev/pci/ixgbe/ixgbe.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.h
diff -u src/sys/dev/pci/ixgbe/ixgbe.h:1.94 src/sys/dev/pci/ixgbe/ixgbe.h:1.95
--- src/sys/dev/pci/ixgbe/ixgbe.h:1.94	Thu Dec 28 10:02:14 2023
+++ src/sys/dev/pci/ixgbe/ixgbe.h	Fri Dec 29 07:34:20 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.h,v 1.94 2023/12/28 10:02:14 msaitoh Exp $ */
+/* $NetBSD: ixgbe.h,v 1.95 2023/12/29 07:34:20 msaitoh Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -438,9 +438,6 @@ struct rx_ring {
 	struct evcnt		rx_discarded;
 	struct evcnt		no_mbuf;
 	u64			rsc_num;
-
-	/* Flow Director */
-	u64			flm;
 };
 
 struct ixgbe_vf {



CVS commit: src/sys/dev/pci/ixgbe

2023-12-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 29 07:34:20 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.h

Log Message:
ixgbe: Remove unused to reduce the size of struct rx_ring.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/dev/pci/ixgbe/ixgbe.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci/ixgbe

2023-12-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec 28 10:13:51 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
ixgbe: Use kmem_zalloc() instead of malloc(,M_ZERO).


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/dev/pci/ixgbe/ix_txrx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.113 src/sys/dev/pci/ixgbe/ix_txrx.c:1.114
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.113	Thu Dec 28 10:05:18 2023
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Thu Dec 28 10:13:51 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.113 2023/12/28 10:05:18 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.114 2023/12/28 10:13:51 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.113 2023/12/28 10:05:18 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.114 2023/12/28 10:13:51 msaitoh Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -626,8 +626,8 @@ ixgbe_allocate_transmit_buffers(struct t
 		goto fail;
 	}
 
-	txr->tx_buffers = malloc(sizeof(struct ixgbe_tx_buf) *
-	sc->num_tx_desc, M_DEVBUF, M_WAITOK | M_ZERO);
+	txr->tx_buffers = kmem_zalloc(sizeof(struct ixgbe_tx_buf) *
+	sc->num_tx_desc, KM_SLEEP);
 
 	/* Create the descriptor buffer dma maps */
 	txbuf = txr->tx_buffers;
@@ -758,7 +758,7 @@ ixgbe_free_transmit_structures(struct ix
 		ixgbe_dma_free(sc, >txdma);
 		IXGBE_TX_LOCK_DESTROY(txr);
 	}
-	free(sc->tx_rings, M_DEVBUF);
+	kmem_free(sc->tx_rings, sizeof(struct tx_ring) * sc->num_queues);
 } /* ixgbe_free_transmit_structures */
 
 /
@@ -806,7 +806,8 @@ ixgbe_free_transmit_buffers(struct tx_ri
 		pcq_destroy(txr->txr_interq);
 	}
 	if (txr->tx_buffers != NULL) {
-		free(txr->tx_buffers, M_DEVBUF);
+		kmem_free(txr->tx_buffers,
+		sizeof(struct ixgbe_tx_buf) * sc->num_tx_desc);
 		txr->tx_buffers = NULL;
 	}
 	if (txr->txtag != NULL) {
@@ -1427,7 +1428,7 @@ ixgbe_allocate_receive_buffers(struct rx
 	int bsize, error;
 
 	bsize = sizeof(struct ixgbe_rx_buf) * rxr->num_desc;
-	rxr->rx_buffers = malloc(bsize, M_DEVBUF, M_WAITOK | M_ZERO);
+	rxr->rx_buffers = kmem_zalloc(bsize, KM_SLEEP);
 
 	error = ixgbe_dma_tag_create(
 	 /*  parent */ sc->osdep.dmat,
@@ -1673,7 +1674,7 @@ ixgbe_free_receive_structures(struct ixg
 		IXGBE_RX_LOCK_DESTROY(rxr);
 	}
 
-	free(sc->rx_rings, M_DEVBUF);
+	kmem_free(sc->rx_rings, sizeof(struct rx_ring) * sc->num_queues);
 } /* ixgbe_free_receive_structures */
 
 
@@ -1700,7 +1701,8 @@ ixgbe_free_receive_buffers(struct rx_rin
 		}
 
 		if (rxr->rx_buffers != NULL) {
-			free(rxr->rx_buffers, M_DEVBUF);
+			kmem_free(rxr->rx_buffers,
+			sizeof(struct ixgbe_rx_buf) * rxr->num_desc);
 			rxr->rx_buffers = NULL;
 		}
 	}
@@ -2341,16 +2343,16 @@ ixgbe_allocate_queues(struct ixgbe_softc
 	int txconf = 0, rxconf = 0;
 
 	/* First, allocate the top level queue structs */
-	sc->queues = (struct ix_queue *)malloc(sizeof(struct ix_queue) *
-	sc->num_queues, M_DEVBUF, M_WAITOK | M_ZERO);
+	sc->queues = kmem_zalloc(sizeof(struct ix_queue) * sc->num_queues,
+	KM_SLEEP);
 
 	/* Second, allocate the TX ring struct memory */
-	sc->tx_rings = malloc(sizeof(struct tx_ring) *
-	sc->num_queues, M_DEVBUF, M_WAITOK | M_ZERO);
+	sc->tx_rings = kmem_zalloc(sizeof(struct tx_ring) * sc->num_queues,
+	KM_SLEEP);
 
 	/* Third, allocate the RX ring */
-	sc->rx_rings = (struct rx_ring *)malloc(sizeof(struct rx_ring) *
-	sc->num_queues, M_DEVBUF, M_WAITOK | M_ZERO);
+	sc->rx_rings = kmem_zalloc(sizeof(struct rx_ring) * sc->num_queues,
+	KM_SLEEP);
 
 	/* For the ring itself */
 	tsize = sc->num_tx_desc * sizeof(union ixgbe_adv_tx_desc);
@@ -2469,9 +2471,9 @@ err_rx_desc:
 err_tx_desc:
 	for (txr = sc->tx_rings; txconf > 0; txr++, txconf--)
 		ixgbe_dma_free(sc, >txdma);
-	free(sc->rx_rings, M_DEVBUF);
-	free(sc->tx_rings, M_DEVBUF);
-	free(sc->queues, M_DEVBUF);
+	kmem_free(sc->rx_rings, sizeof(struct rx_ring) * sc->num_queues);
+	kmem_free(sc->tx_rings, sizeof(struct tx_ring) * sc->num_queues);
+	kmem_free(sc->queues, sizeof(struct ix_queue) * sc->num_queues);
 	return (error);
 } /* ixgbe_allocate_queues */
 
@@ -2493,5 +2495,5 @@ ixgbe_free_queues(struct ixgbe_softc *sc
 		que = >queues[i];
 		mutex_destroy(>dc_mtx);
 	}
-	free(sc->queues, M_DEVBUF);
+	kmem_free(sc->queues, sizeof(struct ix_queue) * sc->num_queues);
 } /* ixgbe_free_queues */



CVS commit: src/sys/dev/pci/ixgbe

2023-12-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec 28 10:13:51 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
ixgbe: Use kmem_zalloc() instead of malloc(,M_ZERO).


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/dev/pci/ixgbe/ix_txrx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci/ixgbe

2023-12-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec 28 10:05:18 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
ixgbe: Simplify. No functional change.

 The descriptor ring size and the alignment are tested in the attach
function, so it's not required to use roundup2(size, DBA_ALIGN).


To generate a diff of this commit:
cvs rdiff -u -r1.112 -r1.113 src/sys/dev/pci/ixgbe/ix_txrx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.112 src/sys/dev/pci/ixgbe/ix_txrx.c:1.113
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.112	Thu Dec 28 10:02:14 2023
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Thu Dec 28 10:05:18 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.112 2023/12/28 10:02:14 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.113 2023/12/28 10:05:18 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.112 2023/12/28 10:02:14 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.113 2023/12/28 10:05:18 msaitoh Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1505,8 +1505,8 @@ ixgbe_setup_receive_ring(struct rx_ring 
 		slot = netmap_reset(na, NR_RX, rxr->me, 0);
 #endif /* DEV_NETMAP */
 
-	rsize = roundup2(sc->num_rx_desc *
-	sizeof(union ixgbe_adv_rx_desc), DBA_ALIGN);
+	rsize = sc->num_rx_desc * sizeof(union ixgbe_adv_rx_desc);
+	KASSERT((rsize % DBA_ALIGN) == 0);
 	bzero((void *)rxr->rx_base, rsize);
 	/* Cache the size */
 	rxr->mbuf_sz = sc->rx_mbuf_sz;
@@ -2353,8 +2353,8 @@ ixgbe_allocate_queues(struct ixgbe_softc
 	sc->num_queues, M_DEVBUF, M_WAITOK | M_ZERO);
 
 	/* For the ring itself */
-	tsize = roundup2(sc->num_tx_desc * sizeof(union ixgbe_adv_tx_desc),
-	DBA_ALIGN);
+	tsize = sc->num_tx_desc * sizeof(union ixgbe_adv_tx_desc);
+	KASSERT((tsize % DBA_ALIGN) == 0);
 
 	/*
 	 * Now set up the TX queues, txconf is needed to handle the
@@ -2410,8 +2410,8 @@ ixgbe_allocate_queues(struct ixgbe_softc
 	/*
 	 * Next the RX queues...
 	 */
-	rsize = roundup2(sc->num_rx_desc * sizeof(union ixgbe_adv_rx_desc),
-	DBA_ALIGN);
+	rsize = sc->num_rx_desc * sizeof(union ixgbe_adv_rx_desc);
+	KASSERT((rsize % DBA_ALIGN) == 0);
 	for (int i = 0; i < sc->num_queues; i++, rxconf++) {
 		rxr = >rx_rings[i];
 		/* Set up some basics */



CVS commit: src/sys/dev/pci/ixgbe

2023-12-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec 28 10:05:18 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
ixgbe: Simplify. No functional change.

 The descriptor ring size and the alignment are tested in the attach
function, so it's not required to use roundup2(size, DBA_ALIGN).


To generate a diff of this commit:
cvs rdiff -u -r1.112 -r1.113 src/sys/dev/pci/ixgbe/ix_txrx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci/ixgbe

2023-12-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec 28 10:02:14 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.h

Log Message:
ixgbe: Use #ifdef IXGBE_FDIR more

 Don't include the Flow Director related members to reduce the size of
struct tx_ring. On amd64 and aarch64, the real size is not changed
because of the alignment.


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.93 -r1.94 src/sys/dev/pci/ixgbe/ixgbe.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.111 src/sys/dev/pci/ixgbe/ix_txrx.c:1.112
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.111	Wed Dec 13 08:25:54 2023
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Thu Dec 28 10:02:14 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.111 2023/12/13 08:25:54 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.112 2023/12/28 10:02:14 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.111 2023/12/13 08:25:54 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.112 2023/12/28 10:02:14 msaitoh Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -85,6 +85,7 @@ __KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 
  */
 static bool ixgbe_rsc_enable = FALSE;
 
+#ifdef IXGBE_FDIR
 /*
  * For Flow Director: this is the
  * number of TX packets we sample
@@ -95,6 +96,7 @@ static bool ixgbe_rsc_enable = FALSE;
  * setting this to 0.
  */
 static int atr_sample_rate = 20;
+#endif
 
 #define IXGBE_M_ADJ(sc, rxr, mp)	\
 	if (sc->max_frame_size <= (rxr->mbuf_sz - ETHER_ALIGN))	\
@@ -715,9 +717,11 @@ ixgbe_setup_transmit_ring(struct tx_ring
 		txbuf->eop = NULL;
 	}
 
+#ifdef IXGBE_FDIR
 	/* Set the rate at which we sample packets */
 	if (sc->feat_en & IXGBE_FEATURE_FDIR)
 		txr->atr_sample = atr_sample_rate;
+#endif
 
 	/* Set number of descriptors available */
 	txr->tx_avail = sc->num_tx_desc;

Index: src/sys/dev/pci/ixgbe/ixgbe.h
diff -u src/sys/dev/pci/ixgbe/ixgbe.h:1.93 src/sys/dev/pci/ixgbe/ixgbe.h:1.94
--- src/sys/dev/pci/ixgbe/ixgbe.h:1.93	Thu Oct 12 08:06:13 2023
+++ src/sys/dev/pci/ixgbe/ixgbe.h	Thu Dec 28 10:02:14 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.h,v 1.93 2023/10/12 08:06:13 msaitoh Exp $ */
+/* $NetBSD: ixgbe.h,v 1.94 2023/12/28 10:02:14 msaitoh Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -376,9 +376,11 @@ struct tx_ring {
 	void			*txr_si;
 	bool			txr_no_space; /* Like IFF_OACTIVE */
 
+#ifdef IXGBE_FDIR
 	/* Flow Director */
 	u16			atr_sample;
 	u16			atr_count;
+#endif
 
 	u64			bytes;  /* Used for AIM */
 	u64			packets;



CVS commit: src/sys/dev/pci/ixgbe

2023-12-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec 28 10:02:14 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.h

Log Message:
ixgbe: Use #ifdef IXGBE_FDIR more

 Don't include the Flow Director related members to reduce the size of
struct tx_ring. On amd64 and aarch64, the real size is not changed
because of the alignment.


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.93 -r1.94 src/sys/dev/pci/ixgbe/ixgbe.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-12-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec 28 09:46:13 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
pcidevs: Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1480 -r1.1481 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1479 -r1.1480 src/sys/dev/pci/pcidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-12-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec 28 09:43:58 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Update Intel Raptor Lake devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1500 -r1.1501 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci

2023-12-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec 28 09:43:58 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Update Intel Raptor Lake devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1500 -r1.1501 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1500 src/sys/dev/pci/pcidevs:1.1501
--- src/sys/dev/pci/pcidevs:1.1500	Thu Dec 28 09:42:39 2023
+++ src/sys/dev/pci/pcidevs	Thu Dec 28 09:43:57 2023
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1500 2023/12/28 09:42:39 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1501 2023/12/28 09:43:57 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -5963,7 +5963,7 @@ product INTEL ADL_U15_2_4_HOST	0x4609	Al
 product INTEL ADL_U9_2_4_HOST	0x460a	Alder Lake (U9,2+4) Host
 product INTEL ADL_PCIE_RP_0	0x460d	Alder Lake PCIe G5 Root Port 0 (x16)
 product INTEL ADL_XDCI		0x460e	Alder Lake USB-C Device (xDCI)
-product INTEL ADL_S_2_0_HOST	0x4610	Alder Lake (S,2+0) Host
+product INTEL ADL_S_2_0_HOST	0x4610	Alder Lake Refresh (S,2+0) Host
 product INTEL ADL_N_8_HOST	0x4617	Alder Lake-N (0+8) Host
 product INTEL ADL_U15_1_4_HOST	0x4619	Alder Lake (U15,1+4) Host
 product INTEL ADL_U9_1_4_HOST	0x461a	Alder Lake (U9,1+4) Host
@@ -5985,7 +5985,9 @@ product INTEL ADL_HX_6_8_HOST	0x463b	Ald
 product INTEL ADL_PCIE_RP_3	0x463d	Alder Lake PCIe G4 Root Port 3 (x4)
 product INTEL ADL_TBTDMA_0	0x463e	Alder Lake Thunderbolt DMA 0
 product INTEL ADL_TBT_PCIE_1	0x463f	Alder Lake Thunderbolt PCIe 1
+product INTEL RPL_S_6_8_HOST_2	0x4640	Raptor Lake (S,6+8) Host
 product INTEL ADL_H_6_8_HOST	0x4641	Alder Lake (H,6+8) Host
+product INTEL RPL_HX_6_4_HOST_2	0x4647	Raptor Lake (HX,6+4) Host
 product INTEL ADL_S_6_4_HOST	0x4648	Alder Lake (S,6+4) Host
 product INTEL ADL_H_6_4_HOST	0x4649	Alder Lake (H,6+4) Host
 product INTEL ADL_PCIE_RP_2	0x464d	Alder Lake PCIe G4 Root Port 2 (x4)
@@ -7436,7 +7438,12 @@ product INTEL RPL_S_6_4_HOST	0xa705	Rapt
 product INTEL RPL_H_6_8_HOST	0xa706	Raptor Lake (H,6+8) Host
 product INTEL RPL_H_4_8_HOST	0xa707	Raptor Lake (H,4+8) Host
 product INTEL RPL_U_2_8_HOST	0xa708	Raptor Lake (U,2+8) Host
+product INTEL RPL_PX_6_8_HOST	0xa709	Raptor Lake (PX,6+8) Host
+product INTEL RPL_PX_4_8_HOST	0xa70a	Raptor Lake (PX,4+8) Host
 product INTEL RPL_PCIE_RP_0	0xa70d	Raptor Lake PCIe G5 Root Port 0 (x16)
+product INTEL RPL_E_8_0_HOST	0xa711	Raptor Lake (E,8+0) Host
+product INTEL RPL_E_6_0_HOST	0xa712	Raptor Lake (E,6+0) Host
+product INTEL RPL_E_4_0_HOST	0xa713	Raptor Lake (E,4+0) Host
 product INTEL RPL_H_4_4_HOST	0xa716	Raptor Lake (H,4+4) Host
 product INTEL RPL_HX_6_4_HOST	0xa719	Raptor Lake (HX,6+4) Host
 product INTEL RPL_U_2_4_HOST	0xa71b	Raptor Lake (U,2+4) Host
@@ -7448,6 +7455,7 @@ product INTEL RPL_HX_8_12_HOST	0xa729	Ra
 product INTEL RPL_HX_6_8_HOST	0xa72a	Raptor Lake (HX,6+8) Host
 product INTEL RPL_PCIE_RP_1	0xa72d	Raptor Lake PCIe G5 Root Port 1 (x8)
 product INTEL RPL_TBTDMA_0	0xa73e	Raptor Lake Thunderbolt DMA 0
+product INTEL RPL_S_8_12_HOST	0xa740	Raptor Lake Refresh (S,8+12) Host
 product INTEL RPL_PCIE_RP_2	0xa74d	Raptor Lake PCIe G4 Root Port 2 (x4)
 product INTEL RPL_GNA		0xa74f	Raptor Lake Gauss Newton Algorithm
 product INTEL RPL_TBTDMA_1	0xa76d	Raptor Lake Thunderbolt DMA 1



CVS commit: src/sys/dev/pci

2023-12-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec 28 09:42:40 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add Intel C26[26] eSPI.


To generate a diff of this commit:
cvs rdiff -u -r1.1499 -r1.1500 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1499 src/sys/dev/pci/pcidevs:1.1500
--- src/sys/dev/pci/pcidevs:1.1499	Mon Nov 13 08:07:24 2023
+++ src/sys/dev/pci/pcidevs	Thu Dec 28 09:42:39 2023
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1499 2023/11/13 08:07:24 jnemeth Exp $
+$NetBSD: pcidevs,v 1.1500 2023/12/28 09:42:39 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -6508,6 +6508,8 @@ product INTEL I740		0x7800	i740 Graphics
 product INTEL 7HS_Z790_ESPI	0x7a04	Z790 eSPI
 product INTEL 7HS_H770_ESPI	0x7a05	H770 eSPI
 product INTEL 7HS_B760_ESPI	0x7a06	B760 eSPI
+product INTEL 7HS_C266_ESPI	0x7a13	C266 eSPI
+product INTEL 7HS_C262_ESPI	0x7a14	C262 eSPI
 product INTEL 7HS_P2SB		0x7a20	700 Series PCH P2SB
 product INTEL 7HS_PMC		0x7a21	700 Series PCH PMC
 product INTEL 7HS_SMB		0x7a23	700 Series PCH SMBus



CVS commit: src/sys/dev/pci

2023-12-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec 28 09:42:40 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add Intel C26[26] eSPI.


To generate a diff of this commit:
cvs rdiff -u -r1.1499 -r1.1500 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci/ixgbe

2023-12-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 13 08:25:54 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
ixgbe: micro-optimize ixgbe_txeof()

 Update txr->packets outside the loop in ixgbe_txeof().


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/sys/dev/pci/ixgbe/ix_txrx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.110 src/sys/dev/pci/ixgbe/ix_txrx.c:1.111
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.110	Fri Dec  8 05:42:59 2023
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Wed Dec 13 08:25:54 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.110 2023/12/08 05:42:59 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.111 2023/12/13 08:25:54 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.110 2023/12/08 05:42:59 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.111 2023/12/13 08:25:54 msaitoh Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1203,7 +1203,6 @@ ixgbe_txeof(struct tx_ring *txr)
 			buf->eop = NULL;
 
 		}
-		++txr->packets;
 		++processed;
 
 		/* Try the next packet */
@@ -1227,6 +1226,7 @@ ixgbe_txeof(struct tx_ring *txr)
 	if (processed) {
 		txr->tx_avail = avail;
 		txr->txr_no_space = false;
+		txr->packets += processed;
 		if_statadd(ifp, if_opackets, processed);
 	}
 



CVS commit: src/sys/dev/pci/ixgbe

2023-12-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 13 08:25:54 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
ixgbe: micro-optimize ixgbe_txeof()

 Update txr->packets outside the loop in ixgbe_txeof().


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/sys/dev/pci/ixgbe/ix_txrx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci/ixgbe

2023-12-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec  8 05:42:59 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
ixgbe: Update if_opackets outside the loop in ixgbe_txeof().


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/sys/dev/pci/ixgbe/ix_txrx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.109 src/sys/dev/pci/ixgbe/ix_txrx.c:1.110
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.109	Fri Dec  8 05:39:27 2023
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Fri Dec  8 05:42:59 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.109 2023/12/08 05:39:27 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.110 2023/12/08 05:42:59 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.109 2023/12/08 05:39:27 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.110 2023/12/08 05:42:59 msaitoh Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1205,7 +1205,6 @@ ixgbe_txeof(struct tx_ring *txr)
 		}
 		++txr->packets;
 		++processed;
-		if_statinc(ifp, if_opackets);
 
 		/* Try the next packet */
 		++txd;
@@ -1228,6 +1227,7 @@ ixgbe_txeof(struct tx_ring *txr)
 	if (processed) {
 		txr->tx_avail = avail;
 		txr->txr_no_space = false;
+		if_statadd(ifp, if_opackets, processed);
 	}
 
 	/*



CVS commit: src/sys/dev/pci/ixgbe

2023-12-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec  8 05:42:59 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
ixgbe: Update if_opackets outside the loop in ixgbe_txeof().


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/sys/dev/pci/ixgbe/ix_txrx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci/ixgbe

2023-12-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec  8 05:39:27 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
ixgbe: micro-optimize ixgbe_txeof()

 Update txr->tx_avail and txr->txr_no_space outside the loop in ixgbe_txeof().


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sys/dev/pci/ixgbe/ix_txrx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci/ixgbe

2023-12-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec  8 05:39:27 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
ixgbe: micro-optimize ixgbe_txeof()

 Update txr->tx_avail and txr->txr_no_space outside the loop in ixgbe_txeof().


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sys/dev/pci/ixgbe/ix_txrx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.108 src/sys/dev/pci/ixgbe/ix_txrx.c:1.109
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.108	Thu Nov 16 05:39:08 2023
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Fri Dec  8 05:39:27 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.108 2023/11/16 05:39:08 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.109 2023/12/08 05:39:27 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.108 2023/11/16 05:39:08 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.109 2023/12/08 05:39:27 msaitoh Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1108,6 +1108,7 @@ ixgbe_txeof(struct tx_ring *txr)
 	union ixgbe_adv_tx_desc *txd;
 	u32			work, processed = 0;
 	u32			limit = sc->tx_process_limit;
+	u16			avail;
 
 	KASSERT(mutex_owned(>tx_mtx));
 
@@ -1151,6 +1152,7 @@ ixgbe_txeof(struct tx_ring *txr)
 	buf = >tx_buffers[work];
 	txd = >tx_base[work];
 	work -= txr->num_desc; /* The distance to ring end */
+	avail = txr->tx_avail;
 	ixgbe_dmamap_sync(txr->txdma.dma_tag, txr->txdma.dma_map,
 	BUS_DMASYNC_POSTREAD);
 
@@ -1172,8 +1174,7 @@ ixgbe_txeof(struct tx_ring *txr)
 			buf->m_head = NULL;
 		}
 		buf->eop = NULL;
-		txr->txr_no_space = false;
-		++txr->tx_avail;
+		++avail;
 
 		/* We clean the range if multi segment */
 		while (txd != eop) {
@@ -1198,7 +1199,7 @@ ixgbe_txeof(struct tx_ring *txr)
 m_freem(buf->m_head);
 buf->m_head = NULL;
 			}
-			++txr->tx_avail;
+			++avail;
 			buf->eop = NULL;
 
 		}
@@ -1224,6 +1225,10 @@ ixgbe_txeof(struct tx_ring *txr)
 
 	work += txr->num_desc;
 	txr->next_to_clean = work;
+	if (processed) {
+		txr->tx_avail = avail;
+		txr->txr_no_space = false;
+	}
 
 	/*
 	 * Queue Hang detection, we know there's



CVS commit: src/sys/dev/pci/ixgbe

2023-11-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 16 05:39:08 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
ixgbe: Modify for the readability. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/dev/pci/ixgbe/ix_txrx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.107 src/sys/dev/pci/ixgbe/ix_txrx.c:1.108
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.107	Tue Nov 14 03:03:18 2023
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Thu Nov 16 05:39:08 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.107 2023/11/14 03:03:18 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.108 2023/11/16 05:39:08 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.107 2023/11/14 03:03:18 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.108 2023/11/16 05:39:08 msaitoh Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1506,10 +1506,10 @@ ixgbe_setup_receive_ring(struct rx_ring 
 	ixgbe_free_receive_ring(rxr);
 
 	/* Now replenish the mbufs */
-	for (int j = 0; j != rxr->num_desc; ++j) {
+	for (int i = 0; i < rxr->num_desc; i++) {
 		struct mbuf *mp;
 
-		rxbuf = >rx_buffers[j];
+		rxbuf = >rx_buffers[i];
 
 #ifdef DEV_NETMAP
 		/*
@@ -1520,14 +1520,14 @@ ixgbe_setup_receive_ring(struct rx_ring 
 		 * an mbuf, so end the block with a continue;
 		 */
 		if ((sc->feat_en & IXGBE_FEATURE_NETMAP) && slot) {
-			int sj = netmap_idx_n2k(na->rx_rings[rxr->me], j);
+			int sj = netmap_idx_n2k(na->rx_rings[rxr->me], i);
 			uint64_t paddr;
 			void *addr;
 
 			addr = PNMB(na, slot + sj, );
 			netmap_load_map(na, rxr->ptag, rxbuf->pmap, addr);
 			/* Update descriptor and the cached value */
-			rxr->rx_base[j].read.pkt_addr = htole64(paddr);
+			rxr->rx_base[i].read.pkt_addr = htole64(paddr);
 			rxbuf->addr = htole64(paddr);
 			continue;
 		}
@@ -1559,7 +1559,7 @@ ixgbe_setup_receive_ring(struct rx_ring 
 		bus_dmamap_sync(rxr->ptag->dt_dmat, rxbuf->pmap,
 		0, mp->m_pkthdr.len, BUS_DMASYNC_PREREAD);
 		/* Update the descriptor and the cached value */
-		rxr->rx_base[j].read.pkt_addr =
+		rxr->rx_base[i].read.pkt_addr =
 		htole64(rxbuf->pmap->dm_segs[0].ds_addr);
 		rxbuf->addr = htole64(rxbuf->pmap->dm_segs[0].ds_addr);
 	}



CVS commit: src/sys/dev/pci/ixgbe

2023-11-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 16 05:39:08 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
ixgbe: Modify for the readability. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/dev/pci/ixgbe/ix_txrx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci/ixgbe

2023-11-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 15 03:50:22 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe_type.h ixv.c

Log Message:
ixgbe: Clear the WTHRESH bit field before writing it.


To generate a diff of this commit:
cvs rdiff -u -r1.347 -r1.348 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.195 -r1.196 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.347 src/sys/dev/pci/ixgbe/ixgbe.c:1.348
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.347	Thu Nov  2 09:40:47 2023
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Wed Nov 15 03:50:22 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.347 2023/11/02 09:40:47 yamaguchi Exp $ */
+/* $NetBSD: ixgbe.c,v 1.348 2023/11/15 03:50:22 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.347 2023/11/02 09:40:47 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.348 2023/11/15 03:50:22 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -4157,6 +4157,7 @@ ixgbe_init_locked(struct ixgbe_softc *sc
 		txdctl = IXGBE_READ_REG(hw, IXGBE_TXDCTL(txr->me));
 		txdctl |= IXGBE_TXDCTL_ENABLE;
 		/* Set WTHRESH to 8, burst writeback */
+		txdctl &= ~IXGBE_TXDCTL_WTHRESH_MASK;
 		txdctl |= IXGBE_TX_WTHRESH << IXGBE_TXDCTL_WTHRESH_SHIFT;
 		/*
 		 * When the internal queue falls below PTHRESH (32),

Index: src/sys/dev/pci/ixgbe/ixgbe_type.h
diff -u src/sys/dev/pci/ixgbe/ixgbe_type.h:1.61 src/sys/dev/pci/ixgbe/ixgbe_type.h:1.62
--- src/sys/dev/pci/ixgbe/ixgbe_type.h:1.61	Wed Oct 11 09:43:17 2023
+++ src/sys/dev/pci/ixgbe/ixgbe_type.h	Wed Nov 15 03:50:22 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_type.h,v 1.61 2023/10/11 09:43:17 msaitoh Exp $ */
+/* $NetBSD: ixgbe_type.h,v 1.62 2023/11/15 03:50:22 msaitoh Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -2625,6 +2625,7 @@ enum {
 /* Transmit Config masks */
 #define IXGBE_TXDCTL_ENABLE		0x0200 /* Ena specific Tx Queue */
 #define IXGBE_TXDCTL_SWFLSH		0x0400 /* Tx Desc. wr-bk flushing */
+#define IXGBE_TXDCTL_WTHRESH_MASK	0x007f
 #define IXGBE_TXDCTL_WTHRESH_SHIFT	16 /* shift to WTHRESH bits */
 /* Enable short packet padding to 64 bytes */
 #define IXGBE_TX_PAD_ENABLE		0x0400

Index: src/sys/dev/pci/ixgbe/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.195 src/sys/dev/pci/ixgbe/ixv.c:1.196
--- src/sys/dev/pci/ixgbe/ixv.c:1.195	Wed Nov 15 02:43:38 2023
+++ src/sys/dev/pci/ixgbe/ixv.c	Wed Nov 15 03:50:22 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixv.c,v 1.195 2023/11/15 02:43:38 msaitoh Exp $ */
+/* $NetBSD: ixv.c,v 1.196 2023/11/15 03:50:22 msaitoh Exp $ */
 
 /**
 
@@ -35,7 +35,7 @@
 /*$FreeBSD: head/sys/dev/ixgbe/if_ixv.c 331224 2018-03-19 20:55:05Z erj $*/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixv.c,v 1.195 2023/11/15 02:43:38 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixv.c,v 1.196 2023/11/15 03:50:22 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1748,6 +1748,7 @@ ixv_initialize_transmit_units(struct ixg
 
 		/* Set WTHRESH to 8, burst writeback */
 		txdctl = IXGBE_READ_REG(hw, IXGBE_VFTXDCTL(j));
+		txdctl &= ~IXGBE_TXDCTL_WTHRESH_MASK;
 		txdctl |= IXGBE_TX_WTHRESH << IXGBE_TXDCTL_WTHRESH_SHIFT;
 		IXGBE_WRITE_REG(hw, IXGBE_VFTXDCTL(j), txdctl);
 



CVS commit: src/sys/dev/pci/ixgbe

2023-11-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 15 03:50:22 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe_type.h ixv.c

Log Message:
ixgbe: Clear the WTHRESH bit field before writing it.


To generate a diff of this commit:
cvs rdiff -u -r1.347 -r1.348 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.195 -r1.196 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci/ixgbe

2023-11-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 15 02:43:38 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ixv.c

Log Message:
ixv(4): Remove unused IFF_OACTIVE. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.194 -r1.195 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.194 src/sys/dev/pci/ixgbe/ixv.c:1.195
--- src/sys/dev/pci/ixgbe/ixv.c:1.194	Thu Nov  2 09:40:47 2023
+++ src/sys/dev/pci/ixgbe/ixv.c	Wed Nov 15 02:43:38 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixv.c,v 1.194 2023/11/02 09:40:47 yamaguchi Exp $ */
+/* $NetBSD: ixv.c,v 1.195 2023/11/15 02:43:38 msaitoh Exp $ */
 
 /**
 
@@ -35,7 +35,7 @@
 /*$FreeBSD: head/sys/dev/ixgbe/if_ixv.c 331224 2018-03-19 20:55:05Z erj $*/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixv.c,v 1.194 2023/11/02 09:40:47 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixv.c,v 1.195 2023/11/15 02:43:38 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -830,7 +830,6 @@ ixv_init_locked(struct ixgbe_softc *sc)
 
 	/* Inform the stack we're ready */
 	ifp->if_flags |= IFF_RUNNING;
-	ifp->if_flags &= ~IFF_OACTIVE;
 
 	/* And now turn on interrupts */
 	ixv_enable_intr(sc);
@@ -1495,7 +1494,7 @@ ixv_stop_locked(void *arg)
 	ixv_disable_intr(sc);
 
 	/* Tell the stack that the interface is no longer active */
-	ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+	ifp->if_flags &= ~IFF_RUNNING;
 
 	hw->mac.ops.reset_hw(hw);
 	sc->hw.adapter_stopped = FALSE;



CVS commit: src/sys/dev/pci/ixgbe

2023-11-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 15 02:43:38 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ixv.c

Log Message:
ixv(4): Remove unused IFF_OACTIVE. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.194 -r1.195 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci/ixgbe

2023-11-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 14 03:03:18 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
ixgbe(4): Modify comment. No functional change.

 ixgbe_tx_ctx_setup() may or may not consume one TX descriptor.


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/sys/dev/pci/ixgbe/ix_txrx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.106 src/sys/dev/pci/ixgbe/ix_txrx.c:1.107
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.106	Tue Nov 14 02:31:46 2023
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Tue Nov 14 03:03:18 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.106 2023/11/14 02:31:46 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.107 2023/11/14 03:03:18 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.106 2023/11/14 02:31:46 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.107 2023/11/14 03:03:18 msaitoh Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -487,8 +487,8 @@ retry:
 	}
 
 	/*
-	 * Set up the appropriate offload context
-	 * this will consume the first descriptor
+	 * Set up the appropriate offload context if requested,
+	 * this may consume one TX descriptor.
 	 */
 	error = ixgbe_tx_ctx_setup(txr, m_head, _type_len, _status);
 	if (__predict_false(error)) {



CVS commit: src/sys/dev/pci/ixgbe

2023-11-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 14 03:03:18 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
ixgbe(4): Modify comment. No functional change.

 ixgbe_tx_ctx_setup() may or may not consume one TX descriptor.


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/sys/dev/pci/ixgbe/ix_txrx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci/ixgbe

2023-11-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 14 02:31:46 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
ixgbe(4): Move assignment of TXD. NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/sys/dev/pci/ixgbe/ix_txrx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.105 src/sys/dev/pci/ixgbe/ix_txrx.c:1.106
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.105	Thu Nov  2 05:07:57 2023
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Tue Nov 14 02:31:46 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.105 2023/11/02 05:07:57 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.106 2023/11/14 02:31:46 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.105 2023/11/02 05:07:57 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.106 2023/11/14 02:31:46 msaitoh Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -854,9 +854,6 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, 
 	/* Indicate the whole packet as payload when not doing TSO */
 	*olinfo_status |= mp->m_pkthdr.len << IXGBE_ADVTXD_PAYLEN_SHIFT;
 
-	/* Now ready a context descriptor */
-	TXD = (struct ixgbe_adv_tx_context_desc *)>tx_base[ctxd];
-
 	/*
 	 * In advanced descriptors the vlan tag must
 	 * be placed into the context descriptor. Hence
@@ -959,6 +956,9 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, 
 no_offloads:
 	type_tucmd_mlhl |= IXGBE_ADVTXD_DCMD_DEXT | IXGBE_ADVTXD_DTYP_CTXT;
 
+	/* Now ready a context descriptor */
+	TXD = (struct ixgbe_adv_tx_context_desc *)>tx_base[ctxd];
+
 	/* Now copy bits into descriptor */
 	TXD->vlan_macip_lens = htole32(vlan_macip_lens);
 	TXD->type_tucmd_mlhl = htole32(type_tucmd_mlhl);



CVS commit: src/sys/dev/pci/ixgbe

2023-11-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 14 02:31:46 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
ixgbe(4): Move assignment of TXD. NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/sys/dev/pci/ixgbe/ix_txrx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/ic

2023-11-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 13 15:08:06 UTC 2023

Modified Files:
src/sys/dev/ic: dwc_eqos_reg.h

Log Message:
eqos(4): Extend bitwidth of SYSBUS_MODE_{RD,WR}_OSR_LMT to 4bits.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/ic/dwc_eqos_reg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/dwc_eqos_reg.h
diff -u src/sys/dev/ic/dwc_eqos_reg.h:1.9 src/sys/dev/ic/dwc_eqos_reg.h:1.10
--- src/sys/dev/ic/dwc_eqos_reg.h:1.9	Mon Nov 13 15:07:19 2023
+++ src/sys/dev/ic/dwc_eqos_reg.h	Mon Nov 13 15:08:06 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_eqos_reg.h,v 1.9 2023/11/13 15:07:19 msaitoh Exp $ */
+/* $NetBSD: dwc_eqos_reg.h,v 1.10 2023/11/13 15:08:06 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2022 Jared McNeill 
@@ -229,9 +229,9 @@
 #define	 GMAC_DMA_MODE_SWR			(1U << 0)
 #define	GMAC_DMA_SYSBUS_MODE			0x1004
 #define	 GMAC_DMA_SYSBUS_MODE_WR_OSR_LMT_SHIFT	24
-#define	 GMAC_DMA_SYSBUS_MODE_WR_OSR_LMT_MASK	(0x3U << GMAC_DMA_SYSBUS_MODE_WR_OSR_LMT_SHIFT)
+#define	 GMAC_DMA_SYSBUS_MODE_WR_OSR_LMT_MASK	(0xfU << GMAC_DMA_SYSBUS_MODE_WR_OSR_LMT_SHIFT)
 #define	 GMAC_DMA_SYSBUS_MODE_RD_OSR_LMT_SHIFT	16
-#define	 GMAC_DMA_SYSBUS_MODE_RD_OSR_LMT_MASK	(0x7U << GMAC_DMA_SYSBUS_MODE_RD_OSR_LMT_SHIFT)
+#define	 GMAC_DMA_SYSBUS_MODE_RD_OSR_LMT_MASK	(0xfU << GMAC_DMA_SYSBUS_MODE_RD_OSR_LMT_SHIFT)
 #define	 GMAC_DMA_SYSBUS_MODE_MB		(1U << 14)
 #define	 GMAC_DMA_SYSBUS_MODE_EAME		(1U << 11)
 #define	 GMAC_DMA_SYSBUS_MODE_BLEN16		(1U << 3)



CVS commit: src/sys/dev/ic

2023-11-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 13 15:08:06 UTC 2023

Modified Files:
src/sys/dev/ic: dwc_eqos_reg.h

Log Message:
eqos(4): Extend bitwidth of SYSBUS_MODE_{RD,WR}_OSR_LMT to 4bits.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/ic/dwc_eqos_reg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/ic

2023-11-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 13 15:07:19 UTC 2023

Modified Files:
src/sys/dev/ic: dwc_eqos.c dwc_eqos_reg.h

Log Message:
eqos(4): Set bit 31 when writing MAC_ADDRESS0_HIGH register.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/ic/dwc_eqos.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/ic/dwc_eqos_reg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/dwc_eqos.c
diff -u src/sys/dev/ic/dwc_eqos.c:1.33 src/sys/dev/ic/dwc_eqos.c:1.34
--- src/sys/dev/ic/dwc_eqos.c:1.33	Thu Nov  2 13:50:14 2023
+++ src/sys/dev/ic/dwc_eqos.c	Mon Nov 13 15:07:19 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_eqos.c,v 1.33 2023/11/02 13:50:14 riastradh Exp $ */
+/* $NetBSD: dwc_eqos.c,v 1.34 2023/11/13 15:07:19 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2022 Jared McNeill 
@@ -38,7 +38,7 @@
 #include "opt_net_mpsafe.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc_eqos.c,v 1.33 2023/11/02 13:50:14 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc_eqos.c,v 1.34 2023/11/13 15:07:19 msaitoh Exp $");
 
 #include 
 #include 
@@ -545,7 +545,7 @@ eqos_setup_rxfilter(struct eqos_softc *s
 
 	/* Write our unicast address */
 	eaddr = CLLADDR(ifp->if_sadl);
-	val = eaddr[4] | (eaddr[5] << 8);
+	val = eaddr[4] | (eaddr[5] << 8) | GMAC_MAC_ADDRESS0_HIGH_AE;
 	WR4(sc, GMAC_MAC_ADDRESS0_HIGH, val);
 	val = eaddr[0] | (eaddr[1] << 8) | (eaddr[2] << 16) |
 	(eaddr[3] << 24);

Index: src/sys/dev/ic/dwc_eqos_reg.h
diff -u src/sys/dev/ic/dwc_eqos_reg.h:1.8 src/sys/dev/ic/dwc_eqos_reg.h:1.9
--- src/sys/dev/ic/dwc_eqos_reg.h:1.8	Thu Oct 26 18:02:50 2023
+++ src/sys/dev/ic/dwc_eqos_reg.h	Mon Nov 13 15:07:19 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_eqos_reg.h,v 1.8 2023/10/26 18:02:50 msaitoh Exp $ */
+/* $NetBSD: dwc_eqos_reg.h,v 1.9 2023/11/13 15:07:19 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2022 Jared McNeill 
@@ -120,6 +120,7 @@
 #define	GMAC_MAC_MDIO_DATA			0x0204
 #define	GMAC_MAC_CSR_SW_CTRL			0x0230
 #define	GMAC_MAC_ADDRESS0_HIGH			0x0300
+#define	 GMAC_MAC_ADDRESS0_HIGH_AE		(1U << 31)
 #define	GMAC_MAC_ADDRESS0_LOW			0x0304
 #define	GMAC_MMC_CONTROL			0x0700
 #define	 GMAC_MMC_CONTROL_UCDBC			(1U << 8)



CVS commit: src/sys/dev/ic

2023-11-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 13 15:07:19 UTC 2023

Modified Files:
src/sys/dev/ic: dwc_eqos.c dwc_eqos_reg.h

Log Message:
eqos(4): Set bit 31 when writing MAC_ADDRESS0_HIGH register.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/ic/dwc_eqos.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/ic/dwc_eqos_reg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/pci/ixgbe

2023-11-01 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov  2 05:07:57 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.c ixv.c

Log Message:
ixgbe: Whitespace. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.345 -r1.346 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.192 -r1.193 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.104 src/sys/dev/pci/ixgbe/ix_txrx.c:1.105
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.104	Thu Oct 12 03:43:55 2023
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Thu Nov  2 05:07:57 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.104 2023/10/12 03:43:55 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.105 2023/11/02 05:07:57 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.104 2023/10/12 03:43:55 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.105 2023/11/02 05:07:57 msaitoh Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -123,7 +123,7 @@ static int   ixgbe_dma_malloc(st
   struct ixgbe_dma_alloc *, int);
 static void  ixgbe_dma_free(struct ixgbe_softc *, struct ixgbe_dma_alloc *);
 
-static void	ixgbe_setup_hw_rsc(struct rx_ring *);
+static void	 ixgbe_setup_hw_rsc(struct rx_ring *);
 
 /
  * ixgbe_legacy_start_locked - Transmit entry point
@@ -406,7 +406,7 @@ ixgbe_drain_all(struct ixgbe_softc *sc)
 static int
 ixgbe_xmit(struct tx_ring *txr, struct mbuf *m_head)
 {
-	struct ixgbe_softc  *sc = txr->sc;
+	struct ixgbe_softc  *sc = txr->sc;
 	struct ixgbe_tx_buf *txbuf;
 	union ixgbe_adv_tx_desc *txd = NULL;
 	struct ifnet	*ifp = sc->ifp;
@@ -765,7 +765,7 @@ ixgbe_free_transmit_structures(struct ix
 static void
 ixgbe_free_transmit_buffers(struct tx_ring *txr)
 {
-	struct ixgbe_softc  *sc = txr->sc;
+	struct ixgbe_softc  *sc = txr->sc;
 	struct ixgbe_tx_buf *tx_buffer;
 	int i;
 

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.345 src/sys/dev/pci/ixgbe/ixgbe.c:1.346
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.345	Mon Oct 30 02:46:28 2023
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Nov  2 05:07:57 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.345 2023/10/30 02:46:28 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.346 2023/11/02 05:07:57 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.345 2023/10/30 02:46:28 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.346 2023/11/02 05:07:57 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -3611,7 +3611,7 @@ static int
 ixgbe_allocate_pci_resources(struct ixgbe_softc *sc,
 const struct pci_attach_args *pa)
 {
-	pcireg_t	memtype, csr;
+	pcireg_t memtype, csr;
 	device_t dev = sc->dev;
 	bus_addr_t addr;
 	int flags;

Index: src/sys/dev/pci/ixgbe/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.192 src/sys/dev/pci/ixgbe/ixv.c:1.193
--- src/sys/dev/pci/ixgbe/ixv.c:1.192	Wed Oct 18 03:52:55 2023
+++ src/sys/dev/pci/ixgbe/ixv.c	Thu Nov  2 05:07:57 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixv.c,v 1.192 2023/10/18 03:52:55 msaitoh Exp $ */
+/* $NetBSD: ixv.c,v 1.193 2023/11/02 05:07:57 msaitoh Exp $ */
 
 /**
 
@@ -35,7 +35,7 @@
 /*$FreeBSD: head/sys/dev/ixgbe/if_ixv.c 331224 2018-03-19 20:55:05Z erj $*/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixv.c,v 1.192 2023/10/18 03:52:55 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixv.c,v 1.193 2023/11/02 05:07:57 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1519,8 +1519,8 @@ static int
 ixv_allocate_pci_resources(struct ixgbe_softc *sc,
 const struct pci_attach_args *pa)
 {
-	pcireg_t	memtype, csr;
-	device_t	dev = sc->dev;
+	pcireg_t memtype, csr;
+	device_t dev = sc->dev;
 	bus_addr_t addr;
 	int flags;
 



CVS commit: src/sys/dev/pci/ixgbe

2023-11-01 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov  2 05:07:57 UTC 2023

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.c ixv.c

Log Message:
ixgbe: Whitespace. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.345 -r1.346 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.192 -r1.193 src/sys/dev/pci/ixgbe/ixv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



  1   2   3   4   5   6   7   8   9   10   >