Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Mar 2008 18:47:48 GMT
From:      "Christian S.J. Peron" <csjp@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 137790 for review
Message-ID:  <200803151847.m2FIlmvF061798@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=137790

Change 137790 by csjp@ibm01 on 2008/03/15 18:47:15

	- Add a pad element to inform users that this space is not being used
	  as the compiler will align subsequent intgers to a 4 byte boundary
	  since the structure is not packed.
	- Change the counters from unsigned to explicitly 64 bits

Affected files ...

.. //depot/projects/zcopybpf/src/sys/net/bpfdesc.h#11 edit

Differences ...

==== //depot/projects/zcopybpf/src/sys/net/bpfdesc.h#11 (text+ko) ====

@@ -75,8 +75,8 @@
 #ifdef BPF_JITTER
 	bpf_jit_filter	*bd_bfilter;	/* binary filter code */
 #endif
-	u_long		bd_rcount;	/* number of packets received */
-	u_long		bd_dcount;	/* number of packets dropped */
+	u_int64_t	bd_rcount;	/* number of packets received */
+	u_int64_t	bd_dcount;	/* number of packets dropped */
 
 	u_char		bd_promisc;	/* true if listening promiscuously */
 	u_char		bd_state;	/* idle, waiting, or timed out */
@@ -91,14 +91,14 @@
 	struct mtx	bd_mtx;		/* mutex for this descriptor */
 	struct callout	bd_callout;	/* for BPF timeouts with select */
 	struct label	*bd_label;	/* MAC label for descriptor */
-	u_long		bd_fcount;	/* number of packets which matched filter */
+	u_int64_t	bd_fcount;	/* number of packets which matched filter */
 	pid_t		bd_pid;		/* PID which created descriptor */
 	int		bd_locked;	/* true if descriptor is locked */
 	u_int		bd_bufmode;	/* Current buffer mode. */
-	u_long		bd_wcount;	/* number of packets written */
-	u_long		bd_wfcount;	/* number of packets that matched write filter */
-	u_long		bd_wdcount;	/* number of packets dropped during a write */
-	u_long		bd_zcopy;	/* number of zero copy operations */
+	u_int64_t	bd_wcount;	/* number of packets written */
+	u_int64_t	bd_wfcount;	/* number of packets that matched write filter */
+	u_int64_t	bd_wdcount;	/* number of packets dropped during a write */
+	u_int64_t	bd_zcopy;	/* number of zero copy operations */
 };
 
 /* Values for bd_state */
@@ -117,13 +117,14 @@
 	u_int		bd_structsize;	/* Size of this structure. */
 	u_char		bd_promisc;
 	u_char		bd_immediate;
+	u_char		__bd_pad[6];
 	int		bd_hdrcmplt;
 	int		bd_direction;
 	int		bd_feedback;
 	int		bd_async;
-	u_long		bd_rcount;
-	u_long		bd_dcount;
-	u_long		bd_fcount;
+	u_int64_t	bd_rcount;
+	u_int64_t	bd_dcount;
+	u_int64_t	bd_fcount;
 	int		bd_sig;
 	int		bd_slen;
 	int		bd_hlen;
@@ -131,10 +132,14 @@
 	pid_t		bd_pid;
 	char		bd_ifname[IFNAMSIZ];
 	int		bd_locked;
-	u_long		bd_wcount;
-	u_long		bd_wfcount;
-	u_long		bd_wdcount;
-	u_long		bd_zcopy;
+	u_int64_t	bd_wcount;
+	u_int64_t	bd_wfcount;
+	u_int64_t	bd_wdcount;
+	u_int64_t	bd_zcopy;
+	/*
+	 * Spare 64 bit integers for future expansion.
+	 */
+	u_int64_t	bd_spare[4];
 };
 
 #define BPFIF_LOCK(bif)		mtx_lock(&(bif)->bif_mtx)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200803151847.m2FIlmvF061798>