be2net: remove usage of be_pci_func
When PCI functions are virtuialized in applications by assigning PCI functions to VM (PCI passthrough), the be2net driver in the VM sees a different function number. So, use of PCI function number in any calculation will break existing code. This patch takes care of it. Signed-off-by: Ajit Khaparde <ajitk@serverengines.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
6cce09f87a
commit
500ca9ba24
@@ -465,8 +465,6 @@ int be_cmd_eq_create(struct be_adapter *adapter,
|
||||
|
||||
req->num_pages = cpu_to_le16(PAGES_4K_SPANNED(q_mem->va, q_mem->size));
|
||||
|
||||
AMAP_SET_BITS(struct amap_eq_context, func, req->context,
|
||||
be_pci_func(adapter));
|
||||
AMAP_SET_BITS(struct amap_eq_context, valid, req->context, 1);
|
||||
/* 4byte eqe*/
|
||||
AMAP_SET_BITS(struct amap_eq_context, size, req->context, 0);
|
||||
@@ -629,7 +627,6 @@ int be_cmd_cq_create(struct be_adapter *adapter,
|
||||
AMAP_SET_BITS(struct amap_cq_context, eventable, ctxt, 1);
|
||||
AMAP_SET_BITS(struct amap_cq_context, eqid, ctxt, eq->id);
|
||||
AMAP_SET_BITS(struct amap_cq_context, armed, ctxt, 1);
|
||||
AMAP_SET_BITS(struct amap_cq_context, func, ctxt, be_pci_func(adapter));
|
||||
be_dws_cpu_to_le(ctxt, sizeof(req->context));
|
||||
|
||||
be_cmd_page_addrs_prepare(req->pages, ARRAY_SIZE(req->pages), q_mem);
|
||||
@@ -678,7 +675,6 @@ int be_cmd_mccq_create(struct be_adapter *adapter,
|
||||
|
||||
req->num_pages = PAGES_4K_SPANNED(q_mem->va, q_mem->size);
|
||||
|
||||
AMAP_SET_BITS(struct amap_mcc_context, fid, ctxt, be_pci_func(adapter));
|
||||
AMAP_SET_BITS(struct amap_mcc_context, valid, ctxt, 1);
|
||||
AMAP_SET_BITS(struct amap_mcc_context, ring_size, ctxt,
|
||||
be_encoded_q_len(mccq->len));
|
||||
@@ -727,8 +723,6 @@ int be_cmd_txq_create(struct be_adapter *adapter,
|
||||
|
||||
AMAP_SET_BITS(struct amap_tx_context, tx_ring_size, ctxt,
|
||||
be_encoded_q_len(txq->len));
|
||||
AMAP_SET_BITS(struct amap_tx_context, pci_func_id, ctxt,
|
||||
be_pci_func(adapter));
|
||||
AMAP_SET_BITS(struct amap_tx_context, ctx_valid, ctxt, 1);
|
||||
AMAP_SET_BITS(struct amap_tx_context, cq_id_send, ctxt, cq->id);
|
||||
|
||||
|
Reference in New Issue
Block a user