From patchwork Sat Oct 22 00:01:23 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: 7039 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp960958wrr; Fri, 21 Oct 2022 17:06:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6qLHHl3QhdZ55ELf/uu7uHomgD7kdFAeYN7M4qedDnKAzK2ZNAzeQ5+mhnuzpHdPQVQ7Gk X-Received: by 2002:aa7:c14f:0:b0:460:e1cc:2c29 with SMTP id r15-20020aa7c14f000000b00460e1cc2c29mr9524822edp.423.1666397162403; Fri, 21 Oct 2022 17:06:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666397162; cv=none; d=google.com; s=arc-20160816; b=iw/oVAvbFBs4jfjHJTqKL+7P5+myJYTz8b3eVCDG4o4wJyYN39AFoxFd8HkN3RKsjx +0TsW83OFUJyfSI4nz3AHDUPC6mUPRhXt90f7gKNwQkMNpweFaFNSVsulbPqOMnSgVpb A1pA82qcEX/n64HLtsLoQjBX8qjEuypa/UFoI9GdIeHYtuqq8oUaxvWBRTMl9+bEWifi nhOQZ4kothA91f40ZyYP8s2a4SWSmLRMW5h10snKngyBVs1JnC54uTHkFOQ96VlC3Rdx yePYIFAKPUqhNOy0s4BGR3/JrN/ufn0y1W8558l3niqmDa+f/LKV+0HQ0AikWm57jRAg p9Gw== 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=PLBxu4by6XAleLxA0oRaPfnYMJ02/YYfmJmpbm49NJpu1OJpOC6HcWFOZohue+Lsqa uDIyH6RVQt/odZ7aWFxTPMONjVCUDnT6N/1+J1y95gNY73oNLD1dBE2Jp6tJ+QKJR/3i vuDiMJzMWJMXnkziWMz/H70a56zr6aavlMQXgkMh3ev8XM0vOEnyZp8EY9xjegdGfl2L 0kyG83ZkkQUiXjZN59rISXO0qMbduPD2Ng36Qdr5PL2XHFJmUl0s67z2xb57nkj3WUlb X7n6PMAklL3H23NZR3u4y8QIn7ZrYHAffTzDpIAekm/wprYFOQiQKeGtr3vKbpwgSa46 cu/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxonhyperv.com header.s=default header.b=sRK8FtnU; 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 cs11-20020a0564020c4b00b0045bce3fe831si20115627edb.522.2022.10.21.17.05.38; Fri, 21 Oct 2022 17:06:02 -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=sRK8FtnU; 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 S230091AbiJVACR (ORCPT + 99 others); Fri, 21 Oct 2022 20:02:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229980AbiJVABq (ORCPT ); Fri, 21 Oct 2022 20:01:46 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 349F826B4BF; Fri, 21 Oct 2022 17:01:43 -0700 (PDT) Received: by linux.microsoft.com (Postfix, from userid 1004) id ED17E20FF4E3; Fri, 21 Oct 2022 17:01:39 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com ED17E20FF4E3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1666396899; bh=rxJ1l3XZAaUy7L0ulivQTclU3lx9TfDBngKUNfhY9VY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:From; b=sRK8FtnUozfkLyS/YoB/nxmO73Wxfagn8q+u6lK2kMwyds8Gay+L7vAqKr52OY+hg d5VDdtG/5q52K/NwCUv0Q794yuRmzs/ohJtioO8UyCn1FgrIPE9q1FaEa7gKuPMesN ereJhPgalqf4f2GuPWE9MBPr8RSJS0OZocjgBckw= 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 v9 06/12] net: mana: Record port number in netdev Date: Fri, 21 Oct 2022 17:01:23 -0700 Message-Id: <1666396889-31288-7-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1666396889-31288-1-git-send-email-longli@linuxonhyperv.com> References: <1666396889-31288-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?1747344070537691862?= X-GMAIL-MSGID: =?utf-8?q?1747344070537691862?= 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);