PERFORCE change 150059 for review

Warner Losh imp at FreeBSD.org
Thu Sep 18 23:51:50 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=150059

Change 150059 by imp at imp_paco-paco on 2008/09/18 23:51:04

	IFC @150058

Affected files ...

.. //depot/projects/mips2/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c#3 integrate
.. //depot/projects/mips2/src/sys/net/if_lagg.c#12 integrate
.. //depot/projects/mips2/src/sys/sys/sysent.h#4 integrate

Differences ...

==== //depot/projects/mips2/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c#3 (text+ko) ====


==== //depot/projects/mips2/src/sys/net/if_lagg.c#12 (text+ko) ====

@@ -1116,6 +1116,13 @@
 	int error = 0;
 
 	LAGG_RLOCK(sc);
+	/* We need a Tx algorithm and at least one port */
+	if (sc->sc_proto == LAGG_PROTO_NONE || sc->sc_count == 0) {
+		IF_DRAIN(&ifp->if_snd);
+		LAGG_RUNLOCK(sc);
+		return;
+	}
+
 	for (;; error = 0) {
 		IFQ_DEQUEUE(&ifp->if_snd, m);
 		if (m == NULL)
@@ -1123,20 +1130,13 @@
 
 		ETHER_BPF_MTAP(ifp, m);
 
-		/* We need a Tx algorithm and at least one port */
-		if (sc->sc_proto != LAGG_PROTO_NONE && sc->sc_count)
-			error = (*sc->sc_start)(sc, m);
-		else
-			m_freem(m);
-
+		error = (*sc->sc_start)(sc, m);
 		if (error == 0)
 			ifp->if_opackets++;
 		else
 			ifp->if_oerrors++;
 	}
 	LAGG_RUNLOCK(sc);
-
-	return;
 }
 
 static struct mbuf *

==== //depot/projects/mips2/src/sys/sys/sysent.h#4 (text+ko) ====

@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/sys/sysent.h,v 1.55 2007/07/12 18:01:31 jhb Exp $
+ * $FreeBSD: src/sys/sys/sysent.h,v 1.56 2008/09/18 20:26:06 jhb Exp $
  */
 
 #ifndef _SYS_SYSENT_H_
@@ -52,14 +52,14 @@
 
 extern systrace_probe_func_t	systrace_probe_func;
 
-struct sysent {		/* system call table */
+struct sysent {			/* system call table */
 	int	sy_narg;	/* number of arguments */
 	sy_call_t *sy_call;	/* implementing function */
 	au_event_t sy_auevent;	/* audit event associated with syscall */
 	systrace_args_func_t sy_systrace_args_func;
 				/* optional argument conversion function. */
-	u_int32_t sy_entry;	/* DTrace entry ID for systrace. */ 
-	u_int32_t sy_return;	/* DTrace return ID for systrace. */ 
+	u_int32_t sy_entry;	/* DTrace entry ID for systrace. */
+	u_int32_t sy_return;	/* DTrace return ID for systrace. */
 };
 
 struct image_params;
@@ -108,55 +108,53 @@
 extern struct sysentvec null_sysvec;
 extern struct sysent sysent[];
 
-#define NO_SYSCALL (-1)
+#define	NO_SYSCALL (-1)
 
 struct module;
 
 struct syscall_module_data {
-       int     (*chainevh)(struct module *, int, void *); /* next handler */
-       void    *chainarg;      /* arg for next event handler */
-       int     *offset;         /* offset into sysent */
-       struct  sysent *new_sysent; /* new sysent */
-       struct  sysent old_sysent; /* old sysent */
+	int	(*chainevh)(struct module *, int, void *); /* next handler */
+	void	*chainarg;		/* arg for next event handler */
+	int	*offset;		/* offset into sysent */
+	struct sysent *new_sysent;	/* new sysent */
+	struct sysent old_sysent;	/* old sysent */
 };
 
-#define MAKE_SYSENT(syscallname)                        \
-static struct sysent syscallname##_sysent = {           \
-    (sizeof(struct syscallname ## _args )               \
-     / sizeof(register_t)),                             \
-    (sy_call_t *)& syscallname,                         \
-    SYS_AUE_##syscallname                               \
+#define	MAKE_SYSENT(syscallname)				\
+static struct sysent syscallname##_sysent = {			\
+	(sizeof(struct syscallname ## _args )			\
+	    / sizeof(register_t)),				\
+	(sy_call_t *)& syscallname,				\
+	SYS_AUE_##syscallname					\
 }
-	
-#define SYSCALL_MODULE(name, offset, new_sysent, evh, arg)     \
-static struct syscall_module_data name##_syscall_mod = {       \
-       evh, arg, offset, new_sysent, { 0, NULL, AUE_NULL }     \
-};                                                             \
-                                                               \
-static moduledata_t name##_mod = {                             \
-       #name,                                                  \
-       syscall_module_handler,                                 \
-       &name##_syscall_mod                                     \
-};                                                             \
+
+#define SYSCALL_MODULE(name, offset, new_sysent, evh, arg)	\
+static struct syscall_module_data name##_syscall_mod = {	\
+	evh, arg, offset, new_sysent, { 0, NULL, AUE_NULL }	\
+};								\
+								\
+static moduledata_t name##_mod = {				\
+	#name,							\
+	syscall_module_handler,					\
+	&name##_syscall_mod					\
+};								\
 DECLARE_MODULE(name, name##_mod, SI_SUB_SYSCALLS, SI_ORDER_MIDDLE)
 
-#define SYSCALL_MODULE_HELPER(syscallname)              \
-static int syscallname##_syscall = SYS_##syscallname;   \
-MAKE_SYSENT(syscallname);                               \
-SYSCALL_MODULE(syscallname,                             \
-    & syscallname##_syscall, & syscallname##_sysent,    \
-    NULL, NULL);
+#define	SYSCALL_MODULE_HELPER(syscallname)			\
+static int syscallname##_syscall = SYS_##syscallname;		\
+MAKE_SYSENT(syscallname);					\
+SYSCALL_MODULE(syscallname,					\
+    & syscallname##_syscall, & syscallname##_sysent,		\
+    NULL, NULL)
 
-#define SYSCALL_MODULE_PRESENT(syscallname)		\
-	(sysent[SYS_##syscallname].sy_call !=		\
-			(sy_call_t *)lkmnosys &&	\
-	sysent[SYS_##syscallname].sy_call !=		\
-			(sy_call_t *)lkmressys)
+#define	SYSCALL_MODULE_PRESENT(syscallname)				\
+	(sysent[SYS_##syscallname].sy_call != (sy_call_t *)lkmnosys &&	\
+	sysent[SYS_##syscallname].sy_call != (sy_call_t *)lkmressys)
 
-int    syscall_register(int *offset, struct sysent *new_sysent,
+int	syscall_register(int *offset, struct sysent *new_sysent,
 	    struct sysent *old_sysent);
-int    syscall_deregister(int *offset, struct sysent *old_sysent);
-int    syscall_module_handler(struct module *mod, int what, void *arg);
+int	syscall_deregister(int *offset, struct sysent *old_sysent);
+int	syscall_module_handler(struct module *mod, int what, void *arg);
 
 #endif /* _KERNEL */
 


More information about the p4-projects mailing list