Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next] net: skb_segment() provides list head and tail
From: Eric Dumazet @ 2014-10-04  3:59 UTC (permalink / raw)
  To: David Miller
  Cc: brouer, netdev, therbert, hannes, fw, dborkman, jhs,
	alexander.duyck, john.r.fastabend
In-Reply-To: <1412375467.17245.16.camel@edumazet-glaptop2.roam.corp.google.com>

From: Eric Dumazet <edumazet@google.com>

Its unfortunate we have to walk again skb list to find the tail
after segmentation, even if data is probably hot in cpu caches.

skb_segment() can store the tail of the list into segs->prev,
and validate_xmit_skb_list() can immediately get the tail.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/core/dev.c    |   27 +++++++++++++++------------
 net/core/skbuff.c |    5 +++++
 2 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 1a90530f83ff..7d5691cc1f47 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2724,22 +2724,25 @@ struct sk_buff *validate_xmit_skb_list(struct sk_buff *skb, struct net_device *d
 {
 	struct sk_buff *next, *head = NULL, *tail;
 
-	while (skb) {
+	for (; skb != NULL; skb = next) {
 		next = skb->next;
 		skb->next = NULL;
+
+		/* in case skb wont be segmented, point to itself */
+		skb->prev = skb;
+
 		skb = validate_xmit_skb(skb, dev);
-		if (skb) {
-			struct sk_buff *end = skb;
+		if (!skb)
+			continue;
 
-			while (end->next)
-				end = end->next;
-			if (!head)
-				head = skb;
-			else
-				tail->next = skb;
-			tail = end;
-		}
-		skb = next;
+		if (!head)
+			head = skb;
+		else
+			tail->next = skb;
+		/* If skb was segmented, skb->prev points to
+		 * the last segment. If not, it still contains skb.
+		 */
+		tail = skb->prev;
 	}
 	return head;
 }
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index a0b312fa3047..06b57ec91f32 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3083,6 +3083,11 @@ perform_csum_check:
 		}
 	} while ((offset += len) < head_skb->len);
 
+	/* Some callers want to get the end of the list.
+	 * Put it in segs->prev to avoid walking the list.
+	 * (see validate_xmit_skb_list() for example)
+	 */
+	segs->prev = tail;
 	return segs;
 
 err:

^ permalink raw reply related

* Re: Bridge IGMP snooping question
From: Herbert Xu @ 2014-10-04  4:05 UTC (permalink / raw)
  To: Thomas Martitz; +Cc: netdev
In-Reply-To: <542D0911.3040402@rockbox.org>

On Thu, Oct 02, 2014 at 10:13:05AM +0200, Thomas Martitz wrote:
> Hello Linux folks,
> 
> I have one question regarding IGMP snooping on bridges, specifically
> about leaving multicast groups.
> 
> br_multicast_leave_group() has this check early on:
> 
> if (!netif_running(br->dev) ||
>         (port && port->state == BR_STATE_DISABLED) ||
>         timer_pending(&querier->timer)) /* <- THIS */
>                goto out;
> 
> I'm wondering why the bridge code prevents group leaves if if the
> querier timer is pending. From my understanding the timer acts as an
> indication whether the local system is the network's querier or not
> (if pending then another router is querier). Therefore this check
> prevents to leave groups if there is another querier.
> 
> I'm wondering what's the rationale for this, if any. It seems to be
> that the decision whether an attached client gets mc forwarded is
> independent on whether the local system is querier or not. Git log
> does not reveal the answer as this check is there from the
> beginning.
> 
> PS: This behavior conflicts with something I'm working.

You can't just leave a group because you received a single
leave message.  There may be another group member still listening
on that port.

To make sure no listeners are left a query message must be sent.
If there is another querier on the network then they are meant to
send such a query message which means that all we have to do is
passively wait for the timeout to expire.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply

* Re: [PATCH net-next] net: bcmgenet: improve bcmgenet_mii_setup()
From: Florian Fainelli @ 2014-10-04  4:18 UTC (permalink / raw)
  To: Petri Gynther; +Cc: netdev, David Miller
In-Reply-To: <20141003192501.C79311004A1@puck.mtv.corp.google.com>

2014-10-03 12:25 GMT-07:00 Petri Gynther <pgynther@google.com>:
> bcmgenet_mii_setup() is called from the PHY state machine every 1-2 seconds
> when the PHYs are in PHY_POLL mode.

At some point, I would to make sure we can avoid polling the PHY
completely and just rely on link interrupts, and use that scheme for
the MoCA PHYs too.

>
> Improve bcmgenet_mii_setup() so that it touches the MAC registers only when
> the link is up and there was a change to link, speed, duplex, or pause status.
>
> Signed-off-by: Petri Gynther <pgynther@google.com>

Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>

