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

From: Simon Horman
Date: Tue Jun 18 2024 - 06:45:10 EST


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@xxxxxxxxxxx>

...

> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c

...

> @@ -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
>
>