Thread (31 messages) flat view 31 messages, 4 authors, 2024-06-25

Re: [net-next PATCH v5 09/10] octeontx2-pf: Add representors for sdp MAC

From: Simon Horman <horms@kernel.org>
Date: 2024-06-18 08:55:52
Also in: lkml

On Tue, Jun 11, 2024 at 09:52:12PM +0530, Geetha sowjanya wrote:
Hardware supports different types of MACs eg RPM, SDP, LBK.
Also, hardware doesn't have an internal switch. LBK is a
loopback mac which punts egress pkts back to ingress pipeline.
RPM and SDP MACs support ingress/egress pkt IO on interfaces with
different set of capabilities like interface modes ranging from
10/100/1000BaseX to 100Gbps KR modes.

At the time of netdev driver registration PF will
seek MAC related information from Admin function driver
'drivers/net/ethernet/marvell/octeontx2/af' and sets up ingress/egress
queues etc such that pkt IO on the channels of these different MACs is
possible. This patch add representors for SDP MAC.

Signed-off-by: Geetha sowjanya <gakula@marvell.com>
...
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c
...
quoted hunk ↗ jump to hunk
@@ -683,6 +684,15 @@ static int otx2vf_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		snprintf(netdev->name, sizeof(netdev->name), "lbk%d", n);
 	}
 
+	if (is_otx2_sdp_rep(vf->pdev)) {
+		int n;
+
+		n = (vf->pcifunc >> RVU_PFVF_FUNC_SHIFT) & RVU_PFVF_FUNC_MASK;
nit: This seems to open-code FIELD_GET
+		n -= 1;
+		snprintf(netdev->name, sizeof(netdev->name), "sdp%d-%d",
+			 pdev->bus->number, n);
+	}
+
 	err = register_netdev(netdev);
 	if (err) {
 		dev_err(dev, "Failed to register netdevice\n");
-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help