Re: [PATCH 1/6] ehea: interface to network stack

2006-08-14 Thread Arnd Bergmann
On Monday 14 August 2006 17:43, Jan-Bernd Themann wrote: > as our queue size is always a power of 2, we simply use: > i++; > i &= (ringbufferlength - 1) > > So we can get along without the if. > The recommended (by Linus) way for dealing with ring buffers like that is to always read the counter

Re: [PATCH 1/6] ehea: interface to network stack

2006-08-14 Thread Jan-Bernd Themann
Hi, Anton Blanchard wrote: Is a conditional cheaper than a divide? In case of a misprediction I would assume it to be significantly slower and I don't know the ratio of mispredictions for this branch. A quick scan of the web shows 40 cycles for athlon64 idiv, and its similarly slow on many ot

Re: [PATCH 1/6] ehea: interface to network stack

2006-08-14 Thread Anton Blanchard
> Is a conditional cheaper than a divide? In case of a misprediction I > would assume it to be significantly slower and I don't know the ratio > of mispredictions for this branch. A quick scan of the web shows 40 cycles for athlon64 idiv, and its similarly slow on many other cpus. Even assuming

Re: [PATCH 1/6] ehea: interface to network stack

2006-08-14 Thread Jörn Engel
On Sat, 12 August 2006 06:56:24 +1000, Anton Blanchard wrote: > > > + > > + skb_index = ((index - i > > + + port_res->skb_arr_sq_len) > > +% port_res->skb_arr_sq_len); > > This is going to fo

Re: [PATCH 1/6] ehea: interface to network stack

2006-08-11 Thread Anton Blanchard
Hi, > --- linux-2.6.18-rc4-orig/drivers/net/ehea/ehea_main.c1969-12-31 > +#define DEB_PREFIX "main" Doesnt appear to be used. > +static struct net_device_stats *ehea_get_stats(struct net_device *dev) ... > + cb2 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); I cant see where this gets fr

Re: [PATCH 1/6] ehea: interface to network stack

2006-08-11 Thread Jan-Bernd Themann
Hi Christian, thanks for your comments, we'll send an updated patch set soon. Jan-Bernd Christian Borntraeger wrote: Hi Jan-Bernd, I had some minutes, here are some finding after a quick look. On Wednesday 09 August 2006 10:38, you wrote: +static struct net_device_stats *ehea_get_stats(stru

Re: [PATCH 1/6] ehea: interface to network stack

2006-08-10 Thread Jan-Bernd Themann
Hi, thanks for your comments! We'll post a modified patch very soon. Jan-Bernd Alexey Dobriyan wrote: On Wed, Aug 09, 2006 at 10:38:20AM +0200, Jan-Bernd Themann wrote: --- linux-2.6.18-rc4-orig/drivers/net/ehea/ehea_main.c +++ kernel/drivers/net/ehea/ehea_main.c +static inline u64 get_sw

Re: [PATCH 1/6] ehea: interface to network stack

2006-08-10 Thread Jan-Bernd Themann
Hi Michael, thanks for your very helpful comments so far, we'll provide a patch with these and other fixes very soon. See comments below. Jan-Bernd Michael Ellerman wrote: > Hi Jan-Bernd, > > Comments below the code they refer to. > > On Wed, 2006-08-09 at 10:38 +0200, Jan-Bernd Themann wrote

Re: [PATCH 1/6] ehea: interface to network stack

2006-08-10 Thread Michael Ellerman
On Thu, 2006-08-10 at 16:15 +1000, Michael Ellerman wrote: > > + struct hcp_query_ehea_port_cb_2 *cb2 = NULL; > > + struct net_device_stats *stats = &port->stats; > > + > > + EDEB_EN(7, "net_device=%p", dev); > > + > > + cb2 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL); > > + if (!cb2) { > > +

Re: [PATCH 1/6] ehea: interface to network stack

2006-08-09 Thread Michael Ellerman
Hi Jan-Bernd, Comments below the code they refer to. On Wed, 2006-08-09 at 10:38 +0200, Jan-Bernd Themann wrote: > Signed-off-by: Jan-Bernd Themann <[EMAIL PROTECTED]> > drivers/net/ehea/ehea_main.c | 2738 > +++ > 1 file changed, 2738 insertions(+)

Re: [PATCH 1/6] ehea: interface to network stack

2006-08-09 Thread Alexey Dobriyan
On Wed, Aug 09, 2006 at 10:38:20AM +0200, Jan-Bernd Themann wrote: > --- linux-2.6.18-rc4-orig/drivers/net/ehea/ehea_main.c > +++ kernel/drivers/net/ehea/ehea_main.c > +static inline u64 get_swqe_addr(u64 tmp_addr, int addr_seg) > +{ > + u64 addr; > + addr = tmp_addr; > + return addr;

Re: [PATCH 1/6] ehea: interface to network stack

2006-08-09 Thread Christian Borntraeger
Hi Jan-Bernd, I had some minutes, here are some finding after a quick look. On Wednesday 09 August 2006 10:38, you wrote: > +static struct net_device_stats *ehea_get_stats(struct net_device *dev) > +{ > + int i; > + u64 hret = H_HARDWARE; > + u64 rx_packets = 0; > + struct ehea_po