Netdev List
 help / color / mirror / Atom feed
* [net-next-2.6 04/24] ixgbevf: Fix Compiler Warnings
From: Jeff Kirsher @ 2011-03-03 13:03 UTC (permalink / raw)
  To: davem; +Cc: Greg Rose, netdev, gospo, bphilips, Jeff Kirsher
In-Reply-To: <1299157429-15878-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Greg Rose <gregory.v.rose@intel.com>

Fix Compiler warnings of variables that are initialized but not used.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ixgbevf/ixgbevf_main.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ixgbevf/ixgbevf_main.c b/drivers/net/ixgbevf/ixgbevf_main.c
index 1e735a1..8276881 100644
--- a/drivers/net/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ixgbevf/ixgbevf_main.c
@@ -178,8 +178,6 @@ static inline bool ixgbevf_check_tx_hang(struct ixgbevf_adapter *adapter,
 	    tx_ring->tx_buffer_info[eop].time_stamp &&
 	    time_after(jiffies, tx_ring->tx_buffer_info[eop].time_stamp + HZ)) {
 		/* detected Tx unit hang */
-		union ixgbe_adv_tx_desc *tx_desc;
-		tx_desc = IXGBE_TX_DESC_ADV(*tx_ring, eop);
 		printk(KERN_ERR "Detected Tx Unit Hang\n"
 		       "  Tx Queue             <%d>\n"
 		       "  TDH, TDT             <%x>, <%x>\n"
@@ -334,7 +332,6 @@ static void ixgbevf_receive_skb(struct ixgbevf_q_vector *q_vector,
 	struct ixgbevf_adapter *adapter = q_vector->adapter;
 	bool is_vlan = (status & IXGBE_RXD_STAT_VP);
 	u16 tag = le16_to_cpu(rx_desc->wb.upper.vlan);
-	int ret;
 
 	if (!(adapter->flags & IXGBE_FLAG_IN_NETPOLL)) {
 		if (adapter->vlgrp && is_vlan)
@@ -345,9 +342,9 @@ static void ixgbevf_receive_skb(struct ixgbevf_q_vector *q_vector,
 			napi_gro_receive(&q_vector->napi, skb);
 	} else {
 		if (adapter->vlgrp && is_vlan)
-			ret = vlan_hwaccel_rx(skb, adapter->vlgrp, tag);
+			vlan_hwaccel_rx(skb, adapter->vlgrp, tag);
 		else
-			ret = netif_rx(skb);
+			netif_rx(skb);
 	}
 }
 
@@ -3287,8 +3284,6 @@ static const struct net_device_ops ixgbe_netdev_ops = {
 
 static void ixgbevf_assign_netdev_ops(struct net_device *dev)
 {
-	struct ixgbevf_adapter *adapter;
-	adapter = netdev_priv(dev);
 	dev->netdev_ops = &ixgbe_netdev_ops;
 	ixgbevf_set_ethtool_ops(dev);
 	dev->watchdog_timeo = 5 * HZ;
-- 
1.7.4


^ permalink raw reply related

* [net-next-2.6 02/24] igb: Fix reg pattern test in ethtool for i350 devices
From: Jeff Kirsher @ 2011-03-03 13:03 UTC (permalink / raw)
  To: davem; +Cc: Carolyn Wyborny, netdev, gospo, bphilips, Jeff Kirsher
In-Reply-To: <1299157429-15878-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Carolyn Wyborny <carolyn.wyborny@intel.com>

This fixes the reg_pattern_test so that the test does not fail
on i350 parts.

Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/igb/igb_ethtool.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
index a70e16b..16bbd49 100644
--- a/drivers/net/igb/igb_ethtool.c
+++ b/drivers/net/igb/igb_ethtool.c
@@ -1070,7 +1070,7 @@ static bool reg_pattern_test(struct igb_adapter *adapter, u64 *data,
 		{0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF};
 	for (pat = 0; pat < ARRAY_SIZE(_test); pat++) {
 		wr32(reg, (_test[pat] & write));
-		val = rd32(reg);
+		val = rd32(reg) & mask;
 		if (val != (_test[pat] & write & mask)) {
 			dev_err(&adapter->pdev->dev, "pattern test reg %04X "
 				"failed: got 0x%08X expected 0x%08X\n",
-- 
1.7.4


^ permalink raw reply related

* [net-next-2.6 03/24] igb: Fix strncpy calls to be safe per source code review tools
From: Jeff Kirsher @ 2011-03-03 13:03 UTC (permalink / raw)
  To: davem; +Cc: Carolyn Wyborny, netdev, gospo, bphilips, Jeff Kirsher
In-Reply-To: <1299157429-15878-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Carolyn Wyborny <carolyn.wyborny@intel.com>

This fix changes the remaining calls to strncpy that have not yet
been changed to use the "sizeof(buf) - 1" syntax rather than just
a number for buffer size.

Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/igb/igb_ethtool.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
index 16bbd49..61f7849 100644
--- a/drivers/net/igb/igb_ethtool.c
+++ b/drivers/net/igb/igb_ethtool.c
@@ -727,8 +727,9 @@ static void igb_get_drvinfo(struct net_device *netdev,
 	char firmware_version[32];
 	u16 eeprom_data;
 
-	strncpy(drvinfo->driver,  igb_driver_name, 32);
-	strncpy(drvinfo->version, igb_driver_version, 32);
+	strncpy(drvinfo->driver,  igb_driver_name, sizeof(drvinfo->driver) - 1);
+	strncpy(drvinfo->version, igb_driver_version,
+		sizeof(drvinfo->version) - 1);
 
 	/* EEPROM image version # is reported as firmware version # for
 	 * 82575 controllers */
@@ -738,8 +739,10 @@ static void igb_get_drvinfo(struct net_device *netdev,
 		(eeprom_data & 0x0FF0) >> 4,
 		eeprom_data & 0x000F);
 
-	strncpy(drvinfo->fw_version, firmware_version, 32);
-	strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32);
+	strncpy(drvinfo->fw_version, firmware_version,
+		sizeof(drvinfo->fw_version) - 1);
+	strncpy(drvinfo->bus_info, pci_name(adapter->pdev),
+		sizeof(drvinfo->bus_info) - 1);
 	drvinfo->n_stats = IGB_STATS_LEN;
 	drvinfo->testinfo_len = IGB_TEST_LEN;
 	drvinfo->regdump_len = igb_get_regs_len(netdev);
-- 
1.7.4


^ permalink raw reply related

* [net-next-2.6 01/24] igb: warn if max_vfs limit is exceeded
From: Jeff Kirsher @ 2011-03-03 13:03 UTC (permalink / raw)
  To: davem; +Cc: Stefan Assmann, netdev, gospo, bphilips, Jeff Kirsher
In-Reply-To: <1299157429-15878-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Stefan Assmann <sassmann@redhat.com>

Currently there's no warning printed when max_vfs > 7 is specified with
igb and the maximum of 7 is silently enforced. This patch prints a
warning and informs the user of the actions taken.

Signed-off-by: Stefan Assmann <sassmann@redhat.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/igb/igb_main.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 579dbba..eef380a 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -2291,7 +2291,12 @@ static int __devinit igb_sw_init(struct igb_adapter *adapter)
 	switch (hw->mac.type) {
 	case e1000_82576:
 	case e1000_i350:
-		adapter->vfs_allocated_count = (max_vfs > 7) ? 7 : max_vfs;
+		if (max_vfs > 7) {
+			dev_warn(&pdev->dev,
+				 "Maximum of 7 VFs per PF, using max\n");
+			adapter->vfs_allocated_count = 7;
+		} else
+			adapter->vfs_allocated_count = max_vfs;
 		break;
 	default:
 		break;
-- 
1.7.4


^ permalink raw reply related

* [net-next-2.6 00/24][pull request] Intel Wired LAN Driver Updates
From: Jeff Kirsher @ 2011-03-03 13:03 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, gospo, bphilips

The following series contains cleanups and fixes for igb, ixgbevf
and mainly ixgbe.

The following are changes since commit dc6ed1df5a5f84e45e77e2acb6fd99b995414956:
  dcbnl: add support for retrieving peer configuration - cee

and are available in the git repository at:
  master.kernel.org:/pub/scm/linux/kernel/git/jkirsher/net-next-2.6 master

Alexander Duyck (1):
  ixgbe: balance free_irq calls with request_irq calls

Carolyn Wyborny (2):
  igb: Fix reg pattern test in ethtool for i350 devices
  igb: Fix strncpy calls to be safe per source code review tools

Don Skidmore (3):
  ixgbe: cleanup X540 PHY reset function pointer
  ixgbe: add function pointer for semaphore function
  ixgbe: cleanup copyright string for 2011

Emil Tantilov (15):
  ixgbe: cleanup wake on LAN defines
  ixgbe: cleanup logic related to HW semaphores
  ixgbe: set media type for 82599 T3 LOM
  ixgbe: Add ability to double reset on failure to clear master enable
  ixgbe: cleanup code in ixgbe_identify_sfp_module_generic
  ixgbe: Check link wants report current link state
  ixgbe: add polling test to end of PHY reset
  ixgbe: Fill out PCIe speed and width enums with values
  ixgbe: Bounds checking for set_rar, clear_rar, set_vmdq, clear_vmdq
  ixgbe: rework ixgbe MTA handling to not drop packets
  ixgbe: Drop unused code for setting up unicast addresses
  ixgbe: Specific check for 100 Full link speed
  ixgbe: Numerous whitespace / formatting cleanups
  ixgbe: store permanent address before initializing Rx addresses
  ixgbe: cleanup handling of I2C interface to PHY

Greg Rose (2):
  ixgbevf: Fix Compiler Warnings
  ixgbe: X540 Cleanup

Stefan Assmann (1):
  igb: warn if max_vfs limit is exceeded

 drivers/net/igb/igb_ethtool.c       |   13 +-
 drivers/net/igb/igb_main.c          |    7 +-
 drivers/net/ixgbe/ixgbe.h           |    2 +-
 drivers/net/ixgbe/ixgbe_82598.c     |   63 ++++--
 drivers/net/ixgbe/ixgbe_82599.c     |  104 ++++++---
 drivers/net/ixgbe/ixgbe_common.c    |  438 ++++++++++++++---------------------
 drivers/net/ixgbe/ixgbe_common.h    |    4 +-
 drivers/net/ixgbe/ixgbe_dcb.c       |    2 +-
 drivers/net/ixgbe/ixgbe_dcb.h       |    2 +-
 drivers/net/ixgbe/ixgbe_dcb_82598.c |    2 +-
 drivers/net/ixgbe/ixgbe_dcb_82598.h |    2 +-
 drivers/net/ixgbe/ixgbe_dcb_82599.c |    2 +-
 drivers/net/ixgbe/ixgbe_dcb_82599.h |    2 +-
 drivers/net/ixgbe/ixgbe_dcb_nl.c    |    2 +-
 drivers/net/ixgbe/ixgbe_ethtool.c   |    2 +-
 drivers/net/ixgbe/ixgbe_fcoe.c      |    2 +-
 drivers/net/ixgbe/ixgbe_fcoe.h      |    2 +-
 drivers/net/ixgbe/ixgbe_main.c      |   12 +-
 drivers/net/ixgbe/ixgbe_mbx.c       |    2 +-
 drivers/net/ixgbe/ixgbe_mbx.h       |    2 +-
 drivers/net/ixgbe/ixgbe_phy.c       |  238 ++++++++++++++-----
 drivers/net/ixgbe/ixgbe_phy.h       |    2 +-
 drivers/net/ixgbe/ixgbe_sriov.c     |    2 +-
 drivers/net/ixgbe/ixgbe_sriov.h     |    2 +-
 drivers/net/ixgbe/ixgbe_type.h      |   40 ++--
 drivers/net/ixgbe/ixgbe_x540.c      |   34 ++-
 drivers/net/ixgbevf/ixgbevf_main.c  |    9 +-
 27 files changed, 547 insertions(+), 447 deletions(-)

-- 
1.7.4


^ permalink raw reply

* Re: [RFC LOL OMG] pfifo_lat: qdisc that limits dequeueing based on estimated link latency
From: Eric Dumazet @ 2011-03-03 12:51 UTC (permalink / raw)
  To: John W. Linville; +Cc: netdev, bloat-devel
In-Reply-To: <1299102850-2883-1-git-send-email-linville@tuxdriver.com>

Le mercredi 02 mars 2011 à 16:54 -0500, John W. Linville a écrit :
> This is a qdisc based on the existing pfifo_fast code.  The difference
> is that this qdisc limits the dequeue rate based on estimates of how
> many packets can be in-flight at a given time while maintaining a target
> link latency.
> 
> This work is based on the eBDP documented in Section IV of "Buffer
> Sizing for 802.11 Based Networks" by Tianji Li, et al.
> 
> 	http://www.hamilton.ie/tianji_li/buffersizing.pdf
> 
> This implementation timestamps an skb as it dequeues it, then
> computes the service time when the frame is freed by the driver.
> An exponentially weighted moving average of per fragment service times
> is used to restrict queueing delays in hopes of achieving a target
> fragment transmission latency.  The skb->deconstructor mechanism is
> abused in order to obtain packet service time estimates.
> 
> Signed-off-by: John W. Linville <linville@tuxdriver.com>
> ---
> I took a whack at reimplementing my eBDP patch at the qdisc level.
> Unfortunately, it doesn't seem to work very well and I'm at a loss
> as to why... :-( Comments welcome -- maybe I'm doing something really
> stupid in the math and just can't see it.
> 
> The skb->deconstructor abuse includes adding a union member in the skb
> to record the qdisc->handle on the way out so that it can be used for
> accounting in the deconstructor -- thanks to Neil Horman for the
> suggestion!
> 
> The reason I think this is an idea worth exploring is that existing
> qdisc code doesn't seem to account for the fact that the devices could
> be doing a lot of queueing behind them.  Even Jussi's recent
> sch_fifo_ewma post doesn't seem to take into account how long the device
> holds-on to packets, which limits his ability to fight latency.
> 
> Anyway, all comments appreciated!
> 
>  

Well, many issues in your patch.

skb destructor cannot be used like that (think about locking, and
various context where drivers actually free skbs (from interrupt, from
softirq, or even _before_ sending data on wire).

qdisc_lookup(skb->dev, skb->qdhandle) for example is only safe if run
with RTNL held. Its not meant to be used in fast path at all, but
management code only.

Being able to have a feedback on when a skb is freed (with a
notification of being delivered or dropped) is a recurring idea, so we
might design a stackable infrastructure.




^ permalink raw reply

* Re: [BUG] VPN broken in net-next
From: Julian Anastasov @ 2011-03-03 12:41 UTC (permalink / raw)
  To: David Miller; +Cc: shemminger, netdev
In-Reply-To: <20110302.165421.258093056.davem@davemloft.net>


 	Hello,

On Wed, 2 Mar 2011, David Miller wrote:

>> I really need to know what addresses interfaces have the time of the
>> __ip_dev_find() call which, if I'm not mistaken, is before the VPN is
>> up.
>
> Looking at pptp_connect(), it seems to be trying to do a route lookup
> using the source address, before it registers the PPP channel and that
> even gets brought up.
>
> I suspect that was working by luck previously, and it was getting the
> default route out perhaps another interface.  If that is the case,
> removing the explicit "fl4_src" source address specification in the lookup
> flow pptp_connect() uses should fix the problem.

 	May be the problem is in inet_hash_insert(), it should
hash ifa_local, not ifa_address. May be they are equal for
the common case but not for peer addresses. In devinet_ioctl()
we can see they are equal initially:

ifa->ifa_address = ifa->ifa_local = sin->sin_addr.s_addr;

 	but later SIOCSIFDSTADDR can change ifa_address which
is destination address from the same prefix:

ifa->ifa_address = sin->sin_addr.s_addr;

 	fib_add_ifaddr() does more things but not for this
case with /32 mask, so the problem should be in using
ifa_address instead of ifa_local.

Regards

--
Julian Anastasov <ja@ssi.bg>

^ permalink raw reply

* Re: [PATCH 1/5] tg3: use usleep_range not msleep for small sleeps
From: Javier Martinez Canillas @ 2011-03-03 12:14 UTC (permalink / raw)
  To: David Miller; +Cc: mcarlson, mchan, grant.likely, netdev, kernelnewbies
In-Reply-To: <20110302.205536.226759949.davem@davemloft.net>

>
>>
>> Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
>
> Why?
>

As I understand msleep() will stop for a minimum of two jiffies and
that resolution is too low in systems with small HZ values (big
jiffies).
Using msleep() (with small values) in this systems will sleep for more
time than the caller expects.

I used usleep_range() because it is a finer precision implementations of msleep.

Sorry if I'm wrong or the sleep precision is not a concern in this
driver and the change doesn't add any value.

Thanks a lot.

-- 
-----------------------------------------
Javier Martínez Canillas
(+34) 682 39 81 69
PhD Student in High Performance Computing
Computer Architecture and Operating System Department (CAOS)
Universitat Autònoma de Barcelona
Barcelona, Spain

^ permalink raw reply

* Re: [PATCH 3/5] tg3: Enclose macro with complex values in parenthesis
From: Javier Martinez Canillas @ 2011-03-03 11:54 UTC (permalink / raw)
  To: David Miller; +Cc: mcarlson, mchan, grant.likely, netdev, kernelnewbies
In-Reply-To: <20110302.205601.71129255.davem@davemloft.net>

>
> This seems unnecessary, what problem do the current macro definitions
> create?
>

Probably the change is unnecessary, the only value is that it silences
a checkpatch error:

ERROR: Macros with complex values should be enclosed in parenthesis

Sorry for the noise.

-- 
-----------------------------------------
Javier Martínez Canillas
(+34) 682 39 81 69
PhD Student in High Performance Computing
Computer Architecture and Operating System Department (CAOS)
Universitat Autònoma de Barcelona
Barcelona, Spain

^ permalink raw reply

* Re: bonding...
From: Neil Horman @ 2011-03-03 11:45 UTC (permalink / raw)
  To: David Miller; +Cc: fubar, netdev
In-Reply-To: <20110302.214910.112578818.davem@davemloft.net>

On Wed, Mar 02, 2011 at 09:49:10PM -0800, David Miller wrote:
> 
> Hey, if someone could step up and help with bonding maintainence
> in some tangible way, I'd really appreciate it.
> 
> Currently the situation is that many people work on bonding patches,
> and whilst I do try and wait for some ACKs to arrive, I am the person
> who has to sort out when changes are ready, decide to apply them, and
> poke for review when things fall through the cracks.
> 
> Sometimes patches go for weeks without ACKs, and in that situation
> I have to either try to understand the changes myself, or wait
> potentially forever for someone with bonding knowledge to take a
> good look at the patch and properly review it.
> 
> It was nearly 2 weeks before Oleg V. Ukhno's 802.3ad round-robin patch
> got looked at by anyone with bonding knowledge.  And it only happened
> because I got tired of seeing his poor patch rot in patchwork
> and had to explicitly asked for review the other day.
> 
> This is unacceptable, people are submitting multiple bonding patches
> every single day now.  It needs a clueful bonding person looking at
> these submissions on a constant basis.
> 
> This is a serious problem and is backlogging the netdev patch queue.
> 
> So if someone would become an active bonding patch-accumulator, and
> send me sets of patches that are ready to apply, I would really
> appreciate it.
> 
> Thanks.
I nominate gospo.  If he doesn't want to, I can do it
Neil

> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply

* Re: [PATCH] sctp: fix the fast retransmit limit
From: Neil Horman @ 2011-03-03 11:41 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: David Miller, Vlad Yasevich, netdev@vger.kernel.org, lksctp,
	Mingyuan Zhu
In-Reply-To: <4D6F5F83.705@cn.fujitsu.com>

On Thu, Mar 03, 2011 at 05:29:39PM +0800, Wei Yongjun wrote:
> If chunk is still lost after fast retransmit, SCTP stack will
> never allow the second fast retransmit of this chunk, even if
> the peer need we do this. This chunk will be retransmit until
> the rtx timeout. This limit is introduce by the following patch:
>   sctp: reduce memory footprint of sctp_chunk structure
>   (c226ef9b83694311327f3ab0036c6de9c22e9daf)
> 
> This patch revert this limit and removed useless SCTP_DONT_FRTX.
> 
> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>

> ---
>  include/net/sctp/structs.h |    1 -
>  net/sctp/outqueue.c        |    4 ++--
>  2 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
> index cc9185c..82a0f84 100644
> --- a/include/net/sctp/structs.h
> +++ b/include/net/sctp/structs.h
> @@ -751,7 +751,6 @@ struct sctp_chunk {
>  
>  #define SCTP_CAN_FRTX 0x0
>  #define SCTP_NEED_FRTX 0x1
> -#define SCTP_DONT_FRTX 0x2
>  	__u16	rtt_in_progress:1,	/* This chunk used for RTT calc? */
>  		has_tsn:1,		/* Does this chunk have a TSN yet? */
>  		has_ssn:1,		/* Does this chunk have a SSN yet? */
> diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
> index 8c6d379..7ed5862 100644
> --- a/net/sctp/outqueue.c
> +++ b/net/sctp/outqueue.c
> @@ -657,7 +657,7 @@ redo:
>  			 * after it is retransmitted.
>  			 */
>  			if (chunk->fast_retransmit == SCTP_NEED_FRTX)
> -				chunk->fast_retransmit = SCTP_DONT_FRTX;
> +				chunk->fast_retransmit = SCTP_CAN_FRTX;
>  
>  			q->empty = 0;
>  			break;
> @@ -679,7 +679,7 @@ redo:
>  	if (rtx_timeout || fast_rtx) {
>  		list_for_each_entry(chunk1, lqueue, transmitted_list) {
>  			if (chunk1->fast_retransmit == SCTP_NEED_FRTX)
> -				chunk1->fast_retransmit = SCTP_DONT_FRTX;
> +				chunk1->fast_retransmit = SCTP_CAN_FRTX;
>  		}
>  	}
>  
> -- 
> 1.6.5.2
> 
> 
> 

^ permalink raw reply

* RE: r8169 disable ASPM patch
From: hayeswang @ 2011-03-03 11:35 UTC (permalink / raw)
  To: 'Francois Romieu', 'David Miller'; +Cc: netdev, sgruszka
In-Reply-To: <20110303094518.GA13491@electric-eye.fr.zoreil.com>

Sorry for my late response. 

> -----Original Message-----
> From: Francois Romieu [mailto:romieu@fr.zoreil.com]
> Sent: Thursday, March 03, 2011 5:45 PM
> To: David Miller
> Cc: netdev@vger.kernel.org; Hayeswang; sgruszka@redhat.com
> Subject: Re: r8169 disable ASPM patch
> 
> (Hayes added to the Cc:)
> 
> David Miller <davem@davemloft.net> :
> [...]
> > What is the status of Stanislaw Gruszka's "disable ASPM" 
> r8169 patch?
> > 
> > 	http://patchwork.ozlabs.org/patch/83961/
> > 
> > Is it waiting for your testing ?
> 
> No.
> 
> I can test it against regression but I do not have the technical 
> knowledge to tell if it is right or not.
> 
> I have read (again) the PR as well as its sibling and there is little 
> evidence for me that the patch is 1) needed 2) better than the global 
> pcie_aspm switch. Either Realtek's in-house knowledge helps making a 
> technical decision or it is a policy-guided choice.
> 
> > Is it waiting for feedback from Hayes?
> 
> Yes.
> 

Our hardware engineer says that it has an issue indeed for 8111B (that is, rev
01) when the aspm is enabled. For the other chips, the aspm would affect the
performance. We suggest to disable for stablity.

> Something like :
> [ ] Ack. So far there is no way to handle ASPM reliably on the 816x [ 
> ]  Not optimal but it is ok as an interim fix. For instance :
>     - if some 816x (8168 ? 810{2, 3} ?) are known broken while others 
> are not
>     - it can be mitigated but the fix is not available yet
>     - needs more tester / vendor work
>     - etc.
> [ ] Nak. The adequate fix is ...
> 
> > Is there going to be a MAINTAINERS patch that adds Hayes?  
> If so what
> > is stalling that?

Realtek would continue handling the kernel. However, the person may be different
for different period. Therefore, I think keeping the current mode is better.

> 
> Realtek nic team asked me privately (end 2010) in rather 
> general terms if they could maintain the r8169 kernel driver. 
> I have given some relevant pointers for kernel code 
> maintenance. Realtek did its housework.
> 
> I have stated publicly that I'll ack such a patch if Hayes 
> wants to add himself. Hayes was Cced. Either Hayes sends a 
> patch or a plain "please do it".
> 

 
Best Regards,
Hayes


^ permalink raw reply

* net-next-2.6: Phonet pull request
From: Rémi Denis-Courmont @ 2011-03-03 11:22 UTC (permalink / raw)
  To: netdev

	Hello,

As "promised", here is the cleaned up and unified Phonet pipe code.
The same kernel can now support both old (e.g. Nokia N900) and new
(e.g. ST-Ericsson U8500 SoC) modems.

Due to lack of hardware, I only tested the ST-E support in software.
But the earlier code was horribly broken anyway.

The following changes since commit dc6ed1df5a5f84e45e77e2acb6fd99b995414956:

  dcbnl: add support for retrieving peer configuration - cee (2011-03-02 21:58:55 -0800)

are available in the git repository at:
  git://git.remlab.net/linux-phonet.git master

Rémi Denis-Courmont (8):
      Phonet: fix NULL-deref in previous patch series
      Phonet: return an error when TX fails
      Phonet: fix backlog callback return value
      Phonet: factor common code to send control messages
      Phonet: allocate sock from accept syscall rather than soft IRQ
      Phonet: provide pipe socket option to retrieve the pipe identifier
      Phonet: support active connection without pipe controller on modem
      Phonet: kill the ST-Ericsson pipe controller Kconfig

 Documentation/networking/phonet.txt |   67 ++---
 include/linux/phonet.h              |    4 +-
 include/net/phonet/pep.h            |    1 -
 net/phonet/Kconfig                  |   12 -
 net/phonet/af_phonet.c              |   13 +-
 net/phonet/pep.c                    |  682 ++++++++++++++---------------------
 net/phonet/socket.c                 |  112 +++----
 7 files changed, 352 insertions(+), 539 deletions(-)

-- 
Rémi Denis-Courmont
http://www.remlab.net/

^ permalink raw reply

* [RFC PATCH] net/core: fix skb handling on netif serves for both bridge and vlan
From: Xiaotian Feng @ 2011-03-03 10:55 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Xiaotian Feng, David S. Miller, Eric Dumazet,
	Tom Herbert

Consider network topology as follows:

eth0  eth1
 |_____|
    |
  bond0 --- br0
    |
  vlan0 --- br1

bond0 serves for both br0 and vlan0, if a vlan tagged packet was sent
to br1 through bond0, bridge handling code is seeing the packet on bond0
and handing it off to my "legacy" bridge before vlan_tx_tag_present
and vlan_hwaccel_do_receive even haven't a chance to look at it.

Moving the vlan_tx_tag_present before bridge/macvlan handling code could
cure this.

Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Tom Herbert <therbert@google.com>
---
 net/core/dev.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 8ae6631..d2d12c2 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3079,27 +3079,27 @@ static int __netif_receive_skb(struct sk_buff *skb)
 ncls:
 #endif
 
-	/* Handle special case of bridge or macvlan */
-	rx_handler = rcu_dereference(skb->dev->rx_handler);
-	if (rx_handler) {
+	if (vlan_tx_tag_present(skb)) {
 		if (pt_prev) {
 			ret = deliver_skb(skb, pt_prev, orig_dev);
 			pt_prev = NULL;
 		}
-		skb = rx_handler(skb);
-		if (!skb)
+		if (vlan_hwaccel_do_receive(&skb)) {
+			ret = __netif_receive_skb(skb);
+			goto out;
+		} else if (unlikely(!skb))
 			goto out;
 	}
 
-	if (vlan_tx_tag_present(skb)) {
+	/* Handle special case of bridge or macvlan */
+	rx_handler = rcu_dereference(skb->dev->rx_handler);
+	if (rx_handler) {
 		if (pt_prev) {
 			ret = deliver_skb(skb, pt_prev, orig_dev);
 			pt_prev = NULL;
 		}
-		if (vlan_hwaccel_do_receive(&skb)) {
-			ret = __netif_receive_skb(skb);
-			goto out;
-		} else if (unlikely(!skb))
+		skb = rx_handler(skb);
+		if (!skb)
 			goto out;
 	}
 
-- 
1.7.1

^ permalink raw reply related

* Re: [PATCH 2/2] netlink: kill eff_cap from struct netlink_skb_parms
From: James Morris @ 2011-03-03 10:49 UTC (permalink / raw)
  To: Patrick McHardy
  Cc: NetDev, dm-devel, David S. Miller, Chris Wright,
	linux-security-module@vger.kernel.org, drbd-dev
In-Reply-To: <4D6F6180.5030903@trash.net>


Reviewed-by: James Morris <jmorris@namei.org>



-- 
James Morris
<jmorris@namei.org>

^ permalink raw reply

* Re: [PATCH] sched: QFQ - quick fair queue scheduler (v2)
From: Eric Dumazet @ 2011-03-03 10:40 UTC (permalink / raw)
  To: Fabio Checconi
  Cc: Stephen Hemminger, David Miller, Luigi Rizzo, netdev,
	Paolo Valente
In-Reply-To: <1299140868.2456.35.camel@edumazet-laptop>

Le jeudi 03 mars 2011 à 09:27 +0100, Eric Dumazet a écrit :

> I am going to test an updated version, thanks for all these hints !
> 

Same problem in qfq_qlen_notify()

Should use :

struct qfq_sched *q = qdisc_priv(sch);


After a stress (and no more trafic) I still have some packets in
backlog:

(8 packets here)

# tc -s -d qdisc show dev dummy0
qdisc cbq 1: root refcnt 2 rate 1000Mbit cell 8b (bounded,isolated) prio no-transmit/8 weight 1000Mbit allot 1514b 
level 2 ewma 5 avpkt 1000b maxidle 0us 
 Sent 109916000 bytes 549580 pkt (dropped 350412, overlimits 1180608 requeues 0) 
 backlog 0b 8p requeues 0 
  borrowed 0 overactions 0 avgidle 125 undertime 0
qdisc qfq 11: parent 1:11 
 Sent 109916000 bytes 549580 pkt (dropped 350412, overlimits 0 requeues 0) 
 rate 2848bit 2pps backlog 0b 8p requeues 0 
# tc -s -d class show dev dummy0
class cbq 1:11 parent 1:1 leaf 11: rate 40000Kbit cell 128b mpu 64b (bounded) prio 2/2 weight 40000Kbit allot 20000b 
level 0 ewma 5 avpkt 1400b maxidle 0us 
 Sent 109916000 bytes 549580 pkt (dropped 350412, overlimits 675712 requeues 0) 
 rate 1516Kbit 947pps backlog 0b 8p requeues 0 
  borrowed 0 overactions 285254 avgidle -22 undertime -24
class cbq 1: root rate 1000Mbit cell 8b (bounded,isolated) prio no-transmit/8 weight 1000Mbit allot 1514b 
level 2 ewma 5 avpkt 1000b maxidle 0us 
 Sent 109916000 bytes 549580 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0 
  borrowed 0 overactions 0 avgidle 125 undertime 0
class cbq 1:1 parent 1: rate 1000Mbit cell 64b mpu 64b (bounded) prio 1/1 weight 1000Mbit allot 10000b 
level 1 ewma 5 avpkt 1500b maxidle 0us 
 Sent 109916000 bytes 549580 pkt (dropped 0, overlimits 0 requeues 0) 
 rate 1516Kbit 947pps backlog 0b 0p requeues 0 
  borrowed 0 overactions 0 avgidle 125 undertime 0
class qfq 11:10 root weight 1600 maxpkt 2048 
 Sent 200 bytes 1 pkt (dropped 18181, overlimits 0 requeues 0) 
 rate 0bit 0pps backlog 200b 0p requeues 0 
class qfq 11:1 root weight 100 maxpkt 1100 
 Sent 2731200 bytes 13656 pkt (dropped 40889, overlimits 0 requeues 0) 
 rate 0bit 0pps backlog 200b 0p requeues 0 
class qfq 11:2 root weight 200 maxpkt 1200 
 Sent 10899800 bytes 54499 pkt (dropped 47, overlimits 0 requeues 0) 
 rate 24bit 0pps backlog 0b 0p requeues 0 
class qfq 11:3 root weight 300 maxpkt 1300 
 Sent 12714400 bytes 63572 pkt (dropped 65, overlimits 0 requeues 0) 
 rate 32bit 0pps backlog 0b 0p requeues 0 
class qfq 11:4 root weight 400 maxpkt 1400 
 Sent 400 bytes 2 pkt (dropped 36362, overlimits 0 requeues 0) 
 rate 0bit 0pps backlog 200b 0p requeues 0 
class qfq 11:5 root weight 500 maxpkt 1500 
 Sent 400 bytes 2 pkt (dropped 45452, overlimits 0 requeues 0) 
 rate 0bit 0pps backlog 200b 0p requeues 0 
class qfq 11:6 root weight 600 maxpkt 1600 
 Sent 800 bytes 4 pkt (dropped 27269, overlimits 0 requeues 0) 
 rate 0bit 0pps backlog 200b 0p requeues 0 
class qfq 11:7 root weight 700 maxpkt 1700 
 Sent 600 bytes 3 pkt (dropped 45452, overlimits 0 requeues 0) 
 rate 0bit 0pps backlog 200b 0p requeues 0 
class qfq 11:8 root weight 800 maxpkt 1800 
 Sent 1000 bytes 5 pkt (dropped 72722, overlimits 0 requeues 0) 
 rate 0bit 0pps backlog 200b 0p requeues 0 
class qfq 11:9 root weight 900 maxpkt 1900 
 Sent 1200 bytes 6 pkt (dropped 63631, overlimits 0 requeues 0) 
 rate 0bit 0pps backlog 200b 0p requeues 0 
class qfq 11:a root weight 1000 maxpkt 2000 
 Sent 14535200 bytes 72676 pkt (dropped 51, overlimits 0 requeues 0) 
 rate 32bit 0pps backlog 0b 0p requeues 0 
class qfq 11:b root weight 1100 maxpkt 2048 
 Sent 14531200 bytes 72656 pkt (dropped 72, overlimits 0 requeues 0) 
 rate 32bit 0pps backlog 0b 0p requeues 0 
class qfq 11:c root weight 1200 maxpkt 2048 
 Sent 10905800 bytes 54529 pkt (dropped 16, overlimits 0 requeues 0) 
 rate 24bit 0pps backlog 0b 0p requeues 0 
class qfq 11:d root weight 1300 maxpkt 2048 
 Sent 14538200 bytes 72691 pkt (dropped 36, overlimits 0 requeues 0) 
 rate 32bit 0pps backlog 0b 0p requeues 0 
class qfq 11:e root weight 1400 maxpkt 2048 
 Sent 18162200 bytes 90811 pkt (dropped 96, overlimits 0 requeues 0) 
 rate 40bit 0pps backlog 0b 0p requeues 0 
class qfq 11:f root weight 1500 maxpkt 2048 
 Sent 10895000 bytes 54475 pkt (dropped 71, overlimits 0 requeues 0) 
 rate 24bit 0pps backlog 0b 0p requeues 0 





^ permalink raw reply

* Re: [PATCH (sh-2.6) 1/4] clksource: Generic timer infrastructure
From: Peppe CAVALLARO @ 2011-03-03 10:25 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Thomas Gleixner, Stuart MENEFY, linux-sh@vger.kernel.org,
	netdev@vger.kernel.org, John Stultz, linux-kernel@vger.kernel.org,
	linux@arm.linux.org.uk
In-Reply-To: <201103030945.07486.arnd@arndb.de>

Hi Arnd,

On 3/3/2011 9:45 AM, Arnd Bergmann wrote:
>
> On Wednesday 02 March 2011, Peppe CAVALLARO wrote:
> > At any rate, I am happy to use the stmmac as experimental
> > driver to do this kind tests.
> > Indeed, in the past, on old Kernel (IIRC 2.6.23), I tried to use
> > the kernel timers but I removed the code from it because
> > I had noticed packets loss and a strange phenomenon with cyclesoak
> > (that showed broken sysload % during the heavy network activities).
> >
> > Let me know how to proceed:
> >
> > 1) experiment with stmmac and hrtimer for handling rx/tx?
> > 2) rework the patches for the Generic Timer Infra?
>
> I'd suggest doing the first. I'm surprised that using an unrelated
> timer for processing interrupts even helps you on stmmac.
>

Indeed, this helped especially to save the cpu usage
on heavy IP traffic (but with Max Throughput and no pkt
loss).

> The timers that you'd normally use for rx interrupt mitigation
> are not periodic timers but are started when a packet arrives
> from the outside.
>
Yes you are right but unfortunately our mac devices have
not this kind of HW.
>
> Doing periodic wakeups for RX instead of just waiting for
> packets to come in should have a significant impact on power
> management on an otherwise idle system.
>
To "mitigate" this issue, the driver does a fast (and extra)
check in the rings and it does not start any rx processes
in case there are no incoming frames.

> For tx resource reclaim, a relatively slow oneshot timer (not
> even hrtimer) should be good enough, since it only needs to be
> active when there is no other way to clean up. E.g. when you
> are in napi polling mode (interrupt disabled), you know that
> stmmac_poll gets called soon, and you can also do the reclaim
> from stmmac_xmit() in order to prevent the timer from triggering
> when you are constantly transmitting.
>
This logic is already in the driver, indeed.
What I've seen on our embedded systems is that the
cost of RX interrupts is very hight and NAPI partially helps.
Typically, in an IP-STB, I receive a burst of UDP pkt
and this  means that many interrupts occur (~99% of CPU
usage on slow platforms).
With the ext timer I was able to reduce the CPU usage in
these kind of scenarios to ~50%.
When there is no net traffic, indeed, the timer periodically
"disturbs" the system but the impact on the CPU usage
actually is low.

Thanks
Peppe
>
>         Arnd
>

^ permalink raw reply

* E-mail Winnner.
From: PROMO @ 2011-03-03 10:03 UTC (permalink / raw)
  To: info

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: FMT.txt --]
[-- Type: application/octet-stream, Size: 244 bytes --]

Your Email Id has won 1,000,000.00 GBP in the British MICROSOFT Promo 2010. send your

Names.
Address.
Sex.
Age.
Tel.
Occupation.

to our claims department:personalclaimsdept03@live.com

Thank you for your corporation
CARL ROBBISON.

^ permalink raw reply

* Re: r8169 disable ASPM patch
From: Francois Romieu @ 2011-03-03  9:45 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Hayes, sgruszka
In-Reply-To: <20110302.215255.183067695.davem@davemloft.net>

(Hayes added to the Cc:)

David Miller <davem@davemloft.net> :
[...]
> What is the status of Stanislaw Gruszka's "disable ASPM" r8169
> patch?
> 
> 	http://patchwork.ozlabs.org/patch/83961/
> 
> Is it waiting for your testing ?

No.

I can test it against regression but I do not have the technical
knowledge to tell if it is right or not.

I have read (again) the PR as well as its sibling and there is little
evidence for me that the patch is 1) needed 2) better than the global
pcie_aspm switch. Either Realtek's in-house knowledge helps making
a technical decision or it is a policy-guided choice.

> Is it waiting for feedback from Hayes?

Yes.

Something like :
[ ] Ack. So far there is no way to handle ASPM reliably on the 816x
[ ] Not optimal but it is ok as an interim fix. For instance :
    - if some 816x (8168 ? 810{2, 3} ?) are known broken while others are not
    - it can be mitigated but the fix is not available yet
    - needs more tester / vendor work
    - etc.
[ ] Nak. The adequate fix is ...

> Is there going to be a MAINTAINERS patch that adds Hayes?  If so
> what is stalling that?

Realtek nic team asked me privately (end 2010) in rather general terms if
they could maintain the r8169 kernel driver. I have given some relevant
pointers for kernel code maintenance. Realtek did its housework.

I have stated publicly that I'll ack such a patch if Hayes wants to
add himself. Hayes was Cced. Either Hayes sends a patch or a plain
"please do it".

-- 
Ueimor

^ permalink raw reply

* [PATCH 2/2] netlink: kill eff_cap from struct netlink_skb_parms
From: Patrick McHardy @ 2011-03-03  9:38 UTC (permalink / raw)
  To: NetDev, dm-devel
  Cc: David S. Miller, Chris Wright,
	linux-security-module@vger.kernel.org, drbd-dev

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 02.diff --]
[-- Type: text/plain, Size: 2971 bytes --]

commit 8ff259625f0ab295fa085b0718eed13093813fbc
Author: Patrick McHardy <kaber@trash.net>
Date:   Thu Mar 3 10:17:31 2011 +0100

    netlink: kill eff_cap from struct netlink_skb_parms
    
    Netlink message processing in the kernel is synchronous these days,
    capabilities can be checked directly in security_netlink_recv() from
    the current process.
    
    Signed-off-by: Patrick McHardy <kaber@trash.net>

diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 8cbfaa6..fe81c85 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -2177,7 +2177,7 @@ static void drbd_connector_callback(struct cn_msg *req, struct netlink_skb_parms
 		return;
 	}
 
-	if (!cap_raised(nsp->eff_cap, CAP_SYS_ADMIN)) {
+	if (!cap_raised(current_cap(), CAP_SYS_ADMIN)) {
 		retcode = ERR_PERM;
 		goto fail;
 	}
diff --git a/drivers/md/dm-log-userspace-transfer.c b/drivers/md/dm-log-userspace-transfer.c
index 049eaf1..1f23e04 100644
--- a/drivers/md/dm-log-userspace-transfer.c
+++ b/drivers/md/dm-log-userspace-transfer.c
@@ -134,7 +134,7 @@ static void cn_ulog_callback(struct cn_msg *msg, struct netlink_skb_parms *nsp)
 {
 	struct dm_ulog_request *tfr = (struct dm_ulog_request *)(msg + 1);
 
-	if (!cap_raised(nsp->eff_cap, CAP_SYS_ADMIN))
+	if (!cap_raised(current_cap(), CAP_SYS_ADMIN))
 		return;
 
 	spin_lock(&receiving_list_lock);
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 66823b8..4c4ac3f 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -160,7 +160,6 @@ struct netlink_skb_parms {
 	struct ucred		creds;		/* Skb credentials	*/
 	__u32			pid;
 	__u32			dst_group;
-	kernel_cap_t		eff_cap;
 };
 
 #define NETLINK_CB(skb)		(*(struct netlink_skb_parms*)&((skb)->cb))
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 97ecd92..a808fb1 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1364,12 +1364,6 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock,
 	NETLINK_CB(skb).dst_group = dst_group;
 	memcpy(NETLINK_CREDS(skb), &siocb->scm->creds, sizeof(struct ucred));
 
-	/* What can I do? Netlink is asynchronous, so that
-	   we will have to save current capabilities to
-	   check them, when this message will be delivered
-	   to corresponding kernel module.   --ANK (980802)
-	 */
-
 	err = -EFAULT;
 	if (memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len)) {
 		kfree_skb(skb);
diff --git a/security/commoncap.c b/security/commoncap.c
index 64c2ed9..a83e607 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -52,13 +52,12 @@ static void warn_setuid_and_fcaps_mixed(const char *fname)
 
 int cap_netlink_send(struct sock *sk, struct sk_buff *skb)
 {
-	NETLINK_CB(skb).eff_cap = current_cap();
 	return 0;
 }
 
 int cap_netlink_recv(struct sk_buff *skb, int cap)
 {
-	if (!cap_raised(NETLINK_CB(skb).eff_cap, cap))
+	if (!cap_raised(current_cap(), cap))
 		return -EPERM;
 	return 0;
 }

^ permalink raw reply related

* [PATCH 1/2] netlink: kill loginuid/sessionid/sid members from struct netlink_skb_parms
From: Patrick McHardy @ 2011-03-03  9:38 UTC (permalink / raw)
  To: NetDev; +Cc: David S. Miller, Al Viro, Eric Paris, linux-audit

[-- Attachment #1: Type: text/plain, Size: 148 bytes --]

The following two patches kill a few unnecessary members of the
netlink cb in order to make room for new members needed for memory
mapped netlink.


[-- Attachment #2: 01.diff --]
[-- Type: text/plain, Size: 9647 bytes --]

commit 509c35212e0d2362393597f195dc5da3fafd4a9c
Author: Patrick McHardy <kaber@trash.net>
Date:   Thu Mar 3 10:17:28 2011 +0100

    netlink: kill loginuid/sessionid/sid members from struct netlink_skb_parms
    
    Netlink message processing in the kernel is synchronous these days, the
    session information can be collected when needed.
    
    Signed-off-by: Patrick McHardy <kaber@trash.net>

diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index e2b9e63..66823b8 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -161,9 +161,6 @@ struct netlink_skb_parms {
 	__u32			pid;
 	__u32			dst_group;
 	kernel_cap_t		eff_cap;
-	__u32			loginuid;	/* Login (audit) uid */
-	__u32			sessionid;	/* Session id (audit) */
-	__u32			sid;		/* SELinux security id */
 };
 
 #define NETLINK_CB(skb)		(*(struct netlink_skb_parms*)&((skb)->cb))
diff --git a/kernel/audit.c b/kernel/audit.c
index 162e88e..9395003 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -673,9 +673,9 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
 
 	pid  = NETLINK_CREDS(skb)->pid;
 	uid  = NETLINK_CREDS(skb)->uid;
-	loginuid = NETLINK_CB(skb).loginuid;
-	sessionid = NETLINK_CB(skb).sessionid;
-	sid  = NETLINK_CB(skb).sid;
+	loginuid = audit_get_loginuid(current);
+	sessionid = audit_get_sessionid(current);
+	security_task_getsecid(current, &sid);
 	seq  = nlh->nlmsg_seq;
 	data = NLMSG_DATA(nlh);
 
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index add2819..f8277c8 100644
--- a/kernel/auditfilter.c
+++ b/kernel/auditfilter.c
@@ -1238,6 +1238,7 @@ static int audit_filter_user_rules(struct netlink_skb_parms *cb,
 	for (i = 0; i < rule->field_count; i++) {
 		struct audit_field *f = &rule->fields[i];
 		int result = 0;
+		u32 sid;
 
 		switch (f->type) {
 		case AUDIT_PID:
@@ -1250,19 +1251,22 @@ static int audit_filter_user_rules(struct netlink_skb_parms *cb,
 			result = audit_comparator(cb->creds.gid, f->op, f->val);
 			break;
 		case AUDIT_LOGINUID:
-			result = audit_comparator(cb->loginuid, f->op, f->val);
+			result = audit_comparator(audit_get_loginuid(current),
+						  f->op, f->val);
 			break;
 		case AUDIT_SUBJ_USER:
 		case AUDIT_SUBJ_ROLE:
 		case AUDIT_SUBJ_TYPE:
 		case AUDIT_SUBJ_SEN:
 		case AUDIT_SUBJ_CLR:
-			if (f->lsm_rule)
-				result = security_audit_rule_match(cb->sid,
+			if (f->lsm_rule) {
+				security_task_getsecid(current, &sid);
+				result = security_audit_rule_match(sid,
 								   f->type,
 								   f->op,
 								   f->lsm_rule,
 								   NULL);
+			}
 			break;
 		}
 
diff --git a/net/netlabel/netlabel_user.h b/net/netlabel/netlabel_user.h
index 6caef8b..f4fc4c9 100644
--- a/net/netlabel/netlabel_user.h
+++ b/net/netlabel/netlabel_user.h
@@ -49,9 +49,9 @@
 static inline void netlbl_netlink_auditinfo(struct sk_buff *skb,
 					    struct netlbl_audit *audit_info)
 {
-	audit_info->secid = NETLINK_CB(skb).sid;
-	audit_info->loginuid = NETLINK_CB(skb).loginuid;
-	audit_info->sessionid = NETLINK_CB(skb).sessionid;
+	security_task_getsecid(current, &audit_info->secid);
+	audit_info->loginuid = audit_get_loginuid(current);
+	audit_info->sessionid = audit_get_sessionid(current);
 }
 
 /* NetLabel NETLINK I/O functions */
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 478181d..97ecd92 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1362,9 +1362,6 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock,
 
 	NETLINK_CB(skb).pid	= nlk->pid;
 	NETLINK_CB(skb).dst_group = dst_group;
-	NETLINK_CB(skb).loginuid = audit_get_loginuid(current);
-	NETLINK_CB(skb).sessionid = audit_get_sessionid(current);
-	security_task_getsecid(current, &(NETLINK_CB(skb).sid));
 	memcpy(NETLINK_CREDS(skb), &siocb->scm->creds, sizeof(struct ucred));
 
 	/* What can I do? Netlink is asynchronous, so that
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 673698d..468ab60 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -497,9 +497,9 @@ static int xfrm_add_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
 	struct xfrm_state *x;
 	int err;
 	struct km_event c;
-	uid_t loginuid = NETLINK_CB(skb).loginuid;
-	u32 sessionid = NETLINK_CB(skb).sessionid;
-	u32 sid = NETLINK_CB(skb).sid;
+	uid_t loginuid = audit_get_loginuid(current);
+	u32 sessionid = audit_get_sessionid(current);
+	u32 sid;
 
 	err = verify_newsa_info(p, attrs);
 	if (err)
@@ -515,6 +515,7 @@ static int xfrm_add_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
 	else
 		err = xfrm_state_update(x);
 
+	security_task_getsecid(current, &sid);
 	xfrm_audit_state_add(x, err ? 0 : 1, loginuid, sessionid, sid);
 
 	if (err < 0) {
@@ -575,9 +576,9 @@ static int xfrm_del_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
 	int err = -ESRCH;
 	struct km_event c;
 	struct xfrm_usersa_id *p = nlmsg_data(nlh);
-	uid_t loginuid = NETLINK_CB(skb).loginuid;
-	u32 sessionid = NETLINK_CB(skb).sessionid;
-	u32 sid = NETLINK_CB(skb).sid;
+	uid_t loginuid = audit_get_loginuid(current);
+	u32 sessionid = audit_get_sessionid(current);
+	u32 sid;
 
 	x = xfrm_user_state_lookup(net, p, attrs, &err);
 	if (x == NULL)
@@ -602,6 +603,7 @@ static int xfrm_del_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
 	km_state_notify(x, &c);
 
 out:
+	security_task_getsecid(current, &sid);
 	xfrm_audit_state_delete(x, err ? 0 : 1, loginuid, sessionid, sid);
 	xfrm_state_put(x);
 	return err;
@@ -1265,9 +1267,9 @@ static int xfrm_add_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
 	struct km_event c;
 	int err;
 	int excl;
-	uid_t loginuid = NETLINK_CB(skb).loginuid;
-	u32 sessionid = NETLINK_CB(skb).sessionid;
-	u32 sid = NETLINK_CB(skb).sid;
+	uid_t loginuid = audit_get_loginuid(current);
+	u32 sessionid = audit_get_sessionid(current);
+	u32 sid;
 
 	err = verify_newpolicy_info(p);
 	if (err)
@@ -1286,6 +1288,7 @@ static int xfrm_add_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
 	 * a type XFRM_MSG_UPDPOLICY - JHS */
 	excl = nlh->nlmsg_type == XFRM_MSG_NEWPOLICY;
 	err = xfrm_policy_insert(p->dir, xp, excl);
+	security_task_getsecid(current, &sid);
 	xfrm_audit_policy_add(xp, err ? 0 : 1, loginuid, sessionid, sid);
 
 	if (err) {
@@ -1522,10 +1525,11 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
 					    NETLINK_CB(skb).pid);
 		}
 	} else {
-		uid_t loginuid = NETLINK_CB(skb).loginuid;
-		u32 sessionid = NETLINK_CB(skb).sessionid;
-		u32 sid = NETLINK_CB(skb).sid;
+		uid_t loginuid = audit_get_loginuid(current);
+		u32 sessionid = audit_get_sessionid(current);
+		u32 sid;
 
+		security_task_getsecid(current, &sid);
 		xfrm_audit_policy_delete(xp, err ? 0 : 1, loginuid, sessionid,
 					 sid);
 
@@ -1553,9 +1557,9 @@ static int xfrm_flush_sa(struct sk_buff *skb, struct nlmsghdr *nlh,
 	struct xfrm_audit audit_info;
 	int err;
 
-	audit_info.loginuid = NETLINK_CB(skb).loginuid;
-	audit_info.sessionid = NETLINK_CB(skb).sessionid;
-	audit_info.secid = NETLINK_CB(skb).sid;
+	audit_info.loginuid = audit_get_loginuid(current);
+	audit_info.sessionid = audit_get_sessionid(current);
+	security_task_getsecid(current, &audit_info.secid);
 	err = xfrm_state_flush(net, p->proto, &audit_info);
 	if (err) {
 		if (err == -ESRCH) /* empty table */
@@ -1720,9 +1724,9 @@ static int xfrm_flush_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
 	if (err)
 		return err;
 
-	audit_info.loginuid = NETLINK_CB(skb).loginuid;
-	audit_info.sessionid = NETLINK_CB(skb).sessionid;
-	audit_info.secid = NETLINK_CB(skb).sid;
+	audit_info.loginuid = audit_get_loginuid(current);
+	audit_info.sessionid = audit_get_sessionid(current);
+	security_task_getsecid(current, &audit_info.secid);
 	err = xfrm_policy_flush(net, type, &audit_info);
 	if (err) {
 		if (err == -ESRCH) /* empty table */
@@ -1789,9 +1793,11 @@ static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh,
 
 	err = 0;
 	if (up->hard) {
-		uid_t loginuid = NETLINK_CB(skb).loginuid;
-		uid_t sessionid = NETLINK_CB(skb).sessionid;
-		u32 sid = NETLINK_CB(skb).sid;
+		uid_t loginuid = audit_get_loginuid(current);
+		u32 sessionid = audit_get_sessionid(current);
+		u32 sid;
+
+		security_task_getsecid(current, &sid);
 		xfrm_policy_delete(xp, p->dir);
 		xfrm_audit_policy_delete(xp, 1, loginuid, sessionid, sid);
 
@@ -1830,9 +1836,11 @@ static int xfrm_add_sa_expire(struct sk_buff *skb, struct nlmsghdr *nlh,
 	km_state_expired(x, ue->hard, current->pid);
 
 	if (ue->hard) {
-		uid_t loginuid = NETLINK_CB(skb).loginuid;
-		uid_t sessionid = NETLINK_CB(skb).sessionid;
-		u32 sid = NETLINK_CB(skb).sid;
+		uid_t loginuid = audit_get_loginuid(current);
+		u32 sessionid = audit_get_sessionid(current);
+		u32 sid;
+
+		security_task_getsecid(current, &sid);
 		__xfrm_state_delete(x);
 		xfrm_audit_state_delete(x, 1, loginuid, sessionid, sid);
 	}
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index c8d6992..cef42f5 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -4669,6 +4669,7 @@ static int selinux_netlink_recv(struct sk_buff *skb, int capability)
 {
 	int err;
 	struct common_audit_data ad;
+	u32 sid;
 
 	err = cap_netlink_recv(skb, capability);
 	if (err)
@@ -4677,8 +4678,9 @@ static int selinux_netlink_recv(struct sk_buff *skb, int capability)
 	COMMON_AUDIT_DATA_INIT(&ad, CAP);
 	ad.u.cap = capability;
 
-	return avc_has_perm(NETLINK_CB(skb).sid, NETLINK_CB(skb).sid,
-			    SECCLASS_CAPABILITY, CAP_TO_MASK(capability), &ad);
+	security_task_getsecid(current, &sid);
+	return avc_has_perm(sid, sid, SECCLASS_CAPABILITY,
+			    CAP_TO_MASK(capability), &ad);
 }
 
 static int ipc_alloc_security(struct task_struct *task,

^ permalink raw reply related

* Re: [PATCH] sched: QFQ - quick fair queue scheduler (v2)
From: Eric Dumazet @ 2011-03-03  9:35 UTC (permalink / raw)
  To: Patrick McHardy
  Cc: Stephen Hemminger, Fabio Checconi, David Miller, Luigi Rizzo,
	netdev
In-Reply-To: <4D6E8997.4010001@trash.net>

Le mercredi 02 mars 2011 à 19:16 +0100, Patrick McHardy a écrit :
> Am 02.03.2011 18:31, schrieb Eric Dumazet:
> > Le mercredi 02 mars 2011 à 17:18 +0100, Eric Dumazet a écrit :
> >> Le mercredi 02 mars 2011 à 08:11 -0800, Stephen Hemminger a écrit :
> >>
> >>> I put the iproute2 code into the repository in the experimental branch.
> >>>
> >>
> >> Thanks
> >>
> >> It seems as soon as packets are dropped, qdisc is frozen (no more
> >> packets dequeued)
> >>
> >> Hmm...
> >>
> > 
> > It seems class deletes are buggy.
> > 
> > After one "tc class del dev $ETH classid 11:1 ..."
> > 
> > a "tc -s -d qdisc show dev $ETH" triggers an Oops
> 
> What classes and filters did you have before issuing that command?

(Fabio found the origin of the problem in qfq_destroy_class())

Here is the script I wrote to use QFQ on dummy0 device
(I then use a normal udpflood workload to stress the thing)

More or less copied from other stuff I had, so its probably very
stupid ;)

# cat egress_dummy0.sh
ETH=dummy0
RATE="rate 40Mbit"
PRIVNETS="172.16.0.0/12 192.168.0.0/16 10.0.0.0/8"
ALLOT="allot 20000"


ethtool -K $ETH tso off

tc qdisc del dev $ETH root 2>/dev/null


tc qdisc add dev $ETH root handle 1: cbq avpkt 1000 rate 1000Mbit \
	bandwidth 1000Mbit
tc class add dev $ETH parent 1: classid 1:1 \
	est 1sec 8sec cbq allot 10000 mpu 64 \
	rate 1000Mbit prio 1 avpkt 1500 bounded

# output to private nets :  40 Mbit limit
tc class add dev $ETH parent 1:1 classid 1:11 \
	est 1sec 8sec cbq $ALLOT mpu 64      \
	$RATE prio 2 avpkt 1400 bounded

tc qdisc add dev $ETH parent 1:11 handle 11:  \
	est 1sec 8sec qfq

tc filter add dev $ETH protocol ip parent 11: handle 3 \
	flow hash keys rxhash divisor 16

tc class add dev $ETH classid 11:1 est 0.5sec 2sec qfq weight 100 maxpkt 1100
tc class add dev $ETH classid 11:2 est 0.5sec 2sec qfq weight 200 maxpkt 1200
tc class add dev $ETH classid 11:3 est 0.5sec 2sec qfq weight 300 maxpkt 1300
tc class add dev $ETH classid 11:4 est 0.5sec 2sec qfq weight 400 maxpkt 1400
tc class add dev $ETH classid 11:5 est 0.5sec 2sec qfq weight 500 maxpkt 1500
tc class add dev $ETH classid 11:6 est 0.5sec 2sec qfq weight 600 maxpkt 1600
tc class add dev $ETH classid 11:7 est 0.5sec 2sec qfq weight 700 maxpkt 1700
tc class add dev $ETH classid 11:8 est 0.5sec 2sec qfq weight 800 maxpkt 1800
tc class add dev $ETH classid 11:9 est 0.5sec 2sec qfq weight 900 maxpkt 1900
tc class add dev $ETH classid 11:a est 0.5sec 2sec qfq weight 1000 maxpkt 2000
tc class add dev $ETH classid 11:b est 0.5sec 2sec qfq weight 1100 maxpkt 2048
tc class add dev $ETH classid 11:c est 0.5sec 2sec qfq weight 1200 maxpkt 2048
tc class add dev $ETH classid 11:d est 0.5sec 2sec qfq weight 1300 maxpkt 2048
tc class add dev $ETH classid 11:e est 0.5sec 2sec qfq weight 1400 maxpkt 2048
tc class add dev $ETH classid 11:f est 0.5sec 2sec qfq weight 1500 maxpkt 2048
tc class add dev $ETH classid 11:10 est 0.5sec 2sec qfq weight 1600 maxpkt 2048


for privnet in $PRIVNETS
do
	tc filter add dev $ETH parent 1: protocol ip prio 100 u32 \
		match ip dst $privnet flowid 1:11
done

tc filter add dev $ETH parent 1: protocol ip prio 100 u32 \
	match ip protocol 0 0x00 flowid 1:1




^ permalink raw reply

* Re: RFC v1: sysctl: add sysctl header cookie, share tables between nets
From: Eric W. Biederman @ 2011-03-03  9:33 UTC (permalink / raw)
  To: David Miller; +Cc: lucian.grijincu, adobriyan, tavi, netdev, linux-kernel
In-Reply-To: <20110302.170644.58413369.davem@davemloft.net>

David Miller <davem@davemloft.net> writes:

> From: Lucian Adrian Grijincu <lucian.grijincu@gmail.com>
> Date: Fri, 25 Feb 2011 20:52:32 +0200
>
>> This is a new approach to the "share sysctl tables" RFC series I
>> posted earlier this month.
>
> I do not disagree conceptually with these changes from a networking
> perspective, but I am not a sysctl layer expert so I don't know if the
> generic sysctl bits are a good idea or not.

I may be missing something in these patches. I haven't had time to look
at this most recent batch carefully.  But from a 10,000 foot perspective I
have a problem with them.  With a handful of network devices the size of
the data structures is negligible.

Where problems show up is when you have a lot of sysctl entries for
devices and at that point we have much larger problems using the
sysctl data structures.  Today add/remove are big O(previous entries)
and I think even readdir suffers from non-scalable data structures.

There are other related issues that the sysctl data structures are not
optimized for use in /proc, and that sysctl uses so usable but on off
locking like mechanisms.

Changing things to make the sysctl users more dependent on the current
implement details of the sysctl data structures seems the exact
opposite of the direction we need to go to make the sysctl data structures
scale.

So until I can see a reason why we should save a few bytes at the cost
of greater future maintenance costs I'm not in favor of this patch set.

Eric

^ permalink raw reply

* [PATCH] sctp: fix the fast retransmit limit
From: Wei Yongjun @ 2011-03-03  9:29 UTC (permalink / raw)
  To: David Miller, Vlad Yasevich, netdev@vger.kernel.org, lksctp
  Cc: Mingyuan Zhu, Neil Horman

If chunk is still lost after fast retransmit, SCTP stack will
never allow the second fast retransmit of this chunk, even if
the peer need we do this. This chunk will be retransmit until
the rtx timeout. This limit is introduce by the following patch:
  sctp: reduce memory footprint of sctp_chunk structure
  (c226ef9b83694311327f3ab0036c6de9c22e9daf)

This patch revert this limit and removed useless SCTP_DONT_FRTX.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 include/net/sctp/structs.h |    1 -
 net/sctp/outqueue.c        |    4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index cc9185c..82a0f84 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -751,7 +751,6 @@ struct sctp_chunk {
 
 #define SCTP_CAN_FRTX 0x0
 #define SCTP_NEED_FRTX 0x1
-#define SCTP_DONT_FRTX 0x2
 	__u16	rtt_in_progress:1,	/* This chunk used for RTT calc? */
 		has_tsn:1,		/* Does this chunk have a TSN yet? */
 		has_ssn:1,		/* Does this chunk have a SSN yet? */
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index 8c6d379..7ed5862 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -657,7 +657,7 @@ redo:
 			 * after it is retransmitted.
 			 */
 			if (chunk->fast_retransmit == SCTP_NEED_FRTX)
-				chunk->fast_retransmit = SCTP_DONT_FRTX;
+				chunk->fast_retransmit = SCTP_CAN_FRTX;
 
 			q->empty = 0;
 			break;
@@ -679,7 +679,7 @@ redo:
 	if (rtx_timeout || fast_rtx) {
 		list_for_each_entry(chunk1, lqueue, transmitted_list) {
 			if (chunk1->fast_retransmit == SCTP_NEED_FRTX)
-				chunk1->fast_retransmit = SCTP_DONT_FRTX;
+				chunk1->fast_retransmit = SCTP_CAN_FRTX;
 		}
 	}
 
-- 
1.6.5.2



^ permalink raw reply related

* Re: [PATCH] sched: QFQ - quick fair queue scheduler (v2)
From: Eric Dumazet @ 2011-03-03  9:07 UTC (permalink / raw)
  To: Fabio Checconi
  Cc: Stephen Hemminger, David Miller, Luigi Rizzo, netdev,
	Paolo Valente
In-Reply-To: <20110303081940.GA29685@gandalf.sssup.it>

Le jeudi 03 mars 2011 à 09:19 +0100, Fabio Checconi a écrit :

> The same bug you identified in qfq_reset_qdisc() is present also in
> qfq_drop(), both loops need to be corrected...

I dont think so, because in qfq_drop() we exit from qfq_drop() right
after call to qfq_deactivate_class()

But I agree code should be same ;)




^ 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