#define PORT_NAME_LEN 32
char lockbuf[PORT_LOCK_NAME_LEN];
char namebuf[PORT_NAME_LEN];
-} __aligned(L1_CACHE_BYTES);
+} __aligned(CACHE_LINE_SIZE);
enum {
/* adapter flags */
#define TX_WR_COUNT_MAX 7 /* the maximum total number of packets that can be
* aggregated into a single TX WR
*/
-#if defined(__i386__) || defined(__amd64__)
-static __inline
-void prefetch(void *x)
-{
- __asm volatile("prefetcht0 %0" :: "m" (*(unsigned long *)x));
-}
+#define prefetch(x) __builtin_prefetch(x)
+#if defined(__i386__) || defined(__amd64__)
#define smp_mb() mb()
-
-#define L1_CACHE_BYTES 128
#define WARN_ON(condition) do { \
if (__predict_false((condition)!=0)) { \
log(LOG_WARNING, "BUG: warning at %s:%d/%s()\n", __FILE__, __LINE__, __FUNCTION__); \
kdb_backtrace(); \
} \
} while (0)
-
-#else
+#else
#define smp_mb()
-#define prefetch(x)
-#define L1_CACHE_BYTES 32
#endif
#define DBG_RX (1 << 0)
void
t3_sge_stop(adapter_t *sc)
{
- int i, nqsets;
-
- t3_set_reg_field(sc, A_SG_CONTROL, F_GLOBALENABLE, 0);
- if (sc->tq == NULL)
- return;
-
- for (nqsets = i = 0; i < (sc)->params.nports; i++)
- nqsets += sc->port[i].nqsets;
-#ifdef notyet
- /*
- *
- * XXX
- */
- for (i = 0; i < nqsets; ++i) {
- struct sge_qset *qs = &sc->sge.qs[i];
-
- taskqueue_drain(sc->tq, &qs->txq[TXQ_OFLD].qresume_task);
- taskqueue_drain(sc->tq, &qs->txq[TXQ_CTRL].qresume_task);
- }
-#endif
+ t3_set_reg_field(sc, A_SG_CONTROL, F_GLOBALENABLE, 0);
}
/**
struct sge_qset *qs = data;
struct sge_txq *q = &qs->txq[TXQ_OFLD];
adapter_t *adap = qs->port->adapter;
- int cleaned;
-
- TXQ_LOCK(qs);
-again: cleaned = reclaim_completed_tx(qs, 16, TXQ_OFLD);
+ TXQ_LOCK(qs);
+again:
while ((m = mbufq_first(&q->sendq)) != NULL) {
unsigned int gen, pidx;
struct ofld_hdr *oh = mtod(m, struct ofld_hdr *);
static int
cxgb_t3fw_modevent(module_t mod, int type, void *unused)
{
- const struct firmware *fp, *parent;
+ const struct firmware *fp;
int error;
switch (type) {
case MOD_LOAD:
0, NULL);
if (fp == NULL)
goto fail_0;
- parent = fp;
return (0);
fail_0:
return (ENXIO);
static int
cxgb_t3b_protocol_sram_modevent(module_t mod, int type, void *unused)
{
- const struct firmware *fp, *parent;
+ const struct firmware *fp;
int error;
switch (type) {
case MOD_LOAD:
0, NULL);
if (fp == NULL)
goto fail_0;
- parent = fp;
return (0);
fail_0:
return (ENXIO);
static int
cxgb_t3b_tp_eeprom_modevent(module_t mod, int type, void *unused)
{
- const struct firmware *fp, *parent;
+ const struct firmware *fp;
int error;
switch (type) {
case MOD_LOAD:
0, NULL);
if (fp == NULL)
goto fail_0;
- parent = fp;
return (0);
fail_0:
return (ENXIO);
static int
cxgb_t3c_protocol_sram_modevent(module_t mod, int type, void *unused)
{
- const struct firmware *fp, *parent;
+ const struct firmware *fp;
int error;
switch (type) {
case MOD_LOAD:
0, NULL);
if (fp == NULL)
goto fail_0;
- parent = fp;
return (0);
fail_0:
return (ENXIO);
static int
cxgb_t3c_tp_eeprom_modevent(module_t mod, int type, void *unused)
{
- const struct firmware *fp, *parent;
+ const struct firmware *fp;
int error;
switch (type) {
case MOD_LOAD:
0, NULL);
if (fp == NULL)
goto fail_0;
- parent = fp;
return (0);
fail_0:
return (ENXIO);
{
struct mbuf *n = *m;
int seg_count, defragged = 0, err = 0;
- bus_dma_segment_t *psegs;
KASSERT(n->m_pkthdr.len, ("packet has zero header len"));
if (n->m_pkthdr.len <= PIO_LEN)
return (0);
retry:
- psegs = segs;
seg_count = 0;
err = bus_dmamap_load_mbuf_sg(tag, map, *m, segs, &seg_count, 0);
if (seg_count == 0) {