From patchwork Thu Nov 3 19:16:24 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: 15116 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp720956wru; Thu, 3 Nov 2022 12:19:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5l6V6qtZGQJm46MkRmay7b05z3rIXEKonv1n55ybXYF8Q9WNQqLvWTLLKde4D5L/wb0I2v X-Received: by 2002:a63:5b23:0:b0:46f:6d7d:cd10 with SMTP id p35-20020a635b23000000b0046f6d7dcd10mr27665731pgb.194.1667503198386; Thu, 03 Nov 2022 12:19:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667503198; cv=none; d=google.com; s=arc-20160816; b=tYUjVgJNX1zVcFyf5yNPEANW+1Pe+A3zXusS1lsoFmCZr1WMnzB63ysSORnJTpMSrc pJoPsgTqG07YEZvoFMRCWqGijkNjBpFK9VwNSZlYo2Qi3eSUqfcCIsLYfUwHGrUcjuaJ Oz1stPvMBeBpT4bw9mfxTiJgj4om/vzKfrPRSPm4nky+nfWoWc8P8kyc7TlmXyzNhKVv F3zsulA2QGdxIG5AhWI8n0HMnGY0MBOM/Mm1TcVAik6wS69JNz8ygoJFNkisGAEVZW3T Ys/Mz9QwKxL90c54X58vu+z/FfNvruLsR3x42s1B6AShxTzv8ModuwbBid8qTuKULBtO qYzg== 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=zxNgoqY8Ii+5XJc2m/rpao9FQDlEI48cmqCKJZ6kJ6R5fCaxHABpVuaibS0l6oxjMd OYGudIK3+u/nMVkQU2aTPMD5iinE9INMO+Vn3gmBbYEkVLSHvT2ACJMS+hpVVGWXavxd hErVeqKwCucr1WzCcOr2imEG0nINsokVPUTekB2tcDKe1+R5Egi1QVoqoYFCdqF2CADL tQZ6RCl5MA7mA9+imcmxAxswTIgGF4HWwvXbMu7rR3cOpqYLwuNRxJShRisXlrwxv2RT bmN9Bpi3EvyYVyurXaCs/os7waUvaAkDUws13F1hbwtbr1uV0vC8Dg2xI9kKFG/FDN56 GxWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxonhyperv.com header.s=default header.b=UvhchW1G; 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 om5-20020a17090b3a8500b00209a3e49f63si820011pjb.94.2022.11.03.12.19.45; Thu, 03 Nov 2022 12:19:58 -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=UvhchW1G; 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 S231652AbiKCTSx (ORCPT + 99 others); Thu, 3 Nov 2022 15:18:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231421AbiKCTQ5 (ORCPT ); Thu, 3 Nov 2022 15:16:57 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id ECF651FCCC; Thu, 3 Nov 2022 12:16:56 -0700 (PDT) Received: by linux.microsoft.com (Postfix, from userid 1004) id D0EB0205DA45; Thu, 3 Nov 2022 12:16:56 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com D0EB0205DA45 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1667503016; bh=rxJ1l3XZAaUy7L0ulivQTclU3lx9TfDBngKUNfhY9VY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:From; b=UvhchW1GvcTupM9lxob/3UAP4CMJG77tb/qMMIkMMznwfBtn/JiEDoYDE9kTqfEki NrkH/gg2/IfC/A+NaIR7/z9OZA0vR4Cvy7UEifVZfPfU+oOgMfiknsSrdpUWYyL+8V 8eLwC5yLvIH6pl+wj/tJzu5jJ5di8jaRpjbICjYs= 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 v10 06/12] net: mana: Record port number in netdev Date: Thu, 3 Nov 2022 12:16:24 -0700 Message-Id: <1667502990-2559-7-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1667502990-2559-1-git-send-email-longli@linuxonhyperv.com> References: <1667502990-2559-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?1748503833998889374?= X-GMAIL-MSGID: =?utf-8?q?1748503833998889374?= 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);