From e285f30d98457a47f1331cfc466a45ef35224fe5 Mon Sep 17 00:00:00 2001 From: Igor Romanov Date: Tue, 13 Oct 2020 14:45:51 +0100 Subject: [PATCH] net/sfc: forward function control window offset to datapath Store function control window offset to correctly set the offset of prime EvQ in EF100. Signed-off-by: Igor Romanov Signed-off-by: Andrew Rybchenko --- drivers/net/sfc/sfc.c | 3 +++ drivers/net/sfc/sfc.h | 2 ++ drivers/net/sfc/sfc_dp_rx.h | 2 ++ drivers/net/sfc/sfc_rx.c | 1 + 4 files changed, 8 insertions(+) diff --git a/drivers/net/sfc/sfc.c b/drivers/net/sfc/sfc.c index d4478a2846..8fa790da55 100644 --- a/drivers/net/sfc/sfc.c +++ b/drivers/net/sfc/sfc.c @@ -667,6 +667,9 @@ sfc_mem_bar_init(struct sfc_adapter *sa, const efx_bar_region_t *mem_ebrp) ebp->esb_rid = mem_ebrp->ebr_index; ebp->esb_dev = pci_dev; ebp->esb_base = res->addr; + + sa->fcw_offset = mem_ebrp->ebr_offset; + return 0; } diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h index ecdd716256..047ca64de7 100644 --- a/drivers/net/sfc/sfc.h +++ b/drivers/net/sfc/sfc.h @@ -221,6 +221,8 @@ struct sfc_adapter { struct rte_kvargs *kvargs; int socket_id; efsys_bar_t mem_bar; + /* Function control window offset */ + efsys_dma_addr_t fcw_offset; efx_family_t family; efx_nic_t *nic; rte_spinlock_t nic_lock; diff --git a/drivers/net/sfc/sfc_dp_rx.h b/drivers/net/sfc/sfc_dp_rx.h index 362be933a9..f3e00e2e38 100644 --- a/drivers/net/sfc/sfc_dp_rx.h +++ b/drivers/net/sfc/sfc_dp_rx.h @@ -88,6 +88,8 @@ struct sfc_dp_rx_qcreate_info { * doorbell */ volatile void *mem_bar; + /** Function control window offset */ + efsys_dma_addr_t fcw_offset; /** VI window size shift */ unsigned int vi_window_shift; }; diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index ff4e69e679..de0773b8a7 100644 --- a/drivers/net/sfc/sfc_rx.c +++ b/drivers/net/sfc/sfc_rx.c @@ -1199,6 +1199,7 @@ sfc_rx_qinit(struct sfc_adapter *sa, unsigned int sw_index, info.hw_index = rxq->hw_index; info.mem_bar = sa->mem_bar.esb_base; info.vi_window_shift = encp->enc_vi_window_shift; + info.fcw_offset = sa->fcw_offset; rc = sa->priv.dp_rx->qcreate(sa->eth_dev->data->port_id, sw_index, &RTE_ETH_DEV_TO_PCI(sa->eth_dev)->addr, -- 2.20.1