X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fcxgbe%2Fcxgbe_main.c;h=6dd1bf1f836eaf2fd0452240ff1cef92d3b50b92;hb=249feed2e40a0a69421acbd3a497fd38af1ebbb6;hp=c759d97f8cd4d9fcc767a163cbadb5255b94cccc;hpb=23d5fee348d4c7c6c6df5c4557e1c416f1545e4b;p=dpdk.git diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c index c759d97f8c..6dd1bf1f83 100644 --- a/drivers/net/cxgbe/cxgbe_main.c +++ b/drivers/net/cxgbe/cxgbe_main.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -417,13 +416,15 @@ void cxgbe_remove_tid(struct tid_info *t, unsigned int chan, unsigned int tid, if (t->tid_tab[tid]) { t->tid_tab[tid] = NULL; - rte_atomic32_dec(&t->conns_in_use); + __atomic_sub_fetch(&t->conns_in_use, 1, __ATOMIC_RELAXED); if (t->hash_base && tid >= t->hash_base) { if (family == FILTER_TYPE_IPV4) - rte_atomic32_dec(&t->hash_tids_in_use); + __atomic_sub_fetch(&t->hash_tids_in_use, 1, + __ATOMIC_RELAXED); } else { if (family == FILTER_TYPE_IPV4) - rte_atomic32_dec(&t->tids_in_use); + __atomic_sub_fetch(&t->tids_in_use, 1, + __ATOMIC_RELAXED); } } @@ -445,13 +446,15 @@ void cxgbe_insert_tid(struct tid_info *t, void *data, unsigned int tid, t->tid_tab[tid] = data; if (t->hash_base && tid >= t->hash_base) { if (family == FILTER_TYPE_IPV4) - rte_atomic32_inc(&t->hash_tids_in_use); + __atomic_add_fetch(&t->hash_tids_in_use, 1, + __ATOMIC_RELAXED); } else { if (family == FILTER_TYPE_IPV4) - rte_atomic32_inc(&t->tids_in_use); + __atomic_add_fetch(&t->tids_in_use, 1, + __ATOMIC_RELAXED); } - rte_atomic32_inc(&t->conns_in_use); + __atomic_add_fetch(&t->conns_in_use, 1, __ATOMIC_RELAXED); } /** @@ -504,10 +507,8 @@ static int tid_init(struct tid_info *t) t->afree = NULL; t->atids_in_use = 0; - rte_atomic32_init(&t->tids_in_use); - rte_atomic32_set(&t->tids_in_use, 0); - rte_atomic32_init(&t->conns_in_use); - rte_atomic32_set(&t->conns_in_use, 0); + t->tids_in_use = 0; + t->conns_in_use = 0; /* Setup the free list for atid_tab and clear the stid bitmap. */ if (natids) { @@ -1500,6 +1501,20 @@ static int adap_init0(struct adapter *adap) ret = t4_query_params(adap, adap->mbox, adap->pf, 0, 1, params, val); adap->params.vi_enable_rx = (ret == 0 && val[0] != 0); + /* Read the RAW MPS entries. In T6, the last 2 TCAM entries + * are reserved for RAW MAC addresses (rawf = 2, one per port). + */ + if (CHELSIO_CHIP_VERSION(adap->params.chip) > CHELSIO_T5) { + params[0] = CXGBE_FW_PARAM_PFVF(RAWF_START); + params[1] = CXGBE_FW_PARAM_PFVF(RAWF_END); + ret = t4_query_params(adap, adap->mbox, adap->pf, 0, 2, + params, val); + if (ret == 0) { + adap->params.rawf_start = val[0]; + adap->params.rawf_size = val[1] - val[0] + 1; + } + } + /* * The MTU/MSS Table is initialized by now, so load their values. If * we're initializing the adapter, then we'll make any modifications