From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1C409A034C for ; Fri, 12 Aug 2022 09:11:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0B9B8406A2; Fri, 12 Aug 2022 09:11:36 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2041.outbound.protection.outlook.com [40.107.94.41]) by mails.dpdk.org (Postfix) with ESMTP id 83C5240697 for ; Fri, 12 Aug 2022 09:11:35 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GYNVVSSklw9cN8jj6O5PJcKpcNB8x2RcigXeLtQKj/Is3OHpZ8PeqDYwalg0gbx0dGYyGGwjJnNQocP7Ls4g6cgD5cwnubBMPLqrf0PYE+VIqnDMx1hIBP7h83s/EGsJwF9lySI3odJ3xkhYo/05zuIay/r3IC7Iz6i3K48VYKaJvBKAmBc/mdW/b65uY06fbAlJ9P3IysX8n7rdZM2yCIp87IZHl3yiM7WDMcwmdoyq2bhpS+L/+ktj6sDHD3K6ZV637W0Kr1Mp9B8c50IEeMAneL8xyOBpqNLZ+q0jeOTA4t/Lut70e1TD6bLt5BvFLIl6dbWX/sXvL92FfauBXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4tEOkAhw/jWKEZkPM6KQ7137jdp9BO03032k7VdBCIc=; b=YA8H7hBJW8qyeMMVIS47tE+2WNLRYRWGJKyPMyw9lrVYGAP0cr9PgWFoWfNQ4YGpKoPUEzbLflU5Ashpk8nFrccSBLuqnEYrMREkUzbJFWnqtOPssBuvb15UypNUPv5FfbHkvCFGMJVE4A0PisqMTyf+VbqN+fcvqq68AGcD4TsPfZprGBkhlyYYuOQuPfGoAN2djNpsCRi8NsN1ef5gpFMqix1lFut21YEqmoY0wuTm9gTPhGCX5uHUnkkQAAZ/Q6EDVnWAki2q1LaKktuwh/Qyw9bFNWcGJu5CLFOZ4nSaRD6R8BBkraijpwXqswJXsS3UP1d9Aoxek8zljGAS6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4tEOkAhw/jWKEZkPM6KQ7137jdp9BO03032k7VdBCIc=; b=LDPOF3bwCjPyeaQfo70tz+o23QietQ4tg2u9FcLGGUUbIih+6A2EPttMWrawGCVU3SkxdnV86M3CcFzUJEaTyHo9cb42JGSNnJZ2/YNJHIUS4CDn6uYW9CdF2t0V64kyI+C2p+2ysmGVklryVX0EdE7KDTZ4kl2h8PAdWCKnyeJAEaRk1QP/zzgT+Kguu6SozL9UNhrRb27NUDp8TbZCbpf3w9SAq/yAPfX5vH5QeDvcaaNpEbFMWom4Nbx2u+akYx377xkuNJEy4a+WeuToCPCkWe8ZfD7CcYqrAyvQYxQNuQLK//L7VG+EmNT0e3OQv+1UNAlvxP6t9h5OnQo/OA== Received: from DM4PR12MB5373.namprd12.prod.outlook.com (2603:10b6:5:39d::14) by BYAPR12MB2838.namprd12.prod.outlook.com (2603:10b6:a03:6f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.16; Fri, 12 Aug 2022 07:11:32 +0000 Received: from DM4PR12MB5373.namprd12.prod.outlook.com ([fe80::442b:be8b:c1ec:a6ee]) by DM4PR12MB5373.namprd12.prod.outlook.com ([fe80::442b:be8b:c1ec:a6ee%3]) with mapi id 15.20.5504.024; Fri, 12 Aug 2022 07:11:31 +0000 From: "Xueming(Steven) Li" To: Huisong Li , "stable@dpdk.org" CC: "liudongdong3@huawei.com" , "fengchengwen@huawei.com" , "huangdaode@huawei.com" Subject: RE: [PATCH 20.11] net/hns3: support backplane media type Thread-Topic: [PATCH 20.11] net/hns3: support backplane media type Thread-Index: AQHYrW42QrMTmt2ki0uLPmqnqZYZ862q2o9g Date: Fri, 12 Aug 2022 07:11:31 +0000 Message-ID: References: <20220811103523.23083-1-lihuisong@huawei.com> In-Reply-To: <20220811103523.23083-1-lihuisong@huawei.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 50903b87-07d9-44f5-6279-08da7c31e254 x-ms-traffictypediagnostic: BYAPR12MB2838:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: yEDQ0peW5rT5NjtPpwJ6a1a6E3xLbsoq/ZBxy++76E2AXHCZqgCVmyIhMdXbkNuH31PukjBaMEV5ffKhFXoPyBmgrUe7NdsC6C1Wnbx7Lk0HF3bYYNBQoELXoUFA4qtammqGzzXSdWzP3tyqvm/l5WyjE5vNVjvOhsCyi5eSF9/dBu6QPyTS++PoXGSzBGg4s/oPErxJOAx09SaesGCSBhg+HDkTsf/eJ3yp2XwHA/Ql/F45IJl5IustacSglr0zV55p55uO5O41j3wWvjyp/3b16EZHUuIRt8U+mKbAdqOTpNp2Y3bXqOQR9/6zsXXDqBt764hWczBTE0w806AzCKR83YxoFausbcLKju+b9PjKZGXZkJX5euW5jjU/AopGoW5gXS8tmFbDorx8TFSegDunoqRhhHWgbPc1UHppCkbzzzcfWxxGFcRszrklcAphL5j2TnA4zGGNdyg+qgwALMTbNWJNZNi4z48XZ6A7RYyv+KHVUnu01nTTHADCQ0ngUXakPz4PyMZsq8+8dTRmLiBmn4c6dg3nLiJBOSUqYo5J6X768khP1fbm8pmM9zYFWF2lUvW7TaHV+AsK0OYIBq5MEGIPs2iRDOqdv9/YoX6m++62NnYWZp8QlRBbalhO44v6EQQCEEqSzM7v0oHxksmbUaWbfdQcMfAGNYqZwdfhjntS+m3Xot1Jq/az2n3wOQOYyaR8LpwWi64kwl3j20xGJx+ibbsHEKSZv5temYjII0efGpKS9II87rU0H6O100AKhTRT6Wb7r/qAESUEpt/EURAbB6ZYcbwP50tnm6ZXr05ojuWf36Al+pP8nIOD x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR12MB5373.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(346002)(136003)(39860400002)(396003)(366004)(376002)(7696005)(478600001)(41300700001)(71200400001)(66946007)(66556008)(66476007)(66446008)(64756008)(8676002)(4326008)(86362001)(6506007)(53546011)(316002)(54906003)(110136005)(38100700002)(122000001)(76116006)(38070700005)(186003)(9686003)(26005)(83380400001)(55016003)(5660300002)(33656002)(2906002)(8936002)(52536014); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?oBBUTDq17hjBsiqftpkOyyR4a9hjetgIqR3Mt/zNitQHdcTulLi9RZ+9mVdp?= =?us-ascii?Q?+/LUu802AgYvGfp5X5abR8a0SKUnhbyA6Y52ZrVymG9UrL41D+uWpiX1MEdd?= =?us-ascii?Q?KmHYgsbeKpYTUdY20AjIVPX1v9SYHrPqXcTsLnx//1178dk2BPgk+wHTGyXE?= =?us-ascii?Q?EUe5xUAU7lNEdE4UhRohnkmWbFeFBKe8f70Y9tp2imBIYtsjyA15CEh/6rDU?= =?us-ascii?Q?ey4vJ+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POyZcoAkdGmKePXf1LORb?= =?us-ascii?Q?8GzYdg4ExgGtHFV2jQWMm43U0yYc0+H8v++1ck5gdxIleJz+N4Fiudix0JSq?= =?us-ascii?Q?63nHDJF0lQYGQGTKNW9fYX43WCox7Ezud64OSsBkhQq3vWDOvmpxKIl2IzcV?= =?us-ascii?Q?3RB5Wti/cHCr0Ja7x0+su7fiGtboKgWUUN96RN3dADzYUvmiG07/I+ivG2vx?= =?us-ascii?Q?8L/3ifgKWlosO7uO6t6UMB++jt01LQ632DS9vBmm8hU/YZq7OGzQh41A3Pw9?= =?us-ascii?Q?BXYuWxH6T03lql+KSe9wzIXmV29w94T1uasOr6/Dn5Al9dKd1bUWhESl2KzO?= =?us-ascii?Q?V9t44GAcYTCBoM2kZ0yC+wVGvVGt9/Ts2YpnwS92gOWDvxw7OwLU3j9eI8Ay?= =?us-ascii?Q?Jt4xqzhJaOcZMYT8ZPYmF8se5/ynaNfPuBr+VrRRaKtWwVEdVMIEKUDG8wOa?= =?us-ascii?Q?MKM2mCw4K4pRbIZb1Gq34O7GNU1+0f4SVmowWL/L?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 50903b87-07d9-44f5-6279-08da7c31e254 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Aug 2022 07:11:31.8613 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: K6UfJyEb5xtjKJQwb4DLjgclNFlkt3meJqBlUK/sXWd3NZ/zDn0czw7OqdlhjdrDZwWqn68ExmvimLOJ76NipA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB2838 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Thanks, applied. > -----Original Message----- > From: Huisong Li > Sent: Thursday, August 11, 2022 6:35 PM > To: stable@dpdk.org; Xueming(Steven) Li > Cc: liudongdong3@huawei.com; fengchengwen@huawei.com; huangdaode@huawei.c= om; lihuisong@huawei.com > Subject: [PATCH 20.11] net/hns3: support backplane media type >=20 > From: Chengwen Feng >=20 > [ upstream commit 916508f002ae887942ab3b970db33c0cc7fc6c02 ] >=20 > The 802.11 physical PMA sub-layer defines three media: copper, fiber and = backplane. For PMD, the backplane is similar to the fiber, the > main differences are that backplane doesn't have optical module. >=20 > Because the interface of firmware fiber is also applicable to the backpla= ne, this patch supports the backplane only through simple extension. >=20 > Signed-off-by: Chengwen Feng > Signed-off-by: Dongdong Liu > --- > drivers/net/hns3/hns3_ethdev.c | 41 ++++++++++++++++++++++++++-------- > 1 file changed, 32 insertions(+), 9 deletions(-) >=20 > diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethde= v.c index b2ff59ef62..f5fdcafa4f 100644 > --- a/drivers/net/hns3/hns3_ethdev.c > +++ b/drivers/net/hns3/hns3_ethdev.c > @@ -3139,6 +3139,34 @@ hns3_get_capability(struct hns3_hw *hw) > return 0; > } >=20 > +static int > +hns3_check_media_type(struct hns3_hw *hw, uint8_t media_type) { > + int ret; > + > + switch (media_type) { > + case HNS3_MEDIA_TYPE_COPPER: > + if (!hns3_dev_copper_supported(hw)) { > + PMD_INIT_LOG(ERR, > + "Media type is copper, not supported."); > + ret =3D -EOPNOTSUPP; > + } else { > + ret =3D 0; > + } > + break; > + case HNS3_MEDIA_TYPE_FIBER: > + case HNS3_MEDIA_TYPE_BACKPLANE: > + ret =3D 0; > + break; > + default: > + PMD_INIT_LOG(ERR, "Unknown media type =3D %u!", media_type); > + ret =3D -EINVAL; > + break; > + } > + > + return ret; > +} > + > static int > hns3_get_board_configuration(struct hns3_hw *hw) { @@ -3153,11 +3181,9 = @@ hns3_get_board_configuration(struct hns3_hw *hw) > return ret; > } >=20 > - if (cfg.media_type =3D=3D HNS3_MEDIA_TYPE_COPPER && > - !hns3_dev_copper_supported(hw)) { > - PMD_INIT_LOG(ERR, "media type is copper, not supported."); > - return -EOPNOTSUPP; > - } > + ret =3D hns3_check_media_type(hw, cfg.media_type); > + if (ret) > + return ret; >=20 > hw->mac.media_type =3D cfg.media_type; > hw->rss_size_max =3D cfg.rss_size_max; > @@ -4488,14 +4514,11 @@ hns3_update_link_info(struct rte_eth_dev *eth_dev= ) { > struct hns3_adapter *hns =3D eth_dev->data->dev_private; > struct hns3_hw *hw =3D &hns->hw; > - int ret =3D 0; >=20 > if (hw->mac.media_type =3D=3D HNS3_MEDIA_TYPE_COPPER) > return 0; > - else if (hw->mac.media_type =3D=3D HNS3_MEDIA_TYPE_FIBER) > - ret =3D hns3_update_fiber_link_info(hw); >=20 > - return ret; > + return hns3_update_fiber_link_info(hw); > } >=20 > static int > -- > 2.22.0