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 9B42E43DC3; Tue, 2 Apr 2024 17:28:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 80AA54028C; Tue, 2 Apr 2024 17:28:58 +0200 (CEST) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mails.dpdk.org (Postfix) with ESMTP id 20F9D4026F for ; Tue, 2 Apr 2024 17:28:57 +0200 (CEST) Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1e0bfc42783so44094815ad.0 for ; Tue, 02 Apr 2024 08:28:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1712071736; x=1712676536; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=m2LClz5i79pMRz+PL/bW+P5jcPZm9Vdgz7gPfFz4tLQ=; b=gW7THgUTkJDSx+QRd5Ft0ynF3nN/63jls9vSM7hxQCY5mbLguRJG2E//7mQ8HW137g Duu6ZRVORkxY+wsaMst4AaWb1CPJwiLXl8176UzZoJaiYrp1F/LL94b7x/j6ayGpKjKM UbLwIpeZHEboyc4tM7qZZPl644j59cEbBx9YlNwjwwljFhHzxnhRl2wg0ptEyfiw8Wcn OsWckSFdD8AAiW0sx7Uda7Ds0/DX3muw6HKNxg2tw7eDqyTQSQOcry+vzojjUSKUTdkG H6BJP8tOk96BXoH++cbufzKyG8lPD2gZP74Tjd1odZgZTnQ8Jwzhe5wSmT/IgYZU3Syr 7UjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712071736; x=1712676536; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=m2LClz5i79pMRz+PL/bW+P5jcPZm9Vdgz7gPfFz4tLQ=; b=PlOH+faiHhaZC1j9JrfvAzNYIDOzTfDybiBoTP0Y2hOkvqWVLm0kw/5/NVeJER4D2J fQBUnj+nWH8dCmfpCcFAulHm+LFAW7D9Jn7CPmeElMiaXiTTtcfzSqx9QajByPzZO5Sk RvA1QxsfZJsheEDS6+lBhSZK1t9UERL1K61aCmLa3h5PutMwQjLSEj7pqHv7A5vaM1zm VMDLHkgOLcss8Q4sXEYEcnZTt5y3o6rhz116Xu+J2CF5dGev5e4E5ytyEJpJBY6JQeiV 3ERTkqlZbVXrDAfakHldQSTVTYamZQ0F4C0JtYCW+GOMWqNbutMgbmFgpExsH76pF1n2 avPA== X-Forwarded-Encrypted: i=1; AJvYcCWc+R5D9pp5wbU01wVwHJ0dvdLhXc5Fv2d8jM44I31cR5BzO1dX/O8/pte+a+1y3ap0hLl/ArKn9R5L4U4= X-Gm-Message-State: AOJu0Yy9vR9DoKl7DdIhMYE1s7IUpbfzvHX/+Bxs7cCAaP4rJtv3ty+7 K7SRsq+GSiUYix6Wh/XsUiW6IgDbo6npjFMfxUfBXYLgLqG6OgSCCK4BUJjNvJk= X-Google-Smtp-Source: AGHT+IHWhvXiKgvCFLilyoVP5NWngLc/lorh97Qq94ziM3GEFOV+HFvA3y1ri1uda7WBODCkfbG9nQ== X-Received: by 2002:a17:902:cf08:b0:1e2:3d75:f738 with SMTP id i8-20020a170902cf0800b001e23d75f738mr12339164plg.17.1712071736285; Tue, 02 Apr 2024 08:28:56 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id mn7-20020a1709030a4700b001e107222eb5sm11184047plb.191.2024.04.02.08.28.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 08:28:56 -0700 (PDT) Date: Tue, 2 Apr 2024 08:28:54 -0700 From: Stephen Hemminger To: huangdengdui Cc: Thomas Monjalon , Damodharam Ammepalli , Ajit Khaparde , "lihuisong (C)" , , , , , , , , , , Subject: Re: [PATCH v2 1/6] ethdev: support setting lanes Message-ID: <20240402082854.155c5507@hermes.local> In-Reply-To: <5f97ce5c-156e-4250-930f-01c5befdb681@huawei.com> References: <20240312075238.3319480-4-huangdengdui@huawei.com> <5d2ab42c-4b56-4a40-8e0c-3ac9a5e34ec6@huawei.com> <4326199.QLehXeTyEo@thomas> <5f97ce5c-156e-4250-930f-01c5befdb681@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, 2 Apr 2024 16:37:39 +0800 huangdengdui wrote: > On 2024/4/2 4:07, Thomas Monjalon wrote: > > 30/03/2024 12:38, huangdengdui: > >> But, there are different solutions for the device to report the setting > >> lane capability, as following: > >> 1. Like the current patch, reporting device capabilities in speed and > >> lane coupling mode. However, if we use this solution, we will have > >> to couple the the lanes setting with speed setting. > >> > >> 2. Like the Damodharam's RFC patch [1], the device reports the maximum > >> number of supported lanes. Users can config a lane randomly, > >> which is completely separated from the speed. > >> > >> 3. Similar to the FEC capability reported by a device, the device reports the > >> relationship table of the number of lanes supported by the speed, > >> for example: > >> speed lanes_capa > >> 50G 1,2 > >> 100G 1,2,4 > >> 200G 2,4 > >> > >> Options 1 and 2 have been discussed a lot above. > >> > >> For solution 1, the speed and lanes are over-coupled, and the implementation is too > >> complex. But I think it's easier to understand and easier for the device to report > >> capabilities. In addition, the ethtool reporting capability also uses this mode. > >> > >> For solution 2, as huisong said that user don't know what lanes should or can be set > >> for a specified speed on one NIC. > >> > >> I think that when the device reports the capability, the lanes should be associated > >> with the speed. In this way, users can know which lanes are supported by the current > >> speed and verify the configuration validity. > >> > >> So I think solution 3 is better. What do you think? > > > > I don't understand your proposals. > > Please could you show the function signature for each option? > > > > > > I agree with separating the lanes setting from the speed setting. > I have a different proposal for device lanes capability reporting. > > Three interfaces are added to the lib/ethdev like FEC interfaces. > 1. rte_eth_lanes_get(uint16_t port_id, uint32_t *capa) /* get current lanes */ > 2. rte_eth_lanes_set(uint16_t port_id, uint32_t capa) > 3. rte_eth_lanes_get_capa(uint16_t port_id, struct rte_eth_lanes_capa *speed_lanes_capa) > > /* A structure used to get capabilities per link speed */ > struct rte_eth_lanes_capa { > uint32_t speed; /**< Link speed (see RTE_ETH_SPEED_NUM_*) */ > uint32_t capa; /**< lanes capabilities bitmask */ > }; > > For example, an ethdev report the following lanes capability array: > struct rte_eth_lanes_capa[] device_capa = { > { RTE_ETH_SPEED_NUM_50G, 0x0003 }, //supports lanes 1 and 2 for 50G > { RTE_ETH_SPEED_NUM_100G, 0x000B } //supports lanes 1, 2 and 4 for 100G > }; > > The application can know which lanes are supported at a specified speed. > > I think it's better to implement the setting lanes feature in this way. > > Welcom to jump into discuss. Wouldn't the best way to handle this be to make lanes as similar as possible to how link speed is handled in ethdev now. It would mean holding off until 24.11 release to do it right. Things like adding link_lanes to rte_eth_link struct