Netdev List
 help / color / mirror / Atom feed
* [RFC v2 0/2] Enable RX-FCS in e100
From: greearb @ 2011-06-24 19:06 UTC (permalink / raw)
  To: netdev; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

This is on top of Miroslaw's patches.  No new patches
are required to ethtool.

This is for RFC only until his patches go in.

Ben Greear (2):
  net:  Support RXFCS feature flag.
  e100:  Support RXFCS feature flag.

 drivers/net/e100.c              |   15 ++++++++++++---
 include/linux/netdev_features.h |    2 ++
 net/core/ethtool.c              |    1 +
 3 files changed, 15 insertions(+), 3 deletions(-)

-- 
1.7.3.4


^ permalink raw reply

* [RFC v2 1/2] net:  Support RXFCS feature flag.
From: greearb @ 2011-06-24 19:06 UTC (permalink / raw)
  To: netdev; +Cc: Ben Greear
In-Reply-To: <1308942371-12748-1-git-send-email-greearb@candelatech.com>

From: Ben Greear <greearb@candelatech.com>

When set, this causes the Ethernet FCS to be appended
to the end of the skb.

Useful for sniffing packets.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 d0ab610... 55f359e... M	include/linux/netdev_features.h
:100644 100644 80b88fe... 62f15e9... M	net/core/ethtool.c
 include/linux/netdev_features.h |    2 ++
 net/core/ethtool.c              |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
index d0ab610..55f359e 100644
--- a/include/linux/netdev_features.h
+++ b/include/linux/netdev_features.h
@@ -54,6 +54,7 @@ enum {
 	NETIF_F_RXCSUM_BIT,		/* Receive checksumming offload */
 	NETIF_F_NOCACHE_COPY_BIT,	/* Use no-cache copyfromuser */
 	NETIF_F_LOOPBACK_BIT,		/* Enable loopback */
+	NETIF_F_RXFCS_BIT,		/* Append FCS to skb */
 
 	/*
 	 * Add your fresh new feature above and remember to update
@@ -98,6 +99,7 @@ enum {
 #define NETIF_F_RXCSUM		__NETIF_F(RXCSUM)
 #define NETIF_F_NOCACHE_COPY	__NETIF_F(NOCACHE_COPY)
 #define NETIF_F_LOOPBACK	__NETIF_F(LOOPBACK)
+#define NETIF_F_RXFCS		__NETIF_F(RXFCS)
 
 /* Features valid for ethtool to change */
 /* = all defined minus driver/device-class-related */
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 80b88fe..62f15e9 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -74,6 +74,7 @@ static const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN]
 	[NETIF_F_RXCSUM_BIT] =           "rx-checksum",
 	[NETIF_F_NOCACHE_COPY_BIT] =     "tx-nocache-copy",
 	[NETIF_F_LOOPBACK_BIT] =         "loopback",
+	[NETIF_F_RXFCS_BIT] =            "rx-fcs",
 };
 
 static int ethtool_get_features(struct net_device *dev, void __user *useraddr)
-- 
1.7.3.4


^ permalink raw reply related

* [RFC v2 2/2] e100:  Support RXFCS feature flag.
From: greearb @ 2011-06-24 19:06 UTC (permalink / raw)
  To: netdev; +Cc: Ben Greear
In-Reply-To: <1308942371-12748-1-git-send-email-greearb@candelatech.com>

From: Ben Greear <greearb@candelatech.com>

This allows e100 to be configured to append the
Ethernet FCS to the skb.

Useful for sniffing networks.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 c1352c6... 761f6f5... M	drivers/net/e100.c
 drivers/net/e100.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index c1352c6..761f6f5 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -1089,6 +1089,7 @@ static void e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb)
 {
 	struct config *config = &cb->u.config;
 	u8 *c = (u8 *)config;
+	struct net_device *netdev = nic->netdev;
 
 	cb->command = cpu_to_le16(cb_config);
 
@@ -1132,6 +1133,9 @@ static void e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb)
 		config->promiscuous_mode = 0x1;		/* 1=on, 0=off */
 	}
 
+	if (netdev->wanted_features & NETIF_F_RXFCS)
+		config->rx_crc_transfer = 0x1;	/* 1=save, 0=discard */
+
 	if (nic->flags & multicast_all)
 		config->multicast_all = 0x1;		/* 1=accept, 0=no */
 
@@ -1919,6 +1923,7 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx,
 	struct sk_buff *skb = rx->skb;
 	struct rfd *rfd = (struct rfd *)skb->data;
 	u16 rfd_status, actual_size;
+	u16 fcs_pad = 0;
 
 	if (unlikely(work_done && *work_done >= work_to_do))
 		return -EAGAIN;
@@ -1951,9 +1956,11 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx,
 	}
 
 	/* Get actual data size */
+	if (dev->wanted_features & NETIF_F_RXFCS)
+		fcs_pad = 4;
 	actual_size = le16_to_cpu(rfd->actual_size) & 0x3FFF;
-	if (unlikely(actual_size > RFD_BUF_LEN - sizeof(struct rfd)))
-		actual_size = RFD_BUF_LEN - sizeof(struct rfd);
+	if (unlikely(actual_size > RFD_BUF_LEN + fcs_pad - sizeof(struct rfd)))
+		actual_size = RFD_BUF_LEN + fcs_pad - sizeof(struct rfd);
 
 	/* Get data */
 	pci_unmap_single(nic->pdev, rx->dma_addr,
@@ -1980,7 +1987,7 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx,
 	if (unlikely(!(rfd_status & cb_ok))) {
 		/* Don't indicate if hardware indicates errors */
 		dev_kfree_skb_any(skb);
-	} else if (actual_size > ETH_DATA_LEN + VLAN_ETH_HLEN) {
+	} else if (actual_size > ETH_DATA_LEN + VLAN_ETH_HLEN + fcs_pad) {
 		/* Don't indicate oversized frames */
 		nic->rx_over_length_errors++;
 		dev_kfree_skb_any(skb);
@@ -2761,6 +2768,8 @@ static int __devinit e100_probe(struct pci_dev *pdev,
 		return -ENOMEM;
 	}
 
+	netdev->hw_features |= NETIF_F_RXFCS;
+
 	netdev->netdev_ops = &e100_netdev_ops;
 	SET_ETHTOOL_OPS(netdev, &e100_ethtool_ops);
 	netdev->watchdog_timeo = E100_WATCHDOG_PERIOD;
-- 
1.7.3.4


^ permalink raw reply related

* Re: [PATCH] bridge: Forward EAPOL Kconfig option BRIDGE_PAE_FORWARD
From: Stephen Hemminger @ 2011-06-24 19:08 UTC (permalink / raw)
  To: Nick Carter; +Cc: netdev, davem
In-Reply-To: <BANLkTi==Ho+6nCX=0hFEQgNAoNE34g35UA@mail.gmail.com>

On Fri, 24 Jun 2011 19:29:41 +0100
Nick Carter <ncarter100@gmail.com> wrote:

> New diffs below with the Kconfig option removed as requested.
> 
> Now all users and distro's will get the correct 802.1x bridge
> behaviour by default.  That is EAPOL frames attempting to traverse the
> bridge will be dropped (IEEE Std 802.1X-2001 C.3.3).
> 
> Users or distro's who want the non-standard behaviour of forwarding
> EAPOL frames, can use a simple runtime configuration change to the
> sysfs bridge/pae_forward attribute.

This is much better, thanks.
See the comments for how to make the code more compact and tighter.

> diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
> index d9d1e2b..91c1b71 100644
> --- a/net/bridge/br_if.c
> +++ b/net/bridge/br_if.c
> @@ -214,6 +214,7 @@ static struct net_device *new_bridge_dev(struct
> net *net, const char *name)
>  	br->topology_change = 0;
>  	br->topology_change_detected = 0;
>  	br->ageing_time = 300 * HZ;
> +	br->pae_forward = BR_PAE_DEFAULT;

It is just a boolean, why the verbose enum values?
 
>  	br_netfilter_rtable_init(br);
> 
> diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
> index 90e985b..edeb92d 100644
> --- a/net/bridge/br_input.c
> +++ b/net/bridge/br_input.c
> @@ -43,6 +43,16 @@ static int br_pass_frame_up(struct sk_buff *skb)
>  		       netif_receive_skb);
>  }
> 
> +static inline bool br_pae_forward(struct net_bridge *br, __be16 proto)
> +{
> +	return br->pae_forward == BR_PAE_FORWARD && proto == htons(ETH_P_PAE);
> +}
> +
> +static inline bool br_pae_drop(struct net_bridge *br, __be16 proto)
> +{
> +	return br->pae_forward == BR_PAE_DEFAULT && proto == htons(ETH_P_PAE);
> +}

Since only used one place, the extra wrappers aren't helping.

