[PATCH 08/44] net: mana: Record port number in netdev
authorLong Li <longli@microsoft.com>
Thu, 3 Nov 2022 19:16:24 +0000 (12:16 -0700)
committerSalvatore Bonaccorso <carnil@debian.org>
Sat, 2 Aug 2025 13:13:02 +0000 (15:13 +0200)
The port number is useful for user-mode application to identify this
net device based on port index. Set to the correct value in ndev.

Reviewed-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Long Li <longli@microsoft.com>
Link: https://lore.kernel.org/r/1667502990-2559-7-git-send-email-longli@linuxonhyperv.com
Acked-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
(cherry picked from commit d44089e555ffe63a49cc6e94d0c03d933e413059)
Signed-off-by: Bastian Blank <waldi@debian.org>
Gbp-Pq: Topic features/all/ethernet-microsoft
Gbp-Pq: Name 0008-net-mana-Record-port-number-in-netdev.patch

drivers/net/ethernet/microsoft/mana/mana_en.c

index ce73963faf067153deb04e7c7315a5780791b951..c41faddee2ef636d211759b9d570732d8dab6d4b 100644 (file)
@@ -2182,6 +2182,7 @@ static int mana_probe_port(struct mana_context *ac, int port_idx,
        ndev->max_mtu = ndev->mtu;
        ndev->min_mtu = ndev->mtu;
        ndev->needed_headroom = MANA_HEADROOM;
+       ndev->dev_port = port_idx;
        SET_NETDEV_DEV(ndev, gc->dev);
 
        netif_carrier_off(ndev);