* Re: [PATCH 3/4] net: ethernet: cpsw: split out IRQ handler
From: Felipe Balbi @ 2015-01-02 18:55 UTC (permalink / raw)
To: Dave Taht; +Cc: Felipe Balbi, Linux OMAP Mailing List, netdev
In-Reply-To: <CAA93jw7qyZjdHGKXjiBhiYp4BWBFrUFM6FF-Lzc0i7eOnM6cNg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 5700 bytes --]
Hi,
On Fri, Jan 02, 2015 at 10:49:49AM -0800, Dave Taht wrote:
> +1.
>
> We'd had a thread on netdev (can't find it now) where we discussed
> adding BQL support and also something saner for the NAPI handling to
> this driver.
yeah, currently is completely borked. I'm on a gigabit network and I'm
getting 94Mbits/sec, total crap.
> Initial results for the beaglebone black were pretty spectacular, and
> it does look like this is way cleaner infrastructure underneat th deal
> with. Are you testing
cool, if I new more about networking I'd certainly help, but I can help
testing for sure, just keep me in Cc ;-)
> on the beaglebone black.? do you remember that convo?
yeah, testing on beagleboneblack and AM437x SK.
cheers
> On Fri, Jan 2, 2015 at 10:10 AM, Felipe Balbi <balbi@ti.com> wrote:
> > Now we can introduce dedicated IRQ handlers
> > for each of the IRQ events. This helps with
> > cleaning up a little bit of the clutter in
> > cpsw_interrupt() while also making sure that
> > TX IRQs will try to handle TX buffers while
> > RX IRQs will try to handle RX buffers.
> >
> > Signed-off-by: Felipe Balbi <balbi@ti.com>
> > ---
> > drivers/net/ethernet/ti/cpsw.c | 41 ++++++++++++++++++++++++++++++-----------
> > 1 file changed, 30 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
> > index 6e04128..c9081bd 100644
> > --- a/drivers/net/ethernet/ti/cpsw.c
> > +++ b/drivers/net/ethernet/ti/cpsw.c
> > @@ -754,18 +754,36 @@ requeue:
> > dev_kfree_skb_any(new_skb);
> > }
> >
> > -static irqreturn_t cpsw_interrupt(int irq, void *dev_id)
> > +static irqreturn_t cpsw_dummy_interrupt(int irq, void *dev_id)
> > {
> > struct cpsw_priv *priv = dev_id;
> > int value = irq - priv->irqs_table[0];
> >
> > - /* NOTICE: Ending IRQ here. The trick with the 'value' variable above
> > - * is to make sure we will always write the correct value to the EOI
> > - * register. Namely 0 for RX_THRESH Interrupt, 1 for RX Interrupt, 2
> > - * for TX Interrupt and 3 for MISC Interrupt.
> > - */
> > cpdma_ctlr_eoi(priv->dma, value);
> >
> > + return IRQ_HANDLED;
> > +}
> > +
> > +static irqreturn_t cpsw_tx_interrupt(int irq, void *dev_id)
> > +{
> > + struct cpsw_priv *priv = dev_id;
> > +
> > + cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX);
> > + cpdma_chan_process(priv->txch, 128);
> > +
> > + priv = cpsw_get_slave_priv(priv, 1);
> > + if (priv)
> > + cpdma_chan_process(priv->txch, 128);
> > +
> > + return IRQ_HANDLED;
> > +}
> > +
> > +static irqreturn_t cpsw_rx_interrupt(int irq, void *dev_id)
> > +{
> > + struct cpsw_priv *priv = dev_id;
> > +
> > + cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
> > +
> > cpsw_intr_disable(priv);
> > if (priv->irq_enabled == true) {
> > cpsw_disable_irq(priv);
> > @@ -1617,7 +1635,8 @@ static void cpsw_ndo_poll_controller(struct net_device *ndev)
> >
> > cpsw_intr_disable(priv);
> > cpdma_ctlr_int_ctrl(priv->dma, false);
> > - cpsw_interrupt(ndev->irq, priv);
> > + cpsw_rx_interrupt(priv->irq[1], priv);
> > + cpsw_tx_interrupt(priv->irq[2], priv);
> > cpdma_ctlr_int_ctrl(priv->dma, true);
> > cpsw_intr_enable(priv);
> > }
> > @@ -2351,7 +2370,7 @@ static int cpsw_probe(struct platform_device *pdev)
> > goto clean_ale_ret;
> >
> > priv->irqs_table[0] = irq;
> > - ret = devm_request_irq(&pdev->dev, irq, cpsw_interrupt,
> > + ret = devm_request_irq(&pdev->dev, irq, cpsw_dummy_interrupt,
> > 0, dev_name(&pdev->dev), priv);
> > if (ret < 0) {
> > dev_err(priv->dev, "error attaching irq (%d)\n", ret);
> > @@ -2363,7 +2382,7 @@ static int cpsw_probe(struct platform_device *pdev)
> > goto clean_ale_ret;
> >
> > priv->irqs_table[1] = irq;
> > - ret = devm_request_irq(&pdev->dev, irq, cpsw_interrupt,
> > + ret = devm_request_irq(&pdev->dev, irq, cpsw_rx_interrupt,
> > 0, dev_name(&pdev->dev), priv);
> > if (ret < 0) {
> > dev_err(priv->dev, "error attaching irq (%d)\n", ret);
> > @@ -2375,7 +2394,7 @@ static int cpsw_probe(struct platform_device *pdev)
> > goto clean_ale_ret;
> >
> > priv->irqs_table[2] = irq;
> > - ret = devm_request_irq(&pdev->dev, irq, cpsw_interrupt,
> > + ret = devm_request_irq(&pdev->dev, irq, cpsw_tx_interrupt,
> > 0, dev_name(&pdev->dev), priv);
> > if (ret < 0) {
> > dev_err(priv->dev, "error attaching irq (%d)\n", ret);
> > @@ -2387,7 +2406,7 @@ static int cpsw_probe(struct platform_device *pdev)
> > goto clean_ale_ret;
> >
> > priv->irqs_table[3] = irq;
> > - ret = devm_request_irq(&pdev->dev, irq, cpsw_interrupt,
> > + ret = devm_request_irq(&pdev->dev, irq, cpsw_dummy_interrupt,
> > 0, dev_name(&pdev->dev), priv);
> > if (ret < 0) {
> > dev_err(priv->dev, "error attaching irq (%d)\n", ret);
> > --
> > 2.2.0
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe netdev" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
>
> --
> Dave Täht
>
> thttp://www.bufferbloat.net/projects/bloat/wiki/Upcoming_Talks
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH net-next] MAINTAINERS: Update Open vSwitch entry.
From: Pravin Shelar @ 2015-01-02 18:54 UTC (permalink / raw)
To: Joe Perches; +Cc: David Miller, netdev
In-Reply-To: <1420224077.23591.2.camel@perches.com>
On Fri, Jan 2, 2015 at 10:41 AM, Joe Perches <joe@perches.com> wrote:
> On Fri, 2015-01-02 at 10:24 -0800, Pravin B Shelar wrote:
>> OVS development is moved to netdev mailing list. Update tree and
>> list in MAINTAINERS file.
> []
>> diff --git a/MAINTAINERS b/MAINTAINERS
> []
>> @@ -7008,9 +7008,11 @@ F: arch/openrisc/
>>
>> OPENVSWITCH
>> M: Pravin Shelar <pshelar@nicira.com>
>> +L: netdev@vger.kernel.org
>> L: dev@openvswitch.org
>> W: http://openvswitch.org
>> -T: git git://git.kernel.org/pub/scm/linux/kernel/git/pshelar/openvswitch.git
>> +T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
>> +T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
>> S: Maintained
>> F: net/openvswitch/
>>
>
> Are those git entries really appropriate?
>
I am not maintaining my tree on kernel.org. All OVS development will
be done on net-next tree, I guess there is no need to explicitly
mention the tree. I will remove the tree information.
^ permalink raw reply
* Re: [PATCH net-next 00/11] Time Counter fixes and improvements
From: Richard Cochran @ 2015-01-02 18:49 UTC (permalink / raw)
To: John Stultz
Cc: netdev, lkml, Amir Vadai, Ariel Elior, Carolyn Wyborny,
David Miller, Frank Li, Jeff Kirsher, Matthew Vick,
Miroslav Lichvar, Mugunthan V N, Or Gerlitz, Thomas Gleixner,
Tom Lendacky
In-Reply-To: <CALAqxLUVU3XmBMiNGH-X5KjGbEjDYtaR2WRXDOHfGNads9caOw@mail.gmail.com>
On Fri, Jan 02, 2015 at 10:37:09AM -0800, John Stultz wrote:
> Though, this does start to sound like issues the timekeeping code had
> to resolve, so while its probably time to let some flowers bloom and
> see what happens, we should be somewhat watchful for too much logic
> duplication.
You took the words right out of my mouth.
My feeling is that this timecounter code might become more
complicated, and if the core time keeping becomes more
straightforward, then maybe one day the two will join.
Thanks,
Richard
^ permalink raw reply
* Re: [PATCH net-next] MAINTAINERS: Update Open vSwitch entry.
From: Joe Perches @ 2015-01-02 18:41 UTC (permalink / raw)
To: Pravin B Shelar; +Cc: davem, netdev
In-Reply-To: <1420223098-1591-1-git-send-email-pshelar@nicira.com>
On Fri, 2015-01-02 at 10:24 -0800, Pravin B Shelar wrote:
> OVS development is moved to netdev mailing list. Update tree and
> list in MAINTAINERS file.
[]
> diff --git a/MAINTAINERS b/MAINTAINERS
[]
> @@ -7008,9 +7008,11 @@ F: arch/openrisc/
>
> OPENVSWITCH
> M: Pravin Shelar <pshelar@nicira.com>
> +L: netdev@vger.kernel.org
> L: dev@openvswitch.org
> W: http://openvswitch.org
> -T: git git://git.kernel.org/pub/scm/linux/kernel/git/pshelar/openvswitch.git
> +T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
> +T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
> S: Maintained
> F: net/openvswitch/
>
Are those git entries really appropriate?
^ permalink raw reply
* Re: [PATCH net-next 00/11] Time Counter fixes and improvements
From: John Stultz @ 2015-01-02 18:37 UTC (permalink / raw)
To: Richard Cochran
Cc: netdev, lkml, Amir Vadai, Ariel Elior, Carolyn Wyborny,
David Miller, Frank Li, Jeff Kirsher, Matthew Vick,
Miroslav Lichvar, Mugunthan V N, Or Gerlitz, Thomas Gleixner,
Tom Lendacky
In-Reply-To: <cover.1418504883.git.richardcochran@gmail.com>
On Sun, Dec 21, 2014 at 10:46 AM, Richard Cochran
<richardcochran@gmail.com> wrote:
> Several PTP Hardware Clock (PHC) drivers implement the clock in
> software using the timecounter/cyclecounter code. This series adds one
> simple improvement and one more subtle fix to the shared timecounter
> facility. Credit for this series goes to Janusz Użycki, who pointed
> the issues out to me off list.
>
> Patch #1 simply move the timecounter code into its own file. When
> working on this series, it was really annoying to see half the kernel
> recompile after every tweak to the timecounter stuff. There is no
> reason to keep this together with the clocksource code.
I did have some faint hope we could merge the cyclecounter and
clocksource struct at some point, and while we've gotten closer with
much of the time-specific values being kept in the timekeeper, the
full cleanup hasn't happened in a few years here, so its clearly not
something I've prioritized.
So no objection in concept.
> Patch #2 implements an improved adjtime() method, and patches 3-10
> convert all of the drivers over to the new method.
>
> Patch #11 fixes a subtle but important issue with the timecounter WRT
> frequency adjustment. As it stands now, a timecounter based PHC will
> exhibit a variable frequency resolution (and variable time error)
> depending on how often the clock is read.
>
> In timecounter_read_delta(), the expression
>
> (delta * cc->mult) >> cc->shift;
>
> can lose resolution from the adjusted value of 'mult'. If the value
> of 'delta' is too small, then small changes in 'mult' have no effect.
> However, if the delta value is large enough, then small changes in
> 'mult' will have an effect.
>
> Reading the clock too often means smaller 'delta' values which in turn
> will spoil the fine adjustments made to 'mult'. Up until now, this
> effect did not show up in my testing. The following example explains
> why.
>
> The CPTS has an input clock of 250 MHz, and the clock source uses
> mult=0x80000000 and shift=29, making the ticks to nanoseconds
> conversion like this:
>
> ticks * 2^31
> ------------
> 2^29
>
> Imagine what happens if the clock is read every 10 milliseconds. Ten
> milliseconds are about 2500000 ticks, which corresponds to about 21
> bits. The product in the numerator has then 52 bits. After the shift
> operation, 23 bits are preserved. This results in a frequency
> adjustment resolution of about 0.1 ppm (not _too_ bad.)
>
> A frequency resolution of 1 ppm requires 20 bits.
> A frequency resolution of 1 ppb requires 30 bits.
>
> For the 250 MHz CPTS clock, reading every 4 seconds yields a 1 ppb
> resolution (which is the finest that our API allows).
>
> However, the error can be much higher if the clock is read too often
> or if time stamps occur close in time to read operations. In general
> it is really not acceptable to allow the rate of clock readings to
> influence the clock accuracy.
Though, this does start to sound like issues the timekeeping code had
to resolve, so while its probably time to let some flowers bloom and
see what happens, we should be somewhat watchful for too much logic
duplication.
The patch set itself seems fairly straight forward (at least to my
back from vacation brain), so..
Acked-by: John Stultz <john.stultz@linaro.org>
thanks
-john
^ permalink raw reply
* Re: [PATCH 02/11] rtlwifi: rtl8723be: Improve modinfo output
From: Sergei Shtylyov @ 2015-01-02 18:35 UTC (permalink / raw)
To: Larry Finger, kvalo-sgV2jX0FEOL9JmXXK+q4OQ
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1420217908-1382-3-git-send-email-Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org>
Hello.
On 1/2/2015 7:58 PM, Larry Finger wrote:
> The description of the power-save variables for this driver is not as
> clear as for the others. The wording is changed to match the others.
> Signed-off-by: Larry Finger <Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org>
> ---
> drivers/net/wireless/rtlwifi/rtl8723be/sw.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
> diff --git a/drivers/net/wireless/rtlwifi/rtl8723be/sw.c b/drivers/net/wireless/rtlwifi/rtl8723be/sw.c
> index 223eb42..52a6d90 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8723be/sw.c
> +++ b/drivers/net/wireless/rtlwifi/rtl8723be/sw.c
> @@ -387,12 +387,13 @@ module_param_named(swlps, rtl8723be_mod_params.swctrl_lps, bool, 0444);
> module_param_named(fwlps, rtl8723be_mod_params.fwctrl_lps, bool, 0444);
> module_param_named(disable_watchdog, rtl8723be_mod_params.disable_watchdog,
> bool, 0444);
> -MODULE_PARM_DESC(swenc, "using hardware crypto (default 0 [hardware])\n");
> -MODULE_PARM_DESC(ips, "using no link power save (default 1 is open)\n");
> -MODULE_PARM_DESC(fwlps, "using linked fw control power save (default 1 is open)\n");
> -MODULE_PARM_DESC(msi, "Set to 1 to use MSI interrupts mode (default 0)\n");
You are completely removing this description. Is it intentional?
> +MODULE_PARM_DESC(swenc, "Set to 1 for software crypto (default 0)\n");
> +MODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n");
> +MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n");
> +MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n");
> MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)");
> -MODULE_PARM_DESC(disable_watchdog, "Set to 1 to disable the watchdog (default 0)\n");
> +MODULE_PARM_DESC(disable_watchdog,
> + "Set to 1 to disable the watchdog (default 0)\n");
WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH net-next] openvswitch: Do not set skb ignore_df
From: Pravin B Shelar @ 2015-01-02 18:27 UTC (permalink / raw)
To: davem; +Cc: netdev, dev, Pravin B Shelar
Tunnel transmit code clear this bit, so setting ignore_df has
no effect.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
---
net/openvswitch/vport-geneve.c | 1 -
net/openvswitch/vport-gre.c | 2 --
net/openvswitch/vport-vxlan.c | 2 --
3 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/net/openvswitch/vport-geneve.c b/net/openvswitch/vport-geneve.c
index 484864d..8769be9 100644
--- a/net/openvswitch/vport-geneve.c
+++ b/net/openvswitch/vport-geneve.c
@@ -209,7 +209,6 @@ static int geneve_tnl_send(struct vport *vport, struct sk_buff *skb)
df = tun_key->tun_flags & TUNNEL_DONT_FRAGMENT ? htons(IP_DF) : 0;
sport = udp_flow_src_port(net, skb, 1, USHRT_MAX, true);
tunnel_id_to_vni(tun_key->tun_id, vni);
- skb->ignore_df = 1;
err = geneve_xmit_skb(geneve_port->gs, rt, skb, fl.saddr,
tun_key->ipv4_dst, tun_key->ipv4_tos,
diff --git a/net/openvswitch/vport-gre.c b/net/openvswitch/vport-gre.c
index d4168c4..ec57221 100644
--- a/net/openvswitch/vport-gre.c
+++ b/net/openvswitch/vport-gre.c
@@ -194,8 +194,6 @@ static int gre_tnl_send(struct vport *vport, struct sk_buff *skb)
df = tun_key->tun_flags & TUNNEL_DONT_FRAGMENT ?
htons(IP_DF) : 0;
- skb->ignore_df = 1;
-
return iptunnel_xmit(skb->sk, rt, skb, fl.saddr,
tun_key->ipv4_dst, IPPROTO_GRE,
tun_key->ipv4_tos, tun_key->ipv4_ttl, df, false);
diff --git a/net/openvswitch/vport-vxlan.c b/net/openvswitch/vport-vxlan.c
index d7c46b3..dc6f625 100644
--- a/net/openvswitch/vport-vxlan.c
+++ b/net/openvswitch/vport-vxlan.c
@@ -175,8 +175,6 @@ static int vxlan_tnl_send(struct vport *vport, struct sk_buff *skb)
df = tun_key->tun_flags & TUNNEL_DONT_FRAGMENT ?
htons(IP_DF) : 0;
- skb->ignore_df = 1;
-
src_port = udp_flow_src_port(net, skb, 0, 0, true);
err = vxlan_xmit_skb(vxlan_port->vs, rt, skb,
--
1.7.1
^ permalink raw reply related
* [PATCH net-next] MAINTAINERS: Update Open vSwitch entry.
From: Pravin B Shelar @ 2015-01-02 18:24 UTC (permalink / raw)
To: davem; +Cc: netdev, Pravin B Shelar
OVS development is moved to netdev mailing list. Update tree and
list in MAINTAINERS file.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
---
MAINTAINERS | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index ddb9ac8..5c976cc 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7008,9 +7008,11 @@ F: arch/openrisc/
OPENVSWITCH
M: Pravin Shelar <pshelar@nicira.com>
+L: netdev@vger.kernel.org
L: dev@openvswitch.org
W: http://openvswitch.org
-T: git git://git.kernel.org/pub/scm/linux/kernel/git/pshelar/openvswitch.git
+T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
+T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
S: Maintained
F: net/openvswitch/
--
1.7.1
^ permalink raw reply related
* Re: tcp: Do not apply TSO segment limit to non-TSO packets
From: Eric Dumazet @ 2015-01-02 18:24 UTC (permalink / raw)
To: Herbert Xu
Cc: Thomas Jarosch, netdev, edumazet, Steffen Klassert, Ben Hutchings,
David S. Miller
In-Reply-To: <20141231134217.GB30248@gondor.apana.org.au>
On Thu, 2015-01-01 at 00:42 +1100, Herbert Xu wrote:
> On Thu, Jan 01, 2015 at 12:39:23AM +1100, Herbert Xu wrote:
> >
> > Thomas Jarosch reported IPsec TCP stalls when a PMTU event occurs.
> >
> > In fact the problem was completely unrelated to IPsec. The bug is
> > also reproducible if you just disable TSO/GSO.
>
> This raises two interesting questions.
>
> Firstly not many people test non-TSO code paths anymore so bugs
> are likely to persist for a long time there. Perhaps it's time
> to remove the non-TSO code path altogether? The GSO code path
> should provide enough speed-up in terms of boosting the effective
> MTU to offset the cost of copying.
> Secondly why are we dealing with hardware TSO segment limits
> by limiting the size of the TSO packet in the TCP stack? Surely
> in this case GSO is free since there won't be any copying?
It might depends on the device capabilities.
Non TSO/GSO path is known to be better for devices unable to perform TX
checksumming, as we compute the checksum at the time we copy data from
user to kernel (csum_and_copy_from_user() from tcp_sendmsg())).
With BQL+TSQ, having to compute the TX hash means bringing data into cpu
caches a second time right before ndo_start_xmit()
But maybe this gain is very relative in a full blown configuration, with
netfilter / complex qdisc being used.
Thanks Herbert !
^ permalink raw reply
* [PATCH] staging: r8188eu: Fix memory leak in firmware loading
From: Larry Finger @ 2015-01-02 18:17 UTC (permalink / raw)
To: gregkh; +Cc: devel, netdev, Larry Finger
The driver allocates memory to store the firmware image; however, that
memory is never released. The kmemleak facility was used to find this
error.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
drivers/staging/rtl8188eu/hal/fw.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/staging/rtl8188eu/hal/fw.c b/drivers/staging/rtl8188eu/hal/fw.c
index 3b28754..a5b7fc4 100644
--- a/drivers/staging/rtl8188eu/hal/fw.c
+++ b/drivers/staging/rtl8188eu/hal/fw.c
@@ -231,6 +231,7 @@ int rtl88eu_download_fw(struct adapter *adapt)
_rtl88e_enable_fw_download(adapt, false);
err = _rtl88e_fw_free_to_go(adapt);
+ kfree(pfwdata);
return err;
}
--
2.1.2
^ permalink raw reply related
* [PATCH 4/4] net: ethernet: cpsw: don't requests IRQs we don't use
From: Felipe Balbi @ 2015-01-02 18:10 UTC (permalink / raw)
To: David Miller
Cc: Mugunthan V N, Yegor Yefremov, Linux OMAP Mailing List, netdev,
Felipe Balbi
In-Reply-To: <1420222228-31949-1-git-send-email-balbi@ti.com>
CPSW never uses RX_THRESHOLD or MISC interrupts. In
fact, they are always kept masked in their appropriate
IRQ Enable register.
Instead of allocating an IRQ that never fires, it's best
to remove that code altogether and let future patches
implement it if anybody needs those.
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
drivers/net/ethernet/ti/cpsw.c | 55 ++++++++++++------------------------------
1 file changed, 15 insertions(+), 40 deletions(-)
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index c9081bd..fd0acd9 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -754,16 +754,6 @@ requeue:
dev_kfree_skb_any(new_skb);
}
-static irqreturn_t cpsw_dummy_interrupt(int irq, void *dev_id)
-{
- struct cpsw_priv *priv = dev_id;
- int value = irq - priv->irqs_table[0];
-
- cpdma_ctlr_eoi(priv->dma, value);
-
- return IRQ_HANDLED;
-}
-
static irqreturn_t cpsw_tx_interrupt(int irq, void *dev_id)
{
struct cpsw_priv *priv = dev_id;
@@ -1635,8 +1625,8 @@ static void cpsw_ndo_poll_controller(struct net_device *ndev)
cpsw_intr_disable(priv);
cpdma_ctlr_int_ctrl(priv->dma, false);
- cpsw_rx_interrupt(priv->irq[1], priv);
- cpsw_tx_interrupt(priv->irq[2], priv);
+ cpsw_rx_interrupt(priv->irq[0], priv);
+ cpsw_tx_interrupt(priv->irq[1], priv);
cpdma_ctlr_int_ctrl(priv->dma, true);
cpsw_intr_enable(priv);
}
@@ -2358,30 +2348,27 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_dma_ret;
}
- ndev->irq = platform_get_irq(pdev, 0);
+ ndev->irq = platform_get_irq(pdev, 1);
if (ndev->irq < 0) {
dev_err(priv->dev, "error getting irq resource\n");
ret = -ENOENT;
goto clean_ale_ret;
}
- irq = platform_get_irq(pdev, 0);
- if (irq < 0)
- goto clean_ale_ret;
-
- priv->irqs_table[0] = irq;
- ret = devm_request_irq(&pdev->dev, irq, cpsw_dummy_interrupt,
- 0, dev_name(&pdev->dev), priv);
- if (ret < 0) {
- dev_err(priv->dev, "error attaching irq (%d)\n", ret);
- goto clean_ale_ret;
- }
+ /* Grab RX and TX IRQs. Note that we also have RX_THRESHOLD and
+ * MISC IRQs which are always kept disabled with this driver so
+ * we will not request them.
+ *
+ * If anyone wants to implement support for those, make sure to
+ * first request and append them to irqs_table array.
+ */
+ /* RX IRQ */
irq = platform_get_irq(pdev, 1);
if (irq < 0)
goto clean_ale_ret;
- priv->irqs_table[1] = irq;
+ priv->irqs_table[0] = irq;
ret = devm_request_irq(&pdev->dev, irq, cpsw_rx_interrupt,
0, dev_name(&pdev->dev), priv);
if (ret < 0) {
@@ -2389,31 +2376,19 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_ale_ret;
}
+ /* TX IRQ */
irq = platform_get_irq(pdev, 2);
if (irq < 0)
goto clean_ale_ret;
- priv->irqs_table[2] = irq;
+ priv->irqs_table[1] = irq;
ret = devm_request_irq(&pdev->dev, irq, cpsw_tx_interrupt,
0, dev_name(&pdev->dev), priv);
if (ret < 0) {
dev_err(priv->dev, "error attaching irq (%d)\n", ret);
goto clean_ale_ret;
}
-
- irq = platform_get_irq(pdev, 3);
- if (irq < 0)
- goto clean_ale_ret;
-
- priv->irqs_table[3] = irq;
- ret = devm_request_irq(&pdev->dev, irq, cpsw_dummy_interrupt,
- 0, dev_name(&pdev->dev), priv);
- if (ret < 0) {
- dev_err(priv->dev, "error attaching irq (%d)\n", ret);
- goto clean_ale_ret;
- }
-
- priv->num_irqs = 4;
+ priv->num_irqs = 2;
ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
--
2.2.0
^ permalink raw reply related
* [PATCH 3/4] net: ethernet: cpsw: split out IRQ handler
From: Felipe Balbi @ 2015-01-02 18:10 UTC (permalink / raw)
To: David Miller
Cc: Mugunthan V N, Yegor Yefremov, Linux OMAP Mailing List, netdev,
Felipe Balbi
In-Reply-To: <1420222228-31949-1-git-send-email-balbi@ti.com>
Now we can introduce dedicated IRQ handlers
for each of the IRQ events. This helps with
cleaning up a little bit of the clutter in
cpsw_interrupt() while also making sure that
TX IRQs will try to handle TX buffers while
RX IRQs will try to handle RX buffers.
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
drivers/net/ethernet/ti/cpsw.c | 41 ++++++++++++++++++++++++++++++-----------
1 file changed, 30 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 6e04128..c9081bd 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -754,18 +754,36 @@ requeue:
dev_kfree_skb_any(new_skb);
}
-static irqreturn_t cpsw_interrupt(int irq, void *dev_id)
+static irqreturn_t cpsw_dummy_interrupt(int irq, void *dev_id)
{
struct cpsw_priv *priv = dev_id;
int value = irq - priv->irqs_table[0];
- /* NOTICE: Ending IRQ here. The trick with the 'value' variable above
- * is to make sure we will always write the correct value to the EOI
- * register. Namely 0 for RX_THRESH Interrupt, 1 for RX Interrupt, 2
- * for TX Interrupt and 3 for MISC Interrupt.
- */
cpdma_ctlr_eoi(priv->dma, value);
+ return IRQ_HANDLED;
+}
+
+static irqreturn_t cpsw_tx_interrupt(int irq, void *dev_id)
+{
+ struct cpsw_priv *priv = dev_id;
+
+ cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX);
+ cpdma_chan_process(priv->txch, 128);
+
+ priv = cpsw_get_slave_priv(priv, 1);
+ if (priv)
+ cpdma_chan_process(priv->txch, 128);
+
+ return IRQ_HANDLED;
+}
+
+static irqreturn_t cpsw_rx_interrupt(int irq, void *dev_id)
+{
+ struct cpsw_priv *priv = dev_id;
+
+ cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
+
cpsw_intr_disable(priv);
if (priv->irq_enabled == true) {
cpsw_disable_irq(priv);
@@ -1617,7 +1635,8 @@ static void cpsw_ndo_poll_controller(struct net_device *ndev)
cpsw_intr_disable(priv);
cpdma_ctlr_int_ctrl(priv->dma, false);
- cpsw_interrupt(ndev->irq, priv);
+ cpsw_rx_interrupt(priv->irq[1], priv);
+ cpsw_tx_interrupt(priv->irq[2], priv);
cpdma_ctlr_int_ctrl(priv->dma, true);
cpsw_intr_enable(priv);
}
@@ -2351,7 +2370,7 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_ale_ret;
priv->irqs_table[0] = irq;
- ret = devm_request_irq(&pdev->dev, irq, cpsw_interrupt,
+ ret = devm_request_irq(&pdev->dev, irq, cpsw_dummy_interrupt,
0, dev_name(&pdev->dev), priv);
if (ret < 0) {
dev_err(priv->dev, "error attaching irq (%d)\n", ret);
@@ -2363,7 +2382,7 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_ale_ret;
priv->irqs_table[1] = irq;
- ret = devm_request_irq(&pdev->dev, irq, cpsw_interrupt,
+ ret = devm_request_irq(&pdev->dev, irq, cpsw_rx_interrupt,
0, dev_name(&pdev->dev), priv);
if (ret < 0) {
dev_err(priv->dev, "error attaching irq (%d)\n", ret);
@@ -2375,7 +2394,7 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_ale_ret;
priv->irqs_table[2] = irq;
- ret = devm_request_irq(&pdev->dev, irq, cpsw_interrupt,
+ ret = devm_request_irq(&pdev->dev, irq, cpsw_tx_interrupt,
0, dev_name(&pdev->dev), priv);
if (ret < 0) {
dev_err(priv->dev, "error attaching irq (%d)\n", ret);
@@ -2387,7 +2406,7 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_ale_ret;
priv->irqs_table[3] = irq;
- ret = devm_request_irq(&pdev->dev, irq, cpsw_interrupt,
+ ret = devm_request_irq(&pdev->dev, irq, cpsw_dummy_interrupt,
0, dev_name(&pdev->dev), priv);
if (ret < 0) {
dev_err(priv->dev, "error attaching irq (%d)\n", ret);
--
2.2.0
^ permalink raw reply related
* [PATCH 2/4] net: ethernet: cpsw: unroll IRQ request loop
From: Felipe Balbi @ 2015-01-02 18:10 UTC (permalink / raw)
To: David Miller
Cc: Mugunthan V N, Yegor Yefremov, Linux OMAP Mailing List, netdev,
Felipe Balbi
In-Reply-To: <1420222228-31949-1-git-send-email-balbi@ti.com>
This patch is in preparation for a nicer IRQ
handling scheme where we use different IRQ
handlers for each IRQ line (as it should be).
Later, we will also drop IRQs offset 0 and 3
because they are always disabled in this driver.
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
drivers/net/ethernet/ti/cpsw.c | 62 ++++++++++++++++++++++++++++++++----------
1 file changed, 47 insertions(+), 15 deletions(-)
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index e61ee83..6e04128 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -2156,7 +2156,8 @@ static int cpsw_probe(struct platform_device *pdev)
void __iomem *ss_regs;
struct resource *res, *ss_res;
u32 slave_offset, sliver_offset, slave_size;
- int ret = 0, i, k = 0;
+ int ret = 0, i;
+ int irq;
ndev = alloc_etherdev(sizeof(struct cpsw_priv));
if (!ndev) {
@@ -2345,24 +2346,55 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_ale_ret;
}
- while ((res = platform_get_resource(priv->pdev, IORESOURCE_IRQ, k))) {
- if (k >= ARRAY_SIZE(priv->irqs_table)) {
- ret = -EINVAL;
- goto clean_ale_ret;
- }
+ irq = platform_get_irq(pdev, 0);
+ if (irq < 0)
+ goto clean_ale_ret;
- ret = devm_request_irq(&pdev->dev, res->start, cpsw_interrupt,
- 0, dev_name(&pdev->dev), priv);
- if (ret < 0) {
- dev_err(priv->dev, "error attaching irq (%d)\n", ret);
- goto clean_ale_ret;
- }
+ priv->irqs_table[0] = irq;
+ ret = devm_request_irq(&pdev->dev, irq, cpsw_interrupt,
+ 0, dev_name(&pdev->dev), priv);
+ if (ret < 0) {
+ dev_err(priv->dev, "error attaching irq (%d)\n", ret);
+ goto clean_ale_ret;
+ }
- priv->irqs_table[k] = res->start;
- k++;
+ irq = platform_get_irq(pdev, 1);
+ if (irq < 0)
+ goto clean_ale_ret;
+
+ priv->irqs_table[1] = irq;
+ ret = devm_request_irq(&pdev->dev, irq, cpsw_interrupt,
+ 0, dev_name(&pdev->dev), priv);
+ if (ret < 0) {
+ dev_err(priv->dev, "error attaching irq (%d)\n", ret);
+ goto clean_ale_ret;
+ }
+
+ irq = platform_get_irq(pdev, 2);
+ if (irq < 0)
+ goto clean_ale_ret;
+
+ priv->irqs_table[2] = irq;
+ ret = devm_request_irq(&pdev->dev, irq, cpsw_interrupt,
+ 0, dev_name(&pdev->dev), priv);
+ if (ret < 0) {
+ dev_err(priv->dev, "error attaching irq (%d)\n", ret);
+ goto clean_ale_ret;
+ }
+
+ irq = platform_get_irq(pdev, 3);
+ if (irq < 0)
+ goto clean_ale_ret;
+
+ priv->irqs_table[3] = irq;
+ ret = devm_request_irq(&pdev->dev, irq, cpsw_interrupt,
+ 0, dev_name(&pdev->dev), priv);
+ if (ret < 0) {
+ dev_err(priv->dev, "error attaching irq (%d)\n", ret);
+ goto clean_ale_ret;
}
- priv->num_irqs = k;
+ priv->num_irqs = 4;
ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
--
2.2.0
^ permalink raw reply related
* [PATCH 1/4] net: ethernet: cpsw: fix hangs with interrupts
From: Felipe Balbi @ 2015-01-02 18:10 UTC (permalink / raw)
To: David Miller
Cc: Mugunthan V N, Yegor Yefremov, Linux OMAP Mailing List, netdev,
Felipe Balbi, stable
In-Reply-To: <1420222228-31949-1-git-send-email-balbi@ti.com>
The CPSW IP implements pulse-signaled interrupts. Due to
that we must write a correct, pre-defined value to the
CPDMA_MACEOIVECTOR register so the controller generates
a pulse on the correct IRQ line to signal the End Of
Interrupt.
The way the driver is written today, all four IRQ lines
are requested using the same IRQ handler and, because of
that, we could fall into situations where a TX IRQ fires
but we tell the controller that we ended an RX IRQ (or
vice-versa). This situation triggers an IRQ storm on the
reserved IRQ 127 of INTC which will in turn call ack_bad_irq()
which will, then, print a ton of:
unexpected IRQ trap at vector 00
In order to fix the problem, we are moving all calls to
cpdma_ctlr_eoi() inside the IRQ handler and making sure
we *always* write the correct value to the CPDMA_MACEOIVECTOR
register. Note that the algorithm assumes that IRQ numbers and
value-to-be-written-to-EOI are proportional, meaning that a
write of value 0 would trigger an EOI pulse for the RX_THRESHOLD
Interrupt and that's the IRQ number sitting in the 0-th index
of our irqs_table array.
This, however, is safe at least for current implementations of
CPSW so we will refrain from making the check smarter (and, as
a side-effect, slower) until we actually have a platform where
IRQ lines are swapped.
This patch has been tested for several days with AM335x- and
AM437x-based platforms. AM57x was left out because there are
still pending patches to enable ethernet in mainline for that
platform. A read of the TRM confirms the statement on previous
paragraph.
Reported-by: Yegor Yefremov <yegorslists@googlemail.com>
Fixes: 510a1e7 (drivers: net: davinci_cpdma: acknowledge interrupt properly)
Cc: <stable@vger.kernel.org> # v3.9+
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
drivers/net/ethernet/ti/cpsw.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index c560f9a..e61ee83 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -757,6 +757,14 @@ requeue:
static irqreturn_t cpsw_interrupt(int irq, void *dev_id)
{
struct cpsw_priv *priv = dev_id;
+ int value = irq - priv->irqs_table[0];
+
+ /* NOTICE: Ending IRQ here. The trick with the 'value' variable above
+ * is to make sure we will always write the correct value to the EOI
+ * register. Namely 0 for RX_THRESH Interrupt, 1 for RX Interrupt, 2
+ * for TX Interrupt and 3 for MISC Interrupt.
+ */
+ cpdma_ctlr_eoi(priv->dma, value);
cpsw_intr_disable(priv);
if (priv->irq_enabled == true) {
@@ -786,8 +794,6 @@ static int cpsw_poll(struct napi_struct *napi, int budget)
int num_tx, num_rx;
num_tx = cpdma_chan_process(priv->txch, 128);
- if (num_tx)
- cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX);
num_rx = cpdma_chan_process(priv->rxch, budget);
if (num_rx < budget) {
@@ -795,7 +801,6 @@ static int cpsw_poll(struct napi_struct *napi, int budget)
napi_complete(napi);
cpsw_intr_enable(priv);
- cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
prim_cpsw = cpsw_get_slave_priv(priv, 0);
if (prim_cpsw->irq_enabled == false) {
prim_cpsw->irq_enabled = true;
@@ -1310,8 +1315,6 @@ static int cpsw_ndo_open(struct net_device *ndev)
napi_enable(&priv->napi);
cpdma_ctlr_start(priv->dma);
cpsw_intr_enable(priv);
- cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
- cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX);
prim_cpsw = cpsw_get_slave_priv(priv, 0);
if (prim_cpsw->irq_enabled == false) {
@@ -1578,9 +1581,6 @@ static void cpsw_ndo_tx_timeout(struct net_device *ndev)
cpdma_chan_start(priv->txch);
cpdma_ctlr_int_ctrl(priv->dma, true);
cpsw_intr_enable(priv);
- cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
- cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX);
-
}
static int cpsw_ndo_set_mac_address(struct net_device *ndev, void *p)
@@ -1620,9 +1620,6 @@ static void cpsw_ndo_poll_controller(struct net_device *ndev)
cpsw_interrupt(ndev->irq, priv);
cpdma_ctlr_int_ctrl(priv->dma, true);
cpsw_intr_enable(priv);
- cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
- cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX);
-
}
#endif
--
2.2.0
^ permalink raw reply related
* [PATCH 0/4] net: cpsw: fix hangs and improve IRQ handling
From: Felipe Balbi @ 2015-01-02 18:10 UTC (permalink / raw)
To: David Miller
Cc: Mugunthan V N, Yegor Yefremov, Linux OMAP Mailing List, netdev,
Felipe Balbi
Hi folks,
patch 1 fixes the bug reported by Yegor Yefremov <yegorslists@googlemail.com>.
patches 2 - 4 improve IRQ handling a little bit.
Tested with BeagleBone Black and AM437x SK. The bug fix has been
tested for almost 3 days non-stop while the following patches
have been tested for a couple of hours with iperf and nuttcp and
NFS root.
Note that we also have a slight throughput improvement after patch 3
when running with AM437x SK (10.0.1.13 below):
===== pre-patch =====
$ iperf -c 10.0.1.13
------------------------------------------------------------
Client connecting to 10.0.1.13, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[ 3] local 10.0.1.2 port 38430 connected with 10.0.1.13 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 240 MBytes 201 Mbits/sec
$ iperf -c 10.0.1.101
------------------------------------------------------------
Client connecting to 10.0.1.101, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[ 3] local 10.0.1.2 port 35143 connected with 10.0.1.101 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 113 MBytes 94.7 Mbits/sec
===== post-patch =====
$ iperf -c 10.0.1.13
------------------------------------------------------------
Client connecting to 10.0.1.13, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[ 3] local 10.0.1.2 port 38447 connected with 10.0.1.13 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 283 MBytes 237 Mbits/sec
$ iperf -c 10.0.1.101
------------------------------------------------------------
Client connecting to 10.0.1.101, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[ 3] local 10.0.1.2 port 35157 connected with 10.0.1.101 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 113 MBytes 94.4 Mbits/sec
That minor decrease on beagleboneblack (10.0.1.101) is so small that's
likely into the error margin, but I'll run some further profiling as
I have a feeling INTC's IRQ handling can be improved.
In any case, patch 1 should go in during the -rc an get backported
all the way back to v3.9, while the other patches can (should) be
delayed for v3.20 merge window.
Felipe Balbi (4):
net: ethernet: cpsw: fix hangs with interrupts
net: ethernet: cpsw: unroll IRQ request loop
net: ethernet: cpsw: split out IRQ handler
net: ethernet: cpsw: don't requests IRQs we don't use
drivers/net/ethernet/ti/cpsw.c | 81 +++++++++++++++++++++++++++---------------
1 file changed, 52 insertions(+), 29 deletions(-)
--
2.2.0
^ permalink raw reply
* Re: [PATCH iproute2 v2] bridge/link: add learning_sync policy flag
From: Scott Feldman @ 2015-01-02 17:57 UTC (permalink / raw)
To: Siva Mannem
Cc: stephen@networkplumber.org, Netdev, Jiří Pírko,
Roopa Prabhu
In-Reply-To: <CA+CtxLS7x8zKQ-9xwjoH3=pidkXS9s5b2+K_VO4eDHJTWo5tYQ@mail.gmail.com>
On Fri, Jan 2, 2015 at 9:14 AM, Siva Mannem <siva.mannem.lnx@gmail.com> wrote:
> Hi,
>
>
>> +.BR "learning_sync on " or " learning_sync off "
>> +Controls whether a given port will sync MAC addresses learned on device port to
>> +bridge FDB.
>> +
>
> For the FDB entries synced from device port to bridge FDB, can the
> device port also mention that it will take care of aging the synced
> entries? I am thinking of a use case where the port supports hardware
> learning and hardware aging?
I think the aging settings are per-bridge, not per-bridge-port, so the
policy control you're talking about wouldn't end up here on
/sbin/bridge link.
However, I would argue even with hardware aging capability, we still
should use Linux for aging since all the controls are already there
and it just works. It keeps the swdev model simple and the swdev
driver simple. Do you have a counter-argument for why enabling
hardware aging would be better?
-scott
^ permalink raw reply
* Re: [PATCH net-next v1 2/5] ixgbevf: Add a RETA query code
From: Vlad Zolotarov @ 2015-01-02 17:49 UTC (permalink / raw)
To: Alexander Duyck, netdev
Cc: gleb, avi, jeffrey.t.kirsher, Don Skidmore, tantilov, Emil S
In-Reply-To: <54A58D69.7080706@gmail.com>
On 01/01/15 20:09, Alexander Duyck wrote:
> On 12/31/2014 10:33 AM, Vlad Zolotarov wrote:
>> On 12/31/14 20:00, Alexander Duyck wrote:
>>> I suspect this code is badly broken as it doesn't take several things
>>> into account.
>>>
>>> First the PF redirection table can have values outside of the range
>>> supported by the VF. This is allowed as the VF can set how many bits of
>>> the redirection table it actually wants to use. This is controlled via
>>> the PSRTYPE register. So for example the PF can be running with 4
>>> queues, and the VF can run either in single queue or as just a pair of
>>> queues.
>>>
>>> Second you could compress this data much more tightly by taking
>>> advantage of the bit widths allowed. So for everything x540 and older
>>> they only use a 4 bit value per entry. That means you could
>>> theoretically stuff 8 entries per u32 instead of just 4.
>> Compression is nice but I think ethtool expects it in a certain
>> format: one entry per byte. And since this patch is targeting the
>> ethtool the output format should be as ethtool expects it to be and
>> this is what this patch does. However I agree that masking the
>> appropriate bits according to PSRTYPE is required. Good catch!
> The idea of compression comes into play when you consider there is
> significant latency trying to get messages across the mailbox. By
> reducing the number of messages needed to get the redirection table you
> should be able to significantly reduce the amount of time needed to
> fetch it. The job of compressing/expanding the values is actually
> pretty straight forward when you consider all that should be needed is a
> simple loop to perform some shift, and, and or operations.
We are talking about a super slow path here. So, regardless how slow it
is it should be done only once between boots. Therefore IMHO any code
complication is not justified here.
>
> - Alex
^ permalink raw reply
* Re: [PATCH iproute2 v2] bridge/link: add learning_sync policy flag
From: Siva Mannem @ 2015-01-02 17:14 UTC (permalink / raw)
To: sfeldma; +Cc: stephen, netdev, jiri, roopa
In-Reply-To: <1419884407-21998-1-git-send-email-sfeldma@gmail.com>
Hi,
> +.BR "learning_sync on " or " learning_sync off "
> +Controls whether a given port will sync MAC addresses learned on device port to
> +bridge FDB.
> +
For the FDB entries synced from device port to bridge FDB, can the
device port also mention that it will take care of aging the synced
entries? I am thinking of a use case where the port supports hardware
learning and hardware aging?
Regards,
Siva.
On Tue, Dec 30, 2014 at 1:50 AM, <sfeldma@gmail.com> wrote:
> From: Scott Feldman <sfeldma@gmail.com>
>
> v2:
>
> Resending now that the dust has cleared in 3.18 on "self" vs. hwmode debate for
> brport settings. learning_sync is now set/cleared using "self" qualifier on
> brport.
>
> v1:
>
> Add 'learned_sync' flag to turn on/off syncing of learned MAC addresses from
> offload device to bridge's FDB. Flag is be set/cleared on offload device port
> using "self" qualifier:
>
> $ sudo bridge link set dev swp1 learning_sync on self
>
> $ bridge -d link show dev swp1
> 2: swp1 state UNKNOWN : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state forwarding priority 32 cost 2
> hairpin off guard off root_block off fastleave off learning off flood off
> 2: swp1 state UNKNOWN : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0
> learning on learning_sync on
>
> Adds new IFLA_BRPORT_LEARNED_SYNCED attribute for IFLA_PROTINFO on the SELF
> brport.
>
> Signed-off-by: Scott Feldman <sfeldma@gmail.com>
> ---
> bridge/link.c | 12 ++++++++++++
> man/man8/bridge.8 | 6 ++++++
> 2 files changed, 18 insertions(+)
>
> diff --git a/bridge/link.c b/bridge/link.c
> index 3f77aab..c8555f8 100644
> --- a/bridge/link.c
> +++ b/bridge/link.c
> @@ -188,6 +188,9 @@ int print_linkinfo(const struct sockaddr_nl *who,
> if (prtb[IFLA_BRPORT_LEARNING])
> print_onoff(fp, "learning",
> rta_getattr_u8(prtb[IFLA_BRPORT_LEARNING]));
> + if (prtb[IFLA_BRPORT_LEARNING_SYNC])
> + print_onoff(fp, "learning_sync",
> + rta_getattr_u8(prtb[IFLA_BRPORT_LEARNING_SYNC]));
> if (prtb[IFLA_BRPORT_UNICAST_FLOOD])
> print_onoff(fp, "flood",
> rta_getattr_u8(prtb[IFLA_BRPORT_UNICAST_FLOOD]));
> @@ -221,6 +224,7 @@ static void usage(void)
> fprintf(stderr, " [ fastleave {on | off} ]\n");
> fprintf(stderr, " [ root_block {on | off} ]\n");
> fprintf(stderr, " [ learning {on | off} ]\n");
> + fprintf(stderr, " [ learning_sync {on | off} ]\n");
> fprintf(stderr, " [ flood {on | off} ]\n");
> fprintf(stderr, " [ hwmode {vepa | veb} ]\n");
> fprintf(stderr, " bridge link show [dev DEV]\n");
> @@ -252,6 +256,7 @@ static int brlink_modify(int argc, char **argv)
> } req;
> char *d = NULL;
> __s8 learning = -1;
> + __s8 learning_sync = -1;
> __s8 flood = -1;
> __s8 hairpin = -1;
> __s8 bpdu_guard = -1;
> @@ -295,6 +300,10 @@ static int brlink_modify(int argc, char **argv)
> NEXT_ARG();
> if (!on_off("learning", &learning, *argv))
> exit(-1);
> + } else if (strcmp(*argv, "learning_sync") == 0) {
> + NEXT_ARG();
> + if (!on_off("learning_sync", &learning_sync, *argv))
> + exit(-1);
> } else if (strcmp(*argv, "flood") == 0) {
> NEXT_ARG();
> if (!on_off("flood", &flood, *argv))
> @@ -359,6 +368,9 @@ static int brlink_modify(int argc, char **argv)
> addattr8(&req.n, sizeof(req), IFLA_BRPORT_UNICAST_FLOOD, flood);
> if (learning >= 0)
> addattr8(&req.n, sizeof(req), IFLA_BRPORT_LEARNING, learning);
> + if (learning_sync >= 0)
> + addattr8(&req.n, sizeof(req), IFLA_BRPORT_LEARNING_SYNC,
> + learning_sync);
>
> if (cost > 0)
> addattr32(&req.n, sizeof(req), IFLA_BRPORT_COST, cost);
> diff --git a/man/man8/bridge.8 b/man/man8/bridge.8
> index cb3fb46..e344db2 100644
> --- a/man/man8/bridge.8
> +++ b/man/man8/bridge.8
> @@ -38,6 +38,7 @@ bridge \- show / manipulate bridge addresses and devices
> .BR fastleave " { " on " | " off " } ] [ "
> .BR root_block " { " on " | " off " } ] [ "
> .BR learning " { " on " | " off " } ] [ "
> +.BR learning_sync " { " on " | " off " } ] [ "
> .BR flood " { " on " | " off " } ] [ "
> .BR hwmode " { " vepa " | " veb " } ] "
>
> @@ -263,6 +264,11 @@ not. If learning if off, the bridge will end up flooding any traffic for which
> it has no FDB entry. By default this flag is on.
>
> .TP
> +.BR "learning_sync on " or " learning_sync off "
> +Controls whether a given port will sync MAC addresses learned on device port to
> +bridge FDB.
> +
> +.TP
> .BR "flooding on " or " flooding off "
> Controls whether a given port will flood unicast traffic for which there is no FDB entry. By default this flag is on.
>
> --
> 1.7.10.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH net-next 1/3] net: add IPv4 routing FIB support for swdev
From: Scott Feldman @ 2015-01-02 17:20 UTC (permalink / raw)
To: Arad, Ronen
Cc: roopa, Netdev, Jirí Pírko, john fastabend, Thomas Graf,
Jamal Hadi Salim, Andy Gospodarek
In-Reply-To: <E4CD12F19ABA0C4D8729E087A761DC3505DD315B@ORSMSX101.amr.corp.intel.com>
On Fri, Jan 2, 2015 at 3:39 AM, Arad, Ronen <ronen.arad@intel.com> wrote:
>
>
>>-----Original Message-----
>>From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org] On
>>Behalf Of Scott Feldman
>>Sent: Friday, January 02, 2015 10:01 AM
>>To: roopa
>>Cc: Netdev; Jiří Pírko; john fastabend; Thomas Graf; Jamal Hadi Salim; Andy
>>Gospodarek
>>Subject: Re: [PATCH net-next 1/3] net: add IPv4 routing FIB support for swdev
>>
>>On Thu, Jan 1, 2015 at 9:49 PM, roopa <roopa@cumulusnetworks.com> wrote:
>>> On 1/1/15, 7:29 PM, sfeldma@gmail.com wrote:
>>>>
>>>> From: Scott Feldman <sfeldma@gmail.com>
>>>>
>>>> To offload IPv4 L3 routing functions to swdev device, the swdev device
>>>> driver
>>>> implements two new ndo ops (ndo_switch_fib_ipv4_add/del). The ops are
>>>> called
>>>> by the core IPv4 FIB code when installing/removing FIB entries to/from the
>>>> kernel FIB. On install, the driver should return 0 if FIB entry (route)
>>>> can be
>>>> installed to device for offloading, -EOPNOTSUPP if route cannot be
>>>> installed
>>>> due to device limitations, and other negative error code on failure to
>>>> install
>>>> route to device. On failure error code, the route is not installed to
>>>> device,
>>>> and not installed in kernel FIB, and the return code is propagated back to
>>>> the
>>>> user-space caller (via netlink). An -EOPNOTSUPP error code is skipped for
>>>> the
>>>> device but installed in the kernel FIB.
>>>>
>>>> The FIB entry (route) nexthop list is used to find the swdev device port
>>>> to
>>>> anchor the ndo op call. The route's fib_dev (the first nexthop's dev) is
>>>> used
>>>> find the swdev port by recursively traversing the fib_dev's lower_dev list
>>>> until a swdev port is found. The ndo op is called on this swdev port.
>>>
>>>
>>> scott, I posted a similar api for bridge attribute sets. But, nobody
>>> supported it.
>>> http://marc.info/?l=linux-netdev&m=141820234410602&w=2
>>>
>>> If this is acceptable, I will be resubmitting my api as well.
>>>
>>
>>This may get shot down as well, who knows?
>>
>>For routes, the nexthop dev may be a bridge or a bond for an IP on the
>>router, so we have no choice but to walk down from the bridge or the
>>bond to find a swport dev to call the ndo op to install the route.
>>
> Another case is when VLAN-aware bridge with VLAN filtering is used. In that
> case IP interfaces are VLAN interfaces created on top of the bridge.
>
>>For bridge settings, I remember someone raised the issue that settings
>>should be propagated down the dev hierarchy, with parent calling
>>child's op and so on. I'll go back and look at your post.
>>
> This was my comment. I'm not sure it was correct. My concern was the VLAN
> interface on top of a VLAN-aware bridge use-case. I now believe that such
> interfaces are upper devices of the bridge (not master). Therefore, it seems
> that traversal starting at a VLAN interface on top of a bridge will follow a
> path: VLAN interface => bridge => [team/bond] => switchdev port.
With the VLAN support built into the bridge, we can avoid the vlan
interface, which makes it a little better:
bridge/vlan => [team/bond] => swdev port
> One complication here is that the VLAN context is important. A "naked" nexthop
> shall only be resolved within the VLAN associated with the VLAN interface. When
> ARP resolution is performed by Linux stack, it goes via the VLAN interface
> which imposes a tag on the packet before handing it to the bridge. The VLAN-
> aware bridge floods such packet only to member ports of the VLAN. This behavior
> of the software bridge has to be preserved with offloaded L3 forwarding and
> offloaded L2 switching.
Good point, and valid for bridge/vlans as well.
>>>
>>>
>>>>
>>>> Since the FIB entry is "naked" when push from the kernel, the
>>>> driver/device
>>>> is responsible for resolving the route's nexthops to neighbor MAC
>>>> addresses.
>>>> This can be done by the driver by monitoring NETEVENT_NEIGH_UPDATE
>>>> netevent notifier to watch for ARP activity. Once a nexthop is resolved
>>>> to
>>>> neighbor MAC address, it can be installed to the device and the device
>>>> will
>>>> do the L3 routing offload in HW, for that nexthop.
>>>>
>>>> Signed-off-by: Scott Feldman <sfeldma@gmail.com>
>>>> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>>>> ---
>>>> include/linux/netdevice.h | 22 +++++++++++
>>>> include/net/switchdev.h | 18 +++++++++
>>>> net/ipv4/fib_trie.c | 17 ++++++++-
>>>> net/switchdev/switchdev.c | 89
>>>> +++++++++++++++++++++++++++++++++++++++++++++
>>>> 4 files changed, 145 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
>>>> index 679e6e9..b66d22b 100644
>>>> --- a/include/linux/netdevice.h
>>>> +++ b/include/linux/netdevice.h
>>>> @@ -767,6 +767,8 @@ struct netdev_phys_item_id {
>>>> typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
>>>> struct sk_buff *skb);
>>>> +struct fib_info;
>>>> +
>>>> /*
>>>> * This structure defines the management hooks for network devices.
>>>> * The following hooks can be defined; unless noted otherwise, they are
>>>> @@ -1030,6 +1032,14 @@ typedef u16 (*select_queue_fallback_t)(struct
>>>> net_device *dev,
>>>> * int (*ndo_switch_port_stp_update)(struct net_device *dev, u8 state);
>>>> * Called to notify switch device port of bridge port STP
>>>> * state change.
>>>> + * int (*ndo_sw_parent_fib_ipv4_add)(struct net_device *dev, __be32 dst,
>>>> + * int dst_len, struct fib_info *fi,
>>>> + * u8 tos, u8 type, u32 tb_id);
>>>> + * Called to add IPv4 route to switch device.
>>>> + * int (*ndo_sw_parent_fib_ipv4_del)(struct net_device *dev, __be32 dst,
>>>> + * int dst_len, struct fib_info *fi,
>>>> + * u8 tos, u8 type, u32 tb_id);
>>>> + * Called to delete IPv4 route from switch device.
>>>> */
>>>> struct net_device_ops {
>>>> int (*ndo_init)(struct net_device *dev);
>>>> @@ -1189,6 +1199,18 @@ struct net_device_ops {
>>>> struct
>>>> netdev_phys_item_id *psid);
>>>> int (*ndo_switch_port_stp_update)(struct
>>>> net_device *dev,
>>>> u8 state);
>>>> + int (*ndo_switch_fib_ipv4_add)(struct
>>>> net_device *dev,
>>>> + __be32 dst,
>>>> + int dst_len,
>>>> + struct fib_info
>>>> *fi,
>>>> + u8 tos, u8
>>>> type,
>>>> + u32 tb_id);
>>>> + int (*ndo_switch_fib_ipv4_del)(struct
>>>> net_device *dev,
>>>> + __be32 dst,
>>>> + int dst_len,
>>>> + struct fib_info
>>>> *fi,
>>>> + u8 tos, u8
>>>> type,
>>>> + u32 tb_id);
>>>> #endif
>>>> };
>>>> diff --git a/include/net/switchdev.h b/include/net/switchdev.h
>>>> index 8a6d164..caebc2a 100644
>>>> --- a/include/net/switchdev.h
>>>> +++ b/include/net/switchdev.h
>>>> @@ -17,6 +17,10 @@
>>>> int netdev_switch_parent_id_get(struct net_device *dev,
>>>> struct netdev_phys_item_id *psid);
>>>> int netdev_switch_port_stp_update(struct net_device *dev, u8 state);
>>>> +int netdev_switch_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
>>>> + u8 tos, u8 type, u32 tb_id);
>>>> +int netdev_switch_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
>>>> + u8 tos, u8 type, u32 tb_id);
>>>> #else
>>>> @@ -32,6 +36,20 @@ static inline int
>>>> netdev_switch_port_stp_update(struct net_device *dev,
>>>> return -EOPNOTSUPP;
>>>> }
>>>> +static inline int netdev_switch_fib_ipv4_add(u32 dst, int dst_len,
>>>> + struct fib_info *fi,
>>>> + u8 tos, u8 type, u32 tb_id)
>>>> +{
>>>> + return -EOPNOTSUPP;
>>>> +}
>>>> +
>>>> +static inline int netdev_switch_fib_ipv4_del(u32 dst, int dst_len,
>>>> + struct fib_info *fi,
>>>> + u8 tos, u8 type, u32 tb_id)
>>>> +{
>>>> + return -EOPNOTSUPP;
>>>> +}
>>>> +
>>>> #endif
>>>> #endif /* _LINUX_SWITCHDEV_H_ */
>>>> diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
>>>> index 281e5e0..ea2dc17 100644
>>>> --- a/net/ipv4/fib_trie.c
>>>> +++ b/net/ipv4/fib_trie.c
>>>> @@ -79,6 +79,7 @@
>>>> #include <net/tcp.h>
>>>> #include <net/sock.h>
>>>> #include <net/ip_fib.h>
>>>> +#include <net/switchdev.h>
>>>> #include "fib_lookup.h"
>>>> #define MAX_STAT_DEPTH 32
>>>> @@ -1201,6 +1202,8 @@ int fib_table_insert(struct fib_table *tb, struct
>>>> fib_config *cfg)
>>>> fib_release_info(fi_drop);
>>>> if (state & FA_S_ACCESSED)
>>>> rt_cache_flush(cfg->fc_nlinfo.nl_net);
>>>> + netdev_switch_fib_ipv4_add(key, plen, fi,
>>>> fa->fa_tos,
>>>> + cfg->fc_type,
>>>> tb->tb_id);
>>>> rtmsg_fib(RTM_NEWROUTE, htonl(key), new_fa, plen,
>>>> tb->tb_id, &cfg->fc_nlinfo,
>>>> NLM_F_REPLACE);
>>>> @@ -1229,6 +1232,13 @@ int fib_table_insert(struct fib_table *tb, struct
>>>> fib_config *cfg)
>>>> new_fa->fa_tos = tos;
>>>> new_fa->fa_type = cfg->fc_type;
>>>> new_fa->fa_state = 0;
>>>> +
>>>> + /* (Optionally) offload fib info to switch hardware. */
>>>> + err = netdev_switch_fib_ipv4_add(key, plen, fi, tos,
>>>> + cfg->fc_type, tb->tb_id);
>>>> + if (err && err != -EOPNOTSUPP)
>>>> + goto out_free_new_fa;
>>>> +
>>>> /*
>>>> * Insert new entry to the list.
>>>> */
>>>> @@ -1237,7 +1247,7 @@ int fib_table_insert(struct fib_table *tb, struct
>>>> fib_config *cfg)
>>>> fa_head = fib_insert_node(t, key, plen);
>>>> if (unlikely(!fa_head)) {
>>>> err = -ENOMEM;
>>>> - goto out_free_new_fa;
>>>> + goto out_sw_fib_del;
>>>> }
>>>> }
>>>> @@ -1253,6 +1263,8 @@ int fib_table_insert(struct fib_table *tb, struct
>>>> fib_config *cfg)
>>>> succeeded:
>>>> return 0;
>>>> +out_sw_fib_del:
>>>> + netdev_switch_fib_ipv4_del(key, plen, fi, tos, cfg->fc_type,
>>>> tb->tb_id);
>>>> out_free_new_fa:
>>>> kmem_cache_free(fn_alias_kmem, new_fa);
>>>> out:
>>>> @@ -1529,6 +1541,9 @@ int fib_table_delete(struct fib_table *tb, struct
>>>> fib_config *cfg)
>>>> rtmsg_fib(RTM_DELROUTE, htonl(key), fa, plen, tb->tb_id,
>>>> &cfg->fc_nlinfo, 0);
>>>> + netdev_switch_fib_ipv4_del(key, plen, fa->fa_info, tos,
>>>> + cfg->fc_type, tb->tb_id);
>>>> +
>>>> list_del_rcu(&fa->fa_list);
>>>> if (!plen)
>>>> diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
>>>> index d162b21..211a8a0 100644
>>>> --- a/net/switchdev/switchdev.c
>>>> +++ b/net/switchdev/switchdev.c
>>>> @@ -12,6 +12,7 @@
>>>> #include <linux/types.h>
>>>> #include <linux/init.h>
>>>> #include <linux/netdevice.h>
>>>> +#include <net/ip_fib.h>
>>>> #include <net/switchdev.h>
>>>> /**
>>>> @@ -50,3 +51,91 @@ int netdev_switch_port_stp_update(struct net_device
>>>> *dev, u8 state)
>>>> return ops->ndo_switch_port_stp_update(dev, state);
>>>> }
>>>> EXPORT_SYMBOL(netdev_switch_port_stp_update);
>>>> +
>>>> +static struct net_device *netdev_switch_get_by_fib_dev(struct net_device
>>>> *dev)
>>>> +{
>>>> + const struct net_device_ops *ops = dev->netdev_ops;
>>>> + struct net_device *lower_dev;
>>>> + struct net_device *port_dev;
>>>> + struct list_head *iter;
>>>> +
>>>> + /* Recusively search from fib_dev down until we find
>>>> + * a sw port dev. (A sw port dev supports
>>>> + * ndo_switch_parent_id_get).
>>>> + */
>>>> +
>>>> + if (ops->ndo_switch_parent_id_get)
>>>> + return dev;
>>>> +
>>>> + netdev_for_each_lower_dev(dev, lower_dev, iter) {
>>>> + port_dev = netdev_switch_get_by_fib_dev(lower_dev);
>>>> + if (port_dev)
>>>> + return port_dev;
>>>> + }
>>>> +
>>>> + return NULL;
>>>> +}
>>>> +
>>>> +/**
>>>> + * netdev_switch_fib_ipv4_add - Add IPv4 route entry to switch
>>>> + *
>>>> + * @dst: route's IPv4 destination address
>>>> + * @dst_len: destination address length (prefix length)
>>>> + * @fi: route FIB info structure
>>>> + * @tos: route TOS
>>>> + * @type: route type
>>>> + * @tb_id: route table ID
>>>> + *
>>>> + * Add IPv4 route entry to switch device.
>>>> + */
>>>> +int netdev_switch_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
>>>> + u8 tos, u8 type, u32 tb_id)
>>>> +{
>>>> + struct net_device *dev;
>>>> + const struct net_device_ops *ops;
>>>> + int err = -EOPNOTSUPP;
>>>> +
>>>> + dev = netdev_switch_get_by_fib_dev(fi->fib_dev);
>>>> + if (!dev)
>>>> + return -EOPNOTSUPP;
>>>> + ops = dev->netdev_ops;
>>>> +
>>>> + if (ops->ndo_switch_fib_ipv4_add)
>>>> + err = ops->ndo_switch_fib_ipv4_add(dev, htonl(dst),
>>>> dst_len,
>>>> + fi, tos, type, tb_id);
>>>> +
>>>> + return err;
>>>> +}
>>>> +EXPORT_SYMBOL(netdev_switch_fib_ipv4_add);
>>>> +
>>>> +/**
>>>> + * netdev_switch_fib_ipv4_del - Delete IPv4 route entry from switch
>>>> + *
>>>> + * @dst: route's IPv4 destination address
>>>> + * @dst_len: destination address length (prefix length)
>>>> + * @fi: route FIB info structure
>>>> + * @tos: route TOS
>>>> + * @type: route type
>>>> + * @tb_id: route table ID
>>>> + *
>>>> + * Delete IPv4 route entry from switch device.
>>>> + */
>>>> +int netdev_switch_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
>>>> + u8 tos, u8 type, u32 tb_id)
>>>> +{
>>>> + struct net_device *dev;
>>>> + const struct net_device_ops *ops;
>>>> + int err = -EOPNOTSUPP;
>>>> +
>>>> + dev = netdev_switch_get_by_fib_dev(fi->fib_dev);
>>>> + if (!dev)
>>>> + return -EOPNOTSUPP;
>>>> + ops = dev->netdev_ops;
>>>> +
>>>> + if (ops->ndo_switch_fib_ipv4_del)
>>>> + err = ops->ndo_switch_fib_ipv4_del(dev, htonl(dst),
>>>> dst_len,
>>>> + fi, tos, type, tb_id);
>>>> +
>>>> + return err;
>>>> +}
>>>> +EXPORT_SYMBOL(netdev_switch_fib_ipv4_del);
>>>
>>>
>>--
>>To unsubscribe from this list: send the line "unsubscribe netdev" in
>>the body of a message to majordomo@vger.kernel.org
>>More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] drivers:net:wireless: Add proper locking for the function, b43_op_beacon_set_tim in main.c
From: nick @ 2015-01-02 17:13 UTC (permalink / raw)
To: Michael Büsch
Cc: stefano.brivio-hl5o88x/ua9eoWH0uzbU5w,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
b43-dev-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
kvalo-sgV2jX0FEOL9JmXXK+q4OQ
In-Reply-To: <20150102102727.3918a684@wiggum>
Michael,
My fault I wasn't aware we were in atomic context, however if we are then why
not just remove the comment. If you want I can send in a patch explaining why
this comment is no longer needed.
Regards,
Nick
On 2015-01-02 04:27 AM, Michael Büsch wrote:
> On Fri, 2 Jan 2015 02:34:01 -0500
> Nicholas Krause <xerofoify-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>> This adds proper locking for the function, b43_op_beacon_set_tim in main.c by using the mutex lock
>> in the structure pointer wl, as embedded into this pointer as a mutex in order to protect against
>> multiple access to the pointer wl when updating the templates for this pointer in the function,
>> b43_update_templates internally in the function, b43_op_beacon_set_tim.
>>
>> Signed-off-by: Nicholas Krause <xerofoify-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> ---
>> drivers/net/wireless/b43/main.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
>> index 47731cb..d568fc8 100644
>> --- a/drivers/net/wireless/b43/main.c
>> +++ b/drivers/net/wireless/b43/main.c
>> @@ -5094,8 +5094,9 @@ static int b43_op_beacon_set_tim(struct ieee80211_hw *hw,
>> {
>> struct b43_wl *wl = hw_to_b43_wl(hw);
>>
>> - /* FIXME: add locking */
>> + mutex_lock(&wl->mutex);
>> b43_update_templates(wl);
>> + mutex_unlock(&wl->mutex);
>>
>> return 0;
>> }
>
> Thanks for the patch.
>
> However, this does not work. We are in atomic context here.
> Please see the b43-dev mailing list archives for a recent thread about that.
> I'm also pretty sure that this is safe without lock, due to the higher level locks in mac80211.
>
^ permalink raw reply
* [PATCH 11/11] rtlwifi: Move macro definitions to core
From: Larry Finger @ 2015-01-02 16:58 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, Larry Finger, netdev
In-Reply-To: <1420217908-1382-1-git-send-email-Larry.Finger@lwfinger.net>
Several of the drivers still were defining their own copies of various
macros. These are all moved into the core.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
drivers/net/wireless/rtlwifi/core.h | 1 +
drivers/net/wireless/rtlwifi/rtl8188ee/dm.h | 3 ---
drivers/net/wireless/rtlwifi/rtl8192ee/dm.h | 3 ---
drivers/net/wireless/rtlwifi/rtl8192se/dm.c | 6 +++---
drivers/net/wireless/rtlwifi/rtl8192se/dm.h | 1 -
drivers/net/wireless/rtlwifi/rtl8723be/dm.h | 3 ---
drivers/net/wireless/rtlwifi/rtl8821ae/dm.h | 9 ---------
7 files changed, 4 insertions(+), 22 deletions(-)
diff --git a/drivers/net/wireless/rtlwifi/core.h b/drivers/net/wireless/rtlwifi/core.h
index 1cde356..7b64e34 100644
--- a/drivers/net/wireless/rtlwifi/core.h
+++ b/drivers/net/wireless/rtlwifi/core.h
@@ -42,6 +42,7 @@
#define DM_DIG_MAX 0x3e
#define DM_DIG_MIN 0x1e
+#define DM_DIG_MAX_AP 0x32
#define DM_DIG_BACKOFF_MAX 12
#define DM_DIG_BACKOFF_MIN -4
#define DM_DIG_BACKOFF_DEFAULT 10
diff --git a/drivers/net/wireless/rtlwifi/rtl8188ee/dm.h b/drivers/net/wireless/rtlwifi/rtl8188ee/dm.h
index 51ad3f9..071ccee 100644
--- a/drivers/net/wireless/rtlwifi/rtl8188ee/dm.h
+++ b/drivers/net/wireless/rtlwifi/rtl8188ee/dm.h
@@ -186,9 +186,6 @@
#define BW_AUTO_SWITCH_HIGH_LOW 25
#define BW_AUTO_SWITCH_LOW_HIGH 30
-#define DM_DIG_MAX_AP 0x32
-#define DM_DIG_MIN_AP 0x20
-
#define DM_DIG_FA_UPPER 0x3e
#define DM_DIG_FA_LOWER 0x1e
#define DM_DIG_FA_TH0 0x200
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ee/dm.h b/drivers/net/wireless/rtlwifi/rtl8192ee/dm.h
index 4880e19..107d5a4 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ee/dm.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192ee/dm.h
@@ -189,9 +189,6 @@
#define BW_AUTO_SWITCH_HIGH_LOW 25
#define BW_AUTO_SWITCH_LOW_HIGH 30
-#define DM_DIG_MAX_AP 0x32
-#define DM_DIG_MIN_AP 0x20
-
#define DM_DIG_FA_UPPER 0x3e
#define DM_DIG_FA_LOWER 0x1e
#define DM_DIG_FA_TH0 0x200
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/dm.c b/drivers/net/wireless/rtlwifi/rtl8192se/dm.c
index 6cac70b..575980b 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/dm.c
@@ -470,7 +470,7 @@ static void _rtl92s_dm_initial_gain_sta_beforeconnect(struct ieee80211_hw *hw)
if (digtable->backoff_enable_flag)
rtl92s_backoff_enable_flag(hw);
else
- digtable->back_val = DM_DIG_BACKOFF;
+ digtable->back_val = DM_DIG_BACKOFF_MAX;
if ((digtable->rssi_val + 10 - digtable->back_val) >
digtable->rx_gain_max)
@@ -504,7 +504,7 @@ static void _rtl92s_dm_initial_gain_sta_beforeconnect(struct ieee80211_hw *hw)
digtable->dig_ext_port_stage = DIG_EXT_PORT_STAGE_MAX;
rtl92s_phy_set_fw_cmd(hw, FW_CMD_DIG_ENABLE);
- digtable->back_val = DM_DIG_BACKOFF;
+ digtable->back_val = DM_DIG_BACKOFF_MAX;
digtable->cur_igvalue = rtlpriv->phy.default_initialgain[0];
digtable->pre_igvalue = 0;
return;
@@ -692,7 +692,7 @@ static void _rtl92s_dm_init_dig(struct ieee80211_hw *hw)
/* for dig debug rssi value */
digtable->rssi_val = 50;
- digtable->back_val = DM_DIG_BACKOFF;
+ digtable->back_val = DM_DIG_BACKOFF_MAX;
digtable->rx_gain_max = DM_DIG_MAX;
digtable->rx_gain_min = DM_DIG_MIN;
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/dm.h b/drivers/net/wireless/rtlwifi/rtl8192se/dm.h
index be07d81..de6ac79 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/dm.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/dm.h
@@ -83,7 +83,6 @@ enum dm_ratr_sta {
#define DM_DIG_HIGH_PWR_THRESH_HIGH 75
#define DM_DIG_HIGH_PWR_THRESH_LOW 70
-#define DM_DIG_BACKOFF 12
#define DM_DIG_MIN_Netcore 0x12
void rtl92s_dm_watchdog(struct ieee80211_hw *hw);
diff --git a/drivers/net/wireless/rtlwifi/rtl8723be/dm.h b/drivers/net/wireless/rtlwifi/rtl8723be/dm.h
index 533b4f2..f752a2c 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723be/dm.h
+++ b/drivers/net/wireless/rtlwifi/rtl8723be/dm.h
@@ -180,9 +180,6 @@
#define BW_AUTO_SWITCH_HIGH_LOW 25
#define BW_AUTO_SWITCH_LOW_HIGH 30
-#define DM_DIG_MAX_AP 0x32
-#define DM_DIG_MIN_AP 0x20
-
#define DM_DIG_FA_UPPER 0x3e
#define DM_DIG_FA_LOWER 0x1e
#define DM_DIG_FA_TH0 0x200
diff --git a/drivers/net/wireless/rtlwifi/rtl8821ae/dm.h b/drivers/net/wireless/rtlwifi/rtl8821ae/dm.h
index 5516557..625a6bb 100644
--- a/drivers/net/wireless/rtlwifi/rtl8821ae/dm.h
+++ b/drivers/net/wireless/rtlwifi/rtl8821ae/dm.h
@@ -187,15 +187,6 @@
#define BW_AUTO_SWITCH_HIGH_LOW 25
#define BW_AUTO_SWITCH_LOW_HIGH 30
-#define DM_FALSEALARM_THRESH_LOW 400
-#define DM_FALSEALARM_THRESH_HIGH 1000
-
-#define DM_DIG_MAX 0x3e
-#define DM_DIG_MIN 0x1e
-
-#define DM_DIG_MAX_AP 0x32
-#define DM_DIG_MIN_AP 0x20
-
#define DM_DIG_FA_UPPER 0x3e
#define DM_DIG_FA_LOWER 0x1e
#define DM_DIG_FA_TH0 200
--
2.1.2
^ permalink raw reply related
* [PATCH 08/11] rtlwifi: rtl8723ae: Convert driver to use common DM table initialization
From: Larry Finger @ 2015-01-02 16:58 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, Larry Finger, netdev
In-Reply-To: <1420217908-1382-1-git-send-email-Larry.Finger@lwfinger.net>
Convert driver rtl8723ae to use common routine rtl_dm_diginit().
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
drivers/net/wireless/rtlwifi/rtl8723ae/dm.c | 27 +--------------------------
1 file changed, 1 insertion(+), 26 deletions(-)
diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/dm.c b/drivers/net/wireless/rtlwifi/rtl8723ae/dm.c
index 8bd124c..4c1c96c 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723ae/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8723ae/dm.c
@@ -147,31 +147,6 @@ static const u8 cckswing_table_ch14[CCK_TABLE_SIZE][8] = {
{0x09, 0x08, 0x07, 0x04, 0x00, 0x00, 0x00, 0x00}
};
-static void rtl8723e_dm_diginit(struct ieee80211_hw *hw)
-{
- struct rtl_priv *rtlpriv = rtl_priv(hw);
- struct dig_t *dm_digtable = &rtlpriv->dm_digtable;
-
- dm_digtable->dig_enable_flag = true;
- dm_digtable->dig_ext_port_stage = DIG_EXT_PORT_STAGE_MAX;
- dm_digtable->cur_igvalue = 0x20;
- dm_digtable->pre_igvalue = 0x0;
- dm_digtable->cursta_cstate = DIG_STA_DISCONNECT;
- dm_digtable->presta_cstate = DIG_STA_DISCONNECT;
- dm_digtable->curmultista_cstate = DIG_MULTISTA_DISCONNECT;
- dm_digtable->rssi_lowthresh = DM_DIG_THRESH_LOW;
- dm_digtable->rssi_highthresh = DM_DIG_THRESH_HIGH;
- dm_digtable->fa_lowthresh = DM_FALSEALARM_THRESH_LOW;
- dm_digtable->fa_highthresh = DM_FALSEALARM_THRESH_HIGH;
- dm_digtable->rx_gain_max = DM_DIG_MAX;
- dm_digtable->rx_gain_min = DM_DIG_MIN;
- dm_digtable->back_val = DM_DIG_BACKOFF_DEFAULT;
- dm_digtable->back_range_max = DM_DIG_BACKOFF_MAX;
- dm_digtable->back_range_min = DM_DIG_BACKOFF_MIN;
- dm_digtable->pre_cck_pd_state = CCK_PD_STAGE_MAX;
- dm_digtable->cur_cck_pd_state = CCK_PD_STAGE_MAX;
-}
-
static u8 rtl8723e_dm_initial_gain_min_pwdb(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
@@ -819,7 +794,7 @@ void rtl8723e_dm_init(struct ieee80211_hw *hw)
struct rtl_priv *rtlpriv = rtl_priv(hw);
rtlpriv->dm.dm_type = DM_TYPE_BYDRIVER;
- rtl8723e_dm_diginit(hw);
+ rtl_dm_diginit(hw, 0x20);
rtl8723_dm_init_dynamic_txpower(hw);
rtl8723_dm_init_edca_turbo(hw);
rtl8723e_dm_init_rate_adaptive_mask(hw);
--
2.1.2
^ permalink raw reply related
* [PATCH 09/11] rtlwifi: rtl8723be: Convert driver to use common DM table initialization
From: Larry Finger @ 2015-01-02 16:58 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, Larry Finger, netdev
In-Reply-To: <1420217908-1382-1-git-send-email-Larry.Finger@lwfinger.net>
Convert driver rtl8723be to use routine rtl_dm_diginit().
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
drivers/net/wireless/rtlwifi/rtl8723be/dm.c | 32 ++---------------------------
1 file changed, 2 insertions(+), 30 deletions(-)
diff --git a/drivers/net/wireless/rtlwifi/rtl8723be/dm.c b/drivers/net/wireless/rtlwifi/rtl8723be/dm.c
index ddf45d9..2367e8f 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723be/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8723be/dm.c
@@ -212,35 +212,6 @@ void rtl8723be_dm_txpower_track_adjust(struct ieee80211_hw *hw, u8 type,
(pwr_val << 16) | (pwr_val << 24);
}
-static void rtl8723be_dm_diginit(struct ieee80211_hw *hw)
-{
- struct rtl_priv *rtlpriv = rtl_priv(hw);
- struct dig_t *dm_digtable = &rtlpriv->dm_digtable;
-
- dm_digtable->dig_enable_flag = true;
- dm_digtable->cur_igvalue = rtl_get_bbreg(hw, ROFDM0_XAAGCCORE1, 0x7f);
- dm_digtable->rssi_lowthresh = DM_DIG_THRESH_LOW;
- dm_digtable->rssi_highthresh = DM_DIG_THRESH_HIGH;
- dm_digtable->fa_lowthresh = DM_FALSEALARM_THRESH_LOW;
- dm_digtable->fa_highthresh = DM_FALSEALARM_THRESH_HIGH;
- dm_digtable->rx_gain_max = DM_DIG_MAX;
- dm_digtable->rx_gain_min = DM_DIG_MIN;
- dm_digtable->back_val = DM_DIG_BACKOFF_DEFAULT;
- dm_digtable->back_range_max = DM_DIG_BACKOFF_MAX;
- dm_digtable->back_range_min = DM_DIG_BACKOFF_MIN;
- dm_digtable->pre_cck_cca_thres = 0xff;
- dm_digtable->cur_cck_cca_thres = 0x83;
- dm_digtable->forbidden_igi = DM_DIG_MIN;
- dm_digtable->large_fa_hit = 0;
- dm_digtable->recover_cnt = 0;
- dm_digtable->dig_min_0 = DM_DIG_MIN;
- dm_digtable->dig_min_1 = DM_DIG_MIN;
- dm_digtable->media_connect_0 = false;
- dm_digtable->media_connect_1 = false;
- rtlpriv->dm.dm_initialgain_enable = true;
- dm_digtable->bt30_cur_igi = 0x32;
-}
-
void rtl8723be_dm_init_rate_adaptive_mask(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
@@ -294,9 +265,10 @@ static void rtl8723be_dm_init_dynamic_atc_switch(struct ieee80211_hw *hw)
void rtl8723be_dm_init(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
+ u32 cur_igvalue = rtl_get_bbreg(hw, ROFDM0_XAAGCCORE1, 0x7f);
rtlpriv->dm.dm_type = DM_TYPE_BYDRIVER;
- rtl8723be_dm_diginit(hw);
+ rtl_dm_diginit(hw, cur_igvalue);
rtl8723be_dm_init_rate_adaptive_mask(hw);
rtl8723_dm_init_edca_turbo(hw);
rtl8723_dm_init_dynamic_bb_powersaving(hw);
--
2.1.2
^ permalink raw reply related
* [PATCH 07/11] rtlwifi: rtl8192ee: Convert driver to use common DM table initialization
From: Larry Finger @ 2015-01-02 16:58 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, Larry Finger, netdev
In-Reply-To: <1420217908-1382-1-git-send-email-Larry.Finger@lwfinger.net>
Convert driver rtl8192ee to use the common routine to initialize
dm_digtable.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
drivers/net/wireless/rtlwifi/rtl8192ee/dm.c | 32 ++---------------------------
1 file changed, 2 insertions(+), 30 deletions(-)
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ee/dm.c b/drivers/net/wireless/rtlwifi/rtl8192ee/dm.c
index 70e58d1..459f3d0 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ee/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ee/dm.c
@@ -152,35 +152,6 @@ static const u8 cckswing_table_ch14[CCK_TABLE_SIZE][8] = {
{0x09, 0x08, 0x07, 0x04, 0x00, 0x00, 0x00, 0x00} /* 32, -16.0dB */
};
-static void rtl92ee_dm_diginit(struct ieee80211_hw *hw)
-{
- struct rtl_priv *rtlpriv = rtl_priv(hw);
- struct dig_t *dm_dig = &rtlpriv->dm_digtable;
-
- dm_dig->cur_igvalue = rtl_get_bbreg(hw, DM_REG_IGI_A_11N,
- DM_BIT_IGI_11N);
- dm_dig->rssi_lowthresh = DM_DIG_THRESH_LOW;
- dm_dig->rssi_highthresh = DM_DIG_THRESH_HIGH;
- dm_dig->fa_lowthresh = DM_FALSEALARM_THRESH_LOW;
- dm_dig->fa_highthresh = DM_FALSEALARM_THRESH_HIGH;
- dm_dig->rx_gain_max = DM_DIG_MAX;
- dm_dig->rx_gain_min = DM_DIG_MIN;
- dm_dig->back_val = DM_DIG_BACKOFF_DEFAULT;
- dm_dig->back_range_max = DM_DIG_BACKOFF_MAX;
- dm_dig->back_range_min = DM_DIG_BACKOFF_MIN;
- dm_dig->pre_cck_cca_thres = 0xff;
- dm_dig->cur_cck_cca_thres = 0x83;
- dm_dig->forbidden_igi = DM_DIG_MIN;
- dm_dig->large_fa_hit = 0;
- dm_dig->recover_cnt = 0;
- dm_dig->dig_min_0 = DM_DIG_MIN;
- dm_dig->dig_min_1 = DM_DIG_MIN;
- dm_dig->media_connect_0 = false;
- dm_dig->media_connect_1 = false;
- rtlpriv->dm.dm_initialgain_enable = true;
- dm_dig->bt30_cur_igi = 0x32;
-}
-
static void rtl92ee_dm_false_alarm_counter_statistics(struct ieee80211_hw *hw)
{
u32 ret_value;
@@ -1089,10 +1060,11 @@ static void rtl92ee_dm_init_dynamic_atc_switch(struct ieee80211_hw *hw)
void rtl92ee_dm_init(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
+ u32 cur_igvalue = rtl_get_bbreg(hw, DM_REG_IGI_A_11N, DM_BIT_IGI_11N);
rtlpriv->dm.dm_type = DM_TYPE_BYDRIVER;
- rtl92ee_dm_diginit(hw);
+ rtl_dm_diginit(hw, cur_igvalue);
rtl92ee_dm_init_rate_adaptive_mask(hw);
rtl92ee_dm_init_primary_cca_check(hw);
rtl92ee_dm_init_edca_turbo(hw);
--
2.1.2
^ permalink raw reply related
* [PATCH 06/11] rtlwifi: rtl8192de: Convert driver to use common DM table initialization
From: Larry Finger @ 2015-01-02 16:58 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, Larry Finger, netdev
In-Reply-To: <1420217908-1382-1-git-send-email-Larry.Finger@lwfinger.net>
This patch converts driver rtl8192de to use the common routine to
initialize dm_digtable.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
drivers/net/wireless/rtlwifi/rtl8192de/dm.c | 32 +++--------------------------
1 file changed, 3 insertions(+), 29 deletions(-)
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/dm.c b/drivers/net/wireless/rtlwifi/rtl8192de/dm.c
index 75643ab..a1be5a6 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/dm.c
@@ -156,34 +156,6 @@ static const u8 cckswing_table_ch14[CCK_TABLE_SIZE][8] = {
{0x09, 0x08, 0x07, 0x04, 0x00, 0x00, 0x00, 0x00} /* 32, -16.0dB */
};
-static void rtl92d_dm_diginit(struct ieee80211_hw *hw)
-{
- struct rtl_priv *rtlpriv = rtl_priv(hw);
- struct dig_t *de_digtable = &rtlpriv->dm_digtable;
-
- de_digtable->dig_enable_flag = true;
- de_digtable->dig_ext_port_stage = DIG_EXT_PORT_STAGE_MAX;
- de_digtable->cur_igvalue = 0x20;
- de_digtable->pre_igvalue = 0x0;
- de_digtable->cursta_cstate = DIG_STA_DISCONNECT;
- de_digtable->presta_cstate = DIG_STA_DISCONNECT;
- de_digtable->curmultista_cstate = DIG_MULTISTA_DISCONNECT;
- de_digtable->rssi_lowthresh = DM_DIG_THRESH_LOW;
- de_digtable->rssi_highthresh = DM_DIG_THRESH_HIGH;
- de_digtable->fa_lowthresh = DM_FALSEALARM_THRESH_LOW;
- de_digtable->fa_highthresh = DM_FALSEALARM_THRESH_HIGH;
- de_digtable->rx_gain_max = DM_DIG_FA_UPPER;
- de_digtable->rx_gain_min = DM_DIG_FA_LOWER;
- de_digtable->back_val = DM_DIG_BACKOFF_DEFAULT;
- de_digtable->back_range_max = DM_DIG_BACKOFF_MAX;
- de_digtable->back_range_min = DM_DIG_BACKOFF_MIN;
- de_digtable->pre_cck_pd_state = CCK_PD_STAGE_LOWRSSI;
- de_digtable->cur_cck_pd_state = CCK_PD_STAGE_MAX;
- de_digtable->large_fa_hit = 0;
- de_digtable->recover_cnt = 0;
- de_digtable->forbidden_igi = DM_DIG_FA_LOWER;
-}
-
static void rtl92d_dm_false_alarm_counter_statistics(struct ieee80211_hw *hw)
{
u32 ret_value;
@@ -1306,7 +1278,9 @@ void rtl92d_dm_init(struct ieee80211_hw *hw)
struct rtl_priv *rtlpriv = rtl_priv(hw);
rtlpriv->dm.dm_type = DM_TYPE_BYDRIVER;
- rtl92d_dm_diginit(hw);
+ rtl_dm_diginit(hw, 0x20);
+ rtlpriv->dm_digtable.rx_gain_max = DM_DIG_FA_UPPER;
+ rtlpriv->dm_digtable.rx_gain_min = DM_DIG_FA_LOWER;
rtl92d_dm_init_dynamic_txpower(hw);
rtl92d_dm_init_edca_turbo(hw);
rtl92d_dm_init_rate_adaptive_mask(hw);
--
2.1.2
^ 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