* [PATCH net-next-2.6 06/12] igb: convert to ethtool set_phys_id
From: Stephen Hemminger @ 2011-04-04 18:43 UTC (permalink / raw)
To: David S. Miller, Ben Hutchings, Jeff Kirsher, Jesse Brandeburg,
Bruce
Cc: netdev
In-Reply-To: <20110404184340.604594357@linuxplumber.net>
[-- Attachment #1: igb-set-phys-id.patch --]
[-- Type: text/plain, Size: 1782 bytes --]
Convert igb driver to use new set_phys_id ethtool interface.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/igb/igb_ethtool.c 2011-04-04 10:48:11.725482218 -0700
+++ b/drivers/net/igb/igb_ethtool.c 2011-04-04 10:50:38.243512749 -0700
@@ -1963,29 +1963,26 @@ static int igb_set_wol(struct net_device
/* bit defines for adapter->led_status */
#define IGB_LED_ON 0
-static int igb_phys_id(struct net_device *netdev, u32 data)
+static int igb_set_phys_id(struct net_device *netdev,
+ enum ethtool_phys_id_state state)
{
struct igb_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw;
- unsigned long timeout;
- timeout = data * 1000;
+ switch (state) {
+ case ETHTOOL_ID_ACTIVE:
+ igb_blink_led(hw);
+ return 0;
+
+ case ETHTOOL_ID_INACTIVE:
+ igb_led_off(hw);
+ clear_bit(IGB_LED_ON, &adapter->led_status);
+ igb_cleanup_led(hw);
+ return 0;
- /*
- * msleep_interruptable only accepts unsigned int so we are limited
- * in how long a duration we can wait
- */
- if (!timeout || timeout > UINT_MAX)
- timeout = UINT_MAX;
-
- igb_blink_led(hw);
- msleep_interruptible(timeout);
-
- igb_led_off(hw);
- clear_bit(IGB_LED_ON, &adapter->led_status);
- igb_cleanup_led(hw);
-
- return 0;
+ default:
+ return -EINVAL;
+ }
}
static int igb_set_coalesce(struct net_device *netdev,
@@ -2215,7 +2212,7 @@ static const struct ethtool_ops igb_etht
.set_tso = igb_set_tso,
.self_test = igb_diag_test,
.get_strings = igb_get_strings,
- .phys_id = igb_phys_id,
+ .set_phys_id = igb_set_phys_id,
.get_sset_count = igb_get_sset_count,
.get_ethtool_stats = igb_get_ethtool_stats,
.get_coalesce = igb_get_coalesce,
^ permalink raw reply
* [PATCH net-next-2.6 05/12] e1000e: implement ethtool set_phys_id
From: Stephen Hemminger @ 2011-04-04 18:43 UTC (permalink / raw)
To: David S. Miller, Ben Hutchings, Jeff Kirsher, Jesse Brandeburg,
Bruce
Cc: netdev
In-Reply-To: <20110404184340.604594357@linuxplumber.net>
[-- Attachment #1: e1000e-phys-id.patch --]
[-- Type: text/plain, Size: 5037 bytes --]
The new ethtool set_phys_id takes over controlling the LED for identifying
boards. This fixes the lockout during that period.
For this device lots of extra infrastructure can also be removed by using
set_phys_id.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/e1000e/e1000.h 2011-04-04 10:48:18.801583226 -0700
+++ b/drivers/net/e1000e/e1000.h 2011-04-04 10:49:31.254596880 -0700
@@ -389,13 +389,10 @@ struct e1000_adapter {
bool fc_autoneg;
- unsigned long led_status;
-
unsigned int flags;
unsigned int flags2;
struct work_struct downshift_task;
struct work_struct update_phy_task;
- struct work_struct led_blink_task;
struct work_struct print_hang_task;
bool idle_check;
@@ -484,7 +481,6 @@ extern const char e1000e_driver_version[
extern void e1000e_check_options(struct e1000_adapter *adapter);
extern void e1000e_set_ethtool_ops(struct net_device *netdev);
-extern void e1000e_led_blink_task(struct work_struct *work);
extern int e1000e_up(struct e1000_adapter *adapter);
extern void e1000e_down(struct e1000_adapter *adapter);
--- a/drivers/net/e1000e/ethtool.c 2011-04-04 10:48:18.789583047 -0700
+++ b/drivers/net/e1000e/ethtool.c 2011-04-04 10:49:48.798839237 -0700
@@ -1851,64 +1851,39 @@ static int e1000_set_wol(struct net_devi
return 0;
}
-/* toggle LED 4 times per second = 2 "blinks" per second */
-#define E1000_ID_INTERVAL (HZ/4)
-
-/* bit defines for adapter->led_status */
-#define E1000_LED_ON 0
-
-void e1000e_led_blink_task(struct work_struct *work)
-{
- struct e1000_adapter *adapter = container_of(work,
- struct e1000_adapter, led_blink_task);
-
- if (test_and_change_bit(E1000_LED_ON, &adapter->led_status))
- adapter->hw.mac.ops.led_off(&adapter->hw);
- else
- adapter->hw.mac.ops.led_on(&adapter->hw);
-}
-
-static void e1000_led_blink_callback(unsigned long data)
-{
- struct e1000_adapter *adapter = (struct e1000_adapter *) data;
-
- schedule_work(&adapter->led_blink_task);
- mod_timer(&adapter->blink_timer, jiffies + E1000_ID_INTERVAL);
-}
-
-static int e1000_phys_id(struct net_device *netdev, u32 data)
+static int e1000_set_phys_id(struct net_device *netdev,
+ enum ethtool_phys_id_state state)
{
struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw;
- if (!data)
- data = INT_MAX;
+ switch (state) {
+ case ETHTOOL_ID_ACTIVE:
+ if ((hw->phy.type == e1000_phy_ife) ||
+ (hw->mac.type == e1000_pchlan) ||
+ (hw->mac.type == e1000_pch2lan) ||
+ (hw->mac.type == e1000_82583) ||
+ (hw->mac.type == e1000_82574))
+ return -EINVAL; /* blink in software */
- if ((hw->phy.type == e1000_phy_ife) ||
- (hw->mac.type == e1000_pchlan) ||
- (hw->mac.type == e1000_pch2lan) ||
- (hw->mac.type == e1000_82583) ||
- (hw->mac.type == e1000_82574)) {
- if (!adapter->blink_timer.function) {
- init_timer(&adapter->blink_timer);
- adapter->blink_timer.function =
- e1000_led_blink_callback;
- adapter->blink_timer.data = (unsigned long) adapter;
- }
- mod_timer(&adapter->blink_timer, jiffies);
- msleep_interruptible(data * 1000);
- del_timer_sync(&adapter->blink_timer);
+ e1000e_blink_led(hw);
+ break;
+
+ case ETHTOOL_ID_INACTIVE:
if (hw->phy.type == e1000_phy_ife)
e1e_wphy(hw, IFE_PHY_SPECIAL_CONTROL_LED, 0);
- } else {
- e1000e_blink_led(hw);
- msleep_interruptible(data * 1000);
- }
+ hw->mac.ops.led_off(hw);
+ hw->mac.ops.cleanup_led(hw);
+ break;
- hw->mac.ops.led_off(hw);
- clear_bit(E1000_LED_ON, &adapter->led_status);
- hw->mac.ops.cleanup_led(hw);
+ case ETHTOOL_ID_ON:
+ adapter->hw.mac.ops.led_on(&adapter->hw);
+ break;
+ case ETHTOOL_ID_OFF:
+ adapter->hw.mac.ops.led_off(&adapter->hw);
+ break;
+ }
return 0;
}
@@ -2049,7 +2024,7 @@ static const struct ethtool_ops e1000_et
.set_tso = e1000_set_tso,
.self_test = e1000_diag_test,
.get_strings = e1000_get_strings,
- .phys_id = e1000_phys_id,
+ .set_phys_id = e1000_set_phys_id,
.get_ethtool_stats = e1000_get_ethtool_stats,
.get_sset_count = e1000e_get_sset_count,
.get_coalesce = e1000_get_coalesce,
--- a/drivers/net/e1000e/netdev.c 2011-04-04 10:48:18.821583507 -0700
+++ b/drivers/net/e1000e/netdev.c 2011-04-04 10:49:31.258596933 -0700
@@ -5991,7 +5991,6 @@ static int __devinit e1000_probe(struct
INIT_WORK(&adapter->downshift_task, e1000e_downshift_workaround);
INIT_WORK(&adapter->update_phy_task, e1000e_update_phy_task);
INIT_WORK(&adapter->print_hang_task, e1000_print_hw_hang);
- INIT_WORK(&adapter->led_blink_task, e1000e_led_blink_task);
/* Initialize link parameters. User can change them with ethtool */
adapter->hw.mac.autoneg = 1;
@@ -6124,7 +6123,6 @@ static void __devexit e1000_remove(struc
cancel_work_sync(&adapter->watchdog_task);
cancel_work_sync(&adapter->downshift_task);
cancel_work_sync(&adapter->update_phy_task);
- cancel_work_sync(&adapter->led_blink_task);
cancel_work_sync(&adapter->print_hang_task);
if (!(netdev->flags & IFF_UP))
^ permalink raw reply
* [PATCH net-next-2.6 08/12] ixgbe: convert to ethtool set_phys_id
From: Stephen Hemminger @ 2011-04-04 18:43 UTC (permalink / raw)
To: David S. Miller, Ben Hutchings, Jeff Kirsher, Jesse Brandeburg,
Bruce
Cc: netdev
In-Reply-To: <20110404184340.604594357@linuxplumber.net>
[-- Attachment #1: ixgbe-set-phys-id.patch --]
[-- Type: text/plain, Size: 1702 bytes --]
Convert ixgbe driver to use new set_phys_id ethtool interface.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/ixgbe/ixgbe_ethtool.c 2011-04-04 10:48:11.641481015 -0700
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c 2011-04-04 10:50:57.979778947 -0700
@@ -1999,25 +1999,29 @@ static int ixgbe_nway_reset(struct net_d
return 0;
}
-static int ixgbe_phys_id(struct net_device *netdev, u32 data)
+static int ixgbe_set_phys_id(struct net_device *netdev,
+ enum ethtool_phys_id_state state)
{
struct ixgbe_adapter *adapter = netdev_priv(netdev);
struct ixgbe_hw *hw = &adapter->hw;
u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
- u32 i;
- if (!data || data > 300)
- data = 300;
+ switch (state) {
+ case ETHTOOL_ID_ACTIVE:
+ return -1;
- for (i = 0; i < (data * 1000); i += 400) {
+ case ETHTOOL_ID_ON:
hw->mac.ops.led_on(hw, IXGBE_LED_ON);
- msleep_interruptible(200);
+ break;
+
+ case ETHTOOL_ID_OFF:
hw->mac.ops.led_off(hw, IXGBE_LED_ON);
- msleep_interruptible(200);
- }
+ break;
- /* Restore LED settings */
- IXGBE_WRITE_REG(&adapter->hw, IXGBE_LEDCTL, led_reg);
+ case ETHTOOL_ID_INACTIVE:
+ /* Restore LED settings */
+ IXGBE_WRITE_REG(&adapter->hw, IXGBE_LEDCTL, led_reg);
+ }
return 0;
}
@@ -2465,7 +2469,7 @@ static const struct ethtool_ops ixgbe_et
.set_tso = ixgbe_set_tso,
.self_test = ixgbe_diag_test,
.get_strings = ixgbe_get_strings,
- .phys_id = ixgbe_phys_id,
+ .set_phys_id = ixgbe_set_phys_id,
.get_sset_count = ixgbe_get_sset_count,
.get_ethtool_stats = ixgbe_get_ethtool_stats,
.get_coalesce = ixgbe_get_coalesce,
^ permalink raw reply
* [PATCH net-next-2.6 09/12] ixgb: convert to set_phys_id
From: Stephen Hemminger @ 2011-04-04 18:43 UTC (permalink / raw)
To: David S. Miller, Ben Hutchings, Jeff Kirsher, Jesse Brandeburg,
Bruce
Cc: netdev
In-Reply-To: <20110404184340.604594357@linuxplumber.net>
[-- Attachment #1: ixgb-set-phys.patch --]
[-- Type: text/plain, Size: 2366 bytes --]
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/ixgb/ixgb.h 2011-04-04 11:38:54.837945742 -0700
+++ b/drivers/net/ixgb/ixgb.h 2011-04-04 11:38:59.441992978 -0700
@@ -157,9 +157,6 @@ struct ixgb_adapter {
u16 link_duplex;
struct work_struct tx_timeout_task;
- struct timer_list blink_timer;
- unsigned long led_status;
-
/* TX */
struct ixgb_desc_ring tx_ring ____cacheline_aligned_in_smp;
unsigned int restart_queue;
--- a/drivers/net/ixgb/ixgb_ethtool.c 2011-04-04 11:38:04.089428786 -0700
+++ b/drivers/net/ixgb/ixgb_ethtool.c 2011-04-04 11:40:39.458950195 -0700
@@ -610,45 +610,23 @@ err_setup_rx:
return err;
}
-/* toggle LED 4 times per second = 2 "blinks" per second */
-#define IXGB_ID_INTERVAL (HZ/4)
-
-/* bit defines for adapter->led_status */
-#define IXGB_LED_ON 0
-
-static void
-ixgb_led_blink_callback(unsigned long data)
-{
- struct ixgb_adapter *adapter = (struct ixgb_adapter *)data;
-
- if (test_and_change_bit(IXGB_LED_ON, &adapter->led_status))
- ixgb_led_off(&adapter->hw);
- else
- ixgb_led_on(&adapter->hw);
-
- mod_timer(&adapter->blink_timer, jiffies + IXGB_ID_INTERVAL);
-}
-
static int
-ixgb_phys_id(struct net_device *netdev, u32 data)
+ixgb_set_phys_id(struct net_device *netdev, enum ethtool_phys_id_state state)
{
struct ixgb_adapter *adapter = netdev_priv(netdev);
- if (!data)
- data = INT_MAX;
-
- if (!adapter->blink_timer.function) {
- init_timer(&adapter->blink_timer);
- adapter->blink_timer.function = ixgb_led_blink_callback;
- adapter->blink_timer.data = (unsigned long)adapter;
- }
+ switch (state) {
+ case ETHTOOL_ID_ACTIVE:
+ return -EINVAL;
- mod_timer(&adapter->blink_timer, jiffies);
+ case ETHTOOL_ID_ON:
+ ixgb_led_on(&adapter->hw);
+ break;
- msleep_interruptible(data * 1000);
- del_timer_sync(&adapter->blink_timer);
- ixgb_led_off(&adapter->hw);
- clear_bit(IXGB_LED_ON, &adapter->led_status);
+ case ETHTOOL_ID_OFF:
+ case ETHTOOL_ID_INACTIVE:
+ ixgb_led_off(&adapter->hw);
+ }
return 0;
}
@@ -766,7 +744,7 @@ static const struct ethtool_ops ixgb_eth
.set_msglevel = ixgb_set_msglevel,
.set_tso = ixgb_set_tso,
.get_strings = ixgb_get_strings,
- .phys_id = ixgb_phys_id,
+ .set_phys_id = ixgb_set_phys_id,
.get_sset_count = ixgb_get_sset_count,
.get_ethtool_stats = ixgb_get_ethtool_stats,
.get_flags = ethtool_op_get_flags,
^ permalink raw reply
* [PATCH net-next-2.6 07/12] igbvf: remove bogus phys_id
From: Stephen Hemminger @ 2011-04-04 18:43 UTC (permalink / raw)
To: David S. Miller, Ben Hutchings, Jeff Kirsher, Jesse Brandeburg,
Bruce
Cc: netdev
In-Reply-To: <20110404184340.604594357@linuxplumber.net>
[-- Attachment #1: igvf-set-phys.patch --]
[-- Type: text/plain, Size: 927 bytes --]
This device lies about supporting phys_id. Remove it and just
let the upper layer report not supported.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/igbvf/ethtool.c 2011-04-04 11:15:50.477019338 -0700
+++ b/drivers/net/igbvf/ethtool.c 2011-04-04 11:16:12.661202774 -0700
@@ -391,11 +391,6 @@ static int igbvf_set_wol(struct net_devi
return -EOPNOTSUPP;
}
-static int igbvf_phys_id(struct net_device *netdev, u32 data)
-{
- return 0;
-}
-
static int igbvf_get_coalesce(struct net_device *netdev,
struct ethtool_coalesce *ec)
{
@@ -527,7 +522,6 @@ static const struct ethtool_ops igbvf_et
.self_test = igbvf_diag_test,
.get_sset_count = igbvf_get_sset_count,
.get_strings = igbvf_get_strings,
- .phys_id = igbvf_phys_id,
.get_ethtool_stats = igbvf_get_ethtool_stats,
.get_coalesce = igbvf_get_coalesce,
.set_coalesce = igbvf_set_coalesce,
^ permalink raw reply
* [PATCH net-next-2.6 10/12] tg3: implement ethtool set_phys_id
From: Stephen Hemminger @ 2011-04-04 18:43 UTC (permalink / raw)
To: David S. Miller, Ben Hutchings, Matt Carlson, Michael Chan; +Cc: netdev
In-Reply-To: <20110404184340.604594357@linuxplumber.net>
[-- Attachment #1: tg3-set-phys-id.patch --]
[-- Type: text/plain, Size: 2073 bytes --]
Implement control of LED via set_phys_id.
Note: since PHY is powered off if device is down, this board
only allows blinking if device is up.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/tg3.c 2011-04-04 11:04:20.373199183 -0700
+++ b/drivers/net/tg3.c 2011-04-04 11:05:19.485863394 -0700
@@ -10317,35 +10317,38 @@ static void tg3_get_strings(struct net_d
}
}
-static int tg3_phys_id(struct net_device *dev, u32 data)
+static int tg3_set_phys_id(struct net_device *dev,
+ enum ethtool_phys_id_state state)
{
struct tg3 *tp = netdev_priv(dev);
- int i;
if (!netif_running(tp->dev))
return -EAGAIN;
- if (data == 0)
- data = UINT_MAX / 2;
+ switch (state) {
+ case ETHTOOL_ID_ACTIVE:
+ return -EINVAL;
- for (i = 0; i < (data * 2); i++) {
- if ((i % 2) == 0)
- tw32(MAC_LED_CTRL, LED_CTRL_LNKLED_OVERRIDE |
- LED_CTRL_1000MBPS_ON |
- LED_CTRL_100MBPS_ON |
- LED_CTRL_10MBPS_ON |
- LED_CTRL_TRAFFIC_OVERRIDE |
- LED_CTRL_TRAFFIC_BLINK |
- LED_CTRL_TRAFFIC_LED);
+ case ETHTOOL_ID_ON:
+ tw32(MAC_LED_CTRL, LED_CTRL_LNKLED_OVERRIDE |
+ LED_CTRL_1000MBPS_ON |
+ LED_CTRL_100MBPS_ON |
+ LED_CTRL_10MBPS_ON |
+ LED_CTRL_TRAFFIC_OVERRIDE |
+ LED_CTRL_TRAFFIC_BLINK |
+ LED_CTRL_TRAFFIC_LED);
+ break;
- else
- tw32(MAC_LED_CTRL, LED_CTRL_LNKLED_OVERRIDE |
- LED_CTRL_TRAFFIC_OVERRIDE);
+ case ETHTOOL_ID_OFF:
+ tw32(MAC_LED_CTRL, LED_CTRL_LNKLED_OVERRIDE |
+ LED_CTRL_TRAFFIC_OVERRIDE);
+ break;
- if (msleep_interruptible(500))
- break;
+ case ETHTOOL_ID_INACTIVE:
+ tw32(MAC_LED_CTRL, tp->led_ctrl);
+ break;
}
- tw32(MAC_LED_CTRL, tp->led_ctrl);
+
return 0;
}
@@ -11371,7 +11374,7 @@ static const struct ethtool_ops tg3_etht
.set_tso = tg3_set_tso,
.self_test = tg3_self_test,
.get_strings = tg3_get_strings,
- .phys_id = tg3_phys_id,
+ .set_phys_id = tg3_set_phys_id,
.get_ethtool_stats = tg3_get_ethtool_stats,
.get_coalesce = tg3_get_coalesce,
.set_coalesce = tg3_set_coalesce,
^ permalink raw reply
* [PATCH net-next-2.6 12/12] qlcnic: convert to set_phys_id
From: Stephen Hemminger @ 2011-04-04 18:43 UTC (permalink / raw)
To: David S. Miller, Ben Hutchings, Amit Kumar Salecha,
Anirban Chakraborty
Cc: netdev
In-Reply-To: <20110404184340.604594357@linuxplumber.net>
[-- Attachment #1: qlcnic-set-phys.patch --]
[-- Type: text/plain, Size: 2635 bytes --]
Convert driver to use new ethtool set_phys_id.
Not completely sure that this is correct for all cases of device
up/down and doing operation. Compile tested only.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/qlcnic/qlcnic_ethtool.c 2011-04-04 11:30:54.689092370 -0700
+++ b/drivers/net/qlcnic/qlcnic_ethtool.c 2011-04-04 11:36:55.776744627 -0700
@@ -831,48 +831,51 @@ static int qlcnic_set_tso(struct net_dev
return 0;
}
-static int qlcnic_blink_led(struct net_device *dev, u32 val)
+static int qlcnic_set_led(struct net_device *dev,
+ enum ethtool_phys_id_state state)
{
struct qlcnic_adapter *adapter = netdev_priv(dev);
int max_sds_rings = adapter->max_sds_rings;
- int dev_down = 0;
int ret;
- if (!test_bit(__QLCNIC_DEV_UP, &adapter->state)) {
- dev_down = 1;
- if (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state))
- return -EIO;
-
- ret = qlcnic_diag_alloc_res(dev, QLCNIC_LED_TEST);
+ switch (state) {
+ case ETHTOOL_ID_ACTIVE:
+ if (!test_bit(__QLCNIC_DEV_UP, &adapter->state)) {
+ if (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state))
+ return -EIO;
+
+ ret = qlcnic_diag_alloc_res(dev, QLCNIC_LED_TEST);
+ if (ret) {
+ clear_bit(__QLCNIC_RESETTING, &adapter->state);
+ return ret;
+ }
+ }
+
+ ret = adapter->nic_ops->config_led(adapter, 1, 0xf);
if (ret) {
- clear_bit(__QLCNIC_RESETTING, &adapter->state);
- return ret;
+ dev_err(&adapter->pdev->dev,
+ "Failed to set LED blink state.\n");
+ break;
}
- }
-
- ret = adapter->nic_ops->config_led(adapter, 1, 0xf);
- if (ret) {
- dev_err(&adapter->pdev->dev,
- "Failed to set LED blink state.\n");
- goto done;
- }
+ return 0;
- msleep_interruptible(val * 1000);
+ case ETHTOOL_ID_INACTIVE:
+ ret = adapter->nic_ops->config_led(adapter, 0, 0xf);
+ if (ret)
+ dev_err(&adapter->pdev->dev,
+ "Failed to reset LED blink state.\n");
+ break;
- ret = adapter->nic_ops->config_led(adapter, 0, 0xf);
- if (ret) {
- dev_err(&adapter->pdev->dev,
- "Failed to reset LED blink state.\n");
- goto done;
+ default:
+ return -EINVAL;
}
-done:
- if (dev_down) {
+ if (!netif_running(dev)) {
qlcnic_diag_free_res(dev, max_sds_rings);
clear_bit(__QLCNIC_RESETTING, &adapter->state);
}
- return ret;
+ return ret;
}
static void
@@ -1080,7 +1083,7 @@ const struct ethtool_ops qlcnic_ethtool_
.set_coalesce = qlcnic_set_intr_coalesce,
.get_flags = ethtool_op_get_flags,
.set_flags = qlcnic_set_flags,
- .phys_id = qlcnic_blink_led,
+ .set_phys_id = qlcnic_set_led,
.set_msglevel = qlcnic_set_msglevel,
.get_msglevel = qlcnic_get_msglevel,
};
^ permalink raw reply
* [PATCH net-next-2.6 11/12] cxgb3: implement set_phys_id
From: Stephen Hemminger @ 2011-04-04 18:43 UTC (permalink / raw)
To: David S. Miller, Ben Hutchings, Divy Le Ray; +Cc: netdev
In-Reply-To: <20110404184340.604594357@linuxplumber.net>
[-- Attachment #1: chelsio-set-phys.patch --]
[-- Type: text/plain, Size: 1459 bytes --]
Implement new ethtool set_phys_id on Chelsio cxgb3 board.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/cxgb3/cxgb3_main.c 2011-04-04 11:05:44.658151093 -0700
+++ b/drivers/net/cxgb3/cxgb3_main.c 2011-04-04 11:08:37.060177688 -0700
@@ -1749,23 +1749,26 @@ static int restart_autoneg(struct net_de
return 0;
}
-static int cxgb3_phys_id(struct net_device *dev, u32 data)
+static int set_phys_id(struct net_device *dev,
+ enum ethtool_phys_id_state state)
{
struct port_info *pi = netdev_priv(dev);
struct adapter *adapter = pi->adapter;
- int i;
- if (data == 0)
- data = 2;
+ switch (state) {
+ case ETHTOOL_ID_ACTIVE:
+ return -EINVAL;
+
+ case ETHTOOL_ID_OFF:
+ t3_set_reg_field(adapter, A_T3DBG_GPIO_EN, F_GPIO0_OUT_VAL, 0);
+ break;
- for (i = 0; i < data * 2; i++) {
+ case ETHTOOL_ID_ON:
+ case ETHTOOL_ID_INACTIVE:
t3_set_reg_field(adapter, A_T3DBG_GPIO_EN, F_GPIO0_OUT_VAL,
- (i & 1) ? F_GPIO0_OUT_VAL : 0);
- if (msleep_interruptible(500))
- break;
- }
- t3_set_reg_field(adapter, A_T3DBG_GPIO_EN, F_GPIO0_OUT_VAL,
F_GPIO0_OUT_VAL);
+ }
+
return 0;
}
@@ -2107,7 +2110,7 @@ static const struct ethtool_ops cxgb_eth
.set_sg = ethtool_op_set_sg,
.get_link = ethtool_op_get_link,
.get_strings = get_strings,
- .phys_id = cxgb3_phys_id,
+ .set_phys_id = set_phys_id,
.nway_reset = restart_autoneg,
.get_sset_count = get_sset_count,
.get_ethtool_stats = get_stats,
^ permalink raw reply
* Re: [patch net-next-2.6] net: vlan: make non-hw-accel rx path similar to hw-accel
From: Nicolas de Pesloüan @ 2011-04-04 19:00 UTC (permalink / raw)
To: Jiri Pirko
Cc: Jesse Gross, netdev, davem, shemminger, kaber, fubar,
eric.dumazet, andy, xiaosuo, Eric W. Biederman
In-Reply-To: <20110404071453.GA2791@psychotron.redhat.com>
Le 04/04/2011 09:14, Jiri Pirko a écrit :
> Mon, Apr 04, 2011 at 08:54:40AM CEST, nicolas.2p.debian@gmail.com wrote:
>> Le 03/04/2011 22:38, Jesse Gross a écrit :
<snip>
>>> It would be nice to merge all of this together. One complication is
>>> the interaction of bridging and vlan on the same device. Some people
>>> want to have a bridge for each vlan and a bridge for untagged packets.
>>> On older kernels with vlan accelerated hardware this was possible
>>> because vlan devices would get packets before bridging and on current
>>> kernels it is possible with ebtables rules. If we use rx_handler for
>>> both I believe we would need to extend it some to allow multiple
>>> handlers.
>>
>> I totally agree.
>
> I do not. The reason I do vlan_untag early is so actually emulates
> hw acceleration. The reason is to make rx path of hwaccel an
> nonhwaccel similar. If you move vlan untag to rx_handler, this goal
> wouldn't be achieved.
Need to think more about that point.
>> Remember that Jiri's original proposal (last summer) was to have
>> several rx_handlers per net_device. I still think we need several of
>> them, because the network stack need to be generic and allow for any
>> complex stacking setup. The rx_handler framework may need to be
>> enhanced for that, but I think it is the right tool to do all those
>> per net_device specific features.
>>
>>>> This would also cause protocol handlers to receive the untouched (tagged)
>>>> frame, if no setup required the frame to be untagged, which I think is the
>>>> right thing to do.
>>>
>>> At the very least we need to make sure that these packets are marked
>>> as PACKET_OTHERHOST because protocol handlers don't pay attention to
>>> the vlan field.
>>
>> Agreed.
>>
>>>>> @@ -3177,7 +3183,7 @@ ncls:
>>>>> ret = deliver_skb(skb, pt_prev, orig_dev);
>>>>> pt_prev = NULL;
>>>>> }
>>>>> - if (vlan_hwaccel_do_receive(&skb)) {
>>>>> + if (vlan_do_receive(&skb)) {
>>>>> ret = __netif_receive_skb(skb);
>>>>> goto out;
>>>>> } else if (unlikely(!skb))
>>>>
>>>> Why are you calling __netif_receive_skb here? Can't we simply goto
>>>> another_round?
>>>
>>> This code (other than the name change) predates the
>>> another_round/rx_handler changes.
>>
>> Yes, you are right. Let's keep this for a possible follow-up patch,
>> to avoid skb reinjection when it is not strictly necessary.
>
> To do another round here was my attention do do in follow up patch (I'm
> still figuring out how to move this effectively into rx_handlers)
So you want to move vlan_do_receive into an rx_handler, but want untagging to stay hard-coded at the
beginning of __netif_receive_skb. I don't think I understand the rational behind that.
^ permalink raw reply
* Re: [PATCH v3] net: Allow no-cache copy from user on transmit
From: Tom Herbert @ 2011-04-04 19:44 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20110404.095207.137846978.davem@davemloft.net>
> I'm simply saying to get rid of the ARCH_HAS_NOCACHE_UACCESS ifdefs
> you're adding to the networking code, since linux/uaccess.h makes sure
> that a nop version of the nocache routines are available always.
>
> If you ifdef the networking bits unnecessarily, those code paths
> won't get build tested in the majority of my test builds, which are
> on sparc64. So I want to avoid the conditionalized compilation if
> at all possible.
>
I'll take them out, but that will result in one needless conditional
in the transmit path for architectures that don't support the no cache
copy, which seems to be everything except x86!?
^ permalink raw reply
* Re: [patch net-next-2.6] net: vlan: make non-hw-accel rx path similar to hw-accel
From: Eric W. Biederman @ 2011-04-04 19:51 UTC (permalink / raw)
To: Nicolas de Pesloüan
Cc: Jiri Pirko, Jesse Gross, netdev, davem, shemminger, kaber, fubar,
eric.dumazet, andy, xiaosuo
In-Reply-To: <4D9A1530.1010102@gmail.com>
Nicolas de Pesloüan <nicolas.2p.debian@gmail.com> writes:
> Le 04/04/2011 09:14, Jiri Pirko a écrit :
>> Mon, Apr 04, 2011 at 08:54:40AM CEST, nicolas.2p.debian@gmail.com wrote:
>>> Le 03/04/2011 22:38, Jesse Gross a écrit :
> <snip>
>>>> It would be nice to merge all of this together. One complication is
>>>> the interaction of bridging and vlan on the same device. Some people
>>>> want to have a bridge for each vlan and a bridge for untagged packets.
>>>> On older kernels with vlan accelerated hardware this was possible
>>>> because vlan devices would get packets before bridging and on current
>>>> kernels it is possible with ebtables rules. If we use rx_handler for
>>>> both I believe we would need to extend it some to allow multiple
>>>> handlers.
>>>
>>> I totally agree.
>>
>> I do not. The reason I do vlan_untag early is so actually emulates
>> hw acceleration. The reason is to make rx path of hwaccel an
>> nonhwaccel similar. If you move vlan untag to rx_handler, this goal
>> wouldn't be achieved.
>
> Need to think more about that point.
>
>>> Remember that Jiri's original proposal (last summer) was to have
>>> several rx_handlers per net_device. I still think we need several of
>>> them, because the network stack need to be generic and allow for any
>>> complex stacking setup. The rx_handler framework may need to be
>>> enhanced for that, but I think it is the right tool to do all those
>>> per net_device specific features.
>>>
>>>>> This would also cause protocol handlers to receive the untouched (tagged)
>>>>> frame, if no setup required the frame to be untagged, which I think is the
>>>>> right thing to do.
>>>>
>>>> At the very least we need to make sure that these packets are marked
>>>> as PACKET_OTHERHOST because protocol handlers don't pay attention to
>>>> the vlan field.
>>>
>>> Agreed.
>>>
>>>>>> @@ -3177,7 +3183,7 @@ ncls:
>>>>>> ret = deliver_skb(skb, pt_prev, orig_dev);
>>>>>> pt_prev = NULL;
>>>>>> }
>>>>>> - if (vlan_hwaccel_do_receive(&skb)) {
>>>>>> + if (vlan_do_receive(&skb)) {
>>>>>> ret = __netif_receive_skb(skb);
>>>>>> goto out;
>>>>>> } else if (unlikely(!skb))
>>>>>
>>>>> Why are you calling __netif_receive_skb here? Can't we simply goto
>>>>> another_round?
>>>>
>>>> This code (other than the name change) predates the
>>>> another_round/rx_handler changes.
>>>
>>> Yes, you are right. Let's keep this for a possible follow-up patch,
>>> to avoid skb reinjection when it is not strictly necessary.
>>
>> To do another round here was my attention do do in follow up patch (I'm
>> still figuring out how to move this effectively into rx_handlers)
>
> So you want to move vlan_do_receive into an rx_handler, but want untagging to
> stay hard-coded at the beginning of __netif_receive_skb. I don't think I
> understand the rational behind that.
__netif_receive_skb is actually late for untagging. eth_type_trans
would be better but not path of control into __netif_receive_skb
actually calls eth_type_trans.
Eric
^ permalink raw reply
* Re: [PATCH net-next-2.6 00/12] Convert more drivers to ethtool set_phys_id
From: Jeff Kirsher @ 2011-04-04 19:53 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David S. Miller, Ben Hutchings, netdev
In-Reply-To: <20110404184340.604594357@linuxplumber.net>
On Mon, Apr 4, 2011 at 11:43, Stephen Hemminger <shemminger@vyatta.com> wrote:
> Did a bunch of the easy drivers to convert.
>
>
I have added patches 3-9 (Intel driver conversions) to my queue of
patches. Thanks Stephen.
--
Cheers,
Jeff
^ permalink raw reply
* [PATCH] ipv6: Don't pass invalid dst_entry pointer to dst_release().
From: Boris Ostrovsky @ 2011-04-04 19:55 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-kernel, Boris Ostrovsky
From: Boris Ostrovsky <boris.ostrovsky@amd.com>
Make sure dst_release() is not called with error pointer. This is
similar to commit 4910ac6c526d2868adcb5893e0c428473de862b5.
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
---
net/ipv6/tcp_ipv6.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 2b0c186..56fa125 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -503,6 +503,7 @@ static int tcp_v6_send_synack(struct sock *sk, struct request_sock *req,
dst = ip6_dst_lookup_flow(sk, &fl6, final_p, false);
if (IS_ERR(dst)) {
err = PTR_ERR(dst);
+ dst = NULL;
goto done;
}
skb = tcp_make_synack(sk, dst, req, rvp);
--
1.7.1
^ permalink raw reply related
* shutdown oops in xt_compat_calc_jump
From: dann frazier @ 2011-04-04 19:48 UTC (permalink / raw)
To: netdev
fyi, noticed this oops when shutting down a system running top of git
(@ 78fca1be)
[ 1169.794644] cfg80211: Calling CRDA to update world regulatory domain
[ 1170.490646] bluetoothd[2029]: segfault at f8ad9944 ip 00000000f77045e0 sp 00000000ffcb14e0 error 4 in bluetoothd[f76bf000+8b000]
[ 1170.543817] BUG: unable to handle kernel paging request at 00000001dc1be9f8
[ 1170.543875] IP: [<ffffffffa051e7b0>] xt_compat_calc_jump+0x25/0x6f [x_tables]
[ 1170.543927] PGD 1215b3067 PUD 0
[ 1170.543955] Oops: 0000 [#1] SMP
[ 1170.543982] last sysfs file: /sys/module/bridge/initstate
[ 1170.544017] CPU 3
[ 1170.544031] Modules linked in: ebtable_broute ebtable_filter vfat msdos fat ext3 jbd ip6table_filter ip6_tables ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables bridge stp llc acpi_cpufreq mperf cpufreq_powersave cpufreq_userspace cpufreq_conservative cpufreq_stats binfmt_misc kvm(-) fuse ext2 loop snd_hda_codec_hdmi snd_hda_codec_conexant arc4 ecb snd_usb_audio snd_usbmidi_lib snd_seq_midi snd_seq_midi_event snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_rawmidi i915 drm_kms_helper thinkpad_acpi snd_seq iwlagn snd_timer snd_seq_device drm snd mac80211 psmouse btusb serio_raw bluetooth evdev tpm_tis snd_page_alloc tpm i2c_i801 i2c_algo_bit cfg80211 battery soundcore nvr
am tpm_bios i2c_core rfkill wmi ac power_supply video button processor ext4 mbcache jbd2 crc16 sha256_generic aesni_intel cryptd aes_x86_64 aes_generic cbc dm_crypt dm_mod sd_mod crc_t10dif usbhid
hid usb_storage ahci libahci libata ehci_hcd scsi_mod usbcore e1000e thermal thermal_sys [last unloaded: kvm_intel]
[ 1170.544836]
[ 1170.544849] Pid: 4901, comm: ebtables Not tainted 2.6.39-rc1+ #9 LENOVO 2516CTO/2516CTO
[ 1170.544902] RIP: 0010:[<ffffffffa051e7b0>] [<ffffffffa051e7b0>] xt_compat_calc_jump+0x25/0x6f [x_tables]
[ 1170.544958] RSP: 0018:ffff880121473cf8 EFLAGS: 00010217
[ 1170.544989] RAX: 000000003b837d3f RBX: 0000000000000090 RCX: 000000007706fa7f
[ 1170.545029] RDX: 0000000000000000 RSI: 0000000000000090 RDI: 000000003b837d3f
[ 1170.545067] RBP: ffffc900111a3000 R08: 0000000000000000 R09: dead000000200200
[ 1170.545104] R10: dead000000100100 R11: 0000000000001311 R12: ffff880121473d88
[ 1170.545147] R13: ffffc900111a6000 R14: ffffffff817de300 R15: 0000000000000000
[ 1170.545185] FS: 0000000000000000(0000) GS:ffff880137d80000(0063) knlGS:00000000f761b6c0
[ 1170.545227] CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033
[ 1170.545258] CR2: 00000001dc1be9f8 CR3: 0000000125868000 CR4: 00000000000006e0
[ 1170.545297] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 1170.545334] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[ 1170.545375] Process ebtables (pid: 4901, threadinfo ffff880121472000, task ffff8801322d1ac0)
[ 1170.545418] Stack:
[ 1170.545433] 0000000000000090 ffffffffa0576d46 f7007265746c6966 0000000000000054
[ 1170.545479] 0000000000000000 0000000000000000 000000000000000e 0000000000000090
[ 1170.545529] 0000000000000000 0000000008af2180 0000000008af21b0 0000000008af21e0
[ 1170.545579] Call Trace:
[ 1170.545600] [<ffffffffa0576d46>] ? compat_do_replace+0x117/0x221 [ebtables]
[ 1170.545639] [<ffffffffa0577392>] ? compat_do_ebt_set_ctl+0x55/0xbb [ebtables]
[ 1170.545688] [<ffffffff810337e3>] ? need_resched+0x1a/0x23
[ 1170.545723] [<ffffffff810337f1>] ? should_resched+0x5/0x24
[ 1170.545730] [<ffffffff81314cc5>] ? _cond_resched+0x9/0x20
[ 1170.545733] [<ffffffff813152fe>] ? mutex_lock_interruptible+0x18/0x32
[ 1170.545738] [<ffffffff8128490b>] ? nf_sockopt_find.clone.1+0xda/0xec
[ 1170.545742] [<ffffffff81284996>] ? compat_nf_sockopt+0x79/0xa5
[ 1170.545744] [<ffffffff810337f1>] ? should_resched+0x5/0x24
[ 1170.545747] [<ffffffff812849f3>] ? compat_nf_setsockopt+0x1a/0x1f
[ 1170.545751] [<ffffffff8128fb35>] ? compat_ip_setsockopt+0x80/0xa0
[ 1170.545756] [<ffffffff812784a2>] ? compat_sys_setsockopt+0x1d5/0x204
[ 1170.545759] [<ffffffff810337f1>] ? should_resched+0x5/0x24
[ 1170.545761] [<ffffffff81314cc5>] ? _cond_resched+0x9/0x20
[ 1170.545764] [<ffffffff812788a5>] ? compat_sys_socketcall+0x148/0x1a7
[ 1170.545768] [<ffffffff8131d2c0>] ? sysenter_dispatch+0x7/0x2e
[ 1170.545769] Code: 5d 41 5e 41 5f c3 40 0f b6 ff 53 31 d2 48 6b ff 70 48 03 3d 03 1b 00 00 8b 4f 6c 4c 8b 47 60 ff c9 eb 27 8d 04 11 d1 f8 48 63 f8
[ 1170.545787] RIP [<ffffffffa051e7b0>] xt_compat_calc_jump+0x25/0x6f [x_tables]
[ 1170.545792] RSP <ffff880121473cf8>
[ 1170.545794] CR2: 00000001dc1be9f8
[ 1170.654269] ---[ end trace d44667d90dcbd115 ]---
[ 1170.662411] fuse exit
Kernel logging (proc) stopped.
^ permalink raw reply
* Re: shutdown oops in xt_compat_calc_jump
From: Patrick McHardy @ 2011-04-04 20:02 UTC (permalink / raw)
To: dann frazier; +Cc: netdev, netfilter-devel@vger.kernel.org
In-Reply-To: <20110404194856.GA3720@dannf.org>
CCed netfilter-devel.
Am 04.04.2011 21:48, schrieb dann frazier:
> fyi, noticed this oops when shutting down a system running top of git
> (@ 78fca1be)
>
> [ 1169.794644] cfg80211: Calling CRDA to update world regulatory domain
> [ 1170.490646] bluetoothd[2029]: segfault at f8ad9944 ip 00000000f77045e0 sp 00000000ffcb14e0 error 4 in bluetoothd[f76bf000+8b000]
> [ 1170.543817] BUG: unable to handle kernel paging request at 00000001dc1be9f8
> [ 1170.543875] IP: [<ffffffffa051e7b0>] xt_compat_calc_jump+0x25/0x6f [x_tables]
> [ 1170.543927] PGD 1215b3067 PUD 0
> [ 1170.543955] Oops: 0000 [#1] SMP
> [ 1170.543982] last sysfs file: /sys/module/bridge/initstate
> [ 1170.544017] CPU 3
> [ 1170.544031] Modules linked in: ebtable_broute ebtable_filter vfat msdos fat ext3 jbd ip6table_filter ip6_tables ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables bridge stp llc acpi_cpufreq mperf cpufreq_powersave cpufreq_userspace cpufreq_conservative cpufreq_stats binfmt_misc kvm(-) fuse ext2 loop snd_hda_codec_hdmi snd_hda_codec_conexant arc4 ecb snd_usb_audio snd_usbmidi_lib snd_seq_midi snd_seq_midi_event snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_rawmidi i915 drm_kms_helper thinkpad_acpi snd_seq iwlagn snd_timer snd_seq_device drm snd mac80211 psmouse btusb serio_raw bluetooth evdev tpm_tis snd_page_alloc tpm i2c_i801 i2c_algo_bit cfg80211 battery soundcore n
vram tpm_bios i2c_core rfkill wmi ac power_supply video button processor ext4 mbcache jbd2 crc16 sha256_generic aesni_intel cryptd aes_x86_64 aes_generic cbc dm_crypt dm_mod sd_mod crc_t10di
f
> usbhid
> hid usb_storage ahci libahci libata ehci_hcd scsi_mod usbcore e1000e thermal thermal_sys [last unloaded: kvm_intel]
> [ 1170.544836]
> [ 1170.544849] Pid: 4901, comm: ebtables Not tainted 2.6.39-rc1+ #9 LENOVO 2516CTO/2516CTO
> [ 1170.544902] RIP: 0010:[<ffffffffa051e7b0>] [<ffffffffa051e7b0>] xt_compat_calc_jump+0x25/0x6f [x_tables]
> [ 1170.544958] RSP: 0018:ffff880121473cf8 EFLAGS: 00010217
> [ 1170.544989] RAX: 000000003b837d3f RBX: 0000000000000090 RCX: 000000007706fa7f
> [ 1170.545029] RDX: 0000000000000000 RSI: 0000000000000090 RDI: 000000003b837d3f
> [ 1170.545067] RBP: ffffc900111a3000 R08: 0000000000000000 R09: dead000000200200
> [ 1170.545104] R10: dead000000100100 R11: 0000000000001311 R12: ffff880121473d88
> [ 1170.545147] R13: ffffc900111a6000 R14: ffffffff817de300 R15: 0000000000000000
> [ 1170.545185] FS: 0000000000000000(0000) GS:ffff880137d80000(0063) knlGS:00000000f761b6c0
> [ 1170.545227] CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033
> [ 1170.545258] CR2: 00000001dc1be9f8 CR3: 0000000125868000 CR4: 00000000000006e0
> [ 1170.545297] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [ 1170.545334] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> [ 1170.545375] Process ebtables (pid: 4901, threadinfo ffff880121472000, task ffff8801322d1ac0)
> [ 1170.545418] Stack:
> [ 1170.545433] 0000000000000090 ffffffffa0576d46 f7007265746c6966 0000000000000054
> [ 1170.545479] 0000000000000000 0000000000000000 000000000000000e 0000000000000090
> [ 1170.545529] 0000000000000000 0000000008af2180 0000000008af21b0 0000000008af21e0
> [ 1170.545579] Call Trace:
> [ 1170.545600] [<ffffffffa0576d46>] ? compat_do_replace+0x117/0x221 [ebtables]
> [ 1170.545639] [<ffffffffa0577392>] ? compat_do_ebt_set_ctl+0x55/0xbb [ebtables]
> [ 1170.545688] [<ffffffff810337e3>] ? need_resched+0x1a/0x23
> [ 1170.545723] [<ffffffff810337f1>] ? should_resched+0x5/0x24
> [ 1170.545730] [<ffffffff81314cc5>] ? _cond_resched+0x9/0x20
> [ 1170.545733] [<ffffffff813152fe>] ? mutex_lock_interruptible+0x18/0x32
> [ 1170.545738] [<ffffffff8128490b>] ? nf_sockopt_find.clone.1+0xda/0xec
> [ 1170.545742] [<ffffffff81284996>] ? compat_nf_sockopt+0x79/0xa5
> [ 1170.545744] [<ffffffff810337f1>] ? should_resched+0x5/0x24
> [ 1170.545747] [<ffffffff812849f3>] ? compat_nf_setsockopt+0x1a/0x1f
> [ 1170.545751] [<ffffffff8128fb35>] ? compat_ip_setsockopt+0x80/0xa0
> [ 1170.545756] [<ffffffff812784a2>] ? compat_sys_setsockopt+0x1d5/0x204
> [ 1170.545759] [<ffffffff810337f1>] ? should_resched+0x5/0x24
> [ 1170.545761] [<ffffffff81314cc5>] ? _cond_resched+0x9/0x20
> [ 1170.545764] [<ffffffff812788a5>] ? compat_sys_socketcall+0x148/0x1a7
> [ 1170.545768] [<ffffffff8131d2c0>] ? sysenter_dispatch+0x7/0x2e
> [ 1170.545769] Code: 5d 41 5e 41 5f c3 40 0f b6 ff 53 31 d2 48 6b ff 70 48 03 3d 03 1b 00 00 8b 4f 6c 4c 8b 47 60 ff c9 eb 27 8d 04 11 d1 f8 48 63 f8
> [ 1170.545787] RIP [<ffffffffa051e7b0>] xt_compat_calc_jump+0x25/0x6f [x_tables]
> [ 1170.545792] RSP <ffff880121473cf8>
> [ 1170.545794] CR2: 00000001dc1be9f8
> [ 1170.654269] ---[ end trace d44667d90dcbd115 ]---
> [ 1170.662411] fuse exit
> Kernel logging (proc) stopped.
> --
> 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: [PATCH v3] net: Allow no-cache copy from user on transmit
From: David Miller @ 2011-04-04 20:05 UTC (permalink / raw)
To: therbert; +Cc: netdev
In-Reply-To: <BANLkTik=hsDPjLUx+evW698moouj5A35jw@mail.gmail.com>
From: Tom Herbert <therbert@google.com>
Date: Mon, 4 Apr 2011 12:44:08 -0700
> I'll take them out, but that will result in one needless conditional
> in the transmit path for architectures that don't support the no cache
> copy, which seems to be everything except x86!?
I think this is a small price to pay for the build regression
exposure, and perheps it's also a bit of an incentive for more
architectures to support nocache copies :-)
^ permalink raw reply
* Re: [PATCH net-next-2.6 00/12] Convert more drivers to ethtool set_phys_id
From: David Miller @ 2011-04-04 20:06 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: shemminger, bhutchings, netdev
In-Reply-To: <BANLkTimfFPEhr4GozxBZB5Pc-LGXWfGTPQ@mail.gmail.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Mon, 4 Apr 2011 12:53:14 -0700
> On Mon, Apr 4, 2011 at 11:43, Stephen Hemminger <shemminger@vyatta.com> wrote:
>> Did a bunch of the easy drivers to convert.
>>
>>
>
> I have added patches 3-9 (Intel driver conversions) to my queue of
> patches. Thanks Stephen.
Careful, Ben's commit to add the interface still isn't in the tree.
He needs to respin his patch set based upon feedback that came in
the other day.
^ permalink raw reply
* Re: [PATCH] ipv6: Don't pass invalid dst_entry pointer to dst_release().
From: David Miller @ 2011-04-04 20:07 UTC (permalink / raw)
To: ostr; +Cc: netdev, linux-kernel, boris.ostrovsky
In-Reply-To: <1301946910-5530-1-git-send-email-ostr@amd64.org>
From: Boris Ostrovsky <ostr@amd64.org>
Date: Mon, 4 Apr 2011 15:55:10 -0400
> From: Boris Ostrovsky <boris.ostrovsky@amd.com>
>
> Make sure dst_release() is not called with error pointer. This is
> similar to commit 4910ac6c526d2868adcb5893e0c428473de862b5.
>
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
Applied, thank you.
^ permalink raw reply
* Re: [PATCH net-next-2.6 00/12] Convert more drivers to ethtool set_phys_id
From: Stephen Hemminger @ 2011-04-04 20:14 UTC (permalink / raw)
To: Jeff Kirsher; +Cc: David S. Miller, Ben Hutchings, netdev
In-Reply-To: <BANLkTimfFPEhr4GozxBZB5Pc-LGXWfGTPQ@mail.gmail.com>
On Mon, 4 Apr 2011 12:53:14 -0700
Jeff Kirsher <jeffrey.t.kirsher@intel.com> wrote:
> On Mon, Apr 4, 2011 at 11:43, Stephen Hemminger <shemminger@vyatta.com> wrote:
> > Did a bunch of the easy drivers to convert.
> >
> >
>
> I have added patches 3-9 (Intel driver conversions) to my queue of
> patches. Thanks Stephen.
I changed the behaviour of igbvf for 'ethtool -p' to return not supported.
This seems correct, but it may break somebody who has some weird script running
in a virt environment.
^ permalink raw reply
* [PATCH net-next-2.6] can: convert protocol handling to RCU
From: Oliver Hartkopp @ 2011-04-04 20:21 UTC (permalink / raw)
To: David Miller
Cc: Linux Netdev List, Kurt Van Dijck, Eric Dumazet, Urs Thuermann
This patch removes spin_locks at CAN socket creation time by using RCU.
Inspired by the discussion with Kurt van Dijck and Eric Dumazet the RCU code
was partly derived from af_phonet.c
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
---
diff --git a/net/can/af_can.c b/net/can/af_can.c
index 733d66f..551ebc1 100644
--- a/net/can/af_can.c
+++ b/net/can/af_can.c
@@ -85,7 +85,7 @@ static struct kmem_cache *rcv_cache __read_mostly;
/* table of registered CAN protocols */
static struct can_proto *proto_tab[CAN_NPROTO] __read_mostly;
-static DEFINE_SPINLOCK(proto_tab_lock);
+static DEFINE_MUTEX(proto_tab_lock);
struct timer_list can_stattimer; /* timer for statistics update */
struct s_stats can_stats; /* packet statistics */
@@ -115,6 +115,19 @@ static void can_sock_destruct(struct sock *sk)
skb_queue_purge(&sk->sk_receive_queue);
}
+static struct can_proto *can_try_module_get(int protocol)
+{
+ struct can_proto *cp;
+
+ rcu_read_lock();
+ cp = rcu_dereference(proto_tab[protocol]);
+ if (cp && !try_module_get(cp->prot->owner))
+ cp = NULL;
+ rcu_read_unlock();
+
+ return cp;
+}
+
static int can_create(struct net *net, struct socket *sock, int protocol,
int kern)
{
@@ -130,9 +143,12 @@ static int can_create(struct net *net, struct socket *sock, int protocol,
if (!net_eq(net, &init_net))
return -EAFNOSUPPORT;
+ cp = can_try_module_get(protocol);
+
#ifdef CONFIG_MODULES
- /* try to load protocol module kernel is modular */
- if (!proto_tab[protocol]) {
+ if (!cp) {
+ /* try to load protocol module if kernel is modular */
+
err = request_module("can-proto-%d", protocol);
/*
@@ -143,22 +159,18 @@ static int can_create(struct net *net, struct socket *sock, int protocol,
if (err && printk_ratelimit())
printk(KERN_ERR "can: request_module "
"(can-proto-%d) failed.\n", protocol);
+ else
+ cp = can_try_module_get(protocol);
}
#endif
- spin_lock(&proto_tab_lock);
- cp = proto_tab[protocol];
- if (cp && !try_module_get(cp->prot->owner))
- cp = NULL;
- spin_unlock(&proto_tab_lock);
-
/* check for available protocol and correct usage */
if (!cp)
return -EPROTONOSUPPORT;
if (cp->type != sock->type) {
- err = -EPROTONOSUPPORT;
+ err = -EPROTOTYPE;
goto errout;
}
@@ -694,15 +706,16 @@ int can_proto_register(struct can_proto *cp)
if (err < 0)
return err;
- spin_lock(&proto_tab_lock);
+ mutex_lock(&proto_tab_lock);
+
if (proto_tab[proto]) {
printk(KERN_ERR "can: protocol %d already registered\n",
proto);
err = -EBUSY;
} else
- proto_tab[proto] = cp;
+ rcu_assign_pointer(proto_tab[proto], cp);
- spin_unlock(&proto_tab_lock);
+ mutex_unlock(&proto_tab_lock);
if (err < 0)
proto_unregister(cp->prot);
@@ -719,13 +732,12 @@ void can_proto_unregister(struct can_proto *cp)
{
int proto = cp->protocol;
- spin_lock(&proto_tab_lock);
- if (!proto_tab[proto]) {
- printk(KERN_ERR "BUG: can: protocol %d is not registered\n",
- proto);
- }
- proto_tab[proto] = NULL;
- spin_unlock(&proto_tab_lock);
+ mutex_lock(&proto_tab_lock);
+ BUG_ON(proto_tab[proto] != cp);
+ rcu_assign_pointer(proto_tab[proto], NULL);
+ mutex_unlock(&proto_tab_lock);
+
+ synchronize_rcu();
proto_unregister(cp->prot);
}
^ permalink raw reply related
* Re: [PATCH net-next-2.6] can: convert protocol handling to RCU
From: Eric Dumazet @ 2011-04-04 20:26 UTC (permalink / raw)
To: Oliver Hartkopp
Cc: David Miller, Linux Netdev List, Kurt Van Dijck, Urs Thuermann
In-Reply-To: <4D9A2844.2080304@hartkopp.net>
Le lundi 04 avril 2011 à 22:21 +0200, Oliver Hartkopp a écrit :
> This patch removes spin_locks at CAN socket creation time by using RCU.
>
> Inspired by the discussion with Kurt van Dijck and Eric Dumazet the RCU code
> was partly derived from af_phonet.c
>
> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
>
> ---
>
> diff --git a/net/can/af_can.c b/net/can/af_can.c
> index 733d66f..551ebc1 100644
> --- a/net/can/af_can.c
> +++ b/net/can/af_can.c
> @@ -85,7 +85,7 @@ static struct kmem_cache *rcv_cache __read_mostly;
Seems good to me, thanks !
Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>
^ permalink raw reply
* Re: [PATCH net-next-2.6 00/12] Convert more drivers to ethtool set_phys_id
From: Ben Hutchings @ 2011-04-04 20:28 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Jeff Kirsher, David S. Miller, netdev
In-Reply-To: <20110404131459.793f67fc@nehalam>
On Mon, 2011-04-04 at 13:14 -0700, Stephen Hemminger wrote:
> On Mon, 4 Apr 2011 12:53:14 -0700
> Jeff Kirsher <jeffrey.t.kirsher@intel.com> wrote:
>
> > On Mon, Apr 4, 2011 at 11:43, Stephen Hemminger <shemminger@vyatta.com> wrote:
> > > Did a bunch of the easy drivers to convert.
> > >
> > >
> >
> > I have added patches 3-9 (Intel driver conversions) to my queue of
> > patches. Thanks Stephen.
>
> I changed the behaviour of igbvf for 'ethtool -p' to return not supported.
> This seems correct, but it may break somebody who has some weird script running
> in a virt environment.
Surely it should be connected to a virtual LED. Doesn't virt-manager
have those yet? ;-)
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [patch net-next-2.6] net: vlan: make non-hw-accel rx path similar to hw-accel
From: Jiri Pirko @ 2011-04-04 20:29 UTC (permalink / raw)
To: Eric W. Biederman
Cc: Nicolas de Pesloüan, Jesse Gross, netdev, davem, shemminger,
kaber, fubar, eric.dumazet, andy, xiaosuo
In-Reply-To: <m1d3l1eqw8.fsf@fess.ebiederm.org>
Mon, Apr 04, 2011 at 09:51:51PM CEST, ebiederm@xmission.com wrote:
>Nicolas de Pesloüan <nicolas.2p.debian@gmail.com> writes:
>
>> Le 04/04/2011 09:14, Jiri Pirko a écrit :
>>> Mon, Apr 04, 2011 at 08:54:40AM CEST, nicolas.2p.debian@gmail.com wrote:
>>>> Le 03/04/2011 22:38, Jesse Gross a écrit :
>> <snip>
>>>>> It would be nice to merge all of this together. One complication is
>>>>> the interaction of bridging and vlan on the same device. Some people
>>>>> want to have a bridge for each vlan and a bridge for untagged packets.
>>>>> On older kernels with vlan accelerated hardware this was possible
>>>>> because vlan devices would get packets before bridging and on current
>>>>> kernels it is possible with ebtables rules. If we use rx_handler for
>>>>> both I believe we would need to extend it some to allow multiple
>>>>> handlers.
>>>>
>>>> I totally agree.
>>>
>>> I do not. The reason I do vlan_untag early is so actually emulates
>>> hw acceleration. The reason is to make rx path of hwaccel an
>>> nonhwaccel similar. If you move vlan untag to rx_handler, this goal
>>> wouldn't be achieved.
>>
>> Need to think more about that point.
>>
>>>> Remember that Jiri's original proposal (last summer) was to have
>>>> several rx_handlers per net_device. I still think we need several of
>>>> them, because the network stack need to be generic and allow for any
>>>> complex stacking setup. The rx_handler framework may need to be
>>>> enhanced for that, but I think it is the right tool to do all those
>>>> per net_device specific features.
>>>>
>>>>>> This would also cause protocol handlers to receive the untouched (tagged)
>>>>>> frame, if no setup required the frame to be untagged, which I think is the
>>>>>> right thing to do.
>>>>>
>>>>> At the very least we need to make sure that these packets are marked
>>>>> as PACKET_OTHERHOST because protocol handlers don't pay attention to
>>>>> the vlan field.
>>>>
>>>> Agreed.
>>>>
>>>>>>> @@ -3177,7 +3183,7 @@ ncls:
>>>>>>> ret = deliver_skb(skb, pt_prev, orig_dev);
>>>>>>> pt_prev = NULL;
>>>>>>> }
>>>>>>> - if (vlan_hwaccel_do_receive(&skb)) {
>>>>>>> + if (vlan_do_receive(&skb)) {
>>>>>>> ret = __netif_receive_skb(skb);
>>>>>>> goto out;
>>>>>>> } else if (unlikely(!skb))
>>>>>>
>>>>>> Why are you calling __netif_receive_skb here? Can't we simply goto
>>>>>> another_round?
>>>>>
>>>>> This code (other than the name change) predates the
>>>>> another_round/rx_handler changes.
>>>>
>>>> Yes, you are right. Let's keep this for a possible follow-up patch,
>>>> to avoid skb reinjection when it is not strictly necessary.
>>>
>>> To do another round here was my attention do do in follow up patch (I'm
>>> still figuring out how to move this effectively into rx_handlers)
>>
>> So you want to move vlan_do_receive into an rx_handler, but want untagging to
>> stay hard-coded at the beginning of __netif_receive_skb. I don't think I
>> understand the rational behind that.
>
>__netif_receive_skb is actually late for untagging. eth_type_trans
>would be better but not path of control into __netif_receive_skb
>actually calls eth_type_trans.
Why __netif_receive_skb is late?
>
>Eric
>
^ permalink raw reply
* Re: [patch net-next-2.6] net: vlan: make non-hw-accel rx path similar to hw-accel
From: Jiri Pirko @ 2011-04-04 20:30 UTC (permalink / raw)
To: Nicolas de Pesloüan
Cc: Jesse Gross, netdev, davem, shemminger, kaber, fubar,
eric.dumazet, andy, xiaosuo, Eric W. Biederman
In-Reply-To: <4D9A1530.1010102@gmail.com>
Mon, Apr 04, 2011 at 09:00:00PM CEST, nicolas.2p.debian@gmail.com wrote:
>Le 04/04/2011 09:14, Jiri Pirko a écrit :
>>Mon, Apr 04, 2011 at 08:54:40AM CEST, nicolas.2p.debian@gmail.com wrote:
>>>Le 03/04/2011 22:38, Jesse Gross a écrit :
><snip>
>>>>It would be nice to merge all of this together. One complication is
>>>>the interaction of bridging and vlan on the same device. Some people
>>>>want to have a bridge for each vlan and a bridge for untagged packets.
>>>> On older kernels with vlan accelerated hardware this was possible
>>>>because vlan devices would get packets before bridging and on current
>>>>kernels it is possible with ebtables rules. If we use rx_handler for
>>>>both I believe we would need to extend it some to allow multiple
>>>>handlers.
>>>
>>>I totally agree.
>>
>>I do not. The reason I do vlan_untag early is so actually emulates
>>hw acceleration. The reason is to make rx path of hwaccel an
>>nonhwaccel similar. If you move vlan untag to rx_handler, this goal
>>wouldn't be achieved.
>
>Need to think more about that point.
>
>>>Remember that Jiri's original proposal (last summer) was to have
>>>several rx_handlers per net_device. I still think we need several of
>>>them, because the network stack need to be generic and allow for any
>>>complex stacking setup. The rx_handler framework may need to be
>>>enhanced for that, but I think it is the right tool to do all those
>>>per net_device specific features.
>>>
>>>>>This would also cause protocol handlers to receive the untouched (tagged)
>>>>>frame, if no setup required the frame to be untagged, which I think is the
>>>>>right thing to do.
>>>>
>>>>At the very least we need to make sure that these packets are marked
>>>>as PACKET_OTHERHOST because protocol handlers don't pay attention to
>>>>the vlan field.
>>>
>>>Agreed.
>>>
>>>>>>@@ -3177,7 +3183,7 @@ ncls:
>>>>>> ret = deliver_skb(skb, pt_prev, orig_dev);
>>>>>> pt_prev = NULL;
>>>>>> }
>>>>>>- if (vlan_hwaccel_do_receive(&skb)) {
>>>>>>+ if (vlan_do_receive(&skb)) {
>>>>>> ret = __netif_receive_skb(skb);
>>>>>> goto out;
>>>>>> } else if (unlikely(!skb))
>>>>>
>>>>>Why are you calling __netif_receive_skb here? Can't we simply goto
>>>>>another_round?
>>>>
>>>>This code (other than the name change) predates the
>>>>another_round/rx_handler changes.
>>>
>>>Yes, you are right. Let's keep this for a possible follow-up patch,
>>>to avoid skb reinjection when it is not strictly necessary.
>>
>>To do another round here was my attention do do in follow up patch (I'm
>>still figuring out how to move this effectively into rx_handlers)
>
>So you want to move vlan_do_receive into an rx_handler, but want
>untagging to stay hard-coded at the beginning of __netif_receive_skb.
>I don't think I understand the rational behind that.
vlan_hwaccel_do_receive/vlan_do_receive could be converted to
rx_handler, not untagging.
^ permalink raw reply
* Re: [PATCH net-next-2.6 00/12] Convert more drivers to ethtool set_phys_id
From: Jeff Kirsher @ 2011-04-04 20:32 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David S. Miller, Ben Hutchings, netdev@vger.kernel.org
In-Reply-To: <20110404131459.793f67fc@nehalam>
[-- Attachment #1: Type: text/plain, Size: 739 bytes --]
On Mon, 2011-04-04 at 13:14 -0700, Stephen Hemminger wrote:
> On Mon, 4 Apr 2011 12:53:14 -0700
> Jeff Kirsher <jeffrey.t.kirsher@intel.com> wrote:
>
> > On Mon, Apr 4, 2011 at 11:43, Stephen Hemminger <shemminger@vyatta.com> wrote:
> > > Did a bunch of the easy drivers to convert.
> > >
> > >
> >
> > I have added patches 3-9 (Intel driver conversions) to my queue of
> > patches. Thanks Stephen.
>
> I changed the behaviour of igbvf for 'ethtool -p' to return not supported.
> This seems correct, but it may break somebody who has some weird script running
> in a virt environment.
I also noticed you did not convert ixgbevf, so we will take a look at
your changes for igbvf and come up with a patch for ixgbevf.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
^ 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