mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hayes Wang <hayeswang@realtek.com>
To: Hayes Wang <hayeswang@realtek.com>,
	Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: nic_swsd <nic_swsd@realtek.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: RE: [PATCH net-next 1/3] r8152: separate USB_RX_EARLY_AGG
Date: Thu, 12 Feb 2015 06:04:06 +0000	[thread overview]
Message-ID: <0835B3720019904CB8F7AA43166CEEB2EE9373@RTITMBSV03.realtek.com.tw> (raw)
In-Reply-To: <0835B3720019904CB8F7AA43166CEEB2EE92DB@RTITMBSV03.realtek.com.tw>

 Sergei Shtylyov; netdev@vger.kernel.org
[...]
> > > +	ocp_data = tp->coalesce / 8;
> >
> >     Why not do it in the initializer?
>
> This is for patch #3. The patch #3 would use this function.
> The unit of the relative setting from the ethtool is 1 us.
> However, the unit for the hw is 8 us. Therefore, I save the
> value with the unit of 1 us, and transfer it to the unit of
> the hw when setting.

I think I misunderstand what you mean. I think you mean I
have to combine

	u32 ocp_data;
	ocp_data = tp->coalesce / 8;

into

	u32 ocp_data = tp->coalesce / 8;

I would correct it.

> > > +	ocp_write_word(tp, MCU_TYPE_USB, USB_RX_EARLY_TIMEOUT, ocp_data);
> > > +}
> > > +
> > > +static void r8153_set_rx_early_size(struct r8152 *tp)
> > > +{
> > > +	struct net_device *dev = tp->netdev;
> >
> >     Not sure you actually need this variable.
>
> If I replace dev->mtu with tp->netdev->mtu, the line would
> more than 80 characters. This is used to avoid it. Should
> I remove it?
>
> > > +	u32 ocp_data;
> > > +
> > > +	ocp_data = (agg_buf_sz - dev->mtu - VLAN_ETH_HLEN - VLAN_HLEN) / 4;
> >
> >     Why not in initializer?
>
> This is for patch #2. The patch #2 would use this function.
> It has to be re-calculated when the mtu is changed, or the
> function is called when the linking status changes to ON.

I think you mean I have to combine

	u32 ocp_data;
	ocp_data = (agg_buf_sz - dev->mtu - VLAN_ETH_HLEN - VLAN_HLEN) / 4;

into

	u32 ocp_data = (agg_buf_sz - dev->mtu - VLAN_ETH_HLEN - VLAN_HLEN) / 4;

I would correct it.

> > > +	ocp_write_word(tp, MCU_TYPE_USB, USB_RX_EARLY_SIZE, ocp_data);
> > >   }
> > [...]
> > > @@ -3911,6 +3907,13 @@ static int rtl8152_probe(struct
> > usb_interface *intf,
> > >   	tp->mii.reg_num_mask = 0x1f;
> > >   	tp->mii.phy_id = R8152_PHY_ID;
> > >
> > > +	if (udev->speed == USB_SPEED_SUPER)
> > > +		tp->coalesce = COALESCE_SUPER;
> > > +	else if (udev->speed == USB_SPEED_HIGH)
> > > +		tp->coalesce = COALESCE_HIGH;
> > > +	else
> > > +		tp->coalesce = COALESCE_SLOW;
> >
> >     This is asking to be a *switch* statement.
>
> Excuse me. I don't understand what you mean.
> The usb speed is determined when the device is plugged on
> the usb host controller or usb hub. The usb speed wouldn't
> chage unless you unplug the device and plug it to another
> port with different usb speed. Therefore, I provide different
> default values for different usb speed.

I think you mean

	switch (udev->speed) {
	case USB_SPEED_SUPER:
		...

I would correct it.
 
Best Regards,
Hayes

  reply	other threads:[~2015-02-12  6:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-11  6:46 [PATCH net-next 0/3] Adjust the settings about USB_RX_EARLY_AGG Hayes Wang
2015-02-11  6:46 ` [PATCH net-next 1/3] r8152: separate USB_RX_EARLY_AGG Hayes Wang
2015-02-11 13:52   ` Sergei Shtylyov
2015-02-12  2:36     ` Hayes Wang
2015-02-12  6:04       ` Hayes Wang [this message]
2015-02-12 11:37       ` Sergei Shtylyov
2015-02-11  6:46 ` [PATCH net-next 2/3] r8152: change rx early size when the mtu is changed Hayes Wang
2015-02-11  6:46 ` [PATCH net-next 3/3] r8152: support setting rx coalesce Hayes Wang
2015-02-12  6:33 ` [PATCH net-next v2 0/3] Adjust the settings about USB_RX_EARLY_AGG Hayes Wang
2015-02-12  6:33   ` [PATCH net-next v2 1/3] r8152: separate USB_RX_EARLY_AGG Hayes Wang
2015-02-12  6:33   ` [PATCH net-next v2 2/3] r8152: change rx early size when the mtu is changed Hayes Wang
2015-02-12  6:33   ` [PATCH net-next v2 3/3] r8152: support setting rx coalesce Hayes Wang
2015-02-19 20:09   ` [PATCH net-next v2 0/3] Adjust the settings about USB_RX_EARLY_AGG David Miller

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=0835B3720019904CB8F7AA43166CEEB2EE9373@RTITMBSV03.realtek.com.tw \
    --to=hayeswang@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    --cc=sergei.shtylyov@cogentembedded.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

all inboxes | Powered by JetHome®