qed: Optimize qed_chain datapath usage
The chain structure and functions are widely used by the qed* modules, both for configuration and datapath. E.g., qede's Tx has one such chain and its Rx has two. Currently, the strucutre's fields which are required for datapath related functions [produce/consume] are intertwined with fields which are required only for configuration purposes [init/destroy/etc.]. This patch re-arranges the chain structure so that all the fields which are required for datapath usage could reside in a single cacheline instead of the two which are required today. Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
01e23015a9
commit
6d937acfb3
@@ -2283,12 +2283,12 @@ static void qed_chain_free_pbl(struct qed_dev *cdev, struct qed_chain *p_chain)
|
||||
{
|
||||
void **pp_virt_addr_tbl = p_chain->pbl.pp_virt_addr_tbl;
|
||||
u32 page_cnt = p_chain->page_cnt, i, pbl_size;
|
||||
u8 *p_pbl_virt = p_chain->pbl.p_virt_table;
|
||||
u8 *p_pbl_virt = p_chain->pbl_sp.p_virt_table;
|
||||
|
||||
if (!pp_virt_addr_tbl)
|
||||
return;
|
||||
|
||||
if (!p_chain->pbl.p_virt_table)
|
||||
if (!p_pbl_virt)
|
||||
goto out;
|
||||
|
||||
for (i = 0; i < page_cnt; i++) {
|
||||
@@ -2306,7 +2306,8 @@ static void qed_chain_free_pbl(struct qed_dev *cdev, struct qed_chain *p_chain)
|
||||
pbl_size = page_cnt * QED_CHAIN_PBL_ENTRY_SIZE;
|
||||
dma_free_coherent(&cdev->pdev->dev,
|
||||
pbl_size,
|
||||
p_chain->pbl.p_virt_table, p_chain->pbl.p_phys_table);
|
||||
p_chain->pbl_sp.p_virt_table,
|
||||
p_chain->pbl_sp.p_phys_table);
|
||||
out:
|
||||
vfree(p_chain->pbl.pp_virt_addr_tbl);
|
||||
}
|
||||
|
@@ -347,11 +347,11 @@ int qed_sp_pf_start(struct qed_hwfn *p_hwfn,
|
||||
|
||||
/* Place EQ address in RAMROD */
|
||||
DMA_REGPAIR_LE(p_ramrod->event_ring_pbl_addr,
|
||||
p_hwfn->p_eq->chain.pbl.p_phys_table);
|
||||
p_hwfn->p_eq->chain.pbl_sp.p_phys_table);
|
||||
page_cnt = (u8)qed_chain_get_page_cnt(&p_hwfn->p_eq->chain);
|
||||
p_ramrod->event_ring_num_pages = page_cnt;
|
||||
DMA_REGPAIR_LE(p_ramrod->consolid_q_pbl_addr,
|
||||
p_hwfn->p_consq->chain.pbl.p_phys_table);
|
||||
p_hwfn->p_consq->chain.pbl_sp.p_phys_table);
|
||||
|
||||
qed_tunn_set_pf_start_params(p_hwfn, p_tunn, &p_ramrod->tunnel_config);
|
||||
|
||||
|
Reference in New Issue
Block a user