Skip to content

Commit e110225

Browse files
committed
Merge branch 'refactoring-rvu-nic-driver'
Geetha sowjanya says: ==================== Refactoring RVU NIC driver This is a preparation pathset for follow-up "Introducing RVU representors driver" patches. The RVU representor driver creates representor netdev of each rvu device when switch dev mode is enabled. RVU representor and NIC have a similar set of HW resources(NIX_LF,RQ/SQ/CQ) and implements a subset of NIC functionality. This patch set groups hw resources and queue configuration code into single API and export the existing functions so, that code can be shared between NIC and representor drivers. These patches are part of "Introduce RVU representors" patchset. https://lore.kernel.org/all/[email protected]/T/ As suggested by "Jiri Pirko", submitting as separate patchset. ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents b4d0679 + 78bd5d8 commit e110225

File tree

4 files changed

+155
-95
lines changed

4 files changed

+155
-95
lines changed

drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ int otx2_hw_set_mtu(struct otx2_nic *pfvf, int mtu)
227227
u16 maxlen;
228228
int err;
229229

230-
maxlen = otx2_get_max_mtu(pfvf) + OTX2_ETH_HLEN + OTX2_HW_TIMESTAMP_LEN;
230+
maxlen = pfvf->hw.max_mtu + OTX2_ETH_HLEN + OTX2_HW_TIMESTAMP_LEN;
231231

232232
mutex_lock(&pfvf->mbox.lock);
233233
req = otx2_mbox_alloc_msg_nix_set_hw_frs(&pfvf->mbox);
@@ -236,7 +236,7 @@ int otx2_hw_set_mtu(struct otx2_nic *pfvf, int mtu)
236236
return -ENOMEM;
237237
}
238238

239-
req->maxlen = pfvf->netdev->mtu + OTX2_ETH_HLEN + OTX2_HW_TIMESTAMP_LEN;
239+
req->maxlen = mtu + OTX2_ETH_HLEN + OTX2_HW_TIMESTAMP_LEN;
240240

241241
/* Use max receive length supported by hardware for loopback devices */
242242
if (is_otx2_lbkvf(pfvf->pdev))

drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ struct otx2_hw {
228228
u16 txschq_list[NIX_TXSCH_LVL_CNT][MAX_TXSCHQ_PER_FUNC];
229229
u16 matchall_ipolicer;
230230
u32 dwrr_mtu;
231+
u32 max_mtu;
231232
u8 smq_link_type;
232233

233234
/* HW settings, coalescing etc */
@@ -996,6 +997,20 @@ int otx2_pool_init(struct otx2_nic *pfvf, u16 pool_id,
996997
int stack_pages, int numptrs, int buf_size, int type);
997998
int otx2_aura_init(struct otx2_nic *pfvf, int aura_id,
998999
int pool_id, int numptrs);
1000+
int otx2_init_rsrc(struct pci_dev *pdev, struct otx2_nic *pf);
1001+
void otx2_free_queue_mem(struct otx2_qset *qset);
1002+
int otx2_alloc_queue_mem(struct otx2_nic *pf);
1003+
int otx2_init_hw_resources(struct otx2_nic *pfvf);
1004+
void otx2_free_hw_resources(struct otx2_nic *pf);
1005+
int otx2_wq_init(struct otx2_nic *pf);
1006+
int otx2_check_pf_usable(struct otx2_nic *pf);
1007+
int otx2_pfaf_mbox_init(struct otx2_nic *pf);
1008+
int otx2_register_mbox_intr(struct otx2_nic *pf, bool probe_af);
1009+
int otx2_realloc_msix_vectors(struct otx2_nic *pf);
1010+
void otx2_pfaf_mbox_destroy(struct otx2_nic *pf);
1011+
void otx2_disable_mbox_intr(struct otx2_nic *pf);
1012+
void otx2_disable_napi(struct otx2_nic *pf);
1013+
irqreturn_t otx2_cq_intr_handler(int irq, void *cq_irq);
9991014

10001015
/* RSS configuration APIs*/
10011016
int otx2_rss_init(struct otx2_nic *pfvf);

0 commit comments

Comments
 (0)