* Re: [PATCH net-next V1 00/14] net/mlx4_en: Optimizations to TX flow
From: Eric Dumazet @ 2014-10-06 12:51 UTC (permalink / raw)
To: Amir Vadai
Cc: David S. Miller, Eric Dumazet, netdev, Yevgeny Petrilin,
Or Gerlitz, Ido Shamay
In-Reply-To: <1412576163-7224-1-git-send-email-amirv@mellanox.com>
On Mon, 2014-10-06 at 09:15 +0300, Amir Vadai wrote:
> Changes from V0:
> - Patch 14/14 ("Use the new tx_copybreak to set inline threshold"):
> - Use same coding convention as currently is in en_ethtool.c
> - Patch 1/14 ("Code cleanups in tx path") and Patch 9/14 ("Use local var in
> tx flow for skb_shinfo(skb)"):
> - local var shinfo was used by mistake in Patch 1/14 while declared at 9/14.
> Fixed it for the sake of future bisections
Hmm... patches were already merged. I am afraid you need to provide one
patch on top of current net-next, if still needed. Too bad for the
bisection.
Thanks !
^ permalink raw reply
* Re: [PATCH 09/16] virtio-net: drop config_mutex
From: Sergei Shtylyov @ 2014-10-06 12:31 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: netdev, linux-kernel, virtualization
In-Reply-To: <20141006122215.GA26790@redhat.com>
On 10/6/2014 4:22 PM, Michael S. Tsirkin wrote:
>>>>> config_mutex served two purposes: prevent multiple concurrent config
>>>>> change handlers, and synchronize access to config_enable flag.
>>>>> Since commit dbf2576e37da0fcc7aacbfbb9fd5d3de7888a3c1
>>>>> workqueue: make all workqueues non-reentrant
>>>>> all workqueues are non-reentrant, and config_enable
>>>>> is now gone.
>>>>> Get rid of the unnecessary lock.
>>>>> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>>>>> ---
>>>>> drivers/net/virtio_net.c | 7 +------
>>>>> 1 file changed, 1 insertion(+), 6 deletions(-)
>>>>> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
>>>>> index fa17afa..d80fef4 100644
>>>>> --- a/drivers/net/virtio_net.c
>>>>> +++ b/drivers/net/virtio_net.c
>>>> [...]
>>>>> @@ -1430,7 +1426,7 @@ static void virtnet_config_changed_work(struct work_struct *work)
>>>>> netif_tx_stop_all_queues(vi->dev);
>>>>> }
>>>>> done:
>>>>> - mutex_unlock(&vi->config_lock);
>>>>> + return;
>>>> There's no need for this *return*.
>>> I know - it's removed by the follow-up patch.
>> Yeah, I saw.
>>> It's formatted like this to make diff smaller
>>> and make review easier.
>> Don't understand how adding this line makes diff smaller though...
>> You first need to add it and then to delete it, where's the save?
>> WBR, Sergei
> If I don't add it, gcc generates a compiler warning: it does not like
> labels at the end of functions.
Ahh... nevermind then.
WBR, Sergei
^ permalink raw reply
* Re: [PATCH net-next] net: introduce netdevice gso_min_segs attribute
From: Eric Dumazet @ 2014-10-06 12:22 UTC (permalink / raw)
To: Amir Vadai
Cc: David S. Miller, Eric Dumazet, netdev, Yevgeny Petrilin,
Or Gerlitz, Ido Shamay
In-Reply-To: <1412597876.11091.59.camel@edumazet-glaptop2.roam.corp.google.com>
On Mon, 2014-10-06 at 05:17 -0700, Eric Dumazet wrote:
> On Mon, 2014-10-06 at 09:41 +0300, Amir Vadai wrote:
> > On 10/5/2014 8:11 PM, Eric Dumazet wrote:
> > > From: Eric Dumazet <edumazet@google.com>
> > >
> > > Some TSO engines might have a too heavy setup cost, that impacts
> > > performance on hosts sending small bursts (2 MSS per packet).
> > >
> > > This patch adds a device gso_min_segs, allowing drivers to set
> > > a minimum segment size for TSO packets, according to the NIC
> > > performance.
> > >
> > > Tested on a mlx4 NIC, this allows to get a ~110% increase of
> > > throughput when sending 2 MSS per packet.
> > >
> >
> > Amazing!
> >
> > Shouldn't there be a netif_set_gso_min_size() too?
>
> Good point, I'll add it in v2, thanks !
Well, no... I thought you were speaking of an hypothetical
netif_set_gso_{max|min}_segs()
But we don't have it. : Drivers simply change dev->gso_max_segs
drivers/net/ethernet/freescale/fec_main.c:3058: ndev->gso_max_segs = FEC_MAX_TSO_SEGS;
drivers/net/ethernet/marvell/mv643xx_eth.c:3120: dev->gso_max_segs = MV643XX_MAX_TSO_SEGS;
drivers/net/ethernet/marvell/mvneta.c:3057: dev->gso_max_segs = MVNETA_MAX_TSO_SEGS;
drivers/net/ethernet/sfc/efx.c:2300: net_dev->gso_max_segs = EFX_TSO_MAX_SEGS;
So my mlx4 patch was simply doing
dev->gso_min_segs = MLX4_MIN_TSO_SEGS;
^ permalink raw reply
* Re: [PATCH 09/16] virtio-net: drop config_mutex
From: Michael S. Tsirkin @ 2014-10-06 12:22 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: netdev, linux-kernel, virtualization
In-Reply-To: <54328604.30403@cogentembedded.com>
On Mon, Oct 06, 2014 at 04:07:32PM +0400, Sergei Shtylyov wrote:
> On 10/6/2014 3:56 PM, Michael S. Tsirkin wrote:
>
> >>>config_mutex served two purposes: prevent multiple concurrent config
> >>>change handlers, and synchronize access to config_enable flag.
>
> >>>Since commit dbf2576e37da0fcc7aacbfbb9fd5d3de7888a3c1
> >>> workqueue: make all workqueues non-reentrant
> >>>all workqueues are non-reentrant, and config_enable
> >>>is now gone.
>
> >>>Get rid of the unnecessary lock.
>
> >>>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> >>>---
> >>> drivers/net/virtio_net.c | 7 +------
> >>> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> >>>diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> >>>index fa17afa..d80fef4 100644
> >>>--- a/drivers/net/virtio_net.c
> >>>+++ b/drivers/net/virtio_net.c
> >>[...]
> >>>@@ -1430,7 +1426,7 @@ static void virtnet_config_changed_work(struct work_struct *work)
> >>> netif_tx_stop_all_queues(vi->dev);
> >>> }
> >>> done:
> >>>- mutex_unlock(&vi->config_lock);
> >>>+ return;
>
> >> There's no need for this *return*.
>
> >I know - it's removed by the follow-up patch.
>
> Yeah, I saw.
>
> >It's formatted like this to make diff smaller
> >and make review easier.
>
> Don't understand how adding this line makes diff smaller though...
> You first need to add it and then to delete it, where's the save?
>
> WBR, Sergei
If I don't add it, gcc generates a compiler warning: it does not like
labels at the end of functions.
So I don't want to just drop the return function: I must drop the label too.
^ permalink raw reply
* Re: [PATCH net-next] net: introduce netdevice gso_min_segs attribute
From: Eric Dumazet @ 2014-10-06 12:17 UTC (permalink / raw)
To: Amir Vadai
Cc: David S. Miller, Eric Dumazet, netdev, Yevgeny Petrilin,
Or Gerlitz, Ido Shamay
In-Reply-To: <5432399B.3060406@mellanox.com>
On Mon, 2014-10-06 at 09:41 +0300, Amir Vadai wrote:
> On 10/5/2014 8:11 PM, Eric Dumazet wrote:
> > From: Eric Dumazet <edumazet@google.com>
> >
> > Some TSO engines might have a too heavy setup cost, that impacts
> > performance on hosts sending small bursts (2 MSS per packet).
> >
> > This patch adds a device gso_min_segs, allowing drivers to set
> > a minimum segment size for TSO packets, according to the NIC
> > performance.
> >
> > Tested on a mlx4 NIC, this allows to get a ~110% increase of
> > throughput when sending 2 MSS per packet.
> >
>
> Amazing!
>
> Shouldn't there be a netif_set_gso_min_size() too?
Good point, I'll add it in v2, thanks !
^ permalink raw reply
* RE: [PATCH net-next] net: introduce netdevice gso_min_segs attribute
From: Eric Dumazet @ 2014-10-06 12:14 UTC (permalink / raw)
To: David Laight
Cc: Amir Vadai, David S. Miller, Eric Dumazet, netdev@vger.kernel.org,
Yevgeny Petrilin, Or Gerlitz, Ido Shamay
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D174AC1A3@AcuExch.aculab.com>
On Mon, 2014-10-06 at 10:20 +0000, David Laight wrote:
> From: Eric Dumazet <edumazet@google.com>
> > Some TSO engines might have a too heavy setup cost, that impacts
> > performance on hosts sending small bursts (2 MSS per packet).
> >
> > This patch adds a device gso_min_segs, allowing drivers to set
> > a minimum segment size for TSO packets, according to the NIC
> > performance.
> >
> > Tested on a mlx4 NIC, this allows to get a ~110% increase of
> > throughput when sending 2 MSS per packet.
>
> Doesn't this all depend on what you need to optimise for.
> I can think of three^Wseveral main cases:
> 1) minimising cpu use while saturating the local network.
> 2) minimising latency for single packets.
> 3) maximising throughput for a single connection.
> 4) minimising cpu use when handling a large number of connections.
> plus all the variations in packet size.
>
> I'm not sure what you are trading for what here.
>
I am not sure you really understood.
What's the point having a 40GB NIC and not being able to reach 18 Gb on
it, even if you are willing to spend all the cpu cycles you want ?
> Maybe gso = tx_bursting is almost always faster on some hardware?
> (Especially if an idle mac engine is 'kicked' for the first packet
> of a burst.)
This has nothing to do with xmit_more.
I start 1200 flows rate limited to 3 MBytes each.
(1000 netperf -t TCP_STREAM, nothing fancy here)
Theoretical total of 3.6 GBytes per second.
Without patch :
# sar -n DEV 5 5 | grep eth0
05:07:56 AM eth0 555621.60 1111203.20 35813.03 1642923.46 0.00 0.00 0.60
05:08:01 AM eth0 555591.00 1111173.80 35810.47 1642877.52 0.00 0.00 0.40
05:08:06 AM eth0 555586.20 1111162.60 35810.06 1642861.03 0.00 0.00 0.60
05:08:11 AM eth0 555624.40 1111235.40 35812.75 1642974.19 0.00 0.00 0.60
05:08:16 AM eth0 555639.60 1111266.80 35813.21 1643017.83 0.00 0.00 0.60
Average: eth0 555612.56 1111208.36 35811.90 1642930.81 0.00 0.00 0.56
With patch :
# sar -n DEV 5 5 | grep eth0
05:07:04 AM eth0 1179478.80 2358940.40 76022.47 3487725.22 0.00 0.00 0.60
05:07:09 AM eth0 1178913.60 2357807.40 75986.60 3486044.00 0.00 0.00 0.40
05:07:14 AM eth0 1178957.40 2357897.60 75988.98 3486177.50 0.00 0.00 0.60
05:07:19 AM eth0 1177556.00 2355064.60 75899.37 3481993.37 0.00 0.00 0.60
05:07:24 AM eth0 1180321.20 2360625.20 76077.15 3490209.58 0.00 0.00 0.40
Average: eth0 1179045.40 2358067.04 75994.92 3486429.94 0.00 0.00 0.52
Ask yourself which one we prefer.
About cpu costs, we hardly see anything caused by GSO,
now we optimized __copy_skb_header()
6.36% swapper [kernel.kallsyms] [k] _raw_spin_lock
5.24% netperf [kernel.kallsyms] [k] copy_user_enhanced_fast_string
5.03% swapper [kernel.kallsyms] [k] poll_idle
3.73% swapper [kernel.kallsyms] [k] tcp_ack
2.73% swapper [kernel.kallsyms] [k] memcpy
2.49% swapper [kernel.kallsyms] [k] __skb_clone
2.41% swapper [kernel.kallsyms] [k] skb_release_data
2.33% swapper [kernel.kallsyms] [k] intel_idle
2.23% swapper [kernel.kallsyms] [k] tcp_init_tso_segs
1.99% swapper [kernel.kallsyms] [k] fq_dequeue
1.94% netperf [kernel.kallsyms] [k] tcp_sendmsg
1.82% swapper [kernel.kallsyms] [k] tcp_write_xmit
1.28% swapper [kernel.kallsyms] [k] __netif_receive_skb_core
1.23% swapper [kernel.kallsyms] [k] __copy_skb_header
1.14% swapper [kernel.kallsyms] [k] kfree
1.10% swapper [kernel.kallsyms] [k] kmem_cache_free
1.06% swapper [kernel.kallsyms] [k] mlx4_en_xmit
1.05% swapper [kernel.kallsyms] [k] tcp_wfree
1.02% swapper [kernel.kallsyms] [k] inet_gso_segment
1.01% swapper [kernel.kallsyms] [k] put_compound_page
0.98% swapper [kernel.kallsyms] [k] _raw_spin_lock_irqsave
0.96% netperf [kernel.kallsyms] [k] __alloc_skb
0.92% netperf [kernel.kallsyms] [k] _raw_spin_lock
0.89% swapper [kernel.kallsyms] [k] skb_segment
0.88% swapper [kernel.kallsyms] [k] tcp_transmit_skb
0.82% swapper [kernel.kallsyms] [k] ip_queue_xmit
0.81% swapper [kernel.kallsyms] [k] __inet_lookup_established
0.76% swapper [kernel.kallsyms] [k] __kfree_skb
0.73% swapper [kernel.kallsyms] [k] ipv4_dst_check
0.66% netperf [kernel.kallsyms] [k] tcp_ack
0.60% swapper [kernel.kallsyms] [k] __alloc_skb
0.56% swapper [kernel.kallsyms] [k] ipt_do_table
^ permalink raw reply
* Re: [PATCH 08/16] virtio_net: drop config_enable
From: Michael S. Tsirkin @ 2014-10-06 12:10 UTC (permalink / raw)
To: Cornelia Huck; +Cc: netdev, linux-kernel, virtualization
In-Reply-To: <20141006135036.77fea7de.cornelia.huck@de.ibm.com>
On Mon, Oct 06, 2014 at 01:50:36PM +0200, Cornelia Huck wrote:
> On Sun, 5 Oct 2014 19:07:13 +0300
> "Michael S. Tsirkin" <mst@redhat.com> wrote:
>
> > Now that virtio core ensures config changes don't arrive during probing,
> > drop config_enable flag in virtio net.
> > On removal, flush is now sufficient to guarantee that no change work is
> > queued.
> >
> > This help simplify the driver, and will allow setting DRIVER_OK earlier
> > without losing config change notifications.
> >
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > ---
> > drivers/net/virtio_net.c | 23 ++---------------------
> > 1 file changed, 2 insertions(+), 21 deletions(-)
> >
> > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> > index 59caa06..fa17afa 100644
> > --- a/drivers/net/virtio_net.c
> > +++ b/drivers/net/virtio_net.c
>
> > @@ -1876,16 +1869,12 @@ static void virtnet_remove(struct virtio_device *vdev)
> > unregister_hotcpu_notifier(&vi->nb);
> >
> > /* Prevent config work handler from accessing the device. */
>
> Same comment as for the equivalent comment in the virtio-blk code.
Same answer :)
> > - mutex_lock(&vi->config_lock);
> > - vi->config_enable = false;
> > - mutex_unlock(&vi->config_lock);
> > + flush_work(&vi->config_work);
> >
> > unregister_netdev(vi->dev);
> >
> > remove_vq_common(vi);
> >
> > - flush_work(&vi->config_work);
> > -
> > free_percpu(vi->stats);
> > free_netdev(vi->dev);
> > }
> > @@ -1899,9 +1888,7 @@ static int virtnet_freeze(struct virtio_device *vdev)
> > unregister_hotcpu_notifier(&vi->nb);
> >
> > /* Prevent config work handler from accessing the device */
>
> dito
Same here.
> > - mutex_lock(&vi->config_lock);
> > - vi->config_enable = false;
> > - mutex_unlock(&vi->config_lock);
> > + flush_work(&vi->config_work);
> >
> > netif_device_detach(vi->dev);
> > cancel_delayed_work_sync(&vi->refill);
^ permalink raw reply
* Re: [PATCH 09/16] virtio-net: drop config_mutex
From: Sergei Shtylyov @ 2014-10-06 12:07 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: netdev, linux-kernel, virtualization
In-Reply-To: <20141006115636.GA26184@redhat.com>
On 10/6/2014 3:56 PM, Michael S. Tsirkin wrote:
>>> config_mutex served two purposes: prevent multiple concurrent config
>>> change handlers, and synchronize access to config_enable flag.
>>> Since commit dbf2576e37da0fcc7aacbfbb9fd5d3de7888a3c1
>>> workqueue: make all workqueues non-reentrant
>>> all workqueues are non-reentrant, and config_enable
>>> is now gone.
>>> Get rid of the unnecessary lock.
>>> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>>> ---
>>> drivers/net/virtio_net.c | 7 +------
>>> 1 file changed, 1 insertion(+), 6 deletions(-)
>>> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
>>> index fa17afa..d80fef4 100644
>>> --- a/drivers/net/virtio_net.c
>>> +++ b/drivers/net/virtio_net.c
>> [...]
>>> @@ -1430,7 +1426,7 @@ static void virtnet_config_changed_work(struct work_struct *work)
>>> netif_tx_stop_all_queues(vi->dev);
>>> }
>>> done:
>>> - mutex_unlock(&vi->config_lock);
>>> + return;
>> There's no need for this *return*.
> I know - it's removed by the follow-up patch.
Yeah, I saw.
> It's formatted like this to make diff smaller
> and make review easier.
Don't understand how adding this line makes diff smaller though...
You first need to add it and then to delete it, where's the save?
WBR, Sergei
^ permalink raw reply
* Re: [PATCH 11/16] virtio_net: minor cleanup
From: Cornelia Huck @ 2014-10-06 12:06 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: netdev, linux-kernel, virtualization
In-Reply-To: <1412525038-15871-12-git-send-email-mst@redhat.com>
On Sun, 5 Oct 2014 19:07:21 +0300
"Michael S. Tsirkin" <mst@redhat.com> wrote:
> goto done;
> done:
> return;
> is ugly, it was put there to make diff review easier.
> replace by open-coded return.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> drivers/net/virtio_net.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
If you don't want to merge it into the mutex removal patch, maybe move
it one up in the series?
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
^ permalink raw reply
* [PATCH v3 net-next] r8169:add support for RTL8168EP
From: Chun-Hao Lin @ 2014-10-06 12:04 UTC (permalink / raw)
To: netdev; +Cc: nic_swsd, linux-kernel, Chun-Hao Lin
RTL8168EP is Realtek PCIe Gigabit Ethernet controller with DASH support.
It is a successor chip of RTL8168DP.
For RTL8168EP, the read/write ocp register is via eri channel type 2, so
I modify ocp_read() ocp_write() and move related functions under
rtl_eri_read() rtl_eri_write().
The way of checking if dash is enabled and setting driver start/stop
are also different with RTL8168DP.
Right now, RTL8168EP phy mcu did not need patch firmware code, so I
did not add firmware code for it.
Signed-off-by: Chun-Hao Lin <hau@realtek.com>
---
drivers/net/ethernet/realtek/r8169.c | 512 ++++++++++++++++++++++++++++++++---
1 file changed, 467 insertions(+), 45 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 54476ba..1f63e0a 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -155,6 +155,9 @@ enum mac_version {
RTL_GIGA_MAC_VER_46,
RTL_GIGA_MAC_VER_47,
RTL_GIGA_MAC_VER_48,
+ RTL_GIGA_MAC_VER_49,
+ RTL_GIGA_MAC_VER_50,
+ RTL_GIGA_MAC_VER_51,
RTL_GIGA_MAC_NONE = 0xff,
};
@@ -302,6 +305,15 @@ static const struct {
[RTL_GIGA_MAC_VER_48] =
_R("RTL8107e", RTL_TD_1, FIRMWARE_8107E_2,
JUMBO_1K, false),
+ [RTL_GIGA_MAC_VER_49] =
+ _R("RTL8168ep/8111ep", RTL_TD_1, NULL,
+ JUMBO_9K, false),
+ [RTL_GIGA_MAC_VER_50] =
+ _R("RTL8168ep/8111ep", RTL_TD_1, NULL,
+ JUMBO_9K, false),
+ [RTL_GIGA_MAC_VER_51] =
+ _R("RTL8168ep/8111ep", RTL_TD_1, NULL,
+ JUMBO_9K, false),
};
#undef _R
@@ -400,6 +412,10 @@ enum rtl_registers {
FuncEvent = 0xf0,
FuncEventMask = 0xf4,
FuncPresetState = 0xf8,
+ IBCR0 = 0xf8,
+ IBCR2 = 0xf9,
+ IBIMR0 = 0xfa,
+ IBISR0 = 0xfb,
FuncForceEvent = 0xfc,
};
@@ -467,6 +483,7 @@ enum rtl8168_registers {
#define ERIAR_EXGMAC (0x00 << ERIAR_TYPE_SHIFT)
#define ERIAR_MSIX (0x01 << ERIAR_TYPE_SHIFT)
#define ERIAR_ASF (0x02 << ERIAR_TYPE_SHIFT)
+#define ERIAR_OOB (0x02 << ERIAR_TYPE_SHIFT)
#define ERIAR_MASK_SHIFT 12
#define ERIAR_MASK_0001 (0x1 << ERIAR_MASK_SHIFT)
#define ERIAR_MASK_0011 (0x3 << ERIAR_MASK_SHIFT)
@@ -935,40 +952,6 @@ static const struct rtl_cond name = { \
\
static bool name ## _check(struct rtl8169_private *tp)
-DECLARE_RTL_COND(rtl_ocpar_cond)
-{
- void __iomem *ioaddr = tp->mmio_addr;
-
- return RTL_R32(OCPAR) & OCPAR_FLAG;
-}
-
-static u32 ocp_read(struct rtl8169_private *tp, u8 mask, u16 reg)
-{
- void __iomem *ioaddr = tp->mmio_addr;
-
- RTL_W32(OCPAR, ((u32)mask & 0x0f) << 12 | (reg & 0x0fff));
-
- return rtl_udelay_loop_wait_high(tp, &rtl_ocpar_cond, 100, 20) ?
- RTL_R32(OCPDR) : ~0;
-}
-
-static void ocp_write(struct rtl8169_private *tp, u8 mask, u16 reg, u32 data)
-{
- void __iomem *ioaddr = tp->mmio_addr;
-
- RTL_W32(OCPDR, data);
- RTL_W32(OCPAR, OCPAR_FLAG | ((u32)mask & 0x0f) << 12 | (reg & 0x0fff));
-
- rtl_udelay_loop_wait_low(tp, &rtl_ocpar_cond, 100, 20);
-}
-
-DECLARE_RTL_COND(rtl_eriar_cond)
-{
- void __iomem *ioaddr = tp->mmio_addr;
-
- return RTL_R32(ERIAR) & ERIAR_FLAG;
-}
-
static bool rtl_ocp_reg_failure(struct rtl8169_private *tp, u32 reg)
{
if (reg & 0xffff0001) {
@@ -1110,6 +1093,13 @@ static int r8169_mdio_read(struct rtl8169_private *tp, int reg)
return value;
}
+DECLARE_RTL_COND(rtl_ocpar_cond)
+{
+ void __iomem *ioaddr = tp->mmio_addr;
+
+ return RTL_R32(OCPAR) & OCPAR_FLAG;
+}
+
static void r8168dp_1_mdio_access(struct rtl8169_private *tp, int reg, u32 data)
{
void __iomem *ioaddr = tp->mmio_addr;
@@ -1245,6 +1235,13 @@ static u16 rtl_ephy_read(struct rtl8169_private *tp, int reg_addr)
RTL_R32(EPHYAR) & EPHYAR_DATA_MASK : ~0;
}
+DECLARE_RTL_COND(rtl_eriar_cond)
+{
+ void __iomem *ioaddr = tp->mmio_addr;
+
+ return RTL_R32(ERIAR) & ERIAR_FLAG;
+}
+
static void rtl_eri_write(struct rtl8169_private *tp, int addr, u32 mask,
u32 val, int type)
{
@@ -1276,6 +1273,52 @@ static void rtl_w0w1_eri(struct rtl8169_private *tp, int addr, u32 mask, u32 p,
rtl_eri_write(tp, addr, mask, (val & ~m) | p, type);
}
+static u32 ocp_read(struct rtl8169_private *tp, u8 mask, u16 reg)
+{
+ void __iomem *ioaddr = tp->mmio_addr;
+
+ switch (tp->mac_version) {
+ case RTL_GIGA_MAC_VER_27:
+ case RTL_GIGA_MAC_VER_28:
+ case RTL_GIGA_MAC_VER_31:
+ RTL_W32(OCPAR, ((u32)mask & 0x0f) << 12 | (reg & 0x0fff));
+ return rtl_udelay_loop_wait_high(tp, &rtl_ocpar_cond, 100, 20) ?
+ RTL_R32(OCPDR) : ~0;
+ case RTL_GIGA_MAC_VER_49:
+ case RTL_GIGA_MAC_VER_50:
+ case RTL_GIGA_MAC_VER_51:
+ return rtl_eri_read(tp, reg, ERIAR_OOB);
+ default:
+ BUG();
+ return ~0;
+ }
+}
+
+static void ocp_write(struct rtl8169_private *tp, u8 mask, u16 reg, u32 data)
+{
+ void __iomem *ioaddr = tp->mmio_addr;
+
+ switch (tp->mac_version) {
+ case RTL_GIGA_MAC_VER_27:
+ case RTL_GIGA_MAC_VER_28:
+ case RTL_GIGA_MAC_VER_31:
+ RTL_W32(OCPDR, data);
+ RTL_W32(OCPAR, OCPAR_FLAG | ((u32)mask & 0x0f) << 12 |
+ (reg & 0x0fff));
+ rtl_udelay_loop_wait_low(tp, &rtl_ocpar_cond, 100, 20);
+ break;
+ case RTL_GIGA_MAC_VER_49:
+ case RTL_GIGA_MAC_VER_50:
+ case RTL_GIGA_MAC_VER_51:
+ rtl_eri_write(tp, reg, ((u32)mask & 0x0f) << ERIAR_MASK_SHIFT,
+ data, ERIAR_OOB);
+ break;
+ default:
+ BUG();
+ break;
+ }
+}
+
static void rtl8168_oob_notify(struct rtl8169_private *tp, u8 cmd)
{
rtl_eri_write(tp, 0xe8, ERIAR_MASK_0001, cmd, ERIAR_EXGMAC);
@@ -1301,25 +1344,84 @@ DECLARE_RTL_COND(rtl_ocp_read_cond)
return ocp_read(tp, 0x0f, reg) & 0x00000800;
}
-static void rtl8168_driver_start(struct rtl8169_private *tp)
+DECLARE_RTL_COND(rtl_ep_ocp_read_cond)
{
- rtl8168_oob_notify(tp, OOB_CMD_DRIVER_START);
+ return ocp_read(tp, 0x0f, 0x124) & 0x00000001;
+}
+
+DECLARE_RTL_COND(rtl_ocp_tx_cond)
+{
+ void __iomem *ioaddr = tp->mmio_addr;
- rtl_msleep_loop_wait_high(tp, &rtl_ocp_read_cond, 10, 10);
+ return RTL_R8(IBISR0) & 0x02;
+}
+
+static void rtl8168_driver_start(struct rtl8169_private *tp)
+{
+ switch (tp->mac_version) {
+ case RTL_GIGA_MAC_VER_27:
+ case RTL_GIGA_MAC_VER_28:
+ case RTL_GIGA_MAC_VER_31:
+ rtl8168_oob_notify(tp, OOB_CMD_DRIVER_START);
+ rtl_msleep_loop_wait_high(tp, &rtl_ocp_read_cond, 10, 10);
+ break;
+ case RTL_GIGA_MAC_VER_49:
+ case RTL_GIGA_MAC_VER_50:
+ case RTL_GIGA_MAC_VER_51:
+ ocp_write(tp, 0x01, 0x180, OOB_CMD_DRIVER_START);
+ ocp_write(tp, 0x01, 0x30, ocp_read(tp, 0x01, 0x30) | 0x01);
+ rtl_msleep_loop_wait_high(tp, &rtl_ep_ocp_read_cond, 10, 10);
+ break;
+ default:
+ BUG();
+ break;
+ }
}
static void rtl8168_driver_stop(struct rtl8169_private *tp)
{
- rtl8168_oob_notify(tp, OOB_CMD_DRIVER_STOP);
+ void __iomem *ioaddr = tp->mmio_addr;
- rtl_msleep_loop_wait_low(tp, &rtl_ocp_read_cond, 10, 10);
+ switch (tp->mac_version) {
+ case RTL_GIGA_MAC_VER_27:
+ case RTL_GIGA_MAC_VER_28:
+ case RTL_GIGA_MAC_VER_31:
+ rtl8168_oob_notify(tp, OOB_CMD_DRIVER_STOP);
+ rtl_msleep_loop_wait_low(tp, &rtl_ocp_read_cond, 10, 10);
+ break;
+ case RTL_GIGA_MAC_VER_49:
+ case RTL_GIGA_MAC_VER_50:
+ case RTL_GIGA_MAC_VER_51:
+ RTL_W8(IBCR2, RTL_R8(IBCR2) & ~0x01);
+ rtl_msleep_loop_wait_low(tp, &rtl_ocp_tx_cond, 50, 2000);
+ RTL_W8(IBISR0, RTL_R8(IBISR0) | 0x20);
+ RTL_W8(IBCR0, RTL_R8(IBCR0) & ~0x01);
+ ocp_write(tp, 0x01, 0x180, OOB_CMD_DRIVER_STOP);
+ ocp_write(tp, 0x01, 0x30, ocp_read(tp, 0x01, 0x30) | 0x01);
+ rtl_msleep_loop_wait_low(tp, &rtl_ep_ocp_read_cond, 10, 10);
+ break;
+ default:
+ BUG();
+ break;
+ }
}
static int r8168_check_dash(struct rtl8169_private *tp)
{
u16 reg = rtl8168_get_ocp_reg(tp);
- return (ocp_read(tp, 0x0f, reg) & 0x00008000) ? 1 : 0;
+ switch (tp->mac_version) {
+ case RTL_GIGA_MAC_VER_27:
+ case RTL_GIGA_MAC_VER_28:
+ case RTL_GIGA_MAC_VER_31:
+ return (ocp_read(tp, 0x0f, reg) & 0x00008000) ? 1 : 0;
+ case RTL_GIGA_MAC_VER_49:
+ case RTL_GIGA_MAC_VER_50:
+ case RTL_GIGA_MAC_VER_51:
+ return (ocp_read(tp, 0x0f, 0x128) & 0x00000001) ? 1 : 0;
+ default:
+ return 0;
+ }
}
struct exgmac_reg {
@@ -1553,6 +1655,9 @@ static u32 __rtl8169_get_wol(struct rtl8169_private *tp)
case RTL_GIGA_MAC_VER_46:
case RTL_GIGA_MAC_VER_47:
case RTL_GIGA_MAC_VER_48:
+ case RTL_GIGA_MAC_VER_49:
+ case RTL_GIGA_MAC_VER_50:
+ case RTL_GIGA_MAC_VER_51:
if (rtl_eri_read(tp, 0xdc, ERIAR_EXGMAC) & MagicPacket_v2)
wolopts |= WAKE_MAGIC;
break;
@@ -1620,6 +1725,9 @@ static void __rtl8169_set_wol(struct rtl8169_private *tp, u32 wolopts)
case RTL_GIGA_MAC_VER_46:
case RTL_GIGA_MAC_VER_47:
case RTL_GIGA_MAC_VER_48:
+ case RTL_GIGA_MAC_VER_49:
+ case RTL_GIGA_MAC_VER_50:
+ case RTL_GIGA_MAC_VER_51:
tmp = ARRAY_SIZE(cfg) - 1;
if (wolopts & WAKE_MAGIC)
rtl_w0w1_eri(tp,
@@ -2126,6 +2234,11 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp,
u32 val;
int mac_version;
} mac_info[] = {
+ /* 8168EP family. */
+ { 0x7cf00000, 0x50200000, RTL_GIGA_MAC_VER_51 },
+ { 0x7cf00000, 0x50100000, RTL_GIGA_MAC_VER_50 },
+ { 0x7cf00000, 0x50000000, RTL_GIGA_MAC_VER_49 },
+
/* 8168H family. */
{ 0x7cf00000, 0x54100000, RTL_GIGA_MAC_VER_46 },
{ 0x7cf00000, 0x54000000, RTL_GIGA_MAC_VER_45 },
@@ -3741,6 +3854,139 @@ static void rtl8168h_2_hw_phy_config(struct rtl8169_private *tp)
rtl_writephy(tp, 0x1f, 0x0000);
}
+static void rtl8168ep_1_hw_phy_config(struct rtl8169_private *tp)
+{
+ /* Enable PHY auto speed down */
+ rtl_writephy(tp, 0x1f, 0x0a44);
+ rtl_w0w1_phy(tp, 0x11, 0x000c, 0x0000);
+ rtl_writephy(tp, 0x1f, 0x0000);
+
+ /* patch 10M & ALDPS */
+ rtl_writephy(tp, 0x1f, 0x0bcc);
+ rtl_w0w1_phy(tp, 0x14, 0x0000, 0x0100);
+ rtl_writephy(tp, 0x1f, 0x0a44);
+ rtl_w0w1_phy(tp, 0x11, 0x00c0, 0x0000);
+ rtl_writephy(tp, 0x1f, 0x0a43);
+ rtl_writephy(tp, 0x13, 0x8084);
+ rtl_w0w1_phy(tp, 0x14, 0x0000, 0x6000);
+ rtl_w0w1_phy(tp, 0x10, 0x1003, 0x0000);
+ rtl_writephy(tp, 0x1f, 0x0000);
+
+ /* Enable EEE auto-fallback function */
+ rtl_writephy(tp, 0x1f, 0x0a4b);
+ rtl_w0w1_phy(tp, 0x11, 0x0004, 0x0000);
+ rtl_writephy(tp, 0x1f, 0x0000);
+
+ /* Enable UC LPF tune function */
+ rtl_writephy(tp, 0x1f, 0x0a43);
+ rtl_writephy(tp, 0x13, 0x8012);
+ rtl_w0w1_phy(tp, 0x14, 0x8000, 0x0000);
+ rtl_writephy(tp, 0x1f, 0x0000);
+
+ /* set rg_sel_sdm_rate */
+ rtl_writephy(tp, 0x1f, 0x0c42);
+ rtl_w0w1_phy(tp, 0x11, 0x4000, 0x2000);
+ rtl_writephy(tp, 0x1f, 0x0000);
+
+ /* Check ALDPS bit, disable it if enabled */
+ rtl_writephy(tp, 0x1f, 0x0a43);
+ if (rtl_readphy(tp, 0x10) & 0x0004)
+ rtl_w0w1_phy(tp, 0x10, 0x0000, 0x0004);
+
+ rtl_writephy(tp, 0x1f, 0x0000);
+}
+
+static void rtl8168ep_2_hw_phy_config(struct rtl8169_private *tp)
+{
+ /* patch 10M & ALDPS */
+ rtl_writephy(tp, 0x1f, 0x0bcc);
+ rtl_w0w1_phy(tp, 0x14, 0x0000, 0x0100);
+ rtl_writephy(tp, 0x1f, 0x0a44);
+ rtl_w0w1_phy(tp, 0x11, 0x00c0, 0x0000);
+ rtl_writephy(tp, 0x1f, 0x0a43);
+ rtl_writephy(tp, 0x13, 0x8084);
+ rtl_w0w1_phy(tp, 0x14, 0x0000, 0x6000);
+ rtl_w0w1_phy(tp, 0x10, 0x1003, 0x0000);
+ rtl_writephy(tp, 0x1f, 0x0000);
+
+ /* Enable UC LPF tune function */
+ rtl_writephy(tp, 0x1f, 0x0a43);
+ rtl_writephy(tp, 0x13, 0x8012);
+ rtl_w0w1_phy(tp, 0x14, 0x8000, 0x0000);
+ rtl_writephy(tp, 0x1f, 0x0000);
+
+ /* Set rg_sel_sdm_rate */
+ rtl_writephy(tp, 0x1f, 0x0c42);
+ rtl_w0w1_phy(tp, 0x11, 0x4000, 0x2000);
+ rtl_writephy(tp, 0x1f, 0x0000);
+
+ /* Channel estimation parameters */
+ rtl_writephy(tp, 0x1f, 0x0a43);
+ rtl_writephy(tp, 0x13, 0x80f3);
+ rtl_w0w1_phy(tp, 0x14, 0x8b00, ~0x8bff);
+ rtl_writephy(tp, 0x13, 0x80f0);
+ rtl_w0w1_phy(tp, 0x14, 0x3a00, ~0x3aff);
+ rtl_writephy(tp, 0x13, 0x80ef);
+ rtl_w0w1_phy(tp, 0x14, 0x0500, ~0x05ff);
+ rtl_writephy(tp, 0x13, 0x80f6);
+ rtl_w0w1_phy(tp, 0x14, 0x6e00, ~0x6eff);
+ rtl_writephy(tp, 0x13, 0x80ec);
+ rtl_w0w1_phy(tp, 0x14, 0x6800, ~0x68ff);
+ rtl_writephy(tp, 0x13, 0x80ed);
+ rtl_w0w1_phy(tp, 0x14, 0x7c00, ~0x7cff);
+ rtl_writephy(tp, 0x13, 0x80f2);
+ rtl_w0w1_phy(tp, 0x14, 0xf400, ~0xf4ff);
+ rtl_writephy(tp, 0x13, 0x80f4);
+ rtl_w0w1_phy(tp, 0x14, 0x8500, ~0x85ff);
+ rtl_writephy(tp, 0x1f, 0x0a43);
+ rtl_writephy(tp, 0x13, 0x8110);
+ rtl_w0w1_phy(tp, 0x14, 0xa800, ~0xa8ff);
+ rtl_writephy(tp, 0x13, 0x810f);
+ rtl_w0w1_phy(tp, 0x14, 0x1d00, ~0x1dff);
+ rtl_writephy(tp, 0x13, 0x8111);
+ rtl_w0w1_phy(tp, 0x14, 0xf500, ~0xf5ff);
+ rtl_writephy(tp, 0x13, 0x8113);
+ rtl_w0w1_phy(tp, 0x14, 0x6100, ~0x61ff);
+ rtl_writephy(tp, 0x13, 0x8115);
+ rtl_w0w1_phy(tp, 0x14, 0x9200, ~0x92ff);
+ rtl_writephy(tp, 0x13, 0x810e);
+ rtl_w0w1_phy(tp, 0x14, 0x0400, ~0x04ff);
+ rtl_writephy(tp, 0x13, 0x810c);
+ rtl_w0w1_phy(tp, 0x14, 0x7c00, ~0x7cff);
+ rtl_writephy(tp, 0x13, 0x810b);
+ rtl_w0w1_phy(tp, 0x14, 0x5a00, ~0x5aff);
+ rtl_writephy(tp, 0x1f, 0x0a43);
+ rtl_writephy(tp, 0x13, 0x80d1);
+ rtl_w0w1_phy(tp, 0x14, 0xff00, ~0xffff);
+ rtl_writephy(tp, 0x13, 0x80cd);
+ rtl_w0w1_phy(tp, 0x14, 0x9e00, ~0x9eff);
+ rtl_writephy(tp, 0x13, 0x80d3);
+ rtl_w0w1_phy(tp, 0x14, 0x0e00, ~0x0eff);
+ rtl_writephy(tp, 0x13, 0x80d5);
+ rtl_w0w1_phy(tp, 0x14, 0xca00, ~0xcaff);
+ rtl_writephy(tp, 0x13, 0x80d7);
+ rtl_w0w1_phy(tp, 0x14, 0x8400, ~0x84ff);
+
+ /* Force PWM-mode */
+ rtl_writephy(tp, 0x1f, 0x0bcd);
+ rtl_writephy(tp, 0x14, 0x5065);
+ rtl_writephy(tp, 0x14, 0xd065);
+ rtl_writephy(tp, 0x1f, 0x0bc8);
+ rtl_writephy(tp, 0x12, 0x00ed);
+ rtl_writephy(tp, 0x1f, 0x0bcd);
+ rtl_writephy(tp, 0x14, 0x1065);
+ rtl_writephy(tp, 0x14, 0x9065);
+ rtl_writephy(tp, 0x14, 0x1065);
+ rtl_writephy(tp, 0x1f, 0x0000);
+
+ /* Check ALDPS bit, disable it if enabled */
+ rtl_writephy(tp, 0x1f, 0x0a43);
+ if (rtl_readphy(tp, 0x10) & 0x0004)
+ rtl_w0w1_phy(tp, 0x10, 0x0000, 0x0004);
+
+ rtl_writephy(tp, 0x1f, 0x0000);
+}
+
static void rtl8102e_hw_phy_config(struct rtl8169_private *tp)
{
static const struct phy_reg phy_reg_init[] = {
@@ -3940,6 +4186,14 @@ static void rtl_hw_phy_config(struct net_device *dev)
rtl8168h_2_hw_phy_config(tp);
break;
+ case RTL_GIGA_MAC_VER_49:
+ rtl8168ep_1_hw_phy_config(tp);
+ break;
+ case RTL_GIGA_MAC_VER_50:
+ case RTL_GIGA_MAC_VER_51:
+ rtl8168ep_2_hw_phy_config(tp);
+ break;
+
case RTL_GIGA_MAC_VER_41:
default:
break;
@@ -4154,6 +4408,9 @@ static void rtl_init_mdio_ops(struct rtl8169_private *tp)
case RTL_GIGA_MAC_VER_46:
case RTL_GIGA_MAC_VER_47:
case RTL_GIGA_MAC_VER_48:
+ case RTL_GIGA_MAC_VER_49:
+ case RTL_GIGA_MAC_VER_50:
+ case RTL_GIGA_MAC_VER_51:
ops->write = r8168g_mdio_write;
ops->read = r8168g_mdio_read;
break;
@@ -4212,6 +4469,9 @@ static void rtl_wol_suspend_quirk(struct rtl8169_private *tp)
case RTL_GIGA_MAC_VER_46:
case RTL_GIGA_MAC_VER_47:
case RTL_GIGA_MAC_VER_48:
+ case RTL_GIGA_MAC_VER_49:
+ case RTL_GIGA_MAC_VER_50:
+ case RTL_GIGA_MAC_VER_51:
RTL_W32(RxConfig, RTL_R32(RxConfig) |
AcceptBroadcast | AcceptMulticast | AcceptMyPhys);
break;
@@ -4356,7 +4616,10 @@ static void r8168_pll_power_down(struct rtl8169_private *tp)
if ((tp->mac_version == RTL_GIGA_MAC_VER_27 ||
tp->mac_version == RTL_GIGA_MAC_VER_28 ||
- tp->mac_version == RTL_GIGA_MAC_VER_31) &&
+ tp->mac_version == RTL_GIGA_MAC_VER_31 ||
+ tp->mac_version == RTL_GIGA_MAC_VER_49 ||
+ tp->mac_version == RTL_GIGA_MAC_VER_50 ||
+ tp->mac_version == RTL_GIGA_MAC_VER_51) &&
r8168_check_dash(tp)) {
return;
}
@@ -4387,10 +4650,13 @@ static void r8168_pll_power_down(struct rtl8169_private *tp)
case RTL_GIGA_MAC_VER_44:
case RTL_GIGA_MAC_VER_45:
case RTL_GIGA_MAC_VER_46:
+ case RTL_GIGA_MAC_VER_50:
+ case RTL_GIGA_MAC_VER_51:
RTL_W8(PMCH, RTL_R8(PMCH) & ~0x80);
break;
case RTL_GIGA_MAC_VER_40:
case RTL_GIGA_MAC_VER_41:
+ case RTL_GIGA_MAC_VER_49:
rtl_w0w1_eri(tp, 0x1a8, ERIAR_MASK_1111, 0x00000000,
0xfc000000, ERIAR_EXGMAC);
RTL_W8(PMCH, RTL_R8(PMCH) & ~0x80);
@@ -4415,10 +4681,13 @@ static void r8168_pll_power_up(struct rtl8169_private *tp)
case RTL_GIGA_MAC_VER_44:
case RTL_GIGA_MAC_VER_45:
case RTL_GIGA_MAC_VER_46:
+ case RTL_GIGA_MAC_VER_50:
+ case RTL_GIGA_MAC_VER_51:
RTL_W8(PMCH, RTL_R8(PMCH) | 0xc0);
break;
case RTL_GIGA_MAC_VER_40:
case RTL_GIGA_MAC_VER_41:
+ case RTL_GIGA_MAC_VER_49:
RTL_W8(PMCH, RTL_R8(PMCH) | 0xc0);
rtl_w0w1_eri(tp, 0x1a8, ERIAR_MASK_1111, 0xfc000000,
0x00000000, ERIAR_EXGMAC);
@@ -4493,6 +4762,9 @@ static void rtl_init_pll_power_ops(struct rtl8169_private *tp)
case RTL_GIGA_MAC_VER_44:
case RTL_GIGA_MAC_VER_45:
case RTL_GIGA_MAC_VER_46:
+ case RTL_GIGA_MAC_VER_49:
+ case RTL_GIGA_MAC_VER_50:
+ case RTL_GIGA_MAC_VER_51:
ops->down = r8168_pll_power_down;
ops->up = r8168_pll_power_up;
break;
@@ -4547,6 +4819,9 @@ static void rtl_init_rxcfg(struct rtl8169_private *tp)
case RTL_GIGA_MAC_VER_46:
case RTL_GIGA_MAC_VER_47:
case RTL_GIGA_MAC_VER_48:
+ case RTL_GIGA_MAC_VER_49:
+ case RTL_GIGA_MAC_VER_50:
+ case RTL_GIGA_MAC_VER_51:
RTL_W32(RxConfig, RX128_INT_EN | RX_DMA_BURST | RX_EARLY_OFF);
break;
default:
@@ -4712,6 +4987,9 @@ static void rtl_init_jumbo_ops(struct rtl8169_private *tp)
case RTL_GIGA_MAC_VER_46:
case RTL_GIGA_MAC_VER_47:
case RTL_GIGA_MAC_VER_48:
+ case RTL_GIGA_MAC_VER_49:
+ case RTL_GIGA_MAC_VER_50:
+ case RTL_GIGA_MAC_VER_51:
default:
ops->disable = NULL;
ops->enable = NULL;
@@ -4828,7 +5106,10 @@ static void rtl8169_hw_reset(struct rtl8169_private *tp)
tp->mac_version == RTL_GIGA_MAC_VER_45 ||
tp->mac_version == RTL_GIGA_MAC_VER_46 ||
tp->mac_version == RTL_GIGA_MAC_VER_47 ||
- tp->mac_version == RTL_GIGA_MAC_VER_48) {
+ tp->mac_version == RTL_GIGA_MAC_VER_48 ||
+ tp->mac_version == RTL_GIGA_MAC_VER_49 ||
+ tp->mac_version == RTL_GIGA_MAC_VER_50 ||
+ tp->mac_version == RTL_GIGA_MAC_VER_51) {
RTL_W8(ChipCmd, RTL_R8(ChipCmd) | StopReq);
rtl_udelay_loop_wait_high(tp, &rtl_txcfg_empty_cond, 100, 666);
} else {
@@ -5754,6 +6035,120 @@ static void rtl_hw_start_8168h_1(struct rtl8169_private *tp)
r8168_mac_ocp_write(tp, 0xc09e, 0x0000);
}
+static void rtl_hw_start_8168ep(struct rtl8169_private *tp)
+{
+ void __iomem *ioaddr = tp->mmio_addr;
+ struct pci_dev *pdev = tp->pci_dev;
+
+ RTL_W32(TxConfig, RTL_R32(TxConfig) | TXCFG_AUTO_FIFO);
+
+ rtl_eri_write(tp, 0xc8, ERIAR_MASK_0101, 0x00080002, ERIAR_EXGMAC);
+ rtl_eri_write(tp, 0xcc, ERIAR_MASK_0001, 0x2f, ERIAR_EXGMAC);
+ rtl_eri_write(tp, 0xd0, ERIAR_MASK_0001, 0x5f, ERIAR_EXGMAC);
+ rtl_eri_write(tp, 0xe8, ERIAR_MASK_1111, 0x00100006, ERIAR_EXGMAC);
+
+ rtl_csi_access_enable_1(tp);
+
+ rtl_tx_performance_tweak(pdev, 0x5 << MAX_READ_REQUEST_SHIFT);
+
+ rtl_w0w1_eri(tp, 0xdc, ERIAR_MASK_0001, 0x00, 0x01, ERIAR_EXGMAC);
+ rtl_w0w1_eri(tp, 0xdc, ERIAR_MASK_0001, 0x01, 0x00, ERIAR_EXGMAC);
+
+ rtl_w0w1_eri(tp, 0xd4, ERIAR_MASK_1111, 0x1f80, 0x00, ERIAR_EXGMAC);
+
+ rtl_eri_write(tp, 0x5f0, ERIAR_MASK_0011, 0x4f87, ERIAR_EXGMAC);
+
+ RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
+ RTL_W32(MISC, RTL_R32(MISC) & ~RXDV_GATED_EN);
+ RTL_W8(MaxTxPacketSize, EarlySize);
+
+ rtl_eri_write(tp, 0xc0, ERIAR_MASK_0011, 0x0000, ERIAR_EXGMAC);
+ rtl_eri_write(tp, 0xb8, ERIAR_MASK_0011, 0x0000, ERIAR_EXGMAC);
+
+ /* Adjust EEE LED frequency */
+ RTL_W8(EEE_LED, RTL_R8(EEE_LED) & ~0x07);
+
+ rtl_w0w1_eri(tp, 0x2fc, ERIAR_MASK_0001, 0x01, 0x06, ERIAR_EXGMAC);
+
+ RTL_W8(DLLPR, RTL_R8(DLLPR) & ~TX_10M_PS_EN);
+
+ rtl_pcie_state_l2l3_enable(tp, false);
+}
+
+static void rtl_hw_start_8168ep_1(struct rtl8169_private *tp)
+{
+ void __iomem *ioaddr = tp->mmio_addr;
+ static const struct ephy_info e_info_8168ep_1[] = {
+ { 0x00, 0xffff, 0x10ab },
+ { 0x06, 0xffff, 0xf030 },
+ { 0x08, 0xffff, 0x2006 },
+ { 0x0d, 0xffff, 0x1666 },
+ { 0x0c, 0x3ff0, 0x0000 }
+ };
+
+ /* disable aspm and clock request before access ephy */
+ RTL_W8(Config2, RTL_R8(Config2) & ~ClkReqEn);
+ RTL_W8(Config5, RTL_R8(Config5) & ~ASPM_en);
+ rtl_ephy_init(tp, e_info_8168ep_1, ARRAY_SIZE(e_info_8168ep_1));
+
+ rtl_hw_start_8168ep(tp);
+}
+
+static void rtl_hw_start_8168ep_2(struct rtl8169_private *tp)
+{
+ void __iomem *ioaddr = tp->mmio_addr;
+ static const struct ephy_info e_info_8168ep_2[] = {
+ { 0x00, 0xffff, 0x10a3 },
+ { 0x19, 0xffff, 0xfc00 },
+ { 0x1e, 0xffff, 0x20ea }
+ };
+
+ /* disable aspm and clock request before access ephy */
+ RTL_W8(Config2, RTL_R8(Config2) & ~ClkReqEn);
+ RTL_W8(Config5, RTL_R8(Config5) & ~ASPM_en);
+ rtl_ephy_init(tp, e_info_8168ep_2, ARRAY_SIZE(e_info_8168ep_2));
+
+ rtl_hw_start_8168ep(tp);
+
+ RTL_W8(DLLPR, RTL_R8(DLLPR) & ~PFM_EN);
+ RTL_W8(DLLPR, RTL_R8(MISC_1) & ~PFM_D3COLD_EN);
+}
+
+static void rtl_hw_start_8168ep_3(struct rtl8169_private *tp)
+{
+ void __iomem *ioaddr = tp->mmio_addr;
+ u32 data;
+ static const struct ephy_info e_info_8168ep_3[] = {
+ { 0x00, 0xffff, 0x10a3 },
+ { 0x19, 0xffff, 0x7c00 },
+ { 0x1e, 0xffff, 0x20eb },
+ { 0x0d, 0xffff, 0x1666 }
+ };
+
+ /* disable aspm and clock request before access ephy */
+ RTL_W8(Config2, RTL_R8(Config2) & ~ClkReqEn);
+ RTL_W8(Config5, RTL_R8(Config5) & ~ASPM_en);
+ rtl_ephy_init(tp, e_info_8168ep_3, ARRAY_SIZE(e_info_8168ep_3));
+
+ rtl_hw_start_8168ep(tp);
+
+ RTL_W8(DLLPR, RTL_R8(DLLPR) & ~PFM_EN);
+ RTL_W8(DLLPR, RTL_R8(MISC_1) & ~PFM_D3COLD_EN);
+
+ data = r8168_mac_ocp_read(tp, 0xd3e2);
+ data &= 0xf000;
+ data |= 0x0271;
+ r8168_mac_ocp_write(tp, 0xd3e2, data);
+
+ data = r8168_mac_ocp_read(tp, 0xd3e4);
+ data &= 0xff00;
+ r8168_mac_ocp_write(tp, 0xd3e4, data);
+
+ data = r8168_mac_ocp_read(tp, 0xe860);
+ data |= 0x0080;
+ r8168_mac_ocp_write(tp, 0xe860, data);
+}
+
static void rtl_hw_start_8168(struct net_device *dev)
{
struct rtl8169_private *tp = netdev_priv(dev);
@@ -5869,6 +6264,18 @@ static void rtl_hw_start_8168(struct net_device *dev)
rtl_hw_start_8168h_1(tp);
break;
+ case RTL_GIGA_MAC_VER_49:
+ rtl_hw_start_8168ep_1(tp);
+ break;
+
+ case RTL_GIGA_MAC_VER_50:
+ rtl_hw_start_8168ep_2(tp);
+ break;
+
+ case RTL_GIGA_MAC_VER_51:
+ rtl_hw_start_8168ep_3(tp);
+ break;
+
default:
printk(KERN_ERR PFX "%s: unknown chipset (mac_version = %d).\n",
dev->name, tp->mac_version);
@@ -7399,7 +7806,10 @@ static void rtl_remove_one(struct pci_dev *pdev)
if ((tp->mac_version == RTL_GIGA_MAC_VER_27 ||
tp->mac_version == RTL_GIGA_MAC_VER_28 ||
- tp->mac_version == RTL_GIGA_MAC_VER_31) &&
+ tp->mac_version == RTL_GIGA_MAC_VER_31 ||
+ tp->mac_version == RTL_GIGA_MAC_VER_49 ||
+ tp->mac_version == RTL_GIGA_MAC_VER_50 ||
+ tp->mac_version == RTL_GIGA_MAC_VER_51) &&
r8168_check_dash(tp)) {
rtl8168_driver_stop(tp);
}
@@ -7556,6 +7966,9 @@ static void rtl_hw_initialize(struct rtl8169_private *tp)
case RTL_GIGA_MAC_VER_46:
case RTL_GIGA_MAC_VER_47:
case RTL_GIGA_MAC_VER_48:
+ case RTL_GIGA_MAC_VER_49:
+ case RTL_GIGA_MAC_VER_50:
+ case RTL_GIGA_MAC_VER_51:
rtl_hw_init_8168g(tp);
break;
@@ -7708,6 +8121,9 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
case RTL_GIGA_MAC_VER_46:
case RTL_GIGA_MAC_VER_47:
case RTL_GIGA_MAC_VER_48:
+ case RTL_GIGA_MAC_VER_49:
+ case RTL_GIGA_MAC_VER_50:
+ case RTL_GIGA_MAC_VER_51:
if (rtl_eri_read(tp, 0xdc, ERIAR_EXGMAC) & MagicPacket_v2)
tp->features |= RTL_FEATURE_WOL;
if ((RTL_R8(Config3) & LinkUp) != 0)
@@ -7756,7 +8172,10 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
tp->mac_version == RTL_GIGA_MAC_VER_45 ||
tp->mac_version == RTL_GIGA_MAC_VER_46 ||
tp->mac_version == RTL_GIGA_MAC_VER_47 ||
- tp->mac_version == RTL_GIGA_MAC_VER_48) {
+ tp->mac_version == RTL_GIGA_MAC_VER_48 ||
+ tp->mac_version == RTL_GIGA_MAC_VER_49 ||
+ tp->mac_version == RTL_GIGA_MAC_VER_50 ||
+ tp->mac_version == RTL_GIGA_MAC_VER_51) {
u16 mac_addr[3];
*(u32 *)&mac_addr[0] = rtl_eri_read(tp, 0xe0, ERIAR_EXGMAC);
@@ -7835,7 +8254,10 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if ((tp->mac_version == RTL_GIGA_MAC_VER_27 ||
tp->mac_version == RTL_GIGA_MAC_VER_28 ||
- tp->mac_version == RTL_GIGA_MAC_VER_31) &&
+ tp->mac_version == RTL_GIGA_MAC_VER_31 ||
+ tp->mac_version == RTL_GIGA_MAC_VER_49 ||
+ tp->mac_version == RTL_GIGA_MAC_VER_50 ||
+ tp->mac_version == RTL_GIGA_MAC_VER_51) &&
r8168_check_dash(tp)) {
rtl8168_driver_start(tp);
}
--
1.8.3.2
^ permalink raw reply related
* Re: [PATCH 09/16] virtio-net: drop config_mutex
From: Michael S. Tsirkin @ 2014-10-06 12:01 UTC (permalink / raw)
To: Cornelia Huck; +Cc: netdev, linux-kernel, virtualization
In-Reply-To: <20141006135610.537c263b.cornelia.huck@de.ibm.com>
On Mon, Oct 06, 2014 at 01:56:10PM +0200, Cornelia Huck wrote:
> On Sun, 5 Oct 2014 19:07:16 +0300
> "Michael S. Tsirkin" <mst@redhat.com> wrote:
>
> > config_mutex served two purposes: prevent multiple concurrent config
> > change handlers, and synchronize access to config_enable flag.
> >
> > Since commit dbf2576e37da0fcc7aacbfbb9fd5d3de7888a3c1
> > workqueue: make all workqueues non-reentrant
> > all workqueues are non-reentrant, and config_enable
> > is now gone.
> >
> > Get rid of the unnecessary lock.
> >
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > ---
> > drivers/net/virtio_net.c | 7 +------
> > 1 file changed, 1 insertion(+), 6 deletions(-)
> >
> > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> > index fa17afa..d80fef4 100644
> > --- a/drivers/net/virtio_net.c
> > +++ b/drivers/net/virtio_net.c
>
> > @@ -1430,7 +1426,7 @@ static void virtnet_config_changed_work(struct work_struct *work)
> > netif_tx_stop_all_queues(vi->dev);
> > }
> > done:
> > - mutex_unlock(&vi->config_lock);
> > + return;
> > }
> >
> > static void virtnet_config_changed(struct virtio_device *vdev)
>
> I'd probably return directly in the remaining 'goto done;' cases, but still
>
> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Yes: this is exactly what
[PATCH 11/16] virtio_net: minor cleanup
does
--
MST
^ permalink raw reply
* Re: [PATCH 09/16] virtio-net: drop config_mutex
From: Michael S. Tsirkin @ 2014-10-06 11:56 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: netdev, linux-kernel, virtualization
In-Reply-To: <54328107.5090400@cogentembedded.com>
On Mon, Oct 06, 2014 at 03:46:15PM +0400, Sergei Shtylyov wrote:
> Hello.
>
> On 10/5/2014 8:07 PM, Michael S. Tsirkin wrote:
>
> >config_mutex served two purposes: prevent multiple concurrent config
> >change handlers, and synchronize access to config_enable flag.
>
> >Since commit dbf2576e37da0fcc7aacbfbb9fd5d3de7888a3c1
> > workqueue: make all workqueues non-reentrant
> >all workqueues are non-reentrant, and config_enable
> >is now gone.
>
> >Get rid of the unnecessary lock.
>
> >Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> >---
> > drivers/net/virtio_net.c | 7 +------
> > 1 file changed, 1 insertion(+), 6 deletions(-)
>
> >diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> >index fa17afa..d80fef4 100644
> >--- a/drivers/net/virtio_net.c
> >+++ b/drivers/net/virtio_net.c
> [...]
> >@@ -1430,7 +1426,7 @@ static void virtnet_config_changed_work(struct work_struct *work)
> > netif_tx_stop_all_queues(vi->dev);
> > }
> > done:
> >- mutex_unlock(&vi->config_lock);
> >+ return;
>
> There's no need for this *return*.
>
I know - it's removed by the follow-up patch.
It's formatted like this to make diff smaller
and make review easier.
> > }
> >
> > static void virtnet_config_changed(struct virtio_device *vdev)
>
> WBR, Sergei
^ permalink raw reply
* Re: [PATCH 09/16] virtio-net: drop config_mutex
From: Cornelia Huck @ 2014-10-06 11:56 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: netdev, linux-kernel, virtualization
In-Reply-To: <1412525038-15871-10-git-send-email-mst@redhat.com>
On Sun, 5 Oct 2014 19:07:16 +0300
"Michael S. Tsirkin" <mst@redhat.com> wrote:
> config_mutex served two purposes: prevent multiple concurrent config
> change handlers, and synchronize access to config_enable flag.
>
> Since commit dbf2576e37da0fcc7aacbfbb9fd5d3de7888a3c1
> workqueue: make all workqueues non-reentrant
> all workqueues are non-reentrant, and config_enable
> is now gone.
>
> Get rid of the unnecessary lock.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> drivers/net/virtio_net.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index fa17afa..d80fef4 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -1430,7 +1426,7 @@ static void virtnet_config_changed_work(struct work_struct *work)
> netif_tx_stop_all_queues(vi->dev);
> }
> done:
> - mutex_unlock(&vi->config_lock);
> + return;
> }
>
> static void virtnet_config_changed(struct virtio_device *vdev)
I'd probably return directly in the remaining 'goto done;' cases, but still
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
^ permalink raw reply
* Re: [PATCH 08/16] virtio_net: drop config_enable
From: Cornelia Huck @ 2014-10-06 11:50 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: netdev, linux-kernel, virtualization
In-Reply-To: <1412525038-15871-9-git-send-email-mst@redhat.com>
On Sun, 5 Oct 2014 19:07:13 +0300
"Michael S. Tsirkin" <mst@redhat.com> wrote:
> Now that virtio core ensures config changes don't arrive during probing,
> drop config_enable flag in virtio net.
> On removal, flush is now sufficient to guarantee that no change work is
> queued.
>
> This help simplify the driver, and will allow setting DRIVER_OK earlier
> without losing config change notifications.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> drivers/net/virtio_net.c | 23 ++---------------------
> 1 file changed, 2 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 59caa06..fa17afa 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -1876,16 +1869,12 @@ static void virtnet_remove(struct virtio_device *vdev)
> unregister_hotcpu_notifier(&vi->nb);
>
> /* Prevent config work handler from accessing the device. */
Same comment as for the equivalent comment in the virtio-blk code.
> - mutex_lock(&vi->config_lock);
> - vi->config_enable = false;
> - mutex_unlock(&vi->config_lock);
> + flush_work(&vi->config_work);
>
> unregister_netdev(vi->dev);
>
> remove_vq_common(vi);
>
> - flush_work(&vi->config_work);
> -
> free_percpu(vi->stats);
> free_netdev(vi->dev);
> }
> @@ -1899,9 +1888,7 @@ static int virtnet_freeze(struct virtio_device *vdev)
> unregister_hotcpu_notifier(&vi->nb);
>
> /* Prevent config work handler from accessing the device */
dito
> - mutex_lock(&vi->config_lock);
> - vi->config_enable = false;
> - mutex_unlock(&vi->config_lock);
> + flush_work(&vi->config_work);
>
> netif_device_detach(vi->dev);
> cancel_delayed_work_sync(&vi->refill);
^ permalink raw reply
* Re: [PATCH 09/16] virtio-net: drop config_mutex
From: Sergei Shtylyov @ 2014-10-06 11:46 UTC (permalink / raw)
To: Michael S. Tsirkin, linux-kernel; +Cc: netdev, virtualization
In-Reply-To: <1412525038-15871-10-git-send-email-mst@redhat.com>
Hello.
On 10/5/2014 8:07 PM, Michael S. Tsirkin wrote:
> config_mutex served two purposes: prevent multiple concurrent config
> change handlers, and synchronize access to config_enable flag.
> Since commit dbf2576e37da0fcc7aacbfbb9fd5d3de7888a3c1
> workqueue: make all workqueues non-reentrant
> all workqueues are non-reentrant, and config_enable
> is now gone.
> Get rid of the unnecessary lock.
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> drivers/net/virtio_net.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index fa17afa..d80fef4 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
[...]
> @@ -1430,7 +1426,7 @@ static void virtnet_config_changed_work(struct work_struct *work)
> netif_tx_stop_all_queues(vi->dev);
> }
> done:
> - mutex_unlock(&vi->config_lock);
> + return;
There's no need for this *return*.
> }
>
> static void virtnet_config_changed(struct virtio_device *vdev)
WBR, Sergei
^ permalink raw reply
* [iproute2 1/1] RFC: obsolete direct invocation of police
From: Jamal Hadi Salim @ 2014-10-06 11:46 UTC (permalink / raw)
To: stephen; +Cc: netdev, xiyou.wangcong, john.r.fastabend, Jamal Hadi Salim
From: Jamal Hadi Salim <jhs@mojatatu.com>
I realize this may be controversial. I dont think people are still using
the 1990s syntax anymore. This is one way to test it.
We want to eventually phase out the kernel hacks for backward compat.
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
tc/f_basic.c | 9 +++------
tc/f_bpf.c | 9 +++------
tc/f_cgroup.c | 9 +++------
tc/f_flow.c | 9 +++------
tc/f_fw.c | 9 +++------
tc/f_route.c | 9 +++------
tc/f_rsvp.c | 9 +++------
tc/f_tcindex.c | 9 +++------
tc/f_u32.c | 10 +++-------
9 files changed, 27 insertions(+), 55 deletions(-)
diff --git a/tc/f_basic.c b/tc/f_basic.c
index 1c33ca3..6137f83 100644
--- a/tc/f_basic.c
+++ b/tc/f_basic.c
@@ -86,12 +86,9 @@ static int basic_parse_opt(struct filter_util *qu, char *handle,
continue;
} else if (matches(*argv, "police") == 0) {
- NEXT_ARG();
- if (parse_police(&argc, &argv, TCA_BASIC_POLICE, n)) {
- fprintf(stderr, "Illegal \"police\"\n");
- return -1;
- }
- continue;
+ fprintf(stderr, "Obsolete \"police\"\n");
+ fprintf(stderr, "use \"action police ...\"\n");
+ return -1;
} else if (strcmp(*argv, "help") == 0) {
explain();
return -1;
diff --git a/tc/f_bpf.c b/tc/f_bpf.c
index 48635a7..4d86f38 100644
--- a/tc/f_bpf.c
+++ b/tc/f_bpf.c
@@ -227,12 +227,9 @@ static int bpf_parse_opt(struct filter_util *qu, char *handle,
}
continue;
} else if (matches(*argv, "police") == 0) {
- NEXT_ARG();
- if (parse_police(&argc, &argv, TCA_BPF_POLICE, n)) {
- fprintf(stderr, "Illegal \"police\"\n");
- return -1;
- }
- continue;
+ fprintf(stderr, "Obsolete \"police\"\n");
+ fprintf(stderr, "use \"action police ...\"\n");
+ return -1;
} else if (strcmp(*argv, "help") == 0) {
explain();
return -1;
diff --git a/tc/f_cgroup.c b/tc/f_cgroup.c
index 53f7406..092050c 100644
--- a/tc/f_cgroup.c
+++ b/tc/f_cgroup.c
@@ -60,12 +60,9 @@ static int cgroup_parse_opt(struct filter_util *qu, char *handle,
continue;
} else if (matches(*argv, "police") == 0) {
- NEXT_ARG();
- if (parse_police(&argc, &argv, TCA_CGROUP_POLICE, n)) {
- fprintf(stderr, "Illegal \"police\"\n");
- return -1;
- }
- continue;
+ fprintf(stderr, "Obsolete \"police\"\n");
+ fprintf(stderr, "use \"action police ...\"\n");
+ return -1;
} else if (strcmp(*argv, "help") == 0) {
explain();
return -1;
diff --git a/tc/f_flow.c b/tc/f_flow.c
index b454a65..d021f6f 100644
--- a/tc/f_flow.c
+++ b/tc/f_flow.c
@@ -220,12 +220,9 @@ static int flow_parse_opt(struct filter_util *fu, char *handle,
}
addattr32(n, 4096, TCA_FLOW_PERTURB, tmp);
} else if (matches(*argv, "police") == 0) {
- NEXT_ARG();
- if (parse_police(&argc, &argv, TCA_FLOW_POLICE, n)) {
- fprintf(stderr, "Illegal \"police\"\n");
- return -1;
- }
- continue;
+ fprintf(stderr, "Obsolete \"police\"\n");
+ fprintf(stderr, "use \"action police ...\"\n");
+ return -1;
} else if (matches(*argv, "action") == 0) {
NEXT_ARG();
if (parse_action(&argc, &argv, TCA_FLOW_ACT, n)) {
diff --git a/tc/f_fw.c b/tc/f_fw.c
index 165f489..4b15cce1 100644
--- a/tc/f_fw.c
+++ b/tc/f_fw.c
@@ -78,12 +78,9 @@ static int fw_parse_opt(struct filter_util *qu, char *handle, int argc, char **a
}
addattr_l(n, 4096, TCA_FW_CLASSID, &handle, 4);
} else if (matches(*argv, "police") == 0) {
- NEXT_ARG();
- if (parse_police(&argc, &argv, TCA_FW_POLICE, n)) {
- fprintf(stderr, "Illegal \"police\"\n");
- return -1;
- }
- continue;
+ fprintf(stderr, "Obsolete \"police\"\n");
+ fprintf(stderr, "use \"action police ...\"\n");
+ return -1;
} else if (matches(*argv, "action") == 0) {
NEXT_ARG();
if (parse_action(&argc, &argv, TCA_FW_ACT, n)) {
diff --git a/tc/f_route.c b/tc/f_route.c
index 23c4ecc..7603c0e 100644
--- a/tc/f_route.c
+++ b/tc/f_route.c
@@ -99,12 +99,9 @@ static int route_parse_opt(struct filter_util *qu, char *handle, int argc, char
}
addattr_l(n, 4096, TCA_ROUTE4_CLASSID, &handle, 4);
} else if (matches(*argv, "police") == 0) {
- NEXT_ARG();
- if (parse_police(&argc, &argv, TCA_ROUTE4_POLICE, n)) {
- fprintf(stderr, "Illegal \"police\"\n");
- return -1;
- }
- continue;
+ fprintf(stderr, "Obsolete \"police\"\n");
+ fprintf(stderr, "use \"action police ...\"\n");
+ return -1;
} else if (matches(*argv, "action") == 0) {
NEXT_ARG();
if (parse_action(&argc, &argv, TCA_ROUTE4_ACT, n)) {
diff --git a/tc/f_rsvp.c b/tc/f_rsvp.c
index cb7b8fb..b1af8fb 100644
--- a/tc/f_rsvp.c
+++ b/tc/f_rsvp.c
@@ -269,12 +269,9 @@ static int rsvp_parse_opt(struct filter_util *qu, char *handle, int argc, char *
}
continue;
} else if (matches(*argv, "police") == 0) {
- NEXT_ARG();
- if (parse_police(&argc, &argv, TCA_RSVP_POLICE, n)) {
- fprintf(stderr, "Illegal \"police\"\n");
- return -1;
- }
- continue;
+ fprintf(stderr, "Obsolete \"police\"\n");
+ fprintf(stderr, "use \"action police ...\"\n");
+ return -1;
} else if (strcmp(*argv, "help") == 0) {
explain();
return -1;
diff --git a/tc/f_tcindex.c b/tc/f_tcindex.c
index b1847c8..e7a08d9 100644
--- a/tc/f_tcindex.c
+++ b/tc/f_tcindex.c
@@ -99,12 +99,9 @@ static int tcindex_parse_opt(struct filter_util *qu, char *handle, int argc,
addattr_l(n, 4096, TCA_TCINDEX_CLASSID, &handle, 4);
}
else if (!strcmp(*argv,"police")) {
- NEXT_ARG();
- if (parse_police(&argc, &argv, TCA_TCINDEX_POLICE, n)) {
- fprintf(stderr, "Illegal \"police\"\n");
- return -1;
- }
- continue;
+ fprintf(stderr, "Obsolete \"police\"\n");
+ fprintf(stderr, "use \"action police ...\"\n");
+ return -1;
}
else if (!strcmp(*argv,"action")) {
NEXT_ARG();
diff --git a/tc/f_u32.c b/tc/f_u32.c
index 80a5097..a7b3da6 100644
--- a/tc/f_u32.c
+++ b/tc/f_u32.c
@@ -1131,13 +1131,9 @@ static int u32_parse_opt(struct filter_util *qu, char *handle,
continue;
} else if (matches(*argv, "police") == 0) {
- NEXT_ARG();
- if (parse_police(&argc, &argv, TCA_U32_POLICE, n)) {
- fprintf(stderr, "Illegal \"police\"\n");
- return -1;
- }
- terminal_ok++;
- continue;
+ fprintf(stderr, "Obsolete \"police\"\n");
+ fprintf(stderr, "use \"action police ...\"\n");
+ return -1;
} else if (strcmp(*argv, "help") == 0) {
explain();
return -1;
--
1.7.9.5
^ permalink raw reply related
* [iproute2 1/1] discourage use of direct policer interface
From: Jamal Hadi Salim @ 2014-10-06 11:41 UTC (permalink / raw)
To: stephen
Cc: netdev, xiyou.wangcong, john.r.fastabend, Jamal Hadi Salim,
Jamal Hadi Salim
From: Jamal Hadi Salim <hadi@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
tc/f_basic.c | 3 ++-
tc/f_bpf.c | 5 +++--
tc/f_cgroup.c | 4 ++--
tc/f_flow.c | 2 +-
tc/f_fw.c | 4 ++--
tc/f_rsvp.c | 4 ++--
tc/f_u32.c | 2 +-
7 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/tc/f_basic.c b/tc/f_basic.c
index 67d26ec..1c33ca3 100644
--- a/tc/f_basic.c
+++ b/tc/f_basic.c
@@ -27,11 +27,12 @@
static void explain(void)
{
- fprintf(stderr, "Usage: ... basic [ match EMATCH_TREE ] [ police POLICE_SPEC ]\n");
+ fprintf(stderr, "Usage: ... basic [ match EMATCH_TREE ] \n");
fprintf(stderr, " [ action ACTION_SPEC ] [ classid CLASSID ]\n");
fprintf(stderr, "\n");
fprintf(stderr, "Where: SELECTOR := SAMPLE SAMPLE ...\n");
fprintf(stderr, " FILTERID := X:Y:Z\n");
+ fprintf(stderr, " ACTION_SPEC := ... look at individual actions\n");
fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n");
}
diff --git a/tc/f_bpf.c b/tc/f_bpf.c
index 8f1593c..48635a7 100644
--- a/tc/f_bpf.c
+++ b/tc/f_bpf.c
@@ -34,13 +34,14 @@ static void explain(void)
fprintf(stderr, " [inline]: run bytecode BPF_BYTECODE\n");
fprintf(stderr, " [from file]: run bytecode-file FILE\n");
fprintf(stderr, "\n");
- fprintf(stderr, " [ police POLICE_SPEC ] [ action ACTION_SPEC ]\n");
+ fprintf(stderr, " [ action ACTION_SPEC ]\n");
fprintf(stderr, " [ classid CLASSID ]\n");
fprintf(stderr, "\n");
fprintf(stderr, "Where BPF_BYTECODE := \'s,c t f k,c t f k,c t f k,...\'\n");
fprintf(stderr, " c,t,f,k and s are decimals; s denotes number of 4-tuples\n");
fprintf(stderr, "Where FILE points to a file containing the BPF_BYTECODE string\n");
- fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n");
+ fprintf(stderr, "\nACTION_SPEC := ... look at individual actions\n");
+ fprintf(stderr, "NOTE: CLASSID is parsed as hexadecimal input.\n");
}
static int bpf_parse_string(char *arg, bool from_file, __u16 *bpf_len,
diff --git a/tc/f_cgroup.c b/tc/f_cgroup.c
index 4a4026e..53f7406 100644
--- a/tc/f_cgroup.c
+++ b/tc/f_cgroup.c
@@ -18,8 +18,8 @@
static void explain(void)
{
- fprintf(stderr, "Usage: ... cgroup [ match EMATCH_TREE ] [ police POLICE_SPEC ]\n");
- fprintf(stderr, " [ action ACTION_SPEC ]\n");
+ fprintf(stderr, "Usage: ... cgroup [ match EMATCH_TREE ]\n");
+ fprintf(stderr, " [ action ACTION_SPEC ]\n");
}
static int cgroup_parse_opt(struct filter_util *qu, char *handle,
diff --git a/tc/f_flow.c b/tc/f_flow.c
index 7d4bb7a..b454a65 100644
--- a/tc/f_flow.c
+++ b/tc/f_flow.c
@@ -27,7 +27,7 @@ static void explain(void)
" [hashing mode]: hash keys KEY-LIST ... [ perturb SECS ]\n"
"\n"
" [ divisor NUM ] [ baseclass ID ] [ match EMATCH_TREE ]\n"
-" [ police POLICE_SPEC ] [ action ACTION_SPEC ]\n"
+" [ action ACTION_SPEC ]\n"
"\n"
"KEY-LIST := [ KEY-LIST , ] KEY\n"
"KEY := [ src | dst | proto | proto-src | proto-dst | iif | priority | \n"
diff --git a/tc/f_fw.c b/tc/f_fw.c
index 161e2f7..165f489 100644
--- a/tc/f_fw.c
+++ b/tc/f_fw.c
@@ -25,8 +25,8 @@
static void explain(void)
{
- fprintf(stderr, "Usage: ... fw [ classid CLASSID ] [ police POLICE_SPEC ]\n");
- fprintf(stderr, " POLICE_SPEC := ... look at TBF\n");
+ fprintf(stderr, "Usage: ... fw [ classid CLASSID ] [ action ACTION_SPEC ]\n");
+ fprintf(stderr, " ACTION_SPEC := ... look at individual actions\n");
fprintf(stderr, " CLASSID := X:Y\n");
fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n");
}
diff --git a/tc/f_rsvp.c b/tc/f_rsvp.c
index 14f24b1..cb7b8fb 100644
--- a/tc/f_rsvp.c
+++ b/tc/f_rsvp.c
@@ -28,11 +28,11 @@ static void explain(void)
{
fprintf(stderr, "Usage: ... rsvp ipproto PROTOCOL session DST[/PORT | GPI ]\n");
fprintf(stderr, " [ sender SRC[/PORT | GPI ]\n");
- fprintf(stderr, " [ classid CLASSID ] [ police POLICE_SPEC ]\n");
+ fprintf(stderr, " [ classid CLASSID ] [ action ACTION_SPEC ]\n");
fprintf(stderr, " [ tunnelid ID ] [ tunnel ID skip NUMBER ]\n");
fprintf(stderr, "Where: GPI := { flowlabel NUMBER | spi/ah SPI | spi/esp SPI |\n");
fprintf(stderr, " u{8|16|32} NUMBER mask MASK at OFFSET}\n");
- fprintf(stderr, " POLICE_SPEC := ... look at TBF\n");
+ fprintf(stderr, " ACTION_SPEC := ... look at individual actions\n");
fprintf(stderr, " FILTERID := X:Y\n");
fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n");
}
diff --git a/tc/f_u32.c b/tc/f_u32.c
index f2a862d..80a5097 100644
--- a/tc/f_u32.c
+++ b/tc/f_u32.c
@@ -32,7 +32,7 @@ static void explain(void)
{
fprintf(stderr, "Usage: ... u32 [ match SELECTOR ... ] [ link HTID ]"
" [ classid CLASSID ]\n");
- fprintf(stderr, " [ police POLICE_SPEC ]"
+ fprintf(stderr, " [ action ACTION_SPEC ]"
" [ offset OFFSET_SPEC ]\n");
fprintf(stderr, " [ ht HTID ] [ hashkey HASHKEY_SPEC ]\n");
fprintf(stderr, " [ sample SAMPLE ]\n");
--
1.7.9.5
^ permalink raw reply related
* [iproute2 2/2] route classifier support for multiple actions
From: Jamal Hadi Salim @ 2014-10-06 11:30 UTC (permalink / raw)
To: stephen; +Cc: netdev, xiyou.wangcong, john.r.fastabend, Jamal Hadi Salim
In-Reply-To: <1412595017-6346-1-git-send-email-jhs@emojatatu.com>
From: Jamal Hadi Salim <jhs@mojatatu.com>
route can now use the action syntax
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
tc/f_route.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/tc/f_route.c b/tc/f_route.c
index 649e0ec..23c4ecc 100644
--- a/tc/f_route.c
+++ b/tc/f_route.c
@@ -28,8 +28,8 @@
static void explain(void)
{
fprintf(stderr, "Usage: ... route [ from REALM | fromif TAG ] [ to REALM ]\n");
- fprintf(stderr, " [ flowid CLASSID ] [ police POLICE_SPEC ]\n");
- fprintf(stderr, " POLICE_SPEC := ... look at TBF\n");
+ fprintf(stderr, " [ flowid CLASSID ] [ action ACTION_SPEC ]]\n");
+ fprintf(stderr, " ACTION_SPEC := ... look at individual actions\n");
fprintf(stderr, " CLASSID := X:Y\n");
fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n");
}
@@ -105,6 +105,13 @@ static int route_parse_opt(struct filter_util *qu, char *handle, int argc, char
return -1;
}
continue;
+ } else if (matches(*argv, "action") == 0) {
+ NEXT_ARG();
+ if (parse_action(&argc, &argv, TCA_ROUTE4_ACT, n)) {
+ fprintf(stderr, "Illegal \"action\"\n");
+ return -1;
+ }
+ continue;
} else if (matches(*argv, "order") == 0) {
NEXT_ARG();
if (get_u32(&order, *argv, 0)) {
@@ -158,6 +165,8 @@ static int route_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt,
fprintf(f, "fromif %s", ll_index_to_name(*(int*)RTA_DATA(tb[TCA_ROUTE4_IIF])));
if (tb[TCA_ROUTE4_POLICE])
tc_print_police(f, tb[TCA_ROUTE4_POLICE]);
+ if (tb[TCA_ROUTE4_ACT])
+ tc_print_action(f, tb[TCA_ROUTE4_ACT]);
return 0;
}
--
1.7.9.5
^ permalink raw reply related
* [iproute2 1/2] tcindex classifier support for multiple actions
From: Jamal Hadi Salim @ 2014-10-06 11:30 UTC (permalink / raw)
To: stephen; +Cc: netdev, xiyou.wangcong, john.r.fastabend, Jamal Hadi Salim
From: Jamal Hadi Salim <jhs@mojatatu.com>
tcindex can now use the action syntax
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
tc/f_tcindex.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/tc/f_tcindex.c b/tc/f_tcindex.c
index 590c0a6..b1847c8 100644
--- a/tc/f_tcindex.c
+++ b/tc/f_tcindex.c
@@ -21,7 +21,7 @@ static void explain(void)
" [ shift SHIFT ]\n");
fprintf(stderr," [ pass_on | fall_through ]\n");
fprintf(stderr," [ classid CLASSID ] "
- "[ police POLICE_SPEC ]\n");
+ "[ action ACTION_SPEC ]\n");
}
static int tcindex_parse_opt(struct filter_util *qu, char *handle, int argc,
@@ -106,6 +106,14 @@ static int tcindex_parse_opt(struct filter_util *qu, char *handle, int argc,
}
continue;
}
+ else if (!strcmp(*argv,"action")) {
+ NEXT_ARG();
+ if (parse_police(&argc, &argv, TCA_TCINDEX_ACT, n)) {
+ fprintf(stderr, "Illegal \"action\"\n");
+ return -1;
+ }
+ continue;
+ }
else {
explain();
return -1;
@@ -171,6 +179,10 @@ static int tcindex_print_opt(struct filter_util *qu, FILE *f,
fprintf(f, "\n");
tc_print_police(f, tb[TCA_TCINDEX_POLICE]);
}
+ if (tb[TCA_TCINDEX_ACT]) {
+ fprintf(f, "\n");
+ tc_print_police(f, tb[TCA_TCINDEX_ACT]);
+ }
return 0;
}
--
1.7.9.5
^ permalink raw reply related
* Re: netlink NETLINK_ROUTE failure & Can the kernel really handle IPv6 properly
From: Ulf Samuelsson @ 2014-10-06 11:25 UTC (permalink / raw)
To: David Miller; +Cc: dcbw, netdev, hannes, netdev
In-Reply-To: <20141003.114949.826855678619123407.davem@davemloft.net>
On 10/03/2014 08:49 PM, David Miller wrote:
> From: Ulf Samuelsson <ulf.samuelsson@ericsson.com>
> Date: Fri, 3 Oct 2014 09:59:39 +0200
>
>> The kernel module is a control module which collects information
>> both from the kernel and from H/W, and talks to a userspace interface
>> manager.
>>
>> There is a proprietary management application which is used to
>> configure the stack.
>> This talks to the interface manager to handle different operations for
>> IPv6.
>>
>> The kernel module needs to know when interfaces are ready to use,
>> I.E: know when it exits "tentative" mode to do its job properly,
>> so the kernel module has to listen for RTM_NEWADDR.
>>
>> In a simpler system, your approach would be OK.
> Sorry, we're not going to help you with a proprietary driver
> of this kind.
>
> They should really just follow our upstream efforts to design
> a usable kernel framework for bridge and routing hardware offloads.
Whether to use a kernel framework or not is not my decision,
and I don't even work with that code.
What should interest the community is that a lot of stuff is probably
not working properly, when IPv6 link-local addresses are used.
Listening for NETDEV_UP, which is used in many places in the kernel,
seems incorrect,
since connection to the link-local address will fail until the
link-local address is verified.
It is not immediately obvious, since after 1-2 seconds the problem
disappears.
For that, listening to the RTM_NEWADDR seems mandatory, so
any framework would benefit from a solution as well.
Best Regards,
Ulf Samuelsson
'
^ permalink raw reply
* Re: [Patch net-next] net_sched: refactor out tcf_exts
From: Jamal Hadi Salim @ 2014-10-06 11:20 UTC (permalink / raw)
To: Cong Wang, netdev; +Cc: John Fastabend, David S. Miller
In-Reply-To: <1412376709-25564-1-git-send-email-xiyou.wangcong@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 192 bytes --]
Sorry for being annoying.
Cong - here's a simple test that will test for both .police and .action
for one classifier. If you have time please run it when updating your
patch.
cheers,
jamal
[-- Attachment #2: rsvp-test1 --]
[-- Type: text/plain, Size: 1808 bytes --]
export TC=/path/to/updatedtc
sudo $TC qdisc del dev eth0 root handle 1:0 prio
sudo $TC qdisc add dev eth0 root handle 1:0 prio
sudo $TC filter add dev eth0 pref 10 proto ip parent 1:0 rsvp session 10.0.0.1 ipproto icmp classid 1:1 police rate 1kbit burst 90k conform-exceed drop/ok
#display stats
$TC -s filter show dev eth0 parent 1:0
filter protocol ip pref 10 rsvp
filter protocol ip pref 10 rsvp fh 0x0001100a flowid 1:1 session 10.0.0.1 ipproto icmp
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
sudo ping -f 10.0.0.1 -c 10000
#display stats again..
$TC -s filter show dev eth0 parent 1:0
#
#
#lets redo with action semantics (two actions in the graph)
sudo $TC qdisc del dev eth0 root handle 1:0 prio
sudo $TC qdisc add dev eth0 root handle 1:0 prio
sudo $TC filter add dev eth0 pref 10 proto ip parent 1:0 \
rsvp session 10.0.0.1 ipproto icmp \
classid 1:1 \
action police rate 1kbit burst 90k pipe \
action ok
sudo ping -f 10.0.0.1 -c 1000
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
--- 10.0.0.1 ping statistics ---
1000 packets transmitted, 1000 received, 0% packet loss, time 377ms
rtt min/avg/max/mdev = 0.282/0.332/0.933/0.042 ms, ipg/ewma 0.378/0.333 ms
#display stats
$TC -s filter show dev eth0 parent 1:0
filter protocol ip pref 10 rsvp
filter protocol ip pref 10 rsvp fh 0x0001100a flowid 1:1 session 10.0.0.1 ipproto icmp
action order 1: police 0x5 rate 1Kbit burst 23440b mtu 2Kb action pipe overhead 0b
ref 1 bind 1
Action statistics:
Sent 98000 bytes 1000 pkt (dropped 0, overlimits 761 requeues 0)
backlog 0b 0p requeues 0
action order 2: gact action pass
random type none pass val 0
index 2 ref 1 bind 1 installed 60 sec used 3 sec
Action statistics:
Sent 74578 bytes 761 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
^ permalink raw reply
* RE: [PATCH] sctp: handle association restarts when the socket is closed.
From: David Laight @ 2014-10-06 11:09 UTC (permalink / raw)
To: 'David Miller', vyasevich@gmail.com; +Cc: netdev@vger.kernel.org
In-Reply-To: <20141006.002229.1370132762577292096.davem@davemloft.net>
From: David Miller
> From: Vladislav Yasevich <vyasevich@gmail.com>
> Date: Fri, 3 Oct 2014 18:16:20 -0400
>
> > From: Vlad Yasevich <vyasevich@gmail.com>
> >
> > Currently association restarts do not take into consideration the
> > state of the socket. When a restart happens, the current assocation
> > simply transitions into established state. This creates a condition
> > where a remote system, through a the restart procedure, may create a
> > local association that is no way reachable by user. The conditions
> > to trigger this are as follows:
> > 1) Remote does not acknoledge some data causing data to remain
> > outstanding.
> > 2) Local application calls close() on the socket. Since data
> > is still outstanding, the association is placed in SHUTDOWN_PENDING
> > state. However, the socket is closed.
> > 3) The remote tries to create a new association, triggering a restart
> > on the local system. The association moves from SHUTDOWN_PENDING
> > to ESTABLISHED. At this point, it is no longer reachable by
> > any socket on the local system.
> >
> > This patch addresses the above situation by moving the newly ESTABLISHED
> > association into SHUTDOWN-SENT state and bundling a SHUTDOWN after
> > the COOKIE-ACK chunk. This way, the restarted associate immidiately
> > enters the shutdown procedure and forces the termination of the
> > unreachable association.
> >
> > Reported-by: David Laight <David.Laight@aculab.com>
> > Signed-off-by: Vlad Yasevich <vyasevich@gmail.com>
>
> Applied, thanks.
>
> Candidate for -stable?
Maybe, but while I raised the problem and tested the fix, I added
a workaround to our M3UA code to ABORT sctp connections.
I'll predicate it on a kernel version when I know which one it is in,
but I'm not going to check backports to old distributions.
(I'm tempted to disable sctp on 2.6.18 kernels...)
So I'm not worried -stable.
Other sctp users may be more worried.
David
^ permalink raw reply
* Re: [Patch net-next] net_sched: refactor out tcf_exts
From: Jamal Hadi Salim @ 2014-10-06 11:09 UTC (permalink / raw)
To: Cong Wang, netdev; +Cc: John Fastabend, David S. Miller
In-Reply-To: <1412376709-25564-1-git-send-email-xiyou.wangcong@gmail.com>
On 10/03/14 18:51, Cong Wang wrote:
> As Jamal pointed it out, tcf_exts is really unnecessary,
> we can definitely refactor it out without losing any functionality.
> This could also remove an indirect layer which makes the code
> much easier to read.
>
> This patch:
>
> 1) moves exts->action and exts->police into tp->ops, since they
> are statically assigned
>
> 2) moves exts->actions list head out
>
> 3) removes exts->type, act->type does the same thing
>
> 4) renames tcf_exts_*() functions to tcf_act_*()
>
> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> Cc: John Fastabend <john.r.fastabend@intel.com>
> Cc: "David S. Miller" <davem@davemloft.net>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Thanks for doing the work Cong.
I noticed John points to an issue in his testing; but
please add my:
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
I will start sending incremental patches to iproute2 to slowly get
rid of direct police interfacing which will allow us to get rid of
.police dereference altogether.
It was a mistake not to do it years ago.
One way to accelerate it right now is to log a "deprecated"
message everytime someone uses TCA_XXX_POLICE attributes.
cheers,
jamal
^ permalink raw reply
* [PATCH net-next] icmp6: Add new icmpv6 type for RPL control message
From: Simon Vincent @ 2014-10-06 10:37 UTC (permalink / raw)
To: netdev; +Cc: Simon Vincent
IANA has defined a type value of 155 for RPL control messages.
We do nothing if we recieve one of these messages. This patch is to
avoid getting lots of icmpv6 unknown type messages when using RPL.
Signed-off-by: Simon Vincent <simon.vincent@xsilon.com>
---
include/uapi/linux/icmpv6.h | 2 ++
net/ipv6/icmp.c | 1 +
2 files changed, 3 insertions(+)
diff --git a/include/uapi/linux/icmpv6.h b/include/uapi/linux/icmpv6.h
index 590beda..0d493c1 100644
--- a/include/uapi/linux/icmpv6.h
+++ b/include/uapi/linux/icmpv6.h
@@ -107,6 +107,8 @@ struct icmp6hdr {
#define ICMPV6_MOBILE_PREFIX_SOL 146
#define ICMPV6_MOBILE_PREFIX_ADV 147
+#define ICMPV6_RPL_CONTROL 155
+
/*
* Codes for Destination Unreachable
*/
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 141e1f3..525ad3c 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -774,6 +774,7 @@ static int icmpv6_rcv(struct sk_buff *skb)
case ICMPV6_DHAAD_REPLY:
case ICMPV6_MOBILE_PREFIX_SOL:
case ICMPV6_MOBILE_PREFIX_ADV:
+ case ICMPV6_RPL_CONTROL:
break;
default:
--
1.9.1
^ permalink raw reply related
* RE: [PATCH net-next] net: introduce netdevice gso_min_segs attribute
From: David Laight @ 2014-10-06 10:20 UTC (permalink / raw)
To: 'Eric Dumazet', Amir Vadai, David S. Miller
Cc: Eric Dumazet, netdev@vger.kernel.org, Yevgeny Petrilin,
Or Gerlitz, Ido Shamay
In-Reply-To: <1412529087.11091.14.camel@edumazet-glaptop2.roam.corp.google.com>
From: Eric Dumazet <edumazet@google.com>
> Some TSO engines might have a too heavy setup cost, that impacts
> performance on hosts sending small bursts (2 MSS per packet).
>
> This patch adds a device gso_min_segs, allowing drivers to set
> a minimum segment size for TSO packets, according to the NIC
> performance.
>
> Tested on a mlx4 NIC, this allows to get a ~110% increase of
> throughput when sending 2 MSS per packet.
Doesn't this all depend on what you need to optimise for.
I can think of three^Wseveral main cases:
1) minimising cpu use while saturating the local network.
2) minimising latency for single packets.
3) maximising throughput for a single connection.
4) minimising cpu use when handling a large number of connections.
plus all the variations in packet size.
I'm not sure what you are trading for what here.
Maybe gso = tx_bursting is almost always faster on some hardware?
(Especially if an idle mac engine is 'kicked' for the first packet
of a burst.)
David
^ 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