Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH] Packet mmap : allow the user to choose the offset of the tx payload.
From: Daniel Borkmann @ 2012-10-07 12:44 UTC (permalink / raw)
  To: pchavent; +Cc: davem, edumazet, xemul, herbert, netdev, johann.baudy, uaca
In-Reply-To: <CAD6jFUS+ovW79iOZxN-ptTZiTF9VsYnoLA-aWFSBX-zUR8OKGQ@mail.gmail.com>

On Sun, Oct 7, 2012 at 12:50 PM, Daniel Borkmann
<danborkmann@iogearbox.net> wrote:
> On Sat, Oct 6, 2012 at 9:43 AM, pchavent <Paul.Chavent@onera.fr> wrote:
>> On Fri, 5 Oct 2012 21:37:58 +0200, Daniel Borkmann wrote:
>>> On Fri, Oct 5, 2012 at 9:21 PM, pchavent <Paul.Chavent@onera.fr> wrote:
>>>> On Fri, 5 Oct 2012 16:17:12 +0200, Daniel Borkmann wrote:
>>>>> On Fri, Oct 5, 2012 at 3:10 PM, Paul Chavent <Paul.Chavent@onera.fr>
>>>>> wrote:
>>>>>>
>>>>>>
>>>>>> The tx offset of packet mmap tx ring used to be :
>>>>>> (TPACKET2_HDRLEN - sizeof(struct sockaddr_ll))
>>>>>>
>>>>>> The problem is that depending on the usage of SOCK_DGRAM or
>>>>>> SOCK_RAW, the payload could be aligned or not.
>>>>>>
>>>>>> This patch allow to let the user give an offset for it's tx
>>>>>> payload if he desires.
>>>>>>
>>>>>> Signed-off-by: Paul Chavent <paul.chavent@onera.fr>
>>>>>
>>>>>
>>>>> Can you provide an example when it doesn't hit TPACKET_ALIGNMENT?
>>>>
>>>>
>>>> When we use tx ring, the user have to write at (TPACKET_HDRLEN -
>>>> sizeof(struct sockaddr_ll))
>>>>
>>>> This adress is aligned on TPACKET_ALIGNMENT since
>>>> TPACKET_HDRLEN = (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) +
>>>> sizeof(struct
>>>> sockaddr_ll))
>>>>
>>>> When we use the tx ring with SOCK_RAW option, the mac header is aligned
>>>> on
>>>> TPACKET_ALIGNMENT, but not the payload (14 bytes away).
>>>
>>>
>>> Okay, I'm confused about your intentions, maybe I'm missing something.
>>> The man-page of packet(7) clearly says:
>>>
>>> The socket_type is either SOCK_RAW for raw packets *including* the
>>> link level header or SOCK_DGRAM for cooked packets with  the link
>>> level header *removed*.
>>>
>>> So this is perfectly intended behavior of PF_PACKET.
>>>
>>> Cheers,
>>>
>>> Daniel
>>
>>
>> Yes, i also expect to be able to include the link level header when i use
>> SOCK_RAW.
>>
>> My intention is to send a frame with this payload (for example) :
>> typedef struct
>> {
>>   double   ts;
>>   uint64_t foo;
>> } test_t;
>>
>> So i get a pointer to the raw packet :
>> void * raw_packet = frame_base + (TPACKET_HDRLEN - sizeof(struct
>> sockaddr_ll));
>>
>> I cook the header :
>> memcpy(raw_packet +  0, dst_addr, sizeof(dst_addr));
>> memcpy(raw_packet +  6, src_addr, sizeof(src_addr));
>> memcpy(raw_packet + 12, type    , sizeof(type));
>>
>> Then i get a pointer to the beginning of payload :
>> test_t * payload = raw_packet + 14;
>>
>> Here payload is at 58 bytes from the beginning of the frame.
>>
>> Then i fill the payload :
>> payload->ts = 1.0;
>> payload->foo = 2;
>> ...
>>
>> These are misaligned accesses.
>>
>> I don't care to fill the cooked header if it's misaligned, but i would like
>> to be able to fill the frame directly in the ring buffer being on aligned
>> boundaries.

Just a minor remark: speaking about your patch, in the case of
SOCK_RAW I think you rather might want to care whether your *mac
header* starts at an aligned offset or not, since the kernel doesn't
care about your particular payload, but about the frame as a whole
that it needs to process.

