* [PATCH] wext: let get_wireless_stats() sleep
From: Johannes Berg @ 2009-10-05 9:15 UTC (permalink / raw)
To: John Linville; +Cc: Miles Lane, linux-wireless, netdev
A number of drivers (recently including cfg80211-based ones)
assume that all wireless handlers, including statistics, can
sleep and they often also implicitly assume that the rtnl is
held around their invocation. This is almost always true now
except when reading from sysfs:
BUG: sleeping function called from invalid context at kernel/mutex.c:280
in_atomic(): 1, irqs_disabled(): 0, pid: 10450, name: head
2 locks held by head/10450:
#0: (&buffer->mutex){+.+.+.}, at: [<c10ceb99>] sysfs_read_file+0x24/0xf4
#1: (dev_base_lock){++.?..}, at: [<c12844ee>] wireless_show+0x1a/0x4c
Pid: 10450, comm: head Not tainted 2.6.32-rc3 #1
Call Trace:
[<c102301c>] __might_sleep+0xf0/0xf7
[<c1324355>] mutex_lock_nested+0x1a/0x33
[<f8cea53b>] wdev_lock+0xd/0xf [cfg80211]
[<f8cea58f>] cfg80211_wireless_stats+0x45/0x12d [cfg80211]
[<c13118d6>] get_wireless_stats+0x16/0x1c
[<c12844fe>] wireless_show+0x2a/0x4c
Fix this by using the rtnl instead of dev_base_lock.
Reported-by: Miles Lane <miles.lane-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Signed-off-by: Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
---
net/core/net-sysfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- wireless-testing.orig/net/core/net-sysfs.c 2009-10-05 11:09:56.000000000 +0200
+++ wireless-testing/net/core/net-sysfs.c 2009-10-05 11:10:52.000000000 +0200
@@ -366,13 +366,13 @@ static ssize_t wireless_show(struct devi
const struct iw_statistics *iw;
ssize_t ret = -EINVAL;
- read_lock(&dev_base_lock);
+ rtnl_lock();
if (dev_isalive(dev)) {
iw = get_wireless_stats(dev);
if (iw)
ret = (*format)(iw, buf);
}
- read_unlock(&dev_base_lock);
+ rtnl_unlock();
return ret;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [net-next-2.6 PATCH 8/9] vxge: Acquire correct lock based on interrupt context.
From: Sreenivasa Honnur @ 2009-10-05 9:14 UTC (permalink / raw)
To: davem; +Cc: netdev, support
- Added macros that check if the thread is in interrupt context or not to
acquire or release locks
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
---
diff -urpN patch7/drivers/net/vxge/vxge-main.c patch8/drivers/net/vxge/vxge-main.c
--- patch7/drivers/net/vxge/vxge-main.c 2009-09-04 02:13:34.000000000 -0700
+++ patch8/drivers/net/vxge/vxge-main.c 2009-09-04 02:18:15.000000000 -0700
@@ -97,10 +97,10 @@ static inline void VXGE_COMPLETE_VPATH_T
more = 0;
skb_ptr = completed;
- if (spin_trylock_irqsave(&fifo->tx_lock, flags)) {
+ if (vxge_spin_trylock(&fifo->tx_lock, flags)) {
vxge_hw_vpath_poll_tx(fifo->handle, &skb_ptr,
NR_SKB_COMPLETED, &more);
- spin_unlock_irqrestore(&fifo->tx_lock, flags);
+ vxge_spin_unlock(&fifo->tx_lock, flags);
}
/* free SKBs */
for (temp = completed; temp != skb_ptr; temp++)
diff -urpN patch7/drivers/net/vxge/vxge-main.h patch8/drivers/net/vxge/vxge-main.h
--- patch7/drivers/net/vxge/vxge-main.h 2009-09-04 02:05:36.000000000 -0700
+++ patch8/drivers/net/vxge/vxge-main.h 2009-09-04 02:16:40.000000000 -0700
@@ -89,6 +89,26 @@
#define VXGE_LL_MAX_FRAME_SIZE(dev) ((dev)->mtu + VXGE_HW_MAC_HEADER_MAX_SIZE)
+#define vxge_spin_lock(l, f) { \
+ if (in_interrupt()) \
+ spin_lock(l); \
+ else \
+ spin_lock_irqsave(l, f); \
+}
+
+#define vxge_spin_trylock(l, f) \
+({ \
+ in_interrupt() ? \
+ spin_trylock(l) : spin_trylock_irqsave(l, f); \
+})
+
+#define vxge_spin_unlock(l, f) { \
+ if (in_interrupt()) \
+ spin_unlock(l); \
+ else \
+ spin_unlock_irqrestore(l, f); \
+}
+
enum vxge_reset_event {
/* reset events */
VXGE_LL_VPATH_RESET = 0,
^ permalink raw reply
* [net-next-2.6 PATCH 7/9] vxge: Allow multiple functions with INTA.
From: Sreenivasa Honnur @ 2009-10-05 9:12 UTC (permalink / raw)
To: davem; +Cc: netdev, support
- Allow multiple functions with INTA.
- Removed the condition to allow only one vpath with INTA
- Ensure that the alarm bit in titan_mask_all_int register is cleared when
driver exits.
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
---
diff -urpN patch6/drivers/net/vxge/vxge-config.c patch7/drivers/net/vxge/vxge-config.cllow multiple functions with INTA.
- Removed the condition to allow only one vpath with INTA
- Ensure that the alarm bit in titan_mask_all_int register is cleared when
driver exits.
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
---
--- patch6/drivers/net/vxge/vxge-config.c 2009-09-04 01:33:43.000000000 -0700
+++ patch7/drivers/net/vxge/vxge-config.c 2009-09-04 02:11:29.000000000 -0700
@@ -3882,6 +3882,30 @@ __vxge_hw_vpath_tim_configure(struct __v
return status;
}
+void
+vxge_hw_vpath_tti_ci_set(struct __vxge_hw_device *hldev, u32 vp_id)
+{
+ struct __vxge_hw_virtualpath *vpath;
+ struct vxge_hw_vpath_reg __iomem *vp_reg;
+ struct vxge_hw_vp_config *config;
+ u64 val64;
+
+ vpath = &hldev->virtual_paths[vp_id];
+ vp_reg = vpath->vp_reg;
+ config = vpath->vp_config;
+
+ if (config->fifo.enable == VXGE_HW_FIFO_ENABLE) {
+ val64 = readq(&vp_reg->tim_cfg1_int_num[VXGE_HW_VPATH_INTR_TX]);
+
+ if (config->tti.timer_ci_en != VXGE_HW_TIM_TIMER_CI_ENABLE) {
+ config->tti.timer_ci_en = VXGE_HW_TIM_TIMER_CI_ENABLE;
+ val64 |= VXGE_HW_TIM_CFG1_INT_NUM_TIMER_CI;
+ writeq(val64,
+ &vp_reg->tim_cfg1_int_num[VXGE_HW_VPATH_INTR_TX]);
+ }
+ }
+ return;
+}
/*
* __vxge_hw_vpath_initialize
* This routine is the final phase of init which initializes the
diff -urpN patch6/drivers/net/vxge/vxge-main.c patch7/drivers/net/vxge/vxge-main.c
--- patch6/drivers/net/vxge/vxge-main.c 2009-09-04 01:31:12.000000000 -0700
+++ patch7/drivers/net/vxge/vxge-main.c 2009-09-04 02:13:34.000000000 -0700
@@ -2435,7 +2435,6 @@ static int vxge_add_isr(struct vxgedev *
int ret = 0;
#ifdef CONFIG_PCI_MSI
int vp_idx = 0, intr_idx = 0, intr_cnt = 0, msix_idx = 0, irq_req = 0;
- u64 function_mode = vdev->config.device_hw_info.function_mode;
int pci_fun = PCI_FUNC(vdev->pdev->devfn);
if (vdev->config.intr_type == MSI_X)
@@ -2444,20 +2443,9 @@ static int vxge_add_isr(struct vxgedev *
if (ret) {
vxge_debug_init(VXGE_ERR,
"%s: Enabling MSI-X Failed", VXGE_DRIVER_NAME);
- if ((function_mode == VXGE_HW_FUNCTION_MODE_MULTI_FUNCTION) &&
- test_and_set_bit(__VXGE_STATE_CARD_UP,
- &driver_config->inta_dev_open))
- return VXGE_HW_FAIL;
- else {
- vxge_debug_init(VXGE_ERR,
- "%s: Defaulting to INTA", VXGE_DRIVER_NAME);
- vdev->config.intr_type = INTA;
- vxge_hw_device_set_intr_type(vdev->devh,
- VXGE_HW_INTR_MODE_IRQLINE);
- vxge_close_vpaths(vdev, 1);
- vdev->no_of_vpath = 1;
- vdev->stats.vpaths_open = 1;
- }
+ vxge_debug_init(VXGE_ERR,
+ "%s: Defaulting to INTA", VXGE_DRIVER_NAME);
+ vdev->config.intr_type = INTA;
}
if (vdev->config.intr_type == MSI_X) {
@@ -2505,24 +2493,11 @@ static int vxge_add_isr(struct vxgedev *
"%s: MSIX - %d Registration failed",
vdev->ndev->name, intr_cnt);
vxge_rem_msix_isr(vdev);
- if ((function_mode ==
- VXGE_HW_FUNCTION_MODE_MULTI_FUNCTION) &&
- test_and_set_bit(__VXGE_STATE_CARD_UP,
- &driver_config->inta_dev_open))
- return VXGE_HW_FAIL;
- else {
- vxge_hw_device_set_intr_type(
- vdev->devh,
- VXGE_HW_INTR_MODE_IRQLINE);
- vdev->config.intr_type = INTA;
- vxge_debug_init(VXGE_ERR,
- "%s: Defaulting to INTA"
- , vdev->ndev->name);
- vxge_close_vpaths(vdev, 1);
- vdev->no_of_vpath = 1;
- vdev->stats.vpaths_open = 1;
+ vdev->config.intr_type = INTA;
+ vxge_debug_init(VXGE_ERR,
+ "%s: Defaulting to INTA"
+ , vdev->ndev->name);
goto INTA_MODE;
- }
}
if (irq_req) {
@@ -2555,23 +2530,11 @@ static int vxge_add_isr(struct vxgedev *
"%s: MSIX - %d Registration failed",
vdev->ndev->name, intr_cnt);
vxge_rem_msix_isr(vdev);
- if ((function_mode ==
- VXGE_HW_FUNCTION_MODE_MULTI_FUNCTION) &&
- test_and_set_bit(__VXGE_STATE_CARD_UP,
- &driver_config->inta_dev_open))
- return VXGE_HW_FAIL;
- else {
- vxge_hw_device_set_intr_type(vdev->devh,
- VXGE_HW_INTR_MODE_IRQLINE);
- vdev->config.intr_type = INTA;
- vxge_debug_init(VXGE_ERR,
- "%s: Defaulting to INTA",
- vdev->ndev->name);
- vxge_close_vpaths(vdev, 1);
- vdev->no_of_vpath = 1;
- vdev->stats.vpaths_open = 1;
+ vdev->config.intr_type = INTA;
+ vxge_debug_init(VXGE_ERR,
+ "%s: Defaulting to INTA",
+ vdev->ndev->name);
goto INTA_MODE;
- }
}
vxge_hw_vpath_msix_unmask(vdev->vpaths[vp_idx].handle,
@@ -2584,6 +2547,10 @@ INTA_MODE:
snprintf(vdev->desc[0], VXGE_INTR_STRLEN, "%s:vxge", vdev->ndev->name);
if (vdev->config.intr_type == INTA) {
+ vxge_hw_device_set_intr_type(vdev->devh,
+ VXGE_HW_INTR_MODE_IRQLINE);
+ vxge_hw_vpath_tti_ci_set(vdev->devh,
+ vdev->vpaths[0].device_id);
ret = request_irq((int) vdev->pdev->irq,
vxge_isr_napi,
IRQF_SHARED, vdev->desc[0], vdev);
@@ -2688,13 +2655,6 @@ vxge_open(struct net_device *dev)
* initialized */
netif_carrier_off(dev);
- /* Check for another device already opn with INTA */
- if ((function_mode == VXGE_HW_FUNCTION_MODE_MULTI_FUNCTION) &&
- test_bit(__VXGE_STATE_CARD_UP, &driver_config->inta_dev_open)) {
- ret = -EPERM;
- goto out0;
- }
-
/* Open VPATHs */
status = vxge_open_vpaths(vdev);
if (status != VXGE_HW_OK) {
@@ -2983,7 +2943,6 @@ int do_vxge_close(struct net_device *dev
vxge_debug_entryexit(VXGE_TRACE,
"%s: %s:%d Exiting...", dev->name, __func__, __LINE__);
- clear_bit(__VXGE_STATE_CARD_UP, &driver_config->inta_dev_open);
clear_bit(__VXGE_STATE_RESET_CARD, &vdev->state);
return 0;
@@ -4397,6 +4356,27 @@ vxge_probe(struct pci_dev *pdev, const s
}
kfree(device_config);
+
+ /*
+ * INTA is shared in multi-function mode. This is unlike the INTA
+ * implementation in MR mode, where each VH has its own INTA message.
+ * - INTA is masked (disabled) as long as at least one function sets
+ * its TITAN_MASK_ALL_INT.ALARM bit.
+ * - INTA is unmasked (enabled) when all enabled functions have cleared
+ * their own TITAN_MASK_ALL_INT.ALARM bit.
+ * The TITAN_MASK_ALL_INT ALARM & TRAFFIC bits are cleared on power up.
+ * Though this driver leaves the top level interrupts unmasked while
+ * leaving the required module interrupt bits masked on exit, there
+ * could be a rougue driver around that does not follow this procedure
+ * resulting in a failure to generate interrupts. The following code is
+ * present to prevent such a failure.
+ */
+
+ if (ll_config.device_hw_info.function_mode ==
+ VXGE_HW_FUNCTION_MODE_MULTI_FUNCTION)
+ if (vdev->config.intr_type == INTA)
+ vxge_hw_device_unmask_all(hldev);
+
vxge_debug_entryexit(VXGE_TRACE, "%s: %s:%d Exiting...",
vdev->ndev->name, __func__, __LINE__);
diff -urpN patch6/drivers/net/vxge/vxge-main.h patch7/drivers/net/vxge/vxge-main.h
--- patch6/drivers/net/vxge/vxge-main.h 2009-09-04 01:25:50.000000000 -0700
+++ patch7/drivers/net/vxge/vxge-main.h 2009-09-04 02:05:36.000000000 -0700
@@ -112,7 +112,6 @@ enum vxge_mac_addr_state {
struct vxge_drv_config {
int config_dev_cnt;
int total_dev_cnt;
- unsigned long inta_dev_open;
int g_no_cpus;
unsigned int vpath_per_dev;
};
diff -urpN patch6/drivers/net/vxge/vxge-traffic.c patch7/drivers/net/vxge/vxge-traffic.c
--- patch6/drivers/net/vxge/vxge-traffic.c 2009-09-04 01:25:50.000000000 -0700
+++ patch7/drivers/net/vxge/vxge-traffic.c 2009-09-04 02:06:25.000000000 -0700
@@ -295,6 +295,8 @@ void vxge_hw_device_intr_enable(struct _
u64 val64;
u32 val32;
+ vxge_hw_device_mask_all(hldev);
+
for (i = 0; i < VXGE_HW_MAX_VIRTUAL_PATHS; i++) {
if (!(hldev->vpaths_deployed & vxge_mBIT(i)))
diff -urpN patch6/drivers/net/vxge/vxge-traffic.h patch7/drivers/net/vxge/vxge-traffic.h
--- patch6/drivers/net/vxge/vxge-traffic.h 2009-09-04 01:25:50.000000000 -0700
+++ patch7/drivers/net/vxge/vxge-traffic.h 2009-09-04 02:07:28.000000000 -0700
@@ -2389,6 +2389,8 @@ vxge_hw_channel_dtr_free(struct __vxge_h
int
vxge_hw_channel_dtr_count(struct __vxge_hw_channel *channel);
+void
+vxge_hw_vpath_tti_ci_set(struct __vxge_hw_device *hldev, u32 vp_id);
/* ========================== PRIVATE API ================================= */
^ permalink raw reply
* [net-next-2.6 PATCH 6/9] vxge: Check if FCS stripping is disabled by the firmware.
From: Sreenivasa Honnur @ 2009-10-05 9:11 UTC (permalink / raw)
To: davem; +Cc: netdev, support
- Added a function to check if FCS stripping is disabled by the firmware, if
it is not disabled fail driver load.
- By default FCS stripping is disabled by the firmware. With this assumption
driver decrements the indicated packet length by 4 bytes(FCS length).
- This patch ensures that FCS stripping is disabled during driver load time.
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
---
diff -urpN patch5/drivers/net/vxge/vxge-config.c patch6/drivers/net/vxge/vxge-config.c
--- patch5/drivers/net/vxge/vxge-config.c 2009-09-04 01:24:25.000000000 -0700
+++ patch6/drivers/net/vxge/vxge-config.c 2009-09-04 01:33:43.000000000 -0700
@@ -2157,6 +2157,28 @@ exit:
}
/*
+ * vxge_hw_vpath_strip_fcs_check - Check for FCS strip.
+ */
+enum vxge_hw_status
+vxge_hw_vpath_strip_fcs_check(struct __vxge_hw_device *hldev, u64 vpath_mask)
+{
+ struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg;
+ enum vxge_hw_status status = VXGE_HW_OK;
+ int i = 0, j = 0;
+
+ for (i = 0; i < VXGE_HW_MAX_VIRTUAL_PATHS; i++) {
+ if (!((vpath_mask) & vxge_mBIT(i)))
+ continue;
+ vpmgmt_reg = hldev->vpmgmt_reg[i];
+ for (j = 0; j < VXGE_HW_MAC_MAX_MAC_PORT_ID; j++) {
+ if (readq(&vpmgmt_reg->rxmac_cfg0_port_vpmgmt_clone[j])
+ & VXGE_HW_RXMAC_CFG0_PORT_VPMGMT_CLONE_STRIP_FCS)
+ return VXGE_HW_FAIL;
+ }
+ }
+ return status;
+}
+/*
* vxge_hw_mgmt_reg_Write - Write Titan register.
*/
enum vxge_hw_status
diff -urpN patch5/drivers/net/vxge/vxge-config.h patch6/drivers/net/vxge/vxge-config.h
--- patch5/drivers/net/vxge/vxge-config.h 2009-09-04 01:23:26.000000000 -0700
+++ patch6/drivers/net/vxge/vxge-config.h 2009-09-04 01:29:17.000000000 -0700
@@ -2201,6 +2201,8 @@ __vxge_hw_vpath_func_id_get(
enum vxge_hw_status
__vxge_hw_vpath_reset_check(struct __vxge_hw_virtualpath *vpath);
+enum vxge_hw_status
+vxge_hw_vpath_strip_fcs_check(struct __vxge_hw_device *hldev, u64 vpath_mask);
/**
* vxge_debug
* @level: level of debug verbosity.
diff -urpN patch5/drivers/net/vxge/vxge-main.c patch6/drivers/net/vxge/vxge-main.c
--- patch5/drivers/net/vxge/vxge-main.c 2009-09-04 01:23:26.000000000 -0700
+++ patch6/drivers/net/vxge/vxge-main.c 2009-09-04 01:31:12.000000000 -0700
@@ -4244,6 +4244,15 @@ vxge_probe(struct pci_dev *pdev, const s
goto _exit3;
}
+ /* if FCS stripping is not disabled in MAC fail driver load */
+ if (vxge_hw_vpath_strip_fcs_check(hldev, vpath_mask) != VXGE_HW_OK) {
+ vxge_debug_init(VXGE_ERR,
+ "%s: FCS stripping is not disabled in MAC"
+ " failing driver load", VXGE_DRIVER_NAME);
+ ret = -EINVAL;
+ goto _exit4;
+ }
+
vxge_hw_device_debug_set(hldev, VXGE_ERR, VXGE_COMPONENT_LL);
/* set private device info */
^ permalink raw reply
* Re: [PATCH] be2net: Fix a bug in preparation of mcc wrb which was causing flash operation to fail
From: David Miller @ 2009-10-05 9:09 UTC (permalink / raw)
To: ajitk, ajitkhaparde; +Cc: netdev
In-Reply-To: <20091005090555.GA12287@serverengines.com>
From: Ajit Khaparde <ajitkhaparde@gmail.com>
Date: Mon, 5 Oct 2009 14:36:07 +0530
> This patch fixes a bug that got introduced in commit 76998bc7.
> During preparation of mcc wrb, req was being wrongly overwritten
> and the flash operation was failing.
> This patch is against the net-2.6 tree.
>
> Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Applied, thanks.
^ permalink raw reply
* [PATCH] be2net: Fix a bug in preparation of mcc wrb which was causing flash operation to fail
From: Ajit Khaparde @ 2009-10-05 9:06 UTC (permalink / raw)
To: davem, netdev
This patch fixes a bug that got introduced in commit 76998bc7.
During preparation of mcc wrb, req was being wrongly overwritten
and the flash operation was failing.
This patch is against the net-2.6 tree.
Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
---
drivers/net/benet/be_cmds.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index 79d35d1..89876ad 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -1129,7 +1129,6 @@ int be_cmd_write_flashrom(struct be_adapter *adapter, struct be_dma_mem *cmd,
spin_lock_bh(&adapter->mcc_lock);
wrb = wrb_from_mccq(adapter);
- req = embedded_payload(wrb);
sge = nonembedded_sgl(wrb);
be_wrb_hdr_prepare(wrb, cmd->size, false, 1);
--
1.6.0.4
^ permalink raw reply related
* [PATCH] iproute2 add hoplimit and reordering route options usage and parsing
From: Gilad Ben-Yossef @ 2009-10-05 8:54 UTC (permalink / raw)
To: netdev; +Cc: ori
From: Yuki Arbel <yuki@comsleep.com>
iproute2 git HEAD (spotted originally on 2.6.26, so it's probably not new)
does not parse the hoplimit route option when proccessing parameters, nor
does it print hoplimit and reordering options in the usage lines.
This patch fixes both.
Tested by setting hoplimit and be retreiving it via "show".
Signed-off-by: Gilad Ben-Yossef <gilad@codefidence.com>
[ported to HEAD and fixed a bug with hoplimit lock handling in original]
Signed-off-by: Ori Finkelman <ori@comsleep.com>
Signed-off-by: Yuki Arbel <yuki@comsleep.com>
---
Carved out from original patch by Yuki Arbel and Ori Finkelman from
Comsleep Ltd. which I'm asssiting in mainlining.
diff --git a/ip/iproute.c b/ip/iproute.c
index bf0f31b..4821a1d 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -73,7 +73,7 @@ static void usage(void)
fprintf(stderr, " [ rtt TIME ] [ rttvar TIME ]\n");
fprintf(stderr, " [ window NUMBER] [ cwnd NUMBER ] [ initcwnd NUMBER ]\n");
fprintf(stderr, " [ ssthresh NUMBER ] [ realms REALM ] [ src ADDRESS ]\n");
- fprintf(stderr, " [ rto_min TIME ]\n");
+ fprintf(stderr, " [ rto_min TIME ] [ hoplimit NUMBER ] [ reordering NUMBER] \n");
fprintf(stderr, "TYPE := [ unicast | local | broadcast | multicast | throw |\n");
fprintf(stderr, " unreachable | prohibit | blackhole | nat ]\n");
fprintf(stderr, "TABLE_ID := [ local | main | default | all | NUMBER ]\n");
@@ -768,6 +768,16 @@ int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
if (get_unsigned(&mtu, *argv, 0))
invarg("\"mtu\" value is invalid\n", *argv);
rta_addattr32(mxrta, sizeof(mxbuf), RTAX_MTU, mtu);
+ } else if (strcmp(*argv, "hoplimit") == 0) {
+ unsigned hoplimit;
+ NEXT_ARG();
+ if (strcmp(*argv, "lock") == 0) {
+ mxlock |= (1<<RTAX_HOPLIMIT);
+ NEXT_ARG();
+ }
+ if (get_unsigned(&hoplimit, *argv, 0))
+ invarg("\"hoplimit\" value is invalid\n", *argv);
+ rta_addattr32(mxrta, sizeof(mxbuf), RTAX_HOPLIMIT, hoplimit);
#ifdef RTAX_ADVMSS
} else if (strcmp(*argv, "advmss") == 0) {
unsigned mss;
^ permalink raw reply related
* Re: [PATCH] TCPCT+1: initial SYN exchange with SYNACK data
From: David Miller @ 2009-10-05 8:50 UTC (permalink / raw)
To: william.allen.simpson; +Cc: netdev
In-Reply-To: <4AC9AD14.2060500@gmail.com>
From: William Allen Simpson <william.allen.simpson@gmail.com>
Date: Mon, 05 Oct 2009 04:23:48 -0400
> This will be widely deployed. Deployment in DNS root servers is
> expected by December. It will be hammered with 600,000+ queries per
> minute. Does that impact your design expectations?
Great, so 600,000 times per second we'll take two new atomic
operations with your most recent suggestion...
> Tomorrow, I'll send out a new patch with everything buried in a single
> kref, the various tests will only be a trifle slower....
This one..
The reason we want tcp_sock smaller is to get better performance (less
memory references) and to save memory. If you're exchanging the space
savings for atomic operations and whatnot, you're defeating half of
the point of making the tcp_sock state smaller.
Make your state take up less space in tcp_sock without making it cost
more in some other form.
And btw, it's not our problem that all of a sudden this is critical
and important for you, and that you don't like how not all aspects of
your implementation were commented upon long ago when the first
implementation was posted.
Your insistence to keep harping on those issues will only irritate me
(and probably others). So please keep that out of the discussion,
thanks.
^ permalink raw reply
* Re: [PATCH] TCPCT+1: initial SYN exchange with SYNACK data
From: David Miller @ 2009-10-05 8:45 UTC (permalink / raw)
To: william.allen.simpson; +Cc: netdev
In-Reply-To: <4AC9AA3E.2090001@gmail.com>
From: William Allen Simpson <william.allen.simpson@gmail.com>
Date: Mon, 05 Oct 2009 04:11:42 -0400
> Given that size is now a concern, would a single kref pointer with a
> u16 field for flags be acceptable? I could bury the rest in the
> kref block.
>
> Would that be acceptable without a config option?
Then we'll eat an atomic operation every connect() or something
like that?
That's bad too. We're trying desperately to remove as many
atomic operations as possible from the socket paths.
Compress your state, really compress it, don't just externalize
it somewhere else in exchange for a different cost.
^ permalink raw reply
* Re: [PATCH] TCPCT+1: initial SYN exchange with SYNACK data
From: William Allen Simpson @ 2009-10-05 8:23 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20091005.010630.214808506.davem@davemloft.net>
David Miller wrote:
> I'm looking at the patch more closely, and as I learn more
> things about your change, my position changes.
>
>> Perhaps you would prefer this as a config option after all?
>
> No, then nobody is going to deploy this thing (meaning it really will
> be useless), or everyone will and everyone will enable it and thus eat
> the space.
>
> It's bad either way.
>
> Store the data either somewhere else or in an extremely compact form.
>
More cross-posting, a good thing for responsiveness....
OK, no config option.
This will be widely deployed. Deployment in DNS root servers is
expected by December. It will be hammered with 600,000+ queries per
minute. Does that impact your design expectations?
Tomorrow, I'll send out a new patch with everything buried in a single
kref, the various tests will only be a trifle slower....
^ permalink raw reply
* Re: [PATCH 1/7] mlx4: Added interrupts test support
From: Yevgeny Petrilin @ 2009-10-05 11:16 UTC (permalink / raw)
To: Roland Dreier; +Cc: davem, netdev
In-Reply-To: <adaeipmqxmv.fsf@cisco.com>
Roland Dreier wrote:
> This feels like a pretty risky thing to do while the device might be
> handling all sorts of other traffic at the same time. Are you sure
> there are no races you expose here?
We did testing on this, during heavy traffic.
A race can happen when there are two processes that execute that test simultaneously,
but the tests always executed from Ethtool context.
I will add additional protection in case somebody tries to execute this test from another context.
> Have you actually seen cases where
> the interrupt test during initialization works but then this test
> catches a problem? (My experience has been that if any MSI-X interrupts
> work from a device, then they'll all work)
It also checks that all the EQs work properly. During initialization we only check the asynchronous EQ
^ permalink raw reply
* Re: [PATCH] TCPCT+1: initial SYN exchange with SYNACK data
From: William Allen Simpson @ 2009-10-05 8:11 UTC (permalink / raw)
To: netdev
In-Reply-To: <4AC9A714.7060903@gmail.com>
William Allen Simpson wrote:
> David Miller wrote:
>> struct tcp_sock is already WAY TOO BIG on 64-bit systems, adding 20
>> more bytes to it for some odd-ball feature is not something I'm
>> willing to do, sorry.
>>
> I see we're cross-posting at the same time.... Since in your previous
> review (last year) this issue was not mentioned, is there some other
> data organization that you would suggest?
>
> http://article.gmane.org/gmane.linux.network/102779
>
> "This looks mostly fine to me. I would even advocate not using a config
> option for this."
>
As a quick followup, I wish this had been raised in my previous posting,
where I'd given the headers, for exactly this kind of feedback. :-)
Given that size is now a concern, would a single kref pointer with a u16
field for flags be acceptable? I could bury the rest in the kref block.
Would that be acceptable without a config option?
^ permalink raw reply
* Re: [PATCH] TCPCT+1: initial SYN exchange with SYNACK data
From: David Miller @ 2009-10-05 8:06 UTC (permalink / raw)
To: william.allen.simpson; +Cc: netdev
In-Reply-To: <4AC9A714.7060903@gmail.com>
From: William Allen Simpson <william.allen.simpson@gmail.com>
Date: Mon, 05 Oct 2009 03:58:12 -0400
> I see we're cross-posting at the same time.... Since in your previous
> review (last year) this issue was not mentioned, is there some other
> data organization that you would suggest?
>
> http://article.gmane.org/gmane.linux.network/102779
>
> "This looks mostly fine to me. I would even advocate not using a
> config
> option for this."
I'm looking at the patch more closely, and as I learn more
things about your change, my position changes.
> Perhaps you would prefer this as a config option after all?
No, then nobody is going to deploy this thing (meaning it really will
be useless), or everyone will and everyone will enable it and thus eat
the space.
It's bad either way.
Store the data either somewhere else or in an extremely compact form.
^ permalink raw reply
* Re: [PATCH] TCPCT+1: initial SYN exchange with SYNACK data
From: William Allen Simpson @ 2009-10-05 7:58 UTC (permalink / raw)
Cc: netdev
In-Reply-To: <20091005.002719.146534039.davem@davemloft.net>
David Miller wrote:
> From: William Allen Simpson <william.allen.simpson@gmail.com>
> Date: Sat, 03 Oct 2009 14:33:41 -0400
>
>> @@ -406,6 +454,32 @@ struct tcp_sock {
> ...
>> + struct tcp_s_data_payload *s_data_payload;
> ...
>> + struct tcp_cookie_pair *cookie_pair;
> ...
>> + u16 s_data_desired; /* bytes */
> ...
>> + u8 cookie_desired; /* bytes */
>> + u8 s_data_in:1,
>> + s_data_out:1,
>> + cookie_in_always:1,
>> + cookie_out_never:1;
>
> struct tcp_sock is already WAY TOO BIG on 64-bit systems, adding 20
> more bytes to it for some odd-ball feature is not something I'm
> willing to do, sorry.
>
I see we're cross-posting at the same time.... Since in your previous
review (last year) this issue was not mentioned, is there some other
data organization that you would suggest?
http://article.gmane.org/gmane.linux.network/102779
"This looks mostly fine to me. I would even advocate not using a config
option for this."
Perhaps you would prefer this as a config option after all?
As for "odd-ball feature", of course this is the initial pass on a much
larger project....
^ permalink raw reply
* Re: [PATCH] TCPCT+1: initial SYN exchange with SYNACK data
From: William Allen Simpson @ 2009-10-05 7:45 UTC (permalink / raw)
To: netdev
In-Reply-To: <4AC79905.1030904@gmail.com>
As I'm new to Linux kernel development, this was based entirely on code
previously reviewed (by Miller), as that seemed a good path for me to learn
proper coding and style.
Now that I'm trying to grok Linux locking functions for the next patch, I've
noticed that setsockopt code uses lock_sock(), but getsockopt doesn't. In a
preemptive kernel, or with SMP, isn't there a possibility that these socket
values could be modified or destroyed at the same time?
I'm especially concerned here, as there are kref blocks, and they could be
left pointing into the weeds?
^ permalink raw reply
* Re: [PATCH 0/4] More device type integration
From: David Miller @ 2009-10-05 7:44 UTC (permalink / raw)
To: marcel; +Cc: netdev, johannes, greg
In-Reply-To: <cover.1254495724.git.marcel@holtmann.org>
From: Marcel Holtmann <marcel@holtmann.org>
Date: Fri, 2 Oct 2009 17:15:24 +0200
> I followed the work from Johannes and made sure we can register the
> device type for wireless devices via the netdev notifier callback for
> all cfg80211 based devices. This way we don't have to touch any of
> the drivers.
>
> For the mobile broadband cards from Ericsson, the device type is now
> set to "wwan" and it also uses "wwan%d" for the default interface name.
Looks good, all applied to net-next-2.6
Thanks!
^ permalink raw reply
* Re: [PATCH] net: export device speed and duplex via sysfs
From: David Miller @ 2009-10-05 7:44 UTC (permalink / raw)
To: andy; +Cc: bhutchings, netdev
In-Reply-To: <20091002200141.GB1639@gospo.rdu.redhat.com>
From: Andy Gospodarek <andy@greyhouse.net>
Date: Fri, 2 Oct 2009 16:01:41 -0400
> I took a look at /sys/class/net/ethX/ and felt like the information was
> pretty complete with the exception of the link speed and duplex, so I
> thought it would be a good place to add it. I personally wouldn't mind
> having most of the information presented in ethtool available via sysfs,
> but I figured I would walk before running.
I have no objections to this, I applied v2 of your patch to
net-next-2.6, thanks!
^ permalink raw reply
* Re: [PATCH kernel 2.6.32-rc1] pcnet_cs: add cis of National Semicondoctor's multifunction pcmcia card
From: David Miller @ 2009-10-05 7:40 UTC (permalink / raw)
To: ken_kawasaki; +Cc: netdev
In-Reply-To: <20091004073257.52a6624b.ken_kawasaki@spring.nifty.jp>
From: Ken Kawasaki <ken_kawasaki@spring.nifty.jp>
Date: Sun, 4 Oct 2009 07:32:57 +0900
>
> pcnet_cs,serial_cs:
>
> add cis of National Semicondoctor's lan&modem mulitifunction pcmcia card,
> NE2K, tamarack ethernet card,
> and some serial card(COMpad2, COMpad4).
>
>
> Signed-off-by: Ken Kawasaki <ken_kawasaki@spring.nifty.jp>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] inet_peer: Optimize inet_getid()
From: Eric Dumazet @ 2009-10-05 7:38 UTC (permalink / raw)
To: David Miller; +Cc: shemminger, netdev
In-Reply-To: <20091005.000818.95127796.davem@davemloft.net>
David Miller a écrit :
>
> I can't apply this, it's going to break the build on some
> architectures.
>
> For example, sparc64 only supports cmpxchg on u32 and u64
> objects, but you're trying to use it on a u16 here.
Oops, thanks for the info David !
^ permalink raw reply
* Re: [PATCH] TCPCT+1: initial SYN exchange with SYNACK data
From: David Miller @ 2009-10-05 7:27 UTC (permalink / raw)
To: william.allen.simpson; +Cc: netdev
In-Reply-To: <4AC79905.1030904@gmail.com>
From: William Allen Simpson <william.allen.simpson@gmail.com>
Date: Sat, 03 Oct 2009 14:33:41 -0400
> @@ -406,6 +454,32 @@ struct tcp_sock {
...
> + struct tcp_s_data_payload *s_data_payload;
...
> + struct tcp_cookie_pair *cookie_pair;
...
> + u16 s_data_desired; /* bytes */
...
> + u8 cookie_desired; /* bytes */
> + u8 s_data_in:1,
> + s_data_out:1,
> + cookie_in_always:1,
> + cookie_out_never:1;
struct tcp_sock is already WAY TOO BIG on 64-bit systems, adding 20
more bytes to it for some odd-ball feature is not something I'm
willing to do, sorry.
^ permalink raw reply
* Re: [PATCH] net: Support inclusion of <linux/socket.h> before <sys/socket.h>
From: David Miller @ 2009-10-05 7:24 UTC (permalink / raw)
To: ben; +Cc: netdev, waldi, manuel, 538372
In-Reply-To: <1254627764.2395.48.camel@localhost>
From: Ben Hutchings <ben@decadent.org.uk>
Date: Sun, 04 Oct 2009 04:42:44 +0100
> From: Bastian Blank <waldi@debian.org>
>
> The following user-space program fails to compile:
>
> #include <linux/socket.h>
> #include <sys/socket.h>
> int main() { return 0; }
>
> The reason is that <linux/socket.h> tests __GLIBC__ to decide whether it
> should define various structures and macros that are now defined for
> user-space by <sys/socket.h>, but __GLIBC__ is not defined if no libc
> headers have yet been included.
>
> It seems safe to drop support for libc 5 now.
>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Fair enough, applied to net-2.6, thanks.
^ permalink raw reply
* Re: [PATCH 21/21] drivers/net/tlan.h: Convert printk(KERN_DEBUG to pr_dbg(
From: David Miller @ 2009-10-05 7:20 UTC (permalink / raw)
To: joe; +Cc: linux-kernel, chessman, netdev
In-Reply-To: <1254726974.1799.315.camel@Joe-Laptop.home>
From: Joe Perches <joe@perches.com>
Date: Mon, 05 Oct 2009 00:16:14 -0700
> On Mon, 2009-10-05 at 00:12 -0700, David Miller wrote:
>> From: Joe Perches <joe@perches.com>
>> Date: Sun, 4 Oct 2009 17:53:48 -0700
>> > Removed "TLAN: " prefix from debug printks, it's added by pr_fmt
>> > Signed-off-by: Joe Perches <joe@perches.com>
>> Applied to net-next-2.6
>
> Patches 20 and 21 depend on patch 1, which introduces pr_dbg
> to kernel.h. Compile failure otherwise.
Ok, I'll toss them then.
Someone else merge this stuff:
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply
* Re: [PATCH 21/21] drivers/net/tlan.h: Convert printk(KERN_DEBUG to pr_dbg(
From: Joe Perches @ 2009-10-05 7:16 UTC (permalink / raw)
To: David Miller; +Cc: linux-kernel, chessman, netdev
In-Reply-To: <20091005.001240.111554671.davem@davemloft.net>
On Mon, 2009-10-05 at 00:12 -0700, David Miller wrote:
> From: Joe Perches <joe@perches.com>
> Date: Sun, 4 Oct 2009 17:53:48 -0700
> > Removed "TLAN: " prefix from debug printks, it's added by pr_fmt
> > Signed-off-by: Joe Perches <joe@perches.com>
> Applied to net-next-2.6
Patches 20 and 21 depend on patch 1, which introduces pr_dbg
to kernel.h. Compile failure otherwise.
^ permalink raw reply
* Re: [PATCH] TI DaVinci EMAC: Minor macro related updates
From: David Miller @ 2009-10-05 7:14 UTC (permalink / raw)
To: chaithrika; +Cc: netdev, davinci-linux-open-source
In-Reply-To: <1254428719-13960-1-git-send-email-chaithrika@ti.com>
From: Chaithrika U S <chaithrika@ti.com>
Date: Thu, 1 Oct 2009 16:25:19 -0400
> Use BIT for macro definitions wherever possible, remove
> unused and redundant macros.
>
> Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Applied to net-next-2.6
^ permalink raw reply
* Re: [PATCH 4/4] ethtool: Remove support for obsolete string query operations
From: David Miller @ 2009-10-05 7:13 UTC (permalink / raw)
To: bhutchings; +Cc: netdev
In-Reply-To: <1254432783.2735.29.camel@achroite>
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Thu, 01 Oct 2009 22:33:03 +0100
> The in-tree implementations have all been converted to
> get_sset_count().
>
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Applied to net-next-2.6
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox