* 3.0.8 not syncing: Fatal exception in interrupt
From: Stefan Priebe - Profihost AG @ 2011-12-05 6:21 UTC (permalink / raw)
To: netdev; +Cc: stable
Dear list,
i encountered the following bug today while running v3.0.8
Better readable here:
http://pastebin.com/raw.php?i=2s75P0wF
2011-12-05 02:57:41 CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
2011-12-05 02:57:41 CR2: 000000000000002c CR3: 0000000119bb2000 CR4:
00000000000006e0
2011-12-05 02:57:41 DR0: 0000000000000000 DR1: 0000000000000000 DR2:
0000000000000000
2011-12-05 02:57:41 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7:
0000000000000400
2011-12-05 02:57:41 Process kworker/0:1 (pid: 0, threadinfo
ffff88011af2c000, task ffff88011af09820)Stack:
2011-12-05 02:57:41 ffff88002589f6e0 ffff880052664d00
ffff880061911c00 ffff88010572c000
2011-12-05 02:57:41 ffff88011fd03d30 ffffffff814f56e2
ffff880061911c00 ffff880061911c00
2011-12-05 02:57:41 ffff88011fd03d80 ffffffff8155e4c6
ffff88011fd03e20 ffffffff81497230
2011-12-05 02:57:41 Call Trace:<IRQ>
2011-12-05 02:57:41 [<ffffffff814f56e2>] __sk_dst_check+0x42/0x70
2011-12-05 02:57:41 [<ffffffff8155e4c6>]
inet_sk_rebuild_header+0x26/0x330
2011-12-05 02:57:41 [<ffffffff81497230>] ? tg3_poll_work+0x1e0/0xe80
2011-12-05 02:57:41 [<ffffffff81548afb>] tcp_retransmit_skb+0xab/0x640
2011-12-05 02:57:41 [<ffffffff81012ca4>] ? x86_pmu_enable+0x1f4/0x270
2011-12-05 02:57:41 [<ffffffff8154b91e>]
tcp_retransmit_timer+0x26e/0x6e0
2011-12-05 02:57:41 [<ffffffff8154bf28>] tcp_write_timer+0x198/0x210
2011-12-05 02:57:41 [<ffffffff81055e3c>] run_timer_softirq+0x1cc/0x320
2011-12-05 02:57:41 [<ffffffff8154bd90>] ?
tcp_retransmit_timer+0x6e0/0x6e0
2011-12-05 02:57:41 [<ffffffff8101dfb8>] ? lapic_next_event+0x18/0x20
2011-12-05 02:57:41 [<ffffffff8104d1d0>] __do_softirq+0xd0/0x1c0
2011-12-05 02:57:41 [<ffffffff815d1d0c>] call_softirq+0x1c/0x30
2011-12-05 02:57:41 [<ffffffff81004a05>] do_softirq+0x55/0x90
2011-12-05 02:57:41 [<ffffffff8104cfcd>] irq_exit+0x7d/0xa0
2011-12-05 02:57:41 [<ffffffff8101eca9>]
smp_apic_timer_interrupt+0x69/0xa0
2011-12-05 02:57:41 [<ffffffff815d14d3>]
apic_timer_interrupt+0x13/0x20<EOI>
2011-12-05 02:57:41 [<ffffffff815d14ce>] ? apic_timer_interrupt+0xe/0x20
2011-12-05 02:57:41 [<ffffffff8100b7b7>] ? mwait_idle+0x117/0x120
2011-12-05 02:57:41 [<ffffffff8106cfd5>] ?
atomic_notifier_call_chain+0x15/0x20
2011-12-05 02:57:41 [<ffffffff8100208d>] cpu_idle+0xad/0xf0
2011-12-05 02:57:41 [<ffffffff815c79aa>] start_secondary+0x201/0x297
2011-12-05 02:57:41 Code: 51 a2 8e 00 89 83 d4 00 00 00 eb 9b 48 85
db 74 16 48 8b 53 40 31 ff 48 85 d2 74 0f 48 8b 05 f2 04 5a 00 48 89 42
18 48 8b 7b 40 <f0> ff 4f 2c 0f 94 c0 84 c0 0f 85 ac 00 00 00 48 c7 43
40 00 00
2011-12-05 02:57:41 RIP [<ffffffff81528796>] ipv4_dst_check+0xb6/0x190
2011-12-05 02:57:41 RSP <ffff88011fd03cf0>
2011-12-05 02:57:41 CR2: 000000000000002c
2011-12-05 02:57:41 ---[ end trace bd99ce386f3021bd ]---
2011-12-05 02:57:41 Kernel panic - not syncing: Fatal exception in
interrupt
2011-12-05 02:57:41 Pid: 0, comm: kworker/0:1 Tainted: G D 2.6.40.8p4 #1
2011-12-05 02:57:41 Call Trace:
2011-12-05 02:57:41 <IRQ> [<ffffffff815cd21c>] panic+0xba/0x1e5
2011-12-05 02:57:41 [<ffffffff815d14d3>] ?
apic_timer_interrupt+0x13/0x20
2011-12-05 02:57:41 [<ffffffff8104717a>] ? kmsg_dump+0x4a/0x100
2011-12-05 02:57:41 [<ffffffff81005ec4>] oops_end+0xd4/0xe0
2011-12-05 02:57:41 [<ffffffff81029501>] no_context+0xf1/0x270
2011-12-05 02:57:41 [<ffffffff810297d5>]
__bad_area_nosemaphore+0x155/0x200
2011-12-05 02:57:41 [<ffffffff810fa37b>] ? kmem_cache_free+0x1b/0xf0
2011-12-05 02:57:41 [<ffffffff814f8f72>] ? __kfree_skb+0x42/0xa0
2011-12-05 02:57:41 [<ffffffff81545b84>] ?
tcp_rcv_established+0x364/0x630
2011-12-05 02:57:41 [<ffffffff8154f364>] ? tcp_v4_do_rcv+0x154/0x2d0
2011-12-05 02:57:41 [<ffffffff8102988e>] bad_area_nosemaphore+0xe/0x10
2011-12-05 02:57:41 [<ffffffff81029e1e>] do_page_fault+0x2ee/0x420
2011-12-05 02:57:41 [<ffffffff8154fbdb>] ? tcp_v4_rcv+0x6fb/0x880
2011-12-05 02:57:41 [<ffffffff8152d087>] ?
ip_local_deliver_finish+0x127/0x250
2011-12-05 02:57:41 [<ffffffff8152d23d>] ? ip_local_deliver+0x8d/0xa0
2011-12-05 02:57:41 [<ffffffff8152c942>] ? ip_rcv_finish+0x172/0x340
2011-12-05 02:57:41 [<ffffffff815d079f>] page_fault+0x1f/0x30
2011-12-05 02:57:41 [<ffffffff81528796>] ? ipv4_dst_check+0xb6/0x190
2011-12-05 02:57:41 [<ffffffff814f56e2>] __sk_dst_check+0x42/0x70
2011-12-05 02:57:41 [<ffffffff8155e4c6>]
inet_sk_rebuild_header+0x26/0x330
2011-12-05 02:57:41 [<ffffffff81497230>] ? tg3_poll_work+0x1e0/0xe80
2011-12-05 02:57:41 [<ffffffff81548afb>] tcp_retransmit_skb+0xab/0x640
2011-12-05 02:57:41 [<ffffffff81012ca4>] ? x86_pmu_enable+0x1f4/0x270
2011-12-05 02:57:41 [<ffffffff8154b91e>]
tcp_retransmit_timer+0x26e/0x6e0
2011-12-05 02:57:41 [<ffffffff8154bf28>] tcp_write_timer+0x198/0x210
2011-12-05 02:57:41 [<ffffffff81055e3c>] run_timer_softirq+0x1cc/0x320
2011-12-05 02:57:41 [<ffffffff8154bd90>] ?
tcp_retransmit_timer+0x6e0/0x6e0
2011-12-05 02:57:41 [<ffffffff8101dfb8>] ? lapic_next_event+0x18/0x20
2011-12-05 02:57:41 [<ffffffff8104d1d0>] __do_softirq+0xd0/0x1c0
2011-12-05 02:57:41 [<ffffffff815d1d0c>] call_softirq+0x1c/0x30
2011-12-05 02:57:41 [<ffffffff81004a05>] do_softirq+0x55/0x90
2011-12-05 02:57:41 [<ffffffff8104cfcd>] irq_exit+0x7d/0xa0
2011-12-05 02:57:41 [<ffffffff8101eca9>]
smp_apic_timer_interrupt+0x69/0xa0
2011-12-05 02:57:41 [<ffffffff815d14d3>] apic_timer_interrupt+0x13/0x20
2011-12-05 02:57:41 <EOI> [<ffffffff815d14ce>] ?
apic_timer_interrupt+0xe/0x20
2011-12-05 02:57:41 [<ffffffff8100b7b7>] ? mwait_idle+0x117/0x120
2011-12-05 02:57:41 [<ffffffff8106cfd5>] ?
atomic_notifier_call_chain+0x15/0x20
2011-12-05 02:57:41 [<ffffffff8100208d>] cpu_idle+0xad/0xf0
2011-12-05 02:57:41 [<ffffffff815c79aa>] start_secondary+0x201/0x297
2011-12-05 02:57:41 BUG: unable to handle kernel NULL pointer
dereference at 000000000000002c
2011-12-05 02:57:41 IP: [<ffffffff81528796>] ipv4_dst_check+0xb6/0x190
2011-12-05 02:57:41 PGD 119889067 PUD 1167d2067 PMD 0
2011-12-05 02:57:41 Oops: 0002 [#2] SMP
2011-12-05 02:57:41 CPU 2
2011-12-05 02:57:41 Modules linked in: ipt_REJECT xt_tcpudp
iptable_filter ip_tables x_tables coretemp k8temp ipv6 dm_snapshot dm_mod
2011-12-05 02:57:41 Pid: 0, comm: kworker/0:1 Tainted: G D
2.6.40.8p4 #1 FUJITSU SIEMENS D2581-A5 /D2581-A5
2011-12-05 02:57:41 RIP: 0010:[<ffffffff81528796>]
[<ffffffff81528796>] ipv4_dst_check+0xb6/0x190
2011-12-05 02:57:41 RSP: 0018:ffff88011fd03cf0 EFLAGS: 00010282
2011-12-05 02:57:41 RAX: 00000001a916c098 RBX: ffff880052664d00 RCX:
0000000000000000
2011-12-05 02:57:41 RDX: ffff88002a179a40 RSI: ffff880027c3ff98 RDI:
0000000000000000
2011-12-05 02:57:41 RBP: ffff88011fd03d10 R08: 0000000000000000 R09:
0000000000000000
2011-12-05 02:57:41 R10: 0000000000000000 R11: ffffffff81604c10 R12:
ffff880027c3ff00
2011-12-05 02:57:41 R13: 0000000001b79e55 R14: ffff88010572c028 R15:
0000000000000100
2011-12-05 02:57:41 FS: 0000000000000000(0000)
GS:ffff88011fd00000(0000) knlGS:0000000000000000
Stefan
^ permalink raw reply
* Re: [net-next 1/6] e1000e: Avoid wrong check on TX hang
From: Jeff Kirsher @ 2011-12-05 6:25 UTC (permalink / raw)
To: Michael Wang
Cc: Flavio Leitner, David Miller, netdev@vger.kernel.org,
gospo@redhat.com, sassmann@redhat.com
In-Reply-To: <4EDC18D3.4060900@linux.vnet.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 1358 bytes --]
On Sun, 2011-12-04 at 17:05 -0800, Michael Wang wrote:
> On 12/04/2011 03:28 PM, Jeff Kirsher wrote:
>
> > On Sat, 2011-12-03 at 19:26 -0800, David Miller wrote:
> >> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> >> Date: Sat, 3 Dec 2011 03:44:26 -0800
> >>
> >>> + if ((!adapter->tx_hang_recheck) &&
> >>
> >> Excessive parenthesis, please remove.
> >>
> >>> + adapter->tx_hang_recheck = 1;
> >>
> >> This variable is a bool, set it to true or false.
> >>
> >>> + adapter->tx_hang_recheck = 0;
> >>
> >> Likewise.
> >>
> >>> + adapter->tx_hang_recheck = 0;
> >>
> >> Likewise.
> >
> > Michael/Flavio -
> >
> > To expedite this patch, I can make the changes that Dave is requesting
> > and re-submit v2 of the patch, if that is ok with you.
> >
>
> Hi, Jeff
>
> That's ok for me, I think it's good if you can work with Dave and make
> out a final version for us, if you want my help, please mail me at any
> time, I'm glad to work with you.
>
> Flavio:
> What's your opinion?
>
> Thanks,
> Michael Wang
I have the patch read to push, so I will go ahead an push v2 out
tonight. Since I am making changes to your patch, I will be removing
your signed-off-by (and Flavio's) and keep you as a CC: so that you can
verify the changes I have made to resolve the issues that Dave saw.
Cheers,
Jeff
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* [PATCH 1/2] r8169: Rx FIFO overflow fixes.
From: Francois Romieu @ 2011-12-05 6:30 UTC (permalink / raw)
To: booster
Cc: hayeswang, 'Jonathan Nieder', 'Eric Dumazet',
netdev, 'nic_swsd', linux-kernel, 'Armin Kazmi'
In-Reply-To: <20111201222612.GA27998@electric-eye.fr.zoreil.com>
Realtek has specified that the post 8168c gigabit chips and the post
8105e fast ethernet chips recover automatically from a Rx FIFO overflow.
The driver does not need to clear the RxFIFOOver bit of IntrStatus and
it should rather avoid messing it.
The implementation deserves some explanation:
1. events outside of the intr_event bit mask are now ignored. It enforces
a no-processing policy for the events that either should not be there
or should be ignored.
2. RxFIFOOver was already ignored in rtl_cfg_infos[RTL_CFG_1] for the
whole 8168 line of chips with two exceptions:
- RTL_GIGA_MAC_VER_22 since b5ba6d12bdac21bc0620a5089e0f24e362645efd
("use RxFIFO overflow workaround for 8168c chipset.").
This one should now be correctly handled.
- RTL_GIGA_MAC_VER_11 (8168b) which requires a different Rx FIFO
overflow processing.
Though it does not conform to Realtek suggestion above, the updated
driver includes no change for RTL_GIGA_MAC_VER_12 and RTL_GIGA_MAC_VER_17.
Both are 8168b. RTL_GIGA_MAC_VER_12 is common and a bit old so I'd rather
wait for experimental evidence that the change suggested by Realtek really
helps or does not hurt in unexpected ways.
Removed case statements in rtl8169_interrupt are only 8168 relevant.
3. RxFIFOOver is masked for post 8105e 810x chips, namely the sole 8105e
(RTL_GIGA_MAC_VER_30) itself.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: hayeswang <hayeswang@realtek.com>
---
Gerd, can you add your Tested-by: to this patch ? Thanks.
drivers/net/ethernet/realtek/r8169.c | 42 +++++++++++++--------------------
1 files changed, 17 insertions(+), 25 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 6f06aa1..7a1e3a6 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -1183,11 +1183,13 @@ static u8 rtl8168d_efuse_read(void __iomem *ioaddr, int reg_addr)
return value;
}
-static void rtl8169_irq_mask_and_ack(void __iomem *ioaddr)
+static void rtl8169_irq_mask_and_ack(struct rtl8169_private *tp)
{
- RTL_W16(IntrMask, 0x0000);
+ void __iomem *ioaddr = tp->mmio_addr;
- RTL_W16(IntrStatus, 0xffff);
+ RTL_W16(IntrMask, 0x0000);
+ RTL_W16(IntrStatus, tp->intr_event);
+ RTL_R8(ChipCmd);
}
static unsigned int rtl8169_tbi_reset_pending(struct rtl8169_private *tp)
@@ -4339,7 +4341,7 @@ static void rtl8169_hw_reset(struct rtl8169_private *tp)
void __iomem *ioaddr = tp->mmio_addr;
/* Disable interrupts */
- rtl8169_irq_mask_and_ack(ioaddr);
+ rtl8169_irq_mask_and_ack(tp);
rtl_rx_close(tp);
@@ -4885,8 +4887,7 @@ static void rtl_hw_start_8168(struct net_device *dev)
RTL_W16(IntrMitigate, 0x5151);
/* Work around for RxFIFO overflow. */
- if (tp->mac_version == RTL_GIGA_MAC_VER_11 ||
- tp->mac_version == RTL_GIGA_MAC_VER_22) {
+ if (tp->mac_version == RTL_GIGA_MAC_VER_11) {
tp->intr_event |= RxFIFOOver | PCSTimeout;
tp->intr_event &= ~RxOverflow;
}
@@ -5076,6 +5077,11 @@ static void rtl_hw_start_8101(struct net_device *dev)
void __iomem *ioaddr = tp->mmio_addr;
struct pci_dev *pdev = tp->pci_dev;
+ if (tp->mac_version >= RTL_GIGA_MAC_VER_30) {
+ tp->intr_event &= ~RxFIFOOver;
+ tp->napi_event &= ~RxFIFOOver;
+ }
+
if (tp->mac_version == RTL_GIGA_MAC_VER_13 ||
tp->mac_version == RTL_GIGA_MAC_VER_16) {
int cap = pci_pcie_cap(pdev);
@@ -5342,7 +5348,7 @@ static void rtl8169_wait_for_quiescence(struct net_device *dev)
/* Wait for any pending NAPI task to complete */
napi_disable(&tp->napi);
- rtl8169_irq_mask_and_ack(ioaddr);
+ rtl8169_irq_mask_and_ack(tp);
tp->intr_mask = 0xffff;
RTL_W16(IntrMask, tp->intr_event);
@@ -5804,6 +5810,10 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
*/
status = RTL_R16(IntrStatus);
while (status && status != 0xffff) {
+ status &= tp->intr_event;
+ if (!status)
+ break;
+
handled = 1;
/* Handle all of the error cases first. These will reset
@@ -5818,27 +5828,9 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
switch (tp->mac_version) {
/* Work around for rx fifo overflow */
case RTL_GIGA_MAC_VER_11:
- case RTL_GIGA_MAC_VER_22:
- case RTL_GIGA_MAC_VER_26:
netif_stop_queue(dev);
rtl8169_tx_timeout(dev);
goto done;
- /* Testers needed. */
- case RTL_GIGA_MAC_VER_17:
- case RTL_GIGA_MAC_VER_19:
- case RTL_GIGA_MAC_VER_20:
- case RTL_GIGA_MAC_VER_21:
- case RTL_GIGA_MAC_VER_23:
- case RTL_GIGA_MAC_VER_24:
- case RTL_GIGA_MAC_VER_27:
- case RTL_GIGA_MAC_VER_28:
- case RTL_GIGA_MAC_VER_31:
- /* Experimental science. Pktgen proof. */
- case RTL_GIGA_MAC_VER_12:
- case RTL_GIGA_MAC_VER_25:
- if (status == RxFIFOOver)
- goto done;
- break;
default:
break;
}
--
1.7.6.4
^ permalink raw reply related
* [PATCH 2/2] r8169: fix Rx index race between FIFO overflow recovery and NAPI handler.
From: Francois Romieu @ 2011-12-05 6:30 UTC (permalink / raw)
To: booster
Cc: hayeswang, 'Jonathan Nieder', 'Eric Dumazet',
netdev, 'nic_swsd', linux-kernel, 'Armin Kazmi'
In-Reply-To: <20111201222612.GA27998@electric-eye.fr.zoreil.com>
Since 92fc43b4159b518f5baae57301f26d770b0834c9, rtl8169_tx_timeout ends up
resetting Rx and Tx indexes and thus racing with the NAPI handler via
-> rtl8169_hw_reset
-> rtl_hw_reset
-> rtl8169_init_ring_indexes
What about returning to the original state ?
rtl_hw_reset is only used by rtl8169_hw_reset and rtl8169_init_one.
The latter does not need rtl8169_init_ring_indexes because the indexes
still contain their original values from the newly allocated network
device private data area (i.e. 0).
rtl8169_hw_reset is used by:
1. rtl8169_down
Helper for rtl8169_close. rtl8169_open explicitely inits the indexes
anyway.
2. rtl8169_pcierr_interrupt
Indexes are set by rtl8169_reinit_task.
3. rtl8169_interrupt
rtl8169_hw_reset is needed when the device goes down. See 1.
4. rtl_shutdown
System shutdown handler. Indexes are irrelevant.
5. rtl8169_reset_task
Indexes must be set before rtl_hw_start is called.
6. rtl8169_tx_timeout
Indexes should not be set. This is the job of rtl8169_reset_task anyway.
The removal of rtl8169_hw_reset in rtl8169_tx_timeout and its move in
rtl8169_reset_task do not change the analysis.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: hayeswang <hayeswang@realtek.com>
---
drivers/net/ethernet/realtek/r8169.c | 11 +++--------
1 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 7a1e3a6..67bf078 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -3935,8 +3935,6 @@ static void rtl_hw_reset(struct rtl8169_private *tp)
break;
udelay(100);
}
-
- rtl8169_init_ring_indexes(tp);
}
static int __devinit
@@ -5395,14 +5393,16 @@ static void rtl8169_reset_task(struct work_struct *work)
if (!netif_running(dev))
goto out_unlock;
+ rtl8169_hw_reset(tp);
+
rtl8169_wait_for_quiescence(dev);
for (i = 0; i < NUM_RX_DESC; i++)
rtl8169_mark_to_asic(tp->RxDescArray + i, rx_buf_sz);
rtl8169_tx_clear(tp);
+ rtl8169_init_ring_indexes(tp);
- rtl8169_hw_reset(tp);
rtl_hw_start(dev);
netif_wake_queue(dev);
rtl8169_check_link_status(dev, tp, tp->mmio_addr);
@@ -5413,11 +5413,6 @@ out_unlock:
static void rtl8169_tx_timeout(struct net_device *dev)
{
- struct rtl8169_private *tp = netdev_priv(dev);
-
- rtl8169_hw_reset(tp);
-
- /* Let's wait a bit while any (async) irq lands on */
rtl8169_schedule_work(dev, rtl8169_reset_task);
}
--
1.7.6.4
^ permalink raw reply related
* Re: r8169 performance?
From: Francois Romieu @ 2011-12-05 6:44 UTC (permalink / raw)
To: Chris Adams, netdev, hayeswang
In-Reply-To: <20111205004650.GA5948@hiwaay.net>
Chris Adams <cmadams@hiwaay.net> :
[...]
> On the "problem" computer (on Fedora 16, kernel 3.1.2):
>
> [ 7.101106] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
> [ 7.102665] r8169 0000:02:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
> [ 7.107308] r8169 0000:02:00.0: setting latency timer to 64
> [ 7.107370] r8169 0000:02:00.0: irq 42 for MSI/MSI-X
> [ 7.107703] r8169 0000:02:00.0: eth0: RTL8168d/8111d at 0xffffc900112fc000, 00:19:66:f2:dc:0b, XID 081000c0 IRQ 42
>
> On the "okay" computer (on Fedora 14, kernel 2.6.35.14):
>
> [ 9.053574] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
> [ 9.053594] r8169 0000:06:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
> [ 9.053689] r8169 0000:06:00.0: setting latency timer to 64
> [ 9.053740] r8169 0000:06:00.0: irq 47 for MSI/MSI-X
> [ 9.053830] r8169 0000:06:00.0: eth0: RTL8168d/8111d at 0xffffc90012998000, 6c:f0:49:b7:67:91, XID 083000c0 IRQ 47
Almost the same: RTL_GIGA_MAC_VER_25 versus RTL_GIGA_MAC_VER_26 (faster).
The only difference in the driver is the hw_phy_config part.
--
Ueimor
^ permalink raw reply
* Re: [net-next 1/6] e1000e: Avoid wrong check on TX hang
From: Michael Wang @ 2011-12-05 7:15 UTC (permalink / raw)
To: jeffrey.t.kirsher
Cc: Flavio Leitner, David Miller, netdev@vger.kernel.org,
gospo@redhat.com, sassmann@redhat.com
In-Reply-To: <1323066318.24828.14.camel@jtkirshe-mobl>
On 12/05/2011 02:25 PM, Jeff Kirsher wrote:
> On Sun, 2011-12-04 at 17:05 -0800, Michael Wang wrote:
>> On 12/04/2011 03:28 PM, Jeff Kirsher wrote:
>>
>>> On Sat, 2011-12-03 at 19:26 -0800, David Miller wrote:
>>>> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>>>> Date: Sat, 3 Dec 2011 03:44:26 -0800
>>>>
>>>>> + if ((!adapter->tx_hang_recheck) &&
>>>>
>>>> Excessive parenthesis, please remove.
>>>>
>>>>> + adapter->tx_hang_recheck = 1;
>>>>
>>>> This variable is a bool, set it to true or false.
>>>>
>>>>> + adapter->tx_hang_recheck = 0;
>>>>
>>>> Likewise.
>>>>
>>>>> + adapter->tx_hang_recheck = 0;
>>>>
>>>> Likewise.
>>>
>>> Michael/Flavio -
>>>
>>> To expedite this patch, I can make the changes that Dave is requesting
>>> and re-submit v2 of the patch, if that is ok with you.
>>>
>>
>> Hi, Jeff
>>
>> That's ok for me, I think it's good if you can work with Dave and make
>> out a final version for us, if you want my help, please mail me at any
>> time, I'm glad to work with you.
>>
>> Flavio:
>> What's your opinion?
>>
>> Thanks,
>> Michael Wang
>
> I have the patch read to push, so I will go ahead an push v2 out
> tonight. Since I am making changes to your patch, I will be removing
> your signed-off-by (and Flavio's) and keep you as a CC: so that you can
> verify the changes I have made to resolve the issues that Dave saw.
>
Hi, Jeff
Is that means you have a better patch which different from ours, and you
will use your patch to instead of ours?
Because David is just ask for some small change, I think your time zone
may be better to work with him, so I ask for your help.
I was just confused that why our signed-off-by should be removed?
Thanks,
Michael Wang
> Cheers,
> Jeff
^ permalink raw reply
* Re: [PATCH net-next V0 19/21] mlx4_core: Modify driver initialization flow to accommodate SRIOV for Ethernet
From: Jack Morgenstein @ 2011-12-05 7:19 UTC (permalink / raw)
To: Or Gerlitz
Cc: Roland Dreier, Yevgeny Petrilin, davem-fT/PcQaiUtIeIZ0/mPfg9Q,
netdev-u79uwXL29TY76Z2rM5mHXA, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
liranl-VPRAkNaXOzVS1MOuV/RT9w
In-Reply-To: <4EDB942F.1020101-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
On Sunday 04 December 2011 17:39, Or Gerlitz wrote:
> On 12/4/2011 4:29 PM, Jack Morgenstein wrote:
> > If the kernel is not configured to support IOV, pci_enable_sriov will
> > fail.
> Jack,
>
> If CONFIG_PCI_IOV isn't set, pci_enable_sriov isn't there...
>
> Or.
>
Not so. I checked. If CONFIG_PCI_IOV isn't set, pci_enable_sriov returns -ENODEV
via a static inline function.
Look in kernel file include/linux/pci.h (for the most recent kernel):
#ifdef CONFIG_PCI_IOV
extern int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn);
extern void pci_disable_sriov(struct pci_dev *dev);
extern irqreturn_t pci_sriov_migration(struct pci_dev *dev);
extern int pci_num_vf(struct pci_dev *dev);
#else
static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)
{
return -ENODEV;
}
static inline void pci_disable_sriov(struct pci_dev *dev)
{
}
static inline irqreturn_t pci_sriov_migration(struct pci_dev *dev)
{
return IRQ_NONE;
}
static inline int pci_num_vf(struct pci_dev *dev)
{
return 0;
}
#endif
- Jack
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" 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 net-next V0 19/21] mlx4_core: Modify driver initialization flow to accommodate SRIOV for Ethernet
From: Or Gerlitz @ 2011-12-05 7:40 UTC (permalink / raw)
To: Jack Morgenstein
Cc: Roland Dreier, Yevgeny Petrilin, davem-fT/PcQaiUtIeIZ0/mPfg9Q,
netdev-u79uwXL29TY76Z2rM5mHXA, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
liranl-VPRAkNaXOzVS1MOuV/RT9w
In-Reply-To: <201112050919.39280.jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
On 12/5/2011 9:19 AM, Jack Morgenstein wrote:
> If CONFIG_PCI_IOV isn't set, pci_enable_sriov isn't there...
> Not so. I checked. If CONFIG_PCI_IOV isn't set, pci_enable_sriov returns -ENODEV via a static inline function. Look in kernel file include/linux/pci.h (for the most recent kernel)
Sure, sorry, my bad, thanks for clarifying this out.
Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" 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
* v6: faster tree-based sysctl implementation
From: Lucian Adrian Grijincu @ 2011-12-05 7:55 UTC (permalink / raw)
To: Eric W . Biederman, linux-kernel
Cc: netdev, Octavian Purdila, David S . Miller, Alexey Dobriyan,
Damien Millescamps
This is version 6 of a patch series that introduces a faster/leaner
sysctl internal implementation.
git://github.com/luciang/linux-2.6-new-sysctl.git v6-new-sysctl-alg
A subset of patches that add the minimal set of patches with the new
algorithm is here:
git://github.com/luciang/linux-2.6-new-sysctl.git v6-new-sysctl-alg-slim
= Stats =
$ time modprobe dummy numdummies=N
Without this patch series :(
- ipv4 only
- N=1000 time= 0m 07s
- N=2000 time= 0m 38s
- N=4000 time= 4m 01s
- ipv4 and ipv6
- N=1000 time= 0m 35s
- N=2000 time= 3m 09s
- N=4000 time=14m 27s
With this patch series :)
- ipv4 only
- N=1000 time= 0m 0.31s
- N=2000 time= 0m 1.23s
- N=4000 time= 0m 5.14s
- N=8000 time= 0m 20.20s
- ipv4 and ipv6
- N=1000 time= 0m 0.70s
- N=2000 time= 0m 1.93s
- N=4000 time= 0m 7.03s
- N=8000 time= 0m 40.89s
= Changes =
since v5:
- https://lkml.org/lkml/2011/6/2/332 - nothing much because of lack
of review. Echo, echo, echo ... :)
- minor tweaks
- rebased on 3.2-rc4
since v4: - http://thread.gmane.org/gmane.linux.network/196495/focus=1144143
- rebased on 3.0-rc1 - added a new patch manually register
kernel/usermodehelper which was added in 3.0-rc1 - minor changes to
the "sysctl: simplify find_in_table" patch
since v3: - http://thread.gmane.org/gmane.linux.network/196495/ -
removed a bad patch that shrinked a counter from int to u8
since v2: - http://thread.gmane.org/gmane.linux.kernel/1137032/focus=3D194748
- added a compatibility layer to support old registering complex
sysctl trees. This layer will be deleted once all users of the old
are changed. - subdirectories and netns correspondent dirs are now
held in rbtrees - split of from the patches that make changes in the
rest of the tree - rebased on top of 2.6.39
since v1: - http://thread.gmane.org/gmane.linux.kernel/1133667 -
rebased on top of 2.6.39-rc6 - split the patch that adds the new
algorithm and data structures. - fixed a few bugs lingering in the old
code - shrinked a reference counter - added a new reference counter to
maintain ownership information - added method to register an empty
sysctl dir and converted some users - added checks enforcing the rule
that a non-netns specific directory may not be registered after a
netns specific one has already been registered. - added cookie
support: register a piece of data with the header to be used to make
simple conversions on the ctl_table.
= Summary =
Part 1: introduce compatibility layer:
sysctl: introduce temporary sysctl wrappers
sysctl: register only tables of sysctl files
Part 2: minimal changes to sysctl users:
sysctl: call sysctl_init before the first sysctl registration
sysctl: no-child: manually register kernel/random
sysctl: no-child: manually register kernel/usermodehelper
sysctl: no-child: manually register kernel/keys
sysctl: no-child: manually register fs/inotify
sysctl: no-child: manually register fs/epoll
sysctl: no-child: manually register root tables
Part 3: cleanups simplifying the new algorithm:
sysctl: faster reimplementation of sysctl_check_table
sysctl: remove useless ctl_table->parent field
sysctl: simplify find_in_table
sysctl: sysctl_head_grab defaults to root header on NULL
sysctl: delete useless grab_header function
sysctl: rename ->used to ->ctl_use_refs
sysctl: rename sysctl_head_grab/finish to sysctl_use_header/unuse
sysctl: rename sysctl_head_next to sysctl_use_next_header
sysctl: split ->count into ctl_procfs_refs and ctl_header_refs
sysctl: rename sysctl_head_get/put to sysctl_proc_inode_get/put
sysctl: rename (un)use_table to __sysctl_(un)use_header
sysctl: simplify ->permissions hook
sysctl: move removal from list out of start_unregistering
sysctl: introduce ctl_table_group and ctl_table_group_ops
Part 4: new algorithm/data structures:
sysctl: faster tree-based sysctl implementation
Part 5: checks/warns requested during review:
sysctl: add duplicate entry and sanity ctl_table checks
sysctl: alloc ctl_table_header with kmem_cache
sysctl: check netns-specific registration order respected
sysctl: warn if registration/unregistration order is not respected
sysctl: always perform sysctl checks
sysctl: reorder members of ctl_table_header (cleanup)
sysctl: add ctl_type member
Part 6: further performance optimisations:
sysctl: replace subdirectory list with rbtree
sysctl: replace netns corresp list with rbtree
sysctl: union-ize some ctl_table_header fields
Part 7: Eric requested ability to register an empty dir:
sysctl: add register_sysctl_dir: register an empty sysctl directory
Part 8: unrequested feature I'd like to piggy back :)
sysctl: add ctl_cookie and ctl_cookie_handler
sysctl: add cookie to __register_sysctl_paths
sysctl: add register_net_sysctl_table_net_cookie
drivers/char/random.c | 27 +-
fs/eventpoll.c | 22 +-
fs/notify/inotify/inotify_user.c | 22 +-
fs/proc/inode.c | 2 +-
fs/proc/proc_sysctl.c | 236 +++++---
include/linux/inotify.h | 2 -
include/linux/key.h | 3 -
include/linux/kmod.h | 3 -
include/linux/poll.h | 2 -
include/linux/sysctl.h | 221 +++++---
include/net/net_namespace.h | 4 +-
init/main.c | 1 +
kernel/Makefile | 5 +-
kernel/kmod.c | 14 +-
kernel/sysctl.c | 1170 ++++++++++++++++++++++++++++----------
kernel/sysctl_check.c | 316 +++++++----
lib/Kconfig.debug | 8 -
net/sysctl_net.c | 86 ++--
security/keys/key.c | 7 +
security/keys/sysctl.c | 18 +-
20 files changed, 1500 insertions(+), 669 deletions(-)
--
1.7.5.4
--
.
..: Lucian
^ permalink raw reply
* Re: [net-next 1/6] e1000e: Avoid wrong check on TX hang
From: Jeff Kirsher @ 2011-12-05 8:02 UTC (permalink / raw)
To: Michael Wang
Cc: Flavio Leitner, David Miller, netdev@vger.kernel.org,
gospo@redhat.com, sassmann@redhat.com
In-Reply-To: <4EDC6F76.2090504@linux.vnet.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 3212 bytes --]
On Sun, 2011-12-04 at 23:15 -0800, Michael Wang wrote:
> On 12/05/2011 02:25 PM, Jeff Kirsher wrote:
>
> > On Sun, 2011-12-04 at 17:05 -0800, Michael Wang wrote:
> >> On 12/04/2011 03:28 PM, Jeff Kirsher wrote:
> >>
> >>> On Sat, 2011-12-03 at 19:26 -0800, David Miller wrote:
> >>>> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> >>>> Date: Sat, 3 Dec 2011 03:44:26 -0800
> >>>>
> >>>>> + if ((!adapter->tx_hang_recheck) &&
> >>>>
> >>>> Excessive parenthesis, please remove.
> >>>>
> >>>>> + adapter->tx_hang_recheck = 1;
> >>>>
> >>>> This variable is a bool, set it to true or false.
> >>>>
> >>>>> + adapter->tx_hang_recheck = 0;
> >>>>
> >>>> Likewise.
> >>>>
> >>>>> + adapter->tx_hang_recheck = 0;
> >>>>
> >>>> Likewise.
> >>>
> >>> Michael/Flavio -
> >>>
> >>> To expedite this patch, I can make the changes that Dave is requesting
> >>> and re-submit v2 of the patch, if that is ok with you.
> >>>
> >>
> >> Hi, Jeff
> >>
> >> That's ok for me, I think it's good if you can work with Dave and make
> >> out a final version for us, if you want my help, please mail me at any
> >> time, I'm glad to work with you.
> >>
> >> Flavio:
> >> What's your opinion?
> >>
> >> Thanks,
> >> Michael Wang
> >
> > I have the patch read to push, so I will go ahead an push v2 out
> > tonight. Since I am making changes to your patch, I will be removing
> > your signed-off-by (and Flavio's) and keep you as a CC: so that you can
> > verify the changes I have made to resolve the issues that Dave saw.
> >
>
> Hi, Jeff
>
> Is that means you have a better patch which different from ours, and you
> will use your patch to instead of ours?
>
> Because David is just ask for some small change, I think your time zone
> may be better to work with him, so I ask for your help.
>
> I was just confused that why our signed-off-by should be removed?
>
> Thanks,
> Michael Wang
>
> > Cheers,
> > Jeff
It is your patch (your original work) but since I have made changes to
your patch, I (or anyone for that matter) should not assume that you as
the owner would signed off on the changes that I have made based on
feedback. It would not be right for me to send out a patch with your
signed-off-by which is different from what you originally submitted,
without your ok. Once I send out the v2 of the patch, please feel free
to add your signed-off-by OR acked-by to the patch.
While I personally do not have a problem keeping you as the owner and
your signed-off-by, I believe that takes in several assumptions which
only you as the owner should speak for. I am not trying to take
ownership for stats purposes, I care less about the number of patches I
create and own and would rather make sure that the original owners get
the credit due for the work they did.
So with that, when I send out my next series of patches please feel free
to ACK or Sign-off on the changes made. I just wanted to make sure that
we get these changes in soon (with out delay).
I can wait if you want to keep ownership of the patch, I just wanted to
ensure that we get your patch included as soon as possible based on the
problem it fixes.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [net-next 1/6] e1000e: Avoid wrong check on TX hang
From: Michael Wang @ 2011-12-05 8:18 UTC (permalink / raw)
To: jeffrey.t.kirsher
Cc: Flavio Leitner, David Miller, netdev@vger.kernel.org,
gospo@redhat.com, sassmann@redhat.com
In-Reply-To: <1323072138.24828.32.camel@jtkirshe-mobl>
On 12/05/2011 04:02 PM, Jeff Kirsher wrote:
> On Sun, 2011-12-04 at 23:15 -0800, Michael Wang wrote:
>> On 12/05/2011 02:25 PM, Jeff Kirsher wrote:
>>
>>> On Sun, 2011-12-04 at 17:05 -0800, Michael Wang wrote:
>>>> On 12/04/2011 03:28 PM, Jeff Kirsher wrote:
>>>>
>>>>> On Sat, 2011-12-03 at 19:26 -0800, David Miller wrote:
>>>>>> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>>>>>> Date: Sat, 3 Dec 2011 03:44:26 -0800
>>>>>>
>>>>>>> + if ((!adapter->tx_hang_recheck) &&
>>>>>>
>>>>>> Excessive parenthesis, please remove.
>>>>>>
>>>>>>> + adapter->tx_hang_recheck = 1;
>>>>>>
>>>>>> This variable is a bool, set it to true or false.
>>>>>>
>>>>>>> + adapter->tx_hang_recheck = 0;
>>>>>>
>>>>>> Likewise.
>>>>>>
>>>>>>> + adapter->tx_hang_recheck = 0;
>>>>>>
>>>>>> Likewise.
>>>>>
>>>>> Michael/Flavio -
>>>>>
>>>>> To expedite this patch, I can make the changes that Dave is requesting
>>>>> and re-submit v2 of the patch, if that is ok with you.
>>>>>
>>>>
>>>> Hi, Jeff
>>>>
>>>> That's ok for me, I think it's good if you can work with Dave and make
>>>> out a final version for us, if you want my help, please mail me at any
>>>> time, I'm glad to work with you.
>>>>
>>>> Flavio:
>>>> What's your opinion?
>>>>
>>>> Thanks,
>>>> Michael Wang
>>>
>>> I have the patch read to push, so I will go ahead an push v2 out
>>> tonight. Since I am making changes to your patch, I will be removing
>>> your signed-off-by (and Flavio's) and keep you as a CC: so that you can
>>> verify the changes I have made to resolve the issues that Dave saw.
>>>
>>
>> Hi, Jeff
>>
>> Is that means you have a better patch which different from ours, and you
>> will use your patch to instead of ours?
>>
>> Because David is just ask for some small change, I think your time zone
>> may be better to work with him, so I ask for your help.
>>
>> I was just confused that why our signed-off-by should be removed?
>>
>> Thanks,
>> Michael Wang
>>
>>> Cheers,
>>> Jeff
>
> It is your patch (your original work) but since I have made changes to
> your patch, I (or anyone for that matter) should not assume that you as
> the owner would signed off on the changes that I have made based on
> feedback. It would not be right for me to send out a patch with your
> signed-off-by which is different from what you originally submitted,
> without your ok. Once I send out the v2 of the patch, please feel free
> to add your signed-off-by OR acked-by to the patch.
>
Hi, Jeff
That make sense, I'm sorry but because I'm new to the community, and I
just want to make every thing clear so I can do better in the future.
> While I personally do not have a problem keeping you as the owner and
> your signed-off-by, I believe that takes in several assumptions which
> only you as the owner should speak for. I am not trying to take
> ownership for stats purposes, I care less about the number of patches I
> create and own and would rather make sure that the original owners get
> the credit due for the work they did.
>
I'm so sorry and I regret if I make you unhappy by some wrong word,
please forgive me.
> So with that, when I send out my next series of patches please feel free
> to ACK or Sign-off on the changes made. I just wanted to make sure that
> we get these changes in soon (with out delay).
>
> I can wait if you want to keep ownership of the patch, I just wanted to
> ensure that we get your patch included as soon as possible based on the
> problem it fixes.
Please help us to make the patch perfect, and I'm very glad if I can
have the opportunity to work with you.
Thanks & Best regards
Michael Wang
^ permalink raw reply
* [net-next 0/6 v2][pull request] Intel Wired LAN Driver Updates
From: Jeff Kirsher @ 2011-12-05 8:20 UTC (permalink / raw)
To: davem; +Cc: Jeff Kirsher, netdev, gospo, sassmann
The following series contains updates to e1000e, igb and ixgbe. 5 of
the patches are bug fixes and one patch is to cleanup a function
prototype of a non-existent function.
-v2 fix up patch 1 based on David Miller's suggestion
fix up patch 5 so that the tested-by is in the correct place
The following are changes since commit 340e8dc1fb4032b6c8334c9bff20b2aec42ecfd8:
atm: clip: Remove code commented out since eternity.
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master
Bruce Allan (1):
e1000e: hitting BUG_ON() from napi_enable
Greg Rose (1):
ixgbe: Remove function prototype for non-existent function
Jeff Kirsher (1):
e1000e: Avoid wrong check on TX hang
John Fastabend (2):
ixgbe: DCBnl set_all, order of operations fix
ixgbe: DCB: IEEE transitions may fail to reprogram hardware.
Matthew Vick (1):
igb: Update DMA Coalescing threshold calculation.
drivers/net/ethernet/intel/e1000e/e1000.h | 1 +
drivers/net/ethernet/intel/e1000e/netdev.c | 27 +++++-
drivers/net/ethernet/intel/igb/igb_main.c | 26 +++++--
drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c | 96 +++++++++--------------
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h | 1 -
5 files changed, 80 insertions(+), 71 deletions(-)
--
1.7.6.4
^ permalink raw reply
* [net-next 1/6] e1000e: Avoid wrong check on TX hang
From: Jeff Kirsher @ 2011-12-05 8:20 UTC (permalink / raw)
To: davem; +Cc: Jeff Kirsher, netdev, gospo, sassmann, Michael Wang,
Flavio Leitner
In-Reply-To: <1323073241-21144-1-git-send-email-jeffrey.t.kirsher@intel.com>
Based on the original patch submitted my Michael Wang
<wangyun@linux.vnet.ibm.com>.
Descriptors may not be write-back while checking TX hang with flag
FLAG2_DMA_BURST on.
So when we detect hang, we just flush the descriptor and detect
again for once.
-v2 change 1 to true and 0 to false and remove extra ()
CC: Michael Wang <wangyun@linux.vnet.ibm.com>
CC: Flavio Leitner <fbl@redhat.com>
Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/e1000e/e1000.h | 1 +
drivers/net/ethernet/intel/e1000e/netdev.c | 23 ++++++++++++++++++++---
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h
index 9fe18d1..f478a22 100644
--- a/drivers/net/ethernet/intel/e1000e/e1000.h
+++ b/drivers/net/ethernet/intel/e1000e/e1000.h
@@ -309,6 +309,7 @@ struct e1000_adapter {
u32 txd_cmd;
bool detect_tx_hung;
+ bool tx_hang_recheck;
u8 tx_timeout_factor;
u32 tx_int_delay;
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index c6e9763..c12df69 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -1014,6 +1014,7 @@ static void e1000_print_hw_hang(struct work_struct *work)
struct e1000_adapter *adapter = container_of(work,
struct e1000_adapter,
print_hang_task);
+ struct net_device *netdev = adapter->netdev;
struct e1000_ring *tx_ring = adapter->tx_ring;
unsigned int i = tx_ring->next_to_clean;
unsigned int eop = tx_ring->buffer_info[i].next_to_watch;
@@ -1025,6 +1026,21 @@ static void e1000_print_hw_hang(struct work_struct *work)
if (test_bit(__E1000_DOWN, &adapter->state))
return;
+ if (!adapter->tx_hang_recheck &&
+ (adapter->flags2 & FLAG2_DMA_BURST)) {
+ /* May be block on write-back, flush and detect again
+ * flush pending descriptor writebacks to memory
+ */
+ ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD);
+ /* execute the writes immediately */
+ e1e_flush();
+ adapter->tx_hang_recheck = true;
+ return;
+ }
+ /* Real hang detected */
+ adapter->tx_hang_recheck = false;
+ netif_stop_queue(netdev);
+
e1e_rphy(hw, PHY_STATUS, &phy_status);
e1e_rphy(hw, PHY_1000T_STATUS, &phy_1000t_status);
e1e_rphy(hw, PHY_EXT_STATUS, &phy_ext_status);
@@ -1145,10 +1161,10 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
if (tx_ring->buffer_info[i].time_stamp &&
time_after(jiffies, tx_ring->buffer_info[i].time_stamp
+ (adapter->tx_timeout_factor * HZ)) &&
- !(er32(STATUS) & E1000_STATUS_TXOFF)) {
+ !(er32(STATUS) & E1000_STATUS_TXOFF))
schedule_work(&adapter->print_hang_task);
- netif_stop_queue(netdev);
- }
+ else
+ adapter->tx_hang_recheck = false;
}
adapter->total_tx_bytes += total_tx_bytes;
adapter->total_tx_packets += total_tx_packets;
@@ -3838,6 +3854,7 @@ static int e1000_open(struct net_device *netdev)
e1000_irq_enable(adapter);
+ adapter->tx_hang_recheck = false;
netif_start_queue(netdev);
adapter->idle_check = true;
--
1.7.6.4
^ permalink raw reply related
* [net-next 2/6] e1000e: hitting BUG_ON() from napi_enable
From: Jeff Kirsher @ 2011-12-05 8:20 UTC (permalink / raw)
To: davem; +Cc: Bruce Allan, netdev, gospo, sassmann, Mike McElroy, Jeff Kirsher
In-Reply-To: <1323073241-21144-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Bruce Allan <bruce.w.allan@intel.com>
Based on a patch from Mike McElroy created against the out-of-tree e1000e
driver:
Hitting the BUG_ON in napi_enable(). Code inspection shows that this can
only be triggered by calling napi_enable() twice without an intervening
napi_disable().
I saw the following sequence of events in the stack trace:
1) We simulated a cable pull using an Extreme switch.
2) e1000_tx_timeout() was entered.
3) e1000_reset_task() was called. Saw the message from e_err() in the
console log.
4) e1000_reinit_locked was called. This function calls e1000_down() and
e1000_up(). These functions call napi_disable() and napi_enable()
respectively.
5) Then on another thread, a monitor task saw carrier was down and executed
'ip set link down' and 'ip set link up' commands.
6) Saw the '_E1000_RESETTING'warning fron the e1000_close function.
7) Either the e1000_open() executed between the e1000_down() and e1000_up()
calls in step 4 or the e1000_open() call executed after the e1000_up()
call. In either case, napi_enable() is called twice which triggers the
BUG_ON.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Cc: Mike McElroy <mike.mcelroy@stratus.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/e1000e/netdev.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index c12df69..93ae0c2 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -3516,7 +3516,6 @@ int e1000e_up(struct e1000_adapter *adapter)
clear_bit(__E1000_DOWN, &adapter->state);
- napi_enable(&adapter->napi);
if (adapter->msix_entries)
e1000_configure_msix(adapter);
e1000_irq_enable(adapter);
@@ -3578,7 +3577,6 @@ void e1000e_down(struct e1000_adapter *adapter)
e1e_flush();
usleep_range(10000, 20000);
- napi_disable(&adapter->napi);
e1000_irq_disable(adapter);
del_timer_sync(&adapter->watchdog_timer);
@@ -3901,6 +3899,8 @@ static int e1000_close(struct net_device *netdev)
pm_runtime_get_sync(&pdev->dev);
+ napi_disable(&adapter->napi);
+
if (!test_bit(__E1000_DOWN, &adapter->state)) {
e1000e_down(adapter);
e1000_free_irq(adapter);
--
1.7.6.4
^ permalink raw reply related
* [net-next 3/6] igb: Update DMA Coalescing threshold calculation.
From: Jeff Kirsher @ 2011-12-05 8:20 UTC (permalink / raw)
To: davem; +Cc: Matthew Vick, netdev, gospo, sassmann, Jeff Kirsher
In-Reply-To: <1323073241-21144-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Matthew Vick <matthew.vick@intel.com>
This patch updates the DMA Coalescing feature parameters to account for
larger MTUs. Previously, sufficient space may not have been allocated in
the receive buffer, causing packet drop.
Signed-off-by: Matthew Vick <matthew.vick@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igb/igb_main.c | 26 +++++++++++++++++++-------
1 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index b66b8aa..143cfeb 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -7061,15 +7061,28 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba)
wr32(E1000_DMCTXTH, 0);
/*
- * DMA Coalescing high water mark needs to be higher
- * than the RX threshold. set hwm to PBA - 2 * max
- * frame size
+ * DMA Coalescing high water mark needs to be greater
+ * than the Rx threshold. Set hwm to PBA - max frame
+ * size in 16B units, capping it at PBA - 6KB.
*/
- hwm = pba - (2 * adapter->max_frame_size);
+ hwm = 64 * pba - adapter->max_frame_size / 16;
+ if (hwm < 64 * (pba - 6))
+ hwm = 64 * (pba - 6);
+ reg = rd32(E1000_FCRTC);
+ reg &= ~E1000_FCRTC_RTH_COAL_MASK;
+ reg |= ((hwm << E1000_FCRTC_RTH_COAL_SHIFT)
+ & E1000_FCRTC_RTH_COAL_MASK);
+ wr32(E1000_FCRTC, reg);
+
+ /*
+ * Set the DMA Coalescing Rx threshold to PBA - 2 * max
+ * frame size, capping it at PBA - 10KB.
+ */
+ dmac_thr = pba - adapter->max_frame_size / 512;
+ if (dmac_thr < pba - 10)
+ dmac_thr = pba - 10;
reg = rd32(E1000_DMACR);
reg &= ~E1000_DMACR_DMACTHR_MASK;
- dmac_thr = pba - 4;
-
reg |= ((dmac_thr << E1000_DMACR_DMACTHR_SHIFT)
& E1000_DMACR_DMACTHR_MASK);
@@ -7085,7 +7098,6 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba)
* coalescing(smart fifb)-UTRESH=0
*/
wr32(E1000_DMCRTRH, 0);
- wr32(E1000_FCRTC, hwm);
reg = (IGB_DMCTLX_DCFLUSH_DIS | 0x4);
--
1.7.6.4
^ permalink raw reply related
* [net-next 4/6] ixgbe: DCBnl set_all, order of operations fix
From: Jeff Kirsher @ 2011-12-05 8:20 UTC (permalink / raw)
To: davem; +Cc: John Fastabend, netdev, gospo, sassmann, Jeff Kirsher
In-Reply-To: <1323073241-21144-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: John Fastabend <john.r.fastabend@intel.com>
The order of operations is important in DCBnl set_all(). When FCoE
is configured it uses the up2tc map to learn which queues to configure
the hardware offloads on. Therefore we need to setup the map before
configuring FCoE.
This is only seen when the both up2tc mappings and APP info are
configured simultaneously.
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c | 77 +++++++++--------------
1 files changed, 29 insertions(+), 48 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
index 33b93ff..8c056c0 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
@@ -309,6 +309,27 @@ static void ixgbe_dcbnl_get_pfc_cfg(struct net_device *netdev, int priority,
*setting = adapter->dcb_cfg.tc_config[priority].dcb_pfc;
}
+#ifdef IXGBE_FCOE
+static void ixgbe_dcbnl_devreset(struct net_device *dev)
+{
+ struct ixgbe_adapter *adapter = netdev_priv(dev);
+
+ while (test_and_set_bit(__IXGBE_RESETTING, &adapter->state))
+ usleep_range(1000, 2000);
+
+ if (netif_running(dev))
+ dev->netdev_ops->ndo_stop(dev);
+
+ ixgbe_clear_interrupt_scheme(adapter);
+ ixgbe_init_interrupt_scheme(adapter);
+
+ if (netif_running(dev))
+ dev->netdev_ops->ndo_open(dev);
+
+ clear_bit(__IXGBE_RESETTING, &adapter->state);
+}
+#endif
+
static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
{
struct ixgbe_adapter *adapter = netdev_priv(netdev);
@@ -338,27 +359,6 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
if (ret)
return DCB_NO_HW_CHG;
-#ifdef IXGBE_FCOE
- if (up && !(up & (1 << adapter->fcoe.up)))
- adapter->dcb_set_bitmap |= BIT_APP_UPCHG;
-
- /*
- * Only take down the adapter if an app change occurred. FCoE
- * may shuffle tx rings in this case and this can not be done
- * without a reset currently.
- */
- if (adapter->dcb_set_bitmap & BIT_APP_UPCHG) {
- while (test_and_set_bit(__IXGBE_RESETTING, &adapter->state))
- usleep_range(1000, 2000);
-
- adapter->fcoe.up = ffs(up) - 1;
-
- if (netif_running(netdev))
- netdev->netdev_ops->ndo_stop(netdev);
- ixgbe_clear_interrupt_scheme(adapter);
- }
-#endif
-
if (adapter->dcb_cfg.pfc_mode_enable) {
switch (adapter->hw.mac.type) {
case ixgbe_mac_82599EB:
@@ -385,15 +385,6 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
}
}
-#ifdef IXGBE_FCOE
- if (adapter->dcb_set_bitmap & BIT_APP_UPCHG) {
- ixgbe_init_interrupt_scheme(adapter);
- if (netif_running(netdev))
- netdev->netdev_ops->ndo_open(netdev);
- ret = DCB_HW_CHG_RST;
- }
-#endif
-
if (adapter->dcb_set_bitmap & (BIT_PG_TX|BIT_PG_RX)) {
u16 refill[MAX_TRAFFIC_CLASS], max[MAX_TRAFFIC_CLASS];
u8 bwg_id[MAX_TRAFFIC_CLASS], prio_type[MAX_TRAFFIC_CLASS];
@@ -442,8 +433,14 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
if (adapter->dcb_cfg.pfc_mode_enable)
adapter->hw.fc.current_mode = ixgbe_fc_pfc;
- if (adapter->dcb_set_bitmap & BIT_APP_UPCHG)
- clear_bit(__IXGBE_RESETTING, &adapter->state);
+#ifdef IXGBE_FCOE
+ if (up && !(up & (1 << adapter->fcoe.up))) {
+ adapter->fcoe.up = ffs(up) - 1;
+ ixgbe_dcbnl_devreset(netdev);
+ ret = DCB_HW_CHG_RST;
+ }
+#endif
+
adapter->dcb_set_bitmap = 0x00;
return ret;
}
@@ -661,22 +658,6 @@ static int ixgbe_dcbnl_ieee_setpfc(struct net_device *dev,
return ixgbe_dcb_hw_pfc_config(&adapter->hw, pfc->pfc_en, prio_tc);
}
-#ifdef IXGBE_FCOE
-static void ixgbe_dcbnl_devreset(struct net_device *dev)
-{
- struct ixgbe_adapter *adapter = netdev_priv(dev);
-
- if (netif_running(dev))
- dev->netdev_ops->ndo_stop(dev);
-
- ixgbe_clear_interrupt_scheme(adapter);
- ixgbe_init_interrupt_scheme(adapter);
-
- if (netif_running(dev))
- dev->netdev_ops->ndo_open(dev);
-}
-#endif
-
static int ixgbe_dcbnl_ieee_setapp(struct net_device *dev,
struct dcb_app *app)
{
--
1.7.6.4
^ permalink raw reply related
* [net-next 6/6] ixgbe: Remove function prototype for non-existent function
From: Jeff Kirsher @ 2011-12-05 8:20 UTC (permalink / raw)
To: davem; +Cc: Greg Rose, netdev, gospo, sassmann, Jeff Kirsher
In-Reply-To: <1323073241-21144-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h
index df04f1a..e8badab 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h
@@ -33,7 +33,6 @@ void ixgbe_msg_task(struct ixgbe_adapter *adapter);
int ixgbe_vf_configuration(struct pci_dev *pdev, unsigned int event_mask);
void ixgbe_disable_tx_rx(struct ixgbe_adapter *adapter);
void ixgbe_ping_all_vfs(struct ixgbe_adapter *adapter);
-void ixgbe_dump_registers(struct ixgbe_adapter *adapter);
int ixgbe_ndo_set_vf_mac(struct net_device *netdev, int queue, u8 *mac);
int ixgbe_ndo_set_vf_vlan(struct net_device *netdev, int queue, u16 vlan,
u8 qos);
--
1.7.6.4
^ permalink raw reply related
* [net-next 5/6] ixgbe: DCB: IEEE transitions may fail to reprogram hardware.
From: Jeff Kirsher @ 2011-12-05 8:20 UTC (permalink / raw)
To: davem; +Cc: John Fastabend, netdev, gospo, sassmann, Jeff Kirsher
In-Reply-To: <1323073241-21144-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: John Fastabend <john.r.fastabend@intel.com>
Transitioning through an IEEE DCBX version from a CEE DCBX
and back (CEE->IEEE->CEE) may leave IEEE attributes programmed
in the hardware. DCB uses a bit field in the set routines to
determine which attributes PG, PFC, APP need to be reprogrammed.
This is needed because user flow allows queueing a series
of changes and then reprogramming the hardware with the
entire set in one operation.
When transitioning from IEEE DCBX mode back into CEE DCBX
mode the PG and PFC bits need to be set so the possibly
different CEE attributes get programmed into the device.
This patch fixes broken logic that was evaluating to 0
and never setting any bits. Further this removes some
checks for num_tc in set routines. This logic only worked
when the number of traffic classes and user priorities
were equal. This is no longer the case for X540 devices.
Besides we can trust user input in this case if the
device is incorrectly configured the DCB bandwidths will
be incorrectly mapped but no OOPs, BUG, or hardware
failure will occur.
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c | 21 ++++++++++-----------
1 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
index 8c056c0..da31735 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
@@ -158,10 +158,6 @@ static void ixgbe_dcbnl_set_pg_tc_cfg_tx(struct net_device *netdev, int tc,
{
struct ixgbe_adapter *adapter = netdev_priv(netdev);
- /* Abort a bad configuration */
- if (ffs(up_map) > adapter->dcb_cfg.num_tcs.pg_tcs)
- return;
-
if (prio != DCB_ATTR_VALUE_UNDEFINED)
adapter->temp_dcb_cfg.tc_config[tc].path[0].prio_type = prio;
if (bwg_id != DCB_ATTR_VALUE_UNDEFINED)
@@ -185,7 +181,7 @@ static void ixgbe_dcbnl_set_pg_tc_cfg_tx(struct net_device *netdev, int tc,
if (adapter->temp_dcb_cfg.tc_config[tc].path[0].up_to_tc_bitmap !=
adapter->dcb_cfg.tc_config[tc].path[0].up_to_tc_bitmap)
- adapter->dcb_set_bitmap |= BIT_PFC;
+ adapter->dcb_set_bitmap |= BIT_PFC | BIT_APP_UPCHG;
}
static void ixgbe_dcbnl_set_pg_bwg_cfg_tx(struct net_device *netdev, int bwg_id,
@@ -206,10 +202,6 @@ static void ixgbe_dcbnl_set_pg_tc_cfg_rx(struct net_device *netdev, int tc,
{
struct ixgbe_adapter *adapter = netdev_priv(netdev);
- /* Abort bad configurations */
- if (ffs(up_map) > adapter->dcb_cfg.num_tcs.pg_tcs)
- return;
-
if (prio != DCB_ATTR_VALUE_UNDEFINED)
adapter->temp_dcb_cfg.tc_config[tc].path[1].prio_type = prio;
if (bwg_id != DCB_ATTR_VALUE_UNDEFINED)
@@ -434,7 +426,12 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
adapter->hw.fc.current_mode = ixgbe_fc_pfc;
#ifdef IXGBE_FCOE
- if (up && !(up & (1 << adapter->fcoe.up))) {
+ /* Reprogam FCoE hardware offloads when the traffic class
+ * FCoE is using changes. This happens if the APP info
+ * changes or the up2tc mapping is updated.
+ */
+ if ((up && !(up & (1 << adapter->fcoe.up))) ||
+ (adapter->dcb_set_bitmap & BIT_APP_UPCHG)) {
adapter->fcoe.up = ffs(up) - 1;
ixgbe_dcbnl_devreset(netdev);
ret = DCB_HW_CHG_RST;
@@ -742,7 +739,9 @@ static u8 ixgbe_dcbnl_setdcbx(struct net_device *dev, u8 mode)
ixgbe_dcbnl_ieee_setets(dev, &ets);
ixgbe_dcbnl_ieee_setpfc(dev, &pfc);
} else if (mode & DCB_CAP_DCBX_VER_CEE) {
- adapter->dcb_set_bitmap |= (BIT_PFC & BIT_PG_TX & BIT_PG_RX);
+ u8 mask = BIT_PFC | BIT_PG_TX | BIT_PG_RX | BIT_APP_UPCHG;
+
+ adapter->dcb_set_bitmap |= mask;
ixgbe_dcbnl_set_all(dev);
} else {
/* Drop into single TC mode strict priority as this
--
1.7.6.4
^ permalink raw reply related
* Re: [net-next 1/6] e1000e: Avoid wrong check on TX hang
From: Jeff Kirsher @ 2011-12-05 8:24 UTC (permalink / raw)
To: Michael Wang
Cc: Flavio Leitner, David Miller, netdev@vger.kernel.org,
gospo@redhat.com, sassmann@redhat.com
In-Reply-To: <4EDC7E66.8070404@linux.vnet.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 4322 bytes --]
On Mon, 2011-12-05 at 00:18 -0800, Michael Wang wrote:
> On 12/05/2011 04:02 PM, Jeff Kirsher wrote:
>
> > On Sun, 2011-12-04 at 23:15 -0800, Michael Wang wrote:
> >> On 12/05/2011 02:25 PM, Jeff Kirsher wrote:
> >>
> >>> On Sun, 2011-12-04 at 17:05 -0800, Michael Wang wrote:
> >>>> On 12/04/2011 03:28 PM, Jeff Kirsher wrote:
> >>>>
> >>>>> On Sat, 2011-12-03 at 19:26 -0800, David Miller wrote:
> >>>>>> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> >>>>>> Date: Sat, 3 Dec 2011 03:44:26 -0800
> >>>>>>
> >>>>>>> + if ((!adapter->tx_hang_recheck) &&
> >>>>>>
> >>>>>> Excessive parenthesis, please remove.
> >>>>>>
> >>>>>>> + adapter->tx_hang_recheck = 1;
> >>>>>>
> >>>>>> This variable is a bool, set it to true or false.
> >>>>>>
> >>>>>>> + adapter->tx_hang_recheck = 0;
> >>>>>>
> >>>>>> Likewise.
> >>>>>>
> >>>>>>> + adapter->tx_hang_recheck = 0;
> >>>>>>
> >>>>>> Likewise.
> >>>>>
> >>>>> Michael/Flavio -
> >>>>>
> >>>>> To expedite this patch, I can make the changes that Dave is requesting
> >>>>> and re-submit v2 of the patch, if that is ok with you.
> >>>>>
> >>>>
> >>>> Hi, Jeff
> >>>>
> >>>> That's ok for me, I think it's good if you can work with Dave and make
> >>>> out a final version for us, if you want my help, please mail me at any
> >>>> time, I'm glad to work with you.
> >>>>
> >>>> Flavio:
> >>>> What's your opinion?
> >>>>
> >>>> Thanks,
> >>>> Michael Wang
> >>>
> >>> I have the patch read to push, so I will go ahead an push v2 out
> >>> tonight. Since I am making changes to your patch, I will be removing
> >>> your signed-off-by (and Flavio's) and keep you as a CC: so that you can
> >>> verify the changes I have made to resolve the issues that Dave saw.
> >>>
> >>
> >> Hi, Jeff
> >>
> >> Is that means you have a better patch which different from ours, and you
> >> will use your patch to instead of ours?
> >>
> >> Because David is just ask for some small change, I think your time zone
> >> may be better to work with him, so I ask for your help.
> >>
> >> I was just confused that why our signed-off-by should be removed?
> >>
> >> Thanks,
> >> Michael Wang
> >>
> >>> Cheers,
> >>> Jeff
> >
> > It is your patch (your original work) but since I have made changes to
> > your patch, I (or anyone for that matter) should not assume that you as
> > the owner would signed off on the changes that I have made based on
> > feedback. It would not be right for me to send out a patch with your
> > signed-off-by which is different from what you originally submitted,
> > without your ok. Once I send out the v2 of the patch, please feel free
> > to add your signed-off-by OR acked-by to the patch.
> >
>
> Hi, Jeff
>
> That make sense, I'm sorry but because I'm new to the community, and I
> just want to make every thing clear so I can do better in the future.
No problem, just trying to help get your work/fix upstream.
>
> > While I personally do not have a problem keeping you as the owner and
> > your signed-off-by, I believe that takes in several assumptions which
> > only you as the owner should speak for. I am not trying to take
> > ownership for stats purposes, I care less about the number of patches I
> > create and own and would rather make sure that the original owners get
> > the credit due for the work they did.
> >
>
>
> I'm so sorry and I regret if I make you unhappy by some wrong word,
> please forgive me.
Not at all, you have not made me unhappy, so no need to apologize. I am
just sorry if my email came across frustrated or unhappy.
>
> > So with that, when I send out my next series of patches please feel free
> > to ACK or Sign-off on the changes made. I just wanted to make sure that
> > we get these changes in soon (with out delay).
> >
> > I can wait if you want to keep ownership of the patch, I just wanted to
> > ensure that we get your patch included as soon as possible based on the
> > problem it fixes.
>
> Please help us to make the patch perfect, and I'm very glad if I can
> have the opportunity to work with you.
I am always here to help and welcome any submissions you want to provide
to make our Intel drivers better. Thank you!
>
> Thanks & Best regards
> Michael Wang
>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [PATCH -next 0/4] netfilter reverse path filter matches
From: Florian Westphal @ 2011-12-05 8:33 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: Florian Westphal, netfilter-devel, netdev, laforge
In-Reply-To: <20111204215150.GA28125@1984>
Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> On Wed, Nov 09, 2011 at 11:19:44PM +0100, Florian Westphal wrote:
> > Userspace part is stored in my iptables repository on
> > http://git.breakpoint.cc/cgi-bin/gitweb.cgi?p=fw/iptables.git (branch 'xt_rpfilter_9').
>
> I have taken this into iptables, now it is available in the rpfilter
> branch.
Thanks Pablo.
> One inquiry, I need to know copyright / license details for this
> extensions/libxt_rpfilter.c
>
[..]
> No need to resend the patch, I can ammend the patch with the copyright
> / licensing header.
>
> See extensions/libxt_cluster.c for reference.
In this case, please amend it to include the same GPL-2 boilerplate
as libxt_cluster.c has.
Thanks,
Florian
^ permalink raw reply
* Re: [net-next 1/6] e1000e: Avoid wrong check on TX hang
From: Michael Wang @ 2011-12-05 8:37 UTC (permalink / raw)
To: Jeff Kirsher; +Cc: davem, netdev, gospo, sassmann, Flavio Leitner
In-Reply-To: <1323073241-21144-2-git-send-email-jeffrey.t.kirsher@intel.com>
Hi, Jeff
Please reserve "From: Michael Wang <wangyun@linux.vnet.ibm.com>" in content.
And because Flavio not respond these days, I add his name for him.
Thanks,
Michael Wang
On 12/05/2011 04:20 PM, Jeff Kirsher wrote:
> Based on the original patch submitted my Michael Wang
> <wangyun@linux.vnet.ibm.com>.
From: Michael Wang <wangyun@linux.vnet.ibm.com>
> Descriptors may not be write-back while checking TX hang with flag
> FLAG2_DMA_BURST on.
> So when we detect hang, we just flush the descriptor and detect
> again for once.
>
> -v2 change 1 to true and 0 to false and remove extra ()
>
> CC: Michael Wang <wangyun@linux.vnet.ibm.com>
> CC: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
Signed-off-by: Flavio Leitner <fbl@redhat.com>
> Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Tested-by: Aaron Brown <aaron.f.brown@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> ---
> drivers/net/ethernet/intel/e1000e/e1000.h | 1 +
> drivers/net/ethernet/intel/e1000e/netdev.c | 23 ++++++++++++++++++++---
> 2 files changed, 21 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h
> index 9fe18d1..f478a22 100644
> --- a/drivers/net/ethernet/intel/e1000e/e1000.h
> +++ b/drivers/net/ethernet/intel/e1000e/e1000.h
> @@ -309,6 +309,7 @@ struct e1000_adapter {
> u32 txd_cmd;
>
> bool detect_tx_hung;
> + bool tx_hang_recheck;
> u8 tx_timeout_factor;
>
> u32 tx_int_delay;
> diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
> index c6e9763..c12df69 100644
> --- a/drivers/net/ethernet/intel/e1000e/netdev.c
> +++ b/drivers/net/ethernet/intel/e1000e/netdev.c
> @@ -1014,6 +1014,7 @@ static void e1000_print_hw_hang(struct work_struct *work)
> struct e1000_adapter *adapter = container_of(work,
> struct e1000_adapter,
> print_hang_task);
> + struct net_device *netdev = adapter->netdev;
> struct e1000_ring *tx_ring = adapter->tx_ring;
> unsigned int i = tx_ring->next_to_clean;
> unsigned int eop = tx_ring->buffer_info[i].next_to_watch;
> @@ -1025,6 +1026,21 @@ static void e1000_print_hw_hang(struct work_struct *work)
> if (test_bit(__E1000_DOWN, &adapter->state))
> return;
>
> + if (!adapter->tx_hang_recheck &&
> + (adapter->flags2 & FLAG2_DMA_BURST)) {
> + /* May be block on write-back, flush and detect again
> + * flush pending descriptor writebacks to memory
> + */
> + ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD);
> + /* execute the writes immediately */
> + e1e_flush();
> + adapter->tx_hang_recheck = true;
> + return;
> + }
> + /* Real hang detected */
> + adapter->tx_hang_recheck = false;
> + netif_stop_queue(netdev);
> +
> e1e_rphy(hw, PHY_STATUS, &phy_status);
> e1e_rphy(hw, PHY_1000T_STATUS, &phy_1000t_status);
> e1e_rphy(hw, PHY_EXT_STATUS, &phy_ext_status);
> @@ -1145,10 +1161,10 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
> if (tx_ring->buffer_info[i].time_stamp &&
> time_after(jiffies, tx_ring->buffer_info[i].time_stamp
> + (adapter->tx_timeout_factor * HZ)) &&
> - !(er32(STATUS) & E1000_STATUS_TXOFF)) {
> + !(er32(STATUS) & E1000_STATUS_TXOFF))
> schedule_work(&adapter->print_hang_task);
> - netif_stop_queue(netdev);
> - }
> + else
> + adapter->tx_hang_recheck = false;
> }
> adapter->total_tx_bytes += total_tx_bytes;
> adapter->total_tx_packets += total_tx_packets;
> @@ -3838,6 +3854,7 @@ static int e1000_open(struct net_device *netdev)
>
> e1000_irq_enable(adapter);
>
> + adapter->tx_hang_recheck = false;
> netif_start_queue(netdev);
>
> adapter->idle_check = true;
^ permalink raw reply
* [net-next RFC PATCH 0/5] Series short description
From: Jason Wang @ 2011-12-05 8:58 UTC (permalink / raw)
To: krkumar2, kvm, mst, netdev, rusty, virtualization, levinsasha928,
bhutchings
multiple queue virtio-net: flow steering through host/guest cooperation
Hello all:
This is a rough series adds the guest/host cooperation of flow
steering support based on Krish Kumar's multiple queue virtio-net
driver patch 3/3 (http://lwn.net/Articles/467283/).
This idea is simple, the backend pass the rxhash to the guest and
guest would tell the backend the hash to queue mapping when necessary
then backend can choose the queue based on the hash value of the
packet. The table is just a page shared bettwen userspace and the
backend.
Patch 1 enable the ability to pass the rxhash through vnet_hdr to
guest.
Patch 2,3 implement a very simple flow director for tap and
mavtap. tap part is based on the multiqueue tap patches posted by me
(http://lwn.net/Articles/459270/).
Patch 4 implement a method for virtio device to find the irq of a
specific virtqueue, in order to do device specific interrupt
optimization
Patch 5 is the part of the guest driver that using accelerate rfs to
program the flow director and with some optimizations on irq affinity
and tx queue selection.
This is just a prototype that demonstrates the idea, there are still
things need to be discussed:
- An alternative idea instead of shared page is ctrl vq, the reason
that a shared table is preferable is the delay of ctrl vq itself.
- Optimization on irq affinity and tx queue selection
Comments are welcomed, thanks!
---
Jason Wang (5):
virtio_net: passing rxhash through vnet_hdr
tuntap: simple flow director support
macvtap: flow director support
virtio: introduce a method to get the irq of a specific virtqueue
virtio-net: flow director support
drivers/lguest/lguest_device.c | 8 ++
drivers/net/macvlan.c | 4 +
drivers/net/macvtap.c | 42 ++++++++-
drivers/net/tun.c | 105 ++++++++++++++++------
drivers/net/virtio_net.c | 189 +++++++++++++++++++++++++++++++++++++++-
drivers/s390/kvm/kvm_virtio.c | 6 +
drivers/vhost/net.c | 10 +-
drivers/vhost/vhost.h | 5 +
drivers/virtio/virtio_mmio.c | 8 ++
drivers/virtio/virtio_pci.c | 12 +++
include/linux/if_macvlan.h | 1
include/linux/if_tun.h | 11 ++
include/linux/virtio_config.h | 4 +
include/linux/virtio_net.h | 16 +++
14 files changed, 377 insertions(+), 44 deletions(-)
--
Signature
^ permalink raw reply
* [net-next RFC PATCH 1/5] virtio_net: passing rxhash through vnet_hdr
From: Jason Wang @ 2011-12-05 8:58 UTC (permalink / raw)
To: krkumar2, kvm, mst, netdev, rusty, virtualization, levinsasha928,
bhutchings
In-Reply-To: <20111205085603.6116.65101.stgit@dhcp-8-146.nay.redhat.com>
This patch enables the ability to pass the rxhash value to guest
through vnet_hdr. This is useful for guest when it wants to cooperate
with virtual device to steer a flow to dedicated guest cpu.
This feature is negotiated through VIRTIO_NET_F_GUEST_RXHASH.
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
drivers/net/macvtap.c | 10 ++++++----
drivers/net/tun.c | 44 +++++++++++++++++++++++++-------------------
drivers/net/virtio_net.c | 26 ++++++++++++++++++++++----
drivers/vhost/net.c | 10 +++++++---
drivers/vhost/vhost.h | 5 +++--
include/linux/if_tun.h | 1 +
include/linux/virtio_net.h | 10 +++++++++-
7 files changed, 73 insertions(+), 33 deletions(-)
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 7c88d13..504c745 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -760,16 +760,17 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q,
int vnet_hdr_len = 0;
if (q->flags & IFF_VNET_HDR) {
- struct virtio_net_hdr vnet_hdr;
+ struct virtio_net_hdr_rxhash vnet_hdr;
vnet_hdr_len = q->vnet_hdr_sz;
if ((len -= vnet_hdr_len) < 0)
return -EINVAL;
- ret = macvtap_skb_to_vnet_hdr(skb, &vnet_hdr);
+ ret = macvtap_skb_to_vnet_hdr(skb, &vnet_hdr.hdr.hdr);
if (ret)
return ret;
- if (memcpy_toiovecend(iv, (void *)&vnet_hdr, 0, sizeof(vnet_hdr)))
+ vnet_hdr.rxhash = skb->rxhash;
+ if (memcpy_toiovecend(iv, (void *)&vnet_hdr, 0, q->vnet_hdr_sz))
return -EFAULT;
}
@@ -890,7 +891,8 @@ static long macvtap_ioctl(struct file *file, unsigned int cmd,
return ret;
case TUNGETFEATURES:
- if (put_user(IFF_TAP | IFF_NO_PI | IFF_VNET_HDR, up))
+ if (put_user(IFF_TAP | IFF_NO_PI | IFF_VNET_HDR | IFF_RXHASH,
+ up))
return -EFAULT;
return 0;
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index afb11d1..7d22b4b 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -869,49 +869,55 @@ static ssize_t tun_put_user(struct tun_file *tfile,
}
if (tfile->flags & TUN_VNET_HDR) {
- struct virtio_net_hdr gso = { 0 }; /* no info leak */
- if ((len -= tfile->vnet_hdr_sz) < 0)
+ struct virtio_net_hdr_rxhash hdr;
+ struct virtio_net_hdr *gso = (struct virtio_net_hdr *)&hdr;
+
+ if ((len -= tfile->vnet_hdr_sz) < 0 ||
+ tfile->vnet_hdr_sz > sizeof(struct virtio_net_hdr_rxhash))
return -EINVAL;
+ memset(&hdr, 0, sizeof(hdr));
if (skb_is_gso(skb)) {
struct skb_shared_info *sinfo = skb_shinfo(skb);
/* This is a hint as to how much should be linear. */
- gso.hdr_len = skb_headlen(skb);
- gso.gso_size = sinfo->gso_size;
+ gso->hdr_len = skb_headlen(skb);
+ gso->gso_size = sinfo->gso_size;
if (sinfo->gso_type & SKB_GSO_TCPV4)
- gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV4;
+ gso->gso_type = VIRTIO_NET_HDR_GSO_TCPV4;
else if (sinfo->gso_type & SKB_GSO_TCPV6)
- gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV6;
+ gso->gso_type = VIRTIO_NET_HDR_GSO_TCPV6;
else if (sinfo->gso_type & SKB_GSO_UDP)
- gso.gso_type = VIRTIO_NET_HDR_GSO_UDP;
+ gso->gso_type = VIRTIO_NET_HDR_GSO_UDP;
else {
pr_err("unexpected GSO type: "
"0x%x, gso_size %d, hdr_len %d\n",
- sinfo->gso_type, gso.gso_size,
- gso.hdr_len);
+ sinfo->gso_type, gso->gso_size,
+ gso->hdr_len);
print_hex_dump(KERN_ERR, "tun: ",
DUMP_PREFIX_NONE,
16, 1, skb->head,
- min((int)gso.hdr_len, 64), true);
+ min((int)gso->hdr_len, 64),
+ true);
WARN_ON_ONCE(1);
return -EINVAL;
}
if (sinfo->gso_type & SKB_GSO_TCP_ECN)
- gso.gso_type |= VIRTIO_NET_HDR_GSO_ECN;
+ gso->gso_type |= VIRTIO_NET_HDR_GSO_ECN;
} else
- gso.gso_type = VIRTIO_NET_HDR_GSO_NONE;
+ gso->gso_type = VIRTIO_NET_HDR_GSO_NONE;
if (skb->ip_summed == CHECKSUM_PARTIAL) {
- gso.flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
- gso.csum_start = skb_checksum_start_offset(skb);
- gso.csum_offset = skb->csum_offset;
+ gso->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
+ gso->csum_start = skb_checksum_start_offset(skb);
+ gso->csum_offset = skb->csum_offset;
} else if (skb->ip_summed == CHECKSUM_UNNECESSARY) {
- gso.flags = VIRTIO_NET_HDR_F_DATA_VALID;
+ gso->flags = VIRTIO_NET_HDR_F_DATA_VALID;
} /* else everything is zero */
- if (unlikely(memcpy_toiovecend(iv, (void *)&gso, total,
- sizeof(gso))))
+ hdr.rxhash = skb_get_rxhash(skb);
+ if (unlikely(memcpy_toiovecend(iv, (void *)&hdr, total,
+ tfile->vnet_hdr_sz)))
return -EFAULT;
total += tfile->vnet_hdr_sz;
}
@@ -1358,7 +1364,7 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
* This is needed because we never checked for invalid flags on
* TUNSETIFF. */
return put_user(IFF_TUN | IFF_TAP | IFF_NO_PI | IFF_ONE_QUEUE |
- IFF_VNET_HDR | IFF_MULTI_QUEUE,
+ IFF_VNET_HDR | IFF_MULTI_QUEUE | IFF_RXHASH,
(unsigned int __user*)argp);
}
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 157ee63..0d871f8 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -107,12 +107,16 @@ struct virtnet_info {
/* Host will merge rx buffers for big packets (shake it! shake it!) */
bool mergeable_rx_bufs;
+
+ /* Host will pass rxhash to us. */
+ bool has_rxhash;
};
struct skb_vnet_hdr {
union {
struct virtio_net_hdr hdr;
struct virtio_net_hdr_mrg_rxbuf mhdr;
+ struct virtio_net_hdr_rxhash rhdr;
};
unsigned int num_sg;
};
@@ -205,7 +209,10 @@ static struct sk_buff *page_to_skb(struct receive_queue *rq,
hdr = skb_vnet_hdr(skb);
if (vi->mergeable_rx_bufs) {
- hdr_len = sizeof hdr->mhdr;
+ if (vi->has_rxhash)
+ hdr_len = sizeof hdr->rhdr;
+ else
+ hdr_len = sizeof hdr->mhdr;
offset = hdr_len;
} else {
hdr_len = sizeof hdr->hdr;
@@ -376,6 +383,9 @@ static void receive_buf(struct receive_queue *rq, void *buf, unsigned int len)
skb_shinfo(skb)->gso_segs = 0;
}
+ if (vi->has_rxhash)
+ skb->rxhash = hdr->rhdr.rxhash;
+
netif_receive_skb(skb);
return;
@@ -645,9 +655,12 @@ static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb,
hdr->mhdr.num_buffers = 0;
/* Encode metadata header at front. */
- if (vi->mergeable_rx_bufs)
- sg_set_buf(sg, &hdr->mhdr, sizeof hdr->mhdr);
- else
+ if (vi->mergeable_rx_bufs) {
+ if (vi->has_rxhash)
+ sg_set_buf(sg, &hdr->rhdr, sizeof hdr->rhdr);
+ else
+ sg_set_buf(sg, &hdr->mhdr, sizeof hdr->mhdr);
+ } else
sg_set_buf(sg, &hdr->hdr, sizeof hdr->hdr);
hdr->num_sg = skb_to_sgvec(skb, sg + 1, 0, skb->len) + 1;
@@ -1338,8 +1351,12 @@ static int virtnet_probe(struct virtio_device *vdev)
if (virtio_has_feature(vdev, VIRTIO_NET_F_MRG_RXBUF))
vi->mergeable_rx_bufs = true;
+ if (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_RXHASH))
+ vi->has_rxhash = true;
+
/* Allocate/initialize the rx/tx queues, and invoke find_vqs */
err = virtnet_setup_vqs(vi);
+
if (err)
goto free_netdev;
@@ -1436,6 +1453,7 @@ static unsigned int features[] = {
VIRTIO_NET_F_GUEST_ECN, VIRTIO_NET_F_GUEST_UFO,
VIRTIO_NET_F_MRG_RXBUF, VIRTIO_NET_F_STATUS, VIRTIO_NET_F_CTRL_VQ,
VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, VIRTIO_NET_F_MULTIQUEUE,
+ VIRTIO_NET_F_GUEST_RXHASH,
};
static struct virtio_driver virtio_net_driver = {
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 882a51f..b2d6548 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -768,9 +768,13 @@ static int vhost_net_set_features(struct vhost_net *n, u64 features)
size_t vhost_hlen, sock_hlen, hdr_len;
int i;
- hdr_len = (features & (1 << VIRTIO_NET_F_MRG_RXBUF)) ?
- sizeof(struct virtio_net_hdr_mrg_rxbuf) :
- sizeof(struct virtio_net_hdr);
+ if (features & (1 << VIRTIO_NET_F_MRG_RXBUF))
+ hdr_len = (features & (1 << VIRTIO_NET_F_GUEST_RXHASH)) ?
+ sizeof(struct virtio_net_hdr_rxhash) :
+ sizeof(struct virtio_net_hdr_mrg_rxbuf);
+ else
+ hdr_len = sizeof(struct virtio_net_hdr);
+
if (features & (1 << VHOST_NET_F_VIRTIO_NET_HDR)) {
/* vhost provides vnet_hdr */
vhost_hlen = hdr_len;
diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h
index a801e28..4ad2d5f 100644
--- a/drivers/vhost/vhost.h
+++ b/drivers/vhost/vhost.h
@@ -115,7 +115,7 @@ struct vhost_virtqueue {
/* hdr is used to store the virtio header.
* Since each iovec has >= 1 byte length, we never need more than
* header length entries to store the header. */
- struct iovec hdr[sizeof(struct virtio_net_hdr_mrg_rxbuf)];
+ struct iovec hdr[sizeof(struct virtio_net_hdr_rxhash)];
struct iovec *indirect;
size_t vhost_hlen;
size_t sock_hlen;
@@ -203,7 +203,8 @@ enum {
(1ULL << VIRTIO_RING_F_EVENT_IDX) |
(1ULL << VHOST_F_LOG_ALL) |
(1ULL << VHOST_NET_F_VIRTIO_NET_HDR) |
- (1ULL << VIRTIO_NET_F_MRG_RXBUF),
+ (1ULL << VIRTIO_NET_F_MRG_RXBUF) |
+ (1ULL << VIRTIO_NET_F_GUEST_RXHASH) ,
};
static inline int vhost_has_feature(struct vhost_dev *dev, int bit)
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h
index d3f24d8..a1f6f3f 100644
--- a/include/linux/if_tun.h
+++ b/include/linux/if_tun.h
@@ -66,6 +66,7 @@
#define IFF_VNET_HDR 0x4000
#define IFF_TUN_EXCL 0x8000
#define IFF_MULTI_QUEUE 0x0100
+#define IFF_RXHASH 0x0200
/* Features for GSO (TUNSETOFFLOAD). */
#define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
index c92b83f..2291317 100644
--- a/include/linux/virtio_net.h
+++ b/include/linux/virtio_net.h
@@ -50,6 +50,7 @@
#define VIRTIO_NET_F_CTRL_VLAN 19 /* Control channel VLAN filtering */
#define VIRTIO_NET_F_CTRL_RX_EXTRA 20 /* Extra RX mode control support */
#define VIRTIO_NET_F_MULTIQUEUE 21 /* Device supports multiple TXQ/RXQ */
+#define VIRTIO_NET_F_GUEST_RXHASH 22 /* Guest can receive rxhash */
#define VIRTIO_NET_S_LINK_UP 1 /* Link is up */
@@ -63,7 +64,7 @@ struct virtio_net_config {
} __attribute__((packed));
/* This is the first element of the scatter-gather list. If you don't
- * specify GSO or CSUM features, you can simply ignore the header. */
+ * specify GSO, CSUM or HASH features, you can simply ignore the header. */
struct virtio_net_hdr {
#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset
#define VIRTIO_NET_HDR_F_DATA_VALID 2 // Csum is valid
@@ -87,6 +88,13 @@ struct virtio_net_hdr_mrg_rxbuf {
__u16 num_buffers; /* Number of merged rx buffers */
};
+/* This is the version of the header to use when GUEST_RXHASH
+ * feature has been negotiated. */
+struct virtio_net_hdr_rxhash {
+ struct virtio_net_hdr_mrg_rxbuf hdr;
+ __u32 rxhash;
+};
+
/*
* Control virtqueue data structures
*
^ permalink raw reply related
* [net-next RFC PATCH 2/5] tuntap: simple flow director support
From: Jason Wang @ 2011-12-05 8:58 UTC (permalink / raw)
To: krkumar2, kvm, mst, netdev, rusty, virtualization, levinsasha928,
bhutchings
In-Reply-To: <20111205085603.6116.65101.stgit@dhcp-8-146.nay.redhat.com>
This patch adds a simple flow director to tun/tap device. It is just a
page that contains the hash to queue mapping which could be changed by
user-space. The backend (tap/macvtap) would query this table to get
the desired queue of a packets when it send packets to userspace.
The page address were set through a new kind of ioctl - TUNSETFD and
were pinned until device exit or another new page were specified.
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
drivers/net/tun.c | 63 ++++++++++++++++++++++++++++++++++++++++--------
include/linux/if_tun.h | 10 ++++++++
2 files changed, 62 insertions(+), 11 deletions(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 7d22b4b..2efaf81 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -64,6 +64,7 @@
#include <linux/nsproxy.h>
#include <linux/virtio_net.h>
#include <linux/rcupdate.h>
+#include <linux/highmem.h>
#include <net/net_namespace.h>
#include <net/netns/generic.h>
#include <net/rtnetlink.h>
@@ -109,6 +110,7 @@ struct tap_filter {
};
#define MAX_TAP_QUEUES (NR_CPUS < 16 ? NR_CPUS : 16)
+#define TAP_HASH_MASK 0xFF
struct tun_file {
struct sock sk;
@@ -128,6 +130,7 @@ struct tun_sock;
struct tun_struct {
struct tun_file *tfiles[MAX_TAP_QUEUES];
+ struct page *fd_page[1];
unsigned int numqueues;
unsigned int flags;
uid_t owner;
@@ -156,7 +159,7 @@ static struct tun_file *tun_get_queue(struct net_device *dev,
struct tun_struct *tun = netdev_priv(dev);
struct tun_file *tfile = NULL;
int numqueues = tun->numqueues;
- __u32 rxq;
+ __u32 rxq, rxhash;
BUG_ON(!rcu_read_lock_held());
@@ -168,6 +171,22 @@ static struct tun_file *tun_get_queue(struct net_device *dev,
goto out;
}
+ rxhash = skb_get_rxhash(skb);
+ if (rxhash) {
+ if (tun->fd_page[0]) {
+ u16 *table = kmap_atomic(tun->fd_page[0]);
+ rxq = table[rxhash & TAP_HASH_MASK];
+ kunmap_atomic(table);
+ if (rxq < numqueues) {
+ tfile = rcu_dereference(tun->tfiles[rxq]);
+ goto out;
+ }
+ }
+ rxq = ((u64)rxhash * numqueues) >> 32;
+ tfile = rcu_dereference(tun->tfiles[rxq]);
+ goto out;
+ }
+
if (likely(skb_rx_queue_recorded(skb))) {
rxq = skb_get_rx_queue(skb);
@@ -178,14 +197,6 @@ static struct tun_file *tun_get_queue(struct net_device *dev,
goto out;
}
- /* Check if we can use flow to select a queue */
- rxq = skb_get_rxhash(skb);
- if (rxq) {
- u32 idx = ((u64)rxq * numqueues) >> 32;
- tfile = rcu_dereference(tun->tfiles[idx]);
- goto out;
- }
-
tfile = rcu_dereference(tun->tfiles[0]);
out:
return tfile;
@@ -1020,6 +1031,14 @@ out:
return ret;
}
+static void tun_destructor(struct net_device *dev)
+{
+ struct tun_struct *tun = netdev_priv(dev);
+ if (tun->fd_page[0])
+ put_page(tun->fd_page[0]);
+ free_netdev(dev);
+}
+
static void tun_setup(struct net_device *dev)
{
struct tun_struct *tun = netdev_priv(dev);
@@ -1028,7 +1047,7 @@ static void tun_setup(struct net_device *dev)
tun->group = -1;
dev->ethtool_ops = &tun_ethtool_ops;
- dev->destructor = free_netdev;
+ dev->destructor = tun_destructor;
}
/* Trivial set of netlink ops to allow deleting tun or tap
@@ -1230,6 +1249,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
tun = netdev_priv(dev);
tun->dev = dev;
tun->flags = flags;
+ tun->fd_page[0] = NULL;
security_tun_dev_post_create(&tfile->sk);
@@ -1353,6 +1373,7 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
struct net_device *dev = NULL;
void __user* argp = (void __user*)arg;
struct ifreq ifr;
+ struct tun_fd tfd;
int ret;
if (cmd == TUNSETIFF || cmd == TUNATTACHQUEUE || _IOC_TYPE(cmd) == 0x89)
@@ -1364,7 +1385,8 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
* This is needed because we never checked for invalid flags on
* TUNSETIFF. */
return put_user(IFF_TUN | IFF_TAP | IFF_NO_PI | IFF_ONE_QUEUE |
- IFF_VNET_HDR | IFF_MULTI_QUEUE | IFF_RXHASH,
+ IFF_VNET_HDR | IFF_MULTI_QUEUE | IFF_RXHASH |
+ IFF_FD,
(unsigned int __user*)argp);
}
@@ -1476,6 +1498,25 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
ret = set_offload(tun, arg);
break;
+ case TUNSETFD:
+ if (copy_from_user(&tfd, argp, sizeof(tfd)))
+ ret = -EFAULT;
+ else {
+ if (tun->fd_page[0]) {
+ put_page(tun->fd_page[0]);
+ tun->fd_page[0] = NULL;
+ }
+
+ /* put_page() in tun_destructor() */
+ if (get_user_pages_fast(tfd.addr, 1, 0,
+ &tun->fd_page[0]) != 1)
+ ret = -EFAULT;
+ else
+ ret = 0;
+ }
+
+ break;
+
case SIOCGIFHWADDR:
/* Get hw address */
memcpy(ifr.ifr_hwaddr.sa_data, tun->dev->dev_addr, ETH_ALEN);
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h
index a1f6f3f..726731d 100644
--- a/include/linux/if_tun.h
+++ b/include/linux/if_tun.h
@@ -36,6 +36,8 @@
#define TUN_VNET_HDR 0x0200
#define TUN_TAP_MQ 0x0400
+struct tun_fd;
+
/* Ioctl defines */
#define TUNSETNOCSUM _IOW('T', 200, int)
#define TUNSETDEBUG _IOW('T', 201, int)
@@ -56,6 +58,7 @@
#define TUNSETVNETHDRSZ _IOW('T', 216, int)
#define TUNATTACHQUEUE _IOW('T', 217, int)
#define TUNDETACHQUEUE _IOW('T', 218, int)
+#define TUNSETFD _IOW('T', 219, struct tun_fd)
/* TUNSETIFF ifr flags */
@@ -67,6 +70,7 @@
#define IFF_TUN_EXCL 0x8000
#define IFF_MULTI_QUEUE 0x0100
#define IFF_RXHASH 0x0200
+#define IFF_FD 0x0400
/* Features for GSO (TUNSETOFFLOAD). */
#define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */
@@ -97,6 +101,12 @@ struct tun_filter {
__u8 addr[0][ETH_ALEN];
};
+/* Programmable flow director */
+struct tun_fd {
+ unsigned long addr;
+ size_t size;
+};
+
#ifdef __KERNEL__
#if defined(CONFIG_TUN) || defined(CONFIG_TUN_MODULE)
struct socket *tun_get_socket(struct file *);
^ permalink raw reply related
* [net-next RFC PATCH 3/5] macvtap: flow director support
From: Jason Wang @ 2011-12-05 8:59 UTC (permalink / raw)
To: krkumar2, kvm, mst, netdev, rusty, virtualization, levinsasha928,
bhutchings
In-Reply-To: <20111205085603.6116.65101.stgit@dhcp-8-146.nay.redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
drivers/net/macvlan.c | 4 ++++
drivers/net/macvtap.c | 36 ++++++++++++++++++++++++++++++++++--
include/linux/if_macvlan.h | 1 +
3 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 7413497..b0cb7ce 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -706,6 +706,7 @@ int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
vlan->port = port;
vlan->receive = receive;
vlan->forward = forward;
+ vlan->fd_page[0] = NULL;
vlan->mode = MACVLAN_MODE_VEPA;
if (data && data[IFLA_MACVLAN_MODE])
@@ -749,6 +750,9 @@ void macvlan_dellink(struct net_device *dev, struct list_head *head)
{
struct macvlan_dev *vlan = netdev_priv(dev);
+ if (vlan->fd_page[0])
+ put_page(vlan->fd_page[0]);
+
list_del(&vlan->list);
unregister_netdevice_queue(dev, head);
}
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 504c745..a34eb84 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -14,6 +14,7 @@
#include <linux/wait.h>
#include <linux/cdev.h>
#include <linux/fs.h>
+#include <linux/highmem.h>
#include <net/net_namespace.h>
#include <net/rtnetlink.h>
@@ -62,6 +63,8 @@ static DEFINE_IDR(minor_idr);
static struct class *macvtap_class;
static struct cdev macvtap_cdev;
+#define TAP_HASH_MASK 0xFF
+
static const struct proto_ops macvtap_socket_ops;
/*
@@ -189,6 +192,11 @@ static struct macvtap_queue *macvtap_get_queue(struct net_device *dev,
/* Check if we can use flow to select a queue */
rxq = skb_get_rxhash(skb);
if (rxq) {
+ if (vlan->fd_page[0]) {
+ u16 *table = kmap_atomic(vlan->fd_page[0]);
+ rxq = table[rxq & TAP_HASH_MASK];
+ kunmap_atomic(table);
+ }
tap = rcu_dereference(vlan->taps[rxq % numvtaps]);
if (tap)
goto out;
@@ -851,6 +859,7 @@ static long macvtap_ioctl(struct file *file, unsigned int cmd,
{
struct macvtap_queue *q = file->private_data;
struct macvlan_dev *vlan;
+ struct tun_fd tfd;
void __user *argp = (void __user *)arg;
struct ifreq __user *ifr = argp;
unsigned int __user *up = argp;
@@ -891,8 +900,8 @@ static long macvtap_ioctl(struct file *file, unsigned int cmd,
return ret;
case TUNGETFEATURES:
- if (put_user(IFF_TAP | IFF_NO_PI | IFF_VNET_HDR | IFF_RXHASH,
- up))
+ if (put_user(IFF_TAP | IFF_NO_PI | IFF_VNET_HDR | IFF_RXHASH |
+ IFF_FD, up))
return -EFAULT;
return 0;
@@ -918,6 +927,29 @@ static long macvtap_ioctl(struct file *file, unsigned int cmd,
q->vnet_hdr_sz = s;
return 0;
+ case TUNSETFD:
+ rcu_read_lock_bh();
+ vlan = rcu_dereference(q->vlan);
+ if (!vlan)
+ ret = -ENOLINK;
+ else {
+ if (copy_from_user(&tfd, argp, sizeof(tfd)))
+ ret = -EFAULT;
+ if (vlan->fd_page[0]) {
+ put_page(vlan->fd_page[0]);
+ vlan->fd_page[0] = NULL;
+ }
+
+ /* put_page() in macvlan_dellink() */
+ if (get_user_pages_fast(tfd.addr, 1, 0,
+ &vlan->fd_page[0]) != 1)
+ ret = -EFAULT;
+ else
+ ret = 0;
+ }
+ rcu_read_unlock_bh();
+ return ret;
+
case TUNSETOFFLOAD:
/* let the user check for future flags */
if (arg & ~(TUN_F_CSUM | TUN_F_TSO4 | TUN_F_TSO6 |
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
index d103dca..69a87a1 100644
--- a/include/linux/if_macvlan.h
+++ b/include/linux/if_macvlan.h
@@ -65,6 +65,7 @@ struct macvlan_dev {
struct macvtap_queue *taps[MAX_MACVTAP_QUEUES];
int numvtaps;
int minor;
+ struct page *fd_page[1];
};
static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox