From: Ferruh Yigit <ferruh.yigit@amd.com>
To: Chaoyong He <chaoyong.he@corigine.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: oss-drivers <oss-drivers@corigine.com>,
Niklas Soderlund <niklas.soderlund@corigine.com>,
James Hershaw <james.hershaw@corigine.com>
Subject: Re: [PATCH v2 2/2] net/nfp: write link speed to control BAR
Date: Mon, 13 Mar 2023 08:39:44 +0000 [thread overview]
Message-ID: <a2c70507-54e2-c754-5407-0727388449c3@amd.com> (raw)
In-Reply-To: <SJ0PR13MB5545808C27EB5405A6A9E9379EB99@SJ0PR13MB5545.namprd13.prod.outlook.com>
On 3/13/2023 3:03 AM, Chaoyong He wrote:
>> On 3/10/2023 6:25 AM, Chaoyong He wrote:
>>> + /**
>>> + * Shift and mask nn_link_status so that it is effectively the value
>>> + * at offset NFP_NET_CFG_STS_NSP_LINK_RATE.
>>> + */
>>> + nn_link_status = (nn_link_status >>
>> NFP_NET_CFG_STS_LINK_RATE_SHIFT) &
>>> + NFP_NET_CFG_STS_LINK_RATE_MASK;
>>
>> Thanks for extensive commenting, perhaps this is the source of confusion, I
>> can't see how above logic makes effectively the value at offset LINK_RATE.
>>
>> NFP_NET_CFG_STS_LINK_RATE_SHIFT = 1
>> NFP_NET_CFG_STS_LINK_RATE_MASK = 0xF
>>
>> NFP_NET_CFG_STS = 0x34
>> NFP_NET_CFG_STS_NSP_LINK_RATE = 0x36
>>
>> nfp_net_notify_port_speed()
>> uint16_t speed;
>> *(0x36) = speed
>>
>> nfp_net_link_update()
>> uint16_t val = *(0x34)
>> val = (val >> 1) & 0xF;
>>
>>
>> How come 'speed' and 'val' are same value?
>>
>> Either there is a mistake or FW is making something in the background, I am
>> trying to clarify this in past few comments but not able to yet.
>
> Yes, here FW does do something in the background.
> ----------------------------------------------------------------------------
>
> 16 bit write only 16 bit read only
>
> | x x x x x x x x x x x x y y y y | x x x x x x x x x x x y y y y x |
>
> ^ ^
>
> 0x36 0x34
> ------------------------------------------------------------------------------
> The firmware confirm that whatever write into ‘yyyy’ field of 0x36 can be read from ‘yyyy’ field of 0x34.
>
Thanks, I was looking for this, I am progressing with the patch.
next prev parent reply other threads:[~2023-03-13 8:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-21 6:29 [PATCH] " Chaoyong He
2023-02-23 16:39 ` Ferruh Yigit
2023-03-06 7:06 ` Chaoyong He
2023-03-07 13:24 ` Ferruh Yigit
2023-03-10 6:07 ` Chaoyong He
2023-03-10 6:25 ` [PATCH v2 0/2] " Chaoyong He
2023-03-10 6:25 ` [PATCH v2 1/2] net/nfp: add helper functions for read/write 16b values Chaoyong He
2023-03-10 6:25 ` [PATCH v2 2/2] net/nfp: write link speed to control BAR Chaoyong He
2023-03-10 11:15 ` Ferruh Yigit
2023-03-13 3:03 ` Chaoyong He
2023-03-13 8:39 ` Ferruh Yigit [this message]
2023-03-13 10:18 ` [PATCH v2 0/2] " Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a2c70507-54e2-c754-5407-0727388449c3@amd.com \
--to=ferruh.yigit@amd.com \
--cc=chaoyong.he@corigine.com \
--cc=dev@dpdk.org \
--cc=james.hershaw@corigine.com \
--cc=niklas.soderlund@corigine.com \
--cc=oss-drivers@corigine.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).