lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0835B3720019904CB8F7AA43166CEEB2EE92DB@RTITMBSV03.realtek.com.tw>
Date:	Thu, 12 Feb 2015 02:36:17 +0000
From:	Hayes Wang <hayeswang@...ltek.com>
To:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC:	nic_swsd <nic_swsd@...ltek.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>
Subject: RE: [PATCH net-next 1/3] r8152: separate USB_RX_EARLY_AGG

Sergei Shtylyov [mailto:sergei.shtylyov@...entembedded.com] 
[...]
> > +	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.

> > +	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.

> > +	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.
 
Best Regards,
Hayes
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