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]
Date:	Fri, 15 Dec 2006 14:55:33 -0800
From:	Stephen Hemminger <shemminger@...l.org>
To:	Francois Romieu <romieu@...zoreil.com>
Cc:	Jeff Garzik <jgarzik@...ox.com>, netdev@...r.kernel.org
Subject: Re: [PATCH 3/3] chelsio: more receive cleanup

On Fri, 15 Dec 2006 21:10:19 +0100
Francois Romieu <romieu@...zoreil.com> wrote:

> Stephen Hemminger <shemminger@...l.org> :
> [...]
> > --- linux-2.6.20-rc1.orig/drivers/net/chelsio/sge.c
> > +++ linux-2.6.20-rc1/drivers/net/chelsio/sge.c
> [...]
> > @@ -1059,37 +1062,33 @@ static void recycle_fl_buf(struct freelQ
> >   *	threshold and the packet is too big to copy, or (b) the packet should
> >   *	be copied but there is no memory for the copy.
> >   */
> > -static inline struct sk_buff *get_packet(struct pci_dev *pdev,
> > -					 struct freelQ *fl, unsigned int len,
> > -					 int dma_pad, int skb_pad,
> > -					 unsigned int copy_thres,
> > -					 unsigned int drop_thres)
> > +static inline struct sk_buff *get_packet(struct pci_dev *pdev, struct freelQ *fl,
> > +					 unsigned int len)
> >  {
> >  	struct sk_buff *skb;
> > -	struct freelQ_ce *ce = &fl->centries[fl->cidx];
> > +	const struct freelQ_ce *ce = &fl->centries[fl->cidx];
> > +
> > +	if (len < copybreak) {
> 
> If you are into cleanups, maybe add likely/unlikely (and remove the inline) ?

Why, you can't predict copybreak on off

> 
> > +		skb = alloc_skb(len + 2, GFP_ATOMIC);
> > +		if (!skb)
> > +			goto use_orig_buf;
> >  
> > -	if (len < copy_thres) {
> > -		skb = alloc_skb(len + skb_pad, GFP_ATOMIC);
> > -		if (likely(skb != NULL)) {
> > -			skb_reserve(skb, skb_pad);
> > -			skb_put(skb, len);
> > -			pci_dma_sync_single_for_cpu(pdev,
> > +		skb_reserve(skb, 2);	/* align IP header */
> 
> s/2/NET_IP_ALIGN/

This is wrong, NET_IP_ALIGN is for DMA buffers only. It is defined
as 0 for those platforms where DMA alignment is important. In this
case we are copying, so we want to force 2.

> Btw, since the driver supports netpoll, its blind enabling of interrupts
> in t1_poll() seems old-fashoined (see thread starting at
> http://lkml.org/lkml/2006/12/12/86)
> 


-- 
Stephen Hemminger <shemminger@...l.org>
-
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