public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: xiaolei wang <xiaolei.wang@windriver.com>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: linux@armlinux.org.uk, andrew@lunn.ch,
	alexandre.torgue@foss.st.com, joabreu@synopsys.com,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, mcoquelin.stm32@gmail.com,
	wojciech.drewek@intel.com, netdev@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [net v4 PATCH] net: stmmac: replace priv->speed with the portTransmitRate from the tc-cbs parameters
Date: Sat, 8 Jun 2024 20:32:36 +0800	[thread overview]
Message-ID: <1394b6f3-b9cc-4526-94da-a1edc361eaf7@windriver.com> (raw)
In-Reply-To: <20240608111621.oasttwwkhsmpcl4y@skbuf>


On 6/8/24 19:16, Vladimir Oltean wrote:
> CAUTION: This email comes from a non Wind River email account!
> Do not click links or open attachments unless you recognize the sender and know the content is safe.
>
> On Sat, Jun 08, 2024 at 12:45:57PM +0800, Xiaolei Wang wrote:
>> The current cbs parameter depends on speed after uplinking,
>> which is not needed and will report a configuration error
>> if the port is not initially connected. The UAPI exposed by
>> tc-cbs requires userspace to recalculate the send slope anyway,
>> because the formula depends on port_transmit_rate (see man tc-cbs),
>> which is not an invariant from tc's perspective. Therefore, we
>> use offload->sendslope and offload->idleslope to derive the
>> original port_transmit_rate from the CBS formula.
>>
>> Fixes: 1f705bc61aee ("net: stmmac: Add support for CBS QDISC")
>> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
>> Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
>> ---
>>
>> Change log:
>>
>> v1:
>>      https://patchwork.kernel.org/project/linux-arm-kernel/patch/20240528092010.439089-1-xiaolei.wang@windriver.com/
>> v2:
>>      Update CBS parameters when speed changes after linking up
>>      https://patchwork.kernel.org/project/linux-arm-kernel/patch/20240530061453.561708-1-xiaolei.wang@windriver.com/
>> v3:
>>      replace priv->speed with the  portTransmitRate from the tc-cbs parameters suggested by Vladimir Oltean
>>      link: https://patchwork.kernel.org/project/linux-arm-kernel/patch/20240607103327.438455-1-xiaolei.wang@windriver.com/
>> v4:
>>      Delete speed_div variable, delete redundant port_transmit_rate_kbps = qopt->idleslope - qopt->sendslope; and update commit log
>>
>>   .../net/ethernet/stmicro/stmmac/stmmac_tc.c   | 20 +++++++------------
>>   1 file changed, 7 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
>> index 222540b55480..87af129a6a1d 100644
>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
>> @@ -344,10 +344,11 @@ static int tc_setup_cbs(struct stmmac_priv *priv,
>>   {
>>        u32 tx_queues_count = priv->plat->tx_queues_to_use;
>>        u32 queue = qopt->queue;
>> -     u32 ptr, speed_div;
>> +     u32 ptr;
>>        u32 mode_to_use;
>>        u64 value;
>>        int ret;
>> +     s64 port_transmit_rate_kbps;
> The feedback that came along with Wojciech's review in v3 was to use
> reverse Christmas tree (RCT) variable ordering. That means to sort
> variable declarations from longest line to shortest. It is the de facto
> coding style standard for kernel networking code.

I will send a new version

thanks

xiaolei

>
> pw-bot: changes-requested

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2024-06-08 12:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-08  4:45 [net v4 PATCH] net: stmmac: replace priv->speed with the portTransmitRate from the tc-cbs parameters Xiaolei Wang
2024-06-08 11:16 ` Vladimir Oltean
2024-06-08 12:32   ` xiaolei wang [this message]
2024-06-08 12:43 ` Vladimir Oltean

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=1394b6f3-b9cc-4526-94da-a1edc361eaf7@windriver.com \
    --to=xiaolei.wang@windriver.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=joabreu@synopsys.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=wojciech.drewek@intel.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