> ---
>  drivers/net/ethernet/broadcom/genet/bcmgenet.c |  3 +-
>  drivers/net/ethernet/broadcom/genet/bcmgenet.h |  3 +-
>  drivers/net/ethernet/broadcom/genet/bcmmii.c   | 73 ++++++++++++++++----------
>  3 files changed, 48 insertions(+), 31 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> index d51729c..e0a6238 100644
> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> @@ -2162,9 +2162,10 @@ static void bcmgenet_netif_stop(struct net_device *dev)
>          */
>         cancel_work_sync(&priv->bcmgenet_irq_work);
>
> -       priv->old_pause = -1;
>         priv->old_link = -1;
> +       priv->old_speed = -1;
>         priv->old_duplex = -1;
> +       priv->old_pause = -1;
>  }
>
>  static int bcmgenet_close(struct net_device *dev)
> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.h b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
> index ad95fe5..321b1db 100644
> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.h
> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
> @@ -548,8 +548,9 @@ struct bcmgenet_priv {
>         u16 gphy_rev;
>
>         /* PHY device variables */
> -       int old_duplex;
>         int old_link;
> +       int old_speed;
> +       int old_duplex;
>         int old_pause;
>         phy_interface_t phy_interface;
>         int phy_addr;
> diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c
> index 75b26cba..9ff799a 100644
> --- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
> +++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
> @@ -82,24 +82,33 @@ static void bcmgenet_mii_setup(struct net_device *dev)
>         struct bcmgenet_priv *priv = netdev_priv(dev);
>         struct phy_device *phydev = priv->phydev;
>         u32 reg, cmd_bits = 0;
> -       unsigned int status_changed = 0;
> +       bool status_changed = false;
>
>         if (priv->old_link != phydev->link) {
> -               status_changed = 1;
> +               status_changed = true;
>                 priv->old_link = phydev->link;
>         }
>
>         if (phydev->link) {
> -               /* program UMAC and RGMII block based on established link
> -                * speed, pause, and duplex.
> -                * the speed set in umac->cmd tell RGMII block which clock
> -                * 25MHz(100Mbps)/125MHz(1Gbps) to use for transmit.
> -                * receive clock is provided by PHY.
> -                */
> -               reg = bcmgenet_ext_readl(priv, EXT_RGMII_OOB_CTRL);
> -               reg &= ~OOB_DISABLE;
> -               reg |= RGMII_LINK;
> -               bcmgenet_ext_writel(priv, reg, EXT_RGMII_OOB_CTRL);
> +               /* check speed/duplex/pause changes */
> +               if (priv->old_speed != phydev->speed) {
> +                       status_changed = true;
> +                       priv->old_speed = phydev->speed;
> +               }
> +
> +               if (priv->old_duplex != phydev->duplex) {
> +                       status_changed = true;
> +                       priv->old_duplex = phydev->duplex;
> +               }
> +
> +               if (priv->old_pause != phydev->pause) {
> +                       status_changed = true;
> +                       priv->old_pause = phydev->pause;
> +               }
> +
> +               /* done if nothing has changed */
> +               if (!status_changed)
> +                       return;
>
>                 /* speed */
>                 if (phydev->speed == SPEED_1000)
> @@ -110,36 +119,39 @@ static void bcmgenet_mii_setup(struct net_device *dev)
>                         cmd_bits = UMAC_SPEED_10;
>                 cmd_bits <<= CMD_SPEED_SHIFT;
>
> -               if (priv->old_duplex != phydev->duplex) {
> -                       status_changed = 1;
> -                       priv->old_duplex = phydev->duplex;
> -               }
> -
>                 /* duplex */
>                 if (phydev->duplex != DUPLEX_FULL)
>                         cmd_bits |= CMD_HD_EN;
>
> -               if (priv->old_pause != phydev->pause) {
> -                       status_changed = 1;
> -                       priv->old_pause = phydev->pause;
> -               }
> -
>                 /* pause capability */
>                 if (!phydev->pause)
>                         cmd_bits |= CMD_RX_PAUSE_IGNORE | CMD_TX_PAUSE_IGNORE;
> -       }
>
> -       if (!status_changed)
> -               return;
> +               /*
> +                * Program UMAC and RGMII block based on established
> +                * link speed, duplex, and pause. The speed set in
> +                * umac->cmd tell RGMII block which clock to use for
> +                * transmit -- 25MHz(100Mbps) or 125MHz(1Gbps).
> +                * Receive clock is provided by the PHY.
> +                */
> +               reg = bcmgenet_ext_readl(priv, EXT_RGMII_OOB_CTRL);
> +               reg &= ~OOB_DISABLE;
> +               reg |= RGMII_LINK;
> +               bcmgenet_ext_writel(priv, reg, EXT_RGMII_OOB_CTRL);
>
> -       if (phydev->link) {
>                 reg = bcmgenet_umac_readl(priv, UMAC_CMD);
>                 reg &= ~((CMD_SPEED_MASK << CMD_SPEED_SHIFT) |
>                                CMD_HD_EN |
>                                CMD_RX_PAUSE_IGNORE | CMD_TX_PAUSE_IGNORE);
>                 reg |= cmd_bits;
>                 bcmgenet_umac_writel(priv, reg, UMAC_CMD);
> +       } else {
> +               /* done if nothing has changed */
> +               if (!status_changed)
> +                       return;
>
> +               /* needed for MoCA fixed PHY to reflect correct link status */
> +               netif_carrier_off(dev);
>         }
>
>         phy_print_status(phydev);
> @@ -318,6 +330,12 @@ static int bcmgenet_mii_probe(struct net_device *dev)
>         /* Communicate the integrated PHY revision */
>         phy_flags = priv->gphy_rev;
>
> +       /* Initialize link state variables that bcmgenet_mii_setup() uses */
> +       priv->old_link = -1;
> +       priv->old_speed = -1;
> +       priv->old_duplex = -1;
> +       priv->old_pause = -1;
> +
>         phydev = of_phy_connect(dev, priv->phy_dn, bcmgenet_mii_setup,
>                                 phy_flags, priv->phy_interface);
>         if (!phydev) {
> @@ -325,9 +343,6 @@ static int bcmgenet_mii_probe(struct net_device *dev)
>                 return -ENODEV;
>         }
>
> -       priv->old_link = -1;
> -       priv->old_duplex = -1;
> -       priv->old_pause = -1;
>         priv->phydev = phydev;
>
>         /* Configure port multiplexer based on what the probed PHY device since
> --
> 2.1.0.rc2.206.gedb03e5
>



-- 
Florian

^ permalink raw reply

* distribution of a single stream over all RSS queues
From: Artem Bokhan @ 2014-10-04  6:34 UTC (permalink / raw)
  To: netdev

Hello.

Are there any 10gbe cards on the market able to distribute packets from 
a single tcp/udp stream over all RSS queues? Probably there are some 
hooks with registers allowing doing that?

ps. I understand packets reodering problem.

^ permalink raw reply

* Re: [PATCH v7 net-next 2/2] bonding: Simplify the xmit function for modes that use xmit_hash
From: Nikolay Aleksandrov @ 2014-10-04  7:37 UTC (permalink / raw)
  To: Mahesh Bandewar, Jay Vosburgh, Veaceslav Falico, Andy Gospodarek,
	David Miller
  Cc: netdev, Eric Dumazet, Maciej Zenczykowski, Cong Wang
In-Reply-To: <1412383720-1540-1-git-send-email-maheshb@google.com>

On 10/04/2014 02:48 AM, Mahesh Bandewar wrote:
> Earlier change to use usable slave array for TLB mode had an additional
> performance advantage. So extending the same logic to all other modes
> that use xmit-hash for slave selection (viz 802.3AD, and XOR modes).
> Also consolidating this with the earlier TLB change.
> 
> The main idea is to build the usable slaves array in the control path
> and use that array for slave selection during xmit operation.
> 
> Measured performance in a setup with a bond of 4x1G NICs with 200
> instances of netperf for the modes involved (3ad, xor, tlb)
> cmd: netperf -t TCP_RR -H <TargetHost> -l 60 -s 5
> 
> Mode        TPS-Before   TPS-After
> 
> 802.3ad   : 468,694      493,101
> TLB (lb=0): 392,583      392,965
> XOR       : 475,696      484,517
> 
> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
> Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
> ---
> v1:
>   (a) If bond_update_slave_arr() fails to allocate memory, it will overwrite
>       the slave that need to be removed.
>   (b) Freeing of array will assign NULL (to handle bond->down to bond->up
>       transition gracefully.
>   (c) Change from pr_debug() to pr_err() if bond_update_slave_arr() returns
>       failure.
>   (d) XOR: bond_update_slave_arr() will consider mii-mon, arp-mon cases and
>       will populate the array even if these parameters are not used.
>   (e) 3AD: Should handle the ad_agg_selection_logic correctly.
> v2:
>   (a) Removed rcu_read_{un}lock() calls from array manipulation code.
>   (b) Slave link-events now refresh array for all these modes.
>   (c) Moved free-array call from bond_close() to bond_uninit().
> v3:
>   (a) Fixed null pointer dereference.
>   (b) Removed bond->lock lockdep dependency.
> v4:
>   (a) Made to changes to comply with Nikolay's locking changes
>   (b) Added a work-queue to refresh slave-array when RTNL is not held
>   (c) Array refresh happens ONLY with RTNL now.
>   (d) alloc changed from GFP_ATOMIC to GFP_KERNEL
> v5:
>   (a) Consolidated all delayed slave-array updates at one place in
>       3ad_state_machine_handler()
> v6:
>   (a) Free slave array when there is no active aggregator
> v7:
>   (a) Couple of trivial changes.
> 
>  drivers/net/bonding/bond_3ad.c  | 140 +++++++++++------------------
>  drivers/net/bonding/bond_alb.c  |  51 ++---------
>  drivers/net/bonding/bond_alb.h  |   8 --
>  drivers/net/bonding/bond_main.c | 192 +++++++++++++++++++++++++++++++++++++---
>  drivers/net/bonding/bonding.h   |  10 +++
>  5 files changed, 249 insertions(+), 152 deletions(-)
> 
<<<snip>>>
> +/* Build the usable slaves array in control path for modes that use xmit-hash
> + * to determine the slave interface -
> + * (a) BOND_MODE_8023AD
> + * (b) BOND_MODE_XOR
> + * (c) BOND_MODE_TLB && tlb_dynamic_lb == 0
> + *
> + * The caller is expected to hold RTNL only and NO other lock!
> + */
> +int bond_update_slave_arr(struct bonding *bond, struct slave *skipslave)
> +{
> +	struct slave *slave;
> +	struct list_head *iter;
> +	struct bond_up_slave *new_arr, *old_arr;
> +	int slaves_in_agg;
> +	int agg_id = 0;
> +	int ret = 0;
> +
> +#ifdef CONFIG_LOCKDEP
> +	lockdep_assert_held(&bond->mode_lock);
> +#endif
^^^^^^^^^
This is wrong now, the logic is inverted.
It will WARN every time mode_lock is _not_ held:

#define lockdep_assert_held(l)  do {                            \
                WARN_ON(debug_locks && !lockdep_is_held(l));    \
        } while (0)

The previous version was correct which did a WARN when mode_lock was
actually held as that is the wrong condition, not when it's not held.
I've missed that comment earlier.

(also switched Veaceslav's email address with the correct one in the CC list)

> +
> +	new_arr = kzalloc(offsetof(struct bond_up_slave, arr[bond->slave_cnt]),
> +			  GFP_KERNEL);
> +	if (!new_arr) {
> +		ret = -ENOMEM;
> +		pr_err("Failed to build slave-array.\n");
> +		goto out;
> +	}
> +	if (BOND_MODE(bond) == BOND_MODE_8023AD) {
> +		struct ad_info ad_info;
> +
> +		if (bond_3ad_get_active_agg_info(bond, &ad_info)) {
> +			pr_debug("bond_3ad_get_active_agg_info failed\n");
> +			kfree_rcu(new_arr, rcu);
> +			/* No active aggragator means it's not safe to use
> +			 * the previous array.
> +			 */
> +			old_arr = rtnl_dereference(bond->slave_arr);
> +			if (old_arr) {
> +				RCU_INIT_POINTER(bond->slave_arr, NULL);
> +				kfree_rcu(old_arr, rcu);
> +			}
> +			goto out;
> +		}
> +		slaves_in_agg = ad_info.ports;
> +		agg_id = ad_info.aggregator_id;
> +	}
> +	bond_for_each_slave(bond, slave, iter) {
> +		if (BOND_MODE(bond) == BOND_MODE_8023AD) {
> +			struct aggregator *agg;
> +
> +			agg = SLAVE_AD_INFO(slave)->port.aggregator;
> +			if (!agg || agg->aggregator_identifier != agg_id)
> +				continue;
> +		}
> +		if (!bond_slave_can_tx(slave))
> +			continue;
> +		if (skipslave == slave)
> +			continue;
> +		new_arr->arr[new_arr->count++] = slave;
> +	}
> +
> +	old_arr = rtnl_dereference(bond->slave_arr);
> +	rcu_assign_pointer(bond->slave_arr, new_arr);
> +	if (old_arr)
> +		kfree_rcu(old_arr, rcu);
> +out:
> +	if (ret != 0 && skipslave) {
> +		int idx;
> +
> +		/* Rare situation where caller has asked to skip a specific
> +		 * slave but allocation failed (most likely!). BTW this is
> +		 * only possible when the call is initiated from
> +		 * __bond_release_one(). In this situation; overwrite the
> +		 * skipslave entry in the array with the last entry from the
> +		 * array to avoid a situation where the xmit path may choose
> +		 * this to-be-skipped slave to send a packet out.
> +		 */
> +		old_arr = rtnl_dereference(bond->slave_arr);
> +		for (idx = 0; idx < old_arr->count; idx++) {
> +			if (skipslave == old_arr->arr[idx]) {
> +				old_arr->arr[idx] =
> +				    old_arr->arr[old_arr->count-1];
> +				old_arr->count--;
> +				break;
> +			}
> +		}
> +	}
> +	return ret;
> +}
> +
<<<snip>>>

^ permalink raw reply

* Re: [PATCH] team: add rescheduling jiffy delay on !rtnl_trylock
From: Paul E. McKenney @ 2014-10-04  8:37 UTC (permalink / raw)
  To: Joe Lawrence; +Cc: Tejun Heo, netdev, Jiri Pirko
In-Reply-To: <20141003153701.7c7da030@jlaw-desktop.mno.stratus.com>

On Fri, Oct 03, 2014 at 03:37:01PM -0400, Joe Lawrence wrote:
> On Wed, 1 Oct 2014 23:43:08 -0700
> "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> wrote:
> 
> > On Mon, Sep 29, 2014 at 12:06:01PM -0400, Tejun Heo wrote:
> > > (cc'ing Paul and quoting the whole body)
> > > 
> > > Paul, this is a fix for RCU sched stall observed w/ a work item
> > > requeueing itself waiting for the RCU grace period.  As the self
> > > requeueing work item ends up being executed by the same kworker, the
> > > worker task never stops running in the absence of a higher priority
> > > task and it seems to delay RCU grace period for a very long time on
> > > !PREEMPT kernels.  As each work item denotes a boundary which no
> > > synchronization construct stretches across, I wonder whether it'd be a
> > > good idea to add a notification for the end of RCU critical section
> > > between executions of work items.
> > 
> > It sounds like a great idea to me!  I suggest invoking
> > rcu_note_context_switch() between executions of work items.
> > 
> > 							Thanx, Paul
> 
> I gave this a spin, probably inserting the call in the wrong place:
> 
> diff --git a/kernel/workqueue.c b/kernel/workqueue.c
> index 5dbe22a..77f128e 100644
> --- a/kernel/workqueue.c
> +++ b/kernel/workqueue.c
> @@ -2045,7 +2045,8 @@ __acquires(&pool->lock)
>          * indefinitely requeue itself while all other CPUs are trapped in
>          * stop_machine.
>          */
> -       cond_resched();
> +       if (!cond_resched())
> +               rcu_note_context_switch(raw_smp_processor_id());
> 
>         spin_lock_irq(&pool->lock);

If the cond_resched() is in the right place, then you should be good.

FWIW, there is a cond_resched_rcu_qs() that should be going into the next
merge window that could be used in place of the above two lines.  This is
commit bde6c3aa9930 in -tip.

> this results in RCU grace periods progressing (dyntick remains
> fixed) as advertised, even with the test-module from [1] loaded:
> 
> Fri Oct  3 14:37:14 2014
>   4 c=9635 g=9636 pq=1 qp=0 dt=51693/140000000000000/0 df=163 of=0 ql=0/1 qs=...D b=10 ci=0 nci=34184 co=0 ca=0
> 
> Fri Oct  3 14:50:24 2014
>   4 c=13072 g=13073 pq=1 qp=0 dt=51693/140000000000000/0 df=163 of=0 ql=0/1 qs=...D b=10 ci=0 nci=34191 co=0 ca=0

Nice!

							Thanx, Paul

> I'll leave it up to Tejun to determine where/how that call should be
> made.
> 
> Thanks!
> 
> -- Joe
> 
> [1] http://marc.info/?l=linux-kernel&m=141192244232345
> 

^ permalink raw reply

* [PATCH] drivers/net/phy/Kconfig: Let MDIO_BCM_UNIMAC depend on HAS_IOMEM
From: Chen Gang @ 2014-10-04  9:54 UTC (permalink / raw)
  To: f.fainelli; +Cc: netdev, linux-kernel, richard

MDIO_BCM_UNIMAC needs HAS_IOMEM, so depend on it, the related error (
with allmodconfig under um):

    MODPOST 1205 modules
  ERROR: "devm_ioremap" [drivers/net/phy/mdio-bcm-unimac.ko] undefined!

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
 drivers/net/phy/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index 14afa4f..75472cf7 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -205,6 +205,7 @@ config MDIO_BUS_MUX_MMIOREG
 
 config MDIO_BCM_UNIMAC
 	tristate "Broadcom UniMAC MDIO bus controller"
+	depends on HAS_IOMEM
 	help
 	  This module provides a driver for the Broadcom UniMAC MDIO busses.
 	  This hardware can be found in the Broadcom GENET Ethernet MAC
-- 
1.9.3

^ permalink raw reply related

* [RFC 1/1] net: fix rcu access on phonet_routes
From: Fabian Frederick @ 2014-10-04  9:57 UTC (permalink / raw)
  To: linux-kernel
  Cc: Josh Triplett, Fabian Frederick, Remi Denis-Courmont,
	David S. Miller, netdev

-Add __rcu annotation on table to fix sparse warnings:
net/phonet/pn_dev.c:279:25: warning: incorrect type in assignment (different address spaces)
net/phonet/pn_dev.c:279:25:    expected struct net_device *<noident>
net/phonet/pn_dev.c:279:25:    got void [noderef] <asn:4>*<noident>
net/phonet/pn_dev.c:376:17: warning: incorrect type in assignment (different address spaces)
net/phonet/pn_dev.c:376:17:    expected struct net_device *volatile <noident>
net/phonet/pn_dev.c:376:17:    got struct net_device [noderef] <asn:4>*<noident>
net/phonet/pn_dev.c:392:17: warning: incorrect type in assignment (different address spaces)
net/phonet/pn_dev.c:392:17:    expected struct net_device *<noident>
net/phonet/pn_dev.c:392:17:    got void [noderef] <asn:4>*<noident>

-Access table with rcu_dereference (fixes the following sparse errors):
net/phonet/pn_dev.c:278:25: error: incompatible types in comparison expression (different address spaces)
net/phonet/pn_dev.c:391:17: error: incompatible types in comparison expression (different address spaces)

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 net/phonet/pn_dev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c
index 56a6146..5c9c0b2f1 100644
--- a/net/phonet/pn_dev.c
+++ b/net/phonet/pn_dev.c
@@ -36,7 +36,7 @@
 
 struct phonet_routes {
 	struct mutex		lock;
-	struct net_device	*table[64];
+	struct net_device __rcu	*table[64];
 };
 
 struct phonet_net {
@@ -275,7 +275,7 @@ static void phonet_route_autodel(struct net_device *dev)
 	bitmap_zero(deleted, 64);
 	mutex_lock(&pnn->routes.lock);
 	for (i = 0; i < 64; i++)
-		if (dev == pnn->routes.table[i]) {
+		if (rcu_dereference(pnn->routes.table[i]) == dev) {
 			RCU_INIT_POINTER(pnn->routes.table[i], NULL);
 			set_bit(i, deleted);
 		}
@@ -388,7 +388,7 @@ int phonet_route_del(struct net_device *dev, u8 daddr)
 
 	daddr = daddr >> 2;
 	mutex_lock(&routes->lock);
-	if (dev == routes->table[daddr])
+	if (rcu_dereference(routes->table[daddr]) == dev)
 		RCU_INIT_POINTER(routes->table[daddr], NULL);
 	else
 		dev = NULL;
-- 
1.9.3

^ permalink raw reply related

* [PATCH] drivers/net/can/m_can/Kconfig: Let CAN_M_CAN depend on HAS_IOMEM
From: Chen Gang @ 2014-10-04 10:00 UTC (permalink / raw)
  To: wg, mkl, fengguang.wu, b29396, varkabhadram
  Cc: linux-can, netdev, linux-kernel

CAN_M_CAN needs HAS_IOMEM, so depend on it, the related error (with
allmodconfig under um):

    MODPOST 1205 modules
  ERROR: "devm_ioremap" [drivers/net/can/m_can/m_can.ko] undefined!
  ERROR: "devm_ioremap_resource" [drivers/net/can/m_can/m_can.ko] undefined!

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
 drivers/net/can/m_can/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/can/m_can/Kconfig b/drivers/net/can/m_can/Kconfig
index fca5482..14c9fcf 100644
--- a/drivers/net/can/m_can/Kconfig
+++ b/drivers/net/can/m_can/Kconfig
@@ -1,4 +1,5 @@
 config CAN_M_CAN
 	tristate "Bosch M_CAN devices"
+	depends on HAS_IOMEM
 	---help---
 	  Say Y here if you want to support for Bosch M_CAN controller.
-- 
1.9.3

^ permalink raw reply related

* Re: [PATCH nf next 0/3] bridge: netfilter: fix handling of ipv4 packets w. options
From: Florian Westphal @ 2014-10-04 10:04 UTC (permalink / raw)
  To: Herbert Xu
  Cc: Florian Westphal, netfilter-devel, bsd, stephen, netdev,
	eric.dumazet, davidn, Bandan Das
In-Reply-To: <20141004035606.GA8228@gondor.apana.org.au>

Herbert Xu <herbert@gondor.apana.org.au> wrote:

[ fix netdev mail address, sorry about that ]

> On Sat, Oct 04, 2014 at 03:04:27AM +0200, Florian Westphal wrote:
> > David Newall reported that bridge causes bad checksums:
> > http://thread.gmane.org/gmane.linux.network/315705/focus=1706769
> > 
> > The proposal was to revert
> > 462fb2af9788a82a5 (bridge : Sanitize skb before it enters the IP stack).
> > 
> > However, this has some other adverse effects since bridge netfilter
> > and ip stack both use skb->cb (and we thus memset skb->cb whenever
> > we hand skb off to the ip stack).
> > 
> > So, this series attemps to resolve this a bit differently.
> > 
> > First, lets add the inet_param padding that Eric suggested previously.
> > This means that any earlier setup of IPCB will be preserved inside the
> > bridge layer.
> > 
> > This is also useful for netfilter since it will preserve
> > IPCB(skb)->frag_max_size set up by ip defrag.
> > 
> > Second, this gets rid of the option parsing/memset calls in
> > to forward and output cases.
> > 
> > Third, the pre-routing path is changed to not mangle the packets
> > but to only validate the ip options.
> > 
> > This patch series is vs. next instead of net/nf tree.
> > 
> > This has been broken for so long that I don't think we need
> > to rush this.
> 
> I'm unsure whether this is the right approach.  So if I understand
> this correctly your problem is coming from packets that are
> 
> 	IP stack => bridge => IP stack

Just to clarify, right now this doesn't work:
ping -R <addr-of-bridge>
ping -R <addr-behind-bridge>

> in which case preserving IP options may work.
> 
> But does your patch handle packets that are
> 
> 	external => bridge => IP stack

Aside from above record-route test I also played with a bogus bridge
setup where incoming packets can exceed br0 mtu, in this case we emit
frag error without echoing/acting on the options.

IP (..  flags [DF], proto ICMP (1), length 1508, options (NOP,RR 192.168.1.1, 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0))
192.168.1.1 > 192.168.1.16: ICMP echo request, id 26676, seq 1, length 1448
IP (..  flags [none], proto ICMP (1), length 576) 192.168.1.10 > 192.168.1.1: ICMP 192.168.1.16 unreachable - need to frag (mtu 1500), length 556

1.10 is br0 IP, 1.16 and 1.1 are on different bridge ports, 1.1 has
bogus (larger) mtu than all other hosts.

The fragment error does not echo any RR information.
Is that your concern?

> The reason I asked for the IPCB to be built is to handle exactly
> that case.

Why do we need to compile ip options, exactly?  If the packet
is locally delivered, we hand it up to the ip stack which will
compile ip options normally.

If its forwarded, it only travels through netfilter hooks.
The preserved ip_options_compile() call will make sure options
look sane (we don't preserve the built opts information in
this patch).

The only case where it can reenter in fwd case, AFAICS, is when the
skb exceeds the mtu due to nf_defrag (reenter via call to ip_fragment()).

And we used to get crash here when calling icmp_send since skb->cb
was pointing to bridge cb, which then would crash in __ip_options_echo()
because the various IPCB->opts offsets were garbage.

But, why would we want to echo options?

We're just a bridge (so yes, strictly speaking the icmp response
is already wrong, but silently tossing packets doesn't seem right
either).

Are you saying we should act like router and set the options?

> In fact, even preserving IPCB in the IP stack reentry case is
> a hack since if we ever change the IP stack in future such that
> on exit the IPCB is no longer valid for reentry your approach
> will fail.

True.  I guess in that case, we'd have to resort to less
straightforward approach, i.e. explicitly add the IPCB parts
we wish to retain to br_input_skb_cb, then translate back-and-forth
where needed.

> Now as to your original problem that ip_options_compile mangles
> the packet this is something I explicitly said we should fix
> before we added br_parse_ip_options (point 2 in that email):
> 
> 	https://lkml.org/lkml/2010/9/3/16
> 
> Unfortunately it looks like nobody actually did the audit.

Right.

> So my suggestion would be to fix br_parse_ip_options so that
> it never mangles the packet.

This patch avoids the option mangling by passing in a NULL skb.
So to do what you want all that is needed is to remember
the parsed opts result.  If we add Erics suggested inet cb pad
we can just place the parsed option struct into IPCB()->opts.

If not, we could add struct ip_options to br_input_skb_cb
and stash it there (we'd still need to re-arrange skb->cb to
what ip stack expects though when calling back into it in output
path).

Alternatively, we could call the ipv4 parsing function again
to re-construct IPCB->opts.

I'm just not yet sure if this is the right idea.
Remembering the information will cause the icmp frag error
above to list br0 ip address in the icmp frag error.

Under which circumstances would we want/need to remember the
parsed options (i.e. retain struct ip_options in ->cb[]), or
act upon them?

Thanks,
Florian

^ permalink raw reply

* Re: [PATCH] drivers/net/can/m_can/Kconfig: Let CAN_M_CAN depend on HAS_IOMEM
From: Varka Bhadram @ 2014-10-04 11:05 UTC (permalink / raw)
  To: Chen Gang, wg, mkl, fengguang.wu, b29396; +Cc: linux-can, netdev, linux-kernel
In-Reply-To: <542FC556.6060306@gmail.com>

Hi Chen Gang


I think commit message should be short and proper.

We can remove *drivers/net/can/m_can/Kconfig* in the commit, just
give *can: Kconfig: *

commit message like : *can: Kconfig: Fix CAN_M_CAN dependency*

On Saturday 04 October 2014 03:30 PM, Chen Gang wrote:
> CAN_M_CAN needs HAS_IOMEM, so depend on it, the related error (with
> allmodconfig under um):
>
>      MODPOST 1205 modules
>    ERROR: "devm_ioremap" [drivers/net/can/m_can/m_can.ko] undefined!
>    ERROR: "devm_ioremap_resource" [drivers/net/can/m_can/m_can.ko] undefined!
>
> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
> ---
>   drivers/net/can/m_can/Kconfig | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/can/m_can/Kconfig b/drivers/net/can/m_can/Kconfig
> index fca5482..14c9fcf 100644
> --- a/drivers/net/can/m_can/Kconfig
> +++ b/drivers/net/can/m_can/Kconfig
> @@ -1,4 +1,5 @@
>   config CAN_M_CAN
>   	tristate "Bosch M_CAN devices"
> +	depends on HAS_IOMEM
>   	---help---
>   	  Say Y here if you want to support for Bosch M_CAN controller.

-- 
Thanks and Regards,
Varka Bhadram.


^ permalink raw reply

* Re: [RFC 1/1] net: fix rcu access on phonet_routes
From: Rémi Denis-Courmont @ 2014-10-04 11:24 UTC (permalink / raw)
  To: Fabian Frederick, David S. Miller; +Cc: linux-kernel, Josh Triplett, netdev
In-Reply-To: <1412416676-21698-1-git-send-email-fabf@skynet.be>

Le samedi 4 octobre 2014, 11:57:56 Fabian Frederick a écrit :
(snip)
> -Access table with rcu_dereference (fixes the following sparse errors):
> net/phonet/pn_dev.c:278:25: error: incompatible types in comparison
> expression (different address spaces) net/phonet/pn_dev.c:391:17: error:
> incompatible types in comparison expression (different address spaces)

Acked-by: Rémi Denis-Courmont <remi@remlab.net>

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

^ permalink raw reply

* Re: [PATCH] drivers/net/can/m_can/Kconfig: Let CAN_M_CAN depend on HAS_IOMEM
From: Chen Gang @ 2014-10-04 11:49 UTC (permalink / raw)
  To: Varka Bhadram, wg, mkl, fengguang.wu, b29396
  Cc: linux-can, netdev, linux-kernel
In-Reply-To: <542FD466.6080603@gmail.com>


On 10/4/14 19:05, Varka Bhadram wrote:
> Hi Chen Gang
> 
> 
> I think commit message should be short and proper.
> 
> We can remove *drivers/net/can/m_can/Kconfig* in the commit, just
> give *can: Kconfig: *
> 
> commit message like : *can: Kconfig: Fix CAN_M_CAN dependency*
> 

OK, thanks, it sounds good to me. If necessary to send patch v2 for it,
please let me know.

Thanks.

> On Saturday 04 October 2014 03:30 PM, Chen Gang wrote:
>> CAN_M_CAN needs HAS_IOMEM, so depend on it, the related error (with
>> allmodconfig under um):
>>
>>      MODPOST 1205 modules
>>    ERROR: "devm_ioremap" [drivers/net/can/m_can/m_can.ko] undefined!
>>    ERROR: "devm_ioremap_resource" [drivers/net/can/m_can/m_can.ko] undefined!
>>
>> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
>> ---
>>   drivers/net/can/m_can/Kconfig | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/net/can/m_can/Kconfig b/drivers/net/can/m_can/Kconfig
>> index fca5482..14c9fcf 100644
>> --- a/drivers/net/can/m_can/Kconfig
>> +++ b/drivers/net/can/m_can/Kconfig
>> @@ -1,4 +1,5 @@
>>   config CAN_M_CAN
>>       tristate "Bosch M_CAN devices"
>> +    depends on HAS_IOMEM
>>       ---help---
>>         Say Y here if you want to support for Bosch M_CAN controller.
> 

-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed

^ permalink raw reply

* Re: [PATCH net-next] net: phy: adjust fixed_phy_register() return value
From: Thomas Petazzoni @ 2014-10-04 12:07 UTC (permalink / raw)
  To: Petri Gynther; +Cc: netdev, davem, f.fainelli
In-Reply-To: <20141001214509.2BF4F10070D@puck.mtv.corp.google.com>

Dear Petri Gynther,

Sorry for the late answer.

On Wed,  1 Oct 2014 14:45:09 -0700 (PDT), Petri Gynther wrote:
> Adjust fixed_phy_register() to return struct phy_device *, so that
> it becomes easy to use fixed PHYs without device tree support:
> 
>   phydev = fixed_phy_register(PHY_POLL, &fixed_phy_status, NULL);
>   fixed_phy_set_link_update(phydev, fixed_phy_link_update);
>   phy_connect_direct(netdev, phydev, handler_fn, phy_interface);
> 
> This change is a prerequisite for modifying bcmgenet driver to work
> without a device tree on Broadcom's MIPS-based 7xxx platforms.
> 
> Signed-off-by: Petri Gynther <pgynther@google.com>

On the principle, I'm obviously fine, but I have one comment below.


>  	/* New binding */
>  	fixed_link_node = of_get_child_by_name(np, "fixed-link");
> @@ -299,7 +300,8 @@ int of_phy_register_fixed_link(struct device_node *np)
>  		status.asym_pause = of_property_read_bool(fixed_link_node,
>  							  "asym-pause");
>  		of_node_put(fixed_link_node);
> -		return fixed_phy_register(PHY_POLL, &status, np);
> +		phy = fixed_phy_register(PHY_POLL, &status, np);
> +		return (!phy || IS_ERR(phy));
>  	}
>  
>  	/* Old binding */
> @@ -310,7 +312,8 @@ int of_phy_register_fixed_link(struct device_node *np)
>  		status.speed = be32_to_cpu(fixed_link_prop[2]);
>  		status.pause = be32_to_cpu(fixed_link_prop[3]);
>  		status.asym_pause = be32_to_cpu(fixed_link_prop[4]);
> -		return fixed_phy_register(PHY_POLL, &status, np);
> +		phy = fixed_phy_register(PHY_POLL, &status, np);
> +		return (!phy || IS_ERR(phy));

I am not sure this return (!phy || IS_ERR(phy)) is doing the right
thing. This function is supposed to return an error code on failure, or
0 on success. I don't see how your error handling returns an error code
on failure. What about doing the more explicit:

		phy = fixed_phy_register(PHY_POLL, &status, np);
		if (IS_ERR(phy))
			return PTR_ERR(phy);
		else
			return 0;

Or am I missing something?

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply

* Re: [PATCH nf next 0/3] bridge: netfilter: fix handling of ipv4 packets w. options
From: Herbert Xu @ 2014-10-04 13:55 UTC (permalink / raw)
  To: Florian Westphal
  Cc: netfilter-devel, bsd, stephen, netdev, eric.dumazet, davidn,
	Bandan Das
In-Reply-To: <20141004100413.GA1241@breakpoint.cc>

On Sat, Oct 04, 2014 at 12:04:13PM +0200, Florian Westphal wrote:
>
> > The reason I asked for the IPCB to be built is to handle exactly
> > that case.
> 
> Why do we need to compile ip options, exactly?  If the packet
> is locally delivered, we hand it up to the ip stack which will
> compile ip options normally.

Good point.  I thought we added this because Bandan Das wanted
options.  But rereading the thread in question

	http://lkml.org/lkml/2010/9/3/16

it seems that he doesn't actually need options.  So what happened
appears to be a misunderstanding.  Bandan tried to improve my
original memset hack by compiling options which would have been
fine except that his approach ended up mangling the packet which
is a big no-no.

So the most straightforward solution is to go back to my original
hack and just do a straight memset zero of the cb area before
each entry into the IP stack from the bridge.

I'll try to create a patch that essentially reverts the patch
that led us here.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply

* bridge: Do not compile options in br_parse_ip_options
From: Herbert Xu @ 2014-10-04 14:18 UTC (permalink / raw)
  To: Florian Westphal
  Cc: netfilter-devel, bsd, stephen, netdev, eric.dumazet, davidn,
	David S. Miller
In-Reply-To: <20141004135508.GA10705@gondor.apana.org.au>

On Sat, Oct 04, 2014 at 09:55:08PM +0800, Herbert Xu wrote:
>
> I'll try to create a patch that essentially reverts the patch
> that led us here.

Here is a patch that's only compile-tested:

bridge: Do not compile options in br_parse_ip_options

Commit 462fb2af9788a82a534f8184abfde31574e1cfa0

	bridge : Sanitize skb before it enters the IP stack

broke when IP options are actually used because it mangles the
skb as if it entered the IP stack which is wrong because the
bridge is supposed to operate below the IP stack.

Since nobody has actually requested for parsing of IP options
this patch fixes it by simply reverting to the previous approach
of ignoring all IP options, i.e., zeroing the IPCB.

If and when somebody who uses IP options and actually needs them
to be parsed by the bridge complains then we can revisit this.

Reported-by: David Newall <davidn@davidnewall.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index a615264..c0fdb4d 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -260,7 +260,6 @@ static inline void nf_bridge_update_protocol(struct sk_buff *skb)
 
 static int br_parse_ip_options(struct sk_buff *skb)
 {
-	struct ip_options *opt;
 	const struct iphdr *iph;
 	struct net_device *dev = skb->dev;
 	u32 len;
@@ -269,7 +268,6 @@ static int br_parse_ip_options(struct sk_buff *skb)
 		goto inhdr_error;
 
 	iph = ip_hdr(skb);
-	opt = &(IPCB(skb)->opt);
 
 	/* Basic sanity checks */
 	if (iph->ihl < 5 || iph->version != 4)
@@ -295,23 +293,11 @@ static int br_parse_ip_options(struct sk_buff *skb)
 	}
 
 	memset(IPCB(skb), 0, sizeof(struct inet_skb_parm));
-	if (iph->ihl == 5)
-		return 0;
-
-	opt->optlen = iph->ihl*4 - sizeof(struct iphdr);
-	if (ip_options_compile(dev_net(dev), opt, skb))
-		goto inhdr_error;
-
-	/* Check correct handling of SRR option */
-	if (unlikely(opt->srr)) {
-		struct in_device *in_dev = __in_dev_get_rcu(dev);
-		if (in_dev && !IN_DEV_SOURCE_ROUTE(in_dev))
-			goto drop;
-
-		if (ip_options_rcv_srr(skb))
-			goto drop;
-	}
-
+	/* We should really parse IP options here but until
+	 * somebody who actually uses IP options complains to
+	 * us we'll just silently ignore the options because
+	 * we're lazy!
+	 */
 	return 0;
 
 inhdr_error:

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply related

* [PATCH iproute2] ip tunnel: fix 'ip -oneline tunnel show' for some GRE tunnels
From: Dmitry Popov @ 2014-10-04 15:00 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

'ip -oneline tunnel show' was not "oneline" for GRE tunnels with iseq:
# ip tun add gre_test remote 1.1.1.1 local 2.2.2.2 mode gre iseq oseq
# ip -oneline tun show gre_test | wc -l
2

The problem existed because of a typo: '\n' was printed when it shouldn't be.
Fixed.

Signed-off-by: Dmitry Popov <ixaphire@qrator.net>
---
 ip/ip6tunnel.c | 2 +-
 ip/iptunnel.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/ip/ip6tunnel.c b/ip/ip6tunnel.c
index 4b73ec6..b83534e 100644
--- a/ip/ip6tunnel.c
+++ b/ip/ip6tunnel.c
@@ -117,7 +117,7 @@ static void print_tunnel(struct ip6_tnl_parm2 *p)
 		}
 
 		if (p->i_flags&GRE_SEQ)
-			printf("%s  Drop packets out of sequence.\n", _SL_);
+			printf("%s  Drop packets out of sequence.", _SL_);
 		if (p->i_flags&GRE_CSUM)
 			printf("%s  Checksum in received packet is required.", _SL_);
 		if (p->o_flags&GRE_SEQ)
diff --git a/ip/iptunnel.c b/ip/iptunnel.c
index 0844a4f..caf8a28 100644
--- a/ip/iptunnel.c
+++ b/ip/iptunnel.c
@@ -409,7 +409,7 @@ static void print_tunnel(struct ip_tunnel_parm *p)
 	}
 
 	if (p->i_flags&GRE_SEQ)
