Date: Thu, 2 Aug 2012 11:59:43 +0000 (UTC) From: Luigi Rizzo <luigi@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r238985 - head/sys/dev/netmap Message-ID: <201208021159.q72Bxhcu078913@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: luigi Date: Thu Aug 2 11:59:43 2012 New Revision: 238985 URL: http://svn.freebsd.org/changeset/base/238985 Log: fix some signed/unsigned warnings in the netmap code. Unfortunately the original drivers still have a lot of sign conversion/comparison warnings. Modified: head/sys/dev/netmap/if_em_netmap.h head/sys/dev/netmap/if_igb_netmap.h head/sys/dev/netmap/ixgbe_netmap.h head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h Modified: head/sys/dev/netmap/if_em_netmap.h ============================================================================== --- head/sys/dev/netmap/if_em_netmap.h Thu Aug 2 10:39:54 2012 (r238984) +++ head/sys/dev/netmap/if_em_netmap.h Thu Aug 2 11:59:43 2012 (r238985) @@ -171,7 +171,7 @@ em_netmap_txsync(struct ifnet *ifp, u_in u_int j, k, l, n = 0, lim = kring->nkr_num_slots - 1; /* generate an interrupt approximately every half ring */ - int report_frequency = kring->nkr_num_slots >> 1; + u_int report_frequency = kring->nkr_num_slots >> 1; k = ring->cur; if (k > lim) Modified: head/sys/dev/netmap/if_igb_netmap.h ============================================================================== --- head/sys/dev/netmap/if_igb_netmap.h Thu Aug 2 10:39:54 2012 (r238984) +++ head/sys/dev/netmap/if_igb_netmap.h Thu Aug 2 11:59:43 2012 (r238985) @@ -125,7 +125,7 @@ igb_netmap_txsync(struct ifnet *ifp, u_i u_int j, k, l, n = 0, lim = kring->nkr_num_slots - 1; /* generate an interrupt approximately every half ring */ - int report_frequency = kring->nkr_num_slots >> 1; + u_int report_frequency = kring->nkr_num_slots >> 1; k = ring->cur; if (k > lim) Modified: head/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- head/sys/dev/netmap/ixgbe_netmap.h Thu Aug 2 10:39:54 2012 (r238984) +++ head/sys/dev/netmap/ixgbe_netmap.h Thu Aug 2 11:59:43 2012 (r238985) @@ -233,7 +233,7 @@ ixgbe_netmap_txsync(struct ifnet *ifp, u * seems very expensive, so we interrupt once every half ring, * or when requested with NS_REPORT */ - int report_frequency = kring->nkr_num_slots >> 1; + u_int report_frequency = kring->nkr_num_slots >> 1; if (k > lim) return netmap_ring_reinit(kring); Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Thu Aug 2 10:39:54 2012 (r238984) +++ head/sys/dev/netmap/netmap.c Thu Aug 2 11:59:43 2012 (r238985) @@ -119,8 +119,8 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, verbos CTLFLAG_RW, &netmap_verbose, 0, "Verbose mode"); SYSCTL_INT(_dev_netmap, OID_AUTO, no_timestamp, CTLFLAG_RW, &netmap_no_timestamp, 0, "no_timestamp"); -int netmap_buf_size = 2048; -TUNABLE_INT("hw.netmap.buf_size", &netmap_buf_size); +u_int netmap_buf_size = 2048; +TUNABLE_INT("hw.netmap.buf_size", (u_int *)&netmap_buf_size); SYSCTL_INT(_dev_netmap, OID_AUTO, buf_size, CTLFLAG_RD, &netmap_buf_size, 0, "Size of packet buffers"); int netmap_mitigate = 1; @@ -1379,7 +1379,7 @@ netmap_start(struct ifnet *ifp, struct m struct netmap_adapter *na = NA(ifp); struct netmap_kring *kring = &na->rx_rings[na->num_rx_rings]; u_int i, len = MBUF_LEN(m); - int error = EBUSY, lim = kring->nkr_num_slots - 1; + u_int error = EBUSY, lim = kring->nkr_num_slots - 1; struct netmap_slot *slot; if (netmap_verbose & NM_VERB_HOST) @@ -1955,7 +1955,7 @@ bdg_netmap_rxsync(struct ifnet *ifp, u_i struct netmap_adapter *na = NA(ifp); struct netmap_kring *kring = &na->rx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; - int j, n, lim = kring->nkr_num_slots - 1; + u_int j, n, lim = kring->nkr_num_slots - 1; u_int k = ring->cur, resvd = ring->reserved; ND("%s ring %d lock %d avail %d", Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Thu Aug 2 10:39:54 2012 (r238984) +++ head/sys/dev/netmap/netmap_kern.h Thu Aug 2 11:59:43 2012 (r238985) @@ -241,7 +241,7 @@ struct netmap_slot *netmap_reset(struct enum txrx tx, int n, u_int new_cur); int netmap_ring_reinit(struct netmap_kring *); -extern int netmap_buf_size; +extern u_int netmap_buf_size; #define NETMAP_BUF_SIZE netmap_buf_size extern int netmap_mitigate; extern int netmap_no_pendintr;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208021159.q72Bxhcu078913>