> Okay.
>
> Maybe what you could do in a new version of your patch is to introduce
> a TP_STATUS flag, e.g. TP_STATUS_SEND_HAS_OFF that you pass along
> binary or'ed with the commonly used flags, and then you can fill
> tp_mac resp. tp_net with offsets. By that, you won't break legacy
> stuff.

Also, note that you should wait with your submission until net-next is reopened.

^ permalink raw reply

* [PATCH] vxlan: remove unused including <linux/version.h>
From: Wei Yongjun @ 2012-10-07 13:23 UTC (permalink / raw)
  To: shemminger; +Cc: yongjun_wei, netdev

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Remove including <linux/version.h> that don't need it.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/net/vxlan.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 51de9ed..6f95580 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -28,7 +28,6 @@
 #include <linux/igmp.h>
 #include <linux/etherdevice.h>
 #include <linux/if_ether.h>
-#include <linux/version.h>
 #include <linux/hash.h>
 #include <net/ip.h>
 #include <net/icmp.h>

^ permalink raw reply related

* Re: [PATCH net 3/6] ipv4: add check if nh_pcpu_rth_output is allocated
From: Eric Dumazet @ 2012-10-07 13:34 UTC (permalink / raw)
  To: Julian Anastasov; +Cc: netdev
In-Reply-To: <1349609168-9848-4-git-send-email-ja@ssi.bg>

On Sun, 2012-10-07 at 14:26 +0300, Julian Anastasov wrote:
> 	Avoid NULL ptr dereference and caching if
> nh_pcpu_rth_output is not allocated.
> 
> Signed-off-by: Julian Anastasov <ja@ssi.bg>
> ---
>  net/ipv4/route.c |   12 +++++++++---
>  1 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> index 488a8bb..0a600cc 100644
> --- a/net/ipv4/route.c
> +++ b/net/ipv4/route.c
> @@ -1798,18 +1798,24 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
>  	fnhe = NULL;
>  	if (fi) {
>  		struct rtable __rcu **prth;
> +		struct fib_nh *nh = &FIB_RES_NH(*res);
>  
> -		fnhe = find_exception(&FIB_RES_NH(*res), fl4->daddr);
> +		fnhe = find_exception(nh, fl4->daddr);
>  		if (fnhe)
>  			prth = &fnhe->fnhe_rth;
> -		else
> -			prth = __this_cpu_ptr(FIB_RES_NH(*res).nh_pcpu_rth_output);
> +		else {
> +			if (!nh->nh_pcpu_rth_output)
> +				goto add;
> +			prth = __this_cpu_ptr(nh->nh_pcpu_rth_output);
> +		}
>  		rth = rcu_dereference(*prth);
>  		if (rt_cache_valid(rth)) {
>  			dst_hold(&rth->dst);
>  			return rth;
>  		}
>  	}
> +
> +add:
>  	rth = rt_dst_alloc(dev_out,
>  			   IN_DEV_CONF_GET(in_dev, NOPOLICY),
>  			   IN_DEV_CONF_GET(in_dev, NOXFRM),

Alternative would be to make sure the allocation succeeded in
fib_create_info(), but I have no idea on the maximal number of fib_info
a complex routing setup might need ?

I guess a typical machine needs less than 30 fib_info...

^ permalink raw reply

* [PATCH] ptp: use list_move instead of list_del/list_add
From: Wei Yongjun @ 2012-10-07 13:41 UTC (permalink / raw)
  To: linux-net-drivers, bhutchings; +Cc: yongjun_wei, netdev

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Using list_move() instead of list_del() + list_add().

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/net/ethernet/sfc/ptp.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
index 5b3dd02..0767043f 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -640,8 +640,7 @@ static void efx_ptp_drop_time_expired_events(struct efx_nic *efx)
 			evt = list_entry(cursor, struct efx_ptp_event_rx,
 					 link);
 			if (time_after(jiffies, evt->expiry)) {
-				list_del(&evt->link);
-				list_add(&evt->link, &ptp->evt_free_list);
+				list_move(&evt->link, &ptp->evt_free_list);
 				netif_warn(efx, hw, efx->net_dev,
 					   "PTP rx event dropped\n");
 			}
@@ -684,8 +683,7 @@ static enum ptp_packet_state efx_ptp_match_rx(struct efx_nic *efx,
 
 			match->state = PTP_PACKET_STATE_MATCHED;
 			rc = PTP_PACKET_STATE_MATCHED;
-			list_del(&evt->link);
-			list_add(&evt->link, &ptp->evt_free_list);
+			list_move(&evt->link, &ptp->evt_free_list);
 			break;
 		}
 	}