-		printf("%s  Drop packets out of sequence.\n", _SL_);
+		printf("%s  Drop packets out of sequence.", _SL_);
 	if (p->i_flags&GRE_CSUM)
 		printf("%s  Checksum in received packet is required.", _SL_);
 	if (p->o_flags&GRE_SEQ)

^ permalink raw reply related

* Re: [RFC 1/1] net: fix rcu access on phonet_routes
From: Eric Dumazet @ 2014-10-04 15:30 UTC (permalink / raw)
  To: Fabian Frederick
  Cc: linux-kernel, Josh Triplett, Remi Denis-Courmont, David S. Miller,
	netdev
In-Reply-To: <1412416676-21698-1-git-send-email-fabf@skynet.be>

On Sat, 2014-10-04 at 11:57 +0200, Fabian Frederick wrote:
> -Add __rcu annotation on table to fix sparse warnings:
> net/phonet/pn_dev.c:279:25: warning: incorrect type in assignment (different address spaces)
> net/phonet/pn_dev.c:279:25:    expected struct net_device *<noident>
> net/phonet/pn_dev.c:279:25:    got void [noderef] <asn:4>*<noident>
> net/phonet/pn_dev.c:376:17: warning: incorrect type in assignment (different address spaces)
> net/phonet/pn_dev.c:376:17:    expected struct net_device *volatile <noident>
> net/phonet/pn_dev.c:376:17:    got struct net_device [noderef] <asn:4>*<noident>
> net/phonet/pn_dev.c:392:17: warning: incorrect type in assignment (different address spaces)
> net/phonet/pn_dev.c:392:17:    expected struct net_device *<noident>
> net/phonet/pn_dev.c:392:17:    got void [noderef] <asn:4>*<noident>
> 
> -Access table with rcu_dereference (fixes the following sparse errors):
> net/phonet/pn_dev.c:278:25: error: incompatible types in comparison expression (different address spaces)
> net/phonet/pn_dev.c:391:17: error: incompatible types in comparison expression (different address spaces)
> 
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
>  net/phonet/pn_dev.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c
> index 56a6146..5c9c0b2f1 100644
> --- a/net/phonet/pn_dev.c
> +++ b/net/phonet/pn_dev.c
> @@ -36,7 +36,7 @@
>  
>  struct phonet_routes {
>  	struct mutex		lock;
> -	struct net_device	*table[64];
> +	struct net_device __rcu	*table[64];
>  };
>  
>  struct phonet_net {
> @@ -275,7 +275,7 @@ static void phonet_route_autodel(struct net_device *dev)
>  	bitmap_zero(deleted, 64);
>  	mutex_lock(&pnn->routes.lock);
>  	for (i = 0; i < 64; i++)
> -		if (dev == pnn->routes.table[i]) {
> +		if (rcu_dereference(pnn->routes.table[i]) == dev) {
>  			RCU_INIT_POINTER(pnn->routes.table[i], NULL);
>  			set_bit(i, deleted);
>  		}
> @@ -388,7 +388,7 @@ int phonet_route_del(struct net_device *dev, u8 daddr)
>  
>  	daddr = daddr >> 2;
>  	mutex_lock(&routes->lock);
> -	if (dev == routes->table[daddr])
> +	if (rcu_dereference(routes->table[daddr]) == dev)
>  		RCU_INIT_POINTER(routes->table[daddr], NULL);
>  	else
>  		dev = NULL;

Hi Fabian

Have you tested this running the kernel with following config options :

CONFIG_LOCKDEP=y
CONFIG_PROVE_RCU=y

LOCKDEP should complain loudly, if not, we should file a bug !

Hint : Use rcu_access_pointer(), and check that LOCKDEP is happy with
that.

Thanks !

^ permalink raw reply

* [PATCH net-next] fec: Fix fec_enet_alloc_buffers() error path
From: Fabio Estevam @ 2014-10-04 16:40 UTC (permalink / raw)
  To: davem; +Cc: rmk+kernel, Frank.Li, netdev, Fabio Estevam

From: Fabio Estevam <fabio.estevam@freescale.com>

When fec_enet_alloc_buffers() fails we should better undo the previous actions,
which consists of: disabling the FEC clocks and putting the FEC pins into
inactive state.

The error path for fec_enet_mii_probe() is kept unchanged.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/net/ethernet/freescale/fec_main.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 1f07db8..620feaf 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -2746,16 +2746,12 @@ fec_enet_open(struct net_device *ndev)
 
 	ret = fec_enet_alloc_buffers(ndev);
 	if (ret)
-		return ret;
+		goto err_enet_alloc;
 
 	/* Probe and connect to PHY when open the interface */
 	ret = fec_enet_mii_probe(ndev);
-	if (ret) {
-		fec_enet_free_buffers(ndev);
-		fec_enet_clk_enable(ndev, false);
-		pinctrl_pm_select_sleep_state(&fep->pdev->dev);
-		return ret;
-	}
+	if (ret)
+		goto err_enet_mii_probe;
 
 	fec_restart(ndev);
 	napi_enable(&fep->napi);
@@ -2763,6 +2759,13 @@ fec_enet_open(struct net_device *ndev)
 	netif_tx_start_all_queues(ndev);
 
 	return 0;
+
+err_enet_mii_probe:
+	fec_enet_free_buffers(ndev);
+err_enet_alloc:
+	fec_enet_clk_enable(ndev, false);
+	pinctrl_pm_select_sleep_state(&fep->pdev->dev);
+	return ret;
 }
 
 static int
-- 
1.9.1

^ permalink raw reply related

* [PATCH net-next] net: sched: avoid costly atomic operation in fq_dequeue()
From: Eric Dumazet @ 2014-10-04 17:11 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

From: Eric Dumazet <edumazet@google.com>

Standard qdisc API to setup a timer implies an atomic operation on every
packet dequeue : qdisc_unthrottled()

It turns out this is not really needed for FQ, as FQ has no concept of
global qdisc throttling, being a qdisc handling many different flows,
some of them can be throttled, while others are not.

Fix is straightforward : add a 'bool throttle' to
qdisc_watchdog_schedule_ns(), and remove calls to qdisc_unthrottled()
in sch_fq.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 include/net/pkt_sched.h |    4 ++--
 net/sched/sch_api.c     |    5 +++--
 net/sched/sch_fq.c      |    6 ++----
 net/sched/sch_tbf.c     |    3 ++-
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index e4b3c828c1c2..27a33833ff4a 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -65,12 +65,12 @@ struct qdisc_watchdog {
 };
 
 void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc);
-void qdisc_watchdog_schedule_ns(struct qdisc_watchdog *wd, u64 expires);
+void qdisc_watchdog_schedule_ns(struct qdisc_watchdog *wd, u64 expires, bool throttle);
 
 static inline void qdisc_watchdog_schedule(struct qdisc_watchdog *wd,
 					   psched_time_t expires)
 {
-	qdisc_watchdog_schedule_ns(wd, PSCHED_TICKS2NS(expires));
+	qdisc_watchdog_schedule_ns(wd, PSCHED_TICKS2NS(expires), true);
 }
 
 void qdisc_watchdog_cancel(struct qdisc_watchdog *wd);
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index aa8329508dba..ab70e7dddb04 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -592,13 +592,14 @@ void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc)
 }
 EXPORT_SYMBOL(qdisc_watchdog_init);
 
-void qdisc_watchdog_schedule_ns(struct qdisc_watchdog *wd, u64 expires)
+void qdisc_watchdog_schedule_ns(struct qdisc_watchdog *wd, u64 expires, bool throttle)
 {
 	if (test_bit(__QDISC_STATE_DEACTIVATED,
 		     &qdisc_root_sleeping(wd->qdisc)->state))
 		return;
 
-	qdisc_throttled(wd->qdisc);
+	if (throttle)
+		qdisc_throttled(wd->qdisc);
 
 	hrtimer_start(&wd->timer,
 		      ns_to_ktime(expires),
diff --git a/net/sched/sch_fq.c b/net/sched/sch_fq.c
index c9b9fcb53206..cbd7e1fd23b4 100644
--- a/net/sched/sch_fq.c
+++ b/net/sched/sch_fq.c
@@ -377,7 +377,6 @@ static int fq_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 		if (time_after(jiffies, f->age + q->flow_refill_delay))
 			f->credit = max_t(u32, f->credit, q->quantum);
 		q->inactive_flows--;
-		qdisc_unthrottled(sch);
 	}
 
 	/* Note: this overwrites f->age */
@@ -385,7 +384,6 @@ static int fq_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 
 	if (unlikely(f == &q->internal)) {
 		q->stat_internal_packets++;
-		qdisc_unthrottled(sch);
 	}
 	sch->q.qlen++;
 
@@ -433,7 +431,8 @@ begin:
 		if (!head->first) {
 			if (q->time_next_delayed_flow != ~0ULL)
 				qdisc_watchdog_schedule_ns(&q->watchdog,
-							   q->time_next_delayed_flow);
+							   q->time_next_delayed_flow,
+							   false);
 			return NULL;
 		}
 	}
