* [net-next-2.6 04/24] e1000: convert to set_phys_id
From: Jeff Kirsher @ 2011-04-14 1:02 UTC (permalink / raw)
To: davem; +Cc: stephen hemminger, netdev, gospo, bphilips, Jeff Kirsher
In-Reply-To: <1302742940-22141-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: stephen hemminger <shemminger@vyatta.com>
Convert to new LED control infrastucture and remove no longer
necessary bits.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/e1000/e1000.h | 3 --
drivers/net/e1000/e1000_ethtool.c | 50 ++++++++++++-------------------------
2 files changed, 16 insertions(+), 37 deletions(-)
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index a881dd0..f96475c 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -238,9 +238,6 @@ struct e1000_adapter {
struct work_struct reset_task;
u8 fc_autoneg;
- struct timer_list blink_timer;
- unsigned long led_status;
-
/* TX */
struct e1000_tx_ring *tx_ring; /* One per active queue */
unsigned int restart_queue;
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index dd70738..5c998a9 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -1753,46 +1753,28 @@ static int e1000_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
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
-
-static void e1000_led_blink_callback(unsigned long data)
+static int e1000_set_phys_id(struct net_device *netdev,
+ enum ethtool_phys_id_state state)
{
- struct e1000_adapter *adapter = (struct e1000_adapter *) data;
+ struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw;
- if (test_and_change_bit(E1000_LED_ON, &adapter->led_status))
- e1000_led_off(hw);
- else
- e1000_led_on(hw);
-
- mod_timer(&adapter->blink_timer, jiffies + E1000_ID_INTERVAL);
-}
+ switch (state) {
+ case ETHTOOL_ID_ACTIVE:
+ e1000_setup_led(hw);
+ return -EINVAL;
-static int e1000_phys_id(struct net_device *netdev, u32 data)
-{
- struct e1000_adapter *adapter = netdev_priv(netdev);
- struct e1000_hw *hw = &adapter->hw;
+ case ETHTOOL_ID_ON:
+ e1000_led_on(hw);
+ break;
- if (!data)
- data = INT_MAX;
+ case ETHTOOL_ID_OFF:
+ e1000_led_off(hw);
+ break;
- 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;
+ case ETHTOOL_ID_INACTIVE:
+ e1000_cleanup_led(hw);
}
- e1000_setup_led(hw);
- mod_timer(&adapter->blink_timer, jiffies);
- msleep_interruptible(data * 1000);
- del_timer_sync(&adapter->blink_timer);
-
- e1000_led_off(hw);
- clear_bit(E1000_LED_ON, &adapter->led_status);
- e1000_cleanup_led(hw);
return 0;
}
@@ -1929,7 +1911,7 @@ static const struct ethtool_ops e1000_ethtool_ops = {
.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 = e1000_get_sset_count,
.get_coalesce = e1000_get_coalesce,
--
1.7.4.2
^ permalink raw reply related
* [net-next-2.6 03/24] igb: introduce igb_thermal_sensor_event for sensor checking
From: Jeff Kirsher @ 2011-04-14 1:01 UTC (permalink / raw)
To: davem; +Cc: Stefan Assmann, netdev, gospo, bphilips, Jeff Kirsher
In-Reply-To: <1302742940-22141-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Stefan Assmann <sassmann@kpanic.de>
The code for thermal sensor checking should be wrapped into a function.
Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/igb/igb_main.c | 67 ++++++++++++++++++++++---------------------
1 files changed, 34 insertions(+), 33 deletions(-)
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 0dfd1b9..cdfd572 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -3532,6 +3532,25 @@ bool igb_has_link(struct igb_adapter *adapter)
return link_active;
}
+static bool igb_thermal_sensor_event(struct e1000_hw *hw, u32 event)
+{
+ bool ret = false;
+ u32 ctrl_ext, thstat;
+
+ /* check for thermal sensor event on i350, copper only */
+ if (hw->mac.type == e1000_i350) {
+ thstat = rd32(E1000_THSTAT);
+ ctrl_ext = rd32(E1000_CTRL_EXT);
+
+ if ((hw->phy.media_type == e1000_media_type_copper) &&
+ !(ctrl_ext & E1000_CTRL_EXT_LINK_MODE_SGMII)) {
+ ret = !!(thstat & event);
+ }
+ }
+
+ return ret;
+}
+
/**
* igb_watchdog - Timer Call-back
* @data: pointer to adapter cast into an unsigned long
@@ -3550,7 +3569,7 @@ static void igb_watchdog_task(struct work_struct *work)
watchdog_task);
struct e1000_hw *hw = &adapter->hw;
struct net_device *netdev = adapter->netdev;
- u32 link, ctrl_ext, thstat;
+ u32 link;
int i;
link = igb_has_link(adapter);
@@ -3574,25 +3593,14 @@ static void igb_watchdog_task(struct work_struct *work)
((ctrl & E1000_CTRL_RFCE) ? "RX" :
((ctrl & E1000_CTRL_TFCE) ? "TX" : "None")));
- /* check for thermal sensor event on i350,
- * copper only */
- if (hw->mac.type == e1000_i350) {
- thstat = rd32(E1000_THSTAT);
- ctrl_ext = rd32(E1000_CTRL_EXT);
- if ((hw->phy.media_type ==
- e1000_media_type_copper) && !(ctrl_ext &
- E1000_CTRL_EXT_LINK_MODE_SGMII)) {
- if (thstat &
- E1000_THSTAT_LINK_THROTTLE) {
- printk(KERN_INFO "igb: %s The "
- "network adapter link "
- "speed was downshifted "
- "because it "
- "overheated.\n",
- netdev->name);
- }
- }
+ /* check for thermal sensor event */
+ if (igb_thermal_sensor_event(hw, E1000_THSTAT_LINK_THROTTLE)) {
+ printk(KERN_INFO "igb: %s The network adapter "
+ "link speed was downshifted "
+ "because it overheated.\n",
+ netdev->name);
}
+
/* adjust timeout factor according to speed/duplex */
adapter->tx_timeout_factor = 1;
switch (adapter->link_speed) {
@@ -3618,22 +3626,15 @@ static void igb_watchdog_task(struct work_struct *work)
if (netif_carrier_ok(netdev)) {
adapter->link_speed = 0;
adapter->link_duplex = 0;
- /* check for thermal sensor event on i350
- * copper only*/
- if (hw->mac.type == e1000_i350) {
- thstat = rd32(E1000_THSTAT);
- ctrl_ext = rd32(E1000_CTRL_EXT);
- if ((hw->phy.media_type ==
- e1000_media_type_copper) && !(ctrl_ext &
- E1000_CTRL_EXT_LINK_MODE_SGMII)) {
- if (thstat & E1000_THSTAT_PWR_DOWN) {
- printk(KERN_ERR "igb: %s The "
- "network adapter was stopped "
- "because it overheated.\n",
+
+ /* check for thermal sensor event */
+ if (igb_thermal_sensor_event(hw, E1000_THSTAT_PWR_DOWN)) {
+ printk(KERN_ERR "igb: %s The network adapter "
+ "was stopped because it "
+ "overheated.\n",
netdev->name);
- }
- }
}
+
/* Links status message must follow this format */
printk(KERN_INFO "igb: %s NIC Link is Down\n",
netdev->name);
--
1.7.4.2
^ permalink raw reply related
* [net-next-2.6 02/24] igb: fix typo in igb_validate_nvm_checksum_82580
From: Jeff Kirsher @ 2011-04-14 1:01 UTC (permalink / raw)
To: davem; +Cc: Stefan Assmann, netdev, gospo, bphilips, Jeff Kirsher
In-Reply-To: <1302742940-22141-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Stefan Assmann <sassmann@kpanic.de>
Comment spelling fix.
Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/igb/e1000_82575.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
index 6b256c2..0cd41c4 100644
--- a/drivers/net/igb/e1000_82575.c
+++ b/drivers/net/igb/e1000_82575.c
@@ -1877,7 +1877,7 @@ static s32 igb_validate_nvm_checksum_82580(struct e1000_hw *hw)
}
if (nvm_data & NVM_COMPATIBILITY_BIT_MASK) {
- /* if chekcsums compatibility bit is set validate checksums
+ /* if checksums compatibility bit is set validate checksums
* for all 4 ports. */
eeprom_regions_count = 4;
}
@@ -1988,6 +1988,7 @@ static s32 igb_update_nvm_checksum_i350(struct e1000_hw *hw)
out:
return ret_val;
}
+
/**
* igb_set_eee_i350 - Enable/disable EEE support
* @hw: pointer to the HW structure
--
1.7.4.2
^ permalink raw reply related
* [net-next-2.6 01/24] igb: Add anti-spoofing feature documentation
From: Jeff Kirsher @ 2011-04-14 1:01 UTC (permalink / raw)
To: davem; +Cc: Greg Rose, netdev, gospo, bphilips, Jeff Kirsher
In-Reply-To: <1302742940-22141-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Greg Rose <gregory.v.rose@intel.com>
Add the documentation for the anti-spoofing feature in the HW.
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
Documentation/networking/igb.txt | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/Documentation/networking/igb.txt b/Documentation/networking/igb.txt
index 98953c0..9a2a037 100644
--- a/Documentation/networking/igb.txt
+++ b/Documentation/networking/igb.txt
@@ -93,6 +93,19 @@ Additional Configurations
REQUIREMENTS: MSI-X support is required for Multiqueue. If MSI-X is not
found, the system will fallback to MSI or to Legacy interrupts.
+ MAC and VLAN anti-spoofing feature
+ ----------------------------------
+ When a malicious driver attempts to send a spoofed packet, it is dropped by
+ the hardware and not transmitted. An interrupt is sent to the PF driver
+ notifying it of the spoof attempt.
+
+ When a spoofed packet is detected the PF driver will send the following
+ message to the system log (displayed by the "dmesg" command):
+
+ Spoof event(s) detected on VF(n)
+
+ Where n=the VF that attempted to do the spoofing.
+
Support
=======
--
1.7.4.2
^ permalink raw reply related
* [net-next-2.6 00/26][pull request] Intel Wired LAN Driver Update
From: Jeff Kirsher @ 2011-04-14 1:01 UTC (permalink / raw)
To: davem; +Cc: Jeff Kirsher, netdev, gospo, bphilips
The following series contains updates to e1000, e1000e, igb and ixgbe.
- e1000 change is to convert to the new set_phys_id interface for
ethtool.
- e1000e has two conversion, one to use usleep_range and the other
to the new VLAN model. There is also a fix for a debug statement as
well as a fix for ASPM.
- igb has a documentation update, comment fix, and the introduction
of thermal sensor checking.
- ixgbe contains the majority of the changes, with several cleanups
and fixes. As well as a conversion to use usleep_range().
The following are changes since commit 8b5933c380fc66a6311739f9b36a812383f82141:
net: ethtool support to configure number of channels
and are available in the git repository at:
master.kernel.org:/pub/scm/linux/kernel/git/jkirsher/net-next-2.6 master
Bruce Allan (3):
e1000e: convert short duration msleep() to usleep_range()
e1000e: PCIe link speed in GT/s, not GB/s
e1000e: If ASPM L0s needs to be disabled, do it prior to enabling
device
Don Skidmore (1):
ixgbe: cleanup short msleep's (<20ms) to use usleep_range
Emil Tantilov (10):
ixgbe: fix return value checks
ixgbe: correct function number for some 82598 parts
ixgbe: fix namespacecheck issue
ixgbe: refactor common start_hw code for 82599 and x540
ixgbe: move disabling of relaxed ordering in start_hw()
ixgbe: fix 82599 KR downshift coexistence with LESM FW module
ixgbe: fix semaphores in eeprom routines for x540
ixgbe: add support for new HW
ixgbe: explicitly disable 100H for x540
ixgbe: make device_caps() generic
Flavio Leitner (1):
e1000e: fix stats locking in e1000_watchdog_task
Greg Rose (1):
igb: Add anti-spoofing feature documentation
Jeff Kirsher (2):
e1000e: convert to new VLAN model
ixgbe: update version string for Dell CEM use
John Fastabend (3):
ixgbe: DCB, further cleanups to app configuration
ixgbe: DCB, misallocated packet buffer size with X540 device
ixgbe: DCB, X540 devices do not respond to pause frames
Stefan Assmann (2):
igb: fix typo in igb_validate_nvm_checksum_82580
igb: introduce igb_thermal_sensor_event for sensor checking
stephen hemminger (1):
e1000: convert to set_phys_id
Documentation/networking/igb.txt | 13 ++
drivers/net/e1000/e1000.h | 3 -
drivers/net/e1000/e1000_ethtool.c | 50 +++------
drivers/net/e1000e/82571.c | 20 ++--
drivers/net/e1000e/e1000.h | 6 +-
drivers/net/e1000e/es2lan.c | 4 +-
drivers/net/e1000e/ethtool.c | 46 ++++++--
drivers/net/e1000e/ich8lan.c | 12 +-
drivers/net/e1000e/lib.c | 10 +-
drivers/net/e1000e/netdev.c | 211 ++++++++++++++++++++---------------
drivers/net/e1000e/phy.c | 4 +-
drivers/net/igb/e1000_82575.c | 3 +-
drivers/net/igb/igb_main.c | 67 ++++++------
drivers/net/ixgbe/ixgbe_82598.c | 60 ++++++++++-
drivers/net/ixgbe/ixgbe_82599.c | 104 ++++++++++++------
drivers/net/ixgbe/ixgbe_common.c | 112 ++++++++++++++++++-
drivers/net/ixgbe/ixgbe_common.h | 4 +-
drivers/net/ixgbe/ixgbe_dcb_82599.c | 77 ++++++++-----
drivers/net/ixgbe/ixgbe_dcb_82599.h | 2 +
drivers/net/ixgbe/ixgbe_dcb_nl.c | 109 ++++--------------
drivers/net/ixgbe/ixgbe_ethtool.c | 14 +-
drivers/net/ixgbe/ixgbe_main.c | 22 ++--
drivers/net/ixgbe/ixgbe_phy.c | 7 +-
drivers/net/ixgbe/ixgbe_type.h | 12 ++
drivers/net/ixgbe/ixgbe_x540.c | 192 +++++++++++++++++++++++---------
25 files changed, 734 insertions(+), 430 deletions(-)
--
1.7.4.2
^ permalink raw reply
* Re: [PATCH] net: allow shifted access in smsc911x V2
From: David Miller @ 2011-04-14 0:13 UTC (permalink / raw)
To: mathieu.poirier; +Cc: netdev, lee.jones, patches, rubini, linus.walleij
In-Reply-To: <1302720621-7339-1-git-send-email-mathieu.poirier@linaro.org>
From: mathieu.poirier@linaro.org
Date: Wed, 13 Apr 2011 12:50:21 -0600
> From: Mathieu J. Poirier <mathieu.poirier@linaro.org>
>
> This is a revised patch that permits a shifted access to the
> LAN9221 registers. More specifically:
>
> It adds a shift parameter in the platform_data.
> It introduces an ops in smsc911x_data.
> A choice of access function to use at run-time.
> Four new shifted access function.
>
> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Looks good, applied.
^ permalink raw reply
* Re: [PATCH net-next 0/5] tg3: Add more selftest and debug support
From: David Miller @ 2011-04-14 0:11 UTC (permalink / raw)
To: mcarlson; +Cc: netdev
In-Reply-To: <1302728708-1797-1-git-send-email-mcarlson@broadcom.com>
From: "Matt Carlson" <mcarlson@broadcom.com>
Date: Wed, 13 Apr 2011 14:05:03 -0700
> This patchset adds register dump capabilities for first failure debugging,
> a jumbo frame loopback test mode, and extended VPD block handling.
All applied, thanks Matt.
^ permalink raw reply
* Re: [PATCH] bridge: reset IPCB in br_parse_ip_options
From: Stephen Hemminger @ 2011-04-14 0:08 UTC (permalink / raw)
To: David Miller; +Cc: eric.dumazet, lkml, shimoda.hiroaki, netdev
In-Reply-To: <20110413.170503.193709874.davem@davemloft.net>
On Wed, 13 Apr 2011 17:05:03 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:
> From: Stephen Hemminger <shemminger@vyatta.com>
> Date: Wed, 13 Apr 2011 17:03:51 -0700
>
> > On Wed, 13 Apr 2011 14:48:12 -0700 (PDT)
> > David Miller <davem@davemloft.net> wrote:
> >
> >> From: Eric Dumazet <eric.dumazet@gmail.com>
> >> Date: Wed, 13 Apr 2011 17:28:07 +0200
> >>
> >> > Dont worry, Stephen or me will send it asap.
> >>
> >> I'm looking forward to it :)
> >
> > You applied the clear of ipcb already.
>
> There are other patches involved, I think.
>
> The one with the NULL route handling, for one.
>
> Please follow back in this thread for the details, the IPCB clear
> wasn't sufficient to get rid of all of the reporter's OOPS's.
Agreed, it is not the complete fix.
--
^ permalink raw reply
* Re: [PATCH] bridge: reset IPCB in br_parse_ip_options
From: David Miller @ 2011-04-14 0:05 UTC (permalink / raw)
To: shemminger; +Cc: eric.dumazet, lkml, shimoda.hiroaki, netdev
In-Reply-To: <20110413170351.078cfa2f@nehalam>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Wed, 13 Apr 2011 17:03:51 -0700
> On Wed, 13 Apr 2011 14:48:12 -0700 (PDT)
> David Miller <davem@davemloft.net> wrote:
>
>> From: Eric Dumazet <eric.dumazet@gmail.com>
>> Date: Wed, 13 Apr 2011 17:28:07 +0200
>>
>> > Dont worry, Stephen or me will send it asap.
>>
>> I'm looking forward to it :)
>
> You applied the clear of ipcb already.
There are other patches involved, I think.
The one with the NULL route handling, for one.
Please follow back in this thread for the details, the IPCB clear
wasn't sufficient to get rid of all of the reporter's OOPS's.
^ permalink raw reply
* Re: [PATCH] bridge: reset IPCB in br_parse_ip_options
From: Stephen Hemminger @ 2011-04-14 0:03 UTC (permalink / raw)
To: David Miller; +Cc: eric.dumazet, lkml, shimoda.hiroaki, netdev
In-Reply-To: <20110413.144812.116375845.davem@davemloft.net>
On Wed, 13 Apr 2011 14:48:12 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Wed, 13 Apr 2011 17:28:07 +0200
>
> > Dont worry, Stephen or me will send it asap.
>
> I'm looking forward to it :)
You applied the clear of ipcb already.
^ permalink raw reply
* Re: [PATCH] iproute2: tc add mqprio qdisc support
From: John Fastabend @ 2011-04-13 23:37 UTC (permalink / raw)
To: Ben Hutchings; +Cc: shemminger@vyatta.com, netdev@vger.kernel.org
In-Reply-To: <1302736222.2873.39.camel@bwh-desktop>
On 4/13/2011 4:10 PM, Ben Hutchings wrote:
> I know that this has already been applied, but:
>
> On Tue, 2011-04-12 at 08:57 -0700, John Fastabend wrote:
>> Add mqprio qdisc support. Output matches the following,
>>
>> # ./tc/tc qdisc
>> qdisc mq 0: dev eth1 root
>> qdisc mq 0: dev eth2 root
>> qdisc mqprio 8001: dev eth3 root tc 8 map 0 1 2 3 4 5 6 7 1 1 1 1 1 1 1 1
>> queues:(0:7) (8:15) (16:23) (24:31) (32:39) (40:47) (48:55) (56:63)
>>
>> And usage is,
>>
>> # ./tc/tc qdisc add dev eth3 root mqprio help
>> Usage: ... mclass [num_tc NUMBER] [map P0 P1...]
>
> mclass?
agh stupid typo in the description that was my working name
for the qdisc some time ago. The help in 'tc' is correct.
>
>> [offset txq0 txq1 ...] [count cnt0 cnt1 ...] [hw 1|0]
>
> Of course I wrote something similar to this, but I never finished it
> off, so thanks.
>
> I don't think it makes sense to require count and offset to be specified
> as separate lists. The arguments could be interleaved but that adds
> more opportunity for error. Since offsets have to be in order and you
> generally don't want to have gaps then the offsets could normally be
> inferred. So maybe something like:
>
> queues cnt0[@txq0] cnt1[@txq1] ...
OK. I agree with you this is better.
>
> [...]
>> +static int mqprio_parse_opt(struct qdisc_util *qu, int argc,
>> + char **argv, struct nlmsghdr *n)
>> +{
>> + int idx;
>> + struct tc_mqprio_qopt opt = {
>> + 8,
>> + {0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 1, 1, 3, 3, 3, 3},
>> + 1,
>> + };
>
> It would be clearer to name the fields being initialised.
>
OK.
> [...]
>> +int mqprio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
>> +{
>> + int i;
>> + struct tc_mqprio_qopt *qopt;
>> +
>> + if (opt == NULL)
>> + return 0;
>> +
>> + qopt = RTA_DATA(opt);
>> +
>> + fprintf(f, " tc %u map ", qopt->num_tc);
>> + for (i = 0; i <= TC_PRIO_MAX; i++)
>> + fprintf(f, "%d ", qopt->prio_tc_map[i]);
>> + fprintf(f, "\n queues:");
>> + for (i = 0; i < qopt->num_tc; i++)
>> + fprintf(f, "(%i:%i) ", qopt->offset[i],
>> + qopt->offset[i] + qopt->count[i] - 1);
> [...]
>
> Shouldn't this output be consistent with the command-line syntax?
I'm not sure, here's what it is now,
queues:(0:7) (8:15) (16:23) (24:31) (32:39) (40:47) (48:55) (56:63)
And here's what it would be with the change,
queues: 8@0 8@8 8@16 8@24 8@32 8@40 8@48 8@56
I like the first option with (#:#) it seems a bit more obvious to me
what the layout is. I'll get this fixed up tomorrow. Thanks for
taking a look Ben.
~John.
^ permalink raw reply
* Re: [PATCH] iproute2: tc add mqprio qdisc support
From: Ben Hutchings @ 2011-04-13 23:10 UTC (permalink / raw)
To: John Fastabend; +Cc: shemminger, netdev
In-Reply-To: <20110412155727.4656.42756.stgit@jf-dev1-dcblab>
I know that this has already been applied, but:
On Tue, 2011-04-12 at 08:57 -0700, John Fastabend wrote:
> Add mqprio qdisc support. Output matches the following,
>
> # ./tc/tc qdisc
> qdisc mq 0: dev eth1 root
> qdisc mq 0: dev eth2 root
> qdisc mqprio 8001: dev eth3 root tc 8 map 0 1 2 3 4 5 6 7 1 1 1 1 1 1 1 1
> queues:(0:7) (8:15) (16:23) (24:31) (32:39) (40:47) (48:55) (56:63)
>
> And usage is,
>
> # ./tc/tc qdisc add dev eth3 root mqprio help
> Usage: ... mclass [num_tc NUMBER] [map P0 P1...]
mclass?
> [offset txq0 txq1 ...] [count cnt0 cnt1 ...] [hw 1|0]
Of course I wrote something similar to this, but I never finished it
off, so thanks.
I don't think it makes sense to require count and offset to be specified
as separate lists. The arguments could be interleaved but that adds
more opportunity for error. Since offsets have to be in order and you
generally don't want to have gaps then the offsets could normally be
inferred. So maybe something like:
queues cnt0[@txq0] cnt1[@txq1] ...
[...]
> +static int mqprio_parse_opt(struct qdisc_util *qu, int argc,
> + char **argv, struct nlmsghdr *n)
> +{
> + int idx;
> + struct tc_mqprio_qopt opt = {
> + 8,
> + {0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 1, 1, 3, 3, 3, 3},
> + 1,
> + };
It would be clearer to name the fields being initialised.
[...]
> +int mqprio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
> +{
> + int i;
> + struct tc_mqprio_qopt *qopt;
> +
> + if (opt == NULL)
> + return 0;
> +
> + qopt = RTA_DATA(opt);
> +
> + fprintf(f, " tc %u map ", qopt->num_tc);
> + for (i = 0; i <= TC_PRIO_MAX; i++)
> + fprintf(f, "%d ", qopt->prio_tc_map[i]);
> + fprintf(f, "\n queues:");
> + for (i = 0; i < qopt->num_tc; i++)
> + fprintf(f, "(%i:%i) ", qopt->offset[i],
> + qopt->offset[i] + qopt->count[i] - 1);
[...]
Shouldn't this output be consistent with the command-line syntax?
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
* [net-next-2.6 RFC PATCH v3] ethtool: allow custom interval for physical identification
From: Bruce Allan @ 2011-04-13 23:09 UTC (permalink / raw)
To: netdev
Cc: Bruce Allan, Ben Hutchings, Sathya Perla, Subbu Seetharaman,
Ajit Khaparde, Michael Chan, Eilon Greenstein, Divy Le Ray,
Don Fry, Jon Mason, Solarflare linux maintainers, Steve Hodgson,
Stephen Hemminger, Matt Carlson
When physical identification of an adapter is done by toggling the
mechanism on and off through software utilizing the set_phys_id operation,
it is done with a fixed duration for both on and off states. Some drivers
may want to set a custom duration for the on/off intervals. This patch
changes the API so the return code from the driver's entry point when it
is called with ETHTOOL_ID_ACTIVE can specify the frequency at which to
cycle the on/off states, and updates the drivers that have already been
converted to use the new set_phys_id and use the synchronous method for
identifying an adapter.
The physical identification frequency set in the updated drivers is based
on how it was done prior to the introduction of set_phys_id.
Compile tested only. Also fixes a compiler warning in sfc.
v2: drivers do not return -EINVAL for ETHOOL_ID_ACTIVE
v3: fold patchset into single patch and cleanup per Ben's feedback
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Cc: Ben Hutchings <bhutchings@solarflare.com>
Cc: Sathya Perla <sathya.perla@emulex.com>
Cc: Subbu Seetharaman <subbu.seetharaman@emulex.com>
Cc: Ajit Khaparde <ajit.khaparde@emulex.com>
Cc: Michael Chan <mchan@broadcom.com>
Cc: Eilon Greenstein <eilong@broadcom.com>
Cc: Divy Le Ray <divy@chelsio.com>
Cc: Don Fry <pcnet32@frontier.com>
Cc: Jon Mason <jdmason@kudzu.us>
Cc: Solarflare linux maintainers <linux-net-drivers@solarflare.com>
Cc: Steve Hodgson <shodgson@solarflare.com>
Cc: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: Matt Carlson <mcarlson@broadcom.com>
---
drivers/net/benet/be_ethtool.c | 2 +-
drivers/net/bnx2.c | 2 +-
drivers/net/bnx2x/bnx2x_ethtool.c | 2 +-
drivers/net/cxgb3/cxgb3_main.c | 2 +-
drivers/net/ewrk3.c | 2 +-
drivers/net/niu.c | 2 +-
drivers/net/pcnet32.c | 2 +-
drivers/net/s2io.c | 2 +-
drivers/net/sfc/ethtool.c | 6 +++---
drivers/net/skge.c | 2 +-
drivers/net/sky2.c | 2 +-
drivers/net/tg3.c | 2 +-
include/linux/ethtool.h | 6 ++++--
net/core/ethtool.c | 31 ++++++++++++++++---------------
14 files changed, 34 insertions(+), 31 deletions(-)
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c
index 96f5502..80226e4 100644
--- a/drivers/net/benet/be_ethtool.c
+++ b/drivers/net/benet/be_ethtool.c
@@ -516,7 +516,7 @@ be_set_phys_id(struct net_device *netdev,
case ETHTOOL_ID_ACTIVE:
be_cmd_get_beacon_state(adapter, adapter->hba_port_num,
&adapter->beacon_state);
- return -EINVAL;
+ return 1; /* cycle on/off once per second */
case ETHTOOL_ID_ON:
be_cmd_set_beacon_state(adapter, adapter->hba_port_num, 0, 0,
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 0a52079..bf729ee 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -7473,7 +7473,7 @@ bnx2_set_phys_id(struct net_device *dev, enum ethtool_phys_id_state state)
bp->leds_save = REG_RD(bp, BNX2_MISC_CFG);
REG_WR(bp, BNX2_MISC_CFG, BNX2_MISC_CFG_LEDMODE_MAC);
- return -EINVAL;
+ return 1; /* cycle on/off once per second */
case ETHTOOL_ID_ON:
REG_WR(bp, BNX2_EMAC_LED, BNX2_EMAC_LED_OVERRIDE |
diff --git a/drivers/net/bnx2x/bnx2x_ethtool.c b/drivers/net/bnx2x/bnx2x_ethtool.c
index ad7d91e..0a5e88d 100644
--- a/drivers/net/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/bnx2x/bnx2x_ethtool.c
@@ -2025,7 +2025,7 @@ static int bnx2x_set_phys_id(struct net_device *dev,
switch (state) {
case ETHTOOL_ID_ACTIVE:
- return -EINVAL;
+ return 1; /* cycle on/off once per second */
case ETHTOOL_ID_ON:
bnx2x_set_led(&bp->link_params, &bp->link_vars,
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index 802c7a7..a087e06 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -1757,7 +1757,7 @@ static int set_phys_id(struct net_device *dev,
switch (state) {
case ETHTOOL_ID_ACTIVE:
- return -EINVAL;
+ return 1; /* cycle on/off once per second */
case ETHTOOL_ID_OFF:
t3_set_reg_field(adapter, A_T3DBG_GPIO_EN, F_GPIO0_OUT_VAL, 0);
diff --git a/drivers/net/ewrk3.c b/drivers/net/ewrk3.c
index c7ce443..17b6027 100644
--- a/drivers/net/ewrk3.c
+++ b/drivers/net/ewrk3.c
@@ -1618,7 +1618,7 @@ static int ewrk3_set_phys_id(struct net_device *dev,
/* Prevent ISR from twiddling the LED */
lp->led_mask = 0;
spin_unlock_irq(&lp->hw_lock);
- return -EINVAL;
+ return 2; /* cycle on/off twice per second */
case ETHTOOL_ID_ON:
cr = inb(EWRK3_CR);
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index 3fa1e9c..ea2272f 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -7896,7 +7896,7 @@ static int niu_set_phys_id(struct net_device *dev,
switch (state) {
case ETHTOOL_ID_ACTIVE:
np->orig_led_state = niu_led_state_save(np);
- return -EINVAL;
+ return 1; /* cycle on/off once per second */
case ETHTOOL_ID_ON:
niu_force_led(np, 1);
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index e89afb9..0a1efba 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -1038,7 +1038,7 @@ static int pcnet32_set_phys_id(struct net_device *dev,
for (i = 4; i < 8; i++)
lp->save_regs[i - 4] = a->read_bcr(ioaddr, i);
spin_unlock_irqrestore(&lp->lock, flags);
- return -EINVAL;
+ return 2; /* cycle on/off twice per second */
case ETHTOOL_ID_ON:
case ETHTOOL_ID_OFF:
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 2d5cc61..2302d97 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -5541,7 +5541,7 @@ static int s2io_ethtool_set_led(struct net_device *dev,
switch (state) {
case ETHTOOL_ID_ACTIVE:
sp->adapt_ctrl_org = readq(&bar0->gpio_control);
- return -EINVAL;
+ return 1; /* cycle on/off once per second */
case ETHTOOL_ID_ON:
s2io_set_led(sp, true);
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c
index 644f7c1..5d8468f 100644
--- a/drivers/net/sfc/ethtool.c
+++ b/drivers/net/sfc/ethtool.c
@@ -182,7 +182,7 @@ static int efx_ethtool_phys_id(struct net_device *net_dev,
enum ethtool_phys_id_state state)
{
struct efx_nic *efx = netdev_priv(net_dev);
- enum efx_led_mode mode;
+ enum efx_led_mode mode = EFX_LED_DEFAULT;
switch (state) {
case ETHTOOL_ID_ON:
@@ -194,8 +194,8 @@ static int efx_ethtool_phys_id(struct net_device *net_dev,
case ETHTOOL_ID_INACTIVE:
mode = EFX_LED_DEFAULT;
break;
- default:
- return -EINVAL;
+ case ETHTOOL_ID_ACTIVE:
+ return 1; /* cycle on/off once per second */
}
efx->type->set_id_led(efx, mode);
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 310dcbc..176d784 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -753,7 +753,7 @@ static int skge_set_phys_id(struct net_device *dev,
switch (state) {
case ETHTOOL_ID_ACTIVE:
- return -EINVAL;
+ return 2; /* cycle on/off twice per second */
case ETHTOOL_ID_ON:
skge_led(skge, LED_MODE_TST);
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index a4b8fe5..c8d0451 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -3813,7 +3813,7 @@ static int sky2_set_phys_id(struct net_device *dev,
switch (state) {
case ETHTOOL_ID_ACTIVE:
- return -EINVAL;
+ return 1; /* cycle on/off once per second */
case ETHTOOL_ID_INACTIVE:
sky2_led(sky2, MO_LED_NORM);
break;
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 9d7defc..7c1a9dd 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -10292,7 +10292,7 @@ static int tg3_set_phys_id(struct net_device *dev,
switch (state) {
case ETHTOOL_ID_ACTIVE:
- return -EINVAL;
+ return 1; /* cycle on/off once per second */
case ETHTOOL_ID_ON:
tw32(MAC_LED_CTRL, LED_CTRL_LNKLED_OVERRIDE |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index ad22a68..9de3127 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -798,8 +798,10 @@ bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported);
* attached to it. The implementation may update the indicator
* asynchronously or synchronously, but in either case it must return
* quickly. It is initially called with the argument %ETHTOOL_ID_ACTIVE,
- * and must either activate asynchronous updates or return -%EINVAL.
- * If it returns -%EINVAL then it will be called again at intervals with
+ * and must either activate asynchronous updates and return zero, return
+ * a negative error or return a positive frequency for synchronous
+ * indication (e.g. 1 for one on/off cycle per second). If it returns
+ * a frequency then it will be called again at intervals with the
* argument %ETHTOOL_ID_ON or %ETHTOOL_ID_OFF and should set the state of
* the indicator accordingly. Finally, it is called with the argument
* %ETHTOOL_ID_INACTIVE and must deactivate the indicator. Returns a
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 41dee2d..13d79f5 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -1669,7 +1669,7 @@ static int ethtool_phys_id(struct net_device *dev, void __user *useraddr)
return dev->ethtool_ops->phys_id(dev, id.data);
rc = dev->ethtool_ops->set_phys_id(dev, ETHTOOL_ID_ACTIVE);
- if (rc && rc != -EINVAL)
+ if (rc < 0)
return rc;
/* Drop the RTNL lock while waiting, but prevent reentry or
@@ -1684,21 +1684,22 @@ static int ethtool_phys_id(struct net_device *dev, void __user *useraddr)
schedule_timeout_interruptible(
id.data ? (id.data * HZ) : MAX_SCHEDULE_TIMEOUT);
} else {
- /* Driver expects to be called periodically */
+ /* Driver expects to be called at twice the frequency in rc */
+ int n = rc * 2, i, interval = HZ / n;
+
+ /* Count down seconds */
do {
- rtnl_lock();
- rc = dev->ethtool_ops->set_phys_id(dev, ETHTOOL_ID_ON);
- rtnl_unlock();
- if (rc)
- break;
- schedule_timeout_interruptible(HZ / 2);
-
- rtnl_lock();
- rc = dev->ethtool_ops->set_phys_id(dev, ETHTOOL_ID_OFF);
- rtnl_unlock();
- if (rc)
- break;
- schedule_timeout_interruptible(HZ / 2);
+ /* Count down iterations per second */
+ i = n;
+ do {
+ rtnl_lock();
+ rc = dev->ethtool_ops->set_phys_id(dev,
+ (i & 1) ? ETHTOOL_ID_OFF : ETHTOOL_ID_ON);
+ rtnl_unlock();
+ if (rc)
+ break;
+ schedule_timeout_interruptible(interval);
+ } while (!signal_pending(current) && --i != 0);
} while (!signal_pending(current) &&
(id.data == 0 || --id.data != 0));
}
^ permalink raw reply related
* Best route for re-implementing TCPHA
From: RichardFliam @ 2011-04-13 23:08 UTC (permalink / raw)
To: netdev
TCPHA (http://dragon.linux-vs.org/~dragonfly/htm/tcpha.htm) provided
several neat features for content and health aware load balancing. I
am looking to re-implement on the 2.6 kernel and I am struck by
indecision on a few key features.
In particular the original project created its own polling methods for
TCP sockets based on fs/select.c and tcp_poll but to me this seems
inelegant. I am wondering if there is a "correct" way to poll sockets
in kernel or should I simply call sock_map_fd on the kernel socket.
After extensive searching I did find this post
http://permalink.gmane.org/gmane.linux.network/180354 to this mailing
list, but it does not seem to contain an answer as to the correct
direction for polling tcp sockets in kernel.
--
--Richard Fliam
^ permalink raw reply
* kernel panic, 2.6.38.2, gretap
From: Denys Fedoryshchenko @ 2011-04-13 22:58 UTC (permalink / raw)
To: netdev
Did following rule to route incoming (over eth0) traffic over gretap
interface
Bringing up interface
ip link add eoip1 type gretap remote X.X.X.X local Y.Y.Y.Y nopmtudisc
ifconfig eoip1 10.255.254.1 netmask 255.255.255.252 up mtu 1500
made source routing:
32000: from all iif eth0 lookup 203
Some routes added to table 203
After few(1-3) seconds running around 30-40 Mbps getting kernel panic:
Notes: I have vlan on same interface, eth0.2023, where rest of traffic
going, and this vlan "shaped" by HTB. It is not involved in gretap
operation.
on eth0 i have huge bfifo:
qdisc bfifo 8001: dev eth0 root refcnt 9 limit 100000000b
Sent 14652829681 bytes 15646355 pkt (dropped 0, overlimits 0 requeues
8)
backlog 0b 0p requeues 8
[ 658.492347] skb_over_panic: text:f80f37d4 len:3028 put:1514
head:d1af2000 data:d1af20a4 tail:0xd1af2c78 end:0xd1af2700 dev:eth0.2022
[ 658.492975] ------------[ cut here ]------------
[ 658.493264] Kernel BUG at c0377eaf [verbose debug info unavailable]
[ 658.493317] invalid opcode: 0000 [#1]
SMP
[ 658.493317] last sysfs file:
/sys/devices/virtual/net/eth0.2022/address
[ 658.493317] Modules linked in:
ip_gre
gre
netconsole
ipmi_si
tun
configfs
cls_u32
sch_htb
8021q
garp
stp
llc
iptable_filter
ipt_addrtype
xt_dscp
xt_string
xt_owner
xt_multiport
xt_iprange
xt_hashlimit
xt_conntrack
xt_DSCP
xt_NFQUEUE
xt_mark
xt_connmark
nf_conntrack
ip_tables
x_tables
bnx2
ipmi_devintf
ipmi_msghandler
processor
ata_piix
i5k_amb
iTCO_wdt
pata_acpi
hwmon
[last unloaded: netconsole]
[ 658.493317]
[ 658.493317] Pid: 0, comm: kworker/0:1 Not tainted 2.6.38.2-devel2 #2
Dell Inc. PowerEdge 1950
/
0D8635
[ 658.493317] EIP: 0060:[<c0377eaf>] EFLAGS: 00010282 CPU: 3
[ 658.493317] EIP is at skb_put+0x7f/0x89
[ 658.493317] EAX: 0000008e EBX: d1af2c78 ECX: f64b5e40 EDX: c05032e8
[ 658.493317] ESI: 000005ea EDI: f5f28380 EBP: 006d006d ESP: f64b5e3c
[ 658.493317] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
[ 658.493317] Process kworker/0:1 (pid: 0, ti=f64b4000 task=f64a4a80
task.ti=f64b0000)
[ 658.493317] Stack:
[ 658.493317] c05032e8
f80f37d4
00000bd4
000005ea
d1af2000
d1af20a4
d1af2c78
d1af2700
[ 658.493317] f5e54000
00000000
eee81e00
f80f37d4
00000604
00000002
00000000
e5602500
[ 658.493317] 00000001
f6b02cb8
0000004d
512e75c0
eef28480
00000000
f5f28400
f5f28380
[ 658.493317] Call Trace:
[ 658.493317] [<f80f37d4>] ? bnx2_poll_work+0x980/0xf48 [bnx2]
[ 658.493317] [<f80f37d4>] ? bnx2_poll_work+0x980/0xf48 [bnx2]
[ 658.493317] [<c0140e49>] ? hrtimer_start+0x20/0x25
[ 658.493317] [<f826ffd1>] ? htb_dequeue+0x757/0x770 [sch_htb]
[ 658.493317] [<f80f3f27>] ? bnx2_poll+0xf7/0x1d9 [bnx2]
[ 658.493317] [<c037f564>] ? net_rx_action+0x8c/0x176
[ 658.493317] [<c012f28f>] ? __do_softirq+0x6b/0x104
[ 658.493317] [<c012f224>] ? __do_softirq+0x0/0x104
[ 658.493317] <IRQ>
[ 658.493317] [<c012f17e>] ? irq_exit+0x26/0x59
[ 658.493317] [<c0103b3d>] ? do_IRQ+0x81/0x95
[ 658.493317] [<c0102ca9>] ? common_interrupt+0x29/0x30
[ 658.493317] [<c010807a>] ? mwait_idle+0x51/0x56
[ 658.493317] [<c0101a97>] ? cpu_idle+0x41/0x5e
[ 658.493317] Code:
24
14
8b
81
a4
00
00
00
89
74
24
0c
89
44
24
10
8b
41
4c
c7
04
24
e8
32
50
c0
89
44
24
08
8b
44
24
2c
89
44
24
04
e8
51
85
07
00
Apr 13 22:48:46 217.151.224.119 unparseable log message: "<0f> "
0b
eb
fe
83
c4
24
5b
5e
c3
55
57
56
53
83
ec
24
fc
89
c5
89
[ 658.493317] EIP: [<c0377eaf>]
skb_put+0x7f/0x89
SS:ESP 0068:f64b5e3c
[ 658.512472] ---[ end trace d06a076521439891 ]---
[ 658.512750] Kernel panic - not syncing: Fatal exception in interrupt
[ 658.514034] Rebooting in 5 seconds..
^ permalink raw reply
* RE: [net-next-2.6 RFC PATCH v2 01/13] ethtool: allow custom interval for physical identification
From: Allan, Bruce W @ 2011-04-13 22:55 UTC (permalink / raw)
To: Ben Hutchings; +Cc: netdev@vger.kernel.org
In-Reply-To: <1302734679.2873.23.camel@bwh-desktop>
>-----Original Message-----
>From: Ben Hutchings [mailto:bhutchings@solarflare.com]
>Sent: Wednesday, April 13, 2011 3:45 PM
>To: Allan, Bruce W
>Cc: netdev@vger.kernel.org
>Subject: RE: [net-next-2.6 RFC PATCH v2 01/13] ethtool: allow custom interval
>for physical identification
>
>On Wed, 2011-04-13 at 15:39 -0700, Allan, Bruce W wrote:
>>
>> >-----Original Message-----
>> >From: Ben Hutchings [mailto:bhutchings@solarflare.com]
>> >Sent: Wednesday, April 13, 2011 1:25 PM
>> >To: Allan, Bruce W
>> >Cc: netdev@vger.kernel.org
>> >Subject: Re: [net-next-2.6 RFC PATCH v2 01/13] ethtool: allow custom interval
>> >for physical identification
>> >
>> >I'm sure there ought to be a clearer way to do this, and to avoid any
>> >weird effects from integer overflow in the multiplication. How about
>> >using an inner loop for each second:
>> >
>> > /* Driver expects to be called at twice the frequency in rc */
>> > int n = rc * 2, i, interval = HZ / n;
>> >
>
> /* Count down seconds */
>> > do {
> /* Count down iterations per second */
>> > i = n;
>> > do {
>> > rtnl_lock();
>> > rc = dev->ethtool_ops->set_phys_id(
>> > dev, (i & 1) ? ETHTOOL_ID_OFF : ETHTOOL_ID_ON);
>> > rtnl_unlock();
>> > if (rc)
>> > break;
>> > schedule_timeout_interruptible(interval);
>> > } while (!signal_pending(current) && --i != 0);
>> > } while (!signal_pending(current) &&
>> > (id.data == 0 || --id.data != 0));
>> >
>> >Ben.
>>
>> OK, if that is clearer to you...v3 forthcoming.
>
>I guess it wouldn't hurt to add comemnts too. Would you agree that it's
>clear with the additions above?
>
>Ben.
Sure, makes sense to me.
Thanks,
Bruce.
^ permalink raw reply
* RE: [net-next-2.6 RFC PATCH v2 01/13] ethtool: allow custom interval for physical identification
From: Ben Hutchings @ 2011-04-13 22:44 UTC (permalink / raw)
To: Allan, Bruce W; +Cc: netdev@vger.kernel.org
In-Reply-To: <8DD2590731AB5D4C9DBF71A877482A90018A3427B6@orsmsx509.amr.corp.intel.com>
On Wed, 2011-04-13 at 15:39 -0700, Allan, Bruce W wrote:
>
> >-----Original Message-----
> >From: Ben Hutchings [mailto:bhutchings@solarflare.com]
> >Sent: Wednesday, April 13, 2011 1:25 PM
> >To: Allan, Bruce W
> >Cc: netdev@vger.kernel.org
> >Subject: Re: [net-next-2.6 RFC PATCH v2 01/13] ethtool: allow custom interval
> >for physical identification
> >
> >I'm sure there ought to be a clearer way to do this, and to avoid any
> >weird effects from integer overflow in the multiplication. How about
> >using an inner loop for each second:
> >
> > /* Driver expects to be called at twice the frequency in rc */
> > int n = rc * 2, i, interval = HZ / n;
> >
/* Count down seconds */
> > do {
/* Count down iterations per second */
> > i = n;
> > do {
> > rtnl_lock();
> > rc = dev->ethtool_ops->set_phys_id(
> > dev, (i & 1) ? ETHTOOL_ID_OFF : ETHTOOL_ID_ON);
> > rtnl_unlock();
> > if (rc)
> > break;
> > schedule_timeout_interruptible(interval);
> > } while (!signal_pending(current) && --i != 0);
> > } while (!signal_pending(current) &&
> > (id.data == 0 || --id.data != 0));
> >
> >Ben.
>
> OK, if that is clearer to you...v3 forthcoming.
I guess it wouldn't hurt to add comemnts too. Would you agree that it's
clear with the additions above?
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: [net-next-2.6 RFC PATCH v2 01/13] ethtool: allow custom interval for physical identification
From: Allan, Bruce W @ 2011-04-13 22:39 UTC (permalink / raw)
To: Ben Hutchings; +Cc: netdev@vger.kernel.org
In-Reply-To: <1302726313.2873.18.camel@bwh-desktop>
>-----Original Message-----
>From: Ben Hutchings [mailto:bhutchings@solarflare.com]
>Sent: Wednesday, April 13, 2011 1:25 PM
>To: Allan, Bruce W
>Cc: netdev@vger.kernel.org
>Subject: Re: [net-next-2.6 RFC PATCH v2 01/13] ethtool: allow custom interval
>for physical identification
>
>I'm sure there ought to be a clearer way to do this, and to avoid any
>weird effects from integer overflow in the multiplication. How about
>using an inner loop for each second:
>
> /* Driver expects to be called at twice the frequency in rc */
> int n = rc * 2, i, interval = HZ / n;
>
> do {
> i = n;
> do {
> rtnl_lock();
> rc = dev->ethtool_ops->set_phys_id(
> dev, (i & 1) ? ETHTOOL_ID_OFF : ETHTOOL_ID_ON);
> rtnl_unlock();
> if (rc)
> break;
> schedule_timeout_interruptible(interval);
> } while (!signal_pending(current) && --i != 0);
> } while (!signal_pending(current) &&
> (id.data == 0 || --id.data != 0));
>
>Ben.
OK, if that is clearer to you...v3 forthcoming.
Thanks,
Bruce.
^ permalink raw reply
* Re: [PATCHv2 net-next-2.6] rndis_host: Poll status before control channel where necessary
From: David Miller @ 2011-04-13 21:49 UTC (permalink / raw)
To: ben-/+tVBieCtBitmTQ+vhA3Yw
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, vzeeaxwl-ubggFOsnOr3gwBMGfI3FeA,
linux-usb-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1302670523.5282.610.camel@localhost>
From: Ben Hutchings <ben-/+tVBieCtBitmTQ+vhA3Yw@public.gmane.org>
Date: Wed, 13 Apr 2011 05:55:23 +0100
> Some RNDIS devices don't respond on the control channel until polled
> on the status channel. In particular, this was reported to be the
> case for the 2Wire HomePortal 1000SW and for some Windows Mobile
> devices.
>
> This is roughly based on a patch by John Carr <john.carr-3P/l8hQepEe9FHfhHBbuYA@public.gmane.org>
> which is currently applied by Mandriva.
>
> Reported-by: Mark Glassberg <vzeeaxwl-ubggFOsnOr3gwBMGfI3FeA@public.gmane.org>
> Signed-off-by: Ben Hutchings <ben-/+tVBieCtBitmTQ+vhA3Yw@public.gmane.org>
> ---
> The first version made this behaviour unconditional and had to be
> reverted. This version adds a quirk flag instead.
Applied, thanks Ben.
The feedback about whether to use the point-to-point flag or not should
be addressed, but seperately.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] bridge: reset IPCB in br_parse_ip_options
From: David Miller @ 2011-04-13 21:48 UTC (permalink / raw)
To: eric.dumazet; +Cc: lkml, shemminger, shimoda.hiroaki, netdev
In-Reply-To: <1302708487.3725.0.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 13 Apr 2011 17:28:07 +0200
> Dont worry, Stephen or me will send it asap.
I'm looking forward to it :)
^ permalink raw reply
* [RFC][PATCH] Zero-copy receive from socket into bio
From: Andreas Gruenbacher @ 2011-04-13 21:39 UTC (permalink / raw)
To: David S. Miller, netdev; +Cc: linux-kernel
Hello,
I'm currently looking into supporting zero-copy receive in drbd.
The basic idea is this: drbd transmits bios via sockets. An ideal sender
sends the packet header and data in separate packets, and the network driver
supports RX_COPYBREAK and receives them into separate socket buffers. The
socket buffers end up aligned properly, and we add them to bios and submit
them, no copying required.
This scenario doesn't seem to be supported by the existing infrastructure, so
does this patch make sense?
Thanks,
Andreas
---
[PATCH] Add a generic zero-copy-receive primitive
This requires a network driver which supports header-data split, i.e.,
receiving small header packets and big data packets into different
buffers so that the data will end up aligned well enough for consumption
by the block layer (search for RX_COPYBREAK in the drivers).
diff --git a/tcp_recvbio.c b/tcp_recvbio.c
new file mode 100644
index 0000000..38342e9
--- /dev/null
+++ b/tcp_recvbio.c
@@ -0,0 +1,185 @@
+#include <linux/kernel.h>
+#include <net/tcp.h>
+#include <linux/bio.h>
+#include <linux/blkdev.h>
+#include <linux/fs.h>
+#include "tcp_recvbio.h"
+
+static int tcp_recvbio_add(struct sk_buff *skb, struct bio *bio,
+ struct bio_vec *last)
+{
+ struct request_queue *q = bio->bi_bdev->bd_disk->queue;
+ struct sk_buff **frag_list = &skb_shinfo(skb)->frag_list;
+ int ret;
+
+ /*
+ * Reject fragmented skbs: there should be no need to support them. We
+ * use frag_list to keep track of the skbs attached to a bio instead.
+ */
+ if (*frag_list && skb != (struct sk_buff *)bio->bi_private)
+ return false;
+
+ if (!blk_rq_aligned(q, last->bv_offset, last->bv_len))
+ return false;
+ ret = bio_add_page(bio, last->bv_page, last->bv_len, last->bv_offset);
+
+ if (ret && !*frag_list) {
+ /* Tell the network layer to leave @skb alone. */
+ skb_get(skb);
+
+ /* Put this skb on the list. */
+ *frag_list = (struct sk_buff *)bio->bi_private;
+ bio->bi_private = skb;
+ }
+ return ret;
+}
+
+static int tcp_recvbio_data(read_descriptor_t *rd_desc, struct sk_buff *skb,
+ unsigned int offset, size_t len)
+{
+ struct bio *bio = rd_desc->arg.data;
+ struct request_queue *q = bio->bi_bdev->bd_disk->queue;
+ int start = skb_headlen(skb), consumed = 0, i;
+ struct bio_vec last = { };
+
+ /* Cannot zero-copy from the header. */
+ if (offset < start)
+ goto give_up;
+
+ /* Give up if the payload is unaligned. */
+ if (!blk_rq_aligned(q, offset - start, 0))
+ goto give_up;
+
+ /* Do not consume more data than we need. */
+ if (len > rd_desc->count - rd_desc->written)
+ len = rd_desc->count - rd_desc->written;
+
+ for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
+ struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i];
+ int end, frag_len;
+
+ WARN_ON(start > offset + len);
+
+ end = start + frag->size;
+ frag_len = end - offset;
+ if (frag_len > 0) {
+ bool merged = false;
+ unsigned int page_offset;
+
+ if (frag_len > len)
+ frag_len = len;
+
+ page_offset = frag->page_offset + offset - start;
+ if (last.bv_page == frag->page &&
+ last.bv_offset + last.bv_len == page_offset) {
+ /* Merge with the previous fragment. */
+ last.bv_len += frag_len;
+ merged = true;
+ }
+ len -= frag_len;
+ offset += frag_len;
+ if (!len || !merged) {
+ if (last.bv_page) {
+ if (!tcp_recvbio_add(skb, bio, &last))
+ goto give_up;
+ consumed += last.bv_len;
+ }
+ if (!len)
+ goto out;
+ last.bv_page = frag->page;
+ last.bv_offset = page_offset;
+ last.bv_len = frag_len;
+ }
+ }
+ start = end;
+ }
+
+ /*
+ * We don't care if there are additional blocks in the skb's frag_list
+ * that are zero-copyable: at worst, we end up copying too many blocks.
+ * (See skb_copy_bits() for an example of walking the frag_list.)
+ */
+
+out:
+ rd_desc->written += consumed;
+ return consumed;
+
+give_up:
+ rd_desc->count = 0;
+ goto out;
+}
+
+/**
+ * tcp_recvbio - zero-copy receive a bio from a socket
+ * @sk: socket to receive from
+ * @bio: bio to add socket data to
+ * @size: bytes to receive
+ * @list: single linked list of skbs added to @bio
+ *
+ * Zero-copy receive data from @sk into @bio by directly using the socket
+ * buffer pages, bypassing the page cache. To keep the network layer from
+ * modifying the socket buffers while in use by @bio, we skb_get() them and
+ * return a list of skbs that @bio now references. The caller is
+ * responsible for releasing @list with consume_skbs() once done.
+ *
+ * Returns the number of bytes received into @bio.
+ */
+int tcp_recvbio(struct sock *sk, struct bio *bio, size_t size,
+ struct sk_buff **list)
+{
+ read_descriptor_t rd_desc = {
+ .count = size,
+ .arg = { .data = bio },
+ };
+ void *old_bi_private;
+ int err = 0;
+
+ /* Temporarily build referenced skb list in bi_private. */
+ old_bi_private = bio->bi_private;
+ bio->bi_private = NULL;
+
+ lock_sock(sk);
+ while (rd_desc.written < rd_desc.count) {
+ long timeo = sock_rcvtimeo(sk, 0);
+
+ sk_wait_data(sk, &timeo);
+ if (signal_pending(current)) {
+ err = sock_intr_errno(timeo);
+ break;
+ }
+ if (!timeo) {
+ if (!rd_desc.written)
+ err = -EAGAIN;
+ break;
+ }
+ read_lock(&sk->sk_callback_lock);
+ err = tcp_read_sock(sk, &rd_desc, tcp_recvbio_data);
+ read_unlock(&sk->sk_callback_lock);
+ if (err < 0)
+ break;
+ }
+ release_sock(sk);
+
+ *list = (struct sk_buff *)bio->bi_private;
+ bio->bi_private = old_bi_private;
+
+ if (err)
+ return err;
+ return rd_desc.written;
+}
+
+/**
+ * consume_skbs - consume a list of skbs
+ *
+ * This assumes that the skbs are linked on frag_list, as the @list returned
+ * from tcp_recvbio().
+ */
+void consume_skbs(struct sk_buff **skb)
+{
+ while (*skb) {
+ struct sk_buff *tmp = *skb;
+ *skb = skb_shinfo(tmp)->frag_list;
+ skb_shinfo(tmp)->frag_list = NULL;
+ consume_skb(tmp);
+ }
+}
diff --git a/tcp_recvbio.h b/tcp_recvbio.h
new file mode 100644
index 0000000..0ba30ee
--- /dev/null
+++ b/tcp_recvbio.h
@@ -0,0 +1,9 @@
+#ifndef __TCP_RECVBIO_H
+#define __TCP_RECVBIO_H
+
+
+extern int tcp_recvbio(struct sock *, struct bio *, size_t, struct sk_buff **);
+extern void consume_skbs(struct sk_buff **);
+
+
+#endif /* __TCP_RECVBIO_H */
--
1.7.4.1.415.g5e839
^ permalink raw reply related
* RE: SMSC 8720a/MDIO/PHY help.
From: ANDY KENNEDY @ 2011-04-13 21:38 UTC (permalink / raw)
To: michael, netdev
In-Reply-To: <1302729564.2742.28.camel@malcolm>
> -----Original Message-----
> From: Michael Riesch [mailto:michael@riesch.at]
> Sent: Wednesday, April 13, 2011 4:19 PM
> To: netdev@vger.kernel.org
> Cc: ANDY KENNEDY
> Subject: Re: SMSC 8720a/MDIO/PHY help.
>
>
> > If you have an idea of something for me to try, I'd love to
> entertain
> > it.
>
> I am rather new to PHYLIB, but these are my ideas:
>
> 1) make sure phy_connect is executed (AFIAK called by MDIO bus
> driver)
Going through the phy.txt doc under Documentation/networking:
PHY Abstraction Layer
(Updated 2008-04-08)
though it may be a bit out-of-date, I did see what you are talking about. What I'm hung up on at the moment is the behavior of adjust_link(). It appears that I only need to start the queues, though I don’t know.
>
> 2) maybe you need to call phy_start / phy_stop (AFAIK from the PHY
> driver's open / close function)
Currently, when I do this I only get the call to adjust_link() over and over again.
>
> HTH,
> Michael
Thanks for the help!
Andy
^ permalink raw reply
* Re: [PATCH 1/1] ipv6: ignore looped-back NA while dad is running
From: David Miller @ 2011-04-13 21:30 UTC (permalink / raw)
To: dwalter; +Cc: netdev, linux-kernel
In-Reply-To: <1302706963.8923.25.camel@localhost>
From: Daniel Walter <dwalter@barracuda.com>
Date: Wed, 13 Apr 2011 17:02:43 +0200
> This message and any attached files are confidential and intended
> solely for the addressee(s). Any publication, transmission or other
> use of the information by a person or entity other than the intended
> addressee is prohibited. If you receive this in error please contact
> the sender and delete the material. The sender does not accept
> liability for any errors or omissions as a result of the
> transmission.
I'm not applying patches that have legal disclaimers like this.
It has no place in a posting made on a public mailing list where open
and unrestricted discussions are essential.
^ permalink raw reply
* Re: SMSC 8720a/MDIO/PHY help.
From: Michael Riesch @ 2011-04-13 21:19 UTC (permalink / raw)
To: netdev; +Cc: ANDY KENNEDY
In-Reply-To: <9AC3F0E75060224C8BBC5BA2DDC8853A1FA8E632@EXV1.corp.adtran.com>
> If you have an idea of something for me to try, I'd love to entertain
> it.
I am rather new to PHYLIB, but these are my ideas:
1) make sure phy_connect is executed (AFIAK called by MDIO bus driver)
2) maybe you need to call phy_start / phy_stop (AFAIK from the PHY
driver's open / close function)
HTH,
Michael
^ permalink raw reply
* Re: [net-next-2.6 RFC PATCH v2 12/13] sky2: set ethtool set_phys_id on/off cycle frequency to 1/sec
From: Stephen Hemminger @ 2011-04-13 21:00 UTC (permalink / raw)
To: Bruce Allan; +Cc: netdev
In-Reply-To: <20110413195949.25901.86878.stgit@gitlad.jf.intel.com>
On Wed, 13 Apr 2011 12:59:49 -0700
Bruce Allan <bruce.w.allan@intel.com> wrote:
> Physical identification frequency based on how it was done prior to the
> introduction of set_phys_id. Compile tested only.
>
> Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
> Cc: Stephen Hemminger <shemminger@linux-foundation.org>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Assume same for skge
^ 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