@@ -820,8 +818,7 @@ static int efx_ptp_stop(struct efx_nic *efx)
 	/* Drop any pending receive events */
 	spin_lock_bh(&efx->ptp_data->evt_lock);
 	list_for_each_safe(cursor, next, &efx->ptp_data->evt_list) {
-		list_del(cursor);
-		list_add(cursor, &efx->ptp_data->evt_free_list);
+		list_move(cursor, &efx->ptp_data->evt_free_list);
 	}
 	spin_unlock_bh(&efx->ptp_data->evt_lock);
 

^ permalink raw reply related

* [PATCH] openvswitch: using nla_for_each_X to simplify the code
From: Wei Yongjun @ 2012-10-07 13:42 UTC (permalink / raw)
  To: jesse-l0M0P4e3n4LQT0dZR+AlfA, davem-fT/PcQaiUtIeIZ0/mPfg9Q
  Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA,
	yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY

From: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>

Using nla_for_each_nested() or nla_for_each_attr()
to simplify the code.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
---
 net/openvswitch/actions.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
index 0811447..b67594f 100644
--- a/net/openvswitch/actions.c
+++ b/net/openvswitch/actions.c
@@ -288,8 +288,7 @@ static int output_userspace(struct datapath *dp, struct sk_buff *skb,
 	upcall.userdata = NULL;
 	upcall.portid = 0;
 
-	for (a = nla_data(attr), rem = nla_len(attr); rem > 0;
-		 a = nla_next(a, &rem)) {
+	nla_for_each_nested(a, attr, rem) {
 		switch (nla_type(a)) {
 		case OVS_USERSPACE_ATTR_USERDATA:
 			upcall.userdata = a;
@@ -311,8 +310,7 @@ static int sample(struct datapath *dp, struct sk_buff *skb,
 	const struct nlattr *a;
 	int rem;
 
-	for (a = nla_data(attr), rem = nla_len(attr); rem > 0;
-		 a = nla_next(a, &rem)) {
+	nla_for_each_nested(a, attr, rem) {
 		switch (nla_type(a)) {
 		case OVS_SAMPLE_ATTR_PROBABILITY:
 			if (net_random() >= nla_get_u32(a))
@@ -371,8 +369,7 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb,
 	const struct nlattr *a;
 	int rem;
 
-	for (a = attr, rem = len; rem > 0;
-	     a = nla_next(a, &rem)) {
+	nla_for_each_attr(a, attr, len, rem) {
 		int err = 0;
 
 		if (prev_port != -1) {

^ permalink raw reply related

* [PATCH] Fix PTP dependencies: explicitly select all the possible dependencies.
From: Haicheng Li @ 2012-10-07 14:14 UTC (permalink / raw)
  To: David Miller; +Cc: fengguang.wu, netdev, linux-kernel
In-Reply-To: <20121006.171748.734171045678392820.davem@davemloft.net>

Fengguang reported a kernel build failure as following:
drivers/built-in.o: In function `pch_gbe_ioctl':
pch_gbe_main.c:(.text+0x510370): undefined reference to `pch_ch_control_write'
pch_gbe_main.c:(.text+0x510393): undefined reference to `pch_ch_control_write'
pch_gbe_main.c:(.text+0x5103b3): undefined reference to `pch_ch_control_write'
...

It's a regression by commit da1586461. The root cause is that
the CONFIG_PPS is not set there, consequently CONFIG_PTP_1588_CLOCK
can not be set anyway, which finally causes ptp_pch and pch_gbe_main
build failures.

As David prefers to use *select* to fix such module co-dependency issues,
this patch explicitly selects all the possible dependencies of PCH_PTP.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reviewed-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Haicheng Li <haicheng.lee@gmail.com>
---
  drivers/net/ethernet/oki-semi/pch_gbe/Kconfig |    3 +++
  1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig 
b/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig
index 9730241..5296cc8 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig
@@ -26,6 +26,9 @@ if PCH_GBE
  config PCH_PTP
  	bool "PCH PTP clock support"
  	default n
+	depends on EXPERIMENTAL
+	select PPS
+	select PTP_1588_CLOCK
  	select PTP_1588_CLOCK_PCH
  	---help---
  	  Say Y here if you want to use Precision Time Protocol (PTP) in the
-- 
1.7.1

^ permalink raw reply related

* Re: [Patch net-next] netpoll: call ->ndo_select_queue() in tx path
From: Cong Wang @ 2012-10-07 14:34 UTC (permalink / raw)
  To: Sylvain Munaut; +Cc: David Miller, netdev, edumazet
In-Reply-To: <CAF6-1L5Gp9kpV+Koru6uAmYxQg_WQav9RVD4MVBDa2UGSoPOCA@mail.gmail.com>

On Wed, 2012-10-03 at 11:33 +0200, Sylvain Munaut wrote:
> Hi,
> 

Hi, Sylvain

> 
> Huh, I don't see it in the final 3.6 ?
> That's rather inconvenient :(
> 

We can backport it to 3.6 stable if you request. :)

Thanks.

^ permalink raw reply

* Re: [PATCH] flexcan: disable bus error interrupts for the i.MX28
From: Wolfgang Grandegger @ 2012-10-07 14:48 UTC (permalink / raw)
  To: Shawn Guo; +Cc: Linux Netdev List, Linux-CAN, Hui Wang, Dong Aisheng
In-Reply-To: <20121007030858.GJ20231@S2101-09.ap.freescale.net>

On 10/07/2012 05:09 AM, Shawn Guo wrote:
> On Fri, Sep 28, 2012 at 03:17:15PM +0200, Wolfgang Grandegger wrote:
>> Due to a bug in most Flexcan cores, the bus error interrupt needs
>> to be enabled. Otherwise we don't get any error warning or passive
>> interrupts. This is _not_ necessay for the i.MX28 and this patch
>> disables bus error interrupts if "berr-reporting" is not requested.
>> This avoids bus error flooding, which might harm, especially on
>> low-end systems.
>>
>> To handle such quirks of the Flexcan cores, a hardware feature flag
>> has been introduced, also replacing the "hw_ver" variable. So far
>> nobody could tell what Flexcan core version is available on what
>> Freescale SOC, apart from the i.MX6Q and P1010, and which bugs or
>> features are present on the various "hw_rev".
>>
>> CC: Hui Wang <jason77.wang@gmail.com>
>> CC: Shawn Guo <shawn.guo@linaro.org>
>> Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
>> ---
>>
>> Concerning the bug, I know that the i.MX35 does have it. Maybe other
>> Flexcan cores than on the i.MX28 does *not* have it either. If you
>> have a chance, please check on the P1010, i.MX6Q, i.MX51, i.MX53,
>> etc.
> 
>>From what I can tell, i.MX35, i.MX51 and i.MX53 use the same version,
> so they should all have the bug.  And for i.MX6Q, since it uses a newer
> version even than i.MX28, I would believe it's affected by the bug.
> But I'm copying Dong who should have better knowledge about this to
> confirm. 

Thank for clarification. I have a i.MX6Q board but without CAN adapter
:(, unfortunately. Otherwise I would try it out myself.

Wolfgang.

>>  drivers/net/can/flexcan.c |   29 +++++++++++++++++++----------
>>  1 files changed, 19 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
>> index c5f1431..c78ecfc 100644
>> --- a/drivers/net/can/flexcan.c
>> +++ b/drivers/net/can/flexcan.c
>> @@ -144,6 +144,10 @@
>>  
>>  #define FLEXCAN_MB_CODE_MASK		(0xf0ffffff)
>>  
>> +/* FLEXCAN hardware feature flags */
>> +#define FLEXCAN_HAS_V10_FEATURES	BIT(1) /* For core version >= 10 */
>> +#define FLEXCAN_HAS_BROKEN_ERR_STATE	BIT(2) /* Broken error state handling */
>> +
>>  /* Structure of the message buffer */
>>  struct flexcan_mb {
>>  	u32 can_ctrl;
>> @@ -178,7 +182,7 @@ struct flexcan_regs {
>>  };
>>  
>>  struct flexcan_devtype_data {
>> -	u32 hw_ver;	/* hardware controller version */
>> +	u32 features;	/* hardware controller features */
>>  };
>>  
>>  struct flexcan_priv {
>> @@ -197,11 +201,11 @@ struct flexcan_priv {
>>  };
>>  
>>  static struct flexcan_devtype_data fsl_p1010_devtype_data = {
>> -	.hw_ver = 3,
>> +	.features = FLEXCAN_HAS_BROKEN_ERR_STATE,
>>  };
>> -
>> +static struct flexcan_devtype_data fsl_imx28_devtype_data;
>>  static struct flexcan_devtype_data fsl_imx6q_devtype_data = {
>> -	.hw_ver = 10,
>> +	.features = FLEXCAN_HAS_V10_FEATURES | FLEXCAN_HAS_BROKEN_ERR_STATE,
>>  };
>>  
>>  static const struct can_bittiming_const flexcan_bittiming_const = {
>> @@ -741,15 +745,19 @@ static int flexcan_chip_start(struct net_device *dev)
>>  	 * enable tx and rx warning interrupt
>>  	 * enable bus off interrupt
>>  	 * (== FLEXCAN_CTRL_ERR_STATE)
>> -	 *
>> -	 * _note_: we enable the "error interrupt"
>> -	 * (FLEXCAN_CTRL_ERR_MSK), too. Otherwise we don't get any
>> -	 * warning or bus passive interrupts.
>>  	 */
>>  	reg_ctrl = flexcan_read(&regs->ctrl);
>>  	reg_ctrl &= ~FLEXCAN_CTRL_TSYN;
>>  	reg_ctrl |= FLEXCAN_CTRL_BOFF_REC | FLEXCAN_CTRL_LBUF |
>> -		FLEXCAN_CTRL_ERR_STATE | FLEXCAN_CTRL_ERR_MSK;
>> +		FLEXCAN_CTRL_ERR_STATE;
>> +	/*
>> +	 * enable the "error interrupt" (FLEXCAN_CTRL_ERR_MSK),
>> +	 * on most Flexcan cores, too. Otherwise we don't get
>> +	 * any error warning or passive interrupts.
>> +	 */
>> +	if (priv->devtype_data->features & FLEXCAN_HAS_BROKEN_ERR_STATE ||
>> +	    priv->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING)
>> +		reg_ctrl |= FLEXCAN_CTRL_ERR_MSK;
>>  
>>  	/* save for later use */
>>  	priv->reg_ctrl_default = reg_ctrl;
>> @@ -772,7 +780,7 @@ static int flexcan_chip_start(struct net_device *dev)
>>  	flexcan_write(0x0, &regs->rx14mask);
>>  	flexcan_write(0x0, &regs->rx15mask);
>>  
>> -	if (priv->devtype_data->hw_ver >= 10)
>> +	if (priv->devtype_data->features & FLEXCAN_HAS_V10_FEATURES)
>>  		flexcan_write(0x0, &regs->rxfgmask);
>>  
>>  	flexcan_transceiver_switch(priv, 1);
>> @@ -954,6 +962,7 @@ static void __devexit unregister_flexcandev(struct net_device *dev)
>>  
>>  static const struct of_device_id flexcan_of_match[] = {
>>  	{ .compatible = "fsl,p1010-flexcan", .data = &fsl_p1010_devtype_data, },
>> +	{ .compatible = "fsl,imx28-flexcan", .data = &fsl_imx28_devtype_data, },
>>  	{ .compatible = "fsl,imx6q-flexcan", .data = &fsl_imx6q_devtype_data, },
>>  	{ /* sentinel */ },
>>  };
>> -- 
>> 1.7.7.6
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-can" 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: [STABLE][3.0][3.2][Add PATCH] phy/fixed: use an unique MDIO bus name
From: Ben Hutchings @ 2012-10-07 15:33 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, stable, Greg Kroah-Hartman, Florian Fainelli,
	David S. Miller, netdev
In-Reply-To: <1349441987.6755.45.camel@gandalf.local.home>

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

On Fri, 2012-10-05 at 08:59 -0400, Steven Rostedt wrote:
> I started testing my 3.2-rt branch on a powerpc box and it would
> constantly spit out the following warning causing ktest to think the
> boot failed:
> 
> sysfs: cannot create duplicate filename '/class/mdio_bus/0
[...]
> Doing some investigations, I found it only triggered on some configs,
> and it was fixed by 3.3. I ran a ktest.pl reverse bisect (bad is good
> and good is bad) and it ended on this commit:
> 
> commit 9e6c643bb4502c50b6511206601b7760c610dfcc
> Author: Florian Fainelli <florian@openwrt.org>
> Date:   Mon Jan 9 23:59:25 2012 +0000
> 
>     phy/fixed: use an unique MDIO bus name.
>     
>     Signed-off-by: Florian Fainelli <florian@openwrt.org>
>     Signed-off-by: David S. Miller <davem@davemloft.net>
>
> diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c
> index 1fa4d73..633680d 100644
> --- a/drivers/net/phy/fixed.c
> +++ b/drivers/net/phy/fixed.c
> @@ -220,7 +220,7 @@ static int __init fixed_mdio_bus_init(void)
>                 goto err_mdiobus_reg;
>         }
>  
> -       snprintf(fmb->mii_bus->id, MII_BUS_ID_SIZE, "0");
> +       snprintf(fmb->mii_bus->id, MII_BUS_ID_SIZE, "fixed-0");
>         fmb->mii_bus->name = "Fixed MDIO Bus";
>         fmb->mii_bus->priv = fmb;
>         fmb->mii_bus->parent = &pdev->dev;
> 
> Sure enough, adding this patch to both 3.2 and 3.0 fixed the bug.
> 
> Please pull this patch into the 3.2 and 3.0 stable trees.

Networking stable fixes are normally vetted, backported and bundled up
by David, so I'll let him decide on this.

There are a lot more MDIO bus drivers that don't play nicely with
others, most of which seem to be fixed in mainline.  If David agrees
that these are generally worthwhile then perhaps someone could try to
gather those up?

Ben.

-- 
Ben Hutchings
You can't have everything.  Where would you put it?

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply

* Re: [PATCH net 3/6] ipv4: add check if nh_pcpu_rth_output is allocated
From: Julian Anastasov @ 2012-10-07 17:24 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev
In-Reply-To: <1349616863.21172.2376.camel@edumazet-glaptop>


	Hello,

On Sun, 7 Oct 2012, Eric Dumazet wrote:

> On Sun, 2012-10-07 at 14:26 +0300, Julian Anastasov wrote:
> > 	Avoid NULL ptr dereference and caching if
> > nh_pcpu_rth_output is not allocated.
> > 
> > Signed-off-by: Julian Anastasov <ja@ssi.bg>
> > ---
> >  net/ipv4/route.c |   12 +++++++++---
> >  1 files changed, 9 insertions(+), 3 deletions(-)
> > 
> > diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> > index 488a8bb..0a600cc 100644
> > --- a/net/ipv4/route.c
> > +++ b/net/ipv4/route.c
> > @@ -1798,18 +1798,24 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
> >  	fnhe = NULL;
> >  	if (fi) {
> >  		struct rtable __rcu **prth;
> > +		struct fib_nh *nh = &FIB_RES_NH(*res);
> >  
> > -		fnhe = find_exception(&FIB_RES_NH(*res), fl4->daddr);
> > +		fnhe = find_exception(nh, fl4->daddr);
> >  		if (fnhe)
> >  			prth = &fnhe->fnhe_rth;
> > -		else
> > -			prth = __this_cpu_ptr(FIB_RES_NH(*res).nh_pcpu_rth_output);
> > +		else {
> > +			if (!nh->nh_pcpu_rth_output)
> > +				goto add;
> > +			prth = __this_cpu_ptr(nh->nh_pcpu_rth_output);
> > +		}
> >  		rth = rcu_dereference(*prth);
> >  		if (rt_cache_valid(rth)) {
> >  			dst_hold(&rth->dst);
> >  			return rth;
> >  		}
> >  	}
> > +
> > +add:
> >  	rth = rt_dst_alloc(dev_out,
> >  			   IN_DEV_CONF_GET(in_dev, NOPOLICY),
> >  			   IN_DEV_CONF_GET(in_dev, NOXFRM),
> 
> Alternative would be to make sure the allocation succeeded in
> fib_create_info(), but I have no idea on the maximal number of fib_info
> a complex routing setup might need ?

	I too preferred not to touch there because I don't
know how much we can want from alloc_percpu.

> I guess a typical machine needs less than 30 fib_info...

	May be, I guess it all depends on the present primary
addresses, gateways and devices. Thousands of routes 
do not look so scary because they will use small number
of fib_infos.

	But it is a problem that we allocate memory
that may never be used, there is no chance to expire it.
Not sure how good is the idea to create fib_infos without
percpu allocations and the first traffic to notify some
thread to attach such arrays? We can safe memory if the
local/broadcast fib_infos are not used for output routes.
But such idea will cost many checks in fast path.
Another hack could be to use 1 entry for local/broadcast/mcast
and array for unicast. Type RTN_BROADCAST is actually not
cached at all, so we do not need to allocate array.

Regards

--
Julian Anastasov <ja@ssi.bg>

^ permalink raw reply

* Re: [PATCH] openvswitch: using nla_for_each_X to simplify the code
From: Jesse Gross @ 2012-10-07 18:30 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: davem, yongjun_wei, dev, netdev
In-Reply-To: <CAPgLHd8hY-nZWaG-meEk1MtY5Rj_26Lj1bxH=jtn20jxni+U8g@mail.gmail.com>

On Sun, Oct 7, 2012 at 6:42 AM, Wei Yongjun <weiyj.lk@gmail.com> wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Using nla_for_each_nested() or nla_for_each_attr()
> to simplify the code.
>
> dpatch engine is used to auto generate this patch.
> (https://github.com/weiyj/dpatch)
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

It is done this way intentionally to avoid checks on the fast path for
conditions that have already been validated.

^ permalink raw reply

* Re: [PATCH] openvswitch: using nla_for_each_X to simplify the code
From: David Miller @ 2012-10-07 18:33 UTC (permalink / raw)
  To: jesse-l0M0P4e3n4LQT0dZR+AlfA
  Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA,
	yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY,
	weiyj.lk-Re5JQEeQqe8AvxtiuMwx3w
In-Reply-To: <CAEP_g=_D1m+p0POKC5ozFEgfEhGzN9G_+Yja_iBz4guuRe6Nog-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

From: Jesse Gross <jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
Date: Sun, 7 Oct 2012 11:30:51 -0700

> On Sun, Oct 7, 2012 at 6:42 AM, Wei Yongjun <weiyj.lk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> From: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
>>
>> Using nla_for_each_nested() or nla_for_each_attr()
>> to simplify the code.
>>
>> dpatch engine is used to auto generate this patch.
>> (https://github.com/weiyj/dpatch)
>>
>> Signed-off-by: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
> 
> It is done this way intentionally to avoid checks on the fast path for
> conditions that have already been validated.

Agreed, I'm not applying this patch.

^ permalink raw reply

* Re: [PATCH 1/20 V2] drivers/net/ethernet/dec/tulip/dmfe.c: fix error return code
From: David Miller @ 2012-10-07 18:37 UTC (permalink / raw)
  To: peter.senna; +Cc: grundler, netdev, linux-kernel, kernel-janitors
In-Reply-To: <1349469667-6137-1-git-send-email-peter.senna@gmail.com>


Applied.

^ permalink raw reply

* Re: [PATCH 2/20 V2] drivers/net/ethernet/natsemi/natsemi.c: fix error return code
From: David Miller @ 2012-10-07 18:38 UTC (permalink / raw)
  To: peter.senna
  Cc: romieu, rick.jones2, netdev, netdev, linux-kernel,
	kernel-janitors
In-Reply-To: <1349469667-6137-2-git-send-email-peter.senna@gmail.com>


Applied.

^ permalink raw reply

* Re: [PATCH 3/20 V2] drivers/net/can/sja1000/peak_pci.c: fix error return code
From: David Miller @ 2012-10-07 18:38 UTC (permalink / raw)
  To: peter.senna; +Cc: wg, mkl, jj, linux-can, netdev, linux-kernel, kernel-janitors
In-Reply-To: <1349469667-6137-3-git-send-email-peter.senna@gmail.com>


This patch was already in the tree.


^ permalink raw reply

* Re: [PATCH 4/20 V2] drivers/net/can/sja1000/peak_pcmcia.c: fix error return code
From: David Miller @ 2012-10-07 18:38 UTC (permalink / raw)
  To: peter.senna
  Cc: wg, mkl, linux, linux-can, netdev, linux-kernel, kernel-janitors
In-Reply-To: <1349469667-6137-4-git-send-email-peter.senna@gmail.com>


This patch was already in the tree.

^ permalink raw reply

* Re: [PATCH 5/20 V2] drivers/net/ethernet/sis/sis900.c: fix error return code
From: David Miller @ 2012-10-07 18:38 UTC (permalink / raw)
  To: peter.senna; +Cc: venza, netdev, linux-kernel, kernel-janitors
In-Reply-To: <1349469667-6137-5-git-send-email-peter.senna@gmail.com>


Applied.

^ permalink raw reply

* Re: [PATCH 6/20 V2] drivers/net/irda/irtty-sir.c: fix error return code
From: David Miller @ 2012-10-07 18:38 UTC (permalink / raw)
  To: peter.senna; +Cc: samuel, irda-users, netdev, linux-kernel, kernel-janitors
In-Reply-To: <1349472786-10921-2-git-send-email-peter.senna@gmail.com>


Applied.

^ permalink raw reply

* Re: [PATCH 7/20 V2] drivers/net/irda/mcs7780.c: fix error return code
From: David Miller @ 2012-10-07 18:38 UTC (permalink / raw)
  To: peter.senna; +Cc: samuel, irda-users, netdev, linux-kernel, kernel-janitors
In-Reply-To: <1349472786-10921-3-git-send-email-peter.senna@gmail.com>


Applied.

^ permalink raw reply

* Re: [PATCH 8/20 V2] drivers/net/irda/pxaficp_ir.c: fix error return code
From: David Miller @ 2012-10-07 18:38 UTC (permalink / raw)
  To: peter.senna-Re5JQEeQqe8AvxtiuMwx3w
  Cc: irda-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	samuel-jcdQHdrhKHMdnm+yROfE0A,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1349472786-10921-4-git-send-email-peter.senna-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>


Applied.

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev

^ permalink raw reply

* Re: [PATCH 9/20 V2] drivers/net/irda/sa1100_ir.c: fix error return code
From: David Miller @ 2012-10-07 18:38 UTC (permalink / raw)
  To: peter.senna-Re5JQEeQqe8AvxtiuMwx3w
  Cc: irda-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	samuel-jcdQHdrhKHMdnm+yROfE0A,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1349472786-10921-5-git-send-email-peter.senna-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>


Applied.

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev

^ permalink raw reply

* Re: [PATCH 10/20 V2] drivers/net/irda/sh_irda.c: fix error return code
From: David Miller @ 2012-10-07 18:38 UTC (permalink / raw)
  To: peter.senna-Re5JQEeQqe8AvxtiuMwx3w
  Cc: irda-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	samuel-jcdQHdrhKHMdnm+yROfE0A,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1349472786-10921-1-git-send-email-peter.senna-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>


Applied.

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev

^ permalink raw reply

* Re: [PATCH 11/20 V2] drivers/net/irda/sh_sir.c: fix error return code
From: David Miller @ 2012-10-07 18:38 UTC (permalink / raw)
  To: peter.senna-Re5JQEeQqe8AvxtiuMwx3w
  Cc: irda-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	samuel-jcdQHdrhKHMdnm+yROfE0A,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1349475053-11464-1-git-send-email-peter.senna-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>


Applied.

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev

^ permalink raw reply

* Re: [PATCH 12/20 V2] drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c: fix error return code
From: David Miller @ 2012-10-07 18:38 UTC (permalink / raw)
  To: peter.senna
  Cc: jitendra.kalsaria, sony.chacko, linux-driver, netdev,
	linux-kernel, kernel-janitors
In-Reply-To: <1349475053-11464-2-git-send-email-peter.senna@gmail.com>


Applied.

^ permalink raw reply

* Re: [PATCH 13/20 V2] drivers/net/ethernet/amd/amd8111e.c: fix error return code
From: David Miller @ 2012-10-07 18:39 UTC (permalink / raw)
  To: peter.senna
  Cc: joe, dhowells, rick.jones2, netdev, netdev, linux-kernel,
	kernel-janitors
In-Reply-To: <1349475053-11464-3-git-send-email-peter.senna@gmail.com>


Applied.

^ 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