summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2012-12-10 17:36:11 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2012-12-10 17:36:11 +0000
commit8a035085bc3ae8fafd05f43d62117d440347efe8 (patch)
tree6c018c79f5d78d263adc8af267e35b30acf3d616
parentd8b0715eb4cad99cd0f114d1b122a17f2ccebd77 (diff)
adjust mbuf chain data pointer so that ip header would appear
word aligned; remove pool constraints insanity while here
-rw-r--r--sys/dev/pci/if_oce.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/sys/dev/pci/if_oce.c b/sys/dev/pci/if_oce.c
index a6aeef691dc..4a20d552883 100644
--- a/sys/dev/pci/if_oce.c
+++ b/sys/dev/pci/if_oce.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_oce.c,v 1.67 2012/11/27 18:08:21 gsoares Exp $ */
+/* $OpenBSD: if_oce.c,v 1.68 2012/12/10 17:36:10 mikeb Exp $ */
/*
* Copyright (c) 2012 Mike Belopuhov
@@ -69,8 +69,6 @@
#include <sys/timeout.h>
#include <sys/pool.h>
-#include <uvm/uvm_extern.h>
-
#include <net/if.h>
#include <net/if_dl.h>
#include <net/if_media.h>
@@ -461,7 +459,7 @@ static inline void *
oce_ring_next(struct oce_ring *);
struct oce_pkt *
oce_pkt_alloc(struct oce_softc *, size_t size, int nsegs,
- int maxsegs);
+ int maxsegsz);
void oce_pkt_free(struct oce_softc *, struct oce_pkt *);
static inline struct oce_pkt *
oce_pkt_get(struct oce_pkt_list *);
@@ -505,12 +503,6 @@ int oce_stats_be3(struct oce_softc *, uint64_t *, uint64_t *);
int oce_stats_xe(struct oce_softc *, uint64_t *, uint64_t *);
struct pool *oce_pkt_pool;
-extern struct uvm_constraint_range no_constraint;
-const struct kmem_pa_mode kp_contig = {
- .kp_constraint = &no_constraint,
- .kp_maxseg = 1,
- .kp_zero = 1
-};
struct cfdriver oce_cd = {
NULL, "oce", DV_IFNET
@@ -605,7 +597,6 @@ oce_attach(struct device *parent, struct device *self, void *aux)
}
pool_init(oce_pkt_pool, sizeof(struct oce_pkt), 0, 0, 0,
"ocepkts", NULL);
- pool_set_constraints(oce_pkt_pool, &kp_contig);
}
/* We allocate a single interrupt resource */
@@ -1782,6 +1773,7 @@ oce_get_buf(struct oce_rq *rq)
}
pkt->mbuf->m_len = pkt->mbuf->m_pkthdr.len = MCLBYTES;
+ m_adj(pkt->mbuf, ETHER_ALIGN);
if (bus_dmamap_load_mbuf(sc->sc_dmat, pkt->map, pkt->mbuf,
BUS_DMA_NOWAIT)) {
@@ -2633,14 +2625,14 @@ oce_ring_next(struct oce_ring *ring)
}
struct oce_pkt *
-oce_pkt_alloc(struct oce_softc *sc, size_t size, int nsegs, int maxsegs)
+oce_pkt_alloc(struct oce_softc *sc, size_t size, int nsegs, int maxsegsz)
{
struct oce_pkt *pkt;
- if ((pkt = pool_get(oce_pkt_pool, PR_NOWAIT)) == NULL)
+ if ((pkt = pool_get(oce_pkt_pool, PR_NOWAIT | PR_ZERO)) == NULL)
return (NULL);
- if (bus_dmamap_create(sc->sc_dmat, size, nsegs, maxsegs, 0,
+ if (bus_dmamap_create(sc->sc_dmat, size, nsegs, maxsegsz, 0,
BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW, &pkt->map)) {
pool_put(oce_pkt_pool, pkt);
return (NULL);