RE: [PATCH net-next 3/3] r8169: support new chips of RTL8111F

From: hayeswang
Date: Thu Sep 01 2011 - 02:03:01 EST




> -----Original Message-----
> From: Francois Romieu [mailto:romieu@xxxxxxxxxxxxx]
> Sent: Thursday, September 01, 2011 3:14 AM
> To: Hayeswang
> Cc: netdev@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH net-next 3/3] r8169: support new chips of RTL8111F
>
> Hayes Wang <hayeswang@xxxxxxxxxxx> :
> [...]
> > diff --git a/drivers/net/ethernet/realtek/r8169.c
> > b/drivers/net/ethernet/realtek/r8169.c
> > index 68f1e2f..c04fbc0 100644
> > --- a/drivers/net/ethernet/realtek/r8169.c
> > +++ b/drivers/net/ethernet/realtek/r8169.c
> [...]
> > @@ -4476,6 +4602,49 @@ static void
> rtl_hw_start_8168e_2(void __iomem *ioaddr, struct pci_dev *pdev)
> > RTL_W8(Config5, RTL_R8(Config5) & ~Spi_en); }
> >
> > +static void rtl_hw_start_8168f_1(void __iomem *ioaddr,
> struct pci_dev
> > +*pdev)
> [...]
> > + RTL_W8(MaxTxPacketSize, 0x27);
>
> Hmmm...
>
> $ grep MaxTxPacketSize drivers/net/r8169.c
> MaxTxPacketSize = 0xec, /* 8101/8168. Unit of 128 bytes. */
> RTL_W8(MaxTxPacketSize, TxPacketMax);
> RTL_W8(MaxTxPacketSize, TxPacketMax);
> RTL_W8(MaxTxPacketSize, TxPacketMax);
> RTL_W8(MaxTxPacketSize, TxPacketMax);
> RTL_W8(MaxTxPacketSize, TxPacketMax);
> RTL_W8(MaxTxPacketSize, TxPacketMax);
> RTL_W8(MaxTxPacketSize, 0x27);
> RTL_W8(MaxTxPacketSize, TxPacketMax);
> RTL_W8(MaxTxPacketSize, TxPacketMax);
>
> Is the 0x27 value still in units of 128 bytes ?

Yes.

>
> Could it be TxPacketMax as everywhere else in the driver
> instead of 0x27 ?

Yes, it is fine to be replaced with TxPacketMax.
The value is suggested by our hardware engineer. This chip supports 9K bytes for
tx, and TxPacketMax * 128 < 9K. This register doesn't acctually limit the tx
size. It influences the behavor when sending large packet. Thus, the different
setting may just result in different performance when sending large packet.


Best Regards,
Hayes

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/