* [PATCH 10/19] net: Change variable type to bool
From: Peter Senna Tschudin @ 2013-09-21 22:27 UTC (permalink / raw)
To: hykim; +Cc: netdev, linux-kernel, kernel-janitors, Peter Senna Tschudin
In-Reply-To: <1379802471-30252-1-git-send-email-peter.senna@gmail.com>
There is the rc variable on both myri10ge_ss_lock_napi and
myri10ge_ss_lock_poll functions. In both cases rc is only assigned the
values true and false. Both functions already return bool. Change rc
type to bool.
The simplified semantic patch that find this problem is as
follows (http://coccinelle.lip6.fr/):
@exists@
type T;
identifier b;
@@
- T
+ bool
b = ...;
... when any
b = \(true\|false\)
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
---
drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
index 149355b..7792264 100644
--- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
+++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
@@ -934,7 +934,7 @@ static inline void myri10ge_ss_init_lock(struct myri10ge_slice_state *ss)
static inline bool myri10ge_ss_lock_napi(struct myri10ge_slice_state *ss)
{
- int rc = true;
+ bool rc = true;
spin_lock(&ss->lock);
if ((ss->state & SLICE_LOCKED)) {
WARN_ON((ss->state & SLICE_STATE_NAPI));
@@ -957,7 +957,7 @@ static inline void myri10ge_ss_unlock_napi(struct myri10ge_slice_state *ss)
static inline bool myri10ge_ss_lock_poll(struct myri10ge_slice_state *ss)
{
- int rc = true;
+ bool rc = true;
spin_lock_bh(&ss->lock);
if ((ss->state & SLICE_LOCKED)) {
ss->state |= SLICE_STATE_POLL_YIELD;
--
1.8.3.1
^ permalink raw reply related
* [PATCH 11/19] wireless: Change variable type to bool
From: Peter Senna Tschudin @ 2013-09-21 22:27 UTC (permalink / raw)
To: bzhao
Cc: linville, linux-wireless, netdev, linux-kernel, kernel-janitors,
Peter Senna Tschudin
In-Reply-To: <1379802471-30252-1-git-send-email-peter.senna@gmail.com>
The variables cancel_scan_cmd, enable_data, hs_activate and valid are
only assigned the values true and false. Change its type to bool.
The simplified semantic patch that find this problem is as
follows (http://coccinelle.lip6.fr/):
@exists@
type T;
identifier b;
@@
- T
+ bool
b = ...;
... when any
b = \(true\|false\)
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
---
drivers/net/wireless/mwifiex/cmdevt.c | 2 +-
drivers/net/wireless/mwifiex/join.c | 2 +-
drivers/net/wireless/mwifiex/sta_cmd.c | 2 +-
drivers/net/wireless/mwifiex/wmm.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c
index 2d76147..fb3fa18 100644
--- a/drivers/net/wireless/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/mwifiex/cmdevt.c
@@ -1048,7 +1048,7 @@ mwifiex_cancel_pending_ioctl(struct mwifiex_adapter *adapter)
struct cmd_ctrl_node *cmd_node = NULL, *tmp_node = NULL;
unsigned long cmd_flags;
unsigned long scan_pending_q_flags;
- uint16_t cancel_scan_cmd = false;
+ bool cancel_scan_cmd = false;
if ((adapter->curr_cmd) &&
(adapter->curr_cmd->wait_q_enabled)) {
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c
index 9d7c0e6..717fbe2 100644
--- a/drivers/net/wireless/mwifiex/join.c
+++ b/drivers/net/wireless/mwifiex/join.c
@@ -621,7 +621,7 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
int ret = 0;
struct ieee_types_assoc_rsp *assoc_rsp;
struct mwifiex_bssdescriptor *bss_desc;
- u8 enable_data = true;
+ bool enable_data = true;
u16 cap_info, status_code;
assoc_rsp = (struct ieee_types_assoc_rsp *) &resp->params;
diff --git a/drivers/net/wireless/mwifiex/sta_cmd.c b/drivers/net/wireless/mwifiex/sta_cmd.c
index c0268b5..7d66018 100644
--- a/drivers/net/wireless/mwifiex/sta_cmd.c
+++ b/drivers/net/wireless/mwifiex/sta_cmd.c
@@ -327,7 +327,7 @@ mwifiex_cmd_802_11_hs_cfg(struct mwifiex_private *priv,
{
struct mwifiex_adapter *adapter = priv->adapter;
struct host_cmd_ds_802_11_hs_cfg_enh *hs_cfg = &cmd->params.opt_hs_cfg;
- u16 hs_activate = false;
+ bool hs_activate = false;
if (!hscfg_param)
/* New Activate command */
diff --git a/drivers/net/wireless/mwifiex/wmm.c b/drivers/net/wireless/mwifiex/wmm.c
index 2e8f9cd..8f8fea0 100644
--- a/drivers/net/wireless/mwifiex/wmm.c
+++ b/drivers/net/wireless/mwifiex/wmm.c
@@ -708,7 +708,7 @@ int mwifiex_ret_wmm_get_status(struct mwifiex_private *priv,
{
u8 *curr = (u8 *) &resp->params.get_wmm_status;
uint16_t resp_len = le16_to_cpu(resp->size), tlv_len;
- int valid = true;
+ bool valid = true;
struct mwifiex_ie_types_data *tlv_hdr;
struct mwifiex_ie_types_wmm_queue_status *tlv_wmm_qstatus;
--
1.8.3.1
^ permalink raw reply related
* [PATCH 12/19] wireless: Change variable type to bool
From: Peter Senna Tschudin @ 2013-09-21 22:27 UTC (permalink / raw)
To: Larry.Finger
Cc: chaoming_li, linville, linux-wireless, netdev, linux-kernel,
kernel-janitors, Peter Senna Tschudin
In-Reply-To: <1379802471-30252-1-git-send-email-peter.senna@gmail.com>
The variable continual is only assigned the values true and false.
Change its type to bool.
The simplified semantic patch that find this problem is as
follows (http://coccinelle.lip6.fr/):
@exists@
type T;
identifier b;
@@
- T
+ bool
b = ...;
... when any
b = \(true\|false\)
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
---
drivers/net/wireless/rtlwifi/efuse.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/rtlwifi/efuse.c b/drivers/net/wireless/rtlwifi/efuse.c
index 838a1ed..63d370d 100644
--- a/drivers/net/wireless/rtlwifi/efuse.c
+++ b/drivers/net/wireless/rtlwifi/efuse.c
@@ -1203,7 +1203,7 @@ static void efuse_power_switch(struct ieee80211_hw *hw, u8 write, u8 pwrstate)
static u16 efuse_get_current_size(struct ieee80211_hw *hw)
{
- int continual = true;
+ bool continual = true;
u16 efuse_addr = 0;
u8 hworden;
u8 efuse_data, word_cnts;
--
1.8.3.1
^ permalink raw reply related
* [PATCH 19/19] net: Change variable type to bool
From: Peter Senna Tschudin @ 2013-09-21 22:27 UTC (permalink / raw)
To: davem
Cc: kuznet, jmorris, kaber, netdev, linux-kernel, kernel-janitors,
Peter Senna Tschudin
In-Reply-To: <1379802471-30252-1-git-send-email-peter.senna@gmail.com>
The variable fully_acked is only assigned the values true and false.
Change its type to bool.
The simplified semantic patch that find this problem is as
follows (http://coccinelle.lip6.fr/):
@exists@
type T;
identifier b;
@@
- T
+ bool
b = ...;
... when any
b = \(true\|false\)
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
---
net/ipv4/tcp_input.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 25a89ea..fa17dce 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2970,7 +2970,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets,
const struct inet_connection_sock *icsk = inet_csk(sk);
struct sk_buff *skb;
u32 now = tcp_time_stamp;
- int fully_acked = true;
+ bool fully_acked = true;
int flag = 0;
u32 pkts_acked = 0;
u32 reord = tp->packets_out;
--
1.8.3.1
^ permalink raw reply related
* Re: [PATCH] declance: Remove `incompatible pointer type' warnings
From: Sergei Shtylyov @ 2013-09-21 22:41 UTC (permalink / raw)
To: Maciej W. Rozycki; +Cc: netdev
In-Reply-To: <alpine.LFD.2.03.1309200008060.5967@linux-mips.org>
Hello.
On 09/20/2013 03:49 AM, Maciej W. Rozycki wrote:
> Revert damage caused by 43d620c82985b19008d87a437b4cf83f356264f7:
Please also specify that commit's summary in parens. That's the only way
to uniquely identify a commit and makes life a bit easier when you browse the
commits.
> .../declance.c: In function 'cp_to_buf':
> .../declance.c:347: warning: assignment from incompatible pointer type
> .../declance.c:348: warning: assignment from incompatible pointer type
> .../declance.c: In function 'cp_from_buf':
> .../declance.c:406: warning: assignment from incompatible pointer type
> .../declance.c:407: warning: assignment from incompatible pointer type
> Also add a `const' qualifier where applicable and adjust formatting.
> Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
WBR, Sergei
^ permalink raw reply
* [PATCH ethtool] Fix iteration count in sff8472_calibration()
From: Ben Hutchings @ 2013-09-22 1:36 UTC (permalink / raw)
To: Ben Hutchings; +Cc: netdev, Aurelien Guillaume
[-- Attachment #1: Type: text/plain, Size: 962 bytes --]
We want to iterate over all elements of the various arrays of readings
(which all have the same dimensions - and maybe ought to be a single
array). Unfortunately the iteration count is sizeof(sd->bias_cur) and
bias_cur has 2-byte elements, so we iterate over twice as many
elements as are really there.
Compiler-detected, and compile-tested only.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
sfpdiag.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sfpdiag.c b/sfpdiag.c
index f67e491..04fd880 100644
--- a/sfpdiag.c
+++ b/sfpdiag.c
@@ -224,7 +224,7 @@ static void sff8472_calibration(const __u8 *id, struct sff8472_diags *sd)
__u16 rx_reading;
/* Calibration should occur for all values (threshold and current) */
- for (i = 0; i < sizeof(sd->bias_cur); ++i) {
+ for (i = 0; i < ARRAY_SIZE(sd->bias_cur); ++i) {
/*
* Apply calibration formula 1 (Temp., Voltage, Bias, Tx Power)
*/
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply related
* Re: [Xen-devel] TSQ accounting skb->truesize degrades throughput for large packets
From: Cong Wang @ 2013-09-22 2:36 UTC (permalink / raw)
To: Wei Liu; +Cc: xen-devel, Linux Kernel Network Developers, Eric Dumazet
In-Reply-To: <20130921150327.GA9078@zion.uk.xensource.com>
On Sat, Sep 21, 2013 at 11:03 PM, Wei Liu <wei.liu2@citrix.com> wrote:
> On Sat, Sep 21, 2013 at 03:00:26AM +0000, Cong Wang wrote:
>> Eric Dumazet <eric.dumazet <at> gmail.com> writes:
>>
>> >
>> > Yeah, my own test was more like the following
>> >
>> ...
>> >
>> > Note that it also seems to make Hystart happier.
>> >
>> > I will send patches when all tests are green.
>> >
>>
>> How is this going? I don't see any patch posted to netdev.
>>
>
> I'm afraid you forgot to CC any relevant people in thie email. :-)
>
I was replying via newsgroup, not mailing list. :)
Anyway, adding Eric and netdev now.
^ permalink raw reply
* Re: [Xen-devel] [PATCH net-next v2 1/2] xen-netback: add a vif-is-connected flag
From: annie li @ 2013-09-22 2:56 UTC (permalink / raw)
To: Paul Durrant; +Cc: netdev, xen-devel, Wei Liu, David Vrabel, Ian Campbell
In-Reply-To: <1379685460-25032-2-git-send-email-paul.durrant@citrix.com>
On 2013-9-20 21:57, Paul Durrant wrote:
> Having applied my patch to separate vif disconnect and free, I ran into a
> BUG when testing resume from S3 with a Windows frontend because the vif task
> pointer was not cleared by xenvif_disconnect() and so a double call to this
> function tries to stop the thread twice.
Or it is better to do more implements in windows netfront? For example,
when the windows vm hibernates, disconnect the vif as required by
netback: connect-> closing-> closed.
Thanks
Annie
> Rather than applying a point fix for that issue it seems better to introduce
> a boolean to indicate whether the vif is connected or not such that repeated
> calls to either xenvif_connect() or xenvif_disconnect() behave appropriately.
>
> Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> Cc: David Vrabel <david.vrabel@citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>
> Cc: Ian Campbell <ian.campbell@citrix.com>
> ---
> drivers/net/xen-netback/common.h | 1 +
> drivers/net/xen-netback/interface.c | 24 +++++++++++++-----------
> 2 files changed, 14 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
> index 5715318..860d92c 100644
> --- a/drivers/net/xen-netback/common.h
> +++ b/drivers/net/xen-netback/common.h
> @@ -169,6 +169,7 @@ struct xenvif {
>
> /* Miscellaneous private stuff. */
> struct net_device *dev;
> + bool connected;
> };
>
> static inline struct xenbus_device *xenvif_to_xenbus_device(struct xenvif *vif)
> diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
> index 01bb854..94b47f5 100644
> --- a/drivers/net/xen-netback/interface.c
> +++ b/drivers/net/xen-netback/interface.c
> @@ -366,7 +366,7 @@ int xenvif_connect(struct xenvif *vif, unsigned long tx_ring_ref,
> int err = -ENOMEM;
>
> /* Already connected through? */
> - if (vif->tx_irq)
> + if (vif->connected)
> return 0;
>
> err = xenvif_map_frontend_rings(vif, tx_ring_ref, rx_ring_ref);
> @@ -425,6 +425,7 @@ int xenvif_connect(struct xenvif *vif, unsigned long tx_ring_ref,
>
> wake_up_process(vif->task);
>
> + vif->connected = 1;
> return 0;
>
> err_rx_unbind:
> @@ -453,23 +454,24 @@ void xenvif_carrier_off(struct xenvif *vif)
>
> void xenvif_disconnect(struct xenvif *vif)
> {
> + if (!vif->connected)
> + return;
> +
> if (netif_carrier_ok(vif->dev))
> xenvif_carrier_off(vif);
>
> - if (vif->tx_irq) {
> - if (vif->tx_irq == vif->rx_irq)
> - unbind_from_irqhandler(vif->tx_irq, vif);
> - else {
> - unbind_from_irqhandler(vif->tx_irq, vif);
> - unbind_from_irqhandler(vif->rx_irq, vif);
> - }
> - vif->tx_irq = 0;
> + if (vif->tx_irq == vif->rx_irq)
> + unbind_from_irqhandler(vif->tx_irq, vif);
> + else {
> + unbind_from_irqhandler(vif->tx_irq, vif);
> + unbind_from_irqhandler(vif->rx_irq, vif);
> }
>
> - if (vif->task)
> - kthread_stop(vif->task);
> + kthread_stop(vif->task);
>
> xenvif_unmap_frontend_rings(vif);
> +
> + vif->connected = 0;
> }
>
> void xenvif_free(struct xenvif *vif)
^ permalink raw reply
* Re: [PATCH 1/2] net: phy: at803x: don't pass function pointers with &
From: Mugunthan V N @ 2013-09-22 5:59 UTC (permalink / raw)
To: Daniel Mack; +Cc: netdev, davem, ujhelyi.m, sergei.shtylyov
In-Reply-To: <1379775182-1271-1-git-send-email-zonque@gmail.com>
On Saturday 21 September 2013 08:23 PM, Daniel Mack wrote:
> Just a cosmetic cleanup.
>
> Signed-off-by: Daniel Mack <zonque@gmail.com>
Looks good to me
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Regards
Mugunthan V N
^ permalink raw reply
* Re: [PATCH 2/2] net: phy: at803x: add suspend/resume callbacks
From: Mugunthan V N @ 2013-09-22 6:00 UTC (permalink / raw)
To: Daniel Mack, netdev; +Cc: davem, ujhelyi.m, sergei.shtylyov
In-Reply-To: <1379775182-1271-2-git-send-email-zonque@gmail.com>
On Saturday 21 September 2013 08:23 PM, Daniel Mack wrote:
> When WOL is enabled, the chip can't be put into power-down (BMCR_PDOWN)
> mode, as that will also switch off the MAC, which consequently leads to
> a link loss.
>
> Use BMCR_ISOLATE in that case, which will at least save us some
> milliamperes in comparison to normal operation mode.
>
> Signed-off-by: Daniel Mack <zonque@gmail.com>
Looks good to me
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Regards
Mugunthan V N
^ permalink raw reply
* Re: [Xen-devel] [PATCH net-next] xen-netfront: convert to GRO API and advertise this feature
From: Jason Wang @ 2013-09-22 6:29 UTC (permalink / raw)
To: Wei Liu, netdev; +Cc: Anirban Chakraborty, Ian Campbell, xen-devel
In-Reply-To: <1379779543-27122-1-git-send-email-wei.liu2@citrix.com>
On 09/22/2013 12:05 AM, Wei Liu wrote:
> Anirban was seeing netfront received MTU size packets, which downgraded
> throughput. The following patch makes netfront use GRO API which
> improves throughput for that case.
>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> Signed-off-by: Anirban Chakraborty <abchak@juniper.net>
> Cc: Ian Campbell <ian.campbell@citrix.com>
Maybe a dumb question: doesn't Xen depends on the driver of host card to
do GRO and pass it to netfront? What the case that netfront can receive
a MTU size packet, for a card that does not support GRO in host? Doing
GRO twice may introduce extra overheads.
Thanks
^ permalink raw reply
* Re: Re: [PATCH] USB2NET : SR9700 : One chip USB 1.1 USB2NETSR9700Device Driver Support
From: liujunliang_ljl @ 2013-09-22 7:44 UTC (permalink / raw)
To: David Miller
Cc: horms, joe, romieu, gregkh, netdev, linux-usb, linux-kernel,
sunhecheng
In-Reply-To: <20130903.222708.238851084536537650.davem@davemloft.net>
Dear Miller :
I'm sorry to trouble you that How about the process for SR9700 Device Driver release?
Thanks a lot.
2013-09-22
liujunliang_ljl
发件人: David Miller
发送时间: 2013-09-04 10:27:14
收件人: liujunliang_ljl
抄送: horms; joe; romieu; gregkh; netdev; linux-usb; linux-kernel; sunhecheng
主题: Re: [PATCH] USB2NET : SR9700 : One chip USB 1.1 USB2NETSR9700Device Driver Support
From: liujunliang_ljl@163.com
Date: Sun, 1 Sep 2013 19:38:08 +0800
> From: Liu Junliang <liujunliang_ljl@163.com>
>
> Signed-off-by: Liu Junliang <liujunliang_ljl@163.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH 1/2] remove all uses of printf's %n
From: George Spelvin @ 2013-09-22 8:09 UTC (permalink / raw)
To: jslaby, keescook, penguin-kernel
Cc: akpm, dan.carpenter, geert, JBeulich, joe, kosaki.motohiro,
linux-kernel, linux-sctp, linux, netdev, remi.denis-courmont,
viro, xemul
In-Reply-To: <201309210928.JCF90671.OtOFLFQSOJVFMH@I-love.SAKURA.ne.jp>
> If you want, we can rename seq_pad() to seq_pad_and_putc(). Also we can pass
> both the padding character (e.g. ' ') and the trailing character (e.g. '\n')
> like seq_pad_and_putc((' ' << 8) | '\n'), though I wonder someone wants to
> use '\0', '\t', '\n' etc. as the padding character...
How about let that complexity wait until it's needed? It's not like
it's that big a PITA of a patch to write, and there's a significant
chance it will *never* be needed.
^ permalink raw reply
* Re: [PATCH 1/2] remove all uses of printf's %n
From: Geert Uytterhoeven @ 2013-09-22 8:16 UTC (permalink / raw)
To: Tetsuo Handa
Cc: Kees Cook, Jiri Slaby, Al Viro, xemul, remi.denis-courmont,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-sctp,
George Spelvin, Andrew Morton, Dan Carpenter, Jan Beulich,
Joe Perches, Motohiro KOSAKI
In-Reply-To: <201309210928.JCF90671.OtOFLFQSOJVFMH@I-love.SAKURA.ne.jp>
On Sat, Sep 21, 2013 at 2:28 AM, Tetsuo Handa
<penguin-kernel@i-love.sakura.ne.jp> wrote:
> Kees Cook wrote:
>> >> - seq_printf(seq, "%*s\n", 127 - len, "");
>> >> + seq_pad(seq, '\n');
>> >
>> > Hmm, seq_pad is unintuitive. I would say it pads the string by '\n'. Of
>> > course it does not, but...
>>
>> I don't think this is a very serious problem. Currently, the padding
>> character is always ' ' for all existing callers, so it only makes
>> sense to make the trailing character an argument.
>
> If you want, we can rename seq_pad() to seq_pad_and_putc(). Also we can pass
> both the padding character (e.g. ' ') and the trailing character (e.g. '\n')
> like seq_pad_and_putc((' ' << 8) | '\n'), though I wonder someone wants to
> use '\0', '\t', '\n' etc. as the padding character...
Not those special characters. '-' could be useful for tables (doh,
text-mode graphics
log output).
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* Re: [PATCH 12/19] wireless: Change variable type to bool
From: Joe Perches @ 2013-09-22 8:22 UTC (permalink / raw)
To: Peter Senna Tschudin
Cc: Larry.Finger, chaoming_li, linville, linux-wireless, netdev,
linux-kernel, kernel-janitors
In-Reply-To: <1379802471-30252-12-git-send-email-peter.senna@gmail.com>
On Sun, 2013-09-22 at 00:27 +0200, Peter Senna Tschudin wrote:
> The variable continual is only assigned the values true and false.
> Change its type to bool.
[]
> diff --git a/drivers/net/wireless/rtlwifi/efuse.c b/drivers/net/wireless/rtlwifi/efuse.c
[]
> @@ -1203,7 +1203,7 @@ static void efuse_power_switch(struct ieee80211_hw *hw, u8 write, u8 pwrstate)
>
> static u16 efuse_get_current_size(struct ieee80211_hw *hw)
> {
> - int continual = true;
> + bool continual = true;
> u16 efuse_addr = 0;
> u8 hworden;
> u8 efuse_data, word_cnts;
Yes, this could use bool, but would probably be better
written without continual at all
as it is before this patch:
static u16 efuse_get_current_size(struct ieee80211_hw *hw)
{
int continual = true;
u16 efuse_addr = 0;
u8 hworden;
u8 efuse_data, word_cnts;
while (continual && efuse_one_byte_read(hw, efuse_addr, &efuse_data)
&& (efuse_addr < EFUSE_MAX_SIZE)) {
if (efuse_data != 0xFF) {
hworden = efuse_data & 0x0F;
word_cnts = efuse_calculate_word_cnts(hworden);
efuse_addr = efuse_addr + (word_cnts * 2) + 1;
} else {
continual = false;
}
}
return efuse_addr;
}
I think writing it without continual, which is effectively
an ersatz "break", would be better
Something like:
static u16 efuse_get_current_size(struct ieee80211_hw *hw)
{
u16 efuse_addr = 0;
u8 hworden;
u8 efuse_data, word_cnts;
while (efuse_one_byte_read(hw, efuse_addr, &efuse_data) &&
(efuse_addr < EFUSE_MAX_SIZE) {
if (efuse_data == 0xff)
break;
hworden = efuse_data & 0x0F;
word_cnts = efuse_calculate_word_cnts(hworden);
efuse_addr = efuse_addr + (word_cnts * 2) + 1;
}
return efuse_addr;
}
^ permalink raw reply
* Donation!!! Forthe purpose of confidentiality and to claim your prize, reply via this email :bayfordadrian1@gmail.com
From: Kelsey Gries @ 2013-09-22 9:59 UTC (permalink / raw)
This is a personal mail directed to you. My wife and I won 148.6m in the
Euro Millions jackpot in August 2012 and have voluntarily decided to
donate $1,000,000..00 USD to you as part of our own charity project to
improve the life of 10 lucky individuals all over the world.If you have
received this email please do not delete it and it is not by mistake
because you are one of the lucky recipients, get back to us with your
details so that we can forward it to the payout bank who will transfer
your own part of the donation to you.
You can verify this by visiting the web pages below.
http://www.guardian.co.uk/uk/2012/aug/14/british-euromillions-jackpot-winners-revealed
http://www.bbc.co.uk/news/uk-england-19254228
For the purpose of confidentiality and to claim your prize, reply via
this email :bayfordadrian1@gmail.com
Yours Sincerely,
Gillian & Adrian Bayford
^ permalink raw reply
* [PATCH] Do not drop DNATed 6to4/6rd packets
From: Catalin(ux) M. BOIE @ 2013-09-22 10:58 UTC (permalink / raw)
To: netdev; +Cc: hannes, yoshfuji, davem
In-Reply-To: <20130915131401.GA18477@order.stressinduktion.org>
From: "Catalin(ux) M. BOIE" <catab@embedromix.ro>
When a router is doing DNAT for 6to4/6rd packets the latest anti-spoofing
patch (218774dc) will drop them because the IPv6 address embedded
does not match the IPv4 destination. This patch will allow them to
pass by testing if we have an address that matches on 6to4/6rd interface.
I have been hit by this problem using Fedora and IPV6TO4_IPV4ADDR.
Also, log the dropped packets (with rate limit).
Signed-off-by: Catalin(ux) M. BOIE <catab@embedromix.ro>
---
include/net/addrconf.h | 4 +++
net/ipv6/addrconf.c | 27 ++++++++++++++++
net/ipv6/sit.c | 83 +++++++++++++++++++++++++++++++++++++++++---------
3 files changed, 99 insertions(+), 15 deletions(-)
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index fb314de..96966eb 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -67,6 +67,10 @@ int ipv6_chk_addr(struct net *net, const struct in6_addr *addr,
int ipv6_chk_home_addr(struct net *net, const struct in6_addr *addr);
#endif
+extern bool ipv6_chk_custom_prefix(const struct in6_addr *addr,
+ const unsigned int prefix_len,
+ struct net_device *dev);
+
int ipv6_chk_prefix(const struct in6_addr *addr, struct net_device *dev);
struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net,
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index d6ff126..a0c3abe 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1499,6 +1499,33 @@ static bool ipv6_chk_same_addr(struct net *net, const struct in6_addr *addr,
return false;
}
+/* Compares an address/prefix_len with addresses on device @dev.
+ * If one is found it returns true.
+ */
+bool ipv6_chk_custom_prefix(const struct in6_addr *addr,
+ const unsigned int prefix_len, struct net_device *dev)
+{
+ struct inet6_dev *idev;
+ struct inet6_ifaddr *ifa;
+ bool ret = false;
+
+ rcu_read_lock();
+ idev = __in6_dev_get(dev);
+ if (idev) {
+ read_lock_bh(&idev->lock);
+ list_for_each_entry(ifa, &idev->addr_list, if_list) {
+ ret = ipv6_prefix_equal(addr, &ifa->addr, prefix_len);
+ if (ret)
+ break;
+ }
+ read_unlock_bh(&idev->lock);
+ }
+ rcu_read_unlock();
+
+ return ret;
+}
+EXPORT_SYMBOL(ipv6_chk_custom_prefix);
+
int ipv6_chk_prefix(const struct in6_addr *addr, struct net_device *dev)
{
struct inet6_dev *idev;
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 7ee5cb9..6b2230d 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -566,6 +566,69 @@ static inline bool is_spoofed_6rd(struct ip_tunnel *tunnel, const __be32 v4addr,
return false;
}
+/* Checks if an address matches an address on the tunnel interface.
+ * Used to detect the NAT of proto 41 packets and let them pass spoofing test.
+ * Long story:
+ * This function is called after we considered the packet as spoofed
+ * in is_spoofed_6rd.
+ * We may have a router that is doing NAT for proto 41 packets
+ * for an internal station. Destination a.a.a.a/PREFIX:bbbb:bbbb
+ * will be translated to n.n.n.n/PREFIX:bbbb:bbbb. And is_spoofed_6rd
+ * function will return true, dropping the packet.
+ * But, we can still check if is spoofed against the IP
+ * addresses associated with the interface.
+ */
+static bool only_dnatted(const struct ip_tunnel *tunnel,
+ const struct in6_addr *v6dst)
+{
+ int prefix_len;
+
+#ifdef CONFIG_IPV6_SIT_6RD
+ prefix_len = tunnel->ip6rd.prefixlen + 32
+ - tunnel->ip6rd.relay_prefixlen;
+#else
+ prefix_len = 48;
+#endif
+ return ipv6_chk_custom_prefix(v6dst, prefix_len, tunnel->dev);
+}
+
+/* Returns true if a packet is spoofed
+ */
+static bool packet_is_spoofed(struct sk_buff *skb,
+ const struct iphdr *iph,
+ struct ip_tunnel *tunnel)
+{
+ const struct ipv6hdr *ipv6h = ipv6_hdr(skb);
+
+ if (tunnel->dev->priv_flags & IFF_ISATAP) {
+ if (!isatap_chksrc(skb, iph, tunnel))
+ return true;
+
+ return false;
+ }
+
+ if ((tunnel->dev->flags&IFF_POINTOPOINT))
+ return false;
+
+ if (unlikely(is_spoofed_6rd(tunnel, iph->saddr, &ipv6h->saddr))) {
+ net_warn_ratelimited("Src spoofed %pI4/%pI6c -> %pI4/%pI6c\n",
+ &iph->saddr, &ipv6h->saddr,
+ &iph->daddr, &ipv6h->daddr);
+ return true;
+ }
+
+ if (likely(!is_spoofed_6rd(tunnel, iph->daddr, &ipv6h->daddr)))
+ return false;
+
+ if (only_dnatted(tunnel, &ipv6h->daddr))
+ return false;
+
+ net_warn_ratelimited("Dst spoofed %pI4/%pI6c -> %pI4/%pI6c\n",
+ &iph->saddr, &ipv6h->saddr,
+ &iph->daddr, &ipv6h->daddr);
+ return true;
+}
+
static int ipip6_rcv(struct sk_buff *skb)
{
const struct iphdr *iph = ip_hdr(skb);
@@ -586,19 +649,9 @@ static int ipip6_rcv(struct sk_buff *skb)
IPCB(skb)->flags = 0;
skb->protocol = htons(ETH_P_IPV6);
- if (tunnel->dev->priv_flags & IFF_ISATAP) {
- if (!isatap_chksrc(skb, iph, tunnel)) {
- tunnel->dev->stats.rx_errors++;
- goto out;
- }
- } else if (!(tunnel->dev->flags&IFF_POINTOPOINT)) {
- if (is_spoofed_6rd(tunnel, iph->saddr,
- &ipv6_hdr(skb)->saddr) ||
- is_spoofed_6rd(tunnel, iph->daddr,
- &ipv6_hdr(skb)->daddr)) {
- tunnel->dev->stats.rx_errors++;
- goto out;
- }
+ if (packet_is_spoofed(skb, iph, tunnel)) {
+ tunnel->dev->stats.rx_errors++;
+ goto out;
}
__skb_tunnel_rx(skb, tunnel->dev, tunnel->net);
@@ -748,7 +801,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
neigh = dst_neigh_lookup(skb_dst(skb), &iph6->daddr);
if (neigh == NULL) {
- net_dbg_ratelimited("sit: nexthop == NULL\n");
+ net_dbg_ratelimited("nexthop == NULL\n");
goto tx_error;
}
@@ -777,7 +830,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
neigh = dst_neigh_lookup(skb_dst(skb), &iph6->daddr);
if (neigh == NULL) {
- net_dbg_ratelimited("sit: nexthop == NULL\n");
+ net_dbg_ratelimited("nexthop == NULL\n");
goto tx_error;
}
--
1.8.3.1
^ permalink raw reply related
* Re: [ovs-dev] [PATCH v2.39 7/7] datapath: Add basic MPLS support to kernel
From: Simon Horman @ 2013-09-22 3:54 UTC (permalink / raw)
To: Pravin Shelar; +Cc: dev@openvswitch.org, Ravi K, netdev, Isaku Yamahata
In-Reply-To: <CALnjE+oY5P5kwyuWNBde3+EbQq8kMqCTSz+KrH=bwOmLE9SSPQ@mail.gmail.com>
On Thu, Sep 19, 2013 at 06:31:14PM -0700, Pravin Shelar wrote:
> On Thu, Sep 19, 2013 at 1:45 PM, Simon Horman <horms@verge.net.au> wrote:
> > On Wed, Sep 18, 2013 at 05:07:59PM -0500, Simon Horman wrote:
> >> On Tue, Sep 17, 2013 at 11:38:18AM -0700, Pravin Shelar wrote:
> >> > On Mon, Sep 9, 2013 at 12:20 AM, Simon Horman <horms@verge.net.au> wrote:
> >> > > Allow datapath to recognize and extract MPLS labels into flow keys
> >> > > and execute actions which push, pop, and set labels on packets.
> >> > >
> >> > > Based heavily on work by Leo Alterman, Ravi K, Isaku Yamahata and Joe Stringer.
> >> > >
> >> > > Cc: Ravi K <rkerur@gmail.com>
> >> > > Cc: Leo Alterman <lalterman@nicira.com>
> >> > > Cc: Isaku Yamahata <yamahata@valinux.co.jp>
> >> > > Cc: Joe Stringer <joe@wand.net.nz>
> >> > > Signed-off-by: Simon Horman <horms@verge.net.au>
> >> > >
> >> > > ---
> >> > ....
> >> > > diff --git a/datapath/datapath.h b/datapath/datapath.h
> >> > > index 5d50dd4..babae3b 100644
> >> > > --- a/datapath/datapath.h
> >> > > +++ b/datapath/datapath.h
> >> > > @@ -36,6 +36,10 @@
> >> > >
> >> > > #define SAMPLE_ACTION_DEPTH 3
> >> > >
> >> > > +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)
> >> > > +#define HAVE_INNER_PROTOCOL
> >> > > +#endif
> >> > > +
> >> > > /**
> >> > > * struct dp_stats_percpu - per-cpu packet processing statistics for a given
> >> > > * datapath.
> >> > > @@ -93,11 +97,16 @@ struct datapath {
> >> > > * @pkt_key: The flow information extracted from the packet. Must be nonnull.
> >> > > * @tun_key: Key for the tunnel that encapsulated this packet. NULL if the
> >> > > * packet is not being tunneled.
> >> > > + * @inner_protocol: Provides a substitute for the skb->inner_protocol field on
> >> > > + * kernels before 3.11.
> >> > > */
> >> > > struct ovs_skb_cb {
> >> > > struct sw_flow *flow;
> >> > > struct sw_flow_key *pkt_key;
> >> > > struct ovs_key_ipv4_tunnel *tun_key;
> >> > > +#ifndef HAVE_INNER_PROTOCOL
> >> > > + __be16 inner_protocol;
> >> > > +#endif
> >> > > };
> >> > > #define OVS_CB(skb) ((struct ovs_skb_cb *)(skb)->cb)
> >> > >
> >> > Can you move this to compat struct ovs_gso_cb {}
> >>
> >> I think that you are correct and inner_protocol needs
> >> to be in struct ovs_gso_cb so that it can
> >> be accessed via skb_network_protocol() from
> >> rpl___skb_gso_segment().
> >>
> >> However I think it may also need to be present in struct ovs_cb
> >> so that it can be set correctly.
> >>
> >> Currently it is set unconditionally
> >> in ovs_execute_actions() and Jesse has suggested setting
> >> it conditionally in pop_mpls() (which is called by do_execute_actions()).
> >> But regardless it seems to me that the field would need to be available
> >> in struct ovs_cb.
> >
> > Having reviewed the code once more I now notice that struct ovs_gso_cb
> > contains struct ovs_skb_cb dp_cb. Whereas my previous assumption was
> > that they were mutually exclusive.
> >
> > With this in mind I think it should be safe to use ovs_gso_cb from
> > ovs_execute_actions() or do_execute_actions() but I would value
> > your opinion on that.
> >
> > Conversely, if inner_protocol was left in struct ovs_skb_cb there should
> > be no problem with accessing it from GSO code as the code currently does.
> > So I am not sure that I see the value of moving it but I am happy to do
> > so if you think it is safe and it is your preferred option.
>
> right, access is not issue.
> Value is the code in datapath.c, with compatibility, remains closer to
> upstream ovs module. We have always tried to keep it that way.
Thanks, I understand.
I have moved inner_protocol as you suggest.
^ permalink raw reply
* Re: [PATCH v2.39 7/7] datapath: Add basic MPLS support to kernel
From: Simon Horman @ 2013-09-22 5:34 UTC (permalink / raw)
To: Jesse Gross
Cc: Ben Pfaff, Pravin Shelar, dev@openvswitch.org, netdev, Ravi K,
Isaku Yamahata, Joe Stringer
In-Reply-To: <CAEP_g=_Eds_XvPLUOhAAMZbxkzmBJEtSR9vVG2kkuRLehrfbDg@mail.gmail.com>
On Thu, Sep 19, 2013 at 12:21:33PM -0500, Jesse Gross wrote:
> On Thu, Sep 19, 2013 at 10:57 AM, Simon Horman <horms@verge.net.au> wrote:
> > On Mon, Sep 16, 2013 at 03:38:21PM -0500, Jesse Gross wrote:
> >> On Mon, Sep 9, 2013 at 12:20 AM, Simon Horman <horms@verge.net.au> wrote:
> >> > @@ -616,6 +736,13 @@ int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb)
> >> > goto out_loop;
> >> > }
> >> >
> >> > + /* Needed to initialise inner protocol on kernels older
> >> > + * than v3.11 where skb->inner_protocol is not present
> >> > + * and compatibility code uses the OVS_CB(skb) to store
> >> > + * the inner protocol.
> >> > + */
> >> > + ovs_skb_set_inner_protocol(skb, skb->protocol);
> >>
> >> The comment makes it sound like this code should just be deleted when
> >> upstreaming. However, I believe that we still need to initialize this
> >> field, right? Is this the best place do it or should it be conditional
> >> on adding a first MPLS header? (i.e. what happens if inner_protocol is
> >> already set and the packet simply passes through OVS?)
> >
> > I believe there are several problems here.
> >
> > The first one, which my comment was written around is that I think that if
> > inner_protocol is a field of struct sk_buff then we can rely on it already
> > being initialised. However, if we are using compatibility code, where
> > inner_protcol is called in the callback field of struct sk_buff then I
> > think that OVS needs to initialise it.
>
> I'm not sure that it's true that inner_protocol is already initialized
> - I grepped the tree and the only assignment that I found is in
> skbuff.c in __copy_skb_header().
My assumption was that it would be initialised to zero,
primarily due to the behaviour of __alloc_skb_head().
Perhaps the core code should be fixed to make my assumption true?
> > A second problem is one that you raise which I had not considered
> > which is how to handle things if inner_protocol is already set.
> >
> > I believe this should only occur in the case where inner_protocol
> > is a field of struct sk_buff and I think it would be most convenient
> > to set it conditionally in ovs_skb_reset_inner_protocol().
> > I think that if it is not set it should be zero but it should be
> > safe to check for values less than ETH_P_802_3_MIN.
>
> It's probably OK to check for values less than ETH_P_802_3_MIN but I'm
> not sure that it's the most correct thing to do since skb->protocol
> could contain these values (such as ETH_P_802_2). It's unlikely that
> they will be GSO packets but it seems better to use the more strict
> check against zero.
Sure, a strict check against zero is fine my me.
> One other consideration in the OVS case - with recirculation we may
> hit this code multiple times and the difference in behavior could be
> surprising. However, on the other hand, we need to be careful because
> skb->cb is not guaranteed to be initialized to zero.
Thanks, that is also not something that I had considered.
I'm not sure, but I think that we can rely on skb->cb
not being clobbered between rounds of recirculation.
Or at the very least I think we could save and restore it
as necessary.
So I think if we could be careful to make sure that inner_protocol
is in a sane state the first time we see the skb but not
each time it is recirculated then I think things should work out.
In my current implementation of recirculation the datapath
side is driven ovs_dp_process_received_packet(). So by my reasoning
above I think it would make sense to reset the inner_protocol there
and in ovs_packet_cmd_execute() rather than in ovs_execute_actions()
which each of those functions call.
^ permalink raw reply
* Re: [PATCH v2.39 7/7] datapath: Add basic MPLS support to kernel
From: Simon Horman @ 2013-09-22 5:38 UTC (permalink / raw)
To: Jesse Gross
Cc: Pravin Shelar, dev@openvswitch.org, netdev, Ravi K,
Isaku Yamahata, Joe Stringer
In-Reply-To: <CAEP_g=8+osWcHjj6pkGkid6djK9=CDf4U4qC97bY=GP0j=K3iw@mail.gmail.com>
On Thu, Sep 19, 2013 at 12:31:51PM -0500, Jesse Gross wrote:
> On Wed, Sep 18, 2013 at 5:07 PM, Simon Horman <horms@verge.net.au> wrote:
> > On Tue, Sep 17, 2013 at 11:38:18AM -0700, Pravin Shelar wrote:
> >> On Mon, Sep 9, 2013 at 12:20 AM, Simon Horman <horms@verge.net.au> wrote:
> >> > diff --git a/datapath/datapath.h b/datapath/datapath.h
> >> > index 5d50dd4..babae3b 100644
> >> > --- a/datapath/datapath.h
> >> > +++ b/datapath/datapath.h
> >> > @@ -36,6 +36,10 @@
> >> >
> >> > #define SAMPLE_ACTION_DEPTH 3
> >> >
> >> > +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)
> >> > +#define HAVE_INNER_PROTOCOL
> >> > +#endif
> >> > +
> >> > /**
> >> > * struct dp_stats_percpu - per-cpu packet processing statistics for a given
> >> > * datapath.
> >> > @@ -93,11 +97,16 @@ struct datapath {
> >> > * @pkt_key: The flow information extracted from the packet. Must be nonnull.
> >> > * @tun_key: Key for the tunnel that encapsulated this packet. NULL if the
> >> > * packet is not being tunneled.
> >> > + * @inner_protocol: Provides a substitute for the skb->inner_protocol field on
> >> > + * kernels before 3.11.
> >> > */
> >> > struct ovs_skb_cb {
> >> > struct sw_flow *flow;
> >> > struct sw_flow_key *pkt_key;
> >> > struct ovs_key_ipv4_tunnel *tun_key;
> >> > +#ifndef HAVE_INNER_PROTOCOL
> >> > + __be16 inner_protocol;
> >> > +#endif
> >> > };
> >> > #define OVS_CB(skb) ((struct ovs_skb_cb *)(skb)->cb)
> >> >
> >> Can you move this to compat struct ovs_gso_cb {}
> >
> > I think that you are correct and inner_protocol needs
> > to be in struct ovs_gso_cb so that it can
> > be accessed via skb_network_protocol() from
> > rpl___skb_gso_segment().
> >
> > However I think it may also need to be present in struct ovs_cb
> > so that it can be set correctly.
> >
> > Currently it is set unconditionally
> > in ovs_execute_actions() and Jesse has suggested setting
> > it conditionally in pop_mpls() (which is called by do_execute_actions()).
> > But regardless it seems to me that the field would need to be available
> > in struct ovs_cb.
>
> Since the helper functions are also in the compat code, I think they
> should have access to ovs_gso_cb.
Pravin also believes that is the case so I have moved inner_protocol
to struct ovs_gso_cb as he requested.
> >> I think we can simplify code by pushing vlan and then segmenting skb,
> >> the way we do it for MPLS.
> >
> > Are you thinking of something like the following which applies
> > prior to the MPLS code.
>
> This is basically what I was thinking about. We might actually be able
> to move all of this to compat code by having a replacement for
> dev_queue_xmit() similar to what we have for ip_local_out() in the
> tunnel code.
I would appreciate Pravin's opinion on this but it seems to me
that it should be possible.
The following applies on top of my previous proposed change
in this thread - simplification of segmentation - and before
the MPLS patch-set. Is this along the lines of what you were
thinking of?
From: Simon Horman <horms@verge.net.au>
datapath: Move segmentation compatibility code into a compatibility function
*** Do not apply: for informational purposes only
Move segmentation compatibility code out of netdev_send and into
rpl_dev_queue_xmit(), a compatibility function used in place
of dev_queue_xmit() as necessary.
As suggested by Jesse Gross.
Some minor though verbose implementation notes:
* This rpl_dev_queue_xmit() endeavours to return a valid error code or
zero on success as per dev_queue_xmit(). The exception is that when
dev_queue_xmit() is called in a loop only the status of the last call is
taken into account, thus ignoring any errors returned by previous calls.
This is derived from the previous calls to dev_queue_xmit() in a loop
where netdev_send() ignores the return value of dev_queue_xmit()
entirely.
* netdev_send() continues to ignore the value of dev_queue_xmit().
So the discussion of the return value of rpl_dev_queue_xmit()
above is has no bearing on run-time behaviour.
* The return value of netdev_send() may differ from the previous
implementation in the case where segmentation is performed before
calling the real dev_queue_xmit(). This is because previously in
this case netdev_send() would return the combined length of the
skbs resulting from segmentation. Whereas the current code
always returns the length of the original skb.
Compile tested only.
Signed-off-by: Simon Horman <horms@verge.net.au>
---
datapath/linux/compat/gso.c | 80 +++++++++++++++++++++++++++++++++++++++++++++
datapath/linux/compat/gso.h | 5 +++
datapath/vport-netdev.c | 78 ++-----------------------------------------
3 files changed, 87 insertions(+), 76 deletions(-)
diff --git a/datapath/linux/compat/gso.c b/datapath/linux/compat/gso.c
index 30332a2..d7e92fb 100644
--- a/datapath/linux/compat/gso.c
+++ b/datapath/linux/compat/gso.c
@@ -36,6 +36,86 @@
#include "gso.h"
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) && \
+ !defined(HAVE_VLAN_BUG_WORKAROUND)
+#include <linux/module.h>
+
+static int vlan_tso __read_mostly;
+module_param(vlan_tso, int, 0644);
+MODULE_PARM_DESC(vlan_tso, "Enable TSO for VLAN packets");
+#else
+#define vlan_tso true
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
+static bool dev_supports_vlan_tx(struct net_device *dev)
+{
+#if defined(HAVE_VLAN_BUG_WORKAROUND)
+ return dev->features & NETIF_F_HW_VLAN_TX;
+#else
+ /* Assume that the driver is buggy. */
+ return false;
+#endif
+}
+
+int rpl_dev_queue_xmit(struct sk_buff *skb)
+{
+#undef dev_queue_xmit
+ int err = -ENOMEM;
+
+ if (vlan_tx_tag_present(skb) && !dev_supports_vlan_tx(skb->dev)) {
+ int features;
+
+ features = netif_skb_features(skb);
+
+ if (!vlan_tso)
+ features &= ~(NETIF_F_TSO | NETIF_F_TSO6 |
+ NETIF_F_UFO | NETIF_F_FSO);
+
+ skb = __vlan_put_tag(skb, skb->vlan_proto, vlan_tx_tag_get(skb));
+ if (unlikely(!skb))
+ return err;
+ vlan_set_tci(skb, 0);
+
+ if (netif_needs_gso(skb, features)) {
+ struct sk_buff *nskb;
+
+ nskb = skb_gso_segment(skb, features);
+ if (!nskb) {
+ if (unlikely(skb_cloned(skb) &&
+ pskb_expand_head(skb, 0, 0, GFP_ATOMIC)))
+ goto drop;
+
+ skb_shinfo(skb)->gso_type &= ~SKB_GSO_DODGY;
+ goto xmit;
+ }
+
+ if (IS_ERR(nskb)) {
+ err = PTR_ERR(nskb);
+ goto drop;
+ }
+ consume_skb(skb);
+ skb = nskb;
+
+ do {
+ nskb = skb->next;
+ skb->next = NULL;
+ err = dev_queue_xmit(skb);
+ skb = nskb;
+ } while (skb);
+
+ return err;
+ }
+ }
+xmit:
+ return dev_queue_xmit(skb);
+
+drop:
+ kfree_skb(skb);
+ return err;
+}
+#endif /* kernel version < 3.6.37 */
+
static __be16 __skb_network_protocol(struct sk_buff *skb)
{
__be16 type = skb->protocol;
diff --git a/datapath/linux/compat/gso.h b/datapath/linux/compat/gso.h
index 44fd213..af1aaed 100644
--- a/datapath/linux/compat/gso.h
+++ b/datapath/linux/compat/gso.h
@@ -69,4 +69,9 @@ static inline void skb_reset_inner_headers(struct sk_buff *skb)
#define ip_local_out rpl_ip_local_out
int ip_local_out(struct sk_buff *skb);
+
+#if 1 // LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
+#define dev_queue_xmit rpl_dev_queue_xmit
+#endif
+
#endif
diff --git a/datapath/vport-netdev.c b/datapath/vport-netdev.c
index 31680fd..4d934b5 100644
--- a/datapath/vport-netdev.c
+++ b/datapath/vport-netdev.c
@@ -34,17 +34,6 @@
#include "vport-internal_dev.h"
#include "vport-netdev.h"
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) && \
- !defined(HAVE_VLAN_BUG_WORKAROUND)
-#include <linux/module.h>
-
-static int vlan_tso __read_mostly;
-module_param(vlan_tso, int, 0644);
-MODULE_PARM_DESC(vlan_tso, "Enable TSO for VLAN packets");
-#else
-#define vlan_tso true
-#endif
-
static void netdev_port_receive(struct vport *vport, struct sk_buff *skb);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)
@@ -259,19 +248,6 @@ static unsigned int packet_length(const struct sk_buff *skb)
return length;
}
-static bool dev_supports_vlan_tx(struct net_device *dev)
-{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)
- /* Software fallback means every device supports vlan_tci on TX. */
- return true;
-#elif defined(HAVE_VLAN_BUG_WORKAROUND)
- return dev->features & NETIF_F_HW_VLAN_TX;
-#else
- /* Assume that the driver is buggy. */
- return false;
-#endif
-}
-
static int netdev_send(struct vport *vport, struct sk_buff *skb)
{
struct netdev_vport *netdev_vport = netdev_vport_priv(vport);
@@ -282,65 +258,15 @@ static int netdev_send(struct vport *vport, struct sk_buff *skb)
net_warn_ratelimited("%s: dropped over-mtu packet: %d > %d\n",
netdev_vport->dev->name,
packet_length(skb), mtu);
- goto drop;
+ kfree_skb(skb);
+ return 0;
}
skb->dev = netdev_vport->dev;
-
- if (vlan_tx_tag_present(skb) && !dev_supports_vlan_tx(skb->dev)) {
- int features;
-
- features = netif_skb_features(skb);
-
- if (!vlan_tso)
- features &= ~(NETIF_F_TSO | NETIF_F_TSO6 |
- NETIF_F_UFO | NETIF_F_FSO);
-
- skb = __vlan_put_tag(skb, skb->vlan_proto, vlan_tx_tag_get(skb));
- if (unlikely(!skb))
- return 0;
- vlan_set_tci(skb, 0);
-
- if (netif_needs_gso(skb, features)) {
- struct sk_buff *nskb;
-
- nskb = skb_gso_segment(skb, features);
- if (!nskb) {
- if (unlikely(skb_cloned(skb) &&
- pskb_expand_head(skb, 0, 0, GFP_ATOMIC)))
- goto drop;
-
- skb_shinfo(skb)->gso_type &= ~SKB_GSO_DODGY;
- goto xmit;
- }
-
- if (IS_ERR(nskb))
- goto drop;
- consume_skb(skb);
- skb = nskb;
-
- len = 0;
- do {
- nskb = skb->next;
- skb->next = NULL;
- len += skb->len;
- dev_queue_xmit(skb);
- skb = nskb;
- } while (skb);
-
- return len;
- }
- }
-
-xmit:
len = skb->len;
dev_queue_xmit(skb);
return len;
-
-drop:
- kfree_skb(skb);
- return 0;
}
/* Returns null if this device is not attached to a datapath. */
--
1.8.4
^ permalink raw reply related
* [PATCH net 0/5] bnx2x: Link fixes
From: Yaniv Rosner @ 2013-09-22 11:59 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Eilon Greenstein, Yaniv Rosner
Hi Dave,
The following patch series contain few link fixes.
Please consider applying it to net.
Thanks,
Yaniv
^ permalink raw reply
* [PATCH net 3/5] bnx2x: 57840 non-external loopback test fail on 1G
From: Yaniv Rosner @ 2013-09-22 11:59 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Eilon Greenstein, Yaniv Rosner
In-Reply-To: <1379851166-11959-1-git-send-email-yanivr@broadcom.com>
when 1G-optic module was plugged in, internal loopback test failed because the
driver used to check the optic module (with no need), and for 1G optic module,
the link speed was forced down to 1G, while the XMAC (10G MAC) was enabled.
This patch avoid accessing optic module in case internal loopback was selected,
and update the link speed in case 1G optic module was detected during init
stage.
Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index 84798bb..5c6d46c 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -4523,10 +4523,14 @@ static void bnx2x_warpcore_config_init(struct bnx2x_phy *phy,
* enabled transmitter to avoid current leakage in case
* no module is connected
*/
- if (bnx2x_is_sfp_module_plugged(phy, params))
- bnx2x_sfp_module_detection(phy, params);
- else
- bnx2x_sfp_e3_set_transmitter(params, phy, 1);
+ if ((params->loopback_mode == LOOPBACK_NONE) ||
+ (params->loopback_mode == LOOPBACK_EXT)) {
+ if (bnx2x_is_sfp_module_plugged(phy, params))
+ bnx2x_sfp_module_detection(phy, params);
+ else
+ bnx2x_sfp_e3_set_transmitter(params,
+ phy, 1);
+ }
bnx2x_warpcore_config_sfi(phy, params);
break;
@@ -6528,6 +6532,11 @@ static int bnx2x_link_initialize(struct link_params *params,
params->phy[INT_PHY].config_init(phy, params, vars);
}
+ /* Re-read this value in case it was changed inside config_init due to
+ * limitations of optic module
+ */
+ vars->line_speed = params->phy[INT_PHY].req_line_speed;
+
/* Init external phy*/
if (non_ext_phy) {
if (params->phy[INT_PHY].supported &
--
1.7.1
^ permalink raw reply related
* [PATCH net 4/5] bnx2x: Specific Active-DAC is not detected on 57810
From: Yaniv Rosner @ 2013-09-22 11:59 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Eilon Greenstein, Yaniv Rosner
In-Reply-To: <1379851166-11959-1-git-send-email-yanivr@broadcom.com>
Fix Warpcore mode setting when active DAC (Direct Attached Cable) is detected.
Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index 5c6d46c..dc67566 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -175,6 +175,7 @@ typedef int (*read_sfp_module_eeprom_func_p)(struct bnx2x_phy *phy,
#define EDC_MODE_LINEAR 0x0022
#define EDC_MODE_LIMITING 0x0044
#define EDC_MODE_PASSIVE_DAC 0x0055
+#define EDC_MODE_ACTIVE_DAC 0x0066
/* ETS defines*/
#define DCBX_INVALID_COS (0xFF)
@@ -8110,7 +8111,10 @@ static int bnx2x_get_edc_mode(struct bnx2x_phy *phy,
if (copper_module_type &
SFP_EEPROM_FC_TX_TECH_BITMASK_COPPER_ACTIVE) {
DP(NETIF_MSG_LINK, "Active Copper cable detected\n");
- check_limiting_mode = 1;
+ if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT)
+ *edc_mode = EDC_MODE_ACTIVE_DAC;
+ else
+ check_limiting_mode = 1;
} else if (copper_module_type &
SFP_EEPROM_FC_TX_TECH_BITMASK_COPPER_PASSIVE) {
DP(NETIF_MSG_LINK,
@@ -8585,6 +8589,7 @@ static void bnx2x_warpcore_set_limiting_mode(struct link_params *params,
mode = MDIO_WC_REG_UC_INFO_B1_FIRMWARE_MODE_DEFAULT;
break;
case EDC_MODE_PASSIVE_DAC:
+ case EDC_MODE_ACTIVE_DAC:
mode = MDIO_WC_REG_UC_INFO_B1_FIRMWARE_MODE_SFP_DAC;
break;
default:
--
1.7.1
^ permalink raw reply related
* [PATCH net 1/5] bnx2x: Generalize KR work-around
From: Yaniv Rosner @ 2013-09-22 11:59 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Eilon Greenstein, Yaniv Rosner
In-Reply-To: <1379851166-11959-1-git-send-email-yanivr@broadcom.com>
Previously, in case of KR link down, the driver would reset the PHY and restart
auto negotiation only when old Warpcore microcode was used (below D108).
This patch comes to generalize this by keep trying to restart KR link,
regardless of Warpcore microcode, since it was found that it solves another link
issue which source is a link-partner. As part of this change, the signal
detect is no longer a condition to apply the work-around to cover this new case.
Like before, as long as the link is down, AN will be restarted every 2 seconds.
Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | 32 +++++----------------
1 files changed, 8 insertions(+), 24 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index d60a2ea..12ef8e1 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -3715,7 +3715,6 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy,
struct link_params *params,
struct link_vars *vars) {
u16 lane, i, cl72_ctrl, an_adv = 0;
- u16 ucode_ver;
struct bnx2x *bp = params->bp;
static struct bnx2x_reg_set reg_set[] = {
{MDIO_WC_DEVAD, MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X2, 0x7},
@@ -3806,15 +3805,7 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy,
/* Advertise pause */
bnx2x_ext_phy_set_pause(params, phy, vars);
- /* Set KR Autoneg Work-Around flag for Warpcore version older than D108
- */
- bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
- MDIO_WC_REG_UC_INFO_B1_VERSION, &ucode_ver);
- if (ucode_ver < 0xd108) {
- DP(NETIF_MSG_LINK, "Enable AN KR work-around. WC ver:0x%x\n",
- ucode_ver);
- vars->rx_tx_asic_rst = MAX_KR_LINK_RETRY;
- }
+ vars->rx_tx_asic_rst = MAX_KR_LINK_RETRY;
bnx2x_cl45_read_or_write(bp, phy, MDIO_WC_DEVAD,
MDIO_WC_REG_DIGITAL5_MISC7, 0x100);
@@ -4347,20 +4338,14 @@ static void bnx2x_warpcore_config_runtime(struct bnx2x_phy *phy,
struct bnx2x *bp = params->bp;
u32 serdes_net_if;
u16 gp_status1 = 0, lnkup = 0, lnkup_kr = 0;
- u16 lane = bnx2x_get_warpcore_lane(phy, params);
vars->turn_to_run_wc_rt = vars->turn_to_run_wc_rt ? 0 : 1;
if (!vars->turn_to_run_wc_rt)
return;
- /* Return if there is no link partner */
- if (!(bnx2x_warpcore_get_sigdet(phy, params))) {
- DP(NETIF_MSG_LINK, "bnx2x_warpcore_get_sigdet false\n");
- return;
- }
-
if (vars->rx_tx_asic_rst) {
+ u16 lane = bnx2x_get_warpcore_lane(phy, params);
serdes_net_if = (REG_RD(bp, params->shmem_base +
offsetof(struct shmem_region, dev_info.
port_hw_config[params->port].default_cfg)) &
@@ -4375,14 +4360,8 @@ static void bnx2x_warpcore_config_runtime(struct bnx2x_phy *phy,
/*10G KR*/
lnkup_kr = (gp_status1 >> (12+lane)) & 0x1;
- DP(NETIF_MSG_LINK,
- "gp_status1 0x%x\n", gp_status1);
-
if (lnkup_kr || lnkup) {
- vars->rx_tx_asic_rst = 0;
- DP(NETIF_MSG_LINK,
- "link up, rx_tx_asic_rst 0x%x\n",
- vars->rx_tx_asic_rst);
+ vars->rx_tx_asic_rst = 0;
} else {
/* Reset the lane to see if link comes up.*/
bnx2x_warpcore_reset_lane(bp, phy, 1);
@@ -5757,6 +5736,11 @@ static int bnx2x_warpcore_read_status(struct bnx2x_phy *phy,
rc = bnx2x_get_link_speed_duplex(phy, params, vars, link_up, gp_speed,
duplex);
+ /* In case of KR link down, start up the recovering procedure */
+ if ((!link_up) && (phy->media_type == ETH_PHY_KR) &&
+ (!(phy->flags & FLAGS_WC_DUAL_MODE)))
+ vars->rx_tx_asic_rst = MAX_KR_LINK_RETRY;
+
DP(NETIF_MSG_LINK, "duplex %x flow_ctrl 0x%x link_status 0x%x\n",
vars->duplex, vars->flow_ctrl, vars->link_status);
return rc;
--
1.7.1
^ permalink raw reply related
* [PATCH net 2/5] bnx2x: KR2 disablement fix
From: Yaniv Rosner @ 2013-09-22 11:59 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Eilon Greenstein, Yaniv Rosner
In-Reply-To: <1379851166-11959-1-git-send-email-yanivr@broadcom.com>
Relocate bnx2x_disable_kr2 function, and use it to disable KR2 in case it is not
configured in order to clear it's configuration, otherwise the link may come up
at 20G instead of the requested 10G-KR. In addition, restart AN after
disabling KR2 as part of the KR2 work-around.
Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | 76 +++++++++++-----------
1 files changed, 39 insertions(+), 37 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index 12ef8e1..84798bb 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -3684,6 +3684,41 @@ static void bnx2x_warpcore_enable_AN_KR2(struct bnx2x_phy *phy,
bnx2x_update_link_attr(params, vars->link_attr_sync);
}
+static void bnx2x_disable_kr2(struct link_params *params,
+ struct link_vars *vars,
+ struct bnx2x_phy *phy)
+{
+ struct bnx2x *bp = params->bp;
+ int i;
+ static struct bnx2x_reg_set reg_set[] = {
+ /* Step 1 - Program the TX/RX alignment markers */
+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL5, 0x7690},
+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL7, 0xe647},
+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL6, 0xc4f0},
+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL9, 0x7690},
+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_RX_CTRL11, 0xe647},
+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_RX_CTRL10, 0xc4f0},
+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_USERB0_CTRL, 0x000c},
+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_BAM_CTRL1, 0x6000},
+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_BAM_CTRL3, 0x0000},
+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_BAM_CODE_FIELD, 0x0002},
+ {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_OUI1, 0x0000},
+ {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_OUI2, 0x0af7},
+ {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_OUI3, 0x0af7},
+ {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_LD_BAM_CODE, 0x0002},
+ {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_LD_UD_CODE, 0x0000}
+ };
+ DP(NETIF_MSG_LINK, "Disabling 20G-KR2\n");
+
+ for (i = 0; i < ARRAY_SIZE(reg_set); i++)
+ bnx2x_cl45_write(bp, phy, reg_set[i].devad, reg_set[i].reg,
+ reg_set[i].val);
+ vars->link_attr_sync &= ~LINK_ATTR_SYNC_KR2_ENABLE;
+ bnx2x_update_link_attr(params, vars->link_attr_sync);
+
+ vars->check_kr2_recovery_cnt = CHECK_KR2_RECOVERY_CNT;
+}
+
static void bnx2x_warpcore_set_lpi_passthrough(struct bnx2x_phy *phy,
struct link_params *params)
{
@@ -3829,6 +3864,8 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy,
bnx2x_set_aer_mmd(params, phy);
bnx2x_warpcore_enable_AN_KR2(phy, params, vars);
+ } else {
+ bnx2x_disable_kr2(params, vars, phy);
}
/* Enable Autoneg: only on the main lane */
@@ -13416,43 +13453,6 @@ static void bnx2x_sfp_tx_fault_detection(struct bnx2x_phy *phy,
}
}
}
-static void bnx2x_disable_kr2(struct link_params *params,
- struct link_vars *vars,
- struct bnx2x_phy *phy)
-{
- struct bnx2x *bp = params->bp;
- int i;
- static struct bnx2x_reg_set reg_set[] = {
- /* Step 1 - Program the TX/RX alignment markers */
- {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL5, 0x7690},
- {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL7, 0xe647},
- {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL6, 0xc4f0},
- {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL9, 0x7690},
- {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_RX_CTRL11, 0xe647},
- {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_RX_CTRL10, 0xc4f0},
- {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_USERB0_CTRL, 0x000c},
- {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_BAM_CTRL1, 0x6000},
- {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_BAM_CTRL3, 0x0000},
- {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_BAM_CODE_FIELD, 0x0002},
- {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_OUI1, 0x0000},
- {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_OUI2, 0x0af7},
- {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_OUI3, 0x0af7},
- {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_LD_BAM_CODE, 0x0002},
- {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_LD_UD_CODE, 0x0000}
- };
- DP(NETIF_MSG_LINK, "Disabling 20G-KR2\n");
-
- for (i = 0; i < ARRAY_SIZE(reg_set); i++)
- bnx2x_cl45_write(bp, phy, reg_set[i].devad, reg_set[i].reg,
- reg_set[i].val);
- vars->link_attr_sync &= ~LINK_ATTR_SYNC_KR2_ENABLE;
- bnx2x_update_link_attr(params, vars->link_attr_sync);
-
- vars->check_kr2_recovery_cnt = CHECK_KR2_RECOVERY_CNT;
- /* Restart AN on leading lane */
- bnx2x_warpcore_restart_AN_KR(phy, params);
-}
-
static void bnx2x_kr2_recovery(struct link_params *params,
struct link_vars *vars,
struct bnx2x_phy *phy)
@@ -13530,6 +13530,8 @@ static void bnx2x_check_kr2_wa(struct link_params *params,
/* Disable KR2 on both lanes */
DP(NETIF_MSG_LINK, "BP=0x%x, NP=0x%x\n", base_page, next_page);
bnx2x_disable_kr2(params, vars, phy);
+ /* Restart AN on leading lane */
+ bnx2x_warpcore_restart_AN_KR(phy, params);
return;
}
}
--
1.7.1
^ 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