* [PATCH net-next 0/2] drivers/net: Remove casts of void *
From: Joe Perches @ 2011-06-14 4:02 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel, linux-wireless, ath9k-devel
Joe Perches (2):
wireless: Remove casts of void *
drivers/net: Remove casts of void *
drivers/net/a2065.c | 2 +-
drivers/net/appletalk/ltpc.c | 8 ++--
drivers/net/atl1e/atl1e_main.c | 5 +--
drivers/net/atlx/atl2.c | 3 +-
drivers/net/benet/be_cmds.c | 3 +-
drivers/net/benet/be_ethtool.c | 4 +-
drivers/net/bna/bfa_cee.c | 2 +-
drivers/net/bna/cna.h | 2 +-
drivers/net/caif/caif_shmcore.c | 2 +-
drivers/net/cnic.c | 4 +-
drivers/net/cxgb3/cxgb3_offload.c | 2 +-
drivers/net/davinci_cpdma.c | 2 +-
drivers/net/declance.c | 38 ++++++++++++---------
drivers/net/depca.c | 4 +-
drivers/net/dl2k.c | 4 +-
drivers/net/ehea/ehea_qmr.c | 2 +-
drivers/net/epic100.c | 4 +-
drivers/net/fealnx.c | 4 +-
drivers/net/gianfar.c | 4 +-
drivers/net/hamachi.c | 4 +-
drivers/net/macmace.c | 2 +-
drivers/net/mlx4/en_rx.c | 2 +-
drivers/net/mlx4/en_tx.c | 5 +--
drivers/net/myri_sbus.c | 3 +-
drivers/net/netxen/netxen_nic_ctx.c | 16 ++++----
drivers/net/pxa168_eth.c | 2 +-
drivers/net/qla3xxx.c | 5 +--
drivers/net/qlcnic/qlcnic_ctx.c | 26 +++++++-------
drivers/net/qlcnic/qlcnic_ethtool.c | 2 +-
drivers/net/qlcnic/qlcnic_hw.c | 3 +-
drivers/net/qlcnic/qlcnic_main.c | 2 +-
drivers/net/qlge/qlge_main.c | 4 +-
drivers/net/s2io.c | 18 ++++------
drivers/net/sfc/siena.c | 2 +-
drivers/net/sis900.c | 4 +-
drivers/net/tokenring/madgemc.c | 2 +-
drivers/net/typhoon.c | 2 +-
drivers/net/vxge/vxge-config.c | 44 ++++++++---------------
drivers/net/vxge/vxge-traffic.c | 6 ++--
drivers/net/wan/pc300_tty.c | 2 +-
drivers/net/wireless/ath/ath9k/ar9003_mac.c | 2 +-
drivers/net/wireless/ath/ath9k/htc_hst.c | 6 +--
drivers/net/wireless/ath/ath9k/init.c | 2 +-
drivers/net/wireless/ath/ath9k/wmi.c | 2 +-
drivers/net/wireless/ath/carl9170/usb.c | 2 +-
drivers/net/wireless/hostap/hostap_cs.c | 4 +-
drivers/net/wireless/hostap/hostap_pci.c | 4 +-
drivers/net/wireless/hostap/hostap_plx.c | 4 +-
drivers/net/wireless/ipw2x00/ipw2100.c | 6 +--
drivers/net/wireless/iwlegacy/iwl-4965-rs.c | 2 +-
drivers/net/wireless/iwlegacy/iwl-4965-ucode.c | 8 ++--
drivers/net/wireless/iwlegacy/iwl3945-base.c | 8 ++--
drivers/net/wireless/iwlegacy/iwl4965-base.c | 2 +-
drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 2 +-
drivers/net/wireless/mwifiex/11n.c | 5 +--
drivers/net/wireless/mwifiex/cmdevt.c | 3 +-
drivers/net/wireless/mwifiex/join.c | 2 +-
drivers/net/wireless/mwifiex/scan.c | 2 +-
drivers/net/wireless/mwifiex/sta_cmd.c | 4 +-
drivers/net/wireless/mwifiex/sta_cmdresp.c | 12 +++---
drivers/net/wireless/mwifiex/txrx.c | 2 +-
drivers/net/wireless/p54/eeprom.c | 4 +-
drivers/net/xilinx_emaclite.c | 4 +-
drivers/net/yellowfin.c | 6 ++--
64 files changed, 164 insertions(+), 189 deletions(-)
--
1.7.6.rc0
^ permalink raw reply
* Re: [PATCH] sky2: avoid using uninitialized variable
From: Stephen Hemminger @ 2011-06-14 4:02 UTC (permalink / raw)
To: Greg Thelen; +Cc: Stephen Hemminger, netdev, linux-kernel@vger.kernel.org
In-Reply-To: <BANLkTi=jw5=9LcwxnXW6xNkF4RbFhHaB55Au=oDhn1yYWf53dA@mail.gmail.com>
On Mon, 13 Jun 2011 17:34:00 -0700
Greg Thelen <gthelen@google.com> wrote:
> On Mon, Jun 13, 2011 at 3:12 PM, Stephen Hemminger
> <shemminger@vyatta.com> wrote:
> > On Mon, 13 Jun 2011 14:21:59 -0700
> > Greg Thelen <gthelen@google.com> wrote:
> >
> >> I am not sure if 0 or ~0 would be a better choice in the gm_phy_read()
> >> error case. I used 0. A more complete solution might be to plumb up
> >> error handling to the callers of gm_phy_read().
> >>
> >> ==
> >> From 37486219a3d93881f3b2619a4b2bb21be62db7d4 Mon Sep 17 00:00:00 2001
> >> From: Greg Thelen <gthelen@google.com>
> >> Date: Mon, 13 Jun 2011 14:09:07 -0700
> >> Subject: [PATCH] sky2: avoid using uninitialized variable
> >>
> >> Prior to this change gm_phy_read() could return an uninitialized
> >> variable if __gm_phy_read() failed.
> >>
> >> This change returns zero in the failure case.
> >>
> >> Signed-off-by: Greg Thelen <gthelen@google.com>
> >
> > Shouldn't the callers be changed to check rather than just returning
> > 0 and masking the problem.
>
> I agree that the right long term solution is to plumb the error
> handling up through the callers. This would involve deleting the
> error-free gm_phy_read() routine and replacing all calls to it with
> calls to error-capable __gm_phy_read(). This would require converting
> several routines from returning void to returning int allowing errors
> to propagate upwards. Notable affected routines include:
> sky2_phy_power_up(), sky2_wol_init(), sky2_phy_power_down(),
> sky2_hw_down(), sky2_mac_init(), sky2_hw_up(), sky2_phy_intr(),
> sky2_led(). sky2_restart() would likely have to re-queue the work
> item in the case of failure. Presumably sky2_poll() would return 0 if
> error is seen. On a related note, it also seems that gm_phy_write()
> callers should be checking its return value to also handle the same
> class of I/O errors. Testing these changes would involve injecting
> error values or access to certain kinds of broken hardware.
In my experience if phy reads once successfully, it is going
to read every time. If there is a problem it only happens on
the first access (powered off, bad timing, etc).
> For the short term I figured that not consuming random data was a step
> in right direction. But I understand if you prefer to hold out for
> the complete solution. Unfortunately, I do not currently have time to
> contribute to the complete solution.
^ permalink raw reply
* Re: [Bugme-new] [Bug 37202] New: Cannot change MTU on bridged interface
From: Shan Wei @ 2011-06-14 3:16 UTC (permalink / raw)
To: Andrew Morton
Cc: netdev, bridge, bugme-daemon, Stephen Hemminger, steve-alexander,
holler
In-Reply-To: <20110613163735.34c42044.akpm@linux-foundation.org>
Andrew Morton wrote, at 06/14/2011 07:37 AM:
>
> (switched to email. Please respond via emailed reply-to-all, not via the
> bugzilla web interface).
>
> On Sat, 11 Jun 2011 10:59:18 GMT
> bugzilla-daemon@bugzilla.kernel.org wrote:
>
>> https://bugzilla.kernel.org/show_bug.cgi?id=37202
>>
>> Summary: Cannot change MTU on bridged interface
>> Product: Networking
>> Version: 2.5
>> Kernel Version: 3.0.0-rc2
>> Platform: All
>> OS/Version: Linux
>> Tree: Mainline
>> Status: NEW
>> Severity: normal
>> Priority: P1
>> Component: Other
>> AssignedTo: acme@ghostprotocols.net
>> ReportedBy: steve-alexander@roadrunner.com
>> Regression: No
>>
>>
>> Without bridge, setting mtu on eth0 works as expected.
>> When eth0 is added to bridge 'br0' and this command is executed,
>>
>> ip link set eth0 mtu 4000
This bug has been fixed.
commit 6407d74c5106bb362b4087693688afd34942b094
Author: Alexander Holler <holler@ahsoftware.de>
Date: Tue Jun 7 00:51:35 2011 -0700
bridge: provide a cow_metrics method for fake_ops
Like in commit 0972ddb237 (provide cow_metrics() methods to blackhole
dst_ops), we must provide a cow_metrics for bridges fake_dst_ops as
well.
This fixes a regression coming from commits 62fa8a846d7d (net: Implement
read-only protection and COW'ing of metrics.) and 33eb9873a28 (bridge:
initialize fake_rtable metrics)
ip link set mybridge mtu 1234
--
Best Regards
-----
Shan Wei
^ permalink raw reply
* Re: Is skb->queue_mapping valid for received packets?
From: Ben Greear @ 2011-06-14 2:28 UTC (permalink / raw)
To: Andy Gospodarek; +Cc: NetDev
In-Reply-To: <20110614022159.GL21309@gospo.rdu.redhat.com>
On 06/13/2011 07:21 PM, Andy Gospodarek wrote:
> On Mon, Jun 13, 2011 at 07:06:53PM -0700, Ben Greear wrote:
>> On 06/13/2011 06:59 PM, Ben Greear wrote:
>>>
>>> Anyone know if skb->queue_mapping is set for incoming packets, ie to
>>> notify which queue they came in on? I can't find it set anywhere,
>>> and it appears it is sometimes set to 1 when it should be 0 in
>>> my system.
>>>
>>> Maybe it's never actually set, and I'm just reading some stale
>>> data?
>>
>> Bleh, found it the second I posted.
>>
>> Seems it's skb_record_rx_queue(), and funny enough, it seems to add +1,
>> so if you are trying to bridge pkts from eth0 to eth1 on the same queues,
>> looks like you need to subtract one on xmit before finding the txqueue.
>>
>> Or something like that.
>>
>
> Just saw your response after I replied. :-)
>
> The queue_mapping storage is a bit odd, but it generally works. The
> value stored in queue_mapping should be decremented properly in
> dev_pick_tx and it should go out of your card with a tx queue that
> matches the rx queue.
>
> There were some issues discovered and fixed with bonding last week
> related to queue_mapping and I would not be surprised if another stacked
> interface like bridging had an issue.
I feel a bit better that I'm not the only one who got
confused on this :)
A quick grep didn't show any queue mgt in bridging code, but
I didn't look closely and might have grep'd the wrong thing.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* [PATCH] MAINTAINERS: Update EBTABLES mailing list
From: Joe Perches @ 2011-06-14 2:26 UTC (permalink / raw)
To: Andrew Morton; +Cc: netfilter-devel, netdev, linux-kernel
It moved to netfilter-devel@vger.kernel.org.
Signed-off-by: Joe Perches <joe@perches.com>
---
MAINTAINERS | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 29801f7..825393f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2292,8 +2292,7 @@ F: drivers/scsi/eata_pio.*
EBTABLES
M: Bart De Schuymer <bart.de.schuymer@pandora.be>
-L: ebtables-user@lists.sourceforge.net
-L: ebtables-devel@lists.sourceforge.net
+L: netfilter-devel@vger.kernel.org
W: http://ebtables.sourceforge.net/
S: Maintained
F: include/linux/netfilter_bridge/ebt_*.h
--
1.7.6.rc0
^ permalink raw reply related
* Re: Is skb->queue_mapping valid for received packets?
From: Andy Gospodarek @ 2011-06-14 2:21 UTC (permalink / raw)
To: Ben Greear; +Cc: NetDev
In-Reply-To: <4DF6C23D.9020704@candelatech.com>
On Mon, Jun 13, 2011 at 07:06:53PM -0700, Ben Greear wrote:
> On 06/13/2011 06:59 PM, Ben Greear wrote:
>>
>> Anyone know if skb->queue_mapping is set for incoming packets, ie to
>> notify which queue they came in on? I can't find it set anywhere,
>> and it appears it is sometimes set to 1 when it should be 0 in
>> my system.
>>
>> Maybe it's never actually set, and I'm just reading some stale
>> data?
>
> Bleh, found it the second I posted.
>
> Seems it's skb_record_rx_queue(), and funny enough, it seems to add +1,
> so if you are trying to bridge pkts from eth0 to eth1 on the same queues,
> looks like you need to subtract one on xmit before finding the txqueue.
>
> Or something like that.
>
Just saw your response after I replied. :-)
The queue_mapping storage is a bit odd, but it generally works. The
value stored in queue_mapping should be decremented properly in
dev_pick_tx and it should go out of your card with a tx queue that
matches the rx queue.
There were some issues discovered and fixed with bonding last week
related to queue_mapping and I would not be surprised if another stacked
interface like bridging had an issue.
^ permalink raw reply
* [PATCH net-next 2/2] net: netfilter: Remove casts of void *
From: Joe Perches @ 2011-06-14 2:21 UTC (permalink / raw)
To: netdev
Cc: Bart De Schuymer, Patrick McHardy, Stephen Hemminger,
David S. Miller, Alexey Kuznetsov, Pekka Savola (ipv6),
James Morris, Hideaki YOSHIFUJI, ebtables-user, ebtables-devel,
netfilter-devel, netfilter, coreteam, bridge, linux-kernel
In-Reply-To: <cover.1308017857.git.joe@perches.com>
Unnecessary casts of void * clutter the code.
These are the remainder casts after several specific
patches to remove netdev_priv and dev_priv.
Done via coccinelle script:
$ cat cast_void_pointer.cocci
@@
type T;
T *pt;
void *pv;
@@
- pt = (T *)pv;
+ pt = pv;
Signed-off-by: Joe Perches <joe@perches.com>
---
net/bridge/netfilter/ebtables.c | 2 +-
net/ipv4/netfilter/arp_tables.c | 16 ++++++----------
net/ipv4/netfilter/ip_tables.c | 13 +++++--------
net/ipv6/netfilter/ip6_tables.c | 13 +++++--------
net/netfilter/ipset/ip_set_core.c | 2 +-
net/netfilter/nf_conntrack_proto.c | 2 +-
6 files changed, 19 insertions(+), 29 deletions(-)
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index 2b5ca1a..a80a44f 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -1667,7 +1667,7 @@ static int compat_copy_entry_to_user(struct ebt_entry *e, void __user **dstptr,
if (*size < sizeof(*ce))
return -EINVAL;
- ce = (struct ebt_entry __user *)*dstptr;
+ ce = *dstptr;
if (copy_to_user(ce, e, sizeof(*ce)))
return -EFAULT;
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
index fd7a3f6..ed46cab 100644
--- a/net/ipv4/netfilter/arp_tables.c
+++ b/net/ipv4/netfilter/arp_tables.c
@@ -370,8 +370,7 @@ static int mark_source_chains(const struct xt_table_info *newinfo,
*/
for (hook = 0; hook < NF_ARP_NUMHOOKS; hook++) {
unsigned int pos = newinfo->hook_entry[hook];
- struct arpt_entry *e
- = (struct arpt_entry *)(entry0 + pos);
+ struct arpt_entry *e = entry0 + pos;
if (!(valid_hooks & (1 << hook)))
continue;
@@ -422,14 +421,12 @@ static int mark_source_chains(const struct xt_table_info *newinfo,
if (pos == oldpos)
goto next;
- e = (struct arpt_entry *)
- (entry0 + pos);
+ e = entry0 + pos;
} while (oldpos == pos + e->next_offset);
/* Move along one */
size = e->next_offset;
- e = (struct arpt_entry *)
- (entry0 + pos + size);
+ e = entry0 + pos + size;
e->counters.pcnt = pos;
pos += size;
} else {
@@ -453,8 +450,7 @@ static int mark_source_chains(const struct xt_table_info *newinfo,
/* ... this is a fallthru */
newpos = pos + e->next_offset;
}
- e = (struct arpt_entry *)
- (entry0 + newpos);
+ e = entry0 + newpos;
e->counters.pcnt = pos;
pos = newpos;
}
@@ -1286,7 +1282,7 @@ compat_copy_entry_from_user(struct compat_arpt_entry *e, void **dstptr,
ret = 0;
origsize = *size;
- de = (struct arpt_entry *)*dstptr;
+ de = *dstptr;
memcpy(de, e, sizeof(struct arpt_entry));
memcpy(&de->counters, &e->counters, sizeof(e->counters));
@@ -1566,7 +1562,7 @@ static int compat_copy_entry_to_user(struct arpt_entry *e, void __user **dstptr,
int ret;
origsize = *size;
- ce = (struct compat_arpt_entry __user *)*dstptr;
+ ce = *dstptr;
if (copy_to_user(ce, e, sizeof(struct arpt_entry)) != 0 ||
copy_to_user(&ce->counters, &counters[i],
sizeof(counters[i])) != 0)
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
index 7647438..3f142fb 100644
--- a/net/ipv4/netfilter/ip_tables.c
+++ b/net/ipv4/netfilter/ip_tables.c
@@ -505,14 +505,12 @@ mark_source_chains(const struct xt_table_info *newinfo,
if (pos == oldpos)
goto next;
- e = (struct ipt_entry *)
- (entry0 + pos);
+ e = entry0 + pos;
} while (oldpos == pos + e->next_offset);
/* Move along one */
size = e->next_offset;
- e = (struct ipt_entry *)
- (entry0 + pos + size);
+ e = entry0 + pos + size;
e->counters.pcnt = pos;
pos += size;
} else {
@@ -535,8 +533,7 @@ mark_source_chains(const struct xt_table_info *newinfo,
/* ... this is a fallthru */
newpos = pos + e->next_offset;
}
- e = (struct ipt_entry *)
- (entry0 + newpos);
+ e = entry0 + newpos;
e->counters.pcnt = pos;
pos = newpos;
}
@@ -1406,7 +1403,7 @@ compat_copy_entry_to_user(struct ipt_entry *e, void __user **dstptr,
int ret = 0;
origsize = *size;
- ce = (struct compat_ipt_entry __user *)*dstptr;
+ ce = *dstptr;
if (copy_to_user(ce, e, sizeof(struct ipt_entry)) != 0 ||
copy_to_user(&ce->counters, &counters[i],
sizeof(counters[i])) != 0)
@@ -1567,7 +1564,7 @@ compat_copy_entry_from_user(struct compat_ipt_entry *e, void **dstptr,
ret = 0;
origsize = *size;
- de = (struct ipt_entry *)*dstptr;
+ de = *dstptr;
memcpy(de, e, sizeof(struct ipt_entry));
memcpy(&de->counters, &e->counters, sizeof(e->counters));
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index 94874b0..b42eb00 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -527,14 +527,12 @@ mark_source_chains(const struct xt_table_info *newinfo,
if (pos == oldpos)
goto next;
- e = (struct ip6t_entry *)
- (entry0 + pos);
+ e = entry0 + pos;
} while (oldpos == pos + e->next_offset);
/* Move along one */
size = e->next_offset;
- e = (struct ip6t_entry *)
- (entry0 + pos + size);
+ e = entry0 + pos + size;
e->counters.pcnt = pos;
pos += size;
} else {
@@ -557,8 +555,7 @@ mark_source_chains(const struct xt_table_info *newinfo,
/* ... this is a fallthru */
newpos = pos + e->next_offset;
}
- e = (struct ip6t_entry *)
- (entry0 + newpos);
+ e = entry0 + newpos;
e->counters.pcnt = pos;
pos = newpos;
}
@@ -1430,7 +1427,7 @@ compat_copy_entry_to_user(struct ip6t_entry *e, void __user **dstptr,
int ret = 0;
origsize = *size;
- ce = (struct compat_ip6t_entry __user *)*dstptr;
+ ce = *dstptr;
if (copy_to_user(ce, e, sizeof(struct ip6t_entry)) != 0 ||
copy_to_user(&ce->counters, &counters[i],
sizeof(counters[i])) != 0)
@@ -1590,7 +1587,7 @@ compat_copy_entry_from_user(struct compat_ip6t_entry *e, void **dstptr,
ret = 0;
origsize = *size;
- de = (struct ip6t_entry *)*dstptr;
+ de = *dstptr;
memcpy(de, e, sizeof(struct ip6t_entry));
memcpy(&de->counters, &e->counters, sizeof(e->counters));
diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c
index 333b0be..fed7ad0 100644
--- a/net/netfilter/ipset/ip_set_core.c
+++ b/net/netfilter/ipset/ip_set_core.c
@@ -1582,7 +1582,7 @@ ip_set_sockfn_get(struct sock *sk, int optval, void __user *user, int *len)
ret = -EFAULT;
goto done;
}
- op = (unsigned *) data;
+ op = data;
if (*op < IP_SET_OP_VERSION) {
/* Check the version at the beginning of operations */
diff --git a/net/netfilter/nf_conntrack_proto.c b/net/netfilter/nf_conntrack_proto.c
index 5701c8d..9a4143d 100644
--- a/net/netfilter/nf_conntrack_proto.c
+++ b/net/netfilter/nf_conntrack_proto.c
@@ -135,7 +135,7 @@ static int kill_l3proto(struct nf_conn *i, void *data)
static int kill_l4proto(struct nf_conn *i, void *data)
{
struct nf_conntrack_l4proto *l4proto;
- l4proto = (struct nf_conntrack_l4proto *)data;
+ l4proto = data;
return nf_ct_protonum(i) == l4proto->l4proto &&
nf_ct_l3num(i) == l4proto->l3proto;
}
--
1.7.6.rc0
^ permalink raw reply related
* [PATCH net-next 1/2] net: Remove casts of void *
From: Joe Perches @ 2011-06-14 2:21 UTC (permalink / raw)
To: netdev
Cc: Patrick McHardy, David S. Miller, Sage Weil, Samuel Ortiz,
Paul Moore, Vlad Yasevich, Sridhar Samudrala, linux-kernel,
ceph-devel, linux-decnet-user, linux-sctp
In-Reply-To: <cover.1308017857.git.joe@perches.com>
Unnecessary casts of void * clutter the code.
These are the remainder casts after several specific
patches to remove netdev_priv and dev_priv.
Done via coccinelle script:
$ cat cast_void_pointer.cocci
@@
type T;
T *pt;
void *pv;
@@
- pt = (T *)pv;
+ pt = pv;
Signed-off-by: Joe Perches <joe@perches.com>
---
net/8021q/vlanproc.c | 2 +-
net/atm/mpc.c | 2 +-
net/ceph/crypto.c | 2 +-
net/decnet/dn_dev.c | 2 +-
net/irda/af_irda.c | 4 ++--
net/irda/ircomm/ircomm_tty_attach.c | 2 +-
net/irda/irda_device.c | 2 +-
net/irda/iriap.c | 8 ++++----
net/irda/irlan/irlan_client.c | 10 +++++-----
net/irda/irlan/irlan_common.c | 10 +++++-----
net/irda/irlan/irlan_eth.c | 2 +-
net/irda/irlan/irlan_provider.c | 10 +++++-----
net/irda/irqueue.c | 4 ++--
net/irda/irttp.c | 18 +++++++++---------
net/key/af_key.c | 20 ++++++++++----------
net/netlabel/netlabel_unlabeled.c | 10 ++++------
net/sctp/bind_addr.c | 2 +-
net/sctp/input.c | 3 +--
net/sctp/sm_make_chunk.c | 26 ++++++++++----------------
net/sctp/sm_sideeffect.c | 2 +-
net/sctp/socket.c | 16 ++++++++--------
21 files changed, 74 insertions(+), 83 deletions(-)
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c
index 016d7f4..d34b6da 100644
--- a/net/8021q/vlanproc.c
+++ b/net/8021q/vlanproc.c
@@ -231,7 +231,7 @@ static void *vlan_seq_next(struct seq_file *seq, void *v, loff_t *pos)
++*pos;
- dev = (struct net_device *)v;
+ dev = v;
if (v == SEQ_START_TOKEN)
dev = net_device_entry(&net->dev_base_head);
diff --git a/net/atm/mpc.c b/net/atm/mpc.c
index 3ccca42..aa97240 100644
--- a/net/atm/mpc.c
+++ b/net/atm/mpc.c
@@ -1005,7 +1005,7 @@ static int mpoa_event_listener(struct notifier_block *mpoa_notifier,
struct mpoa_client *mpc;
struct lec_priv *priv;
- dev = (struct net_device *)dev_ptr;
+ dev = dev_ptr;
if (!net_eq(dev_net(dev), &init_net))
return NOTIFY_DONE;
diff --git a/net/ceph/crypto.c b/net/ceph/crypto.c
index 5a8009c..85f3bc0 100644
--- a/net/ceph/crypto.c
+++ b/net/ceph/crypto.c
@@ -444,7 +444,7 @@ int ceph_key_instantiate(struct key *key, const void *data, size_t datalen)
goto err;
/* TODO ceph_crypto_key_decode should really take const input */
- p = (void*)data;
+ p = (void *)data;
ret = ceph_crypto_key_decode(ckey, &p, (char*)data+datalen);
if (ret < 0)
goto err_ckey;
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index 3780fd6..48530b4 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -1313,7 +1313,7 @@ static void *dn_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos)
++*pos;
- dev = (struct net_device *)v;
+ dev = v;
if (v == SEQ_START_TOKEN)
dev = net_device_entry(&init_net.dev_base_head);
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
index cc61697..c24f25a 100644
--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -369,7 +369,7 @@ static void irda_getvalue_confirm(int result, __u16 obj_id,
{
struct irda_sock *self;
- self = (struct irda_sock *) priv;
+ self = priv;
if (!self) {
IRDA_WARNING("%s: lost myself!\n", __func__);
return;
@@ -418,7 +418,7 @@ static void irda_selective_discovery_indication(discinfo_t *discovery,
IRDA_DEBUG(2, "%s()\n", __func__);
- self = (struct irda_sock *) priv;
+ self = priv;
if (!self) {
IRDA_WARNING("%s: lost myself!\n", __func__);
return;
diff --git a/net/irda/ircomm/ircomm_tty_attach.c b/net/irda/ircomm/ircomm_tty_attach.c
index 3c17540..b65d66e 100644
--- a/net/irda/ircomm/ircomm_tty_attach.c
+++ b/net/irda/ircomm/ircomm_tty_attach.c
@@ -382,7 +382,7 @@ static void ircomm_tty_discovery_indication(discinfo_t *discovery,
info.daddr = discovery->daddr;
info.saddr = discovery->saddr;
- self = (struct ircomm_tty_cb *) priv;
+ self = priv;
ircomm_tty_do_event(self, IRCOMM_TTY_DISCOVERY_INDICATION,
NULL, &info);
}
diff --git a/net/irda/irda_device.c b/net/irda/irda_device.c
index 25cc2e6..3eca35f 100644
--- a/net/irda/irda_device.c
+++ b/net/irda/irda_device.c
@@ -262,7 +262,7 @@ static void irda_task_timer_expired(void *data)
IRDA_DEBUG(2, "%s()\n", __func__);
- task = (struct irda_task *) data;
+ task = data;
irda_task_kick(task);
}
diff --git a/net/irda/iriap.c b/net/irda/iriap.c
index 3647753..dfc7b47 100644
--- a/net/irda/iriap.c
+++ b/net/irda/iriap.c
@@ -300,7 +300,7 @@ static void iriap_disconnect_indication(void *instance, void *sap,
IRDA_DEBUG(4, "%s(), reason=%s\n", __func__, irlmp_reasons[reason]);
- self = (struct iriap_cb *) instance;
+ self = instance;
IRDA_ASSERT(self != NULL, return;);
IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
@@ -754,7 +754,7 @@ static void iriap_connect_confirm(void *instance, void *sap,
{
struct iriap_cb *self;
- self = (struct iriap_cb *) instance;
+ self = instance;
IRDA_ASSERT(self != NULL, return;);
IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
@@ -786,7 +786,7 @@ static void iriap_connect_indication(void *instance, void *sap,
IRDA_DEBUG(1, "%s()\n", __func__);
- self = (struct iriap_cb *) instance;
+ self = instance;
IRDA_ASSERT(skb != NULL, return;);
IRDA_ASSERT(self != NULL, goto out;);
@@ -834,7 +834,7 @@ static int iriap_data_indication(void *instance, void *sap,
IRDA_DEBUG(3, "%s()\n", __func__);
- self = (struct iriap_cb *) instance;
+ self = instance;
IRDA_ASSERT(skb != NULL, return 0;);
IRDA_ASSERT(self != NULL, goto out;);
diff --git a/net/irda/irlan/irlan_client.c b/net/irda/irlan/irlan_client.c
index 7ed3af9..ba1a3fc 100644
--- a/net/irda/irlan/irlan_client.c
+++ b/net/irda/irlan/irlan_client.c
@@ -198,7 +198,7 @@ static int irlan_client_ctrl_data_indication(void *instance, void *sap,
IRDA_DEBUG(2, "%s()\n", __func__ );
- self = (struct irlan_cb *) instance;
+ self = instance;
IRDA_ASSERT(self != NULL, return -1;);
IRDA_ASSERT(self->magic == IRLAN_MAGIC, return -1;);
@@ -226,8 +226,8 @@ static void irlan_client_ctrl_disconnect_indication(void *instance, void *sap,
IRDA_DEBUG(4, "%s(), reason=%d\n", __func__ , reason);
- self = (struct irlan_cb *) instance;
- tsap = (struct tsap_cb *) sap;
+ self = instance;
+ tsap = sap;
IRDA_ASSERT(self != NULL, return;);
IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -298,7 +298,7 @@ static void irlan_client_ctrl_connect_confirm(void *instance, void *sap,
IRDA_DEBUG(4, "%s()\n", __func__ );
- self = (struct irlan_cb *) instance;
+ self = instance;
IRDA_ASSERT(self != NULL, return;);
IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -542,7 +542,7 @@ void irlan_client_get_value_confirm(int result, __u16 obj_id,
IRDA_ASSERT(priv != NULL, return;);
- self = (struct irlan_cb *) priv;
+ self = priv;
IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;);
/* We probably don't need to make any more queries */
diff --git a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c
index 6130f9d..7791176 100644
--- a/net/irda/irlan/irlan_common.c
+++ b/net/irda/irlan/irlan_common.c
@@ -317,8 +317,8 @@ static void irlan_connect_indication(void *instance, void *sap,
IRDA_DEBUG(2, "%s()\n", __func__ );
- self = (struct irlan_cb *) instance;
- tsap = (struct tsap_cb *) sap;
+ self = instance;
+ tsap = sap;
IRDA_ASSERT(self != NULL, return;);
IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -361,7 +361,7 @@ static void irlan_connect_confirm(void *instance, void *sap,
{
struct irlan_cb *self;
- self = (struct irlan_cb *) instance;
+ self = instance;
IRDA_ASSERT(self != NULL, return;);
IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -406,8 +406,8 @@ static void irlan_disconnect_indication(void *instance,
IRDA_DEBUG(0, "%s(), reason=%d\n", __func__ , reason);
- self = (struct irlan_cb *) instance;
- tsap = (struct tsap_cb *) sap;
+ self = instance;
+ tsap = sap;
IRDA_ASSERT(self != NULL, return;);
IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;);
diff --git a/net/irda/irlan/irlan_eth.c b/net/irda/irlan/irlan_eth.c
index 8ee1ff6..e8d5f44 100644
--- a/net/irda/irlan/irlan_eth.c
+++ b/net/irda/irlan/irlan_eth.c
@@ -272,7 +272,7 @@ void irlan_eth_flow_indication(void *instance, void *sap, LOCAL_FLOW flow)
struct irlan_cb *self;
struct net_device *dev;
- self = (struct irlan_cb *) instance;
+ self = instance;
IRDA_ASSERT(self != NULL, return;);
IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;);
diff --git a/net/irda/irlan/irlan_provider.c b/net/irda/irlan/irlan_provider.c
index b8af74a..8b61cf0 100644
--- a/net/irda/irlan/irlan_provider.c
+++ b/net/irda/irlan/irlan_provider.c
@@ -73,7 +73,7 @@ static int irlan_provider_data_indication(void *instance, void *sap,
IRDA_DEBUG(4, "%s()\n", __func__ );
- self = (struct irlan_cb *) instance;
+ self = instance;
IRDA_ASSERT(self != NULL, return -1;);
IRDA_ASSERT(self->magic == IRLAN_MAGIC, return -1;);
@@ -131,8 +131,8 @@ static void irlan_provider_connect_indication(void *instance, void *sap,
IRDA_DEBUG(0, "%s()\n", __func__ );
- self = (struct irlan_cb *) instance;
- tsap = (struct tsap_cb *) sap;
+ self = instance;
+ tsap = sap;
IRDA_ASSERT(self != NULL, return;);
IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -182,8 +182,8 @@ static void irlan_provider_disconnect_indication(void *instance, void *sap,
IRDA_DEBUG(4, "%s(), reason=%d\n", __func__ , reason);
- self = (struct irlan_cb *) instance;
- tsap = (struct tsap_cb *) sap;
+ self = instance;
+ tsap = sap;
IRDA_ASSERT(self != NULL, return;);
IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;);
diff --git a/net/irda/irqueue.c b/net/irda/irqueue.c
index 9715e6e..f06947c 100644
--- a/net/irda/irqueue.c
+++ b/net/irda/irqueue.c
@@ -780,7 +780,7 @@ void* hashbin_lock_find( hashbin_t* hashbin, long hashv, const char* name )
/*
* Search for entry
*/
- entry = (irda_queue_t* ) hashbin_find( hashbin, hashv, name );
+ entry = hashbin_find(hashbin, hashv, name);
/* Release lock */
spin_unlock_irqrestore(&hashbin->hb_spinlock, flags);
@@ -813,7 +813,7 @@ void* hashbin_find_next( hashbin_t* hashbin, long hashv, const char* name,
* This allow to check if the current item is still in the
* hashbin or has been removed.
*/
- entry = (irda_queue_t* ) hashbin_find( hashbin, hashv, name );
+ entry = hashbin_find(hashbin, hashv, name);
/*
* Trick hashbin_get_next() to return what we want
diff --git a/net/irda/irttp.c b/net/irda/irttp.c
index 9d9af46..285ccd6 100644
--- a/net/irda/irttp.c
+++ b/net/irda/irttp.c
@@ -350,7 +350,7 @@ static int irttp_param_max_sdu_size(void *instance, irda_param_t *param,
{
struct tsap_cb *self;
- self = (struct tsap_cb *) instance;
+ self = instance;
IRDA_ASSERT(self != NULL, return -1;);
IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;);
@@ -879,7 +879,7 @@ static int irttp_udata_indication(void *instance, void *sap,
IRDA_DEBUG(4, "%s()\n", __func__);
- self = (struct tsap_cb *) instance;
+ self = instance;
IRDA_ASSERT(self != NULL, return -1;);
IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;);
@@ -914,7 +914,7 @@ static int irttp_data_indication(void *instance, void *sap,
unsigned long flags;
int n;
- self = (struct tsap_cb *) instance;
+ self = instance;
n = skb->data[0] & 0x7f; /* Extract the credits */
@@ -996,7 +996,7 @@ static void irttp_status_indication(void *instance,
IRDA_DEBUG(4, "%s()\n", __func__);
- self = (struct tsap_cb *) instance;
+ self = instance;
IRDA_ASSERT(self != NULL, return;);
IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return;);
@@ -1025,7 +1025,7 @@ static void irttp_flow_indication(void *instance, void *sap, LOCAL_FLOW flow)
{
struct tsap_cb *self;
- self = (struct tsap_cb *) instance;
+ self = instance;
IRDA_ASSERT(self != NULL, return;);
IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return;);
@@ -1208,7 +1208,7 @@ static void irttp_connect_confirm(void *instance, void *sap,
IRDA_DEBUG(4, "%s()\n", __func__);
- self = (struct tsap_cb *) instance;
+ self = instance;
IRDA_ASSERT(self != NULL, return;);
IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return;);
@@ -1292,13 +1292,13 @@ static void irttp_connect_indication(void *instance, void *sap,
__u8 plen;
__u8 n;
- self = (struct tsap_cb *) instance;
+ self = instance;
IRDA_ASSERT(self != NULL, return;);
IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return;);
IRDA_ASSERT(skb != NULL, return;);
- lsap = (struct lsap_cb *) sap;
+ lsap = sap;
self->max_seg_size = max_seg_size - TTP_HEADER;
self->max_header_size = max_header_size+TTP_HEADER;
@@ -1602,7 +1602,7 @@ static void irttp_disconnect_indication(void *instance, void *sap,
IRDA_DEBUG(4, "%s()\n", __func__);
- self = (struct tsap_cb *) instance;
+ self = instance;
IRDA_ASSERT(self != NULL, return;);
IRDA_ASSERT(self->magic == TTP_TSAP_MAGIC, return;);
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 8f92cf8..1e733e9 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -621,7 +621,7 @@ static struct xfrm_state *pfkey_xfrm_state_lookup(struct net *net, const struct
unsigned short family;
xfrm_address_t *xaddr;
- sa = (const struct sadb_sa *) ext_hdrs[SADB_EXT_SA-1];
+ sa = ext_hdrs[SADB_EXT_SA - 1];
if (sa == NULL)
return NULL;
@@ -630,7 +630,7 @@ static struct xfrm_state *pfkey_xfrm_state_lookup(struct net *net, const struct
return NULL;
/* sadb_address_len should be checked by caller */
- addr = (const struct sadb_address *) ext_hdrs[SADB_EXT_ADDRESS_DST-1];
+ addr = ext_hdrs[SADB_EXT_ADDRESS_DST - 1];
if (addr == NULL)
return NULL;
@@ -1039,7 +1039,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net,
int err;
- sa = (const struct sadb_sa *) ext_hdrs[SADB_EXT_SA-1];
+ sa = ext_hdrs[SADB_EXT_SA - 1];
if (!sa ||
!present_and_same_family(ext_hdrs[SADB_EXT_ADDRESS_SRC-1],
ext_hdrs[SADB_EXT_ADDRESS_DST-1]))
@@ -1078,7 +1078,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net,
sa->sadb_sa_encrypt > SADB_X_CALG_MAX) ||
sa->sadb_sa_encrypt > SADB_EALG_MAX)
return ERR_PTR(-EINVAL);
- key = (const struct sadb_key*) ext_hdrs[SADB_EXT_KEY_AUTH-1];
+ key = ext_hdrs[SADB_EXT_KEY_AUTH - 1];
if (key != NULL &&
sa->sadb_sa_auth != SADB_X_AALG_NULL &&
((key->sadb_key_bits+7) / 8 == 0 ||
@@ -1105,14 +1105,14 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net,
if (sa->sadb_sa_flags & SADB_SAFLAGS_NOPMTUDISC)
x->props.flags |= XFRM_STATE_NOPMTUDISC;
- lifetime = (const struct sadb_lifetime*) ext_hdrs[SADB_EXT_LIFETIME_HARD-1];
+ lifetime = ext_hdrs[SADB_EXT_LIFETIME_HARD - 1];
if (lifetime != NULL) {
x->lft.hard_packet_limit = _KEY2X(lifetime->sadb_lifetime_allocations);
x->lft.hard_byte_limit = _KEY2X(lifetime->sadb_lifetime_bytes);
x->lft.hard_add_expires_seconds = lifetime->sadb_lifetime_addtime;
x->lft.hard_use_expires_seconds = lifetime->sadb_lifetime_usetime;
}
- lifetime = (const struct sadb_lifetime*) ext_hdrs[SADB_EXT_LIFETIME_SOFT-1];
+ lifetime = ext_hdrs[SADB_EXT_LIFETIME_SOFT - 1];
if (lifetime != NULL) {
x->lft.soft_packet_limit = _KEY2X(lifetime->sadb_lifetime_allocations);
x->lft.soft_byte_limit = _KEY2X(lifetime->sadb_lifetime_bytes);
@@ -1120,7 +1120,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net,
x->lft.soft_use_expires_seconds = lifetime->sadb_lifetime_usetime;
}
- sec_ctx = (const struct sadb_x_sec_ctx *) ext_hdrs[SADB_X_EXT_SEC_CTX-1];
+ sec_ctx = ext_hdrs[SADB_X_EXT_SEC_CTX - 1];
if (sec_ctx != NULL) {
struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx);
@@ -1134,7 +1134,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net,
goto out;
}
- key = (const struct sadb_key*) ext_hdrs[SADB_EXT_KEY_AUTH-1];
+ key = ext_hdrs[SADB_EXT_KEY_AUTH - 1];
if (sa->sadb_sa_auth) {
int keysize = 0;
struct xfrm_algo_desc *a = xfrm_aalg_get_byid(sa->sadb_sa_auth);
@@ -2219,7 +2219,7 @@ static int pfkey_spdadd(struct sock *sk, struct sk_buff *skb, const struct sadb_
if (xp->selector.dport)
xp->selector.dport_mask = htons(0xffff);
- sec_ctx = (struct sadb_x_sec_ctx *) ext_hdrs[SADB_X_EXT_SEC_CTX-1];
+ sec_ctx = ext_hdrs[SADB_X_EXT_SEC_CTX - 1];
if (sec_ctx != NULL) {
struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx);
@@ -2323,7 +2323,7 @@ static int pfkey_spddelete(struct sock *sk, struct sk_buff *skb, const struct sa
if (sel.dport)
sel.dport_mask = htons(0xffff);
- sec_ctx = (struct sadb_x_sec_ctx *) ext_hdrs[SADB_X_EXT_SEC_CTX-1];
+ sec_ctx = ext_hdrs[SADB_X_EXT_SEC_CTX - 1];
if (sec_ctx != NULL) {
struct xfrm_user_sec_ctx *uctx = pfkey_sadb2xfrm_user_sec_ctx(sec_ctx);
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c
index 9c38658..8efd061 100644
--- a/net/netlabel/netlabel_unlabeled.c
+++ b/net/netlabel/netlabel_unlabeled.c
@@ -426,10 +426,9 @@ int netlbl_unlhsh_add(struct net *net,
audit_info);
switch (addr_len) {
case sizeof(struct in_addr): {
- struct in_addr *addr4, *mask4;
+ const struct in_addr *addr4 = addr;
+ const struct in_addr *mask4 = mask;
- addr4 = (struct in_addr *)addr;
- mask4 = (struct in_addr *)mask;
ret_val = netlbl_unlhsh_add_addr4(iface, addr4, mask4, secid);
if (audit_buf != NULL)
netlbl_af4list_audit_addr(audit_buf, 1,
@@ -440,10 +439,9 @@ int netlbl_unlhsh_add(struct net *net,
}
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
case sizeof(struct in6_addr): {
- struct in6_addr *addr6, *mask6;
+ const struct in6_addr *addr6 = addr;
+ const struct in6_addr *mask6 = mask;
- addr6 = (struct in6_addr *)addr;
- mask6 = (struct in6_addr *)mask;
ret_val = netlbl_unlhsh_add_addr6(iface, addr6, mask6, secid);
if (audit_buf != NULL)
netlbl_af6list_audit_addr(audit_buf, 1,
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c
index 17d1573..4ece451 100644
--- a/net/sctp/bind_addr.c
+++ b/net/sctp/bind_addr.c
@@ -430,7 +430,7 @@ union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp,
list_for_each_entry(laddr, &bp->address_list, list) {
addr_buf = (union sctp_addr *)addrs;
for (i = 0; i < addrcnt; i++) {
- addr = (union sctp_addr *)addr_buf;
+ addr = addr_buf;
af = sctp_get_af_specific(addr->v4.sin_family);
if (!af)
break;
diff --git a/net/sctp/input.c b/net/sctp/input.c
index 741ed16..b7692aa 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -510,8 +510,7 @@ struct sock *sctp_err_lookup(int family, struct sk_buff *skb,
* discard the packet.
*/
if (vtag == 0) {
- chunkhdr = (struct sctp_init_chunk *)((void *)sctphdr
- + sizeof(struct sctphdr));
+ chunkhdr = (void *)sctphdr + sizeof(struct sctphdr);
if (len < sizeof(struct sctphdr) + sizeof(sctp_chunkhdr_t)
+ sizeof(__be32) ||
chunkhdr->chunk_hdr.type != SCTP_CID_INIT ||
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 3363d37..81db4e3 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -2773,7 +2773,7 @@ struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *asoc,
/* Get total length of all the address parameters. */
addr_buf = addrs;
for (i = 0; i < addrcnt; i++) {
- addr = (union sctp_addr *)addr_buf;
+ addr = addr_buf;
af = sctp_get_af_specific(addr->v4.sin_family);
addr_param_len = af->to_addr_param(addr, &addr_param);
@@ -2798,7 +2798,7 @@ struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *asoc,
/* Add the address parameters to the asconf chunk. */
addr_buf = addrs;
for (i = 0; i < addrcnt; i++) {
- addr = (union sctp_addr *)addr_buf;
+ addr = addr_buf;
af = sctp_get_af_specific(addr->v4.sin_family);
addr_param_len = af->to_addr_param(addr, &addr_param);
param.param_hdr.type = flags;
@@ -2958,8 +2958,7 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
union sctp_addr addr;
union sctp_addr_param *addr_param;
- addr_param = (union sctp_addr_param *)
- ((void *)asconf_param + sizeof(sctp_addip_param_t));
+ addr_param = (void *)asconf_param + sizeof(sctp_addip_param_t);
if (asconf_param->param_hdr.type != SCTP_PARAM_ADD_IP &&
asconf_param->param_hdr.type != SCTP_PARAM_DEL_IP &&
@@ -3144,7 +3143,7 @@ struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc,
* asconf parameter.
*/
length = ntohs(addr_param->p.length);
- asconf_param = (sctp_addip_param_t *)((void *)addr_param + length);
+ asconf_param = (void *)addr_param + length;
chunk_len -= length;
/* create an ASCONF_ACK chunk.
@@ -3185,8 +3184,7 @@ struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc,
/* Move to the next ASCONF param. */
length = ntohs(asconf_param->param_hdr.length);
- asconf_param = (sctp_addip_param_t *)((void *)asconf_param +
- length);
+ asconf_param = (void *)asconf_param + length;
chunk_len -= length;
}
@@ -3216,8 +3214,7 @@ static void sctp_asconf_param_success(struct sctp_association *asoc,
struct sctp_transport *transport;
struct sctp_sockaddr_entry *saddr;
- addr_param = (union sctp_addr_param *)
- ((void *)asconf_param + sizeof(sctp_addip_param_t));
+ addr_param = (void *)asconf_param + sizeof(sctp_addip_param_t);
/* We have checked the packet before, so we do not check again. */
af = sctp_get_af_specific(param_type2af(addr_param->p.type));
@@ -3302,8 +3299,7 @@ static __be16 sctp_get_asconf_response(struct sctp_chunk *asconf_ack,
return SCTP_ERROR_NO_ERROR;
case SCTP_PARAM_ERR_CAUSE:
length = sizeof(sctp_addip_param_t);
- err_param = (sctp_errhdr_t *)
- ((void *)asconf_ack_param + length);
+ err_param = (void *)asconf_ack_param + length;
asconf_ack_len -= length;
if (asconf_ack_len > 0)
return err_param->cause;
@@ -3316,8 +3312,7 @@ static __be16 sctp_get_asconf_response(struct sctp_chunk *asconf_ack,
}
length = ntohs(asconf_ack_param->param_hdr.length);
- asconf_ack_param = (sctp_addip_param_t *)
- ((void *)asconf_ack_param + length);
+ asconf_ack_param = (void *)asconf_ack_param + length;
asconf_ack_len -= length;
}
@@ -3349,7 +3344,7 @@ int sctp_process_asconf_ack(struct sctp_association *asoc,
* pointer to the first asconf parameter.
*/
length = ntohs(addr_param->p.length);
- asconf_param = (sctp_addip_param_t *)((void *)addr_param + length);
+ asconf_param = (void *)addr_param + length;
asconf_len -= length;
/* ADDIP 4.1
@@ -3400,8 +3395,7 @@ int sctp_process_asconf_ack(struct sctp_association *asoc,
* one.
*/
length = ntohs(asconf_param->param_hdr.length);
- asconf_param = (sctp_addip_param_t *)((void *)asconf_param +
- length);
+ asconf_param = (void *)asconf_param + length;
asconf_len -= length;
}
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index 534c2e5..1b2bb64 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -1201,7 +1201,7 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
int local_cork = 0;
if (SCTP_EVENT_T_TIMEOUT != event_type)
- chunk = (struct sctp_chunk *) event_arg;
+ chunk = event_arg;
/* Note: This whole file is a huge candidate for rework.
* For example, each command could either have its own handler, so
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 60038fe..fd31b36 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -476,7 +476,7 @@ static int sctp_bindx_add(struct sock *sk, struct sockaddr *addrs, int addrcnt)
/* The list may contain either IPv4 or IPv6 address;
* determine the address length for walking thru the list.
*/
- sa_addr = (struct sockaddr *)addr_buf;
+ sa_addr = addr_buf;
af = sctp_get_af_specific(sa_addr->sa_family);
if (!af) {
retval = -EINVAL;
@@ -555,7 +555,7 @@ static int sctp_send_asconf_add_ip(struct sock *sk,
*/
addr_buf = addrs;
for (i = 0; i < addrcnt; i++) {
- addr = (union sctp_addr *)addr_buf;
+ addr = addr_buf;
af = sctp_get_af_specific(addr->v4.sin_family);
if (!af) {
retval = -EINVAL;
@@ -588,7 +588,7 @@ static int sctp_send_asconf_add_ip(struct sock *sk,
*/
addr_buf = addrs;
for (i = 0; i < addrcnt; i++) {
- addr = (union sctp_addr *)addr_buf;
+ addr = addr_buf;
af = sctp_get_af_specific(addr->v4.sin_family);
memcpy(&saveaddr, addr, af->sockaddr_len);
retval = sctp_add_bind_addr(bp, &saveaddr,
@@ -659,7 +659,7 @@ static int sctp_bindx_rem(struct sock *sk, struct sockaddr *addrs, int addrcnt)
goto err_bindx_rem;
}
- sa_addr = (union sctp_addr *)addr_buf;
+ sa_addr = addr_buf;
af = sctp_get_af_specific(sa_addr->sa.sa_family);
if (!af) {
retval = -EINVAL;
@@ -758,7 +758,7 @@ static int sctp_send_asconf_del_ip(struct sock *sk,
*/
addr_buf = addrs;
for (i = 0; i < addrcnt; i++) {
- laddr = (union sctp_addr *)addr_buf;
+ laddr = addr_buf;
af = sctp_get_af_specific(laddr->v4.sin_family);
if (!af) {
retval = -EINVAL;
@@ -830,7 +830,7 @@ skip_mkasconf:
*/
addr_buf = addrs;
for (i = 0; i < addrcnt; i++) {
- laddr = (union sctp_addr *)addr_buf;
+ laddr = addr_buf;
af = sctp_get_af_specific(laddr->v4.sin_family);
list_for_each_entry(saddr, &bp->address_list, list) {
if (sctp_cmp_addr_exact(&saddr->a, laddr))
@@ -997,7 +997,7 @@ SCTP_STATIC int sctp_setsockopt_bindx(struct sock* sk,
return -EINVAL;
}
- sa_addr = (struct sockaddr *)addr_buf;
+ sa_addr = addr_buf;
af = sctp_get_af_specific(sa_addr->sa_family);
/* If the address family is not supported or if this address
@@ -1088,7 +1088,7 @@ static int __sctp_connect(struct sock* sk,
goto out_free;
}
- sa_addr = (union sctp_addr *)addr_buf;
+ sa_addr = addr_buf;
af = sctp_get_af_specific(sa_addr->sa.sa_family);
/* If the address family is not supported or if this address
--
1.7.6.rc0
^ permalink raw reply related
* [PATCH net-next 0/2] net: remove casts of void *
From: Joe Perches @ 2011-06-14 2:21 UTC (permalink / raw)
To: netdev
Cc: linux-kernel, ebtables-user, ebtables-devel, netfilter-devel,
netfilter, coreteam, bridge, ceph-devel, linux-decnet-user,
linux-sctp
Joe Perches (2):
net: Remove casts of void *
net: netfilter: Remove casts of void *
net/8021q/vlanproc.c | 2 +-
net/atm/mpc.c | 2 +-
net/bridge/netfilter/ebtables.c | 2 +-
net/ceph/crypto.c | 2 +-
net/decnet/dn_dev.c | 2 +-
net/ipv4/netfilter/arp_tables.c | 16 ++++++----------
net/ipv4/netfilter/ip_tables.c | 13 +++++--------
net/ipv6/netfilter/ip6_tables.c | 13 +++++--------
net/irda/af_irda.c | 4 ++--
net/irda/ircomm/ircomm_tty_attach.c | 2 +-
net/irda/irda_device.c | 2 +-
net/irda/iriap.c | 8 ++++----
net/irda/irlan/irlan_client.c | 10 +++++-----
net/irda/irlan/irlan_common.c | 10 +++++-----
net/irda/irlan/irlan_eth.c | 2 +-
net/irda/irlan/irlan_provider.c | 10 +++++-----
net/irda/irqueue.c | 4 ++--
net/irda/irttp.c | 18 +++++++++---------
net/key/af_key.c | 20 ++++++++++----------
net/netfilter/ipset/ip_set_core.c | 2 +-
net/netfilter/nf_conntrack_proto.c | 2 +-
net/netlabel/netlabel_unlabeled.c | 10 ++++------
net/sctp/bind_addr.c | 2 +-
net/sctp/input.c | 3 +--
net/sctp/sm_make_chunk.c | 26 ++++++++++----------------
net/sctp/sm_sideeffect.c | 2 +-
net/sctp/socket.c | 16 ++++++++--------
27 files changed, 93 insertions(+), 112 deletions(-)
--
1.7.6.rc0
^ permalink raw reply
* Re: Is skb->queue_mapping valid for received packets?
From: Andy Gospodarek @ 2011-06-14 2:16 UTC (permalink / raw)
To: Ben Greear; +Cc: NetDev
In-Reply-To: <4DF6C091.5050301@candelatech.com>
On Mon, Jun 13, 2011 at 06:59:45PM -0700, Ben Greear wrote:
>
> Anyone know if skb->queue_mapping is set for incoming packets, ie to
> notify which queue they came in on? I can't find it set anywhere,
> and it appears it is sometimes set to 1 when it should be 0 in
> my system.
>
> Maybe it's never actually set, and I'm just reading some stale
> data?
>
> Thanks,
> Ben
Yes, it is set by calls to skb_record_rx_queue in various multiqueue-
capable ethernet drivers. Where are you checking it and seeing the
incorrect value?
^ permalink raw reply
* Re: Is skb->queue_mapping valid for received packets?
From: Ben Greear @ 2011-06-14 2:06 UTC (permalink / raw)
To: NetDev
In-Reply-To: <4DF6C091.5050301@candelatech.com>
On 06/13/2011 06:59 PM, Ben Greear wrote:
>
> Anyone know if skb->queue_mapping is set for incoming packets, ie to
> notify which queue they came in on? I can't find it set anywhere,
> and it appears it is sometimes set to 1 when it should be 0 in
> my system.
>
> Maybe it's never actually set, and I'm just reading some stale
> data?
Bleh, found it the second I posted.
Seems it's skb_record_rx_queue(), and funny enough, it seems to add +1,
so if you are trying to bridge pkts from eth0 to eth1 on the same queues,
looks like you need to subtract one on xmit before finding the txqueue.
Or something like that.
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* Is skb->queue_mapping valid for received packets?
From: Ben Greear @ 2011-06-14 1:59 UTC (permalink / raw)
To: NetDev
Anyone know if skb->queue_mapping is set for incoming packets, ie to
notify which queue they came in on? I can't find it set anywhere,
and it appears it is sometimes set to 1 when it should be 0 in
my system.
Maybe it's never actually set, and I'm just reading some stale
data?
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* [PATCH 2/2] IGMP snooping: set mrouters_only flag for IPv6 traffic properly
From: Fernando Luis Vázquez Cao @ 2011-06-14 1:06 UTC (permalink / raw)
To: Herbert Xu; +Cc: Stephen Hemminger, netdev, Hideaki YOSHIFUJI, David S. Miller
In-Reply-To: <1308013301.3896.6.camel@nexus.oss.ntt.co.jp>
Upon reception of a MGM report packet the kernel sets the mrouters_only flag
in a skb that is a clone of the original skb, which means that the bridge
loses track of MGM packets (cb buffers are tied to a specific skb and not
shared) and it ends up forwading join requests to the bridge interface.
This can cause unexpected membership timeouts and intermitent/permanent loss
of connectivity as described in RFC 4541 [2.1.1. IGMP Forwarding Rules]:
A snooping switch should forward IGMP Membership Reports only to
those ports where multicast routers are attached.
[...]
Sending membership reports to other hosts can result, for IGMPv1
and IGMPv2, in unintentionally preventing a host from joining a
specific multicast group.
Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
---
diff -urNp linux-3.0-rc2-orig/net/bridge/br_multicast.c linux-3.0-rc2/net/bridge/br_multicast.c
--- linux-3.0-rc2-orig/net/bridge/br_multicast.c 2011-06-13 12:10:27.805554187 +0900
+++ linux-3.0-rc2/net/bridge/br_multicast.c 2011-06-13 12:12:27.591626915 +0900
@@ -1543,7 +1543,7 @@ static int br_multicast_ipv6_rcv(struct
goto out;
}
mld = (struct mld_msg *)skb_transport_header(skb2);
- BR_INPUT_SKB_CB(skb2)->mrouters_only = 1;
+ BR_INPUT_SKB_CB(skb)->mrouters_only = 1;
err = br_ip6_multicast_add_group(br, port, &mld->mld_mca);
break;
}
^ permalink raw reply
* [PATCH 1/2] IGMP snooping: set mrouters_only flag for IPv4 traffic properly
From: Fernando Luis Vázquez Cao @ 2011-06-14 1:04 UTC (permalink / raw)
To: Herbert Xu; +Cc: Stephen Hemminger, netdev, Hayato Kakuta, David S. Miller
In-Reply-To: <1308013301.3896.6.camel@nexus.oss.ntt.co.jp>
Upon reception of a IGMP/IGMPv2 membership report the kernel sets the
mrouters_only flag in a skb that may be a clone of the original skb, which
means that sometimes the bridge loses track of membership report packets (cb
buffers are tied to a specific skb and not shared) and it ends up forwading
join requests to the bridge interface.
This can cause unexpected membership timeouts and intermitent/permanent loss
of connectivity as described in RFC 4541 [2.1.1. IGMP Forwarding Rules]:
A snooping switch should forward IGMP Membership Reports only to
those ports where multicast routers are attached.
[...]
Sending membership reports to other hosts can result, for IGMPv1
and IGMPv2, in unintentionally preventing a host from joining a
specific multicast group.
Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
Tested-by: Hayato Kakuta <kakuta.hayato@oss.ntt.co.jp>
---
diff -urNp linux-3.0-rc2-orig/net/bridge/br_multicast.c linux-3.0-rc2/net/bridge/br_multicast.c
--- linux-3.0-rc2-orig/net/bridge/br_multicast.c 2011-06-09 13:34:04.164261031 +0900
+++ linux-3.0-rc2/net/bridge/br_multicast.c 2011-06-09 20:04:23.473930447 +0900
@@ -1424,7 +1424,7 @@ static int br_multicast_ipv4_rcv(struct
switch (ih->type) {
case IGMP_HOST_MEMBERSHIP_REPORT:
case IGMPV2_HOST_MEMBERSHIP_REPORT:
- BR_INPUT_SKB_CB(skb2)->mrouters_only = 1;
+ BR_INPUT_SKB_CB(skb)->mrouters_only = 1;
err = br_ip4_multicast_add_group(br, port, ih->group);
break;
case IGMPV3_HOST_MEMBERSHIP_REPORT:
^ permalink raw reply
* Re: [PATCH 0/2] IGMP snooping: set mrouters_only flag properly
From: Fernando Luis Vázquez Cao @ 2011-06-14 1:01 UTC (permalink / raw)
To: Herbert Xu; +Cc: Stephen Hemminger, netdev, David S. Miller
In-Reply-To: <1307933995.2704.11.camel@nausicaa>
On Mon, 2011-06-13 at 11:59 +0900, Fernando Luis Vazquez Cao wrote:
> I am sending you a fix for a IGMP snooping bug that bit us when we tried
> to deploy it in production. This bug has been present since day one in
> the IGMP code and I think the fix deserves a backport to -stable
> (>=2.6.34).
>
> The reason I am sending you separate patches for IPv4 and IPv6 is that I
> wanted to acknowledge Hayato Kakuta for his extensive testing of IPv4's
> IGMP code.
I fat fingered the subject of the first patch and found some typos. I
will be replying to this email with the updated patches. I am sorry for
the noise.
David, would you be picking up these fixes or should they go through
someone else's tree. Hopefully I got the mailing list right this time
around.
Thanks,
Fernando
^ permalink raw reply
* Re: [PATCH] sky2: avoid using uninitialized variable
From: Greg Thelen @ 2011-06-14 0:34 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Stephen Hemminger, netdev, linux-kernel@vger.kernel.org
In-Reply-To: <20110613181212.571f8e76@s6510.ftrdhcpuser.net>
On Mon, Jun 13, 2011 at 3:12 PM, Stephen Hemminger
<shemminger@vyatta.com> wrote:
> On Mon, 13 Jun 2011 14:21:59 -0700
> Greg Thelen <gthelen@google.com> wrote:
>
>> I am not sure if 0 or ~0 would be a better choice in the gm_phy_read()
>> error case. I used 0. A more complete solution might be to plumb up
>> error handling to the callers of gm_phy_read().
>>
>> ==
>> From 37486219a3d93881f3b2619a4b2bb21be62db7d4 Mon Sep 17 00:00:00 2001
>> From: Greg Thelen <gthelen@google.com>
>> Date: Mon, 13 Jun 2011 14:09:07 -0700
>> Subject: [PATCH] sky2: avoid using uninitialized variable
>>
>> Prior to this change gm_phy_read() could return an uninitialized
>> variable if __gm_phy_read() failed.
>>
>> This change returns zero in the failure case.
>>
>> Signed-off-by: Greg Thelen <gthelen@google.com>
>
> Shouldn't the callers be changed to check rather than just returning
> 0 and masking the problem.
I agree that the right long term solution is to plumb the error
handling up through the callers. This would involve deleting the
error-free gm_phy_read() routine and replacing all calls to it with
calls to error-capable __gm_phy_read(). This would require converting
several routines from returning void to returning int allowing errors
to propagate upwards. Notable affected routines include:
sky2_phy_power_up(), sky2_wol_init(), sky2_phy_power_down(),
sky2_hw_down(), sky2_mac_init(), sky2_hw_up(), sky2_phy_intr(),
sky2_led(). sky2_restart() would likely have to re-queue the work
item in the case of failure. Presumably sky2_poll() would return 0 if
error is seen. On a related note, it also seems that gm_phy_write()
callers should be checking its return value to also handle the same
class of I/O errors. Testing these changes would involve injecting
error values or access to certain kinds of broken hardware.
For the short term I figured that not consuming random data was a step
in right direction. But I understand if you prefer to hold out for
the complete solution. Unfortunately, I do not currently have time to
contribute to the complete solution.
^ permalink raw reply
* Re: [net-next 24/40] ixgbe: alloc DDP PCI pool and ixgbe queues as per NUMA nodes
From: Vasu Dev @ 2011-06-14 0:14 UTC (permalink / raw)
To: Ben Hutchings; +Cc: Jeff Kirsher, davem, Vasu Dev, netdev, gospo
In-Reply-To: <1307451503.2908.5.camel@bwh-desktop>
On Tue, 2011-06-07 at 13:58 +0100, Ben Hutchings wrote:
> On Tue, 2011-06-07 at 05:32 -0700, Jeff Kirsher wrote:
> > From: Vasu Dev <vasu.dev@intel.com>
> >
> > Have DDP PCI pools allocated from closest NUMA node to the CPU
> > and have ixgbe queues allocs per NUMA node.
> >
> > Signed-off-by: Vasu Dev <vasu.dev@intel.com>
> > Tested-by: Ross Brattain <ross.b.brattain@intel.com>
> > Tested-by: Evan Swanson <evan.swanson@intel.com>
> > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> > ---
> > drivers/net/ixgbe/ixgbe_fcoe.c | 8 ++++++--
> > drivers/net/ixgbe/ixgbe_main.c | 12 +++++++++---
> > 2 files changed, 15 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/net/ixgbe/ixgbe_fcoe.c b/drivers/net/ixgbe/ixgbe_fcoe.c
> > index aadff4f..71e8458 100644
> > --- a/drivers/net/ixgbe/ixgbe_fcoe.c
> > +++ b/drivers/net/ixgbe/ixgbe_fcoe.c
> > @@ -615,7 +615,7 @@ static void ixgbe_fcoe_ddp_pools_free(struct ixgbe_fcoe *fcoe)
> > static void ixgbe_fcoe_ddp_pools_alloc(struct ixgbe_adapter *adapter)
> > {
> > struct ixgbe_fcoe *fcoe = &adapter->fcoe;
> > - unsigned int cpu;
> > + unsigned int cpu, nid;
> > struct pci_pool **pool;
> > char pool_name[32];
> >
> > @@ -623,19 +623,23 @@ static void ixgbe_fcoe_ddp_pools_alloc(struct ixgbe_adapter *adapter)
> > if (!fcoe->pool)
> > return;
> >
> > + nid = dev_to_node(&adapter->pdev->dev);
> > /* allocate pci pool for each cpu */
> > for_each_possible_cpu(cpu) {
> > snprintf(pool_name, 32, "ixgbe_fcoe_ddp_%d", cpu);
> > pool = per_cpu_ptr(fcoe->pool, cpu);
> > + set_dev_node(&adapter->pdev->dev, cpu_to_node(cpu));
> > *pool = pci_pool_create(pool_name,
> > adapter->pdev, IXGBE_FCPTR_MAX,
> > IXGBE_FCPTR_ALIGN, PAGE_SIZE);
> > if (!*pool) {
> > e_err(drv, "failed to alloc DDP pool on cpu:%d\n", cpu);
> > ixgbe_fcoe_ddp_pools_free(fcoe);
> > - return;
> > + break;
> > }
> > }
> > + /* restore original node value */
> > + set_dev_node(&adapter->pdev->dev, nid);
> > }
> [...]
>
> This is a horrible hack. You should fix the API so that you can
> override the node ID, rather than modifying the device.
OK I'll take node id check out of this patch and another patch could do
API change to use node id as you suggested.
Thanks
Vasu
^ permalink raw reply
* Re: [PATCH] Documentation:change all arch/i386 to arch/x86 in Documentation
From: Paul E. McKenney @ 2011-06-14 0:06 UTC (permalink / raw)
To: Wanlong Gao
Cc: linux-doc, linux-kernel, netdev, linux-kbuild, linux-video,
xiyoulinuxkernelgroup, linux-kernel, Dipankar Sarma, Randy Dunlap,
Nick Piggin, Karsten Keil, Michal Marek, James Bottomley,
Martin Mares, Harry Wei, Chuck Lever, Trond Myklebust,
Thomas Weber, Mike Frysinger, Jiri Kosina, Justin P. Mattock
In-Reply-To: <1308007716.2267.2.camel@Tux>
On Tue, Jun 14, 2011 at 07:28:36AM +0800, Wanlong Gao wrote:
> On 一, 2011-06-13 at 10:23 -0700, Paul E. McKenney wrote:
> > On Mon, Jun 13, 2011 at 01:28:18PM +0800, Wanlong Gao wrote:
> > > From: Wanlong Gao <wanlong.gao@gmail.com>
> > >
> > > Change all "arch/i386" to "arch/x86" in Documentaion/,
> > > since the directory has changed.
> > >
> > > Signed-off-by: Wanlong Gao <wanlong.gao@gmail.com>
> >
> > I have queued the Documentation/RCU/NMI-RCU.txt hunk with your
> > Signed-off-by, thank you!
> >
> > Thanx, Paul
> Hi Paul:
> http://git.kernel.org/?p=linux/kernel/git/jikos/trivial.git;a=commitdiff;h=25eb650a690b95cb0e2cf0c3b03f4900a59e0135
> jiri had queued these all, will it get a merge failure?
If it does, I will drop mine.
Thanx, Paul
> Thanks
> >
> > > ---
> > > Documentation/RCU/NMI-RCU.txt | 4 +-
> > > Documentation/blockdev/README.DAC960 | 2 +-
> > > Documentation/blockdev/ramdisk.txt | 8 +++---
> > > Documentation/cpu-freq/cpu-drivers.txt | 2 +-
> > > Documentation/filesystems/nfs/nfsroot.txt | 2 +-
> > > Documentation/isdn/README.HiSax | 2 +-
> > > Documentation/kbuild/makefiles.txt | 38 ++++++++++++++--------------
> > > Documentation/magic-number.txt | 2 +-
> > > Documentation/mca.txt | 6 ++--
> > > Documentation/scheduler/sched-arch.txt | 2 +-
> > > Documentation/scsi/BusLogic.txt | 2 +-
> > > Documentation/serial/computone.txt | 2 +-
> > > Documentation/svga.txt | 2 +-
> > > Documentation/zh_CN/magic-number.txt | 2 +-
> > > 14 files changed, 38 insertions(+), 38 deletions(-)
> <snip patch>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [net-next 13/13] ixgbe: use per NUMA node lock for FCoE DDP
From: Vasu Dev @ 2011-06-14 0:02 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Jeff Kirsher, davem, Vasu Dev, netdev, gospo
In-Reply-To: <1307769482.2872.62.camel@edumazet-laptop>
On Sat, 2011-06-11 at 07:18 +0200, Eric Dumazet wrote:
> > +static void ixgbe_fcoe_lock_init(struct ixgbe_fcoe *fcoe)
> > +{
> > + int node;
> > + spinlock_t *node_lock;
> > +
> > + fcoe->node_lock = kzalloc(sizeof(node_lock) *
> num_possible_nodes(),
> > + GFP_KERNEL);
>
> Hmm...
>
> 1) Think of what happens if some machine has 3 possible nodes : 0, 2,
> 3
>
> -> You should use nr_node_ids instead of num_possible_nodes()
>
Just curious won't these both return same values ? Anycase use of
nr_nodes_ids looks better as it is already set.
> 2) Make sure this block cant have false sharing : Allocate at least a
> full cache line : On a typical 2 node machine, you currently allocate
> 16bytes of memory, and this small block could share a contended cache
> line.
Yeap good point. Thanks
>
>
> > + if (!fcoe->node_lock)
^ permalink raw reply
* Re: [net-next 13/13] ixgbe: use per NUMA node lock for FCoE DDP
From: Vasu Dev @ 2011-06-13 23:59 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Jeff Kirsher, davem, Vasu Dev, netdev, gospo
In-Reply-To: <1307770931.2872.70.camel@edumazet-laptop>
On Sat, 2011-06-11 at 07:42 +0200, Eric Dumazet wrote:
> Le samedi 11 juin 2011 à 07:18 +0200, Eric Dumazet a écrit :
> > > /**
> > > diff --git a/drivers/net/ixgbe/ixgbe_fcoe.h b/drivers/net/ixgbe/ixgbe_fcoe.h
> > > index d876e7a..8618892 100644
> > > --- a/drivers/net/ixgbe/ixgbe_fcoe.h
> > > +++ b/drivers/net/ixgbe/ixgbe_fcoe.h
> > > @@ -69,6 +69,7 @@ struct ixgbe_fcoe {
> > > struct pci_pool **pool;
> > > atomic_t refcnt;
> > > spinlock_t lock;
> > > + struct spinlock **node_lock;
> >
> > Wont this read_mostly pointer sits in often modified cache line ?
> >
> > > struct ixgbe_fcoe_ddp ddp[IXGBE_FCOE_DDP_MAX];
> > > unsigned char *extra_ddp_buffer;
> > > dma_addr_t extra_ddp_buffer_dma;
> >
>
> This patch seems overkill to me, have you tried the more simple way I
> did in commit 79640a4ca6955e3ebdb7038508fa7a0cd7fa5527
> (net: add additional lock to qdisc to increase throughput )
>
Conceptually this patch does same as referred patch from you, in your
case added Qdisc busylock worked fine with multiple tx/Qdisc but for
fcoe a single ixgbe_fcoe instance is used and therefore this patch
required to setup per node lock similar to Qdisc busylock and that was
the only additional code here and rest is similar.
> (remember you must place ->busylock in a separate cache line, to not
> slow down the two cpus that have access to ->lock)
>
> struct ixgbe_fcoe could probably be more carefuly reordered to lower
> false sharing
>
I did optimize ixgbe_fcoe due to added node_lock using pahole and not to
stepped on any mostly modified line beside also reducing holes, but
moving far away in the struct on new cacheline boundary is even better
and I'll do that in updated patch.
> I kindly ask you guys provide actual perf numbers between
>
> 1) before any patch
> 2) After your multilevel per numanode locks
> 3) A more simple way (my suggestion of adding a single 'busylock')
>
I'm retracting this patch for now and in case of updated patch I'll get
number by just this change, earlier I had number w/ and w/o three DDP
related improvements patches in this series and that had net 26% IOPS
increase for 512Bytes reads but that is mainly from other patch adding
per CPU pci pool. The two sockets systems had about same IOPS w/ or w/o
just this patch and so may be this will work better w/ more sockets, so
I'll will respin this patch only if I see any justifiable gain by just
this patch.
Thanks
Vasu
> Thanks
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [Bugme-new] [Bug 37172] New: Enabling 802.1q vlan causes some packets to be received with a vlan id of 64
From: Andrew Morton @ 2011-06-13 23:43 UTC (permalink / raw)
To: a.reversat; +Cc: bugme-daemon, netdev, Patrick McHardy
In-Reply-To: <bug-37172-10286@https.bugzilla.kernel.org/>
(switched to email. Please respond via emailed reply-to-all, not via the
bugzilla web interface).
On Fri, 10 Jun 2011 19:20:58 GMT
bugzilla-daemon@bugzilla.kernel.org wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=37172
>
> Summary: Enabling 802.1q vlan causes some packets to be
> received with a vlan id of 64
> Product: Networking
> Version: 2.5
> Kernel Version: 2.6.39
> Platform: All
> OS/Version: Linux
> Tree: Mainline
> Status: NEW
> Severity: normal
> Priority: P1
> Component: Other
> AssignedTo: acme@ghostprotocols.net
> ReportedBy: a.reversat@gmail.com
> Regression: Yes
>From which kernel version did we regress? Was 2.6.38 OK?
Thanks.
>
> Created an attachment (id=61502)
> --> (https://bugzilla.kernel.org/attachment.cgi?id=61502)
> Packet capture of problem
>
> I added a vlan to my main network card by doing :
>
> vconfig add eth0 6
>
> Then I got huge packet loss when pinging e.g google (around 70% packet loss).
>
> After checking a packet capture it seems that some packets come in with a vlan
> tag even though they shouldn't. In my capture I see them with a vlan id of 64
> where they shouldn't even be 802.1q tagged.
>
> Kernel version is 2.6.39 and I am using the forcedeth driver so I don't know if
> it is related to the network stack or the forcedeth driver.
>
> Attached is the relevant capture. Note how packet with seq 2 for instance is
> tagged and packet with seq 5 isn't.
>
> I'll test this with the latest 3.0 rc and update the bug report if the problem
> is fixed in there.
>
^ permalink raw reply
* [PATCH net-next 6/8] tg3: Show flowctrl settings through get_settings()
From: Matt Carlson @ 2011-06-13 23:39 UTC (permalink / raw)
To: davem; +Cc: netdev, mcarlson
This patch adds code to present the flow control advertisements through
the ethtool get_settings callback.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
---
drivers/net/tg3.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 7ce50e5..a7bea86 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -9934,6 +9934,18 @@ static int tg3_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
}
cmd->advertising = tp->link_config.advertising;
+ if (tg3_flag(tp, PAUSE_AUTONEG)) {
+ if (tp->link_config.flowctrl & FLOW_CTRL_RX) {
+ if (tp->link_config.flowctrl & FLOW_CTRL_TX) {
+ cmd->advertising |= ADVERTISED_Pause;
+ } else {
+ cmd->advertising |= ADVERTISED_Pause |
+ ADVERTISED_Asym_Pause;
+ }
+ } else if (tp->link_config.flowctrl & FLOW_CTRL_TX) {
+ cmd->advertising |= ADVERTISED_Asym_Pause;
+ }
+ }
if (netif_running(dev)) {
ethtool_cmd_speed_set(cmd, tp->link_config.active_speed);
cmd->duplex = tp->link_config.active_duplex;
--
1.7.3.4
^ permalink raw reply related
* [PATCH net-next 2/8] tg3: Remove 40BIT_DMA_LIMIT_BUG
From: Matt Carlson @ 2011-06-13 23:38 UTC (permalink / raw)
To: davem; +Cc: netdev, mcarlson
This patch removes the 40BIT_DMA_LIMIT_BUG flag. There already exists a
flag for this purpose (TG3_FLAG_40BIT_DMA_BUG) and was already being
used in the correct spot.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
---
drivers/net/tg3.c | 8 ++------
drivers/net/tg3.h | 1 -
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index e8f16c5..488bcf9 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -6022,8 +6022,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
tg3_4g_overflow_test(mapping, len))
would_hit_hwbug = 1;
- if (tg3_flag(tp, 40BIT_DMA_LIMIT_BUG) &&
- tg3_40bit_overflow_test(tp, mapping, len))
+ if (tg3_40bit_overflow_test(tp, mapping, len))
would_hit_hwbug = 1;
if (tg3_flag(tp, 5701_DMA_BUG))
@@ -6060,8 +6059,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
tg3_4g_overflow_test(mapping, len))
would_hit_hwbug = 1;
- if (tg3_flag(tp, 40BIT_DMA_LIMIT_BUG) &&
- tg3_40bit_overflow_test(tp, mapping, len))
+ if (tg3_40bit_overflow_test(tp, mapping, len))
would_hit_hwbug = 1;
if (tg3_flag(tp, HW_TSO_1) ||
@@ -13710,8 +13708,6 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
if (tg3_flag(tp, 5755_PLUS))
tg3_flag_set(tp, SHORT_DMA_BUG);
- else
- tg3_flag_set(tp, 40BIT_DMA_LIMIT_BUG);
if (tg3_flag(tp, 5717_PLUS))
tg3_flag_set(tp, LRG_PROD_RING_CAP);
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 3c113c1..4f5dbf6 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -2897,7 +2897,6 @@ enum TG3_FLAGS {
TG3_FLAG_ENABLE_RSS,
TG3_FLAG_ENABLE_TSS,
TG3_FLAG_4G_DMA_BNDRY_BUG,
- TG3_FLAG_40BIT_DMA_LIMIT_BUG,
TG3_FLAG_SHORT_DMA_BUG,
TG3_FLAG_USE_JUMBO_BDFLAG,
TG3_FLAG_L1PLLPD_EN,
--
1.7.3.4
^ permalink raw reply related
* [PATCH net-next 7/8] tg3: Migrate phy preprocessor defs to system defs
From: Matt Carlson @ 2011-06-13 23:39 UTC (permalink / raw)
To: davem; +Cc: netdev, mcarlson
This patch changes to code to use some of the preprocessor
definitions from mii.h over its homegrown equivalents.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
---
drivers/net/tg3.c | 26 ++++++++++++--------------
drivers/net/tg3.h | 8 --------
include/linux/mii.h | 2 ++
3 files changed, 14 insertions(+), 22 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index a7bea86..7dfacc0 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -861,7 +861,7 @@ static int tg3_writephy(struct tg3 *tp, int reg, u32 val)
int ret;
if ((tp->phy_flags & TG3_PHYFLG_IS_FET) &&
- (reg == MII_TG3_CTRL || reg == MII_TG3_AUX_CTRL))
+ (reg == MII_CTRL1000 || reg == MII_TG3_AUX_CTRL))
return 0;
if ((tp->mi_mode & MAC_MI_MODE_AUTO_POLL) != 0) {
@@ -1981,15 +1981,14 @@ static int tg3_phy_reset_5703_4_5(struct tg3 *tp)
/* Set full-duplex, 1000 mbps. */
tg3_writephy(tp, MII_BMCR,
- BMCR_FULLDPLX | TG3_BMCR_SPEED1000);
+ BMCR_FULLDPLX | BMCR_SPEED1000);
/* Set to master mode. */
- if (tg3_readphy(tp, MII_TG3_CTRL, &phy9_orig))
+ if (tg3_readphy(tp, MII_CTRL1000, &phy9_orig))
continue;
- tg3_writephy(tp, MII_TG3_CTRL,
- (MII_TG3_CTRL_AS_MASTER |
- MII_TG3_CTRL_ENABLE_AS_MASTER));
+ tg3_writephy(tp, MII_CTRL1000,
+ CTL1000_AS_MASTER | CTL1000_ENABLE_MASTER);
err = TG3_PHY_AUXCTL_SMDSP_ENABLE(tp);
if (err)
@@ -2014,7 +2013,7 @@ static int tg3_phy_reset_5703_4_5(struct tg3 *tp)
TG3_PHY_AUXCTL_SMDSP_DISABLE(tp);
- tg3_writephy(tp, MII_TG3_CTRL, phy9_orig);
+ tg3_writephy(tp, MII_CTRL1000, phy9_orig);
if (!tg3_readphy(tp, MII_TG3_EXT_CTRL, ®32)) {
reg32 &= ~0x3000;
@@ -2958,16 +2957,15 @@ static int tg3_phy_autoneg_cfg(struct tg3 *tp, u32 advertise, u32 flowctrl)
new_adv = 0;
if (advertise & ADVERTISED_1000baseT_Half)
- new_adv |= MII_TG3_CTRL_ADV_1000_HALF;
+ new_adv |= ADVERTISE_1000HALF;
if (advertise & ADVERTISED_1000baseT_Full)
- new_adv |= MII_TG3_CTRL_ADV_1000_FULL;
+ new_adv |= ADVERTISE_1000FULL;
if (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0 ||
tp->pci_chip_rev_id == CHIPREV_ID_5701_B0)
- new_adv |= (MII_TG3_CTRL_AS_MASTER |
- MII_TG3_CTRL_ENABLE_AS_MASTER);
+ new_adv |= CTL1000_AS_MASTER | CTL1000_ENABLE_MASTER;
- err = tg3_writephy(tp, MII_TG3_CTRL, new_adv);
+ err = tg3_writephy(tp, MII_CTRL1000, new_adv);
if (err)
goto done;
@@ -3076,7 +3074,7 @@ static void tg3_phy_copper_begin(struct tg3 *tp)
break;
case SPEED_1000:
- bmcr |= TG3_BMCR_SPEED1000;
+ bmcr |= BMCR_SPEED1000;
break;
}
@@ -3153,7 +3151,7 @@ static int tg3_copper_is_advertising_all(struct tg3 *tp, u32 mask)
if (mask & ADVERTISED_1000baseT_Full)
all_mask |= ADVERTISE_1000FULL;
- if (tg3_readphy(tp, MII_TG3_CTRL, &tg3_ctrl))
+ if (tg3_readphy(tp, MII_CTRL1000, &tg3_ctrl))
return 0;
if ((tg3_ctrl & all_mask) != all_mask)
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 54441a3..bedc3b4 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -2152,14 +2152,6 @@
/*** Tigon3 specific PHY MII registers. ***/
-#define TG3_BMCR_SPEED1000 0x0040
-
-#define MII_TG3_CTRL 0x09 /* 1000-baseT control register */
-#define MII_TG3_CTRL_ADV_1000_HALF 0x0100
-#define MII_TG3_CTRL_ADV_1000_FULL 0x0200
-#define MII_TG3_CTRL_AS_MASTER 0x0800
-#define MII_TG3_CTRL_ENABLE_AS_MASTER 0x1000
-
#define MII_TG3_MMD_CTRL 0x0d /* MMD Access Control register */
#define MII_TG3_MMD_CTRL_DATA_NOINC 0x4000
#define MII_TG3_MMD_ADDRESS 0x0e /* MMD Address Data register */
diff --git a/include/linux/mii.h b/include/linux/mii.h
index 359fba8..103113a 100644
--- a/include/linux/mii.h
+++ b/include/linux/mii.h
@@ -128,6 +128,8 @@
/* 1000BASE-T Control register */
#define ADVERTISE_1000FULL 0x0200 /* Advertise 1000BASE-T full duplex */
#define ADVERTISE_1000HALF 0x0100 /* Advertise 1000BASE-T half duplex */
+#define CTL1000_AS_MASTER 0x0800
+#define CTL1000_ENABLE_MASTER 0x1000
/* 1000BASE-T Status register */
#define LPA_1000LOCALRXOK 0x2000 /* Link partner local receiver status */
--
1.7.3.4
^ permalink raw reply related
* [PATCH net-next 5/8] tg3: Fix EEE debounce timer values
From: Matt Carlson @ 2011-06-13 23:38 UTC (permalink / raw)
To: davem; +Cc: netdev, mcarlson
This patch fixes the EEE debounce timer values.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
---
drivers/net/tg3.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index fc33566..54441a3 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -1118,10 +1118,10 @@
#define TG3_CPMU_EEEMD_EEE_ENABLE 0x00100000
#define TG3_CPMU_EEE_DBTMR1 0x000036b4
#define TG3_CPMU_DBTMR1_PCIEXIT_2047US 0x07ff0000
-#define TG3_CPMU_DBTMR1_LNKIDLE_2047US 0x000070ff
+#define TG3_CPMU_DBTMR1_LNKIDLE_2047US 0x000007ff
#define TG3_CPMU_EEE_DBTMR2 0x000036b8
#define TG3_CPMU_DBTMR2_APE_TX_2047US 0x07ff0000
-#define TG3_CPMU_DBTMR2_TXIDXEQ_2047US 0x000070ff
+#define TG3_CPMU_DBTMR2_TXIDXEQ_2047US 0x000007ff
#define TG3_CPMU_EEE_LNKIDL_CTRL 0x000036bc
#define TG3_CPMU_EEE_LNKIDL_PCIE_NL0 0x01000000
#define TG3_CPMU_EEE_LNKIDL_UART_IDL 0x00000004
--
1.7.3.4
^ permalink raw reply related
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