>  /* note: already called with rcu_read_lock */
>  int br_handle_frame_finish(struct sk_buff *skb)
>  {
> @@ -98,6 +108,10 @@ int br_handle_frame_finish(struct sk_buff *skb)
>  	}
> 
>  	if (skb) {
> +		/* Prevent Crosstalk (IEEE Std 802.1X-2001 C.3.3) */
> +		if (unlikely(br_pae_drop(br, skb->protocol)))
> +			goto drop;
> +

Referencing standard is good, but perhaps explaining what that means.
Since these are multicast frames, will it ever reach this point.
This point is reached for unicast frames that are not local.
And won't this change existing behavior since before this 802.1x unicast
frames would be forwarded.

>  		if (dst)
>  			br_forward(dst->dst, skb, skb2);
>  		else
> @@ -166,6 +180,10 @@ struct sk_buff *br_handle_frame(struct sk_buff *skb)
>  		if (p->br->stp_enabled == BR_NO_STP && dest[5] == 0)
>  			goto forward;
> 
> +		/* Check if PAE frame should be forwarded */
> +		if (br_pae_forward(p->br, skb->protocol))
> +			goto forward;
> +
>  		if (NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_IN, skb, skb->dev,
>  			    NULL, br_handle_local_finish))
>  			return NULL;	/* frame consumed by filter */
> diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
> index 4e1b620..683c057 100644
> --- a/net/bridge/br_private.h
> +++ b/net/bridge/br_private.h
> @@ -244,6 +244,11 @@ struct net_bridge
>  	struct timer_list		multicast_query_timer;
>  #endif
> 
> +	enum {
> +		BR_PAE_DEFAULT,		/* 802.1x frames consumed by bridge */
> +		BR_PAE_FORWARD,		/* 802.1x frames forwarded by bridge */
> +	} pae_forward;
> +
>  	struct timer_list		hello_timer;
>  	struct timer_list		tcn_timer;
>  	struct timer_list		topology_change_timer;
> diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c
> index 5c1e555..9bdbc84 100644
> --- a/net/bridge/br_sysfs_br.c
> +++ b/net/bridge/br_sysfs_br.c
> @@ -679,6 +679,31 @@ static DEVICE_ATTR(nf_call_arptables, S_IRUGO | S_IWUSR,
>  		   show_nf_call_arptables, store_nf_call_arptables);
>  #endif
> 
> +static ssize_t show_pae_forward(struct device *d, struct
> device_attribute *attr,
> +				char *buf)
> +{
> +	struct net_bridge *br = to_bridge(d);
> +	return sprintf(buf, "%d\n", br->pae_forward);
> +}
> +
> +static int set_pae_forward(struct net_bridge *br, unsigned long val)
> +{
> +	if (val > BR_PAE_FORWARD)
> +		return -EINVAL;
> +
> +	br->pae_forward = val;
> +	return 0;
> +}
> +
> +static ssize_t store_pae_forward(struct device *d,
> +				 struct device_attribute *attr, const char *buf,
> +				 size_t len)
> +{
> +	return store_bridge_parm(d, buf, len, set_pae_forward);
> +}
> +static DEVICE_ATTR(pae_forward, S_IRUGO | S_IWUSR, show_pae_forward,
> +		   store_pae_forward);
> +
>  static struct attribute *bridge_attrs[] = {
>  	&dev_attr_forward_delay.attr,
>  	&dev_attr_hello_time.attr,
> @@ -698,6 +723,7 @@ static struct attribute *bridge_attrs[] = {
>  	&dev_attr_gc_timer.attr,
>  	&dev_attr_group_addr.attr,
>  	&dev_attr_flush.attr,
> +	&dev_attr_pae_forward.attr,
>  #ifdef CONFIG_BRIDGE_IGMP_SNOOPING
>  	&dev_attr_multicast_router.attr,
>  	&dev_attr_multicast_snooping.attr,


^ permalink raw reply

* Re: SKB paged fragment lifecycle on receive
From: David Miller @ 2011-06-24 19:46 UTC (permalink / raw)
  To: jeremy; +Cc: eric.dumazet, Ian.Campbell, netdev, xen-devel, rusty
In-Reply-To: <4E04D59B.8060301@goop.org>

From: Jeremy Fitzhardinge <jeremy@goop.org>
Date: Fri, 24 Jun 2011 11:21:15 -0700

>> Dangerous I would say. You could have a skb1 page transferred to another
>> skb2, and call skb1 destructor way before page being released.
> 
> Under what circumstances would that happen?

Pages get transferred between different SKBs all the time.

For example, GRO makes extensive use of this technique.
See net/core/skbuff.c:skb_gro_receive().

It is just one example.

^ permalink raw reply

* Re: unintended ipv4 broadcast policy change
From: David Miller @ 2011-06-24 19:54 UTC (permalink / raw)
  To: shemminger; +Cc: herbert, netdev
In-Reply-To: <20110624100121.63bbc93a@nehalam.ftrdhcpuser.net>

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Fri, 24 Jun 2011 10:01:21 -0700

> On Thu, 23 Jun 2011 14:08:21 -0700 (PDT)
> David Miller <davem@davemloft.net> wrote:
> 
>> From: Stephen Hemminger <shemminger@vyatta.com>
>> Date: Thu, 23 Jun 2011 17:01:37 -0400
>> 
>> > Standard Debian stable (Squeeze) installation.
>> > $ dpkg -S /sbin/dhclient
>> > isc-dhcp-client: /sbin/dhclient
>> 
>> I bet what happens is that since it isn't reading from
>> the AF_PACKET socket the receive queue just fills up
>> and it's just in the kernel dropping packets in
>> packet_spkt_rcv().
> 
> I don't think that is correct, just instrumented /proc/net/packet
> to add receive queue length is stuck at 0. The packets are getting
> dropped somewhere else.
> 
> sk               RefCnt Type Proto  Iface R Rmem   User   Inode  Count
> ffff880327038000 3      10   0003   3     1 0      0      5881   0

They must be because this is capturing ETH_P_ALL with type SOCK_PACKET
which means receive all packets unconditionally.

^ permalink raw reply

* Re: [PATCH net-next-2.6 1/3] be2net: fix netdev_stats_update
From: David Miller @ 2011-06-24 19:59 UTC (permalink / raw)
  To: eric.dumazet; +Cc: sathya.perla, netdev
In-Reply-To: <1308911520.2228.1.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 24 Jun 2011 12:32:00 +0200

> Hmm, isnt it a patch I provided 10 days ago ?
> 
> I find very strange so few people are able to properly attribute work
> today...

Sathya, if this patch is almost entriely the same as Eric's patch,
and you only made small minor changes, then it isn't your work.

^ permalink raw reply

* Re: SKB paged fragment lifecycle on receive
From: Jeremy Fitzhardinge @ 2011-06-24 20:11 UTC (permalink / raw)
  To: David Miller; +Cc: eric.dumazet, Ian.Campbell, netdev, xen-devel, rusty
In-Reply-To: <20110624.124624.1329947216240823992.davem@davemloft.net>

On 06/24/2011 12:46 PM, David Miller wrote:
> Pages get transferred between different SKBs all the time.
>
> For example, GRO makes extensive use of this technique.
> See net/core/skbuff.c:skb_gro_receive().
>
> It is just one example.

I see, and the new skb doesn't get a destructor copied from the
original, so there'd be no second callback.

Are the pages still attached to the first skb, or are they transferred
completely?

Thanks,
    J



^ permalink raw reply

* pull request: wireless-next-2.6 2011-06-24
From: John W. Linville @ 2011-06-24 20:22 UTC (permalink / raw)
  To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
  Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA

Dave,

Here is a big batch of updates intended for 3.1.  This batch got a bit
bigger than I would have liked -- I guess I let the Bluetooth, ath9k,
and b43 stuff sneak up on me...

Anyway, this is more-or-less the usual stuff -- lots of driver updates,
etc.  The usual suspects like iwlagn and ath9k have a lot of activity,
as do b43, zd1211rw, rtlwifi, and a few others.  The Bluetooth folks
are makign a strong showing as well.

Please let me know if there are problems!

Thanks,

John

---
The following changes since commit 22c8c9343258feda9ea9ebb9e5f8cbb727b69454:

  qlcnic: multi protocol internal loopback support added. (2011-06-24 01:17:07 -0700)

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

Amitkumar Karwar (2):
      mwifiex: get rid of global adapter pointer
      mwifiex: remove casts of void pointers

Anderson Briglia (7):
      Bluetooth: Add advertising report meta event structs
      Bluetooth: Implement the first SMP commands
      Bluetooth: Start SMP procedure
      Bluetooth: Add simple SMP pairing negotiation
      Bluetooth: Add LE SMP Cryptoolbox functions
      Bluetooth: Add SMP confirmation structs
      Bluetooth: Add SMP confirmation checks methods

Anderson Lizardo (1):
      Bluetooth: fix missing parameter for HCI_OP_DISCONNECT

Andre Guedes (8):
      Bluetooth: LE advertising cache
      Bluetooth: Add Advertising Report Meta Event handler
      Bluetooth: Clear advertising cache before scanning
      Bluetooth: Advertising entries lifetime
      Bluetooth: Add 'dst_type' field to struct hci_conn
      Bluetooth: Remove useless check in hci_connect()
      Bluetooth: Check advertising cache in hci_connect()
      Bluetooth: Set 'peer_addr_type' in hci_le_connect()

Antti Julku (2):
      Bluetooth: Move blacklisting functions to hci_core
      Bluetooth: Add blacklisting support for mgmt interface

Arend van Spriel (1):
      drivers: bcma: export bcma_core_disable() function

Connor Hansen (1):
      drivers/ssb/driver_chipcommon_pmu.c: uninitilized warning

Dan Carpenter (2):
      b43: check for allocation failures
      iwlegacy: fix up brokenness caused by cleanup

Daniel Drake (1):
      libertas: add sd8686 reset_card support

David Miller (3):
      Bluetooth: Kill set but not used variable 'l2cap_sk' in rfcomm_sock_getsockopt_old()
      Bluetooth: Do not ignore errors returned from strict_strtol()
      Bluetooth: Kill set but unused variable 'cmd' in cmtp_recv_capimsg()

Eliad Peller (3):
      mac80211: add ieee80211_get_operstate() function
      mac80211: add cancel_hw_scan() callback
      mac80211: quiesce vif before suspending

Emmanuel Grumbach (15):
      iwlagn: don't disable interrupts after the NIC has been reset
      iwlagn: add a iwl_pci.[ch] files that will contain all PCI specific code
      iwlagn: remove uneeded include to pci.h and dma_mapping.h from a few files
      iwlagn: introduce iwl_bus and iwl_bus_ops
      iwlagn: add get_dev to iwl_bus_ops
      iwlagn: move PCI related operations from probe and remove to PCI layer
      iwlagn: don't use the PCI wrappers for DMA operation
      iwlagn: add a method to get the HW ID description as a string to iwl_bus_ops
      iwlagn: don't read the PCI_REVISION_ID from iwl-agn.c
      iwlagn: add a get_irq method to iwl_bus_ops and use it
      iwlagn: finally kill the pointer to pci_dev from iwl-dev.h
      iwlagn: waterfall the bus level if prepare card failed
      iwlagn: fix misplaced bracket
      iwlagn: warn about nested SYNC commands
      iwlagn: store the irq number to iwl_bus just like dev

Gabor Juhos (32):
      ath9k: define mac version for AR9330
      ath9k: define device id for AR9330
      ath9k: add MAC revision detection for AR9330
      ath9k: add platform device id for AR9330
      ath9k: add AR9330 initvals
      ath9k: initialize mode registers for AR9330
      ath9k: initialize tx gain table for AR9330
      ath9k: initialize rx gain table for AR9330
      ath9k: add AR9330 specific PLL initialization
      ath9k: use different BB watchdog timeout value for AR9330
      ath9k: don't enable LDPC for AR9330
      ath9k: read spur frequency information from eeprom for AR9330
      ath9k: fix channel frequency calculation for AR9340
      ath9k: configure RF channel frequency for AR9330
      ath9k: enable TX/RX data byte swap for AR9330
      ath9k: skip internal regulator configuration for AR9330
      ath9k: enable tuning capacitance configuration for AR9330
      ath9k: use correct EEPROM base for AR9330
      ath9k: configure xpa bias level for AR9330
      ath9k: set NF limits for AR9330
      ath9k: enable antenna diversity for AR9330
      ath9k: use correct max_streams for AR9330
      ath9k: add a missing case statement to ath_ant_div_comb_alt_check
      ath9k: fix antenna diversity configuration for non AR9485 chips
      ath9k: remove superfluous parentheses
      ath9k: add fast_div_bias configuration for diversity group 1
      ath9k: set diversity group for AR9330
      ath9k: fix few register offsets for AR9330
      ath9k: configure diversity based on eeprom contents for AR9330
      ath9k: configure internal regulator for AR9330
      ath9k: add external_reset callback to ath9k_platfom_data for AR9330
      ath9k: enable support for AR9330

Gustavo F. Padovan (21):
      Bluetooth: fix set but not used warning
      Bluetooth: Create __l2cap_chan_close()
      Bluetooth: Create l2cap_chan_send()
      Bluetooth: Add chan->chan_type struct member
      Bluetooth: create channel timer to replace sk_timer
      Bluetooth: Remove export of l2cap_chan_clear_timer()
      Bluetooth: Rename __l2cap_chan_close() to l2cap_chan_close()
      Merge master.kernel.org:/.../padovan/bluetooth-2.6
      Bluetooth: Merge l2cap_chan_create() in the l2cap_sock_alloc()
      Bluetooth: Add l2cap_chan_ops abstraction
      Bluetooth: add recv() callback to l2cap_chan_ops
      Bluetooth: add close() callback to l2cap_chan_ops
      Bluetooth: Add state tracking to struct l2cap_chan
      Bluetooth: Add refcnt to struct l2cap_chan
      Bluetooth: Make timer functions generic
      Bluetooth: keep reference if any ERTM timer is enabled
      Bluetooth: Don't forget to check for LE_LINK
      Bluetooth: use bit operation on conf_state
      Bluetooth: Use bit operations on conn_state
      Bluetooth: Fix locking in blacklist code
      Merge master.kernel.org:/.../padovan/bluetooth-2.6

Hauke Mehrtens (1):
      ssb: add __devinit to some functions

Ilia Kolomisnky (1):
      Bluetooth: Fix L2CAP connection establishment

Jaikumar Ganesh (1):
      Bluetooth: Add BT_POWER L2CAP socket option.

Johan Hedberg (2):
      Bluetooth: Remove unnecessary use of hci_dev_list_lock
      Bluetooth: Fix accepting connect requests for defer_setup

Johannes Berg (4):
      Bluetooth: fix sparse & gcc warnings
      iwlagn: don't check ucode subtype
      netlink: advertise incomplete dumps
      nl80211: use netlink consistent dump feature for BSS dumps

John W. Linville (5):
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless-2.6
      Merge branch 'wireless-next-2.6' of git://git.kernel.org/.../iwlwifi/iwlwifi-2.6
      ath5k: free sc->ah in ath5k_deinit_softc
      Merge branch 'master' of master.kernel.org:/.../padovan/bluetooth-next-2.6
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless-next-2.6 into for-davem

Jussi Kivilinna (6):
      zd1211rw: fix invalid signal values from device
      zd1211rw: make 'handle_rx_packet: invalid, small RX packet' message debug-only
      zd1211rw: only update HW beacon if new beacon differs from currect
      zd1211rw: handle lost read-reg interrupts
      zd1211rw: don't let zd_mac_config_beacon() run too long from beacon interrupt handler
      zd1211rw: detect stalled beacon interrupt faster

Kalle Valo (4):
      iwlegacy: fix stop/wake queue hacks
      iwlwifi: fix stop/wake queue hacks
      zd1211rw: include mac80211.h from zd_chip.h
      rtlwifi: include mac80211.h from core.h

Larry Finger (1):
      rtlwifi: Fix warnings on parisc arch

Luiz Augusto von Dentz (2):
      Bluetooth: fix shutdown on SCO sockets
      Bluetooth: Fix L2CAP security check

Mat Martineau (2):
      Bluetooth: Restore accidentally-deleted line
      Bluetooth: Fix check for the ERTM local busy state

Mike McCormack (7):
      rtlwifi: Remove unnecessary indent
      rtlwifi: Resubmit skbs with bad CRC early
      rtlwifi: Free skb in one place
      rtlwifi: Factor out code to receive one packet
      rtlwifi: Fix typo in variable name
      rtlwifi: rtl8192cu: Remove unused parameter
      rtlwifi: rtl8192{c,ce,cu,se}: Remove comparisons of booleans with true

Mohammed Shafi Shajakhan (5):
      ath9k: Add debug messages to track PAPRD failures
      ath9k: remove a redundant call to pcipowersave
      ath9k: Fix a corner case failure in sending PAPRD frames in HT40
      ath9k_hw: make sure PAPRD training is properly done
      ath9k_hw: Fix calculation of PAPRD training power at 5Ghz

Nikanth Karthikesan (1):
      if_spi: Fix compilation warning - unused variable

Paul Stewart (2):
      cfg80211: Ignore downstream DEAUTH for authtry_bsses
      mac80211: Start monitor work on restart

Pavel Roskin (5):
      ath9k: use standard max(), remove A_MAX macro
      ath9k: typo fix in a comment
      ath5k: minor cleanup
      ath5k: annotate reg in ath5k_hw_nic_reset() as __iomem
      ath5k: add missing ieee80211_free_hw() on unload in AHB code

Rafał Miłecki (16):
      b43: define new PHYs and radio regs for cores >= 24
      b43: HT-PHY: add place for writing HT PHY support
      b43: add Kconfig option for compiling SSB driver
      b43: HT-PHY: implement radio ops
      b43: HT-PHY: implement switching analog
      bcma: enable support for 14e4:4357 (BCM43225)
      bcma: fix BCM43224 rev 0 workaround
      bcma: clean exports of functions
      b43: HT-PHY: implement killing radio
      b43: HT-PHY: enable radio
      b43: HT-PHY: define standard structs for channel switching
      b43: HT-PHY: add place for implementing channel switching
      b43: HT-PHY: switch radio to requested channel
      b43: N-PHY: update switching analog on/off
      b43: N-PHY: move declarations of chantables functions to correct files
      b43: HT-PHY: calibrate radio after switching channel

Ruiyi Zhang (1):
      Bluetooth: Allow unsegmented SDU retries on sock_queue_rcv_skb failure

Stanislaw Gruszka (8):
      iwlegacy: remove unused power commands defines
      iwlegacy: remove recover from statistics
      iwlegacy: remove reset rf infrastructure
      iwlegacy: remove firmware event log
      iwlegacy: remove unused agg_tids_count
      iwlegacy: refactor iwl4965_mac_channel_switch
      rt2x00: fix possible memory corruption in case of invalid rxdesc.size
      rt2x00: reset usb devices at probe

Stephen Boyd (1):
      Bluetooth: Silence DEBUG_STRICT_USER_COPY_CHECKS=y warning

Stephen Rothwell (1):
      Bluetooth: include scatterlist.h where needed

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

Vincent Zweije (1):
      networking: fix warning about unused label wake_up

Vinicius Costa Gomes (13):
      Bluetooth: Add support for using the crypto subsystem
      Bluetooth: Add support for LE Start Encryption
      Bluetooth: Remove debug statements
      Bluetooth: Add support for resuming socket when SMP is finished
      Bluetooth: Fix initial security level of LE links
      Bluetooth: Update the security level when link is encrypted
      Bluetooth: Add support for building pairing commands
      Bluetooth: Add support for Pairing features exchange
      Bluetooth: Add support for SMP timeout
      Bluetooth: Add key size checks for SMP
      Bluetooth: Fix crash when setting a LE socket to ready
      Bluetooth: Remove useless access to the socket
      Bluetooth: Fix not setting the chan state

Waldemar Rymarkiewicz (6):
      Bluetooth: Fix auth_complete_evt for legacy units
      Bluetooth: Refactor hci_auth_complete_evt function
      Bluetooth: Remove a magic number
      Bluetooth: Verify a pin code in pin_code_reply
      Bluetooth: Simplify hci_conn_accept_secure check
      Bluetooth: Clean up some code style issues

Wey-Yi Guy (27):
      iwlagn: usersapce application decide the size of trace buffer
      iwlagn: add dumpit support for testmode trace function
      iwlagn: move bt_coex_active as part of iwlagn_mod_params
      iwlagn: move led_mode as part of iwlagn_mod_params
      iwlagn: move no_sleep_autoadjust as part of iwlagn_mod_params
      iwlagn: Band capabilities in EEPROM
      iwlagn: use sku capabilities information from EEPROM
      iwlagn: add coex debug flag
      iwlagn: add debug message for coex related activities
      iwlagn: use IWL_DEBUG_TEMP for temperature related debug
      iwlagn: use IWL_DEBUG_FW for firmware related debug msg
      iwlagn: remove unused debug flag
      iwlagn: generic temperature location in EEPROM
      iwlagn: group similar defines together
      iwlagn: merge duplicated code into single place
      iwlagn: Sanity check for 11n capability
      iwlagn: Sanity check for valid context
      iwlagn: Remove un-necessary indirect call
      iwlagn: add PAN to tx flush
      iwlagn: Support flush queues for specified interface
      iwlagn: move PCI power related functions to the PCI layer
      iwlagn: add power_save module parameter
      iwlagn: Add power_level module parameter
      iwlagn: add offset define for subsystem id
      iwlagn: code alignment
      iwlagn: merge duplicate code into single function
      iwlagn: remove incorrect define

 drivers/bcma/bcma_private.h                        |    4 +-
 drivers/bcma/core.c                                |    3 +-
 drivers/bcma/driver_chipcommon_pmu.c               |    6 +-
 drivers/bcma/driver_pci.c                          |    1 +
 drivers/bcma/host_pci.c                            |    1 +
 drivers/bcma/main.c                                |    2 -
 drivers/net/b44.c                                  |    4 +-
 drivers/net/wireless/ath/ath5k/ahb.c               |    1 +
 drivers/net/wireless/ath/ath5k/ath5k.h             |    7 +-
 drivers/net/wireless/ath/ath5k/base.c              |   15 +-
 drivers/net/wireless/ath/ath5k/mac80211-ops.c      |    6 +-
 drivers/net/wireless/ath/ath5k/reset.c             |    6 +-
 drivers/net/wireless/ath/ath9k/ahb.c               |    4 +
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.c     |   39 +-
 drivers/net/wireless/ath/ath9k/ar9003_hw.c         |  182 +++-
 drivers/net/wireless/ath/ath9k/ar9003_paprd.c      |   39 +-
 drivers/net/wireless/ath/ath9k/ar9003_phy.c        |   41 +-
 drivers/net/wireless/ath/ath9k/ar9003_phy.h        |    6 +-
 .../net/wireless/ath/ath9k/ar9330_1p1_initvals.h   | 1147 ++++++++++++++++++++
 .../net/wireless/ath/ath9k/ar9330_1p2_initvals.h   | 1080 ++++++++++++++++++
 drivers/net/wireless/ath/ath9k/ath9k.h             |    4 +-
 drivers/net/wireless/ath/ath9k/hw.c                |   96 ++-
 drivers/net/wireless/ath/ath9k/hw.h                |    8 +-
 drivers/net/wireless/ath/ath9k/init.c              |    4 +-
 drivers/net/wireless/ath/ath9k/main.c              |   16 +-
 drivers/net/wireless/ath/ath9k/rc.c                |    6 +-
 drivers/net/wireless/ath/ath9k/recv.c              |  146 ++-
 drivers/net/wireless/ath/ath9k/reg.h               |   16 +
 drivers/net/wireless/b43/Kconfig                   |   13 +
 drivers/net/wireless/b43/Makefile                  |    2 +
 drivers/net/wireless/b43/b43.h                     |    6 +
 drivers/net/wireless/b43/bus.c                     |    9 +-
 drivers/net/wireless/b43/main.c                    |   37 +-
 drivers/net/wireless/b43/phy_common.c              |    6 +
 drivers/net/wireless/b43/phy_common.h              |    3 +
 drivers/net/wireless/b43/phy_ht.c                  |  274 +++++
 drivers/net/wireless/b43/phy_ht.h                  |   34 +
 drivers/net/wireless/b43/phy_n.c                   |   21 +-
 drivers/net/wireless/b43/radio_2055.h              |    5 +
 drivers/net/wireless/b43/radio_2056.h              |    5 +
 drivers/net/wireless/b43/radio_2059.c              |   30 +
 drivers/net/wireless/b43/radio_2059.h              |   49 +
 drivers/net/wireless/b43/sdio.c                    |    6 +-
 drivers/net/wireless/b43/tables_nphy.h             |    8 -
 drivers/net/wireless/iwlegacy/iwl-3945.c           |    4 -
 drivers/net/wireless/iwlegacy/iwl-4965-lib.c       |   79 +--
 drivers/net/wireless/iwlegacy/iwl-4965-rx.c        |   78 +--
 drivers/net/wireless/iwlegacy/iwl-4965.c           |    4 -
 drivers/net/wireless/iwlegacy/iwl-commands.h       |    7 -
 drivers/net/wireless/iwlegacy/iwl-core.c           |   91 +-
 drivers/net/wireless/iwlegacy/iwl-core.h           |   15 +-
 drivers/net/wireless/iwlegacy/iwl-debugfs.c        |  192 +---
 drivers/net/wireless/iwlegacy/iwl-dev.h            |   60 +-
 drivers/net/wireless/iwlegacy/iwl-devtrace.c       |    3 -
 drivers/net/wireless/iwlegacy/iwl-devtrace.h       |   60 -
 drivers/net/wireless/iwlegacy/iwl-helpers.h        |    9 +
 drivers/net/wireless/iwlegacy/iwl-rx.c             |   21 -
 drivers/net/wireless/iwlegacy/iwl-scan.c           |   92 +--
 drivers/net/wireless/iwlegacy/iwl3945-base.c       |  301 +-----
 drivers/net/wireless/iwlegacy/iwl4965-base.c       |  463 +-------
 drivers/net/wireless/iwlwifi/Makefile              |    1 +
 drivers/net/wireless/iwlwifi/iwl-1000.c            |    4 -
 drivers/net/wireless/iwlwifi/iwl-2000.c            |   20 +-
 drivers/net/wireless/iwlwifi/iwl-5000-hw.h         |    2 +-
 drivers/net/wireless/iwlwifi/iwl-5000.c            |   23 +-
 drivers/net/wireless/iwlwifi/iwl-6000.c            |   22 +-
 drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c      |   14 +-
 drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c        |   12 +-
 drivers/net/wireless/iwlwifi/iwl-agn-hw.h          |    7 -
 drivers/net/wireless/iwlwifi/iwl-agn-ict.c         |    4 +-
 drivers/net/wireless/iwlwifi/iwl-agn-lib.c         |   75 +-
 drivers/net/wireless/iwlwifi/iwl-agn-tt.c          |   38 +-
 drivers/net/wireless/iwlwifi/iwl-agn-tx.c          |   30 +-
 drivers/net/wireless/iwlwifi/iwl-agn-ucode.c       |   45 +-
 drivers/net/wireless/iwlwifi/iwl-agn.c             |  541 +++-------
 drivers/net/wireless/iwlwifi/iwl-agn.h             |   26 +-
 drivers/net/wireless/iwlwifi/iwl-commands.h        |   35 +-
 drivers/net/wireless/iwlwifi/iwl-core.c            |   85 +--
 drivers/net/wireless/iwlwifi/iwl-core.h            |   47 +-
 drivers/net/wireless/iwlwifi/iwl-debug.h           |   18 +-
 drivers/net/wireless/iwlwifi/iwl-debugfs.c         |    7 +-
 drivers/net/wireless/iwlwifi/iwl-dev.h             |   60 +-
 drivers/net/wireless/iwlwifi/iwl-eeprom.c          |   25 +
 drivers/net/wireless/iwlwifi/iwl-eeprom.h          |   25 +-
 drivers/net/wireless/iwlwifi/iwl-hcmd.c            |   11 +-
 drivers/net/wireless/iwlwifi/iwl-helpers.h         |    9 +
 drivers/net/wireless/iwlwifi/iwl-io.h              |    6 +-
 drivers/net/wireless/iwlwifi/iwl-led.c             |   14 +-
 drivers/net/wireless/iwlwifi/iwl-pci.c             |  571 ++++++++++
 drivers/net/wireless/iwlwifi/iwl-pci.h             |   69 ++
 drivers/net/wireless/iwlwifi/iwl-power.c           |   33 +-
 drivers/net/wireless/iwlwifi/iwl-power.h           |    2 +-
 drivers/net/wireless/iwlwifi/iwl-rx.c              |    4 +-
 drivers/net/wireless/iwlwifi/iwl-sv-open.c         |  139 ++-
 drivers/net/wireless/iwlwifi/iwl-testmode.h        |    9 +-
 drivers/net/wireless/iwlwifi/iwl-tx.c              |   33 +-
 drivers/net/wireless/libertas/if_sdio.c            |   34 +
 drivers/net/wireless/libertas/if_spi.c             |    6 +-
 drivers/net/wireless/mwifiex/11n.c                 |   33 +-
 drivers/net/wireless/mwifiex/11n.h                 |   14 +-
 drivers/net/wireless/mwifiex/11n_rxreorder.c       |    5 +-
 drivers/net/wireless/mwifiex/11n_rxreorder.h       |    5 +-
 drivers/net/wireless/mwifiex/cmdevt.c              |   28 +-
 drivers/net/wireless/mwifiex/join.c                |   23 +-
 drivers/net/wireless/mwifiex/main.c                |   18 +-
 drivers/net/wireless/mwifiex/main.h                |   17 +-
 drivers/net/wireless/mwifiex/scan.c                |    6 +-
 drivers/net/wireless/mwifiex/sdio.c                |   81 +-
 drivers/net/wireless/mwifiex/sta_cmd.c             |  101 +-
 drivers/net/wireless/mwifiex/sta_cmdresp.c         |   69 +-
 drivers/net/wireless/mwifiex/sta_rx.c              |    2 +-
 drivers/net/wireless/mwifiex/txrx.c                |    2 +-
 drivers/net/wireless/rt2x00/rt2x00dev.c            |   13 +
 drivers/net/wireless/rt2x00/rt2x00usb.c            |    1 +
 drivers/net/wireless/rtlwifi/base.c                |    2 +-
 drivers/net/wireless/rtlwifi/core.c                |   12 +-
 drivers/net/wireless/rtlwifi/core.h                |    2 +
 drivers/net/wireless/rtlwifi/efuse.c               |    8 +-
 drivers/net/wireless/rtlwifi/pci.c                 |  206 ++--
 drivers/net/wireless/rtlwifi/ps.c                  |   65 +-
 drivers/net/wireless/rtlwifi/ps.h                  |    3 +-
 drivers/net/wireless/rtlwifi/rc.c                  |    2 +-
 drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c  |    4 +-
 drivers/net/wireless/rtlwifi/rtl8192ce/hw.c        |   10 +-
 drivers/net/wireless/rtlwifi/rtl8192ce/led.c       |    2 +-
 drivers/net/wireless/rtlwifi/rtl8192ce/rf.c        |    2 +-
 drivers/net/wireless/rtlwifi/rtl8192ce/trx.c       |    8 +-
 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c        |    8 +-
 drivers/net/wireless/rtlwifi/rtl8192cu/led.c       |    2 +-
 drivers/net/wireless/rtlwifi/rtl8192cu/rf.c        |    2 +-
 drivers/net/wireless/rtlwifi/rtl8192cu/trx.c       |    2 +-
 drivers/net/wireless/rtlwifi/rtl8192se/dm.c        |    2 +-
 drivers/net/wireless/rtlwifi/rtl8192se/hw.c        |   11 +-
 drivers/net/wireless/rtlwifi/rtl8192se/led.c       |    2 +-
 drivers/net/wireless/rtlwifi/rtl8192se/phy.c       |    4 +-
 drivers/net/wireless/rtlwifi/rtl8192se/reg.h       |    6 +-
 drivers/net/wireless/rtlwifi/rtl8192se/rf.c        |    2 +-
 drivers/net/wireless/rtlwifi/rtl8192se/trx.c       |    6 +-
 drivers/net/wireless/rtlwifi/wifi.h                |    4 +-
 drivers/net/wireless/zd1211rw/zd_chip.h            |    2 +
 drivers/net/wireless/zd1211rw/zd_def.h             |    6 +
 drivers/net/wireless/zd1211rw/zd_mac.c             |  118 ++-
 drivers/net/wireless/zd1211rw/zd_mac.h             |    1 +
 drivers/net/wireless/zd1211rw/zd_usb.c             |  129 ++-
 drivers/net/wireless/zd1211rw/zd_usb.h             |    5 +-
 drivers/ssb/driver_chipcommon_pmu.c                |    4 +-
 drivers/ssb/driver_gige.c                          |   13 +-
 drivers/ssb/driver_pcicore.c                       |   10 +-
 drivers/ssb/main.c                                 |   29 +-
 drivers/ssb/pcihost_wrapper.c                      |    6 +-
 include/linux/ath9k_platform.h                     |    2 +
 include/linux/bcma/bcma.h                          |    1 +
 include/linux/bcma/bcma_driver_pci.h               |    2 +
 include/linux/netlink.h                            |    2 +
 include/net/bluetooth/bluetooth.h                  |   15 +-
 include/net/bluetooth/hci.h                        |   59 +
 include/net/bluetooth/hci_core.h                   |   68 +-
 include/net/bluetooth/l2cap.h                      |  117 ++-
 include/net/bluetooth/mgmt.h                       |   10 +
 include/net/bluetooth/rfcomm.h                     |    9 +-
 include/net/bluetooth/smp.h                        |   46 +
 include/net/genetlink.h                            |   32 +
 include/net/mac80211.h                             |   20 +
 include/net/netlink.h                              |   24 +
 net/bluetooth/Kconfig                              |    8 +
 net/bluetooth/Makefile                             |    2 +-
 net/bluetooth/cmtp/capi.c                          |    3 +-
 net/bluetooth/hci_conn.c                           |   85 ++-
 net/bluetooth/hci_core.c                           |  195 ++++-
 net/bluetooth/hci_event.c                          |  206 +++-
 net/bluetooth/hci_sock.c                           |   70 +--
 net/bluetooth/l2cap_core.c                         |  885 ++++++++++------
 net/bluetooth/l2cap_sock.c                         |  375 +++----
 net/bluetooth/mgmt.c                               |  133 ++-
 net/bluetooth/rfcomm/sock.c                        |    6 +-
 net/bluetooth/smp.c                                |  534 +++++++++
 net/mac80211/driver-ops.h                          |   10 +
 net/mac80211/driver-trace.h                        |    6 +
 net/mac80211/mlme.c                                |    8 +
 net/mac80211/pm.c                                  |   43 +-
 net/mac80211/scan.c                                |   37 +-
 net/mac80211/util.c                                |    2 +
 net/netlink/af_netlink.c                           |    2 +
 net/wireless/mlme.c                                |    4 +-
 net/wireless/nl80211.c                             |   12 +-
 185 files changed, 7520 insertions(+), 3614 deletions(-)
 create mode 100644 drivers/net/wireless/ath/ath9k/ar9330_1p1_initvals.h
 create mode 100644 drivers/net/wireless/ath/ath9k/ar9330_1p2_initvals.h
 create mode 100644 drivers/net/wireless/b43/phy_ht.c
 create mode 100644 drivers/net/wireless/b43/phy_ht.h
 create mode 100644 drivers/net/wireless/b43/radio_2059.c
 create mode 100644 drivers/net/wireless/b43/radio_2059.h
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-pci.c
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-pci.h
 create mode 100644 net/bluetooth/smp.c

Omnibus patch is available here:

	http://www.kernel.org/pub/linux/kernel/people/linville/wireless-next-2.6-2011-06-24.patch.bz2

-- 
John W. Linville		Someday the world will need a hero, and you
linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org			might be all we have.  Be ready.
--
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: SKB paged fragment lifecycle on receive
From: David Miller @ 2011-06-24 20:27 UTC (permalink / raw)
  To: jeremy; +Cc: eric.dumazet, Ian.Campbell, netdev, xen-devel, rusty
In-Reply-To: <4E04EF8F.6070900@goop.org>

From: Jeremy Fitzhardinge <jeremy@goop.org>
Date: Fri, 24 Jun 2011 13:11:59 -0700

> Are the pages still attached to the first skb, or are they transferred
> completely?

In this case they are transferred completely, the refcount isn't
modified at all.

There are cases where partial transfers occur, and in such cases
the refcount is modified.  Just swim around in net/core/skbuff.c
you'll find them :-)



^ permalink raw reply

* Re: pull request: wireless-2.6 2011-06-24
From: David Miller @ 2011-06-24 20:30 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <20110624184949.GC4793@tuxdriver.com>

From: "John W. Linville" <linville@tuxdriver.com>
Date: Fri, 24 Jun 2011 14:49:49 -0400

> Dave,
> 
> Here is another batch of fixes intended for 3.0.  Included are too
> rtlwifi fixes from Larry:  a regression that broke firmware loading for
> rtl8292cu; and a fix to arbitrate between two devices that share the
> same PCI ID but are handled by different drivers...yeah.
> 
> The rest are Bluetooth fixes -- quoth Gustavo:
> 
> 	Three regressions fix intended for 3.0. Two of them fix a
> 	change made in our HCI security process for 3.0. The third
> 	one fixes an issue with non-SSP devices.  All of them are
> 	critical fixes. They should be in 3.0. Please pull!  Thanks.
> 
> Please let me know if there are problems!

Pulled, thanks!

^ permalink raw reply

* [PATCH] vmxnet3: Enable GRO support.
From: Jesse Gross @ 2011-06-24 20:33 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Shreyas Bhatewara, VMware PV-Drivers

When receiving packets from another guest on the same hypervisor, it's
generally possible to receive large packets because no segmentation is
necessary and these packets are handled by LRO.  However, when doing
routing or bridging we must disable LRO and lose this benefit.  In
these cases GRO can still be used and it is very effective because the
packets which are segmented in the hypervisor are received very close
together and can easily be merged.

CC: Shreyas Bhatewara <sbhatewara@vmware.com>
CC: VMware PV-Drivers <pv-drivers@vmware.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
---
This applies on top of my previous vmxnet3 patch
"vmxnet3: Convert to new vlan model."
---
 drivers/net/vmxnet3/vmxnet3_drv.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index c84b1dd..5353429 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -1234,7 +1234,7 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
 			if (unlikely(rcd->ts))
 				__vlan_hwaccel_put_tag(skb, rcd->tci);
 
-			netif_receive_skb(skb);
+			napi_gro_receive(&rq->napi, skb);
 
 			ctx->skb = NULL;
 		}
-- 
1.7.4.1


^ permalink raw reply related

* Re: [PATCH] bridge: Forward EAPOL Kconfig option BRIDGE_PAE_FORWARD
From: Nick Carter @ 2011-06-24 21:29 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, davem
In-Reply-To: <20110624120859.3c43bbcb@nehalam.ftrdhcpuser.net>

On 24 June 2011 20:08, Stephen Hemminger
<shemminger@linux-foundation.org> wrote:
> On Fri, 24 Jun 2011 19:29:41 +0100
> Nick Carter <ncarter100@gmail.com> wrote:
>
>> New diffs below with the Kconfig option removed as requested.
>>
>> Now all users and distro's will get the correct 802.1x bridge
>> behaviour by default.  That is EAPOL frames attempting to traverse the
>> bridge will be dropped (IEEE Std 802.1X-2001 C.3.3).
>>
>> Users or distro's who want the non-standard behaviour of forwarding
>> EAPOL frames, can use a simple runtime configuration change to the
>> sysfs bridge/pae_forward attribute.
>
> This is much better, thanks.
> See the comments for how to make the code more compact and tighter.
>
>> diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
>> index d9d1e2b..91c1b71 100644
>> --- a/net/bridge/br_if.c
>> +++ b/net/bridge/br_if.c
>> @@ -214,6 +214,7 @@ static struct net_device *new_bridge_dev(struct
>> net *net, const char *name)
>>       br->topology_change = 0;
>>       br->topology_change_detected = 0;
>>       br->ageing_time = 300 * HZ;
>> +     br->pae_forward = BR_PAE_DEFAULT;
>
> It is just a boolean, why the verbose enum values?
In case we want BR_PAE_<foo> in the future, not that I can think of a
3rd option now.  So happy to change to a boolean.
>
>>       br_netfilter_rtable_init(br);
>>
>> diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
>> index 90e985b..edeb92d 100644
>> --- a/net/bridge/br_input.c
>> +++ b/net/bridge/br_input.c
>> @@ -43,6 +43,16 @@ static int br_pass_frame_up(struct sk_buff *skb)
>>                      netif_receive_skb);
>>  }
>>
>> +static inline bool br_pae_forward(struct net_bridge *br, __be16 proto)
>> +{
>> +     return br->pae_forward == BR_PAE_FORWARD && proto == htons(ETH_P_PAE);
>> +}
>> +
>> +static inline bool br_pae_drop(struct net_bridge *br, __be16 proto)
>> +{
>> +     return br->pae_forward == BR_PAE_DEFAULT && proto == htons(ETH_P_PAE);
>> +}
>
> Since only used one place, the extra wrappers aren't helping.
I thought they helped readability, but certainly for performance we
should only be doing each check once in a single place.  Again happy
to change.
>
>>  /* note: already called with rcu_read_lock */
>>  int br_handle_frame_finish(struct sk_buff *skb)
>>  {
>> @@ -98,6 +108,10 @@ int br_handle_frame_finish(struct sk_buff *skb)
>>       }
>>
>>       if (skb) {
>> +             /* Prevent Crosstalk (IEEE Std 802.1X-2001 C.3.3) */
>> +             if (unlikely(br_pae_drop(br, skb->protocol)))
>> +                     goto drop;
>> +
>
> Referencing standard is good, but perhaps explaining what that means.
ok

> Since these are multicast frames, will it ever reach this point.
> This point is reached for unicast frames that are not local.
yes, think of it as a bug fix rather than part of new functionality

> And won't this change existing behavior since before this 802.1x unicast
> frames would be forwarded.
Yes, that was my original motivation for making it a Kconfig setting,
so there would be no chance of regressions.  But keep in mind that
802.1x handshake must start with a multicast.  Its only if that
multicast is delivered that the reply can be unicast.  So any one
relying on the existing behaviour of forwarding unicast 802.1x must be
doing something very strange and non-standard.  I can't imagine what.
If there is a valid use case then they now have the simple workaround
of enabling pae forwarding.

>>               if (dst)
>>                       br_forward(dst->dst, skb, skb2);
>>               else
>> @@ -166,6 +180,10 @@ struct sk_buff *br_handle_frame(struct sk_buff *skb)
>>               if (p->br->stp_enabled == BR_NO_STP && dest[5] == 0)
>>                       goto forward;
>>
>> +             /* Check if PAE frame should be forwarded */
>> +             if (br_pae_forward(p->br, skb->protocol))
>> +                     goto forward;
>> +
>>               if (NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_IN, skb, skb->dev,
>>                           NULL, br_handle_local_finish))
>>                       return NULL;    /* frame consumed by filter */
>> diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
>> index 4e1b620..683c057 100644
>> --- a/net/bridge/br_private.h
>> +++ b/net/bridge/br_private.h
>> @@ -244,6 +244,11 @@ struct net_bridge
>>       struct timer_list               multicast_query_timer;
>>  #endif
>>
>> +     enum {
>> +             BR_PAE_DEFAULT,         /* 802.1x frames consumed by bridge */
>> +             BR_PAE_FORWARD,         /* 802.1x frames forwarded by bridge */
>> +     } pae_forward;
>> +
>>       struct timer_list               hello_timer;
>>       struct timer_list               tcn_timer;
>>       struct timer_list               topology_change_timer;
>> diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c
>> index 5c1e555..9bdbc84 100644
>> --- a/net/bridge/br_sysfs_br.c
>> +++ b/net/bridge/br_sysfs_br.c
>> @@ -679,6 +679,31 @@ static DEVICE_ATTR(nf_call_arptables, S_IRUGO | S_IWUSR,
>>                  show_nf_call_arptables, store_nf_call_arptables);
>>  #endif
>>
>> +static ssize_t show_pae_forward(struct device *d, struct
>> device_attribute *attr,
>> +                             char *buf)
>> +{
>> +     struct net_bridge *br = to_bridge(d);
>> +     return sprintf(buf, "%d\n", br->pae_forward);
>> +}
>> +
>> +static int set_pae_forward(struct net_bridge *br, unsigned long val)
>> +{
>> +     if (val > BR_PAE_FORWARD)
>> +             return -EINVAL;
>> +
>> +     br->pae_forward = val;
>> +     return 0;
>> +}
>> +
>> +static ssize_t store_pae_forward(struct device *d,
>> +                              struct device_attribute *attr, const char *buf,
>> +                              size_t len)
>> +{
>> +     return store_bridge_parm(d, buf, len, set_pae_forward);
>> +}
>> +static DEVICE_ATTR(pae_forward, S_IRUGO | S_IWUSR, show_pae_forward,
>> +                store_pae_forward);
>> +
>>  static struct attribute *bridge_attrs[] = {
>>       &dev_attr_forward_delay.attr,
>>       &dev_attr_hello_time.attr,
>> @@ -698,6 +723,7 @@ static struct attribute *bridge_attrs[] = {
>>       &dev_attr_gc_timer.attr,
>>       &dev_attr_group_addr.attr,
>>       &dev_attr_flush.attr,
>> +     &dev_attr_pae_forward.attr,
>>  #ifdef CONFIG_BRIDGE_IGMP_SNOOPING
>>       &dev_attr_multicast_router.attr,
>>       &dev_attr_multicast_snooping.attr,
>
>

^ permalink raw reply

* Re: [PATCH 1/1] r8169: fix wrong register use.
From: David Miller @ 2011-06-24 21:33 UTC (permalink / raw)
  To: romieu; +Cc: netdev, nic_swsd, hayeswang
In-Reply-To: <20110624174944.GA3700@electric-eye.fr.zoreil.com>

From: Francois Romieu <romieu@fr.zoreil.com>
Date: Fri, 24 Jun 2011 19:49:44 +0200

> Please pull from branch 'davem.r8169' in repository
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/romieu/netdev-2.6.git davem.r8169
> 
> to get the change below.

Pulled, thanks!

^ permalink raw reply

* Re: pull request: wireless-next-2.6 2011-06-24
From: David Miller @ 2011-06-24 21:32 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, netdev
In-Reply-To: <20110624202249.GF4793@tuxdriver.com>

From: "John W. Linville" <linville@tuxdriver.com>
Date: Fri, 24 Jun 2011 16:22:49 -0400

> Here is a big batch of updates intended for 3.1.  This batch got a bit
> bigger than I would have liked -- I guess I let the Bluetooth, ath9k,
> and b43 stuff sneak up on me...
> 
> Anyway, this is more-or-less the usual stuff -- lots of driver updates,
> etc.  The usual suspects like iwlagn and ath9k have a lot of activity,
> as do b43, zd1211rw, rtlwifi, and a few others.  The Bluetooth folks
> are makign a strong showing as well.
> 
> Please let me know if there are problems!

Pulled, thanks John.

^ permalink raw reply

* Re: ipv6 hitting route max_size
From: David Miller @ 2011-06-24 21:35 UTC (permalink / raw)
  To: sim; +Cc: netdev, yoshfuji
In-Reply-To: <20110609044042.GA32537@hostway.ca>

From: Simon Kirby <sim@hostway.ca>
Date: Wed, 8 Jun 2011 21:40:42 -0700

> Didn't apply to 2.6.39, so I tried 3.0-rc2, but I get an Oops when
> running the example reproduction case I gave before (

I'll try to debug this.

^ permalink raw reply

* Re: ipv6 hitting route max_size
From: David Miller @ 2011-06-24 21:57 UTC (permalink / raw)
  To: sim; +Cc: netdev, yoshfuji
In-Reply-To: <20110609044042.GA32537@hostway.ca>

From: Simon Kirby <sim@hostway.ca>
Date: Wed, 8 Jun 2011 21:40:42 -0700

> Didn't apply to 2.6.39, so I tried 3.0-rc2, but I get an Oops when
> running the example reproduction case I gave before (
> 
> for ((i = 0;i < 4200;i++)); do ip route add unreachable 2000::$i; done
> 
> ) both with and without your patch applied:

I tried to reproduce this with Linus's current tree but I cannot.

Here is what I did:

-------------------- hex.c --------------------
#include <stdio.h>

int main(void)
{
	int i;

	for (i = 0; i < 0x4200; i++) {
		printf("%04x ", i);
	}
	printf("\n");
	return 0;
}
-------------------- hex.c --------------------
bash$ gcc -o hex hex.c
bash$ for i in $(./hex); do ip route add unreachable 2000::$i; done
bash$

It takes a bit of time to run, but no crash. :-)


^ permalink raw reply

* RE: [Pv-drivers] [PATCH] vmxnet3: Enable GRO support.
From: Scott Goldman @ 2011-06-24 22:02 UTC (permalink / raw)
  To: Jesse Gross, David Miller, Shreyas Bhatewara
  Cc: VMware PV-Drivers, netdev@vger.kernel.org
In-Reply-To: <1308947605-4300-1-git-send-email-jesse@nicira.com>

Hi Jesse.

 
> When receiving packets from another guest on the same hypervisor, it's
> generally possible to receive large packets because no segmentation is
> necessary and these packets are handled by LRO.  However, when doing
> routing or bridging we must disable LRO and lose this benefit.  In
> these cases GRO can still be used and it is very effective because the
> packets which are segmented in the hypervisor are received very close
> together and can easily be merged.


> -			netif_receive_skb(skb);
> +			napi_gro_receive(&rq->napi, skb);

So... this doesn't discriminate between if LRO is off or on.  The last time I tried using GRO on top of our hardware LRO, there was actually some minor performance penalty. Do you have any benchmarks showing that this is ok? If not, do you think it might make sense to just do gro only if(unlikely(lro is off))?

Thanks,
-sjg

^ permalink raw reply

* [PATCH net-next 01/20] tipc: Convert fatal broadcast sanity check to non-fatal check
From: Paul Gortmaker @ 2011-06-24 22:07 UTC (permalink / raw)
  To: davem; +Cc: netdev, Allan.Stephens, Allan Stephens, Paul Gortmaker
In-Reply-To: <1308953247-25266-1-git-send-email-paul.gortmaker@windriver.com>

From: Allan Stephens <allan.stephens@windriver.com>

Modifies the existing broadcast link sanity check that detects an
attempt to send a message off-node when there are no available
destinations so that it no longer causes a kernel panic; instead,
the check now issues a warning and stack trace and then returns
without sending the message anywhere.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 net/tipc/bcast.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index fa68d1e..759b318 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -552,12 +552,16 @@ static int tipc_bcbearer_send(struct sk_buff *buf,
 	if (likely(!msg_non_seq(buf_msg(buf)))) {
 		struct tipc_msg *msg;
 
-		assert(tipc_bcast_nmap.count != 0);
 		bcbuf_set_acks(buf, tipc_bcast_nmap.count);
 		msg = buf_msg(buf);
 		msg_set_non_seq(msg, 1);
 		msg_set_mc_netid(msg, tipc_net_id);
 		bcl->stats.sent_info++;
+
+		if (WARN_ON(!tipc_bcast_nmap.count)) {
+			dump_stack();
+			return 0;
+		}
 	}
 
 	/* Send buffer over bearers until all targets reached */
-- 
1.7.4.4


^ permalink raw reply related

* [PATCH net-next 00/20] misc tipc updates / enhancements
From: Paul Gortmaker @ 2011-06-24 22:07 UTC (permalink / raw)
  To: davem; +Cc: netdev, Allan.Stephens, Paul Gortmaker

A bit more dead code removal, some collapsing of functions with
too many arguments, and some cosmetic stuff with no real impact.

But I think the best part in this lot is getting rid of the internal
(to tipc) duplication of "almost" linked list like code, and just
having it use the normal shared kernel code for the task. 
The diffstat summary reflects the net gain here:

       12 files changed, 276 insertions(+), 381 deletions(-)

All credit to Al for the work to get here.  I'm just an intermediate
reviewer -- and happy to see my value-add in that role becoming smaller
and smaller each time as tipc-2 leaves the SF tipc-1.7.x further behind.

I've independently tested using the basic tipcTS/tipcTC tests between
an x86-32 and an x86-64 host, in both directions.

Thanks,
Paul.

---

The following changes since commit 21e842579a5fd1ce746be4e34ac53ef67d6f0a6b:

  Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/jkirsher/net-next-2.6 (2011-06-23 23:39:33 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/paulg/net-next-2.6.git tipc-Jun24-2011

Allan Stephens (20):
  tipc: Convert fatal broadcast sanity check to non-fatal check
  tipc: Remove unused sanity test macro
  tipc: Standardize exit logic for message rejection handling
  tipc: Add sanity check to detect rejection of non-payload messages
  tipc: Optimize routing of returned payload messages
  tipc: Optimizations & corrections to message rejection
  tipc: Eliminate message header routines for caching destination node
  tipc: Eliminate redundant masking in message header routines
  tipc: Partition name table instance array info into two parts
  tipc: Convert name table publication lists to standard kernel lists
  tipc: Eliminate checks for empty zone list during name translation
  tipc: Correct typo in link statistics output
  tipc: Eliminate unused field in bearer structure
  tipc: Remove unnecessary includes in socket code
  tipc: Eliminate useless check when creating internal message
  tipc: Cleanup of message header size terminology
  tipc: Optimize creation of FIN messages
  tipc: Reject connection protocol message sent to unconnected port
  tipc: Don't create payload message using connection protocol routine
  tipc: Optimize creation of connection protocol messages

 net/tipc/bcast.c      |    6 +-
 net/tipc/bearer.c     |    1 -
 net/tipc/bearer.h     |    2 -
 net/tipc/core.h       |    6 -
 net/tipc/link.c       |    6 +-
 net/tipc/msg.c        |    6 +-
 net/tipc/msg.h        |   34 ++-----
 net/tipc/name_distr.c |    6 +-
 net/tipc/name_table.c |  289 ++++++++++++++++++++-----------------------------
 net/tipc/name_table.h |   14 ++--
 net/tipc/port.c       |  284 ++++++++++++++++++++++--------------------------
 net/tipc/socket.c     |    3 -
 12 files changed, 276 insertions(+), 381 deletions(-)

-- 
1.7.4.4


^ permalink raw reply

* [PATCH net-next 02/20] tipc: Remove unused sanity test macro
From: Paul Gortmaker @ 2011-06-24 22:07 UTC (permalink / raw)
  To: davem; +Cc: netdev, Allan.Stephens, Allan Stephens, Paul Gortmaker
In-Reply-To: <1308953247-25266-1-git-send-email-paul.gortmaker@windriver.com>

From: Allan Stephens <allan.stephens@windriver.com>

Eliminates a TIPC-specific assert() macro that is no longer used.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 net/tipc/core.h |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/net/tipc/core.h b/net/tipc/core.h
index 436dda1..d234a98 100644
--- a/net/tipc/core.h
+++ b/net/tipc/core.h
@@ -62,12 +62,6 @@ struct tipc_msg;	/* msg.h */
 struct print_buf;	/* log.h */
 
 /*
- * TIPC sanity test macros
- */
-
-#define assert(i)  BUG_ON(!(i))
-
-/*
  * TIPC system monitoring code
  */
 
-- 
1.7.4.4


^ permalink raw reply related

* [PATCH net-next 03/20] tipc: Standardize exit logic for message rejection handling
From: Paul Gortmaker @ 2011-06-24 22:07 UTC (permalink / raw)
  To: davem; +Cc: netdev, Allan.Stephens, Allan Stephens, Paul Gortmaker
In-Reply-To: <1308953247-25266-1-git-send-email-paul.gortmaker@windriver.com>

From: Allan Stephens <allan.stephens@windriver.com>

Modifies the routine that handles the rejection of payload messages
so that it has a single exit point that frees up the rejected message,
thereby eliminating some duplicated code.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 net/tipc/port.c |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/net/tipc/port.c b/net/tipc/port.c
index c68dc95..3946b5b 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -367,10 +367,8 @@ int tipc_reject_msg(struct sk_buff *buf, u32 err)
 		imp++;
 
 	/* discard rejected message if it shouldn't be returned to sender */
-	if (msg_errcode(msg) || msg_dest_droppable(msg)) {
-		buf_discard(buf);
-		return data_sz;
-	}
+	if (msg_errcode(msg) || msg_dest_droppable(msg))
+		goto exit;
 
 	/* construct rejected message */
 	if (msg_mcast(msg))
@@ -378,10 +376,9 @@ int tipc_reject_msg(struct sk_buff *buf, u32 err)
 	else
 		hdr_sz = LONG_H_SIZE;
 	rbuf = tipc_buf_acquire(data_sz + hdr_sz);
-	if (rbuf == NULL) {
-		buf_discard(buf);
-		return data_sz;
-	}
+	if (rbuf == NULL)
+		goto exit;
+
 	rmsg = buf_msg(rbuf);
 	tipc_msg_init(rmsg, imp, msg_type(msg), hdr_sz, msg_orignode(msg));
 	msg_set_errcode(rmsg, err);
@@ -411,9 +408,11 @@ int tipc_reject_msg(struct sk_buff *buf, u32 err)
 		tipc_net_route_msg(abuf);
 	}
 
-	/* send rejected message */
-	buf_discard(buf);
+	/* send returned message & dispose of rejected message */
+
 	tipc_net_route_msg(rbuf);
+exit:
+	buf_discard(buf);
 	return data_sz;
 }
 
-- 
1.7.4.4


^ permalink raw reply related

* [PATCH net-next 05/20] tipc: Optimize routing of returned payload messages
From: Paul Gortmaker @ 2011-06-24 22:07 UTC (permalink / raw)
  To: davem; +Cc: netdev, Allan.Stephens, Allan Stephens, Paul Gortmaker
In-Reply-To: <1308953247-25266-1-git-send-email-paul.gortmaker@windriver.com>

From: Allan Stephens <allan.stephens@windriver.com>

Reduces the work involved in transmitting a returned payload message
by doing only the work necessary to route such a message directly to
the specified destination port, rather than invoking the code used
to route an arbitrary message to an arbitrary destination.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 net/tipc/port.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/net/tipc/port.c b/net/tipc/port.c
index 756e64c..70ecdfd 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -360,6 +360,7 @@ int tipc_reject_msg(struct sk_buff *buf, u32 err)
 	int hdr_sz;
 	u32 imp = msg_importance(msg);
 	u32 data_sz = msg_data_sz(msg);
+	u32 src_node;
 
 	if (data_sz > MAX_REJECT_SIZE)
 		data_sz = MAX_REJECT_SIZE;
@@ -416,7 +417,11 @@ int tipc_reject_msg(struct sk_buff *buf, u32 err)
 
 	/* send returned message & dispose of rejected message */
 
-	tipc_net_route_msg(rbuf);
+	src_node = msg_prevnode(msg);
+	if (src_node == tipc_own_addr)
+		tipc_port_recv_msg(rbuf);
+	else
+		tipc_link_send(rbuf, src_node, msg_link_selector(rmsg));
 exit:
 	buf_discard(buf);
 	return data_sz;
-- 
1.7.4.4


^ permalink raw reply related

* [PATCH net-next 04/20] tipc: Add sanity check to detect rejection of non-payload messages
From: Paul Gortmaker @ 2011-06-24 22:07 UTC (permalink / raw)
  To: davem; +Cc: netdev, Allan.Stephens, Allan Stephens, Paul Gortmaker
In-Reply-To: <1308953247-25266-1-git-send-email-paul.gortmaker@windriver.com>

From: Allan Stephens <allan.stephens@windriver.com>

Introduces an internal sanity check to ensure that the only undeliverable
messages TIPC attempts to return to their origin are application payload
messages.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 net/tipc/port.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/net/tipc/port.c b/net/tipc/port.c
index 3946b5b..756e64c 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -367,6 +367,12 @@ int tipc_reject_msg(struct sk_buff *buf, u32 err)
 		imp++;
 
 	/* discard rejected message if it shouldn't be returned to sender */
+
+	if (WARN(!msg_isdata(msg),
+		 "attempt to reject message with user=%u", msg_user(msg))) {
+		dump_stack();
+		goto exit;
+	}
 	if (msg_errcode(msg) || msg_dest_droppable(msg))
 		goto exit;
 
-- 
1.7.4.4


^ permalink raw reply related

* [PATCH net-next 06/20] tipc: Optimizations & corrections to message rejection
From: Paul Gortmaker @ 2011-06-24 22:07 UTC (permalink / raw)
  To: davem; +Cc: netdev, Allan.Stephens, Allan Stephens, Paul Gortmaker
In-Reply-To: <1308953247-25266-1-git-send-email-paul.gortmaker@windriver.com>

From: Allan Stephens <allan.stephens@windriver.com>

Optimizes the creation of a returned payload message by duplicating
the original message and then updating the small number of fields
that need to be adjusted, rather than building the new message header
from scratch. In addition, certain operations that are not always
required are relocated so that they are only done if needed.

These optimizations also have the effect of addressing other issues
that were present previously:

1) Fixes a bug that caused the socket send routines to return the
size of the returned message, rather than the size of the sent
message, when a returnable payload message was sent to a non-existent
destination port.

2) The message header of the returned message now matches that of
the original message more closely. The header is now always the same
size as the original header, and some message header fields that
weren't being initialized in the returned message header are now
populated correctly -- namely the "d" and "s" bits, and the upper
bound of a multicast name instance (where present).

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 net/tipc/port.c |   49 ++++++++++++++++++++++++-------------------------
 1 files changed, 24 insertions(+), 25 deletions(-)

diff --git a/net/tipc/port.c b/net/tipc/port.c
index 70ecdfd..5311817 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -358,14 +358,10 @@ int tipc_reject_msg(struct sk_buff *buf, u32 err)
 	struct sk_buff *rbuf;
 	struct tipc_msg *rmsg;
 	int hdr_sz;
-	u32 imp = msg_importance(msg);
+	u32 imp;
 	u32 data_sz = msg_data_sz(msg);
 	u32 src_node;
-
-	if (data_sz > MAX_REJECT_SIZE)
-		data_sz = MAX_REJECT_SIZE;
-	if (msg_connected(msg) && (imp < TIPC_CRITICAL_IMPORTANCE))
-		imp++;
+	u32 rmsg_sz;
 
 	/* discard rejected message if it shouldn't be returned to sender */
 
@@ -377,30 +373,33 @@ int tipc_reject_msg(struct sk_buff *buf, u32 err)
 	if (msg_errcode(msg) || msg_dest_droppable(msg))
 		goto exit;
 
-	/* construct rejected message */
-	if (msg_mcast(msg))
-		hdr_sz = MCAST_H_SIZE;
-	else
-		hdr_sz = LONG_H_SIZE;
-	rbuf = tipc_buf_acquire(data_sz + hdr_sz);
+	/*
+	 * construct returned message by copying rejected message header and
+	 * data (or subset), then updating header fields that need adjusting
+	 */
+
+	hdr_sz = msg_hdr_sz(msg);
+	rmsg_sz = hdr_sz + min_t(u32, data_sz, MAX_REJECT_SIZE);
+
+	rbuf = tipc_buf_acquire(rmsg_sz);
 	if (rbuf == NULL)
 		goto exit;
 
 	rmsg = buf_msg(rbuf);
