From patchwork Wed Oct 19 22:24:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: longli@linuxonhyperv.com X-Patchwork-Id: 5869 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp563537wrs; Wed, 19 Oct 2022 15:27:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5BpoYu1+4lXdqeYanOp1C5MOzBY7kAdVbDVokMxF1w57dBh8+esdrXP8o4We4iZvDdPaV7 X-Received: by 2002:a17:907:980e:b0:78d:b6d5:661e with SMTP id ji14-20020a170907980e00b0078db6d5661emr8686687ejc.46.1666218423455; Wed, 19 Oct 2022 15:27:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666218423; cv=none; d=google.com; s=arc-20160816; b=B6AnUBjZwVkB5oa9yX/780NWO45whB9KEphiZrcRtoMcBjxtGQ6A47qgXjo38G8H3n gtD3KLnTCcfIb3RIn0foty53KERsyN2oCj5ZFoI+66ngpascTOZSTRKyHAzEQhdYuhY7 RELoMnWcc7E5WDVTpRS/ymFVtKsgBc6lRvZm1u67GVaRAMLfrOqmiO394Nv4iXRMJFkx EXR8oBD/f6AspSGuH5iTNAXYdREGhc2nC2c8gps06vazcqUpl6tyhOa+SSCANbTFPguP 6S1pqwh1Bo5JmvrbrTo52XXLrDhri3NloqrXvkORSJAVKIh+JkB2U+mfPMvkNqVrS3Ou nqcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:reply-to:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=rxJ1l3XZAaUy7L0ulivQTclU3lx9TfDBngKUNfhY9VY=; b=arQuliBPNg8z0JnHa5h7OGPyxxbXKKNaQ4CqmZenaVMc2/W5ua7Trv9dLpQfF3m6mc NhPUcgRKDZPeUB/ppW7H2yBcuJv+lKqDd141NQcMRdRwAZwKIS8zGqV7drjGSilHeamh p9DphJq1EeUoBm1UY4Z+y6ENAHyiw6nN3NtH6Z+STdX7mWH83XMnxXq4SpQIZNxnq9an c+tLVrtDAEtyOJ2NrjbLLZ7lpt3fA3AjPThqKOTxNs4jdKe9kJW0fjIBbmvGvG1Aawm1 siTnuFCCCXFItzw1t28KCtxaW/N56DwB0ThNdBbAvfBOr157hRgKT4FBRQuL0xUDzipF YTnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxonhyperv.com header.s=default header.b=jYFnSlBM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxonhyperv.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ho10-20020a1709070e8a00b0077f92be81adsi16329023ejc.212.2022.10.19.15.26.36; Wed, 19 Oct 2022 15:27:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxonhyperv.com header.s=default header.b=jYFnSlBM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxonhyperv.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231649AbiJSWYy (ORCPT + 99 others); Wed, 19 Oct 2022 18:24:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230510AbiJSWY1 (ORCPT ); Wed, 19 Oct 2022 18:24:27 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C463762D4; Wed, 19 Oct 2022 15:24:25 -0700 (PDT) Received: by linux.microsoft.com (Postfix, from userid 1004) id B4E8020FE9DF; Wed, 19 Oct 2022 15:24:24 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B4E8020FE9DF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1666218264; bh=rxJ1l3XZAaUy7L0ulivQTclU3lx9TfDBngKUNfhY9VY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:From; b=jYFnSlBMhbpay/sQeCvPbsJBqGPInkKnYaQVr1O5zAliw9S5i3Qj3n+9s5GhAaEuC X99xmGe9rnjfe2PCc+NZlpZQPpb0jZYuJoAM+wK69kQHw+mT8CLJtrhBTluCMBPAQW 3INXdwE0vNt8oR3hBuoO9R8NW5SF0sr3c0XOLxsU= From: longli@linuxonhyperv.com To: "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Jason Gunthorpe , Leon Romanovsky , edumazet@google.com, shiraz.saleem@intel.com, Ajay Sharma Cc: linux-hyperv@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Long Li Subject: [Patch v8 06/12] net: mana: Record port number in netdev Date: Wed, 19 Oct 2022 15:24:06 -0700 Message-Id: <1666218252-32191-7-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1666218252-32191-1-git-send-email-longli@linuxonhyperv.com> References: <1666218252-32191-1-git-send-email-longli@linuxonhyperv.com> Reply-To: longli@microsoft.com X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747156649616878871?= X-GMAIL-MSGID: =?utf-8?q?1747156649616878871?= From: Long Li 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 Signed-off-by: Long Li Acked-by: Haiyang Zhang --- drivers/net/ethernet/microsoft/mana/mana_en.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c index 6ad4bc8cbc99..b6303a43fa7c 100644 --- a/drivers/net/ethernet/microsoft/mana/mana_en.c +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c @@ -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);