* Re: [PATCH v3 3/5] usbnet: smsc95xx: fix memory leak in smsc95xx_suspend
From: Steve Glendinning @ 2012-11-06 13:58 UTC (permalink / raw)
To: Ming Lei
Cc: David S. Miller, Greg Kroah-Hartman, Oliver Neukum, netdev,
linux-usb, Steve Glendinning
In-Reply-To: <CACVXFVPhYaBcr+V4W1-fSrLFVMMVo8vUv=eaKu2y_LjZ-EtnwQ@mail.gmail.com>
> BTW, I just saw the smsc95xx datasheet and the vendor's driver
> source code, and found the chip supports runtime PM well
> (remote wakeup on 'good packet' or link change), so do you
> plan to implement that?
Yes, I do plan to implement this. Note that this feature is only
supported on some product variants, for example LAN9500A, so it won't
benefit all smsc95xx users.
^ permalink raw reply
* [PATCH v4 net-next] bonding: extend bond_arp_send_all to bridge devices
From: Chris J Arges @ 2012-11-06 13:56 UTC (permalink / raw)
To: Jay Vosburgh, Andy Gospodarek; +Cc: netdev, linux-kernel, Chris J Arges
ARP monitoring does not work when we have a network in the
following configuration:
eth0----+ +----bond0.100----br0-100---{+virtual machines
| |
+----bond0----+----br0---(fixed IP)->--{LAN arp_ip_target}
| |
eth1----+ +----bond0.200----br0-200---{+virtual machines
This patch extends bond_arp_send_all to check if a device
is also in a bridge.
This is related to the following issues:
http://launchpad.net/bugs/736226
http://bugzilla.kernel.org/show_bug.cgi?id=31822
Thanks to help from Andy Gospodarek <andy@greyhouse.net>.
Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
---
drivers/net/bonding/bond_main.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index b2530b0..62931b0 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2708,6 +2708,14 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
continue;
}
+ /* Check if the target is part of a bridge.
+ */
+ if (rt->dst.dev->priv_flags & IFF_EBRIDGE) {
+ addr = bond_confirm_addr(rt->dst.dev, targets[i], 0);
+ bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i], addr, 0);
+ continue;
+ }
+
if (net_ratelimit()) {
pr_warning("%s: no path to arp_ip_target %pI4 via rt.dev %s\n",
bond->dev->name, &targets[i],
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH v3 net-next] bonding: extend bond_arp_send_all to bridge devices
From: Chris J Arges @ 2012-11-06 13:56 UTC (permalink / raw)
To: Jay Vosburgh; +Cc: Andy Gospodarek, netdev, linux-kernel
In-Reply-To: <26061.1352155545@death.nxdomain>
On 11/05/2012 04:45 PM, Jay Vosburgh wrote:
> Chris J Arges <chris.j.arges@canonical.com> wrote:
>
>> ARP monitoring does not work when we have a network in the
>> following configuration:
>>
>> eth0----+ +----bond0.100----br0-100---{+virtual machines
>> | |
>> +----bond0----+----br0---(fixed IP)->--{LAN arp_ip_target}
>> | |
>> eth1----+ +----bond0.200----br0-200---{+virtual machines
>>
>> This patch extends bond_arp_send_all to check if a device
>> is also in a bridge.
>>
>> This is related to the following issues:
>> http://launchpad.net/bugs/736226
>> http://bugzilla.kernel.org/show_bug.cgi?id=31822
>>
>> Thanks to help from Andy Gospodarek <andy@greyhouse.net>.
>>
>> Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
>
> What has changed that you're up to version 3 now?
Had (user) issues with git send-email, and wanted to send a clean patch.
Sorry about that.
>
>> drivers/net/bonding/bond_main.c | 12 ++++++++++++
>> 1 file changed, 12 insertions(+)
>>
>> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>> index b2530b0..cb791f6 100644
>> --- a/drivers/net/bonding/bond_main.c
>> +++ b/drivers/net/bonding/bond_main.c
>> @@ -2708,6 +2708,18 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
>> continue;
>> }
>>
>> + /*
>> + * Check if the target is part of a bridge.
>> + */
>
> /* Comment should be formatted like this.
> */
>
>> + if (rt->dst.dev->priv_flags & IFF_EBRIDGE) {
>> + /* Confirm addr is part of the bridge */
>> + addr = bond_confirm_addr(rt->dst.dev, targets[i], 0);
>> +
>> + /* Send ARP request */
>
> I think this comment is unnecessary.
>
> -J
>
>> + bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i], addr, 0);
>> + continue;
>> + }
>> +
Great, sending v4 soon with these changes.
--chris j arges
>> if (net_ratelimit()) {
>> pr_warning("%s: no path to arp_ip_target %pI4 via rt.dev %s\n",
>> bond->dev->name, &targets[i],
>> --
>> 1.7.9.5
>>
>
> ---
> -Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com
>
^ permalink raw reply
* Re: [PATCH v3 3/5] usbnet: smsc95xx: fix memory leak in smsc95xx_suspend
From: Ming Lei @ 2012-11-06 13:51 UTC (permalink / raw)
To: Steve Glendinning
Cc: David S. Miller, Greg Kroah-Hartman, Oliver Neukum, netdev,
linux-usb, Steve Glendinning
In-Reply-To: <CAKh2mn52HCFE8JSRJZ95m8qimPP0d4hx8SP3yExTsi+RYfJwRg@mail.gmail.com>
On Tue, Nov 6, 2012 at 9:20 PM, Steve Glendinning <steve@shawell.net> wrote:
> On 6 November 2012 01:45, Ming Lei <ming.lei@canonical.com> wrote:
>> This patch fixes memory leak in smsc95xx_suspend.
>
> Good spot, thanks!
>
> Note that check_warn_return just above your kfree can cause early
> return in the error case, which would still leak filter_mask, so we
> might want to explicitly expand that instance of the helper macro.
OK, will update the patch.
BTW, I just saw the smsc95xx datasheet and the vendor's driver
source code, and found the chip supports runtime PM well
(remote wakeup on 'good packet' or link change), so do you
plan to implement that?
Thanks,
--
Ming Lei
^ permalink raw reply
* [PATCH net] cxgb4: Initialize data structures before using.
From: Vipul Pandya @ 2012-11-06 13:37 UTC (permalink / raw)
To: netdev; +Cc: davem, divy, dm, Vipul Pandya, Jay Hernandez
We should not assume reserve fields to be don't cares as fields may change.
Clearing data structures before using.
Signed-off-by: Jay Hernandez <jay@chelsio.com>
Signed-off-by: Vipul Pandya <vipul@chelsio.com>
---
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
index 32eec15..01fa5b7 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
@@ -2519,6 +2519,7 @@ int t4_fw_bye(struct adapter *adap, unsigned int mbox)
{
struct fw_bye_cmd c;
+ memset(&c, 0, sizeof(c));
INIT_CMD(c, BYE, WRITE);
return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL);
}
@@ -2535,6 +2536,7 @@ int t4_early_init(struct adapter *adap, unsigned int mbox)
{
struct fw_initialize_cmd c;
+ memset(&c, 0, sizeof(c));
INIT_CMD(c, INITIALIZE, WRITE);
return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL);
}
@@ -2551,6 +2553,7 @@ int t4_fw_reset(struct adapter *adap, unsigned int mbox, int reset)
{
struct fw_reset_cmd c;
+ memset(&c, 0, sizeof(c));
INIT_CMD(c, RESET, WRITE);
c.val = htonl(reset);
return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL);
@@ -3278,6 +3281,7 @@ int t4_identify_port(struct adapter *adap, unsigned int mbox, unsigned int viid,
{
struct fw_vi_enable_cmd c;
+ memset(&c, 0, sizeof(c));
c.op_to_viid = htonl(FW_CMD_OP(FW_VI_ENABLE_CMD) | FW_CMD_REQUEST |
FW_CMD_EXEC | FW_VI_ENABLE_CMD_VIID(viid));
c.ien_to_len16 = htonl(FW_VI_ENABLE_CMD_LED | FW_LEN16(c));
--
1.7.1
^ permalink raw reply related
* Re: [PATCH 3/7] ARM: OMAP3+: hwmod: Add AM33XX HWMOD data for davinci_mdio module
From: Mugunthan V N @ 2012-11-06 13:30 UTC (permalink / raw)
To: Bedia, Vaibhav
Cc: netdev@vger.kernel.org, Richard Cochran, Paul Walmsley,
devicetree-discuss@lists.ozlabs.org, Hiremath, Vaibhav,
linux-omap@vger.kernel.org, davem@davemloft.net,
linux-arm-kernel@lists.infradead.org
In-Reply-To: <B5906170F1614E41A8A28DE3B8D121433EC049CC@DBDE01.ent.ti.com>
On 11/6/2012 3:39 PM, Bedia, Vaibhav wrote:
> On Tue, Nov 06, 2012 at 13:42:21, N, Mugunthan V wrote:
> [...]
>> +struct omap_hwmod_addr_space am33xx_mdio_addr_space[] = {
>> + {
>> + .pa_start = 0x4A101000,
>> + .pa_end = 0x4A101000 + SZ_256 - 1,
>> + .flags = ADDR_MAP_ON_INIT,
> Based on the recent discussions and looking the hwmod code,
> I guess ADDR_MAP_ON_INIT does not make sense here. Since you
> are just creating a parent-child relationship here, maybe no
> flag is needed?
Will remove this flag as it is a parrent-child relationship
>
>> + },
>> + { }
>> +};
>> +
>> +struct omap_hwmod_ocp_if am33xx_cpgmac0__mdio = {
>> + .master = &am33xx_cpgmac0_hwmod,
>> + .slave = &am33xx_mdio_hwmod,
>> + .addr = am33xx_mdio_addr_space,
>> + .user = OCP_USER_MPU,
> Is this flag necessary? Shouldn't you just skip the
> user field since there's nothing for the hwmod code
> to do here?
This flag is necessary as MPU is going to access to device.
The patch will look like
@@ -2501,6 +2516,21 @@ static struct omap_hwmod_ocp_if
am33xx_l4_hs__cpgmac0 = {
.user = OCP_USER_MPU,
};
+struct omap_hwmod_addr_space am33xx_mdio_addr_space[] = {
+ {
+ .pa_start = 0x4A101000,
+ .pa_end = 0x4A101000 + SZ_256 - 1,
+ },
+ { }
+};
+
+struct omap_hwmod_ocp_if am33xx_cpgmac0__mdio = {
+ .master = &am33xx_cpgmac0_hwmod,
+ .slave = &am33xx_mdio_hwmod,
+ .addr = am33xx_mdio_addr_space,
+ .user = OCP_USER_MPU,
+};
+
static struct omap_hwmod_addr_space am33xx_elm_addr_space[] = {
{
.pa_start = 0x48080000,
Regards
Mugunthan V N
^ permalink raw reply
* Re: [PATCH v3 3/5] usbnet: smsc95xx: fix memory leak in smsc95xx_suspend
From: Steve Glendinning @ 2012-11-06 13:20 UTC (permalink / raw)
To: Ming Lei
Cc: David S. Miller, Greg Kroah-Hartman, Oliver Neukum, netdev,
linux-usb-u79uwXL29TY76Z2rM5mHXA, Steve Glendinning
In-Reply-To: <1352166341-27616-4-git-send-email-ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
On 6 November 2012 01:45, Ming Lei <ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org> wrote:
> This patch fixes memory leak in smsc95xx_suspend.
Good spot, thanks!
Note that check_warn_return just above your kfree can cause early
return in the error case, which would still leak filter_mask, so we
might want to explicitly expand that instance of the helper macro.
> Also, it isn't necessary to bother mm to allocate 8bytes/16byte,
> and we can use stack variable safely.
Acked-By: Steve Glendinning <steve.glendinning-nksJyM/082jR7s880joybQ@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH v2 00/11] introduce random32_get_bytes() and random32_get_bytes_state()
From: Akinobu Mita @ 2012-11-06 13:04 UTC (permalink / raw)
To: David Laight
Cc: Valdis.Kletnieks, linux-kernel, akpm, Theodore Ts'o,
Artem Bityutskiy, Adrian Hunter, David Woodhouse, linux-mtd,
Eilon Greenstein, netdev, Robert Love, devel, Michel Lespinasse
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6026B7094@saturn3.aculab.com>
2012/11/6 David Laight <David.Laight@aculab.com>:
>> On Sun, 04 Nov 2012 00:43:31 +0900, Akinobu Mita said:
>> > This patchset introduces new functions into random32 library for
>> > getting the requested number of pseudo-random bytes.
>> >
>> > Before introducing these new functions into random32 library,
>> > prandom32() and prandom32_seed() with "prandom32" prefix are
>> > renamed to random32_state() and srandom32_state() respectively.
>> >
>> > The purpose of this renaming is to prevent some kernel developers
>> > from assuming that prandom32() and random32() might imply that only
>> > prandom32() was the one using a pseudo-random number generator by
>> > prandom32's "p", and the result may be a very embarassing security
>> > exposure.
>>
>> Out of curiosity, why the '32'? I'm just waiting for some kernel developer to
>> do something stupid with this on a 64-bit arch because they think it's a 32-bit API. ;)
>>
>> Should we bite the bullet and lose the 32, as long as we're churning the code *anyhow*?
>
> Also why remove the 'pseudo' part of the name?
> It is an important part of the name.
Thanks for the heads-up. Then, what is the ideal function name for
pseudo-random library?
I propose the following renaming, 'p' prefix is restored and '32' is
removed for not returning 32bit pseudo-random number functions.
void prandom_seed(u32 seed); /* rename from srandom32() */
u32 prandom32(void); /* rename from random32() */
void prandom_get_byte(void *buf, int bytes);
void prandom_seed_state(struct rnd_state *state, u64 seed);
/* rename from prandom32_seed() */
u32 prandom32_state(struct rnd_state *state); /* rename from prandom32() */
void prandom_get_byte_state(struct rnd_state *state, void *buf, int bytes);
^ permalink raw reply
* Re: [PATCH v2] af-packet: fix oops when socket is not present
From: Eric Dumazet @ 2012-11-06 12:42 UTC (permalink / raw)
To: Greg KH; +Cc: Eric Leblond, netdev, stable
In-Reply-To: <20121106122848.GB20904@kroah.com>
On Tue, 2012-11-06 at 13:28 +0100, Greg KH wrote:
> On Tue, Nov 06, 2012 at 01:10:10PM +0100, Eric Leblond wrote:
> > Due to a NULL dereference, the following patch is causing oops
> > in normal trafic condition:
> >
> > commit c0de08d04215031d68fa13af36f347a6cfa252ca
> > Author: Eric Leblond <eric@regit.org>
> > Date: Thu Aug 16 22:02:58 2012 +0000
> >
> > af_packet: don't emit packet on orig fanout group
> >
> > This buggy patch was a feature fix and has reached most stable
> > branches.
> >
> > When skb->sk is NULL and when packet fanout is used, there is a
> > crash in match_fanout_group where skb->sk is accessed.
> > This patch fixes the issue by returning false as soon as the
> > socket is NULL: this correspond to the wanted behavior because
> > the kernel as to resend the skb to all the listening socket in
> > this case.
> >
> > Signed-off-by: Eric Leblond <eric@regit.org>
> > ---
> > net/core/dev.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
>
> <formletter>
>
> This is not the correct way to submit patches for inclusion in the
> stable kernel tree. Please read Documentation/stable_kernel_rules.txt
> for how to do this properly.
>
> </formletter>
Right.
By the way, David Miller prefers to handle stable submissions himself.
So Eric, I guess you could just do nothing for this particular patch,
since your stable@vger.kernel.org addition in the CC will be void.
(Dont add the Cc: in the patch itself, as David will remove it anyway)
Thanks
^ permalink raw reply
* Re: [PATCH v2] af-packet: fix oops when socket is not present
From: Greg KH @ 2012-11-06 12:28 UTC (permalink / raw)
To: Eric Leblond; +Cc: netdev, stable
In-Reply-To: <1352203810-957-1-git-send-email-eric@regit.org>
On Tue, Nov 06, 2012 at 01:10:10PM +0100, Eric Leblond wrote:
> Due to a NULL dereference, the following patch is causing oops
> in normal trafic condition:
>
> commit c0de08d04215031d68fa13af36f347a6cfa252ca
> Author: Eric Leblond <eric@regit.org>
> Date: Thu Aug 16 22:02:58 2012 +0000
>
> af_packet: don't emit packet on orig fanout group
>
> This buggy patch was a feature fix and has reached most stable
> branches.
>
> When skb->sk is NULL and when packet fanout is used, there is a
> crash in match_fanout_group where skb->sk is accessed.
> This patch fixes the issue by returning false as soon as the
> socket is NULL: this correspond to the wanted behavior because
> the kernel as to resend the skb to all the listening socket in
> this case.
>
> Signed-off-by: Eric Leblond <eric@regit.org>
> ---
> net/core/dev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
<formletter>
This is not the correct way to submit patches for inclusion in the
stable kernel tree. Please read Documentation/stable_kernel_rules.txt
for how to do this properly.
</formletter>
^ permalink raw reply
* [PATCH v2] af-packet: fix oops when socket is not present
From: Eric Leblond @ 2012-11-06 12:10 UTC (permalink / raw)
To: netdev; +Cc: stable, Eric Leblond
In-Reply-To: <1352201642.3140.880.camel@edumazet-glaptop>
Due to a NULL dereference, the following patch is causing oops
in normal trafic condition:
commit c0de08d04215031d68fa13af36f347a6cfa252ca
Author: Eric Leblond <eric@regit.org>
Date: Thu Aug 16 22:02:58 2012 +0000
af_packet: don't emit packet on orig fanout group
This buggy patch was a feature fix and has reached most stable
branches.
When skb->sk is NULL and when packet fanout is used, there is a
crash in match_fanout_group where skb->sk is accessed.
This patch fixes the issue by returning false as soon as the
socket is NULL: this correspond to the wanted behavior because
the kernel as to resend the skb to all the listening socket in
this case.
Signed-off-by: Eric Leblond <eric@regit.org>
---
net/core/dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index b4978e2..83232a1 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1666,7 +1666,7 @@ static inline int deliver_skb(struct sk_buff *skb,
static inline bool skb_loop_sk(struct packet_type *ptype, struct sk_buff *skb)
{
- if (ptype->af_packet_priv == NULL)
+ if (!ptype->af_packet_priv || !skb->sk)
return false;
if (ptype->id_match)
--
1.7.10.4
^ permalink raw reply related
* [PATCH net-next] bonding: convert delay parameters to unsigned integers
From: Nikolay Aleksandrov @ 2012-11-06 11:52 UTC (permalink / raw)
To: netdev; +Cc: andy, fubar, davem
This patch converts the following parameters from int to unsigned int in order
to remove the unnecessary < 0 checks in the code and make it less error prone.
The functionality remains unchanged as before it wasn't allowed to have these
be less than zero too. Their maximum value was INT_MAX, now it will be UINT_MAX.
It also fixes how min_links parameter is treated since it is unsigned int
already but was treated as signed integer.
struct bond_params members:
updelay downdelay miimon arp_interval
The delay variable is initialized from updelay and downdelay parameters and
counted down to zero so it should never be < 0.
struct slave members:
delay
The change to struct ifbond's miimon parameter (s32 -> u32) will probably
affect some user-space software but it should be all right in 99 % of the
cases as I don't think anyone uses > INT_MAX for that.
Limited testing of this patch was done in VMs.
Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
---
drivers/net/bonding/bond_main.c | 92 +++++++--------------
drivers/net/bonding/bond_procfs.c | 10 +--
drivers/net/bonding/bond_sysfs.c | 169 ++++++++++++++++----------------------
drivers/net/bonding/bonding.h | 10 +--
include/uapi/linux/if_bonding.h | 2 +-
5 files changed, 114 insertions(+), 169 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index b2530b0..a6983e2 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -87,21 +87,21 @@
#define BOND_LINK_MON_INTERV 0
#define BOND_LINK_ARP_INTERV 0
-static int max_bonds = BOND_DEFAULT_MAX_BONDS;
+static unsigned int max_bonds = BOND_DEFAULT_MAX_BONDS;
static int tx_queues = BOND_DEFAULT_TX_QUEUES;
static int num_peer_notif = 1;
-static int miimon = BOND_LINK_MON_INTERV;
-static int updelay;
-static int downdelay;
+static unsigned int miimon = BOND_LINK_MON_INTERV;
+static unsigned int updelay;
+static unsigned int downdelay;
static int use_carrier = 1;
static char *mode;
static char *primary;
static char *primary_reselect;
static char *lacp_rate;
-static int min_links;
+static unsigned int min_links;
static char *ad_select;
static char *xmit_hash_policy;
-static int arp_interval = BOND_LINK_ARP_INTERV;
+static unsigned int arp_interval = BOND_LINK_ARP_INTERV;
static char *arp_ip_target[BOND_MAX_ARP_TARGETS];
static char *arp_validate;
static char *fail_over_mac;
@@ -109,7 +109,7 @@ static int all_slaves_active = 0;
static struct bond_params bonding_defaults;
static int resend_igmp = BOND_DEFAULT_RESEND_IGMP;
-module_param(max_bonds, int, 0);
+module_param(max_bonds, uint, 0);
MODULE_PARM_DESC(max_bonds, "Max number of bonded devices");
module_param(tx_queues, int, 0);
MODULE_PARM_DESC(tx_queues, "Max number of transmit queues (default = 16)");
@@ -119,11 +119,11 @@ MODULE_PARM_DESC(num_grat_arp, "Number of peer notifications to send on "
module_param_named(num_unsol_na, num_peer_notif, int, 0644);
MODULE_PARM_DESC(num_unsol_na, "Number of peer notifications to send on "
"failover event (alias of num_grat_arp)");
-module_param(miimon, int, 0);
+module_param(miimon, uint, 0);
MODULE_PARM_DESC(miimon, "Link check interval in milliseconds");
-module_param(updelay, int, 0);
+module_param(updelay, uint, 0);
MODULE_PARM_DESC(updelay, "Delay before considering link up, in milliseconds");
-module_param(downdelay, int, 0);
+module_param(downdelay, uint, 0);
MODULE_PARM_DESC(downdelay, "Delay before considering link down, "
"in milliseconds");
module_param(use_carrier, int, 0);
@@ -151,14 +151,14 @@ module_param(ad_select, charp, 0);
MODULE_PARM_DESC(ad_select, "803.ad aggregation selection logic; "
"0 for stable (default), 1 for bandwidth, "
"2 for count");
-module_param(min_links, int, 0);
+module_param(min_links, uint, 0);
MODULE_PARM_DESC(min_links, "Minimum number of available links before turning on carrier");
module_param(xmit_hash_policy, charp, 0);
MODULE_PARM_DESC(xmit_hash_policy, "balance-xor and 802.3ad hashing method; "
"0 for layer 2 (default), 1 for layer 3+4, "
"2 for layer 2+3");
-module_param(arp_interval, int, 0);
+module_param(arp_interval, uint, 0);
MODULE_PARM_DESC(arp_interval, "arp interval in milliseconds");
module_param_array(arp_ip_target, charp, NULL, 0);
MODULE_PARM_DESC(arp_ip_target, "arp targets in n.n.n.n form");
@@ -983,7 +983,7 @@ static struct slave *bond_find_best_slave(struct bonding *bond)
{
struct slave *new_active, *old_active;
struct slave *bestslave = NULL;
- int mintime = bond->params.updelay;
+ unsigned int mintime = bond->params.updelay;
int i;
new_active = bond->curr_active_slave;
@@ -1063,7 +1063,7 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
if (new_active->link == BOND_LINK_BACK) {
if (USES_PRIMARY(bond->params.mode)) {
- pr_info("%s: making interface %s the new active one %d ms earlier.\n",
+ pr_info("%s: making interface %s the new active one %u ms earlier.\n",
bond->dev->name, new_active->dev->name,
(bond->params.updelay - new_active->delay) * bond->params.miimon);
}
@@ -2356,7 +2356,7 @@ static int bond_miimon_inspect(struct bonding *bond)
slave->link = BOND_LINK_FAIL;
slave->delay = bond->params.downdelay;
if (slave->delay) {
- pr_info("%s: link status down for %sinterface %s, disabling it in %d ms.\n",
+ pr_info("%s: link status down for %sinterface %s, disabling it in %u ms.\n",
bond->dev->name,
(bond->params.mode ==
BOND_MODE_ACTIVEBACKUP) ?
@@ -2373,7 +2373,7 @@ static int bond_miimon_inspect(struct bonding *bond)
*/
slave->link = BOND_LINK_UP;
slave->jiffies = jiffies;
- pr_info("%s: link status up again after %d ms for interface %s.\n",
+ pr_info("%s: link status up again after %u ms for interface %s.\n",
bond->dev->name,
(bond->params.downdelay - slave->delay) *
bond->params.miimon,
@@ -2381,7 +2381,7 @@ static int bond_miimon_inspect(struct bonding *bond)
continue;
}
- if (slave->delay <= 0) {
+ if (slave->delay == 0) {
slave->new_link = BOND_LINK_DOWN;
commit++;
continue;
@@ -2398,7 +2398,7 @@ static int bond_miimon_inspect(struct bonding *bond)
slave->delay = bond->params.updelay;
if (slave->delay) {
- pr_info("%s: link status up for interface %s, enabling it in %d ms.\n",
+ pr_info("%s: link status up for interface %s, enabling it in %u ms.\n",
bond->dev->name, slave->dev->name,
ignore_updelay ? 0 :
bond->params.updelay *
@@ -2408,7 +2408,7 @@ static int bond_miimon_inspect(struct bonding *bond)
case BOND_LINK_BACK:
if (!link_state) {
slave->link = BOND_LINK_DOWN;
- pr_info("%s: link status down again after %d ms for interface %s.\n",
+ pr_info("%s: link status down again after %u ms for interface %s.\n",
bond->dev->name,
(bond->params.updelay - slave->delay) *
bond->params.miimon,
@@ -2420,7 +2420,7 @@ static int bond_miimon_inspect(struct bonding *bond)
if (ignore_updelay)
slave->delay = 0;
- if (slave->delay <= 0) {
+ if (slave->delay == 0) {
slave->new_link = BOND_LINK_UP;
commit++;
ignore_updelay = false;
@@ -2811,7 +2811,7 @@ void bond_loadbalance_arp_mon(struct work_struct *work)
arp_work.work);
struct slave *slave, *oldcurrent;
int do_failover = 0;
- int delta_in_ticks, extra_ticks;
+ unsigned int delta_in_ticks, extra_ticks;
int i;
read_lock(&bond->lock);
@@ -3020,7 +3020,7 @@ static int bond_ab_arp_inspect(struct bonding *bond, int delta_in_ticks)
*
* Called with RTNL and bond->lock for read.
*/
-static void bond_ab_arp_commit(struct bonding *bond, int delta_in_ticks)
+static void bond_ab_arp_commit(struct bonding *bond, unsigned int delta_in_ticks)
{
struct slave *slave;
int i;
@@ -3166,7 +3166,7 @@ void bond_activebackup_arp_mon(struct work_struct *work)
struct bonding *bond = container_of(work, struct bonding,
arp_work.work);
bool should_notify_peers = false;
- int delta_in_ticks;
+ unsigned int delta_in_ticks;
read_lock(&bond->lock);
@@ -4574,30 +4574,6 @@ static int bond_check_params(struct bond_params *params)
params->ad_select = BOND_AD_STABLE;
}
- if (max_bonds < 0) {
- pr_warning("Warning: max_bonds (%d) not in range %d-%d, so it was reset to BOND_DEFAULT_MAX_BONDS (%d)\n",
- max_bonds, 0, INT_MAX, BOND_DEFAULT_MAX_BONDS);
- max_bonds = BOND_DEFAULT_MAX_BONDS;
- }
-
- if (miimon < 0) {
- pr_warning("Warning: miimon module parameter (%d), not in range 0-%d, so it was reset to %d\n",
- miimon, INT_MAX, BOND_LINK_MON_INTERV);
- miimon = BOND_LINK_MON_INTERV;
- }
-
- if (updelay < 0) {
- pr_warning("Warning: updelay module parameter (%d), not in range 0-%d, so it was reset to 0\n",
- updelay, INT_MAX);
- updelay = 0;
- }
-
- if (downdelay < 0) {
- pr_warning("Warning: downdelay module parameter (%d), not in range 0-%d, so it was reset to 0\n",
- downdelay, INT_MAX);
- downdelay = 0;
- }
-
if ((use_carrier != 0) && (use_carrier != 1)) {
pr_warning("Warning: use_carrier module parameter (%d), not of valid value (0/1), so it was set to 1\n",
use_carrier);
@@ -4651,7 +4627,7 @@ static int bond_check_params(struct bond_params *params)
}
if (bond_mode == BOND_MODE_ALB) {
- pr_notice("In ALB mode you might experience client disconnections upon reconnection of a link if the bonding module updelay parameter (%d msec) is incompatible with the forwarding delay time of the switch\n",
+ pr_notice("In ALB mode you might experience client disconnections upon reconnection of a link if the bonding module updelay parameter (%u msec) is incompatible with the forwarding delay time of the switch\n",
updelay);
}
@@ -4660,19 +4636,19 @@ static int bond_check_params(struct bond_params *params)
/* just warn the user the up/down delay will have
* no effect since miimon is zero...
*/
- pr_warning("Warning: miimon module parameter not set and updelay (%d) or downdelay (%d) module parameter is set; updelay and downdelay have no effect unless miimon is set\n",
+ pr_warning("Warning: miimon module parameter not set and updelay (%u) or downdelay (%u) module parameter is set; updelay and downdelay have no effect unless miimon is set\n",
updelay, downdelay);
}
} else {
/* don't allow arp monitoring */
if (arp_interval) {
- pr_warning("Warning: miimon (%d) and arp_interval (%d) can't be used simultaneously, disabling ARP monitoring\n",
+ pr_warning("Warning: miimon (%u) and arp_interval (%u) can't be used simultaneously, disabling ARP monitoring\n",
miimon, arp_interval);
arp_interval = 0;
}
if ((updelay % miimon) != 0) {
- pr_warning("Warning: updelay (%d) is not a multiple of miimon (%d), updelay rounded to %d ms\n",
+ pr_warning("Warning: updelay (%u) is not a multiple of miimon (%u), updelay rounded to %u ms\n",
updelay, miimon,
(updelay / miimon) * miimon);
}
@@ -4680,7 +4656,7 @@ static int bond_check_params(struct bond_params *params)
updelay /= miimon;
if ((downdelay % miimon) != 0) {
- pr_warning("Warning: downdelay (%d) is not a multiple of miimon (%d), downdelay rounded to %d ms\n",
+ pr_warning("Warning: downdelay (%u) is not a multiple of miimon (%u), downdelay rounded to %u ms\n",
downdelay, miimon,
(downdelay / miimon) * miimon);
}
@@ -4688,12 +4664,6 @@ static int bond_check_params(struct bond_params *params)
downdelay /= miimon;
}
- if (arp_interval < 0) {
- pr_warning("Warning: arp_interval module parameter (%d) , not in range 0-%d, so it was reset to %d\n",
- arp_interval, INT_MAX, BOND_LINK_ARP_INTERV);
- arp_interval = BOND_LINK_ARP_INTERV;
- }
-
for (arp_ip_count = 0;
(arp_ip_count < BOND_MAX_ARP_TARGETS) && arp_ip_target[arp_ip_count];
arp_ip_count++) {
@@ -4711,7 +4681,7 @@ static int bond_check_params(struct bond_params *params)
if (arp_interval && !arp_ip_count) {
/* don't allow arping if no arp_ip_target given... */
- pr_warning("Warning: arp_interval module parameter (%d) specified without providing an arp_ip_target parameter, arp_interval was reset to 0\n",
+ pr_warning("Warning: arp_interval module parameter (%u) specified without providing an arp_ip_target parameter, arp_interval was reset to 0\n",
arp_interval);
arp_interval = 0;
}
@@ -4737,11 +4707,11 @@ static int bond_check_params(struct bond_params *params)
arp_validate_value = 0;
if (miimon) {
- pr_info("MII link monitoring set to %d ms\n", miimon);
+ pr_info("MII link monitoring set to %u ms\n", miimon);
} else if (arp_interval) {
int i;
- pr_info("ARP monitoring set to %d ms, validate %s, with %d target(s):",
+ pr_info("ARP monitoring set to %u ms, validate %s, with %d target(s):",
arp_interval,
arp_validate_tbl[arp_validate_value].modename,
arp_ip_count);
diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c
index 3cea38d..0b4c278 100644
--- a/drivers/net/bonding/bond_procfs.c
+++ b/drivers/net/bonding/bond_procfs.c
@@ -94,17 +94,17 @@ static void bond_info_show_master(struct seq_file *seq)
seq_printf(seq, "MII Status: %s\n", netif_carrier_ok(bond->dev) ?
"up" : "down");
- seq_printf(seq, "MII Polling Interval (ms): %d\n", bond->params.miimon);
- seq_printf(seq, "Up Delay (ms): %d\n",
+ seq_printf(seq, "MII Polling Interval (ms): %u\n", bond->params.miimon);
+ seq_printf(seq, "Up Delay (ms): %u\n",
bond->params.updelay * bond->params.miimon);
- seq_printf(seq, "Down Delay (ms): %d\n",
+ seq_printf(seq, "Down Delay (ms): %u\n",
bond->params.downdelay * bond->params.miimon);
/* ARP information */
if (bond->params.arp_interval > 0) {
int printed = 0;
- seq_printf(seq, "ARP Polling Interval (ms): %d\n",
+ seq_printf(seq, "ARP Polling Interval (ms): %u\n",
bond->params.arp_interval);
seq_printf(seq, "ARP IP target/s (n.n.n.n form):");
@@ -126,7 +126,7 @@ static void bond_info_show_master(struct seq_file *seq)
seq_puts(seq, "\n802.3ad info\n");
seq_printf(seq, "LACP rate: %s\n",
(bond->params.lacp_fast) ? "fast" : "slow");
- seq_printf(seq, "Min links: %d\n", bond->params.min_links);
+ seq_printf(seq, "Min links: %u\n", bond->params.min_links);
seq_printf(seq, "Aggregator selection policy (ad_select): %s\n",
ad_select_tbl[bond->params.ad_select].modename);
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index ef8d2a0..b9a2131 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -503,28 +503,23 @@ static ssize_t bonding_show_arp_interval(struct device *d,
{
struct bonding *bond = to_bond(d);
- return sprintf(buf, "%d\n", bond->params.arp_interval);
+ return sprintf(buf, "%u\n", bond->params.arp_interval);
}
static ssize_t bonding_store_arp_interval(struct device *d,
struct device_attribute *attr,
const char *buf, size_t count)
{
- int new_value, ret = count;
+ int ret = count;
+ unsigned int new_value;
struct bonding *bond = to_bond(d);
- if (sscanf(buf, "%d", &new_value) != 1) {
+ if (sscanf(buf, "%u", &new_value) != 1) {
pr_err("%s: no arp_interval value specified.\n",
bond->dev->name);
ret = -EINVAL;
goto out;
}
- if (new_value < 0) {
- pr_err("%s: Invalid arp_interval value %d not in range 1-%d; rejected.\n",
- bond->dev->name, new_value, INT_MAX);
- ret = -EINVAL;
- goto out;
- }
if (bond->params.mode == BOND_MODE_ALB ||
bond->params.mode == BOND_MODE_TLB) {
pr_info("%s: ARP monitoring cannot be used with ALB/TLB. Only MII monitoring is supported on %s.\n",
@@ -532,7 +527,7 @@ static ssize_t bonding_store_arp_interval(struct device *d,
ret = -EINVAL;
goto out;
}
- pr_info("%s: Setting ARP monitoring interval to %d.\n",
+ pr_info("%s: Setting ARP monitoring interval to %u.\n",
bond->dev->name, new_value);
bond->params.arp_interval = new_value;
if (bond->params.miimon) {
@@ -682,14 +677,15 @@ static ssize_t bonding_show_downdelay(struct device *d,
{
struct bonding *bond = to_bond(d);
- return sprintf(buf, "%d\n", bond->params.downdelay * bond->params.miimon);
+ return sprintf(buf, "%u\n", bond->params.downdelay * bond->params.miimon);
}
static ssize_t bonding_store_downdelay(struct device *d,
struct device_attribute *attr,
const char *buf, size_t count)
{
- int new_value, ret = count;
+ int ret = count;
+ unsigned int new_value;
struct bonding *bond = to_bond(d);
if (!(bond->params.miimon)) {
@@ -699,31 +695,22 @@ static ssize_t bonding_store_downdelay(struct device *d,
goto out;
}
- if (sscanf(buf, "%d", &new_value) != 1) {
+ if (sscanf(buf, "%u", &new_value) != 1) {
pr_err("%s: no down delay value specified.\n", bond->dev->name);
ret = -EINVAL;
goto out;
}
- if (new_value < 0) {
- pr_err("%s: Invalid down delay value %d not in range %d-%d; rejected.\n",
- bond->dev->name, new_value, 1, INT_MAX);
- ret = -EINVAL;
- goto out;
- } else {
- if ((new_value % bond->params.miimon) != 0) {
- pr_warning("%s: Warning: down delay (%d) is not a multiple of miimon (%d), delay rounded to %d ms\n",
- bond->dev->name, new_value,
- bond->params.miimon,
- (new_value / bond->params.miimon) *
- bond->params.miimon);
- }
- bond->params.downdelay = new_value / bond->params.miimon;
- pr_info("%s: Setting down delay to %d.\n",
- bond->dev->name,
- bond->params.downdelay * bond->params.miimon);
-
+ if ((new_value % bond->params.miimon) != 0) {
+ pr_warning("%s: Warning: down delay (%u) is not a multiple of miimon (%u), delay rounded to %u ms\n",
+ bond->dev->name, new_value,
+ bond->params.miimon,
+ (new_value / bond->params.miimon) *
+ bond->params.miimon);
}
-
+ bond->params.downdelay = new_value / bond->params.miimon;
+ pr_info("%s: Setting down delay to %u.\n",
+ bond->dev->name,
+ bond->params.downdelay * bond->params.miimon);
out:
return ret;
}
@@ -736,7 +723,7 @@ static ssize_t bonding_show_updelay(struct device *d,
{
struct bonding *bond = to_bond(d);
- return sprintf(buf, "%d\n", bond->params.updelay * bond->params.miimon);
+ return sprintf(buf, "%u\n", bond->params.updelay * bond->params.miimon);
}
@@ -744,7 +731,8 @@ static ssize_t bonding_store_updelay(struct device *d,
struct device_attribute *attr,
const char *buf, size_t count)
{
- int new_value, ret = count;
+ int ret = count;
+ unsigned int new_value;
struct bonding *bond = to_bond(d);
if (!(bond->params.miimon)) {
@@ -754,30 +742,23 @@ static ssize_t bonding_store_updelay(struct device *d,
goto out;
}
- if (sscanf(buf, "%d", &new_value) != 1) {
+ if (sscanf(buf, "%u", &new_value) != 1) {
pr_err("%s: no up delay value specified.\n",
bond->dev->name);
ret = -EINVAL;
goto out;
}
- if (new_value < 0) {
- pr_err("%s: Invalid down delay value %d not in range %d-%d; rejected.\n",
- bond->dev->name, new_value, 1, INT_MAX);
- ret = -EINVAL;
- goto out;
- } else {
- if ((new_value % bond->params.miimon) != 0) {
- pr_warning("%s: Warning: up delay (%d) is not a multiple of miimon (%d), updelay rounded to %d ms\n",
- bond->dev->name, new_value,
- bond->params.miimon,
- (new_value / bond->params.miimon) *
- bond->params.miimon);
- }
- bond->params.updelay = new_value / bond->params.miimon;
- pr_info("%s: Setting up delay to %d.\n",
- bond->dev->name,
- bond->params.updelay * bond->params.miimon);
+ if ((new_value % bond->params.miimon) != 0) {
+ pr_warning("%s: Warning: up delay (%u) is not a multiple of miimon (%u), updelay rounded to %u ms\n",
+ bond->dev->name, new_value,
+ bond->params.miimon,
+ (new_value / bond->params.miimon) *
+ bond->params.miimon);
}
+ bond->params.updelay = new_value / bond->params.miimon;
+ pr_info("%s: Setting up delay to %u.\n",
+ bond->dev->name,
+ bond->params.updelay * bond->params.miimon);
out:
return ret;
@@ -846,7 +827,7 @@ static ssize_t bonding_show_min_links(struct device *d,
{
struct bonding *bond = to_bond(d);
- return sprintf(buf, "%d\n", bond->params.min_links);
+ return sprintf(buf, "%u\n", bond->params.min_links);
}
static ssize_t bonding_store_min_links(struct device *d,
@@ -952,65 +933,59 @@ static ssize_t bonding_show_miimon(struct device *d,
{
struct bonding *bond = to_bond(d);
- return sprintf(buf, "%d\n", bond->params.miimon);
+ return sprintf(buf, "%u\n", bond->params.miimon);
}
static ssize_t bonding_store_miimon(struct device *d,
struct device_attribute *attr,
const char *buf, size_t count)
{
- int new_value, ret = count;
+ int ret = count;
+ unsigned int new_value;
struct bonding *bond = to_bond(d);
- if (sscanf(buf, "%d", &new_value) != 1) {
+ if (sscanf(buf, "%u", &new_value) != 1) {
pr_err("%s: no miimon value specified.\n",
bond->dev->name);
ret = -EINVAL;
goto out;
}
- if (new_value < 0) {
- pr_err("%s: Invalid miimon value %d not in range %d-%d; rejected.\n",
- bond->dev->name, new_value, 1, INT_MAX);
- ret = -EINVAL;
- goto out;
- } else {
- pr_info("%s: Setting MII monitoring interval to %d.\n",
- bond->dev->name, new_value);
- bond->params.miimon = new_value;
- if (bond->params.updelay)
- pr_info("%s: Note: Updating updelay (to %d) since it is a multiple of the miimon value.\n",
- bond->dev->name,
- bond->params.updelay * bond->params.miimon);
- if (bond->params.downdelay)
- pr_info("%s: Note: Updating downdelay (to %d) since it is a multiple of the miimon value.\n",
- bond->dev->name,
- bond->params.downdelay * bond->params.miimon);
- if (bond->params.arp_interval) {
- pr_info("%s: MII monitoring cannot be used with ARP monitoring. Disabling ARP monitoring...\n",
- bond->dev->name);
- bond->params.arp_interval = 0;
- if (bond->params.arp_validate) {
- bond->params.arp_validate =
- BOND_ARP_VALIDATE_NONE;
- }
- if (delayed_work_pending(&bond->arp_work)) {
- cancel_delayed_work(&bond->arp_work);
- flush_workqueue(bond->wq);
- }
+ pr_info("%s: Setting MII monitoring interval to %u.\n",
+ bond->dev->name, new_value);
+ bond->params.miimon = new_value;
+ if (bond->params.updelay)
+ pr_info("%s: Note: Updating updelay (to %u) since it is a multiple of the miimon value.\n",
+ bond->dev->name,
+ bond->params.updelay * bond->params.miimon);
+ if (bond->params.downdelay)
+ pr_info("%s: Note: Updating downdelay (to %u) since it is a multiple of the miimon value.\n",
+ bond->dev->name,
+ bond->params.downdelay * bond->params.miimon);
+ if (bond->params.arp_interval) {
+ pr_info("%s: MII monitoring cannot be used with ARP monitoring. Disabling ARP monitoring...\n",
+ bond->dev->name);
+ bond->params.arp_interval = 0;
+ if (bond->params.arp_validate) {
+ bond->params.arp_validate =
+ BOND_ARP_VALIDATE_NONE;
}
+ if (delayed_work_pending(&bond->arp_work)) {
+ cancel_delayed_work(&bond->arp_work);
+ flush_workqueue(bond->wq);
+ }
+ }
- if (bond->dev->flags & IFF_UP) {
- /* If the interface is up, we may need to fire off
- * the MII timer. If the interface is down, the
- * timer will get fired off when the open function
- * is called.
- */
- if (!delayed_work_pending(&bond->mii_work)) {
- INIT_DELAYED_WORK(&bond->mii_work,
- bond_mii_monitor);
- queue_delayed_work(bond->wq,
- &bond->mii_work, 0);
- }
+ if (bond->dev->flags & IFF_UP) {
+ /* If the interface is up, we may need to fire off
+ * the MII timer. If the interface is down, the
+ * timer will get fired off when the open function
+ * is called.
+ */
+ if (!delayed_work_pending(&bond->mii_work)) {
+ INIT_DELAYED_WORK(&bond->mii_work,
+ bond_mii_monitor);
+ queue_delayed_work(bond->wq,
+ &bond->mii_work, 0);
}
}
out:
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index f8af2fc..604124c 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -139,14 +139,14 @@ static inline int is_netpoll_tx_blocked(struct net_device *dev)
struct bond_params {
int mode;
int xmit_policy;
- int miimon;
+ unsigned int miimon;
u8 num_peer_notif;
- int arp_interval;
+ unsigned int arp_interval;
int arp_validate;
int use_carrier;
int fail_over_mac;
- int updelay;
- int downdelay;
+ unsigned int updelay;
+ unsigned int downdelay;
int lacp_fast;
unsigned int min_links;
int ad_select;
@@ -175,7 +175,7 @@ struct slave {
struct slave *next;
struct slave *prev;
struct bonding *bond; /* our master */
- int delay;
+ unsigned int delay;
unsigned long jiffies;
unsigned long last_arp_rx;
s8 link; /* one of BOND_LINK_XXXX */
diff --git a/include/uapi/linux/if_bonding.h b/include/uapi/linux/if_bonding.h
index a17edda..9796b4a 100644
--- a/include/uapi/linux/if_bonding.h
+++ b/include/uapi/linux/if_bonding.h
@@ -95,7 +95,7 @@
typedef struct ifbond {
__s32 bond_mode;
__s32 num_slaves;
- __s32 miimon;
+ __u32 miimon;
} ifbond;
typedef struct ifslave {
--
1.7.11.4
^ permalink raw reply related
* Re: [PATCH net-next] mlx4: change TX coalescing defaults
From: Eric Dumazet @ 2012-11-06 11:50 UTC (permalink / raw)
To: Amir Mellanox
Cc: David Miller, netdev, Yevgeny Petrilin, Or Gerlitz, Vimalkumar,
amirv
In-Reply-To: <CAPcc5Piw2f4y=PXRGN+_gUA3ogO6zzbhyvNFEf717_m8dejbWQ@mail.gmail.com>
On Tue, 2012-11-06 at 10:04 +0200, Amir Mellanox wrote:
> Eric Hi,
>
> I will check and review your patch and return to you ASAP.
>
> Regarding BQL, the driver has it over half a year now, In commit:
> 5b263f5374ea70daa61ed9f5cc5d8f4ac236efbd
Oh right, it seems I was not looking for right verbs or changelog
keywords ;)
Then I suspect my patch will help to keep inflight BQL counter lower and
reduce latencies.
Thanks
^ permalink raw reply
* Re: [PATCH 1/1] af-packet: fix oops when socket is not present
From: Eric Dumazet @ 2012-11-06 11:34 UTC (permalink / raw)
To: Eric Leblond; +Cc: netdev, stable
In-Reply-To: <1352197481-16782-2-git-send-email-eric@regit.org>
On Tue, 2012-11-06 at 11:24 +0100, Eric Leblond wrote:
> When skb->sk is NULL and when packet fanout is used, there is a
> crash in match_fanout_group where skb->sk is accessed.
> This patch fixes the issue by returning false as soon as the
> socket is NULL: this correspond to the wanted behavior because
> the kernel as to resend the skb to all the listening socket in
> this case.
>
> Signed-off-by: Eric Leblond <eric@regit.org>
> ---
> net/core/dev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index b4978e2..c7b5293 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -1666,7 +1666,7 @@ static inline int deliver_skb(struct sk_buff *skb,
>
> static inline bool skb_loop_sk(struct packet_type *ptype, struct sk_buff *skb)
> {
> - if (ptype->af_packet_priv == NULL)
> + if ((ptype->af_packet_priv == NULL) || (skb->sk == NULL))
Why adding these parentheses ?
if (!ptype->af_packet_priv || !skb->sk)
> return false;
>
> if (ptype->id_match)
Your patch is technically correct, but misses extra information to ease
stable team work.
Your previous mail with this useful information wont be part of the
patch.
Please add this information in the changelog ?
Thanks
^ permalink raw reply
* Re: [PATCH 3/7] ARM: OMAP3+: hwmod: Add AM33XX HWMOD data for davinci_mdio module
From: Mugunthan V N @ 2012-11-06 11:24 UTC (permalink / raw)
To: Bedia, Vaibhav
Cc: netdev@vger.kernel.org, Richard Cochran, Paul Walmsley,
devicetree-discuss@lists.ozlabs.org, Hiremath, Vaibhav,
linux-omap@vger.kernel.org, davem@davemloft.net,
linux-arm-kernel@lists.infradead.org
In-Reply-To: <B5906170F1614E41A8A28DE3B8D121433EC049CC@DBDE01.ent.ti.com>
On 11/6/2012 3:39 PM, Bedia, Vaibhav wrote:
> On Tue, Nov 06, 2012 at 13:42:21, N, Mugunthan V wrote:
> [...]
>> +struct omap_hwmod_addr_space am33xx_mdio_addr_space[] = {
>> + {
>> + .pa_start = 0x4A101000,
>> + .pa_end = 0x4A101000 + SZ_256 - 1,
>> + .flags = ADDR_MAP_ON_INIT,
> Based on the recent discussions and looking the hwmod code,
> I guess ADDR_MAP_ON_INIT does not make sense here. Since you
> are just creating a parent-child relationship here, maybe no
> flag is needed?
>
>> + },
>> + { }
>> +};
>> +
>> +struct omap_hwmod_ocp_if am33xx_cpgmac0__mdio = {
>> + .master = &am33xx_cpgmac0_hwmod,
>> + .slave = &am33xx_mdio_hwmod,
>> + .addr = am33xx_mdio_addr_space,
>> + .user = OCP_USER_MPU,
> Is this flag necessary? Shouldn't you just skip the
> user field since there's nothing for the hwmod code
> to do here?
>
>
Will remove the unnecessary flags and submit the patch.
Regards
Mugunthan V N
^ permalink raw reply
* RE: [PATCH v2 00/11] introduce random32_get_bytes() and random32_get_bytes_state()
From: David Laight @ 2012-11-06 11:18 UTC (permalink / raw)
To: Valdis.Kletnieks, Akinobu Mita
Cc: linux-kernel, akpm, Theodore Ts'o, Artem Bityutskiy,
Adrian Hunter, David Woodhouse, linux-mtd, Eilon Greenstein,
netdev, Robert Love, devel, Michel Lespinasse
In-Reply-To: <90816.1352178872@turing-police.cc.vt.edu>
> On Sun, 04 Nov 2012 00:43:31 +0900, Akinobu Mita said:
> > This patchset introduces new functions into random32 library for
> > getting the requested number of pseudo-random bytes.
> >
> > Before introducing these new functions into random32 library,
> > prandom32() and prandom32_seed() with "prandom32" prefix are
> > renamed to random32_state() and srandom32_state() respectively.
> >
> > The purpose of this renaming is to prevent some kernel developers
> > from assuming that prandom32() and random32() might imply that only
> > prandom32() was the one using a pseudo-random number generator by
> > prandom32's "p", and the result may be a very embarassing security
> > exposure.
>
> Out of curiosity, why the '32'? I'm just waiting for some kernel developer to
> do something stupid with this on a 64-bit arch because they think it's a 32-bit API. ;)
>
> Should we bite the bullet and lose the 32, as long as we're churning the code *anyhow*?
Also why remove the 'pseudo' part of the name?
It is an important part of the name.
David
^ permalink raw reply
* Re: how to disable automatic route addition for an ipv6 address
From: devendra.aaru @ 2012-11-06 11:07 UTC (permalink / raw)
To: Mikael Abrahamsson; +Cc: netdev
In-Reply-To: <alpine.DEB.2.00.1211060755510.13802@uplift.swm.pp.se>
On Tue, Nov 6, 2012 at 2:01 AM, Mikael Abrahamsson <swmike@swm.pp.se> wrote:
> On Mon, 5 Nov 2012, devendra.aaru wrote:
>
>> while adding the ipv6 address to interface ,
>>
>> ifconfig eth0 add 2001:8800:10fb:4444::ae/64
>>
>> i am seeing the route addition automatically
>>
>> route -n -A inet6 shows that one of the route from the above added
>> address.
>
>
> You mean you get a /64 route to the interface? I'd say that's normal, as
> you're adding a /64.
>
> If you do not want this, add it as a /128 instead.
>
> "ip -6 a a dev eth0 2000:db8::1/128" will add just that /128 to eth0
> interface without an encompassing network route.
>
> "ip -6 r l" to verify (you will see just the IPv6 address to the device, ie
> an implicit /128).
>
Thanks a lot Mikael, i will give a try :-)
> --
> Mikael Abrahamsson email: swmike@swm.pp.se
^ permalink raw reply
* [PATCH 0/1] oops in af_packet fanout mode
From: Eric Leblond @ 2012-11-06 10:24 UTC (permalink / raw)
To: netdev; +Cc: stable
Due to a NULL dereference, the following patch is causing oops
in normal trafic condition:
commit c0de08d04215031d68fa13af36f347a6cfa252ca
Author: Eric Leblond <eric@regit.org>
Date: Thu Aug 16 22:02:58 2012 +0000
af_packet: don't emit packet on orig fanout group
This patch was a feature fix and has reached most stable
branches. The following patch fixes the issue and should be
applied to branch containing the previous patch.
BR,
--
Eric Leblond <eric@regit.org>
^ permalink raw reply
* [PATCH 1/1] af-packet: fix oops when socket is not present
From: Eric Leblond @ 2012-11-06 10:24 UTC (permalink / raw)
To: netdev; +Cc: stable, Eric Leblond
In-Reply-To: <1352197481-16782-1-git-send-email-eric@regit.org>
When skb->sk is NULL and when packet fanout is used, there is a
crash in match_fanout_group where skb->sk is accessed.
This patch fixes the issue by returning false as soon as the
socket is NULL: this correspond to the wanted behavior because
the kernel as to resend the skb to all the listening socket in
this case.
Signed-off-by: Eric Leblond <eric@regit.org>
---
net/core/dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index b4978e2..c7b5293 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1666,7 +1666,7 @@ static inline int deliver_skb(struct sk_buff *skb,
static inline bool skb_loop_sk(struct packet_type *ptype, struct sk_buff *skb)
{
- if (ptype->af_packet_priv == NULL)
+ if ((ptype->af_packet_priv == NULL) || (skb->sk == NULL))
return false;
if (ptype->id_match)
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCH 0/7] ARM: AM33XX: net: Add DT support to CPGMAC and MDIO driver
From: Richard Cochran @ 2012-11-06 10:40 UTC (permalink / raw)
To: Mugunthan V N
Cc: netdev, devicetree-discuss, linux-omap, davem, linux-arm-kernel
In-Reply-To: <1352189545-26303-1-git-send-email-mugunthanvnm@ti.com>
On Tue, Nov 06, 2012 at 01:42:18PM +0530, Mugunthan V N wrote:
> This patch-series adds support for,
>
> [1/7]: Typo mistake in CPSW driver while invoking runtime_pm api's
>
> [2/7]: Adds parent<->child relation between CPSW & MDIO module inside cpsw
> driver, as in case of AM33XX, the resources are shared and common
> register bit-field is provided to control module/clock enable/disable,
> makes it difficult to handle common resource.
>
> So the solution here is, to create parent<->child relation between them.
>
> [3/7]: Add hwmod entry for MDIO module, required for MDIO driver.
>
> [4/7]: cpsw: simplify the setup of the register pointers
>
> [5/7]: Add DT device nodes for both CPSW and MDIO modules in am33xx.dtsi,
> am335x-evm.dts and am335x-bone.dts file
>
> [6/7]: Enable CPSW support to omap2plus_defconfig
>
> [7/7]: cpsw: Kernel warn fix during suspend
Acked-by: Richard Cochran <richardcochran@gmail.com>
^ permalink raw reply
* RE: [PATCH 3/7] ARM: OMAP3+: hwmod: Add AM33XX HWMOD data for davinci_mdio module
From: Bedia, Vaibhav @ 2012-11-06 10:09 UTC (permalink / raw)
To: N, Mugunthan V, netdev@vger.kernel.org
Cc: Richard Cochran, Paul Walmsley,
devicetree-discuss@lists.ozlabs.org, Hiremath, Vaibhav,
linux-omap@vger.kernel.org, davem@davemloft.net,
linux-arm-kernel@lists.infradead.org
In-Reply-To: <1352189545-26303-4-git-send-email-mugunthanvnm@ti.com>
On Tue, Nov 06, 2012 at 13:42:21, N, Mugunthan V wrote:
[...]
> +struct omap_hwmod_addr_space am33xx_mdio_addr_space[] = {
> + {
> + .pa_start = 0x4A101000,
> + .pa_end = 0x4A101000 + SZ_256 - 1,
> + .flags = ADDR_MAP_ON_INIT,
Based on the recent discussions and looking the hwmod code,
I guess ADDR_MAP_ON_INIT does not make sense here. Since you
are just creating a parent-child relationship here, maybe no
flag is needed?
> + },
> + { }
> +};
> +
> +struct omap_hwmod_ocp_if am33xx_cpgmac0__mdio = {
> + .master = &am33xx_cpgmac0_hwmod,
> + .slave = &am33xx_mdio_hwmod,
> + .addr = am33xx_mdio_addr_space,
> + .user = OCP_USER_MPU,
Is this flag necessary? Shouldn't you just skip the
user field since there's nothing for the hwmod code
to do here?
Regards,
Vaibhav
^ permalink raw reply
* [PATCH 2/2] smsc95xx: set MII_BUSY bit to read/write PHY regs
From: Steve Glendinning @ 2012-11-06 10:08 UTC (permalink / raw)
To: netdev; +Cc: Steve Glendinning
The device datasheet specifies the BUSY bit must be set when reading
or writing phy registers. This patch ensures we do that.
Signed-off-by: Steve Glendinning <steve.glendinning@shawell.net>
---
drivers/net/usb/smsc95xx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 34f2e78..69efe66 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -167,7 +167,7 @@ static int smsc95xx_mdio_read(struct net_device *netdev, int phy_id, int idx)
/* set the address, index & direction (read from PHY) */
phy_id &= dev->mii.phy_id_mask;
idx &= dev->mii.reg_num_mask;
- addr = (phy_id << 11) | (idx << 6) | MII_READ_;
+ addr = (phy_id << 11) | (idx << 6) | MII_READ_ | MII_BUSY_;
ret = smsc95xx_write_reg(dev, MII_ADDR, addr);
check_warn_goto_done(ret, "Error writing MII_ADDR");
@@ -204,7 +204,7 @@ static void smsc95xx_mdio_write(struct net_device *netdev, int phy_id, int idx,
/* set the address, index & direction (write to PHY) */
phy_id &= dev->mii.phy_id_mask;
idx &= dev->mii.reg_num_mask;
- addr = (phy_id << 11) | (idx << 6) | MII_WRITE_;
+ addr = (phy_id << 11) | (idx << 6) | MII_WRITE_ | MII_BUSY_;
ret = smsc95xx_write_reg(dev, MII_ADDR, addr);
check_warn_goto_done(ret, "Error writing MII_ADDR");
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCH 1/6] VSOCK: vsock protocol implementation.
From: Stephen Hemminger @ 2012-11-06 9:10 UTC (permalink / raw)
To: George Zhang
Cc: pv-drivers, netdev, linux-kernel, virtualization, gregkh,
vm-crosstalk, davem
In-Reply-To: <20121105180043.21472.95003.stgit@promb-2n-dhcp175.eng.vmware.com>
On Mon, 05 Nov 2012 10:00:51 -0800
George Zhang <georgezhang@vmware.com> wrote:
> + /* Added in 2.6.10. */
> + .owner = THIS_MODULE,
Thanks for submitting this, it will make life easier for distro's
that now have to go through extra effort to include out of mainline
support for Vmware.
You did some scrubbing of the macro's to support multiple kernel
versions, but there are still some leftovers.
This code seems to have a lot of "this added in version xxx"
type comments. These are probably not a good idea to include
in the mainline kernel code.
^ permalink raw reply
* iputils-s20121106
From: YOSHIFUJI Hideaki @ 2012-11-06 9:07 UTC (permalink / raw)
To: netdev; +Cc: YOSHIFUJI Hideaki
Hello.
I have just released new snapshot of iputils (iputils-s20121106).
This release basically fixes bugs in ping/ping6 with -f option and
a bug regarding error message in tracepath6.
----
Changes since s20121011:
ninfod: Attatch configure and renew config.h.in.
makefile: clean-up
tracepath6: Print reason on getadrinfo() failure.
ping,ping6: Fix hang with -f option.
ping: Make sure to print C if checksum failed with -f option.
----
Release note:
https://sourceforge.net/p/iputils/code/ci/s20121106/tree/RELNOTES
Download:
https://sourceforge.net/projects/iputils/files/
http://www.skbuff.net/iputils/
Regards,
--yoshfuji
^ permalink raw reply
* Re: [PATCH 0/6] VSOCK for Linux upstreaming
From: Stephen Hemminger @ 2012-11-06 9:06 UTC (permalink / raw)
To: Stephen Hemminger
Cc: pv-drivers, netdev, linux-kernel, virtualization, gregkh,
vm-crosstalk, davem, George Zhang
In-Reply-To: <20121106100021.538486e7@s6510.linuxnetplumber.net>
Never mind, mail server seemed to be overloaded today.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox