* [PATCH net-next] vxge: make function table const
From: Stephen Hemminger @ 2011-09-16 21:10 UTC (permalink / raw)
To: Jon Mason, David Miller; +Cc: netdev
All tables of function pointers should be const.
The pre-existing code has lots of needless indirection...
Inspired by similar change in PAX.
Compile tested only.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
drivers/net/ethernet/neterion/vxge/vxge-config.c | 11 +++++------
drivers/net/ethernet/neterion/vxge/vxge-config.h | 4 ++--
drivers/net/ethernet/neterion/vxge/vxge-main.c | 10 +++++++---
drivers/net/ethernet/neterion/vxge/vxge-traffic.c | 12 ++++++------
4 files changed, 20 insertions(+), 17 deletions(-)
--- a/drivers/net/ethernet/neterion/vxge/vxge-config.c 2011-09-16 13:12:56.529369674 -0700
+++ b/drivers/net/ethernet/neterion/vxge/vxge-config.c 2011-09-16 13:21:30.925393238 -0700
@@ -1342,9 +1342,7 @@ vxge_hw_device_initialize(
hldev->bar0 = attr->bar0;
hldev->pdev = attr->pdev;
- hldev->uld_callbacks.link_up = attr->uld_callbacks.link_up;
- hldev->uld_callbacks.link_down = attr->uld_callbacks.link_down;
- hldev->uld_callbacks.crit_err = attr->uld_callbacks.crit_err;
+ hldev->uld_callbacks = attr->uld_callbacks;
__vxge_hw_device_pci_e_init(hldev);
@@ -2633,7 +2631,7 @@ __vxge_hw_mempool_create(struct __vxge_h
u32 items_priv_size,
u32 items_initial,
u32 items_max,
- struct vxge_hw_mempool_cbs *mp_callback,
+ const struct vxge_hw_mempool_cbs *mp_callback,
void *userdata)
{
enum vxge_hw_status status = VXGE_HW_OK;
@@ -2817,7 +2815,9 @@ __vxge_hw_ring_create(struct __vxge_hw_v
struct vxge_hw_ring_config *config;
struct __vxge_hw_device *hldev;
u32 vp_id;
- struct vxge_hw_mempool_cbs ring_mp_callback;
+ static const struct vxge_hw_mempool_cbs ring_mp_callback = {
+ .item_func_alloc = __vxge_hw_ring_mempool_item_alloc,
+ };
if ((vp == NULL) || (attr == NULL)) {
status = VXGE_HW_FAIL;
@@ -2872,7 +2872,6 @@ __vxge_hw_ring_create(struct __vxge_hw_v
/* calculate actual RxD block private size */
ring->rxdblock_priv_size = ring->rxd_priv_size * ring->rxds_per_block;
- ring_mp_callback.item_func_alloc = __vxge_hw_ring_mempool_item_alloc;
ring->mempool = __vxge_hw_mempool_create(hldev,
VXGE_HW_BLOCK_SIZE,
VXGE_HW_BLOCK_SIZE,
--- a/drivers/net/ethernet/neterion/vxge/vxge-config.h 2011-09-16 13:12:56.529369674 -0700
+++ b/drivers/net/ethernet/neterion/vxge/vxge-config.h 2011-09-16 13:21:30.925393238 -0700
@@ -740,7 +740,7 @@ struct __vxge_hw_device {
struct vxge_hw_device_config config;
enum vxge_hw_device_link_state link_state;
- struct vxge_hw_uld_cbs uld_callbacks;
+ const struct vxge_hw_uld_cbs *uld_callbacks;
u32 host_type;
u32 func_id;
@@ -840,7 +840,7 @@ struct vxge_hw_device_hw_info {
struct vxge_hw_device_attr {
void __iomem *bar0;
struct pci_dev *pdev;
- struct vxge_hw_uld_cbs uld_callbacks;
+ const struct vxge_hw_uld_cbs *uld_callbacks;
};
#define VXGE_HW_DEVICE_LINK_STATE_SET(hldev, ls) (hldev->link_state = ls)
--- a/drivers/net/ethernet/neterion/vxge/vxge-main.c 2011-09-16 13:12:56.529369674 -0700
+++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c 2011-09-16 13:21:30.925393238 -0700
@@ -4284,6 +4284,12 @@ static int __devinit is_sriov_initialize
return 0;
}
+static const struct vxge_hw_uld_cbs vxge_callbacks = {
+ .link_up = vxge_callback_link_up,
+ .link_down = vxge_callback_link_down,
+ .crit_err = vxge_callback_crit_err,
+};
+
/**
* vxge_probe
* @pdev : structure containing the PCI related information of the device.
@@ -4494,9 +4500,7 @@ vxge_probe(struct pci_dev *pdev, const s
}
/* Setting driver callbacks */
- attr.uld_callbacks.link_up = vxge_callback_link_up;
- attr.uld_callbacks.link_down = vxge_callback_link_down;
- attr.uld_callbacks.crit_err = vxge_callback_crit_err;
+ attr.uld_callbacks = &vxge_callbacks;
status = vxge_hw_device_initialize(&hldev, &attr, device_config);
if (status != VXGE_HW_OK) {
--- a/drivers/net/ethernet/neterion/vxge/vxge-traffic.c 2011-09-16 13:12:56.533369674 -0700
+++ b/drivers/net/ethernet/neterion/vxge/vxge-traffic.c 2011-09-16 13:21:30.925393238 -0700
@@ -532,8 +532,8 @@ __vxge_hw_device_handle_error(struct __v
}
/* notify driver */
- if (hldev->uld_callbacks.crit_err)
- hldev->uld_callbacks.crit_err(
+ if (hldev->uld_callbacks->crit_err)
+ hldev->uld_callbacks->crit_err(
(struct __vxge_hw_device *)hldev,
type, vp_id);
out:
@@ -560,8 +560,8 @@ __vxge_hw_device_handle_link_down_ind(st
hldev->link_state = VXGE_HW_LINK_DOWN;
/* notify driver */
- if (hldev->uld_callbacks.link_down)
- hldev->uld_callbacks.link_down(hldev);
+ if (hldev->uld_callbacks->link_down)
+ hldev->uld_callbacks->link_down(hldev);
exit:
return VXGE_HW_OK;
}
@@ -585,8 +585,8 @@ __vxge_hw_device_handle_link_up_ind(stru
hldev->link_state = VXGE_HW_LINK_UP;
/* notify driver */
- if (hldev->uld_callbacks.link_up)
- hldev->uld_callbacks.link_up(hldev);
+ if (hldev->uld_callbacks->link_up)
+ hldev->uld_callbacks->link_up(hldev);
exit:
return VXGE_HW_OK;
}
^ permalink raw reply
* Re: [PATCH] ipv6: Send ICMPv6 RSes only when RAs are accepted
From: David Miller @ 2011-09-16 21:15 UTC (permalink / raw)
To: tore; +Cc: netdev
In-Reply-To: <201108291209.p7TC9KkD002967@wrath.fud.no>
From: Tore Anderson <tore@fud.no>
Date: Mon, 29 Aug 2011 14:08:33 +0200
> The change also makes "Hybrid Router" forwarding mode ("forwarding"
> sysctl set to 2) redundant, as the only thing that distinguished it from
> the standard Router mode (forwarding=1) was that RSes was being sent. It
> has therefore been removed.
You're not removing "accept_ra==2", it's still there in the test:
> - if ((ifp->idev->cnf.forwarding == 0 ||
> - ifp->idev->cnf.forwarding == 2) &&
> + if (((ifp->idev->cnf.accept_ra == 1 && !ifp->idev->cnf.forwarding) ||
> + ifp->idev->cnf.accept_ra == 2) &&
And it does provide it's own unique behavior compared to
"accept_ra==1".
^ permalink raw reply
* Re: [PATCH] sctp: deal with multiple COOKIE_ECHO chunks
From: David Miller @ 2011-09-16 21:17 UTC (permalink / raw)
To: makc; +Cc: linux-sctp, netdev, vladislav.yasevich
In-Reply-To: <20110830072010.94AE98132707@regina.usersys.redhat.com>
From: Max Matveev <makc@redhat.com>
Date: Tue, 30 Aug 2011 17:02:24 +1000
> Attempt to reduce the number of IP packets emitted in response to single
> SCTP packet (2e3216cd) introduced a complication - if a packet contains
> two COOKIE_ECHO chunks and nothing else then SCTP state machine corks the
> socket while processing first COOKIE_ECHO and then loses the association
> and forgets to uncork the socket. To deal with the issue add new SCTP
> command which can be used to set association explictly. Use this new
> command when processing second COOKIE_ECHO chunk to restore the context
> for SCTP state machine.
>
> Signed-off-by: Max Matveev <makc@redhat.com>
Applied, but there were a ton of whitespace errors that GIT complained
about and I had to fix up.
^ permalink raw reply
* [PATCH net-next] ixgb: relax stack usage of 768 Byte
From: Hagen Paul Pfeifer @ 2011-09-16 21:34 UTC (permalink / raw)
To: netdev; +Cc: Hagen Paul Pfeifer, Jeff Kirsher
ixgb_set_multi() will push (128 * 6) byte on the stack to set the
multicast filter. Fix this by allocate the scratch buffer on the heap.
Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgb/ixgb_main.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
index c8b9c90..4d23007 100644
--- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c
+++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
@@ -1095,8 +1095,10 @@ ixgb_set_multi(struct net_device *netdev)
rctl |= IXGB_RCTL_MPE;
IXGB_WRITE_REG(hw, RCTL, rctl);
} else {
- u8 mta[IXGB_MAX_NUM_MULTICAST_ADDRESSES *
- IXGB_ETH_LENGTH_OF_ADDRESS];
+ u8 *mta = kmalloc(IXGB_MAX_NUM_MULTICAST_ADDRESSES *
+ IXGB_ETH_LENGTH_OF_ADDRESS, GFP_ATOMIC);
+ if (!mta)
+ return;
IXGB_WRITE_REG(hw, RCTL, rctl);
@@ -1106,6 +1108,8 @@ ixgb_set_multi(struct net_device *netdev)
ha->addr, IXGB_ETH_LENGTH_OF_ADDRESS);
ixgb_mc_addr_list_update(hw, mta, netdev_mc_count(netdev), 0);
+
+ kfree(mta);
}
if (netdev->features & NETIF_F_HW_VLAN_RX)
--
1.7.5.4
^ permalink raw reply related
* Re: [PATCH] ipv6: Send ICMPv6 RSes only when RAs are accepted
From: David Miller @ 2011-09-16 21:49 UTC (permalink / raw)
To: tore; +Cc: netdev
In-Reply-To: <4E73C2E5.2050901@fud.no>
From: Tore Anderson <tore@fud.no>
Date: Fri, 16 Sep 2011 23:43:01 +0200
> * David Miller
>
>> From: Tore Anderson <tore@fud.no>
>> Date: Mon, 29 Aug 2011 14:08:33 +0200
>>
>>> The change also makes "Hybrid Router" forwarding mode ("forwarding"
>>> sysctl set to 2) redundant, as the only thing that distinguished it from
>>> the standard Router mode (forwarding=1) was that RSes was being sent. It
>>> has therefore been removed.
>>
>> You're not removing "accept_ra==2", it's still there in the test:
>>
>>> - if ((ifp->idev->cnf.forwarding == 0 ||
>>> - ifp->idev->cnf.forwarding == 2) &&
>>> + if (((ifp->idev->cnf.accept_ra == 1 && !ifp->idev->cnf.forwarding) ||
>>> + ifp->idev->cnf.accept_ra == 2) &&
>>
>> And it does provide it's own unique behavior compared to
>> "accept_ra==1".
>
> Hi David,
>
> I'm not removing accept_ra==2, no, only forwarding==2. Or, more
> precisely, I'm only removing the *documentation* for forwarding==2;
> forwarding==2 will still work, but there's no difference from
> forwarding==1 any longer.
Ok, please make this more clear in your commit message.
Thank you.
^ permalink raw reply
* Re: [PATCH] ipv6: Send ICMPv6 RSes only when RAs are accepted
From: Tore Anderson @ 2011-09-16 21:43 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20110916.171503.42153974977438913.davem@davemloft.net>
* David Miller
> From: Tore Anderson <tore@fud.no>
> Date: Mon, 29 Aug 2011 14:08:33 +0200
>
>> The change also makes "Hybrid Router" forwarding mode ("forwarding"
>> sysctl set to 2) redundant, as the only thing that distinguished it from
>> the standard Router mode (forwarding=1) was that RSes was being sent. It
>> has therefore been removed.
>
> You're not removing "accept_ra==2", it's still there in the test:
>
>> - if ((ifp->idev->cnf.forwarding == 0 ||
>> - ifp->idev->cnf.forwarding == 2) &&
>> + if (((ifp->idev->cnf.accept_ra == 1 && !ifp->idev->cnf.forwarding) ||
>> + ifp->idev->cnf.accept_ra == 2) &&
>
> And it does provide it's own unique behavior compared to
> "accept_ra==1".
Hi David,
I'm not removing accept_ra==2, no, only forwarding==2. Or, more
precisely, I'm only removing the *documentation* for forwarding==2;
forwarding==2 will still work, but there's no difference from
forwarding==1 any longer.
--
Tore Anderson
^ permalink raw reply
* Re: [PATCH] ipv6: Send ICMPv6 RSes only when RAs are accepted
From: Tore Anderson @ 2011-09-16 22:07 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20110916.174900.961553137813655280.davem@davemloft.net>
* David Miller
>> I'm not removing accept_ra==2, no, only forwarding==2. Or, more
>> precisely, I'm only removing the *documentation* for forwarding==2;
>> forwarding==2 will still work, but there's no difference from
>> forwarding==1 any longer.
>
> Ok, please make this more clear in your commit message.
I actually did improve the commit message in this regard when I re-sent
the patch, see <http://patchwork.ozlabs.org/patch/113625/>. Is that one
good enough?
--
Tore Anderson
^ permalink raw reply
* Re: [PATCH] caif: fix a potential NULL dereference
From: David Miller @ 2011-09-16 22:56 UTC (permalink / raw)
To: eric.dumazet; +Cc: sjurbren, netdev
In-Reply-To: <1314965963.2573.23.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 02 Sep 2011 14:19:23 +0200
> Commit bd30ce4bc0b7 (caif: Use RCU instead of spin-lock in caif_dev.c)
> added a potential NULL dereference in case alloc_percpu() fails.
>
> caif_device_alloc() can also use GFP_KERNEL instead of GFP_ATOMIC.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> CC: Sjur Brændeland <sjur.brandeland@stericsson.com>
Applied.
^ permalink raw reply
* Re: [PATCH 1/2] net: Align AF-specific flowi structs to long
From: David Miller @ 2011-09-16 22:57 UTC (permalink / raw)
To: david.ward; +Cc: netdev, ja
In-Reply-To: <1315141641-3120-2-git-send-email-david.ward@ll.mit.edu>
From: David Ward <david.ward@ll.mit.edu>
Date: Sun, 4 Sep 2011 09:07:20 -0400
> AF-specific flowi structs are now passed to flow_key_compare, which must
> also be aligned to a long.
>
> Signed-off-by: David Ward <david.ward@ll.mit.edu>
Applied.
^ permalink raw reply
* Re: [PATCH 2/2] net: Handle different key sizes between address families in flow cache
From: David Miller @ 2011-09-16 22:57 UTC (permalink / raw)
To: david.ward; +Cc: netdev, ja
In-Reply-To: <1315141641-3120-3-git-send-email-david.ward@ll.mit.edu>
From: David Ward <david.ward@ll.mit.edu>
Date: Sun, 4 Sep 2011 09:07:21 -0400
> With the conversion of struct flowi to a union of AF-specific structs, some
> operations on the flow cache need to account for the exact size of the key.
>
> Signed-off-by: David Ward <david.ward@ll.mit.edu>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] can-gw: add netlink based CAN routing
From: David Miller @ 2011-09-16 22:55 UTC (permalink / raw)
To: socketcan; +Cc: netdev, sojkam1, pisa, hanzalek, oliver.hartkopp
In-Reply-To: <4E5F955B.8030806@hartkopp.net>
From: Oliver Hartkopp <socketcan@hartkopp.net>
Date: Thu, 01 Sep 2011 16:23:23 +0200
> This patch adds a CAN Gateway/Router to route (and modify) CAN frames.
>
> It is based on the PF_CAN core infrastructure for msg filtering and msg
> sending and can optionally modify routed CAN frames on the fly.
> CAN frames can *only* be routed between CAN network interfaces (one hop).
> They can be modified with AND/OR/XOR/SET operations as configured by the
> netlink configuration interface known e.g. from iptables. From the netlink
> view this can-gw implements RTM_{NEW|DEL|GET}ROUTE for PF_CAN.
>
> The CAN specific userspace tool to manage CAN routing entries can be found in
> the CAN utils http://svn.berlios.de/wsvn/socketcan/trunk/can-utils/cangw.c
> at the SocketCAN SVN on BerliOS.
>
> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Applied.
^ permalink raw reply
* Re: [PATCH] ipv4: Fix fib_info->fib_metrics leak
From: David Miller @ 2011-09-16 22:58 UTC (permalink / raw)
To: zheng.z.yan; +Cc: netdev, laijs
In-Reply-To: <4E646B14.1020801@intel.com>
From: "Yan, Zheng" <zheng.z.yan@intel.com>
Date: Mon, 05 Sep 2011 14:24:20 +0800
> Commit 4670994d(net,rcu: convert call_rcu(fc_rport_free_rcu) to
> kfree_rcu()) introduced a memory leak. This patch reverts it.
>
> Signed-off-by: Zheng Yan <zheng.z.yan@intel.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] ixgb: relax stack usage of 768 Byte
From: Jeff Kirsher @ 2011-09-16 23:08 UTC (permalink / raw)
To: Hagen Paul Pfeifer; +Cc: netdev@vger.kernel.org
In-Reply-To: <1316208897-4557-1-git-send-email-hagen@jauu.net>
[-- Attachment #1: Type: text/plain, Size: 508 bytes --]
On Fri, 2011-09-16 at 14:34 -0700, Hagen Paul Pfeifer wrote:
> ixgb_set_multi() will push (128 * 6) byte on the stack to set the
> multicast filter. Fix this by allocate the scratch buffer on the heap.
>
> Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
> Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> ---
> drivers/net/ethernet/intel/ixgb/ixgb_main.c | 8 ++++++--
> 1 files changed, 6 insertions(+), 2 deletions(-)
Thanks Hagen! I have added the patch to my queue of ixgbe patches.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply
* Re: [PATCH] ipv6: Send ICMPv6 RSes only when RAs are accepted
From: David Miller @ 2011-09-16 23:15 UTC (permalink / raw)
To: tore; +Cc: netdev
In-Reply-To: <4E73C8B1.70404@fud.no>
From: Tore Anderson <tore@fud.no>
Date: Sat, 17 Sep 2011 00:07:45 +0200
> * David Miller
>
>>> I'm not removing accept_ra==2, no, only forwarding==2. Or, more
>>> precisely, I'm only removing the *documentation* for forwarding==2;
>>> forwarding==2 will still work, but there's no difference from
>>> forwarding==1 any longer.
>>
>> Ok, please make this more clear in your commit message.
>
> I actually did improve the commit message in this regard when I re-sent
> the patch, see <http://patchwork.ozlabs.org/patch/113625/>. Is that one
> good enough?
Looks good, applied, thanks!
^ permalink raw reply
* Re: [PATCH] IRDA: Fix global type conflicts in net/irda/irsysctl.c v2
From: David Miller @ 2011-09-16 23:17 UTC (permalink / raw)
To: andi; +Cc: samuel, netdev, ak
In-Reply-To: <1316200190-2320-1-git-send-email-andi@firstfloor.org>
From: Andi Kleen <andi@firstfloor.org>
Date: Fri, 16 Sep 2011 12:09:50 -0700
> From: Andi Kleen <ak@linux.intel.com>
>
> The externs here didn't agree with the declarations in qos.c.
>
> Better would be probably to move this into a header, but since it's
> common practice to have naked externs with sysctls I left it for now.
>
> Cc: samuel@sortiz.org
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] pcnet32: constify function table
From: David Miller @ 2011-09-16 23:20 UTC (permalink / raw)
To: shemminger; +Cc: pcnet32, netdev
In-Reply-To: <20110916140626.2648c477@nehalam.linuxnetplumber.net>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Fri, 16 Sep 2011 14:06:26 -0700
> Function tables need to be const to prevent malicious use.
>
> This is compile tested only.
> Gleaned from PAX.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Applied.
^ permalink raw reply
* Re: [PATCH] wan: make LAPB callbacks const
From: David Miller @ 2011-09-16 23:20 UTC (permalink / raw)
To: shemminger; +Cc: khc, netdev
In-Reply-To: <20110916140429.4a144301@nehalam.linuxnetplumber.net>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Fri, 16 Sep 2011 14:04:29 -0700
> This is compile tested only.
> Suggested by dumpster diving in PAX.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] vxge: make function table const
From: David Miller @ 2011-09-16 23:20 UTC (permalink / raw)
To: shemminger; +Cc: jdmason, netdev
In-Reply-To: <20110916141001.2d4ca61d@nehalam.linuxnetplumber.net>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Fri, 16 Sep 2011 14:10:01 -0700
>
> All tables of function pointers should be const.
> The pre-existing code has lots of needless indirection...
>
> Inspired by similar change in PAX.
> Compile tested only.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Applied.
^ permalink raw reply
* Re: [PATCH] can: ti_hecc: include linux/io.h
From: David Miller @ 2011-09-16 23:21 UTC (permalink / raw)
To: wg; +Cc: zonque, linux-kernel, netdev
In-Reply-To: <4E73A123.1040801@grandegger.com>
From: Wolfgang Grandegger <wg@grandegger.com>
Date: Fri, 16 Sep 2011 21:18:59 +0200
> On 09/16/2011 07:57 PM, Daniel Mack wrote:
>> This fixes a build breakage for OMAP3 boards.
>>
>> Signed-off-by: Daniel Mack <zonque@gmail.com>
>> Cc: Wolfgang Grandegger <wg@grandegger.com>
>> Cc: netdev@vger.kernel.org
>
> Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] bna: make function tables cont
From: David Miller @ 2011-09-16 23:20 UTC (permalink / raw)
To: shemminger; +Cc: rmody, netdev
In-Reply-To: <20110916140951.6318785d@nehalam.linuxnetplumber.net>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Fri, 16 Sep 2011 14:09:51 -0700
> To prevent malicious usage, all tables of pointers must be const.
>
> Compile tested only.
> Gleaned for PAX.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next 0/4] ethtool: Fixes for RX NFC API
From: David Miller @ 2011-09-16 23:25 UTC (permalink / raw)
To: bhutchings; +Cc: netdev, alexander.h.duyck, sebastian.poehn, santwona.behera
In-Reply-To: <1315352693.2788.20.camel@bwh-desktop>
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Wed, 07 Sep 2011 00:44:53 +0100
> This series fixes some minor flaws in the documentation and the API itself.
All applied, thanks Ben.
^ permalink raw reply
* Re: [PATCH -next v2] unix stream: Fix use-after-free crashes
From: David Miller @ 2011-09-16 23:35 UTC (permalink / raw)
To: eric.dumazet
Cc: zheng.z.yan, tim.c.chen, zheng.z.yan, netdev, sfr, jirislaby,
sedat.dilek, alex.shi
In-Reply-To: <1315364126.3400.64.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 07 Sep 2011 04:55:26 +0200
> Please David just revert 0856a304091b33a8e
Done.
^ permalink raw reply
* Re: [PATCH -next v2] unix stream: Fix use-after-free crashes
From: Tim Chen @ 2011-09-16 16:50 UTC (permalink / raw)
To: David Miller
Cc: eric.dumazet, zheng.z.yan, zheng.z.yan, netdev, sfr, jirislaby,
sedat.dilek, alex.shi
In-Reply-To: <20110916.193529.1252147879675316417.davem@davemloft.net>
On Fri, 2011-09-16 at 19:35 -0400, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Wed, 07 Sep 2011 04:55:26 +0200
>
> > Please David just revert 0856a304091b33a8e
>
> Done.
Eric,
Can you re-spin a patch that incorporates your idea that we don't
add pid/credential references when we are not requesting credentials
in the socket. And probably another one that remove unnecessary
pid/credentials references in send/receive when we do use credentials?
Tim
^ permalink raw reply
* [net-next 2/3] bna: Set Ring Param Fix
From: Rasesh Mody @ 2011-09-17 1:06 UTC (permalink / raw)
To: davem, netdev; +Cc: adapter_linux_open_src_team, Rasesh Mody, Gurunatha Karaje
In-Reply-To: <1316221608-21392-1-git-send-email-rmody@brocade.com>
When Rx queue size is changed, queues are torn down and setup with the new queue
size. During this operation, clear promiscuous mode and restore the original
VLAN filter.
Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com>
Signed-off-by: Rasesh Mody <rmody@brocade.com>
---
drivers/net/ethernet/brocade/bna/bnad_ethtool.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/brocade/bna/bnad_ethtool.c b/drivers/net/ethernet/brocade/bna/bnad_ethtool.c
index 4842224..ac6b495 100644
--- a/drivers/net/ethernet/brocade/bna/bnad_ethtool.c
+++ b/drivers/net/ethernet/brocade/bna/bnad_ethtool.c
@@ -471,16 +471,17 @@ bnad_set_ringparam(struct net_device *netdev,
current_err = bnad_setup_rx(bnad, i);
if (current_err && !err)
err = current_err;
- if (!err)
- bnad_restore_vlans(bnad, i);
}
if (!err && bnad->rx_info[0].rx) {
/* restore rx configuration */
+ bnad_restore_vlans(bnad, 0);
bnad_enable_default_bcast(bnad);
spin_lock_irqsave(&bnad->bna_lock, flags);
bnad_mac_addr_set_locked(bnad, netdev->dev_addr);
spin_unlock_irqrestore(&bnad->bna_lock, flags);
+ bnad->cfg_flags &= ~(BNAD_CF_ALLMULTI |
+ BNAD_CF_PROMISC);
bnad_set_rx_mode(netdev);
}
}
--
1.7.1
^ permalink raw reply related
* [net-next 3/3] bna: Eliminate Small Race Condition Window in RX Path
From: Rasesh Mody @ 2011-09-17 1:06 UTC (permalink / raw)
To: davem, netdev; +Cc: adapter_linux_open_src_team, Rasesh Mody, Gurunatha Karaje
In-Reply-To: <1316221608-21392-1-git-send-email-rmody@brocade.com>
Change details:
- In a continuous sequence of ifconfig up/down operations, there is a small
window of race between bnad_set_rx_mode() and bnad_cleanup_rx() while the
former tries to access rx_info->rx & the latter sets it to NULL. This race
could lead to bna_rx_mode_set() being called with a NULL (rx_info->rx)
pointer and a crash.
- Hold bnad->bna_lock while setting / unsetting rx_info->rx in bnad_setup_rx()
& bnad_cleanup_rx(), thereby eliminating the race described above.
Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com>
Signed-off-by: Rasesh Mody <rmody@brocade.com>
---
drivers/net/ethernet/brocade/bna/bnad.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c
index 33ab1f8..abca139 100644
--- a/drivers/net/ethernet/brocade/bna/bnad.c
+++ b/drivers/net/ethernet/brocade/bna/bnad.c
@@ -1875,10 +1875,10 @@ bnad_cleanup_rx(struct bnad *bnad, u32 rx_id)
spin_lock_irqsave(&bnad->bna_lock, flags);
bna_rx_destroy(rx_info->rx);
- spin_unlock_irqrestore(&bnad->bna_lock, flags);
rx_info->rx = NULL;
rx_info->rx_id = 0;
+ spin_unlock_irqrestore(&bnad->bna_lock, flags);
bnad_rx_res_free(bnad, res_info);
}
@@ -1932,12 +1932,13 @@ bnad_setup_rx(struct bnad *bnad, u32 rx_id)
spin_lock_irqsave(&bnad->bna_lock, flags);
rx = bna_rx_create(&bnad->bna, bnad, rx_config, &rx_cbfn, res_info,
rx_info);
- spin_unlock_irqrestore(&bnad->bna_lock, flags);
if (!rx) {
err = -ENOMEM;
+ spin_unlock_irqrestore(&bnad->bna_lock, flags);
goto err_return;
}
rx_info->rx = rx;
+ spin_unlock_irqrestore(&bnad->bna_lock, flags);
/*
* Init NAPI, so that state is set to NAPI_STATE_SCHED,
--
1.7.1
^ 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