-	tipc_msg_init(rmsg, imp, msg_type(msg), hdr_sz, msg_orignode(msg));
-	msg_set_errcode(rmsg, err);
-	msg_set_destport(rmsg, msg_origport(msg));
-	msg_set_origport(rmsg, msg_destport(msg));
-	if (msg_short(msg)) {
-		msg_set_orignode(rmsg, tipc_own_addr);
-		/* leave name type & instance as zeroes */
-	} else {
-		msg_set_orignode(rmsg, msg_destnode(msg));
-		msg_set_nametype(rmsg, msg_nametype(msg));
-		msg_set_nameinst(rmsg, msg_nameinst(msg));
+	skb_copy_to_linear_data(rbuf, msg, rmsg_sz);
+
+	if (msg_connected(rmsg)) {
+		imp = msg_importance(rmsg);
+		if (imp < TIPC_CRITICAL_IMPORTANCE)
+			msg_set_importance(rmsg, ++imp);
 	}
-	msg_set_size(rmsg, data_sz + hdr_sz);
-	skb_copy_to_linear_data_offset(rbuf, hdr_sz, msg_data(msg), data_sz);
+	msg_set_non_seq(rmsg, 0);
+	msg_set_size(rmsg, rmsg_sz);
+	msg_set_errcode(rmsg, err);
+	msg_set_prevnode(rmsg, tipc_own_addr);
+	msg_swap_words(rmsg, 4, 5);
+	if (!msg_short(rmsg))
+		msg_swap_words(rmsg, 6, 7);
 
 	/* send self-abort message when rejecting on a connected port */
 	if (msg_connected(msg)) {
-- 
1.7.4.4


^ permalink raw reply related


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