net: mana: Record port number in netdev

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>
This commit is contained in:
Long Li 2022-11-03 12:16:24 -07:00 committed by Leon Romanovsky
parent 4c0ff7a106
commit d44089e555
1 changed files with 1 additions and 0 deletions

View File

@ -2133,6 +2133,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);