netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Justin Lai <justinlai0215@realtek.com>
Cc: "kuba@kernel.org" <kuba@kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Ping-Ke Shih <pkshih@realtek.com>,
	Larry Chiu <larry.chiu@realtek.com>
Subject: Re: [PATCH net-next] rtase: Add ndo_setup_tc support for CBS offload in traffic control setup
Date: Tue, 25 Mar 2025 17:20:53 +0000	[thread overview]
Message-ID: <20250325172053.GX892515@horms.kernel.org> (raw)
In-Reply-To: <ab27fd1a1e9d40759e090346eafb5881@realtek.com>

On Mon, Mar 24, 2025 at 12:06:09PM +0000, Justin Lai wrote:
> > 
> > > On Fri, Mar 14, 2025 at 05:40:21PM +0800, Justin Lai wrote:
> > > > Add support for ndo_setup_tc to enable CBS offload functionality as
> > > > part of traffic control configuration for network devices.
> > > >
> > > > Signed-off-by: Justin Lai <justinlai0215@realtek.com>
> > >
> > > ...
> > >
> > > > diff --git a/drivers/net/ethernet/realtek/rtase/rtase_main.c
> > > > b/drivers/net/ethernet/realtek/rtase/rtase_main.c
> > > > index 2aacc1996796..2a61cd192026 100644
> > > > --- a/drivers/net/ethernet/realtek/rtase/rtase_main.c
> > > > +++ b/drivers/net/ethernet/realtek/rtase/rtase_main.c
> > > > @@ -1661,6 +1661,54 @@ static void rtase_get_stats64(struct
> > > > net_device
> > > *dev,
> > > >       stats->rx_length_errors = tp->stats.rx_length_errors;  }
> > > >
> > > > +static void rtase_set_hw_cbs(const struct rtase_private *tp, u32
> > > > +queue) {
> > > > +     u32 idle = tp->tx_qos[queue].idleslope * RTASE_1T_CLOCK;
> > > > +     u32 val, i;
> > > > +
> > > > +     val = u32_encode_bits(idle / RTASE_1T_POWER,
> > > RTASE_IDLESLOPE_INT_MASK);
> > > > +     idle %= RTASE_1T_POWER;
> > > > +
> > > > +     for (i = 1; i <= RTASE_IDLESLOPE_INT_SHIFT; i++) {
> > > > +             idle *= 2;
> > > > +             if ((idle / RTASE_1T_POWER) == 1)
> > > > +                     val |= BIT(RTASE_IDLESLOPE_INT_SHIFT - i);
> > > > +
> > > > +             idle %= RTASE_1T_POWER;
> > > > +     }
> > > > +
> > > > +     rtase_w32(tp, RTASE_TXQCRDT_0 + queue * 4, val); }
> > > > +
> > > > +static void rtase_setup_tc_cbs(struct rtase_private *tp,
> > > > +                            const struct tc_cbs_qopt_offload *qopt)
> > {
> > > > +     u32 queue = qopt->queue;
> > >
> > > Hi Justin,
> > >
> > > Does queue need to be checked somewhere to make sure it is in range?
> > 
> > Hi Simon,
> > 
> > Thank you for your response. I will add a check to ensure that the queue is
> > within the specified range.
> 
> Hi Simon,
> 
> Given that our hardware supports CBS offload on each queue, could it
> be possible that checking the range of qopt->queue might not be
> necessary?

Hi Justin,

If qopt->queue can only be a valid queue, and all queues support
CBS, then I guess it would not be necessary.

      reply	other threads:[~2025-03-25 17:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-14  9:40 [PATCH net-next] rtase: Add ndo_setup_tc support for CBS offload in traffic control setup Justin Lai
2025-03-19 12:34 ` Simon Horman
2025-03-20  3:44   ` Justin Lai
2025-03-24 12:06     ` Justin Lai
2025-03-25 17:20       ` Simon Horman [this message]

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=20250325172053.GX892515@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=justinlai0215@realtek.com \
    --cc=kuba@kernel.org \
    --cc=larry.chiu@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pkshih@realtek.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).