@@ -495,7 +494,6 @@ begin:
 	}
 out:
 	qdisc_bstats_update(sch, skb);
-	qdisc_unthrottled(sch);
 	return skb;
 }
 
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
index 77edffe329c4..a4afde14e865 100644
--- a/net/sched/sch_tbf.c
+++ b/net/sched/sch_tbf.c
@@ -268,7 +268,8 @@ static struct sk_buff *tbf_dequeue(struct Qdisc *sch)
 		}
 
 		qdisc_watchdog_schedule_ns(&q->watchdog,
-					   now + max_t(long, -toks, -ptoks));
+					   now + max_t(long, -toks, -ptoks),
+					   true);
 
 		/* Maybe we have a shorter packet in the queue,
 		   which can be sent now. It sounds cool,

^ permalink raw reply related

* Fw: [Bug 85571] New: wakeup from hibernate does not bring up networking (hard freeze, soft lockups and unusable system)
From: Stephen Hemminger @ 2014-10-04 17:32 UTC (permalink / raw)
  To: netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA



Begin forwarded message:

Date: Fri, 3 Oct 2014 21:22:46 -0700
From: "bugzilla-daemon-590EEB7GvNiWaY/ihj7yzEB+6BGkLq7r@public.gmane.org" <bugzilla-daemon-590EEB7GvNiWaY/ihj7yzEB+6BGkLq7r@public.gmane.org>
To: "stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public.gmane.org" <stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public.gmane.org>
Subject: [Bug 85571] New: wakeup from hibernate does not bring up networking (hard freeze, soft lockups and unusable system)


https://bugzilla.kernel.org/show_bug.cgi?id=85571

            Bug ID: 85571
           Summary: wakeup from hibernate does not bring up networking
                    (hard freeze, soft lockups and unusable system)
           Product: Networking
           Version: 2.5
    Kernel Version: 3.16.3-200.fc20.x86_64
          Hardware: Intel
                OS: Linux
              Tree: Fedora
            Status: NEW
          Severity: blocking
          Priority: P1
         Component: Other
          Assignee: shemminger-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org
          Reporter: itsme_410-/E1597aS9LQAvxtiuMwx3w@public.gmane.org
        Regression: No

The subject line is pretty explanatory. On my Dell Precision M3800, my system
does not wake up from hibernate correctly. (I have no issues with either a Dell
Latitude E6400 or a Dell XPS 13). The latop is unusable and needs a hard
reboot. Here are my hardware details. I also occassionally get the message:

BUG: soft lockup - CPU#0 stuck for 22s! and so on all the way till CPU#1

And I also get the following messages from systemd:

kernel:[43026.180173] do_IRQ: 0.81 No irq handler for vector (irq -1)

kernel:do_IRQ: 0.81 No irq handler for vector (irq -1)

Here is the output from cat /proc/cpuinfo, lsmod, lsb, lspci, etc:


$ cat /proc/cpuinfo
processor    : 0
vendor_id    : GenuineIntel
cpu family    : 6
model        : 60
model name    : Intel(R) Core(TM) i7-4702HQ CPU @ 2.20GHz
stepping    : 3
microcode    : 0x1a
cpu MHz        : 2196.132
cache size    : 6144 KB
physical id    : 0
siblings    : 8
core id        : 0
cpu cores    : 4
apicid        : 0
initial apicid    : 0
fpu        : yes
fpu_exception    : yes
cpuid level    : 13
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb
rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology
nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2
ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt
tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt
pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1
avx2 smep bmi2 erms invpcid
bogomips    : 4389.99
clflush size    : 64
cache_alignment    : 64
address sizes    : 39 bits physical, 48 bits virtual
power management:

processor    : 1
vendor_id    : GenuineIntel
cpu family    : 6
model        : 60
model name    : Intel(R) Core(TM) i7-4702HQ CPU @ 2.20GHz
stepping    : 3
microcode    : 0x1a
cpu MHz        : 1900.335
cache size    : 6144 KB
physical id    : 0
siblings    : 8
core id        : 1
cpu cores    : 4
apicid        : 2
initial apicid    : 2
fpu        : yes
fpu_exception    : yes
cpuid level    : 13
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb
rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology
nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2
ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt
tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt
pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1
avx2 smep bmi2 erms invpcid
bogomips    : 4389.99
clflush size    : 64
cache_alignment    : 64
address sizes    : 39 bits physical, 48 bits virtual
power management:

processor    : 2
vendor_id    : GenuineIntel
cpu family    : 6
model        : 60
model name    : Intel(R) Core(TM) i7-4702HQ CPU @ 2.20GHz
stepping    : 3
microcode    : 0x1a
cpu MHz        : 2039.382
cache size    : 6144 KB
physical id    : 0
siblings    : 8
core id        : 2
cpu cores    : 4
apicid        : 4
initial apicid    : 4
fpu        : yes
fpu_exception    : yes
cpuid level    : 13
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb
rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology
nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2
ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt
tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt
pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1
avx2 smep bmi2 erms invpcid
bogomips    : 4389.99
clflush size    : 64
cache_alignment    : 64
address sizes    : 39 bits physical, 48 bits virtual
power management:

processor    : 3
vendor_id    : GenuineIntel
cpu family    : 6
model        : 60
model name    : Intel(R) Core(TM) i7-4702HQ CPU @ 2.20GHz
stepping    : 3
microcode    : 0x1a
cpu MHz        : 2199.312
cache size    : 6144 KB
physical id    : 0
siblings    : 8
core id        : 3
cpu cores    : 4
apicid        : 6
initial apicid    : 6
fpu        : yes
fpu_exception    : yes
cpuid level    : 13
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb
rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology
nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2
ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt
tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt
pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1
avx2 smep bmi2 erms invpcid
bogomips    : 4389.99
clflush size    : 64
cache_alignment    : 64
address sizes    : 39 bits physical, 48 bits virtual
power management:

processor    : 4
vendor_id    : GenuineIntel
cpu family    : 6
model        : 60
model name    : Intel(R) Core(TM) i7-4702HQ CPU @ 2.20GHz
stepping    : 3
microcode    : 0x1a
cpu MHz        : 1176.656
cache size    : 6144 KB
physical id    : 0
siblings    : 8
core id        : 0
cpu cores    : 4
apicid        : 1
initial apicid    : 1
fpu        : yes
fpu_exception    : yes
cpuid level    : 13
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb
rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology
nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2
ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt
tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt
pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1
avx2 smep bmi2 erms invpcid
bogomips    : 4389.99
clflush size    : 64
cache_alignment    : 64
address sizes    : 39 bits physical, 48 bits virtual
power management:

processor    : 5
vendor_id    : GenuineIntel
cpu family    : 6
model        : 60
model name    : Intel(R) Core(TM) i7-4702HQ CPU @ 2.20GHz
stepping    : 3
microcode    : 0x1a
cpu MHz        : 1218.250
cache size    : 6144 KB
physical id    : 0
siblings    : 8
core id        : 1
cpu cores    : 4
apicid        : 3
initial apicid    : 3
fpu        : yes
fpu_exception    : yes
cpuid level    : 13
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb
rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology
nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2
ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt
tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt
pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1
avx2 smep bmi2 erms invpcid
bogomips    : 4389.99
clflush size    : 64
cache_alignment    : 64
address sizes    : 39 bits physical, 48 bits virtual
power management:

processor    : 6
vendor_id    : GenuineIntel
cpu family    : 6
model        : 60
model name    : Intel(R) Core(TM) i7-4702HQ CPU @ 2.20GHz
stepping    : 3
microcode    : 0x1a
cpu MHz        : 2200.000
cache size    : 6144 KB
physical id    : 0
siblings    : 8
core id        : 2
cpu cores    : 4
apicid        : 5
initial apicid    : 5
fpu        : yes
fpu_exception    : yes
cpuid level    : 13
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb
rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology
nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2
ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt
tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt
pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1
avx2 smep bmi2 erms invpcid
bogomips    : 4389.99
clflush size    : 64
cache_alignment    : 64
address sizes    : 39 bits physical, 48 bits virtual
power management:

processor    : 7
vendor_id    : GenuineIntel
cpu family    : 6
model        : 60
model name    : Intel(R) Core(TM) i7-4702HQ CPU @ 2.20GHz
stepping    : 3
microcode    : 0x1a
cpu MHz        : 1901.453
cache size    : 6144 KB
physical id    : 0
siblings    : 8
core id        : 3
cpu cores    : 4
apicid        : 7
initial apicid    : 7
fpu        : yes
fpu_exception    : yes
cpuid level    : 13
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb
rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology
nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2
ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt
tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt
pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1
avx2 smep bmi2 erms invpcid
bogomips    : 4389.99
clflush size    : 64
cache_alignment    : 64
address sizes    : 39 bits physical, 48 bits virtual
power management:


$ lsmod
Module                  Size  Used by
ccm                    17773  1
tun                    27153  3
ip6t_rpfilter          12546  1
ip6t_REJECT            12939  2
xt_conntrack           12760  9
bnep                   19624  2
ebtable_nat            12807  0
ebtable_broute         12731  0
bridge                116006  1 ebtable_broute
stp                    12868  1 bridge
llc                    13941  2 stp,bridge
ebtable_filter         12827  0
ebtables               30758  3 ebtable_broute,ebtable_nat,ebtable_filter
ip6table_nat           12974  1
nf_conntrack_ipv6      18738  6
nf_defrag_ipv6         34712  1 nf_conntrack_ipv6
nf_nat_ipv6            13213  1 ip6table_nat
ip6table_mangle        12700  1
ip6table_security      12710  1
ip6table_raw           12683  1
ip6table_filter        12815  1
ip6_tables             26809  5
ip6table_filter,ip6table_mangle,ip6table_security,ip6table_nat,ip6table_raw
iptable_nat            12970  1
nf_conntrack_ipv4      14656  5
nf_defrag_ipv4         12702  1 nf_conntrack_ipv4
nf_nat_ipv4            13199  1 iptable_nat
nf_nat                 25178  4
nf_nat_ipv4,nf_nat_ipv6,ip6table_nat,iptable_nat
nf_conntrack           99420  8
nf_nat,nf_nat_ipv4,nf_nat_ipv6,xt_conntrack,ip6table_nat,iptable_nat,nf_conntrack_ipv4,nf_conntrack_ipv6
iptable_mangle         12695  1
iptable_security       12705  1
iptable_raw            12678  1
arc4                   12608  2
x86_pkg_temp_thermal    14205  0
coretemp               13441  0
kvm_intel             147547  0
kvm                   452677  1 kvm_intel
crct10dif_pclmul       14307  0
crc32_pclmul           13133  0
iwlmvm                222115  0
crc32c_intel           22094  0
ghash_clmulni_intel    13230  0
mac80211              623787  1 iwlmvm
pn544_mei              12802  0
mei_phy                13574  1 pn544_mei
pn544                  18073  1 pn544_mei
hci                    43298  2 pn544,mei_phy
rtsx_pci_sdmmc         22998  0
snd_hda_codec_realtek    72791  1
mmc_core              121087  1 rtsx_pci_sdmmc
nfc                    98285  2 hci,pn544
snd_hda_codec_generic    67662  1 snd_hda_codec_realtek
snd_hda_codec_hdmi     47489  1
rtsx_pci_ms            18168  0
iTCO_wdt               13480  0
memstick               16199  1 rtsx_pci_ms
iTCO_vendor_support    13419  1 iTCO_wdt
snd_hda_intel          30379  7
dell_wmi               12681  0
sparse_keymap          13584  1 dell_wmi
dell_laptop            18168  0
snd_hda_controller     30139  1 snd_hda_intel
uvcvideo               81022  0
dcdbas                 14875  1 dell_laptop
videobuf2_vmalloc      13163  1 uvcvideo
snd_hda_codec         131298  5
snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_intel,snd_hda_controller
videobuf2_memops       13161  1 videobuf2_vmalloc
videobuf2_core         57175  1 uvcvideo
v4l2_common            14542  1 videobuf2_core
snd_hwdep              17650  1 snd_hda_codec
joydev                 17344  0
iwlwifi               125702  1 iwlmvm
snd_seq                62266  0
videodev              147660  3 uvcvideo,v4l2_common,videobuf2_core
snd_seq_device         14136  1 snd_seq
btusb                  32448  0
cfg80211              500115  3 iwlwifi,mac80211,iwlmvm
lpc_ich                21093  0
microcode              44710  0
serio_raw              13434  0
snd_pcm               104333  4
snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel,snd_hda_controller
i2c_i801               18146  0
rtsx_pci               44989  2 rtsx_pci_ms,rtsx_pci_sdmmc
mei_me                 19568  0
mfd_core               13182  2 lpc_ich,rtsx_pci
bluetooth             433970  21 bnep,btusb
mei                    86597  3 pn544_mei,mei_phy,mei_me
hid_multitouch         17419  0
rfkill                 21979  6 nfc,cfg80211,bluetooth,dell_laptop
snd_timer              28778  2 snd_pcm,snd_seq
media                  20846  2 uvcvideo,videodev
snd                    75905  24
snd_hda_codec_realtek,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_seq,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel,snd_seq_device
soundcore              14491  2 snd,snd_hda_codec
shpchp                 37047  0
nfsd                  283833  1
auth_rpcgss            58761  1 nfsd
nfs_acl                12741  1 nfsd
int3403_thermal        12967  0
lockd                  93436  1 nfsd
sunrpc                279214  5 nfsd,auth_rpcgss,lockd,nfs_acl
dell_smo8800           13154  0
nouveau              1222531  1
i915                  904304  5
ttm                    80772  1 nouveau
i2c_algo_bit           13257  2 i915,nouveau
drm_kms_helper         58041  2 i915,nouveau
drm                   291361  7 ttm,i915,drm_kms_helper,nouveau
i2c_core               55486  8
drm,i915,i2c_i801,drm_kms_helper,i2c_algo_bit,v4l2_common,nouveau,videodev
mxm_wmi                12865  1 nouveau
video                  19777  2 i915,nouveau
wmi                    18820  3 dell_wmi,mxm_wmi,nouveau


$ lspci
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor
DRAM Controller (rev 06)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor
PCI Express x16 Controller (rev 06)
00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor
Integrated Graphics Controller (rev 06)
00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor
HD Audio Controller (rev 06)
00:04.0 Signal processing controller: Intel Corporation Device 0c03 (rev 06)
00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family
USB xHCI (rev 05)
00:16.0 Communication controller: Intel Corporation 8 Series/C220 Series
Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family
USB EHCI #2 (rev 05)
00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High
Definition Audio Controller (rev 05)
00:1c.0 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI
Express Root Port #1 (rev d5)
00:1c.2 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI
Express Root Port #3 (rev d5)
00:1c.3 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI
Express Root Port #4 (rev d5)
00:1d.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family
USB EHCI #1 (rev 05)
00:1f.0 ISA bridge: Intel Corporation HM87 Express LPC Controller (rev 05)
00:1f.2 SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family
6-port SATA Controller 1 [AHCI mode] (rev 05)
00:1f.3 SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus
Controller (rev 05)
00:1f.6 Signal processing controller: Intel Corporation 8 Series Chipset Family
Thermal Management Controller (rev 05)
Please let me know if more information is needed and what I can provide!

--
You are receiving this mail because:
You are the assignee for the bug.
--
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: bridge: Do not compile options in br_parse_ip_options
From: Florian Westphal @ 2014-10-04 18:06 UTC (permalink / raw)
  To: Herbert Xu
  Cc: Florian Westphal, netfilter-devel, bsd, stephen, netdev,
	eric.dumazet, davidn, David S. Miller
In-Reply-To: <20141004141802.GA10878@gondor.apana.org.au>

Herbert Xu <herbert@gondor.apana.org.au> wrote:
> On Sat, Oct 04, 2014 at 09:55:08PM +0800, Herbert Xu wrote:
> >
> > I'll try to create a patch that essentially reverts the patch
> > that led us here.
> 
> Here is a patch that's only compile-tested:
> 
> bridge: Do not compile options in br_parse_ip_options
> 
> Commit 462fb2af9788a82a534f8184abfde31574e1cfa0
> 
> 	bridge : Sanitize skb before it enters the IP stack
> 
> broke when IP options are actually used because it mangles the
> skb as if it entered the IP stack which is wrong because the
> bridge is supposed to operate below the IP stack.
> 
> Since nobody has actually requested for parsing of IP options
> this patch fixes it by simply reverting to the previous approach
> of ignoring all IP options, i.e., zeroing the IPCB.

Fair enough.  We lose frag_max_size information from ipv4 defrag,
plus netfilter hooks are called without validating ip options.

The former has not worked ever with bridge, and the latter
evidentily isn't a problem either since this has not worked at all
for three years...

So I am fine with it, provided we rename br_parse_ip_options() --
thats not what it does after this patch (br_validate_iphdr(), for
example?)

> If and when somebody who uses IP options and actually needs them
> to be parsed by the bridge complains then we can revisit this.

Ok, fair enough.

Thanks Herbert.

^ permalink raw reply

* Re: [PATCH net-next] net: phy: adjust fixed_phy_register() return value
From: David Miller @ 2014-10-05  0:02 UTC (permalink / raw)
  To: thomas.petazzoni; +Cc: pgynther, netdev, f.fainelli
In-Reply-To: <20141004140731.15c18a77@free-electrons.com>

From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Date: Sat, 4 Oct 2014 14:07:31 +0200

> I am not sure this return (!phy || IS_ERR(phy)) is doing the right
> thing. This function is supposed to return an error code on failure, or
> 0 on success. I don't see how your error handling returns an error code
> on failure. What about doing the more explicit:
> 
> 		phy = fixed_phy_register(PHY_POLL, &status, np);
> 		if (IS_ERR(phy))
> 			return PTR_ERR(phy);
> 		else
> 			return 0;
> 
> Or am I missing something?

Agreed, there is no circumstance under which the new fixed_phy_register()
should return a NULL pointer.

^ permalink raw reply

* Re: [PATCH net-next] mlx4: add a new xmit_more counter
From: David Miller @ 2014-10-05  0:04 UTC (permalink / raw)
  To: eric.dumazet
  Cc: amirv, brouer, therbert, netdev, hannes, fw, dborkman, jhs,
	alexander.duyck, john.r.fastabend, dave.taht, toke
In-Reply-To: <1412263461.16704.107.camel@edumazet-glaptop2.roam.corp.google.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 02 Oct 2014 08:24:21 -0700

> From: Eric Dumazet <edumazet@google.com>
> 
> ethtool -S reports a new counter, tracking number of time doorbell
> was not triggered, because skb->xmit_more was set.
> 
> $ ethtool -S eth0 | egrep "tx_packet|xmit_more"
>      tx_packets: 2413288400
>      xmit_more: 666121277
> 
> I merged the tso_packet false sharing avoidance in this patch as well.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Applied, thanks Eric.

^ permalink raw reply

* Re: [PATCH net] ip6_gre: fix flowi6_proto value in xmit path
From: David Miller @ 2014-10-05  0:09 UTC (permalink / raw)
  To: nicolas.dichtel; +Cc: netdev
In-Reply-To: <1412267209-893-1-git-send-email-nicolas.dichtel@6wind.com>

From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Thu,  2 Oct 2014 18:26:49 +0200

> In xmit path, we build a flowi6 which will be used for the output route lookup.
> We are sending a GRE packet, neither IPv4 nor IPv6 encapsulated packet, thus the
> protocol should be IPPROTO_GRE.
> 
> Fixes: c12b395a4664 ("gre: Support GRE over IPv6")
> Reported-by: Matthieu Ternisien d'Ouville <matthieu.tdo@6wind.com>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

Applied and queued up for -stable, thanks.

^ 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