* Re: [PATCH 2/2] ipv4 igmp: use del_timer_sync instead of del_timer in ip_mc_down
From: Salam Noureddine @ 2013-09-27 23:28 UTC (permalink / raw)
To: Alexey Kuznetsov
Cc: Stephen Hemminger, David S. Miller, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, netdev
In-Reply-To: <20130927231532.GA23750@ms2.inr.ac.ru>
Thanks for the explanation. Currenlty, __in_dev_put is both used in
timer handler function and in ip_mc_down where del_timer is invoked. I
guess we need to change the timer handler so it uses in_dev_put to do
proper cleanup in cases where it runs past the call to ip_mc_down and
has the last reference.
On Fri, Sep 27, 2013 at 4:15 PM, Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> wrote:
> On Fri, Sep 27, 2013 at 04:04:00PM -0700, Salam Noureddine wrote:
>> I don't quite understand the reason
>> for having __in_dev_put decrement the refcnt without destroying the
>> in_device in case it reaches 0. If the timer handler assumes it cannot
>> be the last one to hold a reference then that would mean it doesn't
>> need the reference in the first place.
>
> I would like to explain this, because this can result in a big mistake.
>
> Timer takes reference, when it _can_ be the last sometimes.
>
> When we do del_timer() and know for sure that someone holds refcnt, we can just
> decrese it. In this cae it is obvious: we sit in context whcih deals with in_dev,
> so that reference from timer acannot be the last: caller of the function holds refcnt.
>
> But in another places timer _expires_ and that last reference is dropped by in_dev_put().
>
> Alexey
^ permalink raw reply
* Re: [PATCH net-next] qdisc: meta return ENOMEM on alloc failure
From: Thomas Graf @ 2013-09-27 23:31 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David Miller, netdev
In-Reply-To: <20130926174011.22632779@nehalam.linuxnetplumber.net>
On 09/26/13 at 05:40pm, Stephen Hemminger wrote:
> Rather than returning earlier value (EINVAL), return ENOMEM if
> kzalloc fails. Found while reviewing to find another EINVAL condition.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Thomas Graf <tgraf@suug.ch>
^ permalink raw reply
* Re: [PATCH v1] USBNET: fix handling padding packet
From: Ming Lei @ 2013-09-27 23:51 UTC (permalink / raw)
To: David S. Miller, Greg Kroah-Hartman
Cc: Oliver Neukum, Network Development, linux-usb, Ming Lei
In-Reply-To: <1379941175-10500-1-git-send-email-ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
On Mon, Sep 23, 2013 at 8:59 PM, Ming Lei <ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org> wrote:
> Commit 638c5115a7949(USBNET: support DMA SG) introduces DMA SG
> if the usb host controller is capable of building packet from
> discontinuous buffers, but missed handling padding packet when
> building DMA SG.
>
> This patch attachs the pre-allocated padding packet at the
> end of the sg list, so padding packet can be sent to device
> if drivers require that.
>
> Reported-by: David Laight <David.Laight-JxhZ9S5GRejQT0dZR+AlfA@public.gmane.org>
> Acked-by: Oliver Neukum <oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
> Signed-off-by: Ming Lei <ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
> ---
> v1:
> - fix bug in case of dev->can_dma_sg and !urb->num_sgs
David, could you queue this patch in your tree? And it should fix
regression caused by commit 638c5115a7949(USBNET: support
DMA SG), since I found that without the padding the device can't
send out packets successfully if their length is dividable by max
packet size, and the problem can be observed with icmp sending:
$ping -s 974 another_machine #from host with ax99179_178a attached
Thanks,
--
Ming Lei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH 2/2] ipv4 igmp: use del_timer_sync instead of del_timer in ip_mc_down
From: Alexey Kuznetsov @ 2013-09-27 23:15 UTC (permalink / raw)
To: Salam Noureddine
Cc: Stephen Hemminger, David S. Miller, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, netdev
In-Reply-To: <CAO7SqHA5pBs7Tmop1ukS_AEXO8K9Np7odo20QdTYHBg2qoV49Q@mail.gmail.com>
On Fri, Sep 27, 2013 at 04:04:00PM -0700, Salam Noureddine wrote:
> I don't quite understand the reason
> for having __in_dev_put decrement the refcnt without destroying the
> in_device in case it reaches 0. If the timer handler assumes it cannot
> be the last one to hold a reference then that would mean it doesn't
> need the reference in the first place.
I would like to explain this, because this can result in a big mistake.
Timer takes reference, when it _can_ be the last sometimes.
When we do del_timer() and know for sure that someone holds refcnt, we can just
decrese it. In this cae it is obvious: we sit in context whcih deals with in_dev,
so that reference from timer acannot be the last: caller of the function holds refcnt.
But in another places timer _expires_ and that last reference is dropped by in_dev_put().
Alexey
^ permalink raw reply
* [PATCH net-next 2/2] ethernet: use likely() for common Ethernet encap
From: Stephen Hemminger @ 2013-09-28 0:21 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20130927171941.0dad4d2a@nehalam.linuxnetplumber.net>
Mark code path's likely/unlikely based on most common usage.
* Very few devices use dsa tags.
* Most traffic is Ethernet (not 802.2)
* No sane person uses trailer type or Novell encapsulation
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
--- a/net/ethernet/eth.c 2013-09-26 17:34:35.363115182 -0700
+++ b/net/ethernet/eth.c 2013-09-26 17:34:38.915070453 -0700
@@ -179,12 +179,13 @@ __be16 eth_type_trans(struct sk_buff *sk
* variants has been configured on the receiving interface,
* and if so, set skb->protocol without looking at the packet.
*/
- if (netdev_uses_dsa_tags(dev))
+ if (unlikely(netdev_uses_dsa_tags(dev)))
return htons(ETH_P_DSA);
- if (netdev_uses_trailer_tags(dev))
+
+ if (unlikely(netdev_uses_trailer_tags(dev)))
return htons(ETH_P_TRAILER);
- if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN)
+ if (likely(ntohs(eth->h_proto) >= ETH_P_802_3_MIN))
return eth->h_proto;
/*
@@ -193,7 +194,7 @@ __be16 eth_type_trans(struct sk_buff *sk
* layer. We look for FFFF which isn't a used 802.2 SSAP/DSAP. This
* won't work for fault tolerant netware but does for the rest.
*/
- if (skb->len >= 2 && *(unsigned short *)(skb->data) == 0xFFFF)
+ if (unlikely(skb->len >= 2 && *(unsigned short *)(skb->data) == 0xFFFF))
return htons(ETH_P_802_3);
/*
^ permalink raw reply
* [PATCH net-next 1/2] ethernet: cleanup eth_type_trans
From: Stephen Hemminger @ 2013-09-28 0:19 UTC (permalink / raw)
To: David Miller; +Cc: netdev
Remove old legacy comment and weird if condition.
The comment has outlived it's stay and is throwback to some
early net code (before my time). Maybe Dave remembers what it meant.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
--- a/net/ethernet/eth.c 2013-09-26 17:25:54.093639280 -0700
+++ b/net/ethernet/eth.c 2013-09-26 17:34:35.363115182 -0700
@@ -169,20 +169,9 @@ __be16 eth_type_trans(struct sk_buff *sk
else
skb->pkt_type = PACKET_MULTICAST;
}
-
- /*
- * This ALLMULTI check should be redundant by 1.4
- * so don't forget to remove it.
- *
- * Seems, you forgot to remove it. All silly devices
- * seems to set IFF_PROMISC.
- */
-
- else if (1 /*dev->flags&IFF_PROMISC */) {
- if (unlikely(!ether_addr_equal_64bits(eth->h_dest,
- dev->dev_addr)))
- skb->pkt_type = PACKET_OTHERHOST;
- }
+ else if (unlikely(!ether_addr_equal_64bits(eth->h_dest,
+ dev->dev_addr)))
+ skb->pkt_type = PACKET_OTHERHOST;
/*
* Some variants of DSA tagging don't have an ethertype field
^ permalink raw reply
* Re: [PATCH net-next] net: introduce SO_MAX_PACING_RATE
From: Eric Dumazet @ 2013-09-28 0:28 UTC (permalink / raw)
To: Steinar H. Gunderson; +Cc: David Miller, netdev, Michael Kerrisk
In-Reply-To: <20130927211604.GA929@imap.gmail.com>
On Fri, 2013-09-27 at 23:16 +0200, Steinar H. Gunderson wrote:
> On Mon, Sep 23, 2013 at 08:10:14AM -0700, Eric Dumazet wrote:
> > SO_MAX_PACING_RATE offers the application the ability to cap the
> > rate computed by transport layer. Value is in bytes per second.
>
> I tried this (the first version) on top of 3.12-rc2, but it doesn't actually
> appear to work.
>
> The setsockopt goes through:
>
> [pid 30501] setsockopt(11, SOL_SOCKET, 0x2f /* SO_??? */, [1920000], 4) = 0
>
> And the fq scheduler is active on the machine:
The socket option actually works, but FQ has a problem with non TSO
frames, because default quantum is 3028 (2 * 1514)
I am testing this patch :
diff --git a/net/sched/sch_fq.c b/net/sched/sch_fq.c
index 32ad015..f7e45b0 100644
--- a/net/sched/sch_fq.c
+++ b/net/sched/sch_fq.c
@@ -473,7 +473,8 @@ begin:
rate = min(rate, q->flow_max_rate);
if (rate) {
- u64 len = (u64)qdisc_pkt_len(skb) * NSEC_PER_SEC;
+ u32 plen = max(qdisc_pkt_len(skb), q->quantum);
+ u64 len = (u64)plen * NSEC_PER_SEC;
do_div(len, rate);
/* Since socket rate can change later,
^ permalink raw reply related
* Re: [PATCH] can: add Renesas R-Car CAN driver
From: Joe Perches @ 2013-09-28 0:40 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: netdev, wg, mkl, linux-can, linux-sh
In-Reply-To: <201309280211.39068.sergei.shtylyov@cogentembedded.com>
On Sat, 2013-09-28 at 02:11 +0400, Sergei Shtylyov wrote:
> Add support for the CAN controller found in Renesas R-Car SoCs.
trivia:
> +++ linux-can-next/drivers/net/can/rcar_can.c
[]
> +static void rcar_can_rx_pkt(struct rcar_can_priv *priv, int mbx)
> +{
> + struct net_device_stats *stats = &priv->ndev->stats;
> + struct can_frame *cf;
> + struct sk_buff *skb;
> + u32 data;
> + u8 dlc;
> +
> + skb = alloc_can_skb(priv->ndev, &cf);
> + if (!skb) {
> + stats->rx_dropped++;
> + if (printk_ratelimit())
> + netdev_err(priv->ndev,
> + "%s: alloc_can_skb() failed\n", __func__);
This logging message is unnecessary because it's
redundant to the generic OOM error in __alloc_skb.
It already gets a dump_stack();
^ permalink raw reply
* Re: [PATCH] can: add Renesas R-Car CAN driver
From: Stephen Hemminger @ 2013-09-28 0:45 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: netdev, wg, mkl, linux-can, linux-sh
In-Reply-To: <201309280211.39068.sergei.shtylyov@cogentembedded.com>
On Sat, 28 Sep 2013 02:11:38 +0400
Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> wrote:
> + stats->rx_bytes += cf->can_dlc;
> +}
> +
> +static irqreturn_t rcar_can_interrupt(int irq, void *dev_id)
> +{
> + struct net_device *ndev = (struct net_device *)dev_id;
> + struct rcar_can_priv *priv = netdev_priv(ndev);
> + struct net_device_stats *stats = &ndev->stats;
> + u8 isr;
> +
> + isr = rcar_can_readb(priv, RCAR_CAN_ISR);
> + if (isr & ISR_ERSF)
> + rcar_can_error(ndev);
IRQ handler should return IRQ_NONE if not for this device.
Most devices this is true if isr is 0.
Also should check for hot-plug case where device interrupt occurs
but see's all-ones on the bus.
^ permalink raw reply
* Re: [PATCH] can: add Renesas R-Car CAN driver
From: Sergei Shtylyov @ 2013-09-28 0:52 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, wg, mkl, linux-can, linux-sh
In-Reply-To: <20130927174518.2ee83214@nehalam.linuxnetplumber.net>
Hello.
On 09/28/2013 04:45 AM, Stephen Hemminger wrote:
>> + stats->rx_bytes += cf->can_dlc;
>> +}
>> +
>> +static irqreturn_t rcar_can_interrupt(int irq, void *dev_id)
>> +{
>> + struct net_device *ndev = (struct net_device *)dev_id;
>> + struct rcar_can_priv *priv = netdev_priv(ndev);
>> + struct net_device_stats *stats = &ndev->stats;
>> + u8 isr;
>> +
>> + isr = rcar_can_readb(priv, RCAR_CAN_ISR);
>> + if (isr & ISR_ERSF)
>> + rcar_can_error(ndev);
> IRQ handler should return IRQ_NONE if not for this device.
> Most devices this is true if isr is 0.
Hm, totally overlooked that... :-/
> Also should check for hot-plug case where device interrupt occurs
> but see's all-ones on the bus.
Hotplug is not possible with this SoC device.
WBR, Sergei
^ permalink raw reply
* [PATCH v1 net-next] net: pkt_sched: PIE AQM scheme
From: Vijay Subramanian @ 2013-09-28 1:56 UTC (permalink / raw)
To: netdev
Cc: davem, shemminger, eric.dumazet, Vijay Subramanian,
Mythili Prabhu, Dave Taht
From: Vijay Subramanian <vijaynsu@cisco.com>
Proportional Integral controller Enhanced (PIE) is a scheduler to address the
bufferbloat problem.
>From the IETF draft below:
" Bufferbloat is a phenomenon where excess buffers in the network cause high
latency and jitter. As more and more interactive applications (e.g. voice over
IP, real time video streaming and financial transactions) run in the Internet,
high latency and jitter degrade application performance. There is a pressing
need to design intelligent queue management schemes that can control latency
and jitter; and hence provide desirable quality of service to users.
We present here a lightweight design, PIE(Proportional Integral controller
Enhanced) that can effectively control the average queueing latency to a target
value. Simulation results, theoretical analysis and Linux testbed results have
shown that PIE can ensure low latency and achieve high link utilization under
various congestion situations. The design does not require per-packet
timestamp, so it incurs very small overhead and is simple enough to implement
in both hardware and software. "
Many thanks to Dave Taht for extensive feedback, reviews, testing and
suggestions. Thanks also to Stephen Hemminger for initial review and suggestion
to use psched and friends. Naeem Khademi and Dave Taht independently
contributed to ECN support.
For more information, please see technical paper about PIE in the IEEE
Conference on High Performance Switching and Routing 2013. A copy of the paper
can be found at ftp://ftpeng.cisco.com/pie/.
Please also refer to the IETF draft submission at
http://tools.ietf.org/html/draft-pan-tsvwg-pie-00
All relevant code, documents and test scripts and results can be found at
ftp://ftpeng.cisco.com/pie/.
For problems with the iproute2/tc or Linux kernel code, please contact Vijay
Subramanian (vijaynsu@cisco.com or subramanian.vijay@gmail.com) Mythili Prabhu
(mysuryan@cisco.com)
Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com>
Signed-off-by: Mythili Prabhu <mysuryan@cisco.com>
CC: Dave Taht <dave.taht@bufferbloat.net>
---
include/uapi/linux/pkt_sched.h | 26 ++
net/sched/Kconfig | 11 +
net/sched/Makefile | 1 +
net/sched/sch_pie.c | 623 ++++++++++++++++++++++++++++++++++++++++
4 files changed, 661 insertions(+)
create mode 100644 net/sched/sch_pie.c
diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
index f2624b5..2fb6e6d 100644
--- a/include/uapi/linux/pkt_sched.h
+++ b/include/uapi/linux/pkt_sched.h
@@ -787,4 +787,30 @@ struct tc_fq_qd_stats {
__u32 throttled_flows;
__u32 pad;
};
+
+/*PIE*/
+enum {
+ TCA_PIE_UNSPEC,
+ TCA_PIE_TARGET,
+ TCA_PIE_LIMIT,
+ TCA_PIE_TUPDATE,
+ TCA_PIE_ALPHA,
+ TCA_PIE_BETA,
+ TCA_PIE_ECN,
+ TCA_PIE_BYTEMODE,
+ __TCA_PIE_MAX
+};
+#define TCA_PIE_MAX (__TCA_PIE_MAX - 1)
+
+struct tc_pie_xstats {
+ __u32 prob; /* current probability */
+ __u32 delay; /* current delay in ms */
+ __u32 avg_dq_rate; /* current average dq_rate in bits/pie_time */
+ __u32 packets_in; /* total number of packets enqueued */
+ __u32 dropped; /* packets dropped due to pie_action */
+ __u32 overlimit; /* dropped due to lack of space in queue */
+ __u32 maxq; /* maximum queue size */
+ __u32 ecn_mark; /* packets marked with ecn*/
+};
+
#endif
diff --git a/net/sched/Kconfig b/net/sched/Kconfig
index c03a32a..7b32e58 100644
--- a/net/sched/Kconfig
+++ b/net/sched/Kconfig
@@ -286,6 +286,17 @@ config NET_SCH_FQ
If unsure, say N.
+config NET_SCH_PIE
+ tristate "Proportianal Enhanced Controller AQM (PIE)"
+ help
+ Say Y here if you want to use the Proportianal and Enhanced Controller AQM (PIE)
+ packet scheduling algorithm.
+
+ To compile this driver as a module, choose M here: the module
+ will be called sch_pie.
+
+ If unsure, say N.
+
config NET_SCH_INGRESS
tristate "Ingress Qdisc"
depends on NET_CLS_ACT
diff --git a/net/sched/Makefile b/net/sched/Makefile
index e5f9abe..5b4ece9 100644
--- a/net/sched/Makefile
+++ b/net/sched/Makefile
@@ -40,6 +40,7 @@ obj-$(CONFIG_NET_SCH_QFQ) += sch_qfq.o
obj-$(CONFIG_NET_SCH_CODEL) += sch_codel.o
obj-$(CONFIG_NET_SCH_FQ_CODEL) += sch_fq_codel.o
obj-$(CONFIG_NET_SCH_FQ) += sch_fq.o
+obj-$(CONFIG_NET_SCH_PIE) += sch_pie.o
obj-$(CONFIG_NET_CLS_U32) += cls_u32.o
obj-$(CONFIG_NET_CLS_ROUTE4) += cls_route.o
diff --git a/net/sched/sch_pie.c b/net/sched/sch_pie.c
new file mode 100644
index 0000000..cfcfde9
--- /dev/null
+++ b/net/sched/sch_pie.c
@@ -0,0 +1,623 @@
+/* Copyright (C) 2013 Cisco Systems, Inc, 2013.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
+ *
+ * Author: Vijay Subramanian <vijaynsu@cisco.com>
+ * Author: Mythili Prabhu <mysuryan@cisco.com>
+ *
+ * ECN support is added by Naeem Khademi <naeemk@ifi.uio.no>
+ * University of Oslo, Norway.
+ */
+
+#include <linux/module.h>
+#include <linux/slab.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/skbuff.h>
+#include <net/pkt_sched.h>
+#include <net/inet_ecn.h>
+
+#define PIE_DEFAULT_QUEUE_LIMIT 200 /* in packets */
+#define QUEUE_THRESHOLD (5000)
+#define DQCOUNT_INVALID -1
+#define THRESHOLD_PKT_SIZE 1500
+#define MAX_INT_VALUE 0xffffffff
+#define MAX_INT_VALUE_CAP (0xffffffff >> 8)
+
+typedef u32 pie_time_t;
+typedef s32 pie_tdiff_t;
+#define PIE_SHIFT 10
+#define MS2PIETIME(a) ((a * NSEC_PER_MSEC) >> PIE_SHIFT)
+#define PIE_TIME_PER_SEC ((NSEC_PER_SEC >> PIE_SHIFT))
+
+static inline pie_time_t pie_get_time(void)
+{
+ u64 ns = ktime_to_ns(ktime_get());
+ return ns >> PIE_SHIFT;
+}
+
+static inline u32 pie_time_to_ms(pie_time_t val)
+{
+ u64 valms = ((u64) val << PIE_SHIFT);
+
+ do_div(valms, NSEC_PER_MSEC);
+ return (u32) valms;
+}
+
+/* parameters used*/
+struct pie_params {
+ pie_time_t target; /* user specified target delay in pietime*/
+ pie_time_t tupdate; /* frequency with which the timer fires*/
+ u32 limit; /* number of packets that can be enqueued */
+ u32 alpha; /* alpha and beta are between -4 and 4 */
+ u32 beta; /* and are used for shift relative to 1 */
+ bool ecn; /* true if ecn is enabled */
+ bool bytemode; /* to scale drop early prob based on pkt size */
+};
+
+/* variables used*/
+struct pie_vars {
+ u32 prob; /* probability but scaled by u32 limit. */
+ pie_time_t burst_time;
+ pie_time_t qdelay;
+ pie_time_t qdelay_old;
+ u32 dq_count; /* measured in bytes */
+ pie_time_t dq_tstamp; /* drain rate */
+ u32 avg_dq_rate; /* bytes per pietime tick, scaled by 8 */
+ u32 qlen_old; /* in bytes */
+};
+
+struct pie_stats {
+ u32 packets_in; /* total number of packets enqueued */
+ u32 dropped; /* packets dropped due to pie_action */
+ u32 overlimit; /* dropped due to lack of space in queue */
+ u32 maxq; /* maximum queue size */
+ u32 ecn_mark; /* packets marked with ECN */
+};
+
+static void pie_params_init(struct pie_params *params)
+{
+ memset(params, 0, sizeof(*params));
+ params->alpha = 2;
+ params->beta = 20;
+ params->tupdate = MS2PIETIME(30); /* 30 ms */
+ params->limit = PIE_DEFAULT_QUEUE_LIMIT;
+ params->target = MS2PIETIME(20); /* 20 ms */
+ params->ecn = false;
+ params->bytemode = false;
+}
+
+static void pie_vars_init(struct pie_vars *vars)
+{
+ memset(vars, 0, sizeof(*vars));
+ vars->dq_count = DQCOUNT_INVALID;
+ vars->avg_dq_rate = 0;
+ /* default of 100 ms in pietime */
+ vars->burst_time = MS2PIETIME(100);
+}
+
+static void pie_stats_init(struct pie_stats *stats)
+{
+ memset(stats, 0, sizeof(*stats));
+}
+
+struct pie_sched_data {
+ struct pie_params params;
+ struct pie_vars vars;
+ struct pie_stats stats;
+ struct timer_list adapt_timer;
+};
+
+static inline bool drop_early(struct Qdisc *sch, u32 packet_size)
+{
+ struct pie_sched_data *q = qdisc_priv(sch);
+ u32 rnd;
+ u32 local_prob = q->vars.prob;
+
+
+ /* If there is still burst allowance left or delay is much below target
+ * not due to heavy dropping, skip random early drop
+ */
+ if (q->vars.burst_time > 0)
+ return false;
+
+ /* If current delay is less than half of target, and
+ * if drop prob is low already, disable early_drop
+ */
+ if ((q->vars.qdelay < q->params.target / 2)
+ && (q->vars.prob < MAX_INT_VALUE / 5))
+ return false;
+
+ /* If we have fewer than 2 packets, disable drop_early,
+ * similar to min_th in RED
+ */
+ if (sch->qstats.backlog < 2 * 1500)
+ return false;
+
+ /* If bytemode is turned on, use packet size to compute new
+ * probablity. Smaller packets will have lower drop prob in this case
+ */
+ if (q->params.bytemode) {
+ /* If packet_size is greater than THRESHOLD_PKT_SIZE,
+ * we cap the probability to the maximum value
+ */
+ if (packet_size <= THRESHOLD_PKT_SIZE) {
+ local_prob =
+ (local_prob / THRESHOLD_PKT_SIZE) * packet_size;
+ } else {
+ local_prob = MAX_INT_VALUE_CAP;
+ }
+
+ } else {
+ local_prob = q->vars.prob;
+ }
+
+ rnd = net_random() % MAX_INT_VALUE_CAP;
+ if (rnd < local_prob)
+ return true;
+
+ return false;
+}
+
+static int pie_qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch)
+{
+ struct pie_sched_data *q = qdisc_priv(sch);
+
+ if (unlikely(qdisc_qlen(sch) >= sch->limit))
+ goto out;
+
+ if (!drop_early(sch, skb->len)) {
+ /* we can enqueue the packet */
+ q->stats.packets_in++;
+
+ if (qdisc_qlen(sch) > q->stats.maxq)
+ q->stats.maxq = qdisc_qlen(sch);
+
+ return qdisc_enqueue_tail(skb, sch);
+ } else if (q->params.ecn && INET_ECN_set_ce(skb) &&
+ (q->vars.prob <= MAX_INT_VALUE / 10)) {
+ /* If packet is ecn capable, mark it if drop probability
+ * is lower than 10%, else drop it.
+ */
+ q->stats.ecn_mark++;
+ return qdisc_enqueue_tail(skb, sch);
+ }
+out:
+ q->stats.overlimit++;
+ qdisc_drop(skb, sch);
+ return NET_XMIT_CN; /*indicate congestion*/
+}
+
+static const struct nla_policy pie_policy[TCA_PIE_MAX + 1] = {
+ [TCA_PIE_TARGET] = {.type = NLA_U32},
+ [TCA_PIE_LIMIT] = {.type = NLA_U32},
+ [TCA_PIE_TUPDATE] = {.type = NLA_U32},
+ [TCA_PIE_ALPHA] = {.type = NLA_U32},
+ [TCA_PIE_BETA] = {.type = NLA_U32},
+ [TCA_PIE_ECN] = {.type = NLA_U32},
+ [TCA_PIE_BYTEMODE] = {.type = NLA_U32},
+};
+
+static int pie_change(struct Qdisc *sch, struct nlattr *opt)
+{
+ struct pie_sched_data *q = qdisc_priv(sch);
+ struct nlattr *tb[TCA_PIE_MAX + 1];
+ unsigned int qlen;
+ int err;
+
+ if (!opt)
+ return -EINVAL;
+
+ err = nla_parse_nested(tb, TCA_PIE_MAX, opt, pie_policy);
+ if (err < 0)
+ return err;
+
+ sch_tree_lock(sch);
+
+ /* convert from microseconds to pietime */
+ if (tb[TCA_PIE_TARGET]) {
+ /* target is in us */
+ u32 target = nla_get_u32(tb[TCA_PIE_TARGET]);
+ /* convert to pietime */
+ q->params.target = ((u64) target * NSEC_PER_USEC) >> PIE_SHIFT;
+ }
+
+ if (tb[TCA_PIE_TUPDATE]) {
+ /* tupdate is in us */
+ u32 tupdate = nla_get_u32(tb[TCA_PIE_TUPDATE]);
+ /* convert to pietime */
+ q->params.tupdate =
+ ((u64) tupdate * NSEC_PER_USEC) >> PIE_SHIFT;
+ }
+
+ if (tb[TCA_PIE_LIMIT]) {
+ u32 limit = nla_get_u32(tb[TCA_PIE_LIMIT]);
+ q->params.limit = limit;
+ sch->limit = limit;
+ }
+
+ if (tb[TCA_PIE_ALPHA])
+ q->params.alpha = nla_get_u32(tb[TCA_PIE_ALPHA]);
+
+ if (tb[TCA_PIE_BETA])
+ q->params.beta = nla_get_u32(tb[TCA_PIE_BETA]);
+
+ if (tb[TCA_PIE_ECN])
+ q->params.ecn = nla_get_u32(tb[TCA_PIE_ECN]);
+
+ if (tb[TCA_PIE_BYTEMODE])
+ q->params.bytemode = nla_get_u32(tb[TCA_PIE_BYTEMODE]);
+
+ /* Drop excess packets if new limit is lower */
+ qlen = sch->q.qlen;
+ while (sch->q.qlen > sch->limit) {
+ struct sk_buff *skb = __skb_dequeue(&sch->q);
+
+ sch->qstats.backlog -= qdisc_pkt_len(skb);
+ qdisc_drop(skb, sch);
+ }
+ qdisc_tree_decrease_qlen(sch, qlen - sch->q.qlen);
+
+ sch_tree_unlock(sch);
+ return 0;
+}
+
+static int pie_process_dequeue(struct Qdisc *sch, struct sk_buff *skb)
+{
+
+ struct pie_sched_data *q = qdisc_priv(sch);
+ int qlen = sch->qstats.backlog; /* current queue size in bytes */
+
+ /* If current queue is about 10 packets or more and dq_count is unset
+ * we have enough packets to calculate the drain rate. Save
+ * current time as dq_tstamp and start measurement cycle.
+ */
+
+ if (qlen >= QUEUE_THRESHOLD && q->vars.dq_count == DQCOUNT_INVALID) {
+ q->vars.dq_tstamp = pie_get_time();
+ q->vars.dq_count = 0;
+ }
+
+ /* Calculate the average drain rate from this value. If queue length
+ * has receded to a small value viz., <= QUEUE_THRESHOLD bytes,reset
+ * the dq_count to -1 as we don't have enough packets to calculate the
+ * drain rate anymore The following if block is entered only when we
+ * have a substantial queue built up (QUEUE_THRESHOLD bytes or more)
+ * and we calculate the drain rate for the threshold here. dq_count is
+ * in bytes, time difference in pie_time, hence rate is in
+ * bytes/pie_time.
+ */
+
+ if (q->vars.dq_count != DQCOUNT_INVALID) {
+
+ q->vars.dq_count += skb->len;
+
+ if (q->vars.dq_count >= QUEUE_THRESHOLD) {
+ pie_time_t now = pie_get_time();
+ pie_tdiff_t dtime = now - q->vars.dq_tstamp;
+ u64 count = q->vars.dq_count << 3; /* scale by 8*/
+
+ if (dtime == 0)
+ return 0;
+
+ /* dtime has overflowed */
+ if (dtime < 0)
+ dtime = -dtime;
+
+ do_div(count, dtime);
+
+ if (q->vars.avg_dq_rate == 0)
+ q->vars.avg_dq_rate = count;
+ else
+ q->vars.avg_dq_rate =
+ (q->vars.avg_dq_rate -
+ (q->vars.avg_dq_rate >> 3)) + (count >> 3);
+
+ /* If the queue has receded below the threshold, we hold
+ * on to the last drain rate calculated, else we reset
+ * dq_count to 0 to re-enter the if block when the next
+ * packet is dequeued
+ */
+
+ if (qlen < QUEUE_THRESHOLD)
+ q->vars.dq_count = DQCOUNT_INVALID;
+ else {
+ q->vars.dq_count = 0;
+ q->vars.dq_tstamp = pie_get_time();
+ }
+
+ if (q->vars.burst_time > 0) {
+ if (q->vars.burst_time > dtime)
+ q->vars.burst_time -= dtime;
+ else
+ q->vars.burst_time = 0;
+ }
+ }
+
+ }
+ return 0;
+}
+
+static void calculate_probability(struct Qdisc *sch)
+{
+ struct pie_sched_data *q = qdisc_priv(sch);
+ int qlen = sch->qstats.backlog; /* queue size in bytes */
+ pie_time_t qdelay = 0; /* in pietime */
+ pie_time_t qdelay_old = q->vars.qdelay; /* in pietime */
+ s32 delta = 0; /* signed difference */
+ u32 oldprob;
+ u32 alpha, beta;
+ bool update_prob = true; /* Should probability be updated? */
+
+ q->vars.qdelay_old = q->vars.qdelay;
+
+ if (q->vars.avg_dq_rate > 0)
+ qdelay = (qlen << 3) / q->vars.avg_dq_rate;
+ else
+ qdelay = 0;
+
+ /* If qdelay is zero and qlen is not, it means qlen is very small, less
+ * than dequeue_rate, so we do not update probabilty in this round
+ */
+ if (qdelay == 0 && qlen != 0)
+ update_prob = false;
+
+ /* Add ranges for alpha and beta, more aggressive for high dropping
+ * mode and gentle steps for light dropping mode
+ * In light dropping mode, take gentle steps; in medium dropping mode,
+ * take medium steps; in high dropping mode, take big steps.
+ */
+ if (q->vars.prob < MAX_INT_VALUE / 100) {
+ alpha =
+ (q->params.alpha * (MAX_INT_VALUE / PIE_TIME_PER_SEC)) >> 7;
+ beta =
+ (q->params.beta * (MAX_INT_VALUE / PIE_TIME_PER_SEC)) >> 7;
+ } else if (q->vars.prob < MAX_INT_VALUE / 10) {
+ alpha =
+ (q->params.alpha * (MAX_INT_VALUE / PIE_TIME_PER_SEC)) >> 5;
+ beta =
+ (q->params.beta * (MAX_INT_VALUE / PIE_TIME_PER_SEC)) >> 5;
+ } else {
+ alpha =
+ (q->params.alpha * (MAX_INT_VALUE / PIE_TIME_PER_SEC)) >> 4;
+ beta =
+ (q->params.beta * (MAX_INT_VALUE / PIE_TIME_PER_SEC)) >> 4;
+ }
+
+ /* alpha and beta should be between 0 and 32, in multiples of 1/16
+ */
+ delta += alpha * ((qdelay - q->params.target));
+ delta += beta * ((qdelay - qdelay_old));
+
+ oldprob = q->vars.prob;
+
+ /* addition to ensure we increase probability in steps of no
+ * more than 2%
+ */
+
+ if (delta > (s32) (MAX_INT_VALUE * 2 / 100)
+ && q->vars.prob >= MAX_INT_VALUE / 10) {
+ delta = MAX_INT_VALUE * 2 / 100;
+ }
+
+ /* Non-linear drop
+ * Tune drop probability to increase quickly for high delays
+ * (250ms and above)
+ * 250ms is derived through experiments and provides error protection
+ */
+
+ if (qdelay > (MS2PIETIME(250)))
+ delta += (2 * MAX_INT_VALUE) / 100;
+
+ q->vars.prob += delta;
+
+ if (delta > 0) {
+ /* prevent overflow */
+ if (q->vars.prob < oldprob) {
+ q->vars.prob = MAX_INT_VALUE;
+ /* Prevent normalization error
+ * If probability is the maximum value already,
+ * we normalize it here, and skip the
+ * check to do a non-linear drop in the next section
+ */
+ update_prob = false;
+ }
+ } else {
+ /* prevent underflow */
+ if (q->vars.prob > oldprob)
+ q->vars.prob = 0;
+ }
+
+ /* Non-linear drop in probability */
+ /* Reduce drop probability quickly if delay is 0 for 2 consecutive
+ * Tupdate periods
+ */
+ if ((qdelay == 0) && (qdelay_old == 0) && update_prob)
+ q->vars.prob = (q->vars.prob * 98) / 100;
+
+ q->vars.qdelay = qdelay;
+ q->vars.qlen_old = qlen;
+
+ /* we restart the measurement cycle if the following conditions are met
+ * 1. If the delay has been low for 2 consecutive Tupdate periods
+ * 2. Calculated drop probability is zero
+ * 3. We have atleast one estimate for the avg_dq_rate ie.,
+ * is a non-zero value
+ */
+ if ((q->vars.qdelay < q->params.target / 2)
+ && (q->vars.qdelay_old < q->params.target / 2)
+ && (q->vars.prob == 0)
+ && q->vars.avg_dq_rate > 0)
+ pie_vars_init(&q->vars);
+
+ return;
+}
+
+static inline void pie_timer(unsigned long arg)
+{
+ struct Qdisc *sch = (struct Qdisc *)arg;
+ struct pie_sched_data *q = qdisc_priv(sch);
+ u64 tup;
+
+ calculate_probability(sch);
+ /* reset the timer to fire after 'tupdate' us,
+ * tupdate is currently in pie_time
+ * mod_timer expects time to be in jiffies
+ */
+ /* convert from pietime to nsecs to ms*/
+ tup = pie_time_to_ms(q->params.tupdate);
+ tup = (tup * HZ) / (1000); /* and then to jiffies */
+
+ mod_timer(&q->adapt_timer, jiffies + tup);
+
+ return;
+
+}
+
+static int pie_init(struct Qdisc *sch, struct nlattr *opt)
+{
+ struct pie_sched_data *q = qdisc_priv(sch);
+
+ pie_params_init(&q->params);
+ pie_vars_init(&q->vars);
+ pie_stats_init(&q->stats);
+ sch->limit = q->params.limit;
+ setup_timer(&q->adapt_timer, pie_timer, (unsigned long)sch);
+ add_timer(&q->adapt_timer);
+
+ if (opt) {
+ int err = pie_change(sch, opt);
+
+ if (err)
+ return err;
+ }
+
+ return 0;
+}
+
+static int pie_dump(struct Qdisc *sch, struct sk_buff *skb)
+{
+ struct pie_sched_data *q = qdisc_priv(sch);
+ struct nlattr *opts;
+
+ opts = nla_nest_start(skb, TCA_OPTIONS);
+ if (opts == NULL)
+ goto nla_put_failure;
+
+ /* convert target and tupdate from pietime to us */
+ if (nla_put_u32(skb, TCA_PIE_TARGET,
+ pie_time_to_ms(q->params.target) * 1000L) ||
+ nla_put_u32(skb, TCA_PIE_LIMIT,
+ sch->limit) ||
+ nla_put_u32(skb, TCA_PIE_TUPDATE,
+ pie_time_to_ms(q->params.tupdate) * 1000L) ||
+ nla_put_u32(skb, TCA_PIE_ALPHA,
+ q->params.alpha) ||
+ nla_put_u32(skb, TCA_PIE_BETA, q->params.beta) ||
+ nla_put_u32(skb, TCA_PIE_ECN, q->params.ecn) ||
+ nla_put_u32(skb, TCA_PIE_BYTEMODE, q->params.bytemode))
+ goto nla_put_failure;
+
+ return nla_nest_end(skb, opts);
+
+nla_put_failure:
+ nla_nest_cancel(skb, opts);
+ return -1;
+
+}
+
+static int pie_dump_stats(struct Qdisc *sch, struct gnet_dump *d)
+{
+ struct pie_sched_data *q = qdisc_priv(sch);
+ struct tc_pie_xstats st = {
+ .prob = q->vars.prob,
+ .delay = pie_time_to_ms(q->vars.qdelay) * 1000, /* in us*/
+ /* unscale and return dq_rate in bytes per sec*/
+ .avg_dq_rate = q->vars.avg_dq_rate * (PIE_TIME_PER_SEC/8),
+ .packets_in = q->stats.packets_in,
+ .overlimit = q->stats.overlimit,
+ .maxq = q->stats.maxq,
+ .dropped = q->stats.dropped,
+ .ecn_mark = q->stats.ecn_mark,
+ };
+
+ return gnet_stats_copy_app(d, &st, sizeof(st));
+}
+
+static inline struct sk_buff *pie_qdisc_dequeue(struct Qdisc *sch)
+{
+ struct sk_buff *skb;
+ skb = __qdisc_dequeue_head(sch, &sch->q);
+
+ if (!skb)
+ return NULL;
+
+ pie_process_dequeue(sch, skb);
+
+ return skb;
+}
+
+static void pie_reset(struct Qdisc *sch)
+{
+ struct pie_sched_data *q = qdisc_priv(sch);
+ qdisc_reset_queue(sch);
+ pie_vars_init(&q->vars);
+
+ return;
+}
+
+static void pie_destroy(struct Qdisc *sch)
+{
+ struct pie_sched_data *q = qdisc_priv(sch);
+
+ del_timer_sync(&q->adapt_timer);
+}
+
+static struct Qdisc_ops pie_qdisc_ops __read_mostly = {
+ .id = "pie",
+ .priv_size = sizeof(struct pie_sched_data),
+
+ .enqueue = pie_qdisc_enqueue,
+ .dequeue = pie_qdisc_dequeue,
+ .peek = qdisc_peek_dequeued,
+ .init = pie_init,
+ .destroy = pie_destroy,
+ .reset = pie_reset,
+ .change = pie_change,
+ .dump = pie_dump,
+ .dump_stats = pie_dump_stats,
+ .owner = THIS_MODULE,
+};
+
+static int __init pie_module_init(void)
+{
+ return register_qdisc(&pie_qdisc_ops);
+}
+
+static void __exit pie_module_exit(void)
+{
+ unregister_qdisc(&pie_qdisc_ops);
+}
+
+module_init(pie_module_init);
+module_exit(pie_module_exit);
+
+MODULE_DESCRIPTION
+ ("PIE (Proportional Intergal controller Enhanced) scheduler");
+MODULE_AUTHOR("Vijay Subramanian");
+MODULE_AUTHOR("Mythili Prabhu");
+MODULE_LICENSE("GPL");
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH net 1/2] ip_tunnel: Fix a memory corruption in ip_tunnel_xmit
From: Pravin Shelar @ 2013-09-28 2:34 UTC (permalink / raw)
To: Steffen Klassert; +Cc: David Miller, netdev
In-Reply-To: <20130927074530.GD7660@secunet.com>
On Fri, Sep 27, 2013 at 12:45 AM, Steffen Klassert
<steffen.klassert@secunet.com> wrote:
> On Thu, Sep 26, 2013 at 11:25:01AM -0700, Pravin Shelar wrote:
>> On Thu, Sep 26, 2013 at 1:25 AM, Steffen Klassert
>> <steffen.klassert@secunet.com> wrote:
>> > On Wed, Sep 25, 2013 at 09:55:50AM -0700, Pravin Shelar wrote:
>> >> On Tue, Sep 24, 2013 at 10:54 PM, Steffen Klassert
>> >> <steffen.klassert@secunet.com> wrote:
>> >> > We might extend the used aera of a skb beyond the total
>> >> > headroom when we install the ipip header. Fix this by
>> >> > calling skb_cow_head() unconditionally.
>> >> >
>> >> It is better to call skb_cow_head() from ipip_tunnel_xmit() as it is
>> >> consistent with gre.
>> >
>> > I think this would just move the bug from ipip to gre. ipgre_xmit()
>> > uses dev->needed_headroom which is based on the guessed output device
>> > in ip_tunnel_bind_dev(). If the device we get from the route lookup
>> > in ip_tunnel_xmit() is different from the guessed one and the resulting
>> > max_headroom is bigger than dev->needed_headroom, we run into that bug
>> > because skb_cow_head() will not be called with the updated
>> > dev->needed_headroom.
>> >
>> Thats why ip_tunnel_xmit() update dev->needed_headroom.
>> Just to be clear I was talking abt calling skb_cow_head with
>> dev->needed_headroom in ipip_xmit and leave ip_tunnel_xmit as it is.
>> So that most of cases we will not need to adjust headroom in ip_tunnel
>> xmit.
>
> skb_cow_head() does not do much if there is enough headroom, so
> calling it here is uncritical. But we should adjust the headroom
> as soon as we know that it is insufficient.
>
ok.
> Also, I really wonder how you want to adjust the headroom in
> ipip_tunnel_xmit() to a correct value. We know the needed
> headroom after the route lookup in ip_tunnel_xmit() and
> we have to adust it here because ip_tunnel_xmit() calls
> iptunnel_xmit() which does a __skb_push() before it
> installs the IP header.
>
> Please keep in mind tat this is a bug fix that might be interesting
> for stable too, we should try to keep the changes at a minimum.
>
> Another thing that I noticed, with commit 0e6fbc5b
> (ip_tunnels: extend iptunnel_xmit()) you moved the IP header
> installation to iptunnel_xmit() and changed skb_push()
> to __skb_push(). This made this bug quite hard to track
> down because instead of triggering a skb under panic,
> it did a silent memory corruption and crashed at random
> other places. Maybe we should change this back to skb_push().
All callers of iptunnel_xmit() are required to setup sufficient
headroom. So skb_push check are not necessary.
^ permalink raw reply
* Re: [PATCH net 2/2] ip_tunnel: Add fallback tunnels to the hash lists
From: Pravin Shelar @ 2013-09-28 2:40 UTC (permalink / raw)
To: Steffen Klassert; +Cc: David Miller, netdev
In-Reply-To: <20130927075654.GE7660@secunet.com>
On Fri, Sep 27, 2013 at 12:56 AM, Steffen Klassert
<steffen.klassert@secunet.com> wrote:
> On Thu, Sep 26, 2013 at 11:24:07AM -0700, Pravin Shelar wrote:
>> On Thu, Sep 26, 2013 at 1:13 AM, Steffen Klassert
>> <steffen.klassert@secunet.com> wrote:
>> > On Wed, Sep 25, 2013 at 09:03:11AM -0700, Pravin Shelar wrote:
>> >> fallback tunnel s not required to be in hash table, Its is returned if
>> >> none of hashed tunnels are matched, ref ip_tunnel_lookup().
>> >> Can you post command to reproduce this issue?
>> >>
>> >
>> > Something like
>> >
>> > ip tunnel change tunl0 mode ipip remote 0.0.0.0 local 0.0.0.0 ttl 0 tos 1
>> >
>> > worked until v3.9 and stopped working with v3.10.
>>
>> OK, I see the bug, tunnel exact match lookup does not check fb tunnel.
>> There are two options.
>> 1. Fix ip_tunnel_find() to check for fb tunnel.
>> 2. Add fb tunnel to hash table, which is what ur patch does.
>> I think your patch is better solution as it get rid of special case.
>> But patch is not complete. It needs to remove fb tunnel checks on
>> netdev unregister.
>
> It looks like this is another bug that requires an additional patch.
> We add the fallback tunnel to the unregister list when we iterate over
> all netdevices in the namespace at the beginning of ip_tunnel_destroy()
> and then again explicitly at the end of ip_tunnel_destroy().
right.
And if the special case is removed, code will become simple.
^ permalink raw reply
* [PATCH] carl9170: fix leaks at failure path in carl9170_usb_probe()
From: Alexey Khoroshilov @ 2013-09-28 3:51 UTC (permalink / raw)
To: Christian Lamparter
Cc: Alexey Khoroshilov, John W. Linville, linux-wireless, netdev,
linux-kernel, ldv-project
carl9170_usb_probe() does not handle request_firmware_nowait() failure
that leads to several leaks in this case.
The patch adds all required deallocations.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
---
drivers/net/wireless/ath/carl9170/usb.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/carl9170/usb.c b/drivers/net/wireless/ath/carl9170/usb.c
index 307bc0d..3c76de1 100644
--- a/drivers/net/wireless/ath/carl9170/usb.c
+++ b/drivers/net/wireless/ath/carl9170/usb.c
@@ -1076,8 +1076,14 @@ static int carl9170_usb_probe(struct usb_interface *intf,
carl9170_set_state(ar, CARL9170_STOPPED);
- return request_firmware_nowait(THIS_MODULE, 1, CARL9170FW_NAME,
+ err = request_firmware_nowait(THIS_MODULE, 1, CARL9170FW_NAME,
&ar->udev->dev, GFP_KERNEL, ar, carl9170_usb_firmware_step2);
+ if (err) {
+ usb_put_dev(udev);
+ usb_put_dev(udev);
+ carl9170_free(ar);
+ }
+ return err;
}
static void carl9170_usb_disconnect(struct usb_interface *intf)
--
1.8.1.2
^ permalink raw reply related
* Re: [PATCH] carl9170: fix leaks at failure path in carl9170_usb_probe()
From: Fabio Estevam @ 2013-09-28 4:17 UTC (permalink / raw)
To: Alexey Khoroshilov
Cc: Christian Lamparter, John W. Linville, linux-wireless,
netdev@vger.kernel.org, linux-kernel, ldv-project
In-Reply-To: <1380340311-4630-1-git-send-email-khoroshilov@ispras.ru>
On Sat, Sep 28, 2013 at 12:51 AM, Alexey Khoroshilov
<khoroshilov@ispras.ru> wrote:
> - return request_firmware_nowait(THIS_MODULE, 1, CARL9170FW_NAME,
> + err = request_firmware_nowait(THIS_MODULE, 1, CARL9170FW_NAME,
> &ar->udev->dev, GFP_KERNEL, ar, carl9170_usb_firmware_step2);
> + if (err) {
> + usb_put_dev(udev);
> + usb_put_dev(udev);
You are doing the same free twice.
I guess you meant to also free: usb_put_dev(ar->udev)
^ permalink raw reply
* Re: [PATCH] carl9170: fix leaks at failure path in carl9170_usb_probe()
From: Alexey Khoroshilov @ 2013-09-28 5:16 UTC (permalink / raw)
To: Fabio Estevam
Cc: Christian Lamparter, John W. Linville, linux-wireless,
netdev@vger.kernel.org, linux-kernel, ldv-project
In-Reply-To: <CAOMZO5DE0OdXhWNEr2HAswvgryBqP8VNk3+vanwsi38L6pL9OA@mail.gmail.com>
On 28.09.2013 00:17, Fabio Estevam wrote:
> On Sat, Sep 28, 2013 at 12:51 AM, Alexey Khoroshilov
> <khoroshilov@ispras.ru> wrote:
>
>> - return request_firmware_nowait(THIS_MODULE, 1, CARL9170FW_NAME,
>> + err = request_firmware_nowait(THIS_MODULE, 1, CARL9170FW_NAME,
>> &ar->udev->dev, GFP_KERNEL, ar, carl9170_usb_firmware_step2);
>> + if (err) {
>> + usb_put_dev(udev);
>> + usb_put_dev(udev);
> You are doing the same free twice.
Yes, because it was get twice.
> I guess you meant to also free: usb_put_dev(ar->udev)
udev and ar->udev are equal, so technically the patch is correct.
I agree that there is some inconsistency, but I would prefer to fix it
at usb_get_dev() side with a comment about reasons for the double get.
--
Alexey
^ permalink raw reply
* [PATCH net-next 0/6] bnx2x: enhancements patch series
From: Yuval Mintz @ 2013-09-28 5:46 UTC (permalink / raw)
To: davem, netdev; +Cc: ariele, eilong
Hi Dave,
This patch series contains several modifications to the driver in all areas;
It also includes a patch which might be considered as bug fixes but since
it fixes a benign issue we're posting it in this series.
Please consider applying these patches to `net-next'.
Thanks,
Yuval Mintz
^ permalink raw reply
* [PATCH net-next 2/6] bnx2x: Correct VF driver info
From: Yuval Mintz @ 2013-09-28 5:46 UTC (permalink / raw)
To: davem, netdev; +Cc: ariele, eilong, Yuval Mintz
In-Reply-To: <1380347172-16670-1-git-send-email-yuvalmin@broadcom.com>
When running ethtool on VF interfaces, returning values should indicate
that the interface does not support self-test or register dump.
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 2 +-
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
index 97b3d32..a38d049 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
@@ -2231,7 +2231,7 @@ void bnx2x_igu_clear_sb_gen(struct bnx2x *bp, u8 func, u8 idu_sb_id,
#define BNX2X_NUM_TESTS_SF 7
#define BNX2X_NUM_TESTS_MF 3
#define BNX2X_NUM_TESTS(bp) (IS_MF(bp) ? BNX2X_NUM_TESTS_MF : \
- BNX2X_NUM_TESTS_SF)
+ IS_VF(bp) ? 0 : BNX2X_NUM_TESTS_SF)
#define BNX2X_PHY_LOOPBACK 0
#define BNX2X_MAC_LOOPBACK 1
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
index 120966c..8213cc8 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
@@ -639,6 +639,9 @@ static int bnx2x_get_regs_len(struct net_device *dev)
struct bnx2x *bp = netdev_priv(dev);
int regdump_len = 0;
+ if (IS_VF(bp))
+ return 0;
+
regdump_len = __bnx2x_get_regs_len(bp);
regdump_len *= 4;
regdump_len += sizeof(struct dump_header);
--
1.8.1.227.g44fe835
^ permalink raw reply related
* [PATCH net-next 1/6] bnx2x: Test nvram when interface is down
From: Yuval Mintz @ 2013-09-28 5:46 UTC (permalink / raw)
To: davem, netdev; +Cc: ariele, eilong, Yuval Mintz
In-Reply-To: <1380347172-16670-1-git-send-email-yuvalmin@broadcom.com>
Since submit 3fb43eb "bnx2x: Change to D3hot only on removal" nvram
is accessible whenever the driver is loaded - Thus it is possible to
test it during self-test even if the interface is down
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
index 324de5f..120966c 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
@@ -2900,9 +2900,16 @@ static void bnx2x_self_test(struct net_device *dev,
memset(buf, 0, sizeof(u64) * BNX2X_NUM_TESTS(bp));
+ if (bnx2x_test_nvram(bp) != 0) {
+ if (!IS_MF(bp))
+ buf[4] = 1;
+ else
+ buf[0] = 1;
+ etest->flags |= ETH_TEST_FL_FAILED;
+ }
+
if (!netif_running(dev)) {
- DP(BNX2X_MSG_ETHTOOL,
- "Can't perform self-test when interface is down\n");
+ DP(BNX2X_MSG_ETHTOOL, "Interface is down\n");
return;
}
@@ -2964,13 +2971,7 @@ static void bnx2x_self_test(struct net_device *dev,
/* wait until link state is restored */
bnx2x_wait_for_link(bp, link_up, is_serdes);
}
- if (bnx2x_test_nvram(bp) != 0) {
- if (!IS_MF(bp))
- buf[4] = 1;
- else
- buf[0] = 1;
- etest->flags |= ETH_TEST_FL_FAILED;
- }
+
if (bnx2x_test_intr(bp) != 0) {
if (!IS_MF(bp))
buf[5] = 1;
--
1.8.1.227.g44fe835
^ permalink raw reply related
* [PATCH net-next 4/6] bnx2x: Change function prototype
From: Yuval Mintz @ 2013-09-28 5:46 UTC (permalink / raw)
To: davem, netdev; +Cc: ariele, eilong, Yaniv Rosner, Yuval Mintz
In-Reply-To: <1380347172-16670-1-git-send-email-yuvalmin@broadcom.com>
From: Yaniv Rosner <yanivr@broadcom.com>
Change bnx2x_bsc_read function prototype (more of a cosmetic change).
Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index d60a2ea..92112e2 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -3121,7 +3121,7 @@ static void bnx2x_bsc_module_sel(struct link_params *params)
}
static int bnx2x_bsc_read(struct link_params *params,
- struct bnx2x_phy *phy,
+ struct bnx2x *bp,
u8 sl_devid,
u16 sl_addr,
u8 lc_addr,
@@ -3130,7 +3130,6 @@ static int bnx2x_bsc_read(struct link_params *params,
{
u32 val, i;
int rc = 0;
- struct bnx2x *bp = params->bp;
if (xfer_cnt > 16) {
DP(NETIF_MSG_LINK, "invalid xfer_cnt %d. Max is 16 bytes\n",
@@ -7886,7 +7885,7 @@ static int bnx2x_warpcore_read_sfp_module_eeprom(struct bnx2x_phy *phy,
usleep_range(1000, 2000);
bnx2x_warpcore_power_module(params, 1);
}
- rc = bnx2x_bsc_read(params, phy, dev_addr, addr32, 0, byte_cnt,
+ rc = bnx2x_bsc_read(params, bp, dev_addr, addr32, 0, byte_cnt,
data_array);
} while ((rc != 0) && (++cnt < I2C_WA_RETRY_CNT));
--
1.8.1.227.g44fe835
^ permalink raw reply related
* [PATCH net-next 3/6] bnx2x: Don't disable/enable SR-IOV when loading
From: Yuval Mintz @ 2013-09-28 5:46 UTC (permalink / raw)
To: davem, netdev; +Cc: ariele, eilong, Yuval Mintz
In-Reply-To: <1380347172-16670-1-git-send-email-yuvalmin@broadcom.com>
From: Ariel Elior <ariele@broadcom.com>
Current bnx2x implementation controls the number of VFs only by
standard sysfs support, and will reject setting the number of VFs
when the PF is not loaded.
As a result, there is no need to schedule a delayed work to enable
SR-IOV when PF is loaded, as the number of VFs at that point
must be 0.
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 2 +-
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 23 -----------------------
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h | 2 --
3 files changed, 1 insertion(+), 26 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index a6704b5..467689f 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -11740,7 +11740,7 @@ static int bnx2x_open(struct net_device *dev)
rc = bnx2x_nic_load(bp, LOAD_OPEN);
if (rc)
return rc;
- return bnx2x_open_epilog(bp);
+ return 0;
}
/* called with rtnl_lock */
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index 7991f10..03cfee1 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -3635,29 +3635,6 @@ alloc_mem_err:
return -ENOMEM;
}
-int bnx2x_open_epilog(struct bnx2x *bp)
-{
- /* Enable sriov via delayed work. This must be done via delayed work
- * because it causes the probe of the vf devices to be run, which invoke
- * register_netdevice which must have rtnl lock taken. As we are holding
- * the lock right now, that could only work if the probe would not take
- * the lock. However, as the probe of the vf may be called from other
- * contexts as well (such as passthrough to vm fails) it can't assume
- * the lock is being held for it. Using delayed work here allows the
- * probe code to simply take the lock (i.e. wait for it to be released
- * if it is being held). We only want to do this if the number of VFs
- * was set before PF driver was loaded.
- */
- if (IS_SRIOV(bp) && BNX2X_NR_VIRTFN(bp)) {
- smp_mb__before_clear_bit();
- set_bit(BNX2X_SP_RTNL_ENABLE_SRIOV, &bp->sp_rtnl_state);
- smp_mb__after_clear_bit();
- schedule_delayed_work(&bp->sp_rtnl_task, 0);
- }
-
- return 0;
-}
-
void bnx2x_iov_channel_down(struct bnx2x *bp)
{
int vf_idx;
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h
index 059f0d4..1ff6a93 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h
@@ -782,7 +782,6 @@ static inline int bnx2x_vf_headroom(struct bnx2x *bp)
void bnx2x_pf_set_vfs_vlan(struct bnx2x *bp);
int bnx2x_sriov_configure(struct pci_dev *dev, int num_vfs);
void bnx2x_iov_channel_down(struct bnx2x *bp);
-int bnx2x_open_epilog(struct bnx2x *bp);
#else /* CONFIG_BNX2X_SRIOV */
@@ -842,7 +841,6 @@ static inline int bnx2x_vf_pci_alloc(struct bnx2x *bp) {return 0; }
static inline void bnx2x_pf_set_vfs_vlan(struct bnx2x *bp) {}
static inline int bnx2x_sriov_configure(struct pci_dev *dev, int num_vfs) {return 0; }
static inline void bnx2x_iov_channel_down(struct bnx2x *bp) {}
-static inline int bnx2x_open_epilog(struct bnx2x *bp) {return 0; }
#endif /* CONFIG_BNX2X_SRIOV */
#endif /* bnx2x_sriov.h */
--
1.8.1.227.g44fe835
^ permalink raw reply related
* [PATCH net-next 6/6] bnx2x: use pcie_get_minimum_link()
From: Yuval Mintz @ 2013-09-28 5:46 UTC (permalink / raw)
To: davem, netdev; +Cc: ariele, eilong, Yuval Mintz
In-Reply-To: <1380347172-16670-1-git-send-email-yuvalmin@broadcom.com>
Use common code for getting the pcie link speed/width for debug printing.
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 6 ----
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 45 +++++++-----------------
2 files changed, 12 insertions(+), 39 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
index a38d049..8fe4bcb 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
@@ -2491,11 +2491,5 @@ enum {
#define NUM_MACS 8
-enum bnx2x_pci_bus_speed {
- BNX2X_PCI_LINK_SPEED_2500 = 2500,
- BNX2X_PCI_LINK_SPEED_5000 = 5000,
- BNX2X_PCI_LINK_SPEED_8000 = 8000
-};
-
void bnx2x_set_local_cmng(struct bnx2x *bp);
#endif /* bnx2x.h */
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 467689f..654680d 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -12274,28 +12274,6 @@ err_out:
return rc;
}
-static void bnx2x_get_pcie_width_speed(struct bnx2x *bp, int *width,
- enum bnx2x_pci_bus_speed *speed)
-{
- u32 link_speed, val = 0;
-
- pci_read_config_dword(bp->pdev, PCICFG_LINK_CONTROL, &val);
- *width = (val & PCICFG_LINK_WIDTH) >> PCICFG_LINK_WIDTH_SHIFT;
-
- link_speed = (val & PCICFG_LINK_SPEED) >> PCICFG_LINK_SPEED_SHIFT;
-
- switch (link_speed) {
- case 3:
- *speed = BNX2X_PCI_LINK_SPEED_8000;
- break;
- case 2:
- *speed = BNX2X_PCI_LINK_SPEED_5000;
- break;
- default:
- *speed = BNX2X_PCI_LINK_SPEED_2500;
- }
-}
-
static int bnx2x_check_firmware(struct bnx2x *bp)
{
const struct firmware *firmware = bp->firmware;
@@ -12652,8 +12630,8 @@ static int bnx2x_init_one(struct pci_dev *pdev,
{
struct net_device *dev = NULL;
struct bnx2x *bp;
- int pcie_width;
- enum bnx2x_pci_bus_speed pcie_speed;
+ enum pcie_link_width pcie_width;
+ enum pci_bus_speed pcie_speed;
int rc, max_non_def_sbs;
int rx_count, tx_count, rss_count, doorbell_size;
int max_cos_est;
@@ -12802,18 +12780,19 @@ static int bnx2x_init_one(struct pci_dev *pdev,
dev_addr_add(bp->dev, bp->fip_mac, NETDEV_HW_ADDR_T_SAN);
rtnl_unlock();
}
-
- bnx2x_get_pcie_width_speed(bp, &pcie_width, &pcie_speed);
- BNX2X_DEV_INFO("got pcie width %d and speed %d\n",
- pcie_width, pcie_speed);
-
- BNX2X_DEV_INFO("%s (%c%d) PCI-E x%d %s found at mem %lx, IRQ %d, node addr %pM\n",
+ if (pcie_get_minimum_link(bp->pdev, &pcie_speed, &pcie_width) ||
+ pcie_speed == PCI_SPEED_UNKNOWN ||
+ pcie_width == PCIE_LNK_WIDTH_UNKNOWN)
+ BNX2X_DEV_INFO("Failed to determine PCI Express Bandwidth\n");
+ else
+ BNX2X_DEV_INFO(
+ "%s (%c%d) PCI-E x%d %s found at mem %lx, IRQ %d, node addr %pM\n",
board_info[ent->driver_data].name,
(CHIP_REV(bp) >> 12) + 'A', (CHIP_METAL(bp) >> 4),
pcie_width,
- pcie_speed == BNX2X_PCI_LINK_SPEED_2500 ? "2.5GHz" :
- pcie_speed == BNX2X_PCI_LINK_SPEED_5000 ? "5.0GHz" :
- pcie_speed == BNX2X_PCI_LINK_SPEED_8000 ? "8.0GHz" :
+ pcie_speed == PCIE_SPEED_2_5GT ? "2.5GHz" :
+ pcie_speed == PCIE_SPEED_5_0GT ? "5.0GHz" :
+ pcie_speed == PCIE_SPEED_8_0GT ? "8.0GHz" :
"Unknown",
dev->base_addr, bp->pdev->irq, dev->dev_addr);
--
1.8.1.227.g44fe835
^ permalink raw reply related
* [PATCH net-next 5/6] bnx2x: Add support for EXTPHY2 LED mode
From: Yuval Mintz @ 2013-09-28 5:46 UTC (permalink / raw)
To: davem, netdev; +Cc: ariele, eilong, Yaniv Rosner, Yuval Mintz
In-Reply-To: <1380347172-16670-1-git-send-email-yuvalmin@broadcom.com>
From: Yaniv Rosner <yanivr@broadcom.com>
Add new LED mode for the BCM848xx to support new board type.
Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h | 1 +
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | 20 +++++++++++++++++---
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h
index 32767f6..cf1df8b 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h
@@ -172,6 +172,7 @@ struct shared_hw_cfg { /* NVRAM Offset */
#define SHARED_HW_CFG_LED_MAC4 0x000c0000
#define SHARED_HW_CFG_LED_PHY8 0x000d0000
#define SHARED_HW_CFG_LED_EXTPHY1 0x000e0000
+ #define SHARED_HW_CFG_LED_EXTPHY2 0x000f0000
#define SHARED_HW_CFG_AN_ENABLE_MASK 0x3f000000
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index 92112e2..c60cf43 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -6344,9 +6344,15 @@ int bnx2x_set_led(struct link_params *params,
* intended override.
*/
break;
- } else
+ } else {
+ u32 nig_led_mode = ((params->hw_led_mode <<
+ SHARED_HW_CFG_LED_MODE_SHIFT) ==
+ SHARED_HW_CFG_LED_EXTPHY2) ?
+ (SHARED_HW_CFG_LED_PHY1 >>
+ SHARED_HW_CFG_LED_MODE_SHIFT) : hw_led_mode;
REG_WR(bp, NIG_REG_LED_MODE_P0 + port*4,
- hw_led_mode);
+ nig_led_mode);
+ }
REG_WR(bp, NIG_REG_LED_CONTROL_OVERRIDE_TRAFFIC_P0 + port*4, 0);
/* Set blinking rate to ~15.9Hz */
@@ -10608,10 +10614,18 @@ static void bnx2x_848xx_set_link_led(struct bnx2x_phy *phy,
0x40);
} else {
+ /* EXTPHY2 LED mode indicate that the 100M/1G/10G LED
+ * sources are all wired through LED1, rather than only
+ * 10G in other modes.
+ */
+ val = ((params->hw_led_mode <<
+ SHARED_HW_CFG_LED_MODE_SHIFT) ==
+ SHARED_HW_CFG_LED_EXTPHY2) ? 0x98 : 0x80;
+
bnx2x_cl45_write(bp, phy,
MDIO_PMA_DEVAD,
MDIO_PMA_REG_8481_LED1_MASK,
- 0x80);
+ val);
/* Tell LED3 to blink on source */
bnx2x_cl45_read(bp, phy,
--
1.8.1.227.g44fe835
^ permalink raw reply related
* Do not miss a chance!
From: johntaylor @ 2013-09-28 7:27 UTC (permalink / raw)
Dear Customer,
There is a lot of people in this world who spend so much time
watching their health that they have not the time to enjoy it.
No doctor visits
Lowest price World Wide
Discreet Packaging
http://translate.googleusercontent.com/translate_c?depth=1&hl=auto&sl=de&url=www.google.fm&u=http://onlineshop55.yolasite.com/shop&usg=ALkJrhigo2DxeKnp8k6CY7J-q-rVMUPqBw
Best Regards,
^ permalink raw reply
* MUTUAL PROJECT
From: jing01lee @ 2013-09-28 6:53 UTC (permalink / raw)
To: Recipients
Hello
I have a business proposal for you. There is no risks involved.
Pls reply for briefs.
Mr Lee
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox