Netdev List
 help / color / mirror / Atom feed
* Re: [next-next-2.6 PATCH] enic: Add support to configure hardware interrupt coalesce timers in a platform independent way
From: David Miller @ 2011-06-17 19:25 UTC (permalink / raw)
  To: vkolluri; +Cc: netdev
In-Reply-To: <20110617175648.5502.43785.stgit@savbu-pc100.cisco.com>

From: Vasanthy Kolluri <vkolluri@cisco.com>
Date: Fri, 17 Jun 2011 10:56:48 -0700

> From: Vasanthy Kolluri <vkolluri@cisco.com>
> 
> enic driver and the underlying hardware use different units for representing the interrupt coalesce timer.
> Driver converts the interrupt coalesce timer in usec to hardware cycles while setting the relevant hardware
> registers. The conversion factor can be different for each of the adapter hardware types. So it is dynamically
> learnt from the adapter firmware using the devcmd CMD_INTR_COAL_CONVERT. This allows the driver to configure
> the hardware interrupt coalesce timers in a platform independent way.
> 
> Signed-off-by: Danny Guo <dannguo@cisco.com>
> Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
> Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
> Signed-off-by: David Wang <dwang2@cisco.com>

Applied.

^ permalink raw reply

* Re: [PATCH] fs_enet: fix freescale FCC ethernet dp buffer alignment
From: David Miller @ 2011-06-17 19:21 UTC (permalink / raw)
  To: holger.brunck
  Cc: linuxppc-dev, clive.stubbings, pantelis.antoniou, vbordug, netdev
In-Reply-To: <1308299439-5975-1-git-send-email-holger.brunck@keymile.com>

From: Holger Brunck <holger.brunck@keymile.com>
Date: Fri, 17 Jun 2011 10:30:39 +0200

> From: Clive Stubbings <clive.stubbings@xentech.co.uk>
> 
> The RIPTR and TIPTR  (receive/transmit internal temporary data pointer),
> used by microcode as a temporary buffer for data, must be 32-byte aligned
> according to the RM for MPC8247.
> 
> Tested on mgcoge.
> 
> Signed-off-by: Clive Stubbings <clive.stubbings@xentech.co.uk>
> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
> cc: Pantelis Antoniou <pantelis.antoniou@gmail.com>
> cc: Vitaly Bordug <vbordug@ru.mvista.com>
> cc: netdev@vger.kernel.org

Applied, thanks.

^ permalink raw reply

* Re: [PATCH net-next V2] drivers/net: Remove casts of void *
From: David Miller @ 2011-06-17 19:19 UTC (permalink / raw)
  To: joe
  Cc: acme, jcliburn, chris.snook, jie.yang, sathya.perla,
	subbu.seetharaman, ajit.khaparde, rmody, ddutt, sjur.brandeland,
	divy, leitao, amit.salecha, ron.mercer, linux-driver,
	anirban.chakraborty, jdmason, linux-net-drivers, shodgson,
	bhutchings, venza, dave, netdev, linux-kernel
In-Reply-To: <3bea9d0803a4ebfee2bb0f6e42defbf76126dc86.1308287030.git.joe@perches.com>

From: Joe Perches <joe@perches.com>
Date: Thu, 16 Jun 2011 22:08:06 -0700

> Unnecessary casts of void * clutter the code.
> 
> These are the remainder casts after several specific
> patches to remove netdev_priv and dev_priv.
> 
> Done via coccinelle script (and a little editing):
> 
> $ cat cast_void_pointer.cocci
> @@
> type T;
> T *pt;
> void *pv;
> @@
> 
> - pt = (T *)pv;
> + pt = pv;
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> Acked-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
> Acked-By: Chris Snook <chris.snook@gmail.com>
> Acked-by: Jon Mason <jdmason@kudzu.us>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH] virtio-net: per cpu 64 bit stats (v2)
From: David Miller @ 2011-06-17 19:18 UTC (permalink / raw)
  To: shemminger; +Cc: eric.dumazet, rusty, mst, virtualization, netdev
In-Reply-To: <20110615123629.6efae8aa@s6510.ftrdhcpuser.net>

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Wed, 15 Jun 2011 12:36:29 -0400

> Use per-cpu variables to maintain 64 bit statistics.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

I'll apply this, thanks.

^ permalink raw reply

* Re: [PATCH] virtio-net: per cpu 64 bit stats
From: Stephen Hemminger @ 2011-06-17 19:13 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: Rusty Russell, virtualization, netdev
In-Reply-To: <20110615183316.GB7197@redhat.com>

On Wed, 15 Jun 2011 21:33:16 +0300
"Michael S. Tsirkin" <mst@redhat.com> wrote:

> On Wed, Jun 15, 2011 at 11:43:37AM -0400, Stephen Hemminger wrote:
> > Use per-cpu variables to maintain 64 bit statistics.
> > Compile tested only.
> > 
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> 
> Interesting. Does this help speed at all?
> 
> > --- a/drivers/net/virtio_net.c	2011-06-14 15:18:46.448596355 -0400
> > +++ b/drivers/net/virtio_net.c	2011-06-15 09:54:22.914426067 -0400
> > @@ -40,6 +40,15 @@ module_param(gso, bool, 0444);
> >  
> >  #define VIRTNET_SEND_COMMAND_SG_MAX    2
> >  
> > +struct virtnet_stats {
> > +	struct u64_stats_sync syncp;
> > +	u64 tx_bytes;
> > +	u64 tx_packets;
> > +
> > +	u64 rx_bytes;
> > +	u64 rx_packets;
> > +};
> > +
> >  struct virtnet_info {
> >  	struct virtio_device *vdev;
> >  	struct virtqueue *rvq, *svq, *cvq;
> > @@ -56,6 +65,9 @@ struct virtnet_info {
> >  	/* Host will merge rx buffers for big packets (shake it! shake it!) */
> >  	bool mergeable_rx_bufs;
> >  
> > +	/* Active statistics */
> > +	struct virtnet_stats __percpu *stats;
> > +
> >  	/* Work struct for refilling if we run low on memory. */
> >  	struct delayed_work refill;
> >  
> > @@ -209,7 +221,6 @@ static int receive_mergeable(struct virt
> >  			skb->dev->stats.rx_length_errors++;
> >  			return -EINVAL;
> >  		}
> > -
> >  		page = virtqueue_get_buf(vi->rvq, &len);
> >  		if (!page) {
> >  			pr_debug("%s: rx error: %d buffers missing\n",
> > @@ -217,6 +228,7 @@ static int receive_mergeable(struct virt
> >  			skb->dev->stats.rx_length_errors++;
> >  			return -EINVAL;
> >  		}
> > +
> >  		if (len > PAGE_SIZE)
> >  			len = PAGE_SIZE;
> >
> 
> Let's not tweak whitespace unnecessarily.
>   
> > @@ -230,6 +242,7 @@ static int receive_mergeable(struct virt
> >  static void receive_buf(struct net_device *dev, void *buf, unsigned int len)
> >  {
> >  	struct virtnet_info *vi = netdev_priv(dev);
> > +	struct virtnet_stats __percpu *stats = this_cpu_ptr(vi->stats);
> >  	struct sk_buff *skb;
> >  	struct page *page;
> >  	struct skb_vnet_hdr *hdr;
> > @@ -265,8 +278,11 @@ static void receive_buf(struct net_devic
> >  
> >  	hdr = skb_vnet_hdr(skb);
> >  	skb->truesize += skb->data_len;
> > -	dev->stats.rx_bytes += skb->len;
> > -	dev->stats.rx_packets++;
> > +
> > +	u64_stats_update_begin(&stats->syncp);
> > +	stats->rx_bytes += skb->len;
> > +	stats->rx_packets++;
> > +	u64_stats_update_begin(&stats->syncp);
> >  
> >  	if (hdr->hdr.flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) {
> >  		pr_debug("Needs csum!\n");
> > @@ -515,11 +531,16 @@ static unsigned int free_old_xmit_skbs(s
> >  {
> >  	struct sk_buff *skb;
> >  	unsigned int len, tot_sgs = 0;
> > +	struct virtnet_stats __percpu *stats = this_cpu_ptr(vi->stats);
> >  
> >  	while ((skb = virtqueue_get_buf(vi->svq, &len)) != NULL) {
> >  		pr_debug("Sent skb %p\n", skb);
> > -		vi->dev->stats.tx_bytes += skb->len;
> > -		vi->dev->stats.tx_packets++;
> > +
> > +		u64_stats_update_begin(&stats->syncp);
> > +		stats->tx_bytes += skb->len;
> > +		stats->tx_packets++;
> > +		u64_stats_update_begin(&stats->syncp);
> > +
> >  		tot_sgs += skb_vnet_hdr(skb)->num_sg;
> >  		dev_kfree_skb_any(skb);
> >  	}
> > @@ -641,6 +662,40 @@ static int virtnet_set_mac_address(struc
> >  	return 0;
> >  }
> >  
> > +static struct rtnl_link_stats64 *virtnet_stats(struct net_device *dev,
> > +					       struct rtnl_link_stats64 *tot)
> > +{
> > +	struct virtnet_info *vi = netdev_priv(dev);
> > +	int cpu;
> > +	unsigned int start;
> > +
> > +	for_each_possible_cpu(cpu) {
> > +		struct virtnet_stats __percpu *stats
> > +			= per_cpu_ptr(vi->stats, cpu);
> > +		u64 tpackets, tbytes, rpackets, rbytes;
> > +
> > +		do {
> > +			start = u64_stats_fetch_begin(&stats->syncp);
> > +			tpackets = stats->tx_packets;
> > +			tbytes   = stats->tx_bytes;
> > +			rpackets = stats->rx_packets;
> > +			rbytes   = stats->rx_bytes;
> > +		} while (u64_stats_fetch_retry(&stats->syncp, start));
> > +
> > +		tot->rx_packets += rpackets;
> > +		tot->tx_packets += tpackets;
> > +		tot->rx_bytes   += rbytes;
> > +		tot->tx_bytes   += tbytes;
> > +	}
> > +
> > +	tot->tx_dropped = dev->stats.tx_dropped;
> > +	tot->rx_dropped = dev->stats.rx_dropped;
> > +	tot->rx_length_errors = dev->stats.rx_length_errors;
> > +	tot->rx_frame_errors = dev->stats.rx_frame_errors;
> > +
> > +	return tot;
> > +}
> > +
> >  #ifdef CONFIG_NET_POLL_CONTROLLER
> >  static void virtnet_netpoll(struct net_device *dev)
> >  {
> > @@ -650,6 +705,14 @@ static void virtnet_netpoll(struct net_d
> >  }
> >  #endif
> >  
> > +static void virtnet_free(struct net_device *dev)
> > +{
> > +	struct virtnet_info *vi = netdev_priv(dev);
> > +
> > +	free_percpu(vi->stats);
> > +	free_netdev(dev);
> > +}
> > +
> >  static int virtnet_open(struct net_device *dev)
> >  {
> >  	struct virtnet_info *vi = netdev_priv(dev);
> > @@ -835,6 +898,7 @@ static const struct net_device_ops virtn
> >  	.ndo_set_mac_address = virtnet_set_mac_address,
> >  	.ndo_set_rx_mode     = virtnet_set_rx_mode,
> >  	.ndo_change_mtu	     = virtnet_change_mtu,
> > +	.ndo_get_stats64     = virtnet_stats,
> >  	.ndo_vlan_rx_add_vid = virtnet_vlan_rx_add_vid,
> >  	.ndo_vlan_rx_kill_vid = virtnet_vlan_rx_kill_vid,
> >  #ifdef CONFIG_NET_POLL_CONTROLLER
> > @@ -895,6 +959,8 @@ static int virtnet_probe(struct virtio_d
> >  	/* Set up network device as normal. */
> >  	dev->netdev_ops = &virtnet_netdev;
> >  	dev->features = NETIF_F_HIGHDMA;
> > +	dev->destructor = virtnet_free;
> > +
> >  	SET_ETHTOOL_OPS(dev, &virtnet_ethtool_ops);
> >  	SET_NETDEV_DEV(dev, &vdev->dev);
> >  
> > @@ -939,6 +1005,11 @@ static int virtnet_probe(struct virtio_d
> >  	vi->vdev = vdev;
> >  	vdev->priv = vi;
> >  	vi->pages = NULL;
> > +	vi->stats = alloc_percpu(struct virtnet_stats);
> > +	err = -ENOMEM;
> > +	if (vi->stats == NULL)
> > +		goto free;
> > +
> >  	INIT_DELAYED_WORK(&vi->refill, refill_work);
> >  	sg_init_table(vi->rx_sg, ARRAY_SIZE(vi->rx_sg));
> >  	sg_init_table(vi->tx_sg, ARRAY_SIZE(vi->tx_sg));
> > @@ -958,7 +1029,7 @@ static int virtnet_probe(struct virtio_d
> >  
> >  	err = vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names);
> >  	if (err)
> > -		goto free;
> > +		goto free_stats;
> >  
> >  	vi->rvq = vqs[0];
> >  	vi->svq = vqs[1];
> > @@ -1003,6 +1074,8 @@ unregister:
> >  	cancel_delayed_work_sync(&vi->refill);
> >  free_vqs:
> >  	vdev->config->del_vqs(vdev);
> > +free_stats:
> > +	free_percpu(vi->stats);
> >  free:
> >  	free_netdev(dev);
> >  	return err;

Haven't done any performance tests on this.

^ permalink raw reply

* Re: [PATCH 001/001] vlan: don't call ndo_vlan_rx_register on hardware that doesn't have vlan support
From: David Miller @ 2011-06-17 19:11 UTC (permalink / raw)
  To: shemminger; +Cc: a.reversat, netdev
In-Reply-To: <20110617120032.6ed3ae3c@nehalam.ftrdhcpuser.net>

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Fri, 17 Jun 2011 12:00:32 -0700

> On Fri, 17 Jun 2011 00:13:10 -0400 (EDT)
> David Miller <davem@davemloft.net> wrote:
> 
>> From: Antoine Reversat <a.reversat@gmail.com>
>> Date: Thu, 16 Jun 2011 16:47:13 -0400
>> 
>> > This patch removes the call to ndo_vlan_rx_register if the underlying
>> > device doesn't have hardware support for VLAN.
>> > Signed-off-by: Antoine Reversat <a.reversat@gmail.com>
>> 
>> Applied, thanks.
> 
> Need same check for unregister?

What unregister?  There is only ->ndo_vlan_rx_register(), no such
->ndo_vlan_rx_unregister() op exists.

^ permalink raw reply

* Re: pull request: wireless-2.6 2011-06-17
From: David Miller @ 2011-06-17 19:01 UTC (permalink / raw)
  To: linville-2XuSBdqkA4R54TAoqtyWWQ
  Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20110617173613.GC6820-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>

From: "John W. Linville" <linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
Date: Fri, 17 Jun 2011 13:36:14 -0400

> Here is a batch of fixes intended for 3.0.  Included are a regression
> for mwl8k which caused CCMP encryption to fail on that device, and an
> mwifiex fix for a null pointer dereference.  Also included is a batch
> of Bluetooth fixes from Gustavo, including a regression fix for BT 1.1
> devices, a fix for shutdown of SCO devices, a fix for an information
> leak, and a silly error-checking fix that I thought was worth including
> to prevent misinterpreting bad data as device command options.
> 
> Please let me know if there are problems!

Pulled, thanks John.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH 001/001] vlan: don't call ndo_vlan_rx_register on hardware that doesn't have vlan support
From: Stephen Hemminger @ 2011-06-17 19:00 UTC (permalink / raw)
  To: David Miller; +Cc: a.reversat, netdev
In-Reply-To: <20110617.001310.887138223551857478.davem@davemloft.net>

On Fri, 17 Jun 2011 00:13:10 -0400 (EDT)
David Miller <davem@davemloft.net> wrote:

> From: Antoine Reversat <a.reversat@gmail.com>
> Date: Thu, 16 Jun 2011 16:47:13 -0400
> 
> > This patch removes the call to ndo_vlan_rx_register if the underlying
> > device doesn't have hardware support for VLAN.
> > Signed-off-by: Antoine Reversat <a.reversat@gmail.com>
> 
> Applied, thanks.

Need same check for unregister?

^ permalink raw reply

* Re: [PATCH net-next 5/7] qlcnic: fix default operating state of interface
From: Stephen Hemminger @ 2011-06-17 19:00 UTC (permalink / raw)
  To: David Miller; +Cc: anirban.chakraborty, netdev, amit.salecha
In-Reply-To: <20110617.001035.1602476678651330954.davem@davemloft.net>

On Fri, 17 Jun 2011 00:10:35 -0400 (EDT)
David Miller <davem@davemloft.net> wrote:

> From: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
> Date: Thu, 16 Jun 2011 13:37:36 -0700
> 
> > From: Amit Kumar Salecha <amit.salecha@qlogic.com>
> > 
> > Currently interface shows status as RUNNING, even if there is no link.
> > To fix this, netif_carrier_off should be called after register_netdev().
> > 
> > netif_carrier_off calls linkwatch_fire_event(dev); only if netdev is registered,
> > otherwise it skips. linkwatch_fire_event set default state of nic interface.
> > 
> > Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
> > Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
> 
> You cannot do this.
> 
> The exact second that register_netdev() is called, the device can
> be brought up asynchronously and the link brought into the up state.
> 
> Your netif_carrier_off() call will race with this.
> 
> This is why no other (properly functioning) driver does what you're
> trying to do here.

The proper place to do this is in the open() routine.
When device is not open, the carrier state is undefined; and devices
that are trying to save power turn off PHY when device is not in use.

Therefore the open() routine should ensure that the carrier is in
the proper state when returning. Just doing something like:

static int qlcnic_open() {
...
	netif_carrier_off()

        err = __qlcnic_up();
	...
}

static int __qlcnic_up() {
	...
	(lots of tests)
	...

        netif_carrier_on();
	adapter->reset_context = 0;
	set_bit(__QLCNIC_DEV_UP, &adapter->state);
	return 0;
}

^ permalink raw reply

* Re: [RFC 2/2] ethtool: Add support for DMA Coalescing feature config to ethtool.
From: David Miller @ 2011-06-17 18:54 UTC (permalink / raw)
  To: carolyn.wyborny; +Cc: netdev, bhutchings
In-Reply-To: <EDC0E76513226749BFBC9C3FB031318F016EEF8A6E@orsmsx508.amr.corp.intel.com>

From: "Wyborny, Carolyn" <carolyn.wyborny@intel.com>
Date: Fri, 17 Jun 2011 08:50:11 -0700

> I will add a fuller description of the feature in my updated patch.
> I thought the feature was more well known. Quick description is that
> it's a power saving feature that causes the adapter to coalesce its
> DMA writes at low traffic times to save power on the platform by
> reducing wakeups.  The parameter is intended as a simple u32 value,
> not just an on or off, but also to allow a variety of configuration
> by adapter vendors, with validation of the input on the driver side.
> Since I left out the implementation in my patch, this wasn't clear.
> I will also fix this in my next submission.

The value cannot have adapter specific meaning, you must define it
precisely and in a generic manner, such that the user can specify the
same setting across different card types.

^ permalink raw reply

* Re: [PATCH net-next] ip: introduce ip_is_fragment helper inline function
From: Paul Gortmaker @ 2011-06-17 18:24 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: davem, netdev
In-Reply-To: <1308334764.2831.18.camel@bwh-desktop>

On 11-06-17 02:19 PM, Ben Hutchings wrote:
> On Fri, 2011-06-17 at 14:08 -0400, Paul Gortmaker wrote:
>> There are enough instances of this:
>>
>>     iph->frag_off & htons(IP_MF | IP_OFFSET)
>>
>> that a helper function is probably warranted.
> [...]
>> --- a/drivers/net/s2io.c
>> +++ b/drivers/net/s2io.c
>> @@ -4111,7 +4111,7 @@ static netdev_tx_t s2io_xmit(struct sk_buff *skb, struct net_device *dev)
>>  			struct tcphdr *th;
>>  			ip = ip_hdr(skb);
>>  
>> -			if ((ip->frag_off & htons(IP_OFFSET|IP_MF)) == 0) {
>> +			if (ip_is_fragment(ip) == 0) {
>>  				th = (struct tcphdr *)(((unsigned char *)ip) +
>>  						       ip->ihl*4);
>>  
> 
> The condition should be written more clearly as !ip_is_fragment().

Agreed, and I actually had that but then "un-did" it since
I didn't want to force my choices of coding style down
into drivers.  Maybe I was just being overcautious.

> 
> [...]
>> diff --git a/include/net/ip.h b/include/net/ip.h
>> index e9ea7c7..114a152 100644
>> --- a/include/net/ip.h
>> +++ b/include/net/ip.h
>> @@ -250,6 +250,11 @@ int ip_decrease_ttl(struct iphdr *iph)
>>  	return --iph->ttl;
>>  }
>>  
>> +static inline int ip_is_fragment(const struct iphdr *iph)
>> +{
>> +	return iph->frag_off & htons(IP_MF | IP_OFFSET);
>> +}
>> +
>>  static inline
>>  int ip_dont_fragment(struct sock *sk, struct dst_entry *dst)
>>  {
> [..]
> 
> The return type should be bool.

I can make that change.  I'll sit on it for a bit in case anyone
else sees anything else needing a tweak.

Thanks Ben,
Paul.

> 
> Ben.
> 

^ permalink raw reply

* Re: [PATCH net-next] ip: introduce ip_is_fragment helper inline function
From: Ben Hutchings @ 2011-06-17 18:19 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: davem, netdev
In-Reply-To: <1308334091-10031-1-git-send-email-paul.gortmaker@windriver.com>

On Fri, 2011-06-17 at 14:08 -0400, Paul Gortmaker wrote:
> There are enough instances of this:
> 
>     iph->frag_off & htons(IP_MF | IP_OFFSET)
> 
> that a helper function is probably warranted.
[...]
> --- a/drivers/net/s2io.c
> +++ b/drivers/net/s2io.c
> @@ -4111,7 +4111,7 @@ static netdev_tx_t s2io_xmit(struct sk_buff *skb, struct net_device *dev)
>  			struct tcphdr *th;
>  			ip = ip_hdr(skb);
>  
> -			if ((ip->frag_off & htons(IP_OFFSET|IP_MF)) == 0) {
> +			if (ip_is_fragment(ip) == 0) {
>  				th = (struct tcphdr *)(((unsigned char *)ip) +
>  						       ip->ihl*4);
>  

The condition should be written more clearly as !ip_is_fragment().

[...]
> diff --git a/include/net/ip.h b/include/net/ip.h
> index e9ea7c7..114a152 100644
> --- a/include/net/ip.h
> +++ b/include/net/ip.h
> @@ -250,6 +250,11 @@ int ip_decrease_ttl(struct iphdr *iph)
>  	return --iph->ttl;
>  }
>  
> +static inline int ip_is_fragment(const struct iphdr *iph)
> +{
> +	return iph->frag_off & htons(IP_MF | IP_OFFSET);
> +}
> +
>  static inline
>  int ip_dont_fragment(struct sock *sk, struct dst_entry *dst)
>  {
[..]

The return type should be bool.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply

* RE: Netconf2011 slides...
From: Loke, Chetan @ 2011-06-17 18:09 UTC (permalink / raw)
  To: Changli Gao, Srinivasa T N; +Cc: David Miller, netdev
In-Reply-To: <BANLkTi=Vk__TbiGGrUkqexoJ1=mGh8a1gw@mail.gmail.com>

> -----Original Message-----
> From: netdev-owner@vger.kernel.org [mailto:netdev-
> owner@vger.kernel.org] On Behalf Of Changli Gao
> Sent: June 17, 2011 9:22 AM
> To: Srinivasa T N
> Cc: David Miller; netdev@vger.kernel.org
> Subject: Re: Netconf2011 slides...
> 
> On Thu, Jun 16, 2011 at 6:09 PM, Srinivasa T N
> <seenutn@linux.vnet.ibm.com> wrote:
> >        Were there some interesting topics which is useful for the
> community?
> > (Few lines on each such topic would do).
> >
> 
> netmap was mentioned by Tom. It is interesting for me.
> 
> http://info.iet.unipi.it/~luigi/netmap/

http://lists.openwall.net/netdev/2011/06/08/7

Just curious is there anything that we can do to enhance TPACKET_V3 (ignore the memcpy)?
Not selling it because I have proposed the patch but anyone who is serious
about online/offline packet mining for multiple ports would have hard time scaling with
tpacket_v1[2] to begin with.

At the very least, one needs block abstraction + timeout mechanism. Simple.
One just can't retire data - packet-by-packet. We have boxes capable
of mining ~40G with similar approach.

Now we can also think about rolling it into a separate driver but then that's
something that is open for discussion.

Benefits of a driver are as follows:
1) Folks can customize block/packet headers according to their needs without having to recompile the kernel.
2) No core network bloat.
3) Smaller NPU/FPGA shops can churn out a new driver patchset relatively quickly.



> 
> --
> Regards,
> Changli Gao(xiaosuo@gmail.com)

Regards
Chetan Loke


^ permalink raw reply

* [PATCH net-next] ip: introduce ip_is_fragment helper inline function
From: Paul Gortmaker @ 2011-06-17 18:08 UTC (permalink / raw)
  To: davem; +Cc: netdev, Paul Gortmaker

There are enough instances of this:

    iph->frag_off & htons(IP_MF | IP_OFFSET)

that a helper function is probably warranted.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/net/bonding/bond_main.c        |    2 +-
 drivers/net/ioc3-eth.c                 |    2 +-
 drivers/net/myri10ge/myri10ge.c        |    2 +-
 drivers/net/s2io.c                     |    2 +-
 drivers/net/sfc/filter.c               |    2 +-
 drivers/net/vxge/vxge-main.c           |    2 +-
 include/net/ip.h                       |    5 +++++
 net/core/dev.c                         |    2 +-
 net/ipv4/ip_input.c                    |    4 ++--
 net/ipv4/ip_output.c                   |    2 +-
 net/ipv4/ipconfig.c                    |    2 +-
 net/ipv4/netfilter/nf_defrag_ipv4.c    |    2 +-
 net/ipv4/netfilter/nf_nat_standalone.c |    2 +-
 net/ipv4/xfrm4_policy.c                |    2 +-
 net/netfilter/ipvs/ip_vs_core.c        |    7 +++----
 net/sched/cls_flow.c                   |    4 ++--
 net/sched/cls_rsvp.h                   |    2 +-
 net/sched/sch_choke.c                  |    2 +-
 net/sched/sch_sfq.c                    |    2 +-
 19 files changed, 27 insertions(+), 23 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 07e866d..5baeb6e 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3432,7 +3432,7 @@ static int bond_xmit_hash_policy_l34(struct sk_buff *skb, int count)
 	int layer4_xor = 0;
 
 	if (skb->protocol == htons(ETH_P_IP)) {
-		if (!(iph->frag_off & htons(IP_MF|IP_OFFSET)) &&
+		if (!ip_is_fragment(iph) &&
 		    (iph->protocol == IPPROTO_TCP ||
 		     iph->protocol == IPPROTO_UDP)) {
 			layer4_xor = ntohs((*layer4hdr ^ *(layer4hdr + 1)));
diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c
index 32f07f8..318a25a 100644
--- a/drivers/net/ioc3-eth.c
+++ b/drivers/net/ioc3-eth.c
@@ -532,7 +532,7 @@ static void ioc3_tcpudp_checksum(struct sk_buff *skb, uint32_t hwsum, int len)
 		return;
 
 	ih = (struct iphdr *) ((char *)eh + ETH_HLEN);
-	if (ih->frag_off & htons(IP_MF | IP_OFFSET))
+	if (ip_is_fragment(ih))
 		return;
 
 	proto = ih->protocol;
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index 04e10f4..110b61a 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -2257,7 +2257,7 @@ myri10ge_get_frag_header(struct skb_frag_struct *frag, void **mac_hdr,
 	*ip_hdr = iph;
 	if (iph->protocol != IPPROTO_TCP)
 		return -1;
-	if (iph->frag_off & htons(IP_MF | IP_OFFSET))
+	if (ip_is_fragment(iph))
 		return -1;
 	*hdr_flags |= LRO_TCP;
 	*tcpudp_hdr = (u8 *) (*ip_hdr) + (iph->ihl << 2);
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index df0d2c8..5897513 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -4111,7 +4111,7 @@ static netdev_tx_t s2io_xmit(struct sk_buff *skb, struct net_device *dev)
 			struct tcphdr *th;
 			ip = ip_hdr(skb);
 
-			if ((ip->frag_off & htons(IP_OFFSET|IP_MF)) == 0) {
+			if (ip_is_fragment(ip) == 0) {
 				th = (struct tcphdr *)(((unsigned char *)ip) +
 						       ip->ihl*4);
 
diff --git a/drivers/net/sfc/filter.c b/drivers/net/sfc/filter.c
index 95a980f..f2fc258 100644
--- a/drivers/net/sfc/filter.c
+++ b/drivers/net/sfc/filter.c
@@ -652,7 +652,7 @@ int efx_filter_rfs(struct net_device *net_dev, const struct sk_buff *skb,
 	/* RFS must validate the IP header length before calling us */
 	EFX_BUG_ON_PARANOID(!pskb_may_pull(skb, nhoff + sizeof(*ip)));
 	ip = (const struct iphdr *)(skb->data + nhoff);
-	if (ip->frag_off & htons(IP_MF | IP_OFFSET))
+	if (ip_is_fragment(ip))
 		return -EPROTONOSUPPORT;
 	EFX_BUG_ON_PARANOID(!pskb_may_pull(skb, nhoff + 4 * ip->ihl + 4));
 	ports = (const __be16 *)(skb->data + nhoff + 4 * ip->ihl);
diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
index e658edd..0068605 100644
--- a/drivers/net/vxge/vxge-main.c
+++ b/drivers/net/vxge/vxge-main.c
@@ -629,7 +629,7 @@ static u32 vxge_get_vpath_no(struct vxgedev *vdev, struct sk_buff *skb)
 
 		ip = ip_hdr(skb);
 
-		if ((ip->frag_off & htons(IP_OFFSET|IP_MF)) == 0) {
+		if (ip_is_fragment(ip) == 0) {
 			th = (struct tcphdr *)(((unsigned char *)ip) +
 					ip->ihl*4);
 
diff --git a/include/net/ip.h b/include/net/ip.h
index e9ea7c7..114a152 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -250,6 +250,11 @@ int ip_decrease_ttl(struct iphdr *iph)
 	return --iph->ttl;
 }
 
+static inline int ip_is_fragment(const struct iphdr *iph)
+{
+	return iph->frag_off & htons(IP_MF | IP_OFFSET);
+}
+
 static inline
 int ip_dont_fragment(struct sock *sk, struct dst_entry *dst)
 {
diff --git a/net/core/dev.c b/net/core/dev.c
index b3f52d2..5bb00d5 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2532,7 +2532,7 @@ __u32 __skb_get_rxhash(struct sk_buff *skb)
 			goto done;
 
 		ip = (const struct iphdr *) (skb->data + nhoff);
-		if (ip->frag_off & htons(IP_MF | IP_OFFSET))
+		if (ip_is_fragment(ip))
 			ip_proto = 0;
 		else
 			ip_proto = ip->protocol;
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
index c8f48ef..073a9b0 100644
--- a/net/ipv4/ip_input.c
+++ b/net/ipv4/ip_input.c
@@ -165,7 +165,7 @@ int ip_call_ra_chain(struct sk_buff *skb)
 		    (!sk->sk_bound_dev_if ||
 		     sk->sk_bound_dev_if == dev->ifindex) &&
 		    net_eq(sock_net(sk), dev_net(dev))) {
-			if (ip_hdr(skb)->frag_off & htons(IP_MF | IP_OFFSET)) {
+			if (ip_is_fragment(ip_hdr(skb))) {
 				if (ip_defrag(skb, IP_DEFRAG_CALL_RA_CHAIN))
 					return 1;
 			}
@@ -256,7 +256,7 @@ int ip_local_deliver(struct sk_buff *skb)
 	 *	Reassemble IP fragments.
 	 */
 
-	if (ip_hdr(skb)->frag_off & htons(IP_MF | IP_OFFSET)) {
+	if (ip_is_fragment(ip_hdr(skb))) {
 		if (ip_defrag(skb, IP_DEFRAG_LOCAL_DELIVER))
 			return 0;
 	}
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 98af369..529a6f6 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -489,7 +489,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
 
 		if (first_len - hlen > mtu ||
 		    ((first_len - hlen) & 7) ||
-		    (iph->frag_off & htons(IP_MF|IP_OFFSET)) ||
+		    ip_is_fragment(iph) ||
 		    skb_cloned(skb))
 			goto slow_path;
 
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index ab7e554..ae93dd5 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -932,7 +932,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str
 		goto drop;
 
 	/* Fragments are not supported */
-	if (h->frag_off & htons(IP_OFFSET | IP_MF)) {
+	if (ip_is_fragment(h)) {
 		if (net_ratelimit())
 			printk(KERN_ERR "DHCP/BOOTP: Ignoring fragmented "
 			       "reply.\n");
diff --git a/net/ipv4/netfilter/nf_defrag_ipv4.c b/net/ipv4/netfilter/nf_defrag_ipv4.c
index f3a9b42..9bb1b8a 100644
--- a/net/ipv4/netfilter/nf_defrag_ipv4.c
+++ b/net/ipv4/netfilter/nf_defrag_ipv4.c
@@ -82,7 +82,7 @@ static unsigned int ipv4_conntrack_defrag(unsigned int hooknum,
 #endif
 #endif
 	/* Gather fragments. */
-	if (ip_hdr(skb)->frag_off & htons(IP_MF | IP_OFFSET)) {
+	if (ip_is_fragment(ip_hdr(skb))) {
 		enum ip_defrag_users user = nf_ct_defrag_user(hooknum, skb);
 		if (nf_ct_ipv4_gather_frags(skb, user))
 			return NF_STOLEN;
diff --git a/net/ipv4/netfilter/nf_nat_standalone.c b/net/ipv4/netfilter/nf_nat_standalone.c
index 7317bdf..42c0e45 100644
--- a/net/ipv4/netfilter/nf_nat_standalone.c
+++ b/net/ipv4/netfilter/nf_nat_standalone.c
@@ -88,7 +88,7 @@ nf_nat_fn(unsigned int hooknum,
 
 	/* We never see fragments: conntrack defrags on pre-routing
 	   and local-out, and nf_nat_out protects post-routing. */
-	NF_CT_ASSERT(!(ip_hdr(skb)->frag_off & htons(IP_MF | IP_OFFSET)));
+	NF_CT_ASSERT(!ip_is_fragment(ip_hdr(skb)));
 
 	ct = nf_ct_get(skb, &ctinfo);
 	/* Can't track?  It's not due to stress, or conntrack would
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
index 981e43e..fc5368a 100644
--- a/net/ipv4/xfrm4_policy.c
+++ b/net/ipv4/xfrm4_policy.c
@@ -117,7 +117,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl, int reverse)
 	memset(fl4, 0, sizeof(struct flowi4));
 	fl4->flowi4_mark = skb->mark;
 
-	if (!(iph->frag_off & htons(IP_MF | IP_OFFSET))) {
+	if (!ip_is_fragment(iph)) {
 		switch (iph->protocol) {
 		case IPPROTO_UDP:
 		case IPPROTO_UDPLITE:
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index bfa808f..c965428 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -852,7 +852,7 @@ static int ip_vs_out_icmp(struct sk_buff *skb, int *related,
 	*related = 1;
 
 	/* reassemble IP fragments */
-	if (ip_hdr(skb)->frag_off & htons(IP_MF | IP_OFFSET)) {
+	if (ip_is_fragment(ip_hdr(skb))) {
 		if (ip_vs_gather_frags(skb, ip_vs_defrag_user(hooknum)))
 			return NF_STOLEN;
 	}
@@ -1156,8 +1156,7 @@ ip_vs_out(unsigned int hooknum, struct sk_buff *skb, int af)
 		ip_vs_fill_iphdr(af, skb_network_header(skb), &iph);
 	} else
 #endif
-		if (unlikely(ip_hdr(skb)->frag_off & htons(IP_MF|IP_OFFSET) &&
-			     !pp->dont_defrag)) {
+		if (unlikely(ip_is_fragment(ip_hdr(skb)) && !pp->dont_defrag)) {
 			if (ip_vs_gather_frags(skb,
 					       ip_vs_defrag_user(hooknum)))
 				return NF_STOLEN;
@@ -1310,7 +1309,7 @@ ip_vs_in_icmp(struct sk_buff *skb, int *related, unsigned int hooknum)
 	*related = 1;
 
 	/* reassemble IP fragments */
-	if (ip_hdr(skb)->frag_off & htons(IP_MF | IP_OFFSET)) {
+	if (ip_is_fragment(ip_hdr(skb))) {
 		if (ip_vs_gather_frags(skb, ip_vs_defrag_user(hooknum)))
 			return NF_STOLEN;
 	}
diff --git a/net/sched/cls_flow.c b/net/sched/cls_flow.c
index 8ec0139..34533a5 100644
--- a/net/sched/cls_flow.c
+++ b/net/sched/cls_flow.c
@@ -121,7 +121,7 @@ static u32 flow_get_proto_src(struct sk_buff *skb)
 		if (!pskb_network_may_pull(skb, sizeof(*iph)))
 			break;
 		iph = ip_hdr(skb);
-		if (iph->frag_off & htons(IP_MF | IP_OFFSET))
+		if (ip_is_fragment(iph))
 			break;
 		poff = proto_ports_offset(iph->protocol);
 		if (poff >= 0 &&
@@ -163,7 +163,7 @@ static u32 flow_get_proto_dst(struct sk_buff *skb)
 		if (!pskb_network_may_pull(skb, sizeof(*iph)))
 			break;
 		iph = ip_hdr(skb);
-		if (iph->frag_off & htons(IP_MF | IP_OFFSET))
+		if (ip_is_fragment(iph))
 			break;
 		poff = proto_ports_offset(iph->protocol);
 		if (poff >= 0 &&
diff --git a/net/sched/cls_rsvp.h b/net/sched/cls_rsvp.h
index 402c44b..ed691b1 100644
--- a/net/sched/cls_rsvp.h
+++ b/net/sched/cls_rsvp.h
@@ -167,7 +167,7 @@ restart:
 	dst = &nhptr->daddr;
 	protocol = nhptr->protocol;
 	xprt = ((u8 *)nhptr) + (nhptr->ihl<<2);
-	if (nhptr->frag_off & htons(IP_MF | IP_OFFSET))
+	if (ip_is_fragment(nhptr))
 		return -1;
 #endif
 
diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c
index 06afbae..3422b25 100644
--- a/net/sched/sch_choke.c
+++ b/net/sched/sch_choke.c
@@ -181,7 +181,7 @@ static bool choke_match_flow(struct sk_buff *skb1,
 		    ip1->saddr != ip2->saddr || ip1->daddr != ip2->daddr)
 			return false;
 
-		if ((ip1->frag_off | ip2->frag_off) & htons(IP_MF | IP_OFFSET))
+		if (ip_is_fragment(ip1) | ip_is_fragment(ip2))
 			ip_proto = 0;
 		off1 += ip1->ihl * 4;
 		off2 += ip2->ihl * 4;
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
index b6ea6af..4536ee6 100644
--- a/net/sched/sch_sfq.c
+++ b/net/sched/sch_sfq.c
@@ -157,7 +157,7 @@ static unsigned int sfq_hash(struct sfq_sched_data *q, struct sk_buff *skb)
 		iph = ip_hdr(skb);
 		h = (__force u32)iph->daddr;
 		h2 = (__force u32)iph->saddr ^ iph->protocol;
-		if (iph->frag_off & htons(IP_MF | IP_OFFSET))
+		if (ip_is_fragment(iph))
 			break;
 		poff = proto_ports_offset(iph->protocol);
 		if (poff >= 0 &&
-- 
1.7.4.4


^ permalink raw reply related

* [next-next-2.6 PATCH] enic: Add support to configure hardware interrupt coalesce timers in a platform independent way
From: Vasanthy Kolluri @ 2011-06-17 17:56 UTC (permalink / raw)
  To: netdev, davem

From: Vasanthy Kolluri <vkolluri@cisco.com>

enic driver and the underlying hardware use different units for representing the interrupt coalesce timer.
Driver converts the interrupt coalesce timer in usec to hardware cycles while setting the relevant hardware
registers. The conversion factor can be different for each of the adapter hardware types. So it is dynamically
learnt from the adapter firmware using the devcmd CMD_INTR_COAL_CONVERT. This allows the driver to configure
the hardware interrupt coalesce timers in a platform independent way.

Signed-off-by: Danny Guo <dannguo@cisco.com>
Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
---
 drivers/net/enic/enic.h        |    2 +
 drivers/net/enic/enic_dev.c    |   11 +++++++
 drivers/net/enic/enic_dev.h    |    1 +
 drivers/net/enic/enic_main.c   |   26 +++++++++++------
 drivers/net/enic/enic_res.c    |    7 ++---
 drivers/net/enic/vnic_dev.c    |   60 ++++++++++++++++++++++++++++++++++++++++
 drivers/net/enic/vnic_dev.h    |    5 +++
 drivers/net/enic/vnic_devcmd.h |   19 +++++++++++++
 drivers/net/enic/vnic_enet.h   |    4 ---
 drivers/net/enic/vnic_intr.c   |    7 +++--
 drivers/net/enic/vnic_intr.h   |    6 +---
 11 files changed, 122 insertions(+), 26 deletions(-)


diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h
index f747bce..f0b062b 100644
--- a/drivers/net/enic/enic.h
+++ b/drivers/net/enic/enic.h
@@ -32,7 +32,7 @@
 
 #define DRV_NAME		"enic"
 #define DRV_DESCRIPTION		"Cisco VIC Ethernet NIC Driver"
-#define DRV_VERSION		"2.1.1.20"
+#define DRV_VERSION		"2.1.1.24"
 #define DRV_COPYRIGHT		"Copyright 2008-2011 Cisco Systems, Inc"
 
 #define ENIC_BARS_MAX		6
diff --git a/drivers/net/enic/enic_dev.c b/drivers/net/enic/enic_dev.c
index 90687b1..fd6247b 100644
--- a/drivers/net/enic/enic_dev.c
+++ b/drivers/net/enic/enic_dev.c
@@ -166,6 +166,17 @@ int enic_dev_disable(struct enic *enic)
 	return err;
 }
 
+int enic_dev_intr_coal_timer_info(struct enic *enic)
+{
+	int err;
+
+	spin_lock(&enic->devcmd_lock);
+	err = vnic_dev_intr_coal_timer_info(enic->vdev);
+	spin_unlock(&enic->devcmd_lock);
+
+	return err;
+}
+
 int enic_vnic_dev_deinit(struct enic *enic)
 {
 	int err;
diff --git a/drivers/net/enic/enic_dev.h b/drivers/net/enic/enic_dev.h
index d5f6813..ff8e87f 100644
--- a/drivers/net/enic/enic_dev.h
+++ b/drivers/net/enic/enic_dev.h
@@ -34,6 +34,7 @@ int enic_dev_hang_notify(struct enic *enic);
 int enic_dev_set_ig_vlan_rewrite_mode(struct enic *enic);
 int enic_dev_enable(struct enic *enic);
 int enic_dev_disable(struct enic *enic);
+int enic_dev_intr_coal_timer_info(struct enic *enic);
 int enic_vnic_dev_deinit(struct enic *enic);
 int enic_dev_init_prov2(struct enic *enic, struct vic_provinfo *vp);
 int enic_dev_deinit_done(struct enic *enic, int *status);
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 4b3a93a..e25800f 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -284,12 +284,10 @@ static int enic_set_coalesce(struct net_device *netdev,
 	u32 rx_coalesce_usecs;
 	unsigned int i, intr;
 
-	tx_coalesce_usecs = min_t(u32,
-		INTR_COALESCE_HW_TO_USEC(VNIC_INTR_TIMER_MAX),
-		ecmd->tx_coalesce_usecs);
-	rx_coalesce_usecs = min_t(u32,
-		INTR_COALESCE_HW_TO_USEC(VNIC_INTR_TIMER_MAX),
-		ecmd->rx_coalesce_usecs);
+	tx_coalesce_usecs = min_t(u32, ecmd->tx_coalesce_usecs,
+		vnic_dev_get_intr_coal_timer_max(enic->vdev));
+	rx_coalesce_usecs = min_t(u32, ecmd->rx_coalesce_usecs,
+		vnic_dev_get_intr_coal_timer_max(enic->vdev));
 
 	switch (vnic_dev_get_intr_mode(enic->vdev)) {
 	case VNIC_DEV_INTR_MODE_INTX:
@@ -298,26 +296,26 @@ static int enic_set_coalesce(struct net_device *netdev,
 
 		intr = enic_legacy_io_intr();
 		vnic_intr_coalescing_timer_set(&enic->intr[intr],
-			INTR_COALESCE_USEC_TO_HW(tx_coalesce_usecs));
+			tx_coalesce_usecs);
 		break;
 	case VNIC_DEV_INTR_MODE_MSI:
 		if (tx_coalesce_usecs != rx_coalesce_usecs)
 			return -EINVAL;
 
 		vnic_intr_coalescing_timer_set(&enic->intr[0],
-			INTR_COALESCE_USEC_TO_HW(tx_coalesce_usecs));
+			tx_coalesce_usecs);
 		break;
 	case VNIC_DEV_INTR_MODE_MSIX:
 		for (i = 0; i < enic->wq_count; i++) {
 			intr = enic_msix_wq_intr(enic, i);
 			vnic_intr_coalescing_timer_set(&enic->intr[intr],
-				INTR_COALESCE_USEC_TO_HW(tx_coalesce_usecs));
+				tx_coalesce_usecs);
 		}
 
 		for (i = 0; i < enic->rq_count; i++) {
 			intr = enic_msix_rq_intr(enic, i);
 			vnic_intr_coalescing_timer_set(&enic->intr[intr],
-				INTR_COALESCE_USEC_TO_HW(rx_coalesce_usecs));
+				rx_coalesce_usecs);
 		}
 
 		break;
@@ -2175,6 +2173,14 @@ static int enic_dev_init(struct enic *enic)
 	unsigned int i;
 	int err;
 
+	/* Get interrupt coalesce timer info */
+	err = enic_dev_intr_coal_timer_info(enic);
+	if (err) {
+		dev_warn(dev, "Using default conversion factor for "
+			"interrupt coalesce timer\n");
+		vnic_dev_intr_coal_timer_info_default(enic->vdev);
+	}
+
 	/* Get vNIC configuration
 	 */
 
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 34f4207..4a35367 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -90,9 +90,8 @@ int enic_get_vnic_config(struct enic *enic)
 		max_t(u16, ENIC_MIN_MTU,
 		c->mtu));
 
-	c->intr_timer_usec = min_t(u32,
-		INTR_COALESCE_HW_TO_USEC(VNIC_INTR_TIMER_MAX),
-		c->intr_timer_usec);
+	c->intr_timer_usec = min_t(u32, c->intr_timer_usec,
+		vnic_dev_get_intr_coal_timer_max(enic->vdev));
 
 	dev_info(enic_get_dev(enic),
 		"vNIC MAC addr %pM wq/rq %d/%d mtu %d\n",
@@ -303,7 +302,7 @@ void enic_init_vnic_resources(struct enic *enic)
 
 	for (i = 0; i < enic->intr_count; i++) {
 		vnic_intr_init(&enic->intr[i],
-			INTR_COALESCE_USEC_TO_HW(enic->config.intr_timer_usec),
+			enic->config.intr_timer_usec,
 			enic->config.intr_timer_type,
 			mask_on_assertion);
 	}
diff --git a/drivers/net/enic/vnic_dev.c b/drivers/net/enic/vnic_dev.c
index 68f24ae..8c4c8cf 100644
--- a/drivers/net/enic/vnic_dev.c
+++ b/drivers/net/enic/vnic_dev.c
@@ -40,6 +40,12 @@ struct vnic_res {
 	unsigned int count;
 };
 
+struct vnic_intr_coal_timer_info {
+	u32 mul;
+	u32 div;
+	u32 max_usec;
+};
+
 struct vnic_dev {
 	void *priv;
 	struct pci_dev *pdev;
@@ -58,6 +64,7 @@ struct vnic_dev {
 	enum vnic_proxy_type proxy;
 	u32 proxy_index;
 	u64 args[VNIC_DEVCMD_NARGS];
+	struct vnic_intr_coal_timer_info intr_coal_timer_info;
 };
 
 #define VNIC_MAX_RES_HDR_SIZE \
@@ -794,6 +801,42 @@ int vnic_dev_deinit(struct vnic_dev *vdev)
 	return vnic_dev_cmd(vdev, CMD_DEINIT, &a0, &a1, wait);
 }
 
+void vnic_dev_intr_coal_timer_info_default(struct vnic_dev *vdev)
+{
+	/* Default: hardware intr coal timer is in units of 1.5 usecs */
+	vdev->intr_coal_timer_info.mul = 2;
+	vdev->intr_coal_timer_info.div = 3;
+	vdev->intr_coal_timer_info.max_usec =
+		vnic_dev_intr_coal_timer_hw_to_usec(vdev, 0xffff);
+}
+
+int vnic_dev_intr_coal_timer_info(struct vnic_dev *vdev)
+{
+	int wait = 1000;
+	int err;
+
+	memset(vdev->args, 0, sizeof(vdev->args));
+
+	err = _vnic_dev_cmd(vdev, CMD_INTR_COAL_CONVERT, wait);
+
+	/* Use defaults when firmware doesn't support the devcmd at all or
+	 * supports it for only specific hardware
+	 */
+	if ((err == ERR_ECMDUNKNOWN) ||
+		(!err && !(vdev->args[0] && vdev->args[1] && vdev->args[2]))) {
+		pr_warning("Using default conversion factor for "
+			"interrupt coalesce timer\n");
+		vnic_dev_intr_coal_timer_info_default(vdev);
+		return 0;
+	}
+
+	vdev->intr_coal_timer_info.mul = (u32) vdev->args[0];
+	vdev->intr_coal_timer_info.div = (u32) vdev->args[1];
+	vdev->intr_coal_timer_info.max_usec = (u32) vdev->args[2];
+
+	return err;
+}
+
 int vnic_dev_link_status(struct vnic_dev *vdev)
 {
 	if (!vnic_dev_notify_ready(vdev))
@@ -838,6 +881,23 @@ enum vnic_dev_intr_mode vnic_dev_get_intr_mode(
 	return vdev->intr_mode;
 }
 
+u32 vnic_dev_intr_coal_timer_usec_to_hw(struct vnic_dev *vdev, u32 usec)
+{
+	return (usec * vdev->intr_coal_timer_info.mul) /
+		vdev->intr_coal_timer_info.div;
+}
+
+u32 vnic_dev_intr_coal_timer_hw_to_usec(struct vnic_dev *vdev, u32 hw_cycles)
+{
+	return (hw_cycles * vdev->intr_coal_timer_info.div) /
+		vdev->intr_coal_timer_info.mul;
+}
+
+u32 vnic_dev_get_intr_coal_timer_max(struct vnic_dev *vdev)
+{
+	return vdev->intr_coal_timer_info.max_usec;
+}
+
 void vnic_dev_unregister(struct vnic_dev *vdev)
 {
 	if (vdev) {
diff --git a/drivers/net/enic/vnic_dev.h b/drivers/net/enic/vnic_dev.h
index cf482a2..852b698 100644
--- a/drivers/net/enic/vnic_dev.h
+++ b/drivers/net/enic/vnic_dev.h
@@ -109,11 +109,16 @@ int vnic_dev_open(struct vnic_dev *vdev, int arg);
 int vnic_dev_open_done(struct vnic_dev *vdev, int *done);
 int vnic_dev_init(struct vnic_dev *vdev, int arg);
 int vnic_dev_deinit(struct vnic_dev *vdev);
+void vnic_dev_intr_coal_timer_info_default(struct vnic_dev *vdev);
+int vnic_dev_intr_coal_timer_info(struct vnic_dev *vdev);
 int vnic_dev_hang_reset(struct vnic_dev *vdev, int arg);
 int vnic_dev_hang_reset_done(struct vnic_dev *vdev, int *done);
 void vnic_dev_set_intr_mode(struct vnic_dev *vdev,
 	enum vnic_dev_intr_mode intr_mode);
 enum vnic_dev_intr_mode vnic_dev_get_intr_mode(struct vnic_dev *vdev);
+u32 vnic_dev_intr_coal_timer_usec_to_hw(struct vnic_dev *vdev, u32 usec);
+u32 vnic_dev_intr_coal_timer_hw_to_usec(struct vnic_dev *vdev, u32 hw_cycles);
+u32 vnic_dev_get_intr_coal_timer_max(struct vnic_dev *vdev);
 void vnic_dev_unregister(struct vnic_dev *vdev);
 int vnic_dev_set_ig_vlan_rewrite_mode(struct vnic_dev *vdev,
 	u8 ig_vlan_rewrite_mode);
diff --git a/drivers/net/enic/vnic_devcmd.h b/drivers/net/enic/vnic_devcmd.h
index c5569bf..8025e88 100644
--- a/drivers/net/enic/vnic_devcmd.h
+++ b/drivers/net/enic/vnic_devcmd.h
@@ -318,6 +318,25 @@ enum vnic_devcmd_cmd {
 	 *             ERR_EINPROGRESS - command in a0 is still in progress
 	 */
 	CMD_STATUS = _CMDC(_CMD_DIR_RW, _CMD_VTYPE_ALL, 49),
+
+	/*
+	 * Returns interrupt coalescing timer conversion factors.
+	 * After calling this devcmd, ENIC driver can convert
+	 * interrupt coalescing timer in usec into CPU cycles as follows:
+	 *
+	 *   intr_timer_cycles = intr_timer_usec * multiplier / divisor
+	 *
+	 * Interrupt coalescing timer in usecs can be obtained from
+	 * CPU cycles as follows:
+	 *
+	 *   intr_timer_usec = intr_timer_cycles * divisor / multiplier
+	 *
+	 * in: none
+	 * out: (u32)a0 = multiplier
+	 *      (u32)a1 = divisor
+	 *      (u32)a2 = maximum timer value in usec
+	 */
+	CMD_INTR_COAL_CONVERT = _CMDC(_CMD_DIR_READ, _CMD_VTYPE_ALL, 50),
 };
 
 /* CMD_ENABLE2 flags */
diff --git a/drivers/net/enic/vnic_enet.h b/drivers/net/enic/vnic_enet.h
index 061ad87..6095428 100644
--- a/drivers/net/enic/vnic_enet.h
+++ b/drivers/net/enic/vnic_enet.h
@@ -20,10 +20,6 @@
 #ifndef _VNIC_ENIC_H_
 #define _VNIC_ENIC_H_
 
-/* Hardware intr coalesce timer is in units of 1.5us */
-#define INTR_COALESCE_USEC_TO_HW(usec) ((usec) * 2/3)
-#define INTR_COALESCE_HW_TO_USEC(usec) ((usec) * 3/2)
-
 /* Device-specific region: enet configuration */
 struct vnic_enet_config {
 	u32 flags;
diff --git a/drivers/net/enic/vnic_intr.c b/drivers/net/enic/vnic_intr.c
index 3873771..0ca107f 100644
--- a/drivers/net/enic/vnic_intr.c
+++ b/drivers/net/enic/vnic_intr.c
@@ -46,7 +46,7 @@ int vnic_intr_alloc(struct vnic_dev *vdev, struct vnic_intr *intr,
 	return 0;
 }
 
-void vnic_intr_init(struct vnic_intr *intr, unsigned int coalescing_timer,
+void vnic_intr_init(struct vnic_intr *intr, u32 coalescing_timer,
 	unsigned int coalescing_type, unsigned int mask_on_assertion)
 {
 	vnic_intr_coalescing_timer_set(intr, coalescing_timer);
@@ -56,9 +56,10 @@ void vnic_intr_init(struct vnic_intr *intr, unsigned int coalescing_timer,
 }
 
 void vnic_intr_coalescing_timer_set(struct vnic_intr *intr,
-	unsigned int coalescing_timer)
+	u32 coalescing_timer)
 {
-	iowrite32(coalescing_timer, &intr->ctrl->coalescing_timer);
+	iowrite32(vnic_dev_intr_coal_timer_usec_to_hw(intr->vdev,
+		coalescing_timer), &intr->ctrl->coalescing_timer);
 }
 
 void vnic_intr_clean(struct vnic_intr *intr)
diff --git a/drivers/net/enic/vnic_intr.h b/drivers/net/enic/vnic_intr.h
index 09dc0b7..2b16363 100644
--- a/drivers/net/enic/vnic_intr.h
+++ b/drivers/net/enic/vnic_intr.h
@@ -24,8 +24,6 @@
 
 #include "vnic_dev.h"
 
-#define VNIC_INTR_TIMER_MAX		0xffff
-
 #define VNIC_INTR_TIMER_TYPE_ABS	0
 #define VNIC_INTR_TIMER_TYPE_QUIET	1
 
@@ -104,10 +102,10 @@ static inline u32 vnic_intr_legacy_pba(u32 __iomem *legacy_pba)
 void vnic_intr_free(struct vnic_intr *intr);
 int vnic_intr_alloc(struct vnic_dev *vdev, struct vnic_intr *intr,
 	unsigned int index);
-void vnic_intr_init(struct vnic_intr *intr, unsigned int coalescing_timer,
+void vnic_intr_init(struct vnic_intr *intr, u32 coalescing_timer,
 	unsigned int coalescing_type, unsigned int mask_on_assertion);
 void vnic_intr_coalescing_timer_set(struct vnic_intr *intr,
-	unsigned int coalescing_timer);
+	u32 coalescing_timer);
 void vnic_intr_clean(struct vnic_intr *intr);
 
 #endif /* _VNIC_INTR_H_ */


^ permalink raw reply related

* pull request: wireless-2.6 2011-06-17
From: John W. Linville @ 2011-06-17 17:36 UTC (permalink / raw)
  To: davem; +Cc: linux-wireless, netdev, linux-kernel

Dave,

Here is a batch of fixes intended for 3.0.  Included are a regression
for mwl8k which caused CCMP encryption to fail on that device, and an
mwifiex fix for a null pointer dereference.  Also included is a batch
of Bluetooth fixes from Gustavo, including a regression fix for BT 1.1
devices, a fix for shutdown of SCO devices, a fix for an information
leak, and a silly error-checking fix that I thought was worth including
to prevent misinterpreting bad data as device command options.

Please let me know if there are problems!

Thanks,

John

---

The following changes since commit 118133e6580a0c912cda86109b6468b5ffe73f1c:

  netdev: bfin_mac: fix memory leak when freeing dma descriptors (2011-06-17 00:19:09 -0400)

are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git for-davem

David Miller (1):
      Bluetooth: Do not ignore errors returned from strict_strtol()

Filip Palian (1):
      Bluetooth: l2cap and rfcomm: fix 1 byte infoleak to userspace.

John W. Linville (2):
      Merge branch 'master' of master.kernel.org:/.../padovan/bluetooth-2.6
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless-2.6 into for-davem

Luiz Augusto von Dentz (1):
      Bluetooth: fix shutdown on SCO sockets

Nishant Sarmukadam (1):
      mwl8k: Tell firmware to generate CCMP header

Ville Tervo (1):
      Bluetooth: Do not send SET_EVENT_MASK for 1.1 and earlier devices

Yogesh Ashok Powar (1):
      mwifiex: Fixing NULL pointer dereference

 drivers/bluetooth/btmrvl_debugfs.c      |   12 ++++++++++++
 drivers/net/wireless/mwifiex/cfg80211.c |    2 ++
 drivers/net/wireless/mwl8k.c            |    4 +++-
 net/bluetooth/hci_event.c               |   18 ++++++++++--------
 net/bluetooth/l2cap_sock.c              |    1 +
 net/bluetooth/rfcomm/sock.c             |    1 +
 net/bluetooth/sco.c                     |   13 ++++++++++++-
 7 files changed, 41 insertions(+), 10 deletions(-)

diff --git a/drivers/bluetooth/btmrvl_debugfs.c b/drivers/bluetooth/btmrvl_debugfs.c
index fd6305b..8ecf4c6 100644
--- a/drivers/bluetooth/btmrvl_debugfs.c
+++ b/drivers/bluetooth/btmrvl_debugfs.c
@@ -64,6 +64,8 @@ static ssize_t btmrvl_hscfgcmd_write(struct file *file,
 		return -EFAULT;
 
 	ret = strict_strtol(buf, 10, &result);
+	if (ret)
+		return ret;
 
 	priv->btmrvl_dev.hscfgcmd = result;
 
@@ -108,6 +110,8 @@ static ssize_t btmrvl_psmode_write(struct file *file, const char __user *ubuf,
 		return -EFAULT;
 
 	ret = strict_strtol(buf, 10, &result);
+	if (ret)
+		return ret;
 
 	priv->btmrvl_dev.psmode = result;
 
@@ -147,6 +151,8 @@ static ssize_t btmrvl_pscmd_write(struct file *file, const char __user *ubuf,
 		return -EFAULT;
 
 	ret = strict_strtol(buf, 10, &result);
+	if (ret)
+		return ret;
 
 	priv->btmrvl_dev.pscmd = result;
 
@@ -191,6 +197,8 @@ static ssize_t btmrvl_gpiogap_write(struct file *file, const char __user *ubuf,
 		return -EFAULT;
 
 	ret = strict_strtol(buf, 16, &result);
+	if (ret)
+		return ret;
 
 	priv->btmrvl_dev.gpio_gap = result;
 
@@ -230,6 +238,8 @@ static ssize_t btmrvl_hscmd_write(struct file *file, const char __user *ubuf,
 		return -EFAULT;
 
 	ret = strict_strtol(buf, 10, &result);
+	if (ret)
+		return ret;
 
 	priv->btmrvl_dev.hscmd = result;
 	if (priv->btmrvl_dev.hscmd) {
@@ -272,6 +282,8 @@ static ssize_t btmrvl_hsmode_write(struct file *file, const char __user *ubuf,
 		return -EFAULT;
 
 	ret = strict_strtol(buf, 10, &result);
+	if (ret)
+		return ret;
 
 	priv->btmrvl_dev.hsmode = result;
 
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 660831c..687c1f2 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -1288,6 +1288,8 @@ int mwifiex_register_cfg80211(struct net_device *dev, u8 *mac,
 
 	*(unsigned long *) wdev_priv = (unsigned long) priv;
 
+	set_wiphy_dev(wdev->wiphy, (struct device *) priv->adapter->dev);
+
 	ret = wiphy_register(wdev->wiphy);
 	if (ret < 0) {
 		dev_err(priv->adapter->dev, "%s: registering cfg80211 device\n",
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index 3226118..aeac3cc 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -2474,6 +2474,7 @@ struct mwl8k_cmd_set_hw_spec {
  * faster client.
  */
 #define MWL8K_SET_HW_SPEC_FLAG_ENABLE_LIFE_TIME_EXPIRY	0x00000400
+#define MWL8K_SET_HW_SPEC_FLAG_GENERATE_CCMP_HDR	0x00000200
 #define MWL8K_SET_HW_SPEC_FLAG_HOST_DECR_MGMT		0x00000080
 #define MWL8K_SET_HW_SPEC_FLAG_HOSTFORM_PROBERESP	0x00000020
 #define MWL8K_SET_HW_SPEC_FLAG_HOSTFORM_BEACON		0x00000010
@@ -2510,7 +2511,8 @@ static int mwl8k_cmd_set_hw_spec(struct ieee80211_hw *hw)
 	cmd->flags = cpu_to_le32(MWL8K_SET_HW_SPEC_FLAG_HOST_DECR_MGMT |
 				 MWL8K_SET_HW_SPEC_FLAG_HOSTFORM_PROBERESP |
 				 MWL8K_SET_HW_SPEC_FLAG_HOSTFORM_BEACON |
-				 MWL8K_SET_HW_SPEC_FLAG_ENABLE_LIFE_TIME_EXPIRY);
+				 MWL8K_SET_HW_SPEC_FLAG_ENABLE_LIFE_TIME_EXPIRY |
+				 MWL8K_SET_HW_SPEC_FLAG_GENERATE_CCMP_HDR);
 	cmd->num_tx_desc_per_queue = cpu_to_le32(MWL8K_TX_DESCS);
 	cmd->total_rxd = cpu_to_le32(MWL8K_RX_DESCS);
 
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index f13ddbf..77930aa 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -477,14 +477,16 @@ static void hci_setup_event_mask(struct hci_dev *hdev)
 	 * command otherwise */
 	u8 events[8] = { 0xff, 0xff, 0xfb, 0xff, 0x00, 0x00, 0x00, 0x00 };
 
-	/* Events for 1.2 and newer controllers */
-	if (hdev->lmp_ver > 1) {
-		events[4] |= 0x01; /* Flow Specification Complete */
-		events[4] |= 0x02; /* Inquiry Result with RSSI */
-		events[4] |= 0x04; /* Read Remote Extended Features Complete */
-		events[5] |= 0x08; /* Synchronous Connection Complete */
-		events[5] |= 0x10; /* Synchronous Connection Changed */
-	}
+	/* CSR 1.1 dongles does not accept any bitfield so don't try to set
+	 * any event mask for pre 1.2 devices */
+	if (hdev->lmp_ver <= 1)
+		return;
+
+	events[4] |= 0x01; /* Flow Specification Complete */
+	events[4] |= 0x02; /* Inquiry Result with RSSI */
+	events[4] |= 0x04; /* Read Remote Extended Features Complete */
+	events[5] |= 0x08; /* Synchronous Connection Complete */
+	events[5] |= 0x10; /* Synchronous Connection Changed */
 
 	if (hdev->features[3] & LMP_RSSI_INQ)
 		events[4] |= 0x04; /* Inquiry Result with RSSI */
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index 18dc988..8248303 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -413,6 +413,7 @@ static int l2cap_sock_getsockopt_old(struct socket *sock, int optname, char __us
 			break;
 		}
 
+		memset(&cinfo, 0, sizeof(cinfo));
 		cinfo.hci_handle = chan->conn->hcon->handle;
 		memcpy(cinfo.dev_class, chan->conn->hcon->dev_class, 3);
 
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c
index 386cfaf..1b10727 100644
--- a/net/bluetooth/rfcomm/sock.c
+++ b/net/bluetooth/rfcomm/sock.c
@@ -788,6 +788,7 @@ static int rfcomm_sock_getsockopt_old(struct socket *sock, int optname, char __u
 
 		l2cap_sk = rfcomm_pi(sk)->dlc->session->sock->sk;
 
+		memset(&cinfo, 0, sizeof(cinfo));
 		cinfo.hci_handle = conn->hcon->handle;
 		memcpy(cinfo.dev_class, conn->hcon->dev_class, 3);
 
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index 42fdffd..cb4fb78 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -369,6 +369,15 @@ static void __sco_sock_close(struct sock *sk)
 
 	case BT_CONNECTED:
 	case BT_CONFIG:
+		if (sco_pi(sk)->conn) {
+			sk->sk_state = BT_DISCONN;
+			sco_sock_set_timer(sk, SCO_DISCONN_TIMEOUT);
+			hci_conn_put(sco_pi(sk)->conn->hcon);
+			sco_pi(sk)->conn->hcon = NULL;
+		} else
+			sco_chan_del(sk, ECONNRESET);
+		break;
+
 	case BT_CONNECT:
 	case BT_DISCONN:
 		sco_chan_del(sk, ECONNRESET);
@@ -819,7 +828,9 @@ static void sco_chan_del(struct sock *sk, int err)
 		conn->sk = NULL;
 		sco_pi(sk)->conn = NULL;
 		sco_conn_unlock(conn);
-		hci_conn_put(conn->hcon);
+
+		if (conn->hcon)
+			hci_conn_put(conn->hcon);
 	}
 
 	sk->sk_state = BT_CLOSED;
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply related

* Re: [next-next-2.6 PATCH] enic: Add support to configure hardware interrupt coalesce timers in a platform independent way
From: vkolluri @ 2011-06-17 17:27 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <20110616.235715.2076846351080666905.davem@davemloft.net>

I'll fix and resubmit.

Thanks
Vasanthy


On 6/16/11 8:57 PM, "David Miller" <davem@davemloft.net> wrote:

> From: Vasanthy Kolluri <vkolluri@cisco.com>
> Date: Wed, 15 Jun 2011 14:17:58 -0700
> 
>> + /* Get interrupt coalesce timer info
>> +  */
>> +
>> + err = enic_dev_intr_coal_timer_info(enic);
> 
> Please, comment should be just one line long and empty
> line is superflous.


^ permalink raw reply

* [PATCH] gigaset: call module_put before restart of if_open()
From: Pavel Shved @ 2011-06-17 16:25 UTC (permalink / raw)
  To: Hansjoerg Lipp
  Cc: Pavel Shved, Tilman Schmidt, Karsten Keil,
	open list:GIGASET ISDN DRIVERS, open list:ISDN SUBSYSTEM,
	open list, ldv-project
In-Reply-To: <1308327913-23220-1-git-send-email-shved@ispras.ru>

if_open() calls try_module_get(), and after an attempt to lock a mutex
the if_open() function may return -ERESTARTSYS without
putting the module.  Then, when if_open() is executed again,
try_module_get() is called making the reference counter of THIS_MODULE
greater than one at successful exit from if_open().  The if_close()
function puts the module only once, and as a result it can't be
unloaded.

This patch adds module_put call before the return from if_open().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Pavel Shved <shved@ispras.ru>
---
 drivers/isdn/gigaset/interface.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c
index 59de638..e35058b 100644
--- a/drivers/isdn/gigaset/interface.c
+++ b/drivers/isdn/gigaset/interface.c
@@ -156,8 +156,10 @@ static int if_open(struct tty_struct *tty, struct file *filp)
 	if (!cs || !try_module_get(cs->driver->owner))
 		return -ENODEV;
 
-	if (mutex_lock_interruptible(&cs->mutex))
+	if (mutex_lock_interruptible(&cs->mutex)) {
+		module_put(cs->driver->owner);
 		return -ERESTARTSYS;
+	}
 	tty->driver_data = cs;
 
 	++cs->open_count;
-- 
1.7.0.2


^ permalink raw reply related

* Re: bnx2 udp multicast packet loss and jtter
From: Eric Dumazet @ 2011-06-17 16:55 UTC (permalink / raw)
  To: Kieran Kunhya; +Cc: netdev
In-Reply-To: <BANLkTi=j_yYaNTeSfjqtOUnNoZRymAK32A@mail.gmail.com>

Le vendredi 17 juin 2011 à 17:42 +0100, Kieran Kunhya a écrit :

> The analyzer can either use the RTP definition of jitter, or it uses
> its own algorithm to attempt to
> mimic the RTP definition of jitter when using TS packets in UDP by
> using the continuity counter.
> This happens with both UDP and RTP streams. (though for unrelated
> reasons UDP is usually used)
> 
> The analyzer is on a different machine. The UDP thread isn't bottlenecked at all
> and the machine is only under moderate load. It also happens with many
> different applications
> that can serve mpegts files.

Quite frankly, I cant believe your bnx2 can be responsible of jitters
like that. By the way, check you're on full duplex mode, not on half
duplex.

You could take a tcpdump on the sender machine, to check if delays are
on this machine, or later in your network (a congestioned egress
somewhere)




^ permalink raw reply

* Re: bnx2 vlan issue
From: Jesse Gross @ 2011-06-17 16:47 UTC (permalink / raw)
  To: Dominique Martinet; +Cc: netdev
In-Reply-To: <loom.20110617T075702-107@post.gmane.org>

On Thu, Jun 16, 2011 at 11:10 PM, Dominique Martinet
<rnfhrznznaq.tf@noclue.notk.org> wrote:
> Hi,
>
> Jesse Gross <jesse <at> nicira.com> writes:
>> On Thu, Mar 24, 2011 at 5:26 PM, Seblu <seblu <at> seblu.net> wrote:
>> > Maybe i was not enough clear. It seems to me that new behaviour, with
>> > vlan on top of bridge rather than above interface in bridge is not
>> > functional.
>> > In other words, i cannot use vlan and bridge together in 2.6.38 (with
>> > e1000e).
>>
>> Sorry, I misunderstood what you were saying before.  Can you try and
>> see where the packets are getting lost or improperly handled by
>> running tcpdump on the various interfaces?  For example, check that
>> packets are coming in with tags on the physical interfaces, have tags
>> on the bridge interface, no tag on the vlan interface, etc.
>
> I think I ran into the same problem, and my workaround for this was to add
> a vlan do the bridge and then add the vlan'ed bridge to another bridge, i.e.
> (since I can't draw, commands will be better :P)
>
> brctl addbr br0
> brctl addif br0 eth0
> ip link add link br0 name br0.42 type vlan id 42
> ip link set br0.42 up
>
> brctl addbr br_42
> brctl addif br_42 br0.42
>
> and then I could put VMs in br_42 which got network "as expected"
> before, I used to have br_42 with eth0.42 in it, so it is just one more
> step..
> What bothers me is that I also want to put VMs in br0, and it does work,
> but this bridge also sees all the tagged data - isn't there a way to just
> "pick" the untagged network?

You are bridging the VMs to the physical network, so it is expected
that they will see all traffic.  That said, you could use ebtables to
only take vlan 0, similar to if you only wanted them to see packets to
their MAC address and not flooding.

> My other question is that I'm not certain if that's the expected way to
> use the new behaviour, if not I wouldn't mind light shining from above :)

Yes, that's the intended behavior and correct usage.

^ permalink raw reply

* Re: bnx2 udp multicast packet loss and jtter
From: Kieran Kunhya @ 2011-06-17 16:42 UTC (permalink / raw)
  To: Eric Dumazet, netdev
In-Reply-To: <1308325964.3539.14.camel@edumazet-laptop>

On Fri, Jun 17, 2011 at 4:52 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Le vendredi 17 juin 2011 à 16:35 +0100, Kieran Kunhya a écrit :
>> On Fri, Jun 17, 2011 at 4:30 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>> >
>> > Le samedi 11 juin 2011 à 15:32 +0100, Kieran Kunhya a écrit :
>> > > Hello,
>> > >
>> > > I get some bad packet loss and high jitter on a BCM5709. This is on
>> > > kernel 2.6.38-8 - unfortunately using a newer kernel isn't an option
>> > > right now.
>> > > The bnx2 driver is version v2.0.23b.
>> > >
>> > > I've tried a lot of kenel types such as -lowlatency, -ck and vanilla.
>> > > The thread doing the udp output is at realtime priority and the same
>> > > thing happens with different applications.
>> > >
>> > > Example of jitter
>> > > http://dl.dropbox.com/u/2701213/jitter.png
>> > >
>> > > Is there anything I can do to further diagnose this problem?
>> > >
>> >
>> > Hi
>> >
>> > How is this jitter measured ?
>> >
>> > Is the link otherwise idle, or do you have a particular qdisc setup to
>> > make sure packets from other flow wont have an effect ?
>>
>> Thanks for the reply.
>> The jitter is measured with an IPTV analyser. There are other devices
>> on the same switch which don't have any jitter issues.
>> The link is otherwise idle.
>
> jitter has a precise meaning in RTP flows. Is this IPTV analyser using
> this definition ?
>
> Is this analyser running on the machine that sends frames, or another
> machine ?
>
> Are you sure the realtime thread fullfill its requirements ?
> (RT priority wont help if this thread is cpu bounded)

The analyzer can either use the RTP definition of jitter, or it uses
its own algorithm to attempt to
mimic the RTP definition of jitter when using TS packets in UDP by
using the continuity counter.
This happens with both UDP and RTP streams. (though for unrelated
reasons UDP is usually used)

The analyzer is on a different machine. The UDP thread isn't bottlenecked at all
and the machine is only under moderate load. It also happens with many
different applications
that can serve mpegts files.

^ permalink raw reply

* [PATCH] farsync: add module_put to error path in fst_open()
From: Pavel Shved @ 2011-06-17 16:25 UTC (permalink / raw)
  To: Kevin Curtis; +Cc: Pavel Shved, netdev, linux-kernel, ldv-project

The fst_open() function, after a successful try_module_get() may return
an error code if hdlc_open() returns it.  However, it does not put the
module on this error path.

This patch adds the necessary module_put() call.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Pavel Shved <shved@ispras.ru>
---
 drivers/net/wan/farsync.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
index e050bd6..777d1a4 100644
--- a/drivers/net/wan/farsync.c
+++ b/drivers/net/wan/farsync.c
@@ -2203,8 +2203,10 @@ fst_open(struct net_device *dev)
 
 	if (port->mode != FST_RAW) {
 		err = hdlc_open(dev);
-		if (err)
+		if (err) {
+			module_put(THIS_MODULE);
 			return err;
+		}
 	}
 
 	fst_openport(port);
-- 
1.7.0.2

^ permalink raw reply related

* Re: [BUG] b43 / ssb: kernel BUG() in __queue_work()
From: Guennadi Liakhovetski @ 2011-06-17 16:17 UTC (permalink / raw)
  To: John W. Linville
  Cc: Stefano Brivio, Michael Buesch, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20110617144231.GB2528-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>

On Fri, 17 Jun 2011, John W. Linville wrote:

> You probably should send this to linux-wireless-u79uwXL29TaiAVqoAR/hOK1cXZ9k6wlg@public.gmane.org

Thanks for forwarding, John. A short update: I verified back to 2.6.38(.5) 
and the bug is there too. It's even easier to reproduce with some more 
intensive IO, e.g., ssh to the system and run something like "top."

Thanks
Guennadi

> 
> On Fri, Jun 17, 2011 at 04:08:04PM +0200, Guennadi Liakhovetski wrote:
> > Hi
> > 
> > I'm getting reproducibly the below BUG() with recent kernels, e.g., next 
> > of today. Occurs on ARM and SuperH with an SDIO b43 card. Using WPA2, 
> > configure a network and start ping from outside, within a couple of 
> > minutes (usually under 1 minute actually) the kernel crashes.
> > 
> > Thanks
> > Guennadi
> > ---
> > Guennadi Liakhovetski, Ph.D.
> > Freelance Open-Source Software Developer
> > http://www.open-technology.de/
> > 
> > [  155.912000] ------------[ cut here ]------------
> > [  155.912000] kernel BUG at /home/lyakh/software/project/24/src/linux-2.6/kernel/workqueue.c:1037!
> > [  155.912000] Kernel BUG: 003e [#1]
> > [  155.912000] Modules linked in: aes_generic arc4 mmc_block b43 ssb mac80211 cfg80211 sh_mobile_sdhi tmio_mmc_core mmc_core sh_mobile_ceu_camera videobuf2_dma_contig videobuf2_memops soc_camera videobuf_core videobuf2_core v4l2_common uio_pdrv_genirq videodev uio soc_mediabus shdma
> > [  155.912000] 
> > [  155.912000] Pid : 1540, Comm: 		ksdioirqd/mmc0
> > [  155.912000] CPU : 0        		Not tainted  (3.0.0-rc3-ecovec+ #332)
> > [  155.912000] 
> > [  155.912000] PC is at __queue_work+0x1de/0x2ac
> > [  155.912000] PR is at __queue_work+0x1d2/0x2ac
> > [  155.912000] PC  : 8802a5fa SP  : 8d3719b0 SR  : 400081f0 TEA : c000e6e0
> > [  155.912000] R0  : 8d565000 R1  : 8d318f80 R2  : 8d565054 R3  : 00000000
> > [  155.912000] R4  : 8d565000 R5  : 8d68ef00 R6  : 8d318f7c R7  : 000005a0
> > [  155.912000] R8  : 8d318f7c R9  : 8d68ef00 R10 : 00000000 R11 : 8838e458
> > [  155.912000] R12 : 8d68d20c R13 : 00000000 R14 : 8d3719b0
> > [  155.912000] MACH: 00000064 MACL: 00000000 GBR : 00000000 PR  : 8802a5ee
> > [  155.912000] 
> > [  155.912000] Call trace:
> > [  155.912000]  [<c0294820>] ieee80211_duration+0x0/0x16c [mac80211]
> > [  155.912000]  [<8802a6e8>] queue_work_on+0x20/0x30
> > [  155.912000]  [<880036b4>] arch_local_irq_restore+0x0/0x2a
> > [  155.912000]  [<8802b53c>] queue_work+0x24/0x60
> > [  155.912000]  [<c0298904>] ieee80211_queue_work+0x20/0x34 [mac80211]
> > [  155.912000]  [<c02f512c>] b43_op_tx+0x40/0x5c [b43]
> > [  155.912000]  [<c029442e>] __ieee80211_tx+0x16e/0x1c0 [mac80211]
> > [  155.912000]  [<c029599e>] ieee80211_tx+0x76/0xc8 [mac80211]
> > [  155.912000]  [<c0295b4a>] ieee80211_xmit+0x15a/0x1b8 [mac80211]
> > [  155.912000]  [<88011efc>] sub_preempt_count+0x0/0x8c
> > [  155.912000]  [<881e0600>] skb_push+0x0/0x64
> > [  155.912000]  [<c0296a02>] ieee80211_subif_start_xmit+0x50e/0x55c [mac80211]
> > [  155.912000]  [<881e0600>] skb_push+0x0/0x64
> > [  155.912000]  [<881302b4>] memcpy+0x0/0x28c
> > [  155.912000]  [<881e85c2>] dev_hard_start_xmit+0x38a/0x49c
> > [  155.912000]  [<882034b6>] __ip_append_data+0x3da/0x6c4
> > [  155.912000]  [<881f8488>] sch_direct_xmit+0x60/0x1c0
> > [  155.912000]  [<881e88ac>] dev_queue_xmit+0x1d8/0x3f0
> > [  155.912000]  [<882053dc>] ip_finish_output+0x268/0x2b4
> > [  155.912000]  [<881302b4>] memcpy+0x0/0x28c
> > [  155.912000]  [<882054ae>] ip_output+0x86/0xac
> > [  155.912000]  [<88202e7c>] ip_local_out+0x5c/0x64
> > [  155.912000]  [<88202e90>] ip_send_skb+0xc/0x88
> > [  155.912000]  [<88203c52>] ip_push_pending_frames+0x22/0x38
> > [  155.912000]  [<88222856>] icmp_push_reply+0xce/0x104
> > [  155.912000]  [<88222a36>] icmp_reply+0x14a/0x1bc
> > [  155.912000]  [<88222bc6>] icmp_echo+0x3a/0x50
> > [  155.912000]  [<8821db68>] raw_local_deliver+0x0/0x1bc
> > [  155.912000]  [<8821db68>] raw_local_deliver+0x0/0x1bc
> > [  155.912000]  [<881e2b40>] __skb_checksum_complete+0x10/0x1c
> > [  155.912000]  [<88223050>] icmp_rcv+0xec/0x128
> > [  155.912000]  [<88200dee>] ip_local_deliver+0x86/0x13c
> > [  155.912000]  [<88200ce8>] ip_rcv+0x3d8/0x458
> > [  155.912000]  [<881e61d4>] __netif_receive_skb+0x298/0x2fc
> > [  155.912000]  [<881e636a>] netif_receive_skb+0x36/0x50
> > [  155.912000]  [<c02914f2>] ieee80211_deliver_skb+0xf6/0x158 [mac80211]
> > [  155.912000]  [<c02928a0>] ieee80211_rx_handlers+0xe16/0x124e [mac80211]
> > [  155.912000]  [<c01cff02>] mmc_wait_for_req+0xa6/0xd0 [mmc_core]
> > [  155.912000]  [<c01d59ca>] mmc_io_rw_extended+0x12a/0x1b0 [mmc_core]
> > [  155.912000]  [<881dff72>] skb_queue_tail+0x3e/0x74
> > [  155.912000]  [<c02933c0>] ieee80211_prepare_and_rx_handle+0x6e8/0x77c [mac80211]
> > [  155.912000]  [<c0293bda>] ieee80211_rx+0x786/0x818 [mac80211]
> > [  155.912000]  [<c01d0450>] mmc_wait_done+0x0/0x18 [mmc_core]
> > [  155.912000]  [<c0304e56>] b43_rx+0x4a2/0x510 [b43]
> > [  155.912000]  [<c030a6d6>] b43_pio_rx+0x2d6/0x35c [b43]
> > [  155.912000]  [<c02f864c>] b43_do_interrupt_thread+0x5b4/0x758 [b43]
> > [  155.912000]  [<c02f8852>] b43_sdio_interrupt_handler+0x26/0x48 [b43]
> > [  155.912000]  [<c030b370>] b43_sdio_interrupt_dispatcher+0x30/0x54 [b43]
> > [  155.912000]  [<c01d7368>] sdio_irq_thread+0x7c/0x274 [mmc_core]
> > [  155.912000]  [<c01d72ec>] sdio_irq_thread+0x0/0x274 [mmc_core]
> > [  155.912000]  [<8802f172>] kthread+0x4a/0x7c
> > [  155.912000]  [<8802f184>] kthread+0x5c/0x7c
> > [  155.912000]  [<c01d72ec>] sdio_irq_thread+0x0/0x274 [mmc_core]
> > [  155.912000]  [<88003d5c>] kernel_thread_helper+0x8/0x14
> > [  155.912000]  [<8802f128>] kthread+0x0/0x7c
> > [  155.912000]  [<88003d54>] kernel_thread_helper+0x0/0x14
> > [  155.912000] 
> > [  155.912000] Code:
> > [  155.912000]   8802a5f4:  cmp/eq    r1, r2
> > [  155.912000]   8802a5f6:  bt.s      8802a5fc
> > [  155.912000]   8802a5f8:  mov       r0, r4
> > [  155.912000] ->8802a5fa:  trapa     #62
> > [  155.912000]   8802a5fc:  mov.l     @(8,r4), r7
> > [  155.912000]   8802a5fe:  mov       r7, r1
> > [  155.912000]   8802a600:  add       #4, r1
> > [  155.912000]   8802a602:  shll2     r1
> > [  155.912000]   8802a604:  add       r4, r1
> > [  155.912000] 
> > [  155.912000] Process: ksdioirqd/mmc0 (pid: 1540, stack limit = 8d370001)
> > [  155.912000] Stack: (0x8d3719b0 to 0x8d372000)
> > [  155.912000] 19a0:                                     c0294820 8802a6e8 8d3719d4 00000000 
> > [  155.912000] 19c0: 8d68d20c 880036b4 8d68d000 8d68ef00 8d318f7c 8802b53c 8d3719dc c0298904 
> > [  155.912000] 19e0: 8d3719ec 8d371a38 8d31833c 8d318f7c c02f512c 8d3719fc 8d318ea0 c029442e 
> > [  155.912000] 1a00: 8d371a08 8d3182c0 00000000 00000000 8d339ae0 00000000 c029599e 8d371a38 
> > [  155.912000] 1a20: 8d506850 8f1e13c0 00000000 8d3182c0 8d339afc 8d339ae0 8d339ae0 8d3182c0 
> > [  155.912000] 1a40: 8f1e13c0 8d68d000 8d2e9200 c03123c0 00000800 00000002 c0295b4a 8d371a74 
> > [  155.912000] 1a60: 000003bc 88011efc 8d3182c0 8f1e13c0 8d339ae0 881e0600 8d339af8 8d371aa0 
> > [  155.912000] 1a80: c0296a02 8d371aa0 8d506850 881e0600 881302b4 8d506864 8f1e13c0 8d339ae0 
> > [  155.912000] 1aa0: 00000000 0000000c 0000001c 8d506850 8d506864 8d506842 8d3182c0 c0236b98 
> > [  155.912000] 1ac0: 8f1e1000 01081ad8 24000000 a5f335fe 02100e00 0200b772 0ece6872 8d370000 
> > [  155.912000] 1ae0: 8d2ecf20 881e85c2 8d371b04 8834278c 8f1e1000 8d68eea0 8834276c 00006000 
> > [  155.912000] 1b00: 8d339ae0 00000000 882034b6 c029b384 8834278c 881f8488 8d371b34 8d68eea0 
> > [  155.912000] 1b20: 00000010 8d68eea0 8f1e1000 8d2ed600 8d339ae0 881e88ac 8d371b54 8d2ed640 
> > [  155.912000] 1b40: 00000000 8d2ed600 8f1e1000 8d339ae0 8d2ed65c 882053dc 8d371b74 8d2bd74a 
> > [  155.912000] 1b60: 8d339b5c 00000000 0000000e 8d2bd740 8d339ae0 881302b4 fffffff0 8d2bd754 
> > [  155.912000] 1b80: 8d2bd750 882054ae 8d371ba4 8834270c 8d371bec 8d506866 8d339b20 8f1e1000 
> > [  155.912000] 1ba0: 8d339ae0 88202e7c 8d371bb4 8d371c38 8f0b5b80 88202e90 8d371bbc 88203c52 
> > [  155.912000] 1bc0: 8d371bc8 8f0b5b80 88222856 8d371bd0 88222a36 8d371bec 00000008 8d371be0 
> > [  155.912000] 1be0: 8d2da75c 8d3738c0 8d371c38 00000000 00000000 00000000 00010000 00000000 
> > [  155.912000] 1c00: 15b2a8c0 1bb2a8c0 00000000 15b2a8c0 00003810 00000000 c0349300 00000000 
> > [  155.912000] 1c20: 88222bc6 8d371c38 8821db68 88342bd8 8d373f01 3900a76f 8d2da6e0 00000000 
> > [  155.912000] 1c40: 00000038 00000000 3900a76f 15b2a8c0 00000200 00000100 00000008 0669ae33 
> > [  155.912000] 1c60: 00000000 00000000 00000000 00000000 8834270c 00000008 8821db68 88342bd8 
> > [  155.912000] 1c80: 8d2da720 8d2da6e0 881e2b40 8d371c9c 88342bd8 8d373f01 88223050 8d371ca4 
> > [  155.912000] 1ca0: 8d2da6e0 88200dee 8d371cb4 88342bdc 8d2da6e0 88200ce8 8d371ccc 00000000 
> > [  155.912000] 1cc0: 8d506c50 8d2da6f8 8d2da6e0 881e61d4 8d371ce4 00000000 8f1e1000 8d371cb4 
> > [  155.912000] 1ce0: 883426ec 0000009c 00000001 8d2da6e0 8834270c 881e636a 8d371d14 8f1e1000 
> > [  155.912000] 1d00: 8d2da6f8 8d3182c0 8d2da75c 00000000 8d2da6e0 8d2da6e0 c02914f2 8d371d20 
> > [  155.912000] 1d20: c02928a0 8d371d40 8f1e13c0 8f1e107c 8d3182c0 00000000 00004208 8d371dec 
> > [  155.912000] 1d40: 8d371dcc c01cff02 8d371d4c 00000000 8d371d50 00000000 c01d59ca 8d371d6c 
> > [  155.912000] 1d60: 00000004 8d371da0 8d43ec00 8d371de4 00000035 00000000 00001000 00001000 
> > [  155.912000] 1d80: 00005000 00001000 881dff72 c02933c0 8d371dac 8f1e177c 8d3182c0 8d2da6e0 
> > [  155.912000] 1da0: 8d506c28 0000002b 8d371dec 00000001 8d3182c0 8f1e13c0 c0293bda 8d371dd8 
> > [  155.912000] 1dc0: 8d2da6e0 8d371dec 8d68d000 00000000 8d68d000 8d3182c0 00000000 8d371d4c 
> > [  155.912000] 1de0: c01d0450 8d506c32 8d506c28 8d2da6e0 8d3182c0 8f1e13c0 8d68d000 8d2e9200 
> > [  155.912000] 1e00: 00000000 00000010 00000000 00000000 00000000 c0304e56 8d371e34 00007499 
> > [  155.912000] 1e20: 0000012a 00000002 8d2da6e0 8d3182c0 8d32f400 0000000f 00000002 00000000 
> > [  155.912000] 1e40: 8d2da720 8d506c22 8d2da75c 00000000 00000000 00000000 00000985 ffffffc7 
> > [  155.912000] 1e60: 00000000 0000000b 00000000 00000000 c030a6d6 8d371e90 8d32f400 0000008e 
> > [  155.912000] 1e80: 8d319009 8d2da75c 8d4ca424 8d4ca420 00000002 00000000 8d318ea0 8d2da6e0 
> > [  155.912000] 1ea0: 8d318f98 c02f864c 8d371ec4 00000001 8d3aa9bc 8d3aa93c 00010000 00008000 
> > [  155.912000] 1ec0: 8d32f400 8d32f000 00010000 00000000 00000000 00000000 00000000 00000000 
> > [  155.912000] 1ee0: 00008000 8d32f47c 8d32f400 c02f8852 8d371f0c 00000001 8d3aa9bc 8d3aa93c 
> > [  155.912000] 1f00: 8d32f400 8d32f400 8d318ea8 c030b370 8d371f1c 8d32f2fc 8d2e7000 c01d7368 
> > [  155.912000] 1f20: 8d371f30 8d43ec00 7fffffff 8d3aa800 8d4a5da4 c01d72ec 00000000 8d3aa8fc 
> > [  155.912000] 1f40: 8d3aaa44 00000003 00000001 8802f172 8802f184 8d371f70 00000000 00000000 
> > [  155.912000] 1f60: c01d72ec 8d3aa800 8d4a5d94 00000000 00000000 8d3aa800 00000000 8d371f7c 
> > [  155.912000] 1f80: 8d371f7c 88003d5c 8d371f9c 00000000 00000000 00000000 00000000 00000000 
> > [  155.912000] 1fa0: 00000000 00000000 00000000 00000000 00000000 8d4a5d94 8802f128 00000000 
> > [  155.912000] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
> > [  155.912000] 1fe0: 8d371fa4 88003d54 00000000 40008000 00000000 00000000 00000000 00000000 
> > [  155.916000] ---[ end trace d5cca8a145e4559d ]---
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at  http://www.tux.org/lkml/
> > 
> 
> -- 
> John W. Linville		Someday the world will need a hero, and you
> linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org			might be all we have.  Be ready.
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH] vmxnet3: fix starving rx ring when alloc_skb fails
From: David Miller @ 2011-06-17 16:09 UTC (permalink / raw)
  To: bhutchings; +Cc: scottjg, netdev, pv-drivers
In-Reply-To: <1308312860.11457.56.camel@localhost>

From: Ben Hutchings <bhutchings@solarflare.com>
Date: Fri, 17 Jun 2011 13:14:20 +0100

> But this means the driver drops received packets as soon as there is an
> allocation failure, rather than only if there are repeated failures.  I
> don't see how that's preferable.

Because it decreases the possibility of RX ring starvation.

If you get one allocation failure during a NAPI poll run, and you're
proabably processing a set of packets, they are all going to fail.

^ permalink raw reply

* Re: [RFC 1/2] net:  Support getting/setting RX-FCS in drivers.
From: Ben Hutchings @ 2011-06-17 16:00 UTC (permalink / raw)
  To: Ben Greear; +Cc: netdev
In-Reply-To: <4DFB73B2.10506@candelatech.com>

On Fri, 2011-06-17 at 08:33 -0700, Ben Greear wrote:
> On 06/17/2011 05:20 AM, Ben Hutchings wrote:
> > On Thu, 2011-06-16 at 21:30 -0700, greearb@candelatech.com wrote:
> >> From: Ben Greear<greearb@candelatech.com>
> >>
> >> This will allow us to enable/disable having the Ethernet
> >> frame checksum appended to the skb.  Enabling this is
> >> useful when sniffing packets.
> >>
> >> In particular, this can be used to test logic that allows
> >> a NIC to receive all frames, even ones with bad checksums.
[...]
> > And as Michal says, this could reasonably be a feature not an entirely
> > separate flag.  I'm not sure it's that important to have debugging flags
> > in features, but I also don't want to have 2 commands per flag...
> 
> I'm not sure it really counts as a feature, and I've no desire to tangle
> with the effort to extend features beyond 32 bits.

There are several people wanting to add new flags, so between you I'm
sure you can manage it.

> Maybe we could have a new
> ethtool command that took a struct with two args, so we can "set flag-foo val"
> instead of 'enable-flag-foo' and 'disable-flag-foo'?
> 
> That should be only one additional method for the drivers to implement, and
> can be used for the other patches I have planned as well.

Whereas implementing an extra feature toggle now requires zero extra
methods.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox