* Re: New qdisc monitor
From: Andi Kleen @ 2009-10-02 21:21 UTC (permalink / raw)
To: clownix; +Cc: netdev
In-Reply-To: <1254501684.2670.7.camel@localhost>
clownix <clownix@clownix.net> writes:
> At http://clownix.net, there is a qdisc monitor based on a new sched
> qdisc named spy and a module that periodicaly sends the
> enqueues/dequeues/drops/queue-size/delays... to be plotted to the user
> world through a netlink socket.
> Note that the name of this software package is "clownix_spy", and not
> cloonix_net which is another project on the same site.
Sounds like a cool idea, but could you consider submitting the qdisc
for mainline and getting it reviewed? Out of tree kernel patches for these
kinds of things tend to be a pain to use.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
^ permalink raw reply
* Re: Performance questions using bridge and macvlan
From: Ira W. Snyder @ 2009-10-02 21:11 UTC (permalink / raw)
To: netdev
In-Reply-To: <20091001212133.GD28963@ovro.caltech.edu>
On Thu, Oct 01, 2009 at 02:21:33PM -0700, Ira W. Snyder wrote:
> Hello all,
>
> I've got an "interesting" network setup (using bridge), and I wonder if
> macvlan might help me get some more performance. Unfortunately, there
> isn't much documentation for macvlan, so I'm asking here.
>
> I have a computer acting as an ethernet bridge. NIC A is on a network
> with a 1500 byte mtu. NIC B is a point-to-point ethernet device with a
> 64K mtu.
>
> Adding both devices to a bridge using brctl works as expected. The
> computer attached to NIC B can send/recv normal ethernet traffic onto
> the outside network through NIC A.
>
> Unfortunately, the bridge code does not fragment packets, and so the 64K
> mtu is reduced to a 1500 byte mtu. This kills performance by a factor of
> about 5x on the point-to-point device. All of my tests were using
> netperf/netserver running on the machine doing the bridging.
>
> Without bridge, using full 64K mtu packets, netperf gives ~600mbit/sec.
> With brigde, using 1500 byte mtu packets, netperf gives ~120mbit/sec.
>
> My question is this: is it possible to setup routing or macvlans such
> that any traffic from the bridge machine itself travels across the
> point-to-point link (at full 64K mtu), but any other traffic goes
> through the bridge (using 1500 byte mtu).
>
> I'm aware that either running NAT or routing will fragment packets and
> solve my problem, but this introduces some complexity in my network
> setup that I would like to avoid.
>
I have solved my problem using a veth pair device instead of macvlan. My
solution is described below to help anyone else who comes across this
problem.
eth0: physical ethernet, 1500 byte mtu
eth2: point-to-point ethernet, 65522 byte mtu
veth0, veth1: a veth pair device
br0, br1: ethernet bridges
# create the veth devices, increase mtu
ip link add link eth0 type veth
ip link set veth0 mtu 65522
ip link set veth1 mtu 65522
# create the bridges
brctl addbr br0
brctl addbr br1
# setup bridge 0
brctl addif br0 eth0
brctl addif br0 veth0
# setup bridge 1
brctl addif br1 eth2
brctl addif br1 veth1
# bring everything up
ip link set eth0 up
ip link set eth2 up
ip link set veth0 up
ip link set veth1 up
ip link set br0 up
ip link set br1 up
At this point, I use dhcpcd on the br0 interface to get an address. In
order for routing to work properly, I had to get an address for the br1
interface as well. Without an address for br1, everything was still
slow.
My routing table now looks like this:
[root@mybox ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.17.0 0.0.0.0 255.255.255.0 U 0 0 0 br1
192.168.17.0 0.0.0.0 255.255.255.0 U 204 0 0 br0
0.0.0.0 192.168.17.1 0.0.0.0 UG 204 0 0 br0
I'm curious if I could run dhcpcd on br1 and still have everything work
correctly. I think the answer is yes, but it will take more testing to
confirm this.
Ira
^ permalink raw reply
* Re: [PATCH] TCPCT-1: adding a sysctl
From: Andi Kleen @ 2009-10-02 21:06 UTC (permalink / raw)
To: William Allen Simpson; +Cc: netdev
In-Reply-To: <4AC61505.8030701@gmail.com>
William Allen Simpson <william.allen.simpson@gmail.com> writes:
>
> Any suggestions for improvement? Or general approval?
The patch seems incomplete, can't find callers for most of the new functions.
In general cookies fell a bit out of favour because they don't support window
scaling etc. But you don't seem to fix that by putting that data into
the new option.
My immediate gut reaction is that it will be likely challenging to
traverse many packet filters (which often have a tendency to drop
anything they don't know) with this option on. That is also what killed
ECN.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
^ permalink raw reply
* Re: Messages are printed on screen
From: Ben Hutchings @ 2009-10-02 20:49 UTC (permalink / raw)
To: Markus Feldmann; +Cc: netdev
In-Reply-To: <ha4q26$7mt$1@ger.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1910 bytes --]
On Fri, 2009-10-02 at 14:01 +0200, Markus Feldmann wrote:
> Ben Hutchings schrieb:
> > On Fri, 2009-10-02 at 11:52 +0200, Markus Feldmann wrote:
> >
> >>
> >> As you see some of my IRQ-Lines are multiply in use, so my Server is
> >> working hard at his limit.
> >
> > IRQ sharing is normal on PCs without MSI support, but to see where
> > that's happening you need to look at /proc/interrupts and not the BIOS
> > setup program or wherever you got the above information from.
> Ok i did <cat /proc/interrupts> and got:
> CPU0
> 0: 259603 XT-PIC-XT timer
> 1: 1421 XT-PIC-XT i8042
> 2: 0 XT-PIC-XT cascade
> 4: 200000 XT-PIC-XT ohci_hcd:usb3, pppp0
This number is a clue because after every 100,000 interrupts for a
particular IRQ the kernel checks how many of them were handled. If this
is less than 100 then it disables the IRQ. So I suspect one of these
devices is misbehaving, or its driver is not handling interrupts
correctly. Is 'pppp0' actually an Ethernet device that you're using for
PPPoE? If so, what model of network card is it?
> 5: 0 XT-PIC-XT ehci_hcd:usb1, lan0
> 7: 6959 XT-PIC-XT lan1
> 8: 2 XT-PIC-XT rtc0
> 9: 0 XT-PIC-XT acpi
> 11: 37697 XT-PIC-XT ide2, ide3, ohci_hcd:usb2, lan2
> 14: 0 XT-PIC-XT ide0
> NMI: 0 Non-maskable interrupts
> TRM: 0 Thermal event interrupts
> MCE: 0 Machine check exceptions
> MCP: 13 Machine check polls
> ERR: 2
>
> How can i assigned IRQs during Boot?
[...]
They are assigned by the BIOS. You may be able to configure this in
BIOS setup.
Ben.
--
Ben Hutchings
Who are all these weirdos? - David Bowie, about L-Space IRC channel #afp
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* Re: [RFC take2] pkt_sched: gen_estimator: Dont report fake rate estimators
From: Eric Dumazet @ 2009-10-02 20:32 UTC (permalink / raw)
To: Jarek Poplawski; +Cc: David Miller, kaber, netdev
In-Reply-To: <4AC65E6F.8050403@gmail.com>
Jarek Poplawski a écrit :
>
>
> Hmm... So you made me to do some "real" work here, and guess what?:
> there is one serious checkpatch warning! ;-) Plus, this new parameter
> should be added to the function description. Otherwise:
> Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
>
> Thanks,
> Jarek P.
>
> PS: I guess full "Don't" would show we really mean it...
Okay :) Here is the last round, before the night !
Thanks again
[RFC] pkt_sched: gen_estimator: Don't report fake rate estimators
We currently send TCA_STATS_RATE_EST elements to netlink users, even if no estimator
is running.
# tc -s -d qdisc
qdisc pfifo_fast 0: dev eth0 root bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
Sent 112833764978 bytes 1495081739 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
User has no way to tell if the "rate 0bit 0pps" is a real estimation, or a fake
one (because no estimator is active)
After this patch, tc command output is :
$ tc -s -d qdisc
qdisc pfifo_fast 0: dev eth0 root bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
Sent 561075 bytes 1196 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
We add a parameter to gnet_stats_copy_rate_est() function so that
it can use gen_estimator_active(bstats, r), as suggested by Jarek.
This parameter can be NULL if check is not necessary, (htb for
example has a mandatory rate estimator)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
---
include/net/gen_stats.h | 1 +
net/core/gen_stats.c | 8 +++++++-
net/sched/act_api.c | 3 ++-
net/sched/sch_api.c | 2 +-
net/sched/sch_cbq.c | 2 +-
net/sched/sch_drr.c | 2 +-
net/sched/sch_hfsc.c | 2 +-
net/sched/sch_htb.c | 2 +-
8 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/include/net/gen_stats.h b/include/net/gen_stats.h
index c148855..eb87a14 100644
--- a/include/net/gen_stats.h
+++ b/include/net/gen_stats.h
@@ -30,6 +30,7 @@ extern int gnet_stats_start_copy_compat(struct sk_buff *skb, int type,
extern int gnet_stats_copy_basic(struct gnet_dump *d,
struct gnet_stats_basic_packed *b);
extern int gnet_stats_copy_rate_est(struct gnet_dump *d,
+ const struct gnet_stats_basic_packed *b,
struct gnet_stats_rate_est *r);
extern int gnet_stats_copy_queue(struct gnet_dump *d,
struct gnet_stats_queue *q);
diff --git a/net/core/gen_stats.c b/net/core/gen_stats.c
index 8569310..393b1d8 100644
--- a/net/core/gen_stats.c
+++ b/net/core/gen_stats.c
@@ -127,6 +127,7 @@ gnet_stats_copy_basic(struct gnet_dump *d, struct gnet_stats_basic_packed *b)
/**
* gnet_stats_copy_rate_est - copy rate estimator statistics into statistics TLV
* @d: dumping handle
+ * @b: basic statistics
* @r: rate estimator statistics
*
* Appends the rate estimator statistics to the top level TLV created by
@@ -136,8 +137,13 @@ gnet_stats_copy_basic(struct gnet_dump *d, struct gnet_stats_basic_packed *b)
* if the room in the socket buffer was not sufficient.
*/
int
-gnet_stats_copy_rate_est(struct gnet_dump *d, struct gnet_stats_rate_est *r)
+gnet_stats_copy_rate_est(struct gnet_dump *d,
+ const struct gnet_stats_basic_packed *b,
+ struct gnet_stats_rate_est *r)
{
+ if (b && !gen_estimator_active(b, r))
+ return 0;
+
if (d->compat_tc_stats) {
d->tc_stats.bps = r->bps;
d->tc_stats.pps = r->pps;
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 2dfb3e7..ca2e1fd 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -618,7 +618,8 @@ int tcf_action_copy_stats(struct sk_buff *skb, struct tc_action *a,
goto errout;
if (gnet_stats_copy_basic(&d, &h->tcf_bstats) < 0 ||
- gnet_stats_copy_rate_est(&d, &h->tcf_rate_est) < 0 ||
+ gnet_stats_copy_rate_est(&d, &h->tcf_bstats,
+ &h->tcf_rate_est) < 0 ||
gnet_stats_copy_queue(&d, &h->tcf_qstats) < 0)
goto errout;
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 903e418..1acfd29 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -1179,7 +1179,7 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid,
goto nla_put_failure;
if (gnet_stats_copy_basic(&d, &q->bstats) < 0 ||
- gnet_stats_copy_rate_est(&d, &q->rate_est) < 0 ||
+ gnet_stats_copy_rate_est(&d, &q->bstats, &q->rate_est) < 0 ||
gnet_stats_copy_queue(&d, &q->qstats) < 0)
goto nla_put_failure;
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index 5b132c4..3846d65 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -1609,7 +1609,7 @@ cbq_dump_class_stats(struct Qdisc *sch, unsigned long arg,
cl->xstats.undertime = cl->undertime - q->now;
if (gnet_stats_copy_basic(d, &cl->bstats) < 0 ||
- gnet_stats_copy_rate_est(d, &cl->rate_est) < 0 ||
+ gnet_stats_copy_rate_est(d, &cl->bstats, &cl->rate_est) < 0 ||
gnet_stats_copy_queue(d, &cl->qstats) < 0)
return -1;
diff --git a/net/sched/sch_drr.c b/net/sched/sch_drr.c
index 5a888af..a65604f 100644
--- a/net/sched/sch_drr.c
+++ b/net/sched/sch_drr.c
@@ -280,7 +280,7 @@ static int drr_dump_class_stats(struct Qdisc *sch, unsigned long arg,
}
if (gnet_stats_copy_basic(d, &cl->bstats) < 0 ||
- gnet_stats_copy_rate_est(d, &cl->rate_est) < 0 ||
+ gnet_stats_copy_rate_est(d, &cl->bstats, &cl->rate_est) < 0 ||
gnet_stats_copy_queue(d, &cl->qdisc->qstats) < 0)
return -1;
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
index 2c5c76b..b38b39c 100644
--- a/net/sched/sch_hfsc.c
+++ b/net/sched/sch_hfsc.c
@@ -1375,7 +1375,7 @@ hfsc_dump_class_stats(struct Qdisc *sch, unsigned long arg,
xstats.rtwork = cl->cl_cumul;
if (gnet_stats_copy_basic(d, &cl->bstats) < 0 ||
- gnet_stats_copy_rate_est(d, &cl->rate_est) < 0 ||
+ gnet_stats_copy_rate_est(d, &cl->bstats, &cl->rate_est) < 0 ||
gnet_stats_copy_queue(d, &cl->qstats) < 0)
return -1;
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 85acab9..2e38d1a 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -1105,7 +1105,7 @@ htb_dump_class_stats(struct Qdisc *sch, unsigned long arg, struct gnet_dump *d)
cl->xstats.ctokens = cl->ctokens;
if (gnet_stats_copy_basic(d, &cl->bstats) < 0 ||
- gnet_stats_copy_rate_est(d, &cl->rate_est) < 0 ||
+ gnet_stats_copy_rate_est(d, NULL, &cl->rate_est) < 0 ||
gnet_stats_copy_queue(d, &cl->qstats) < 0)
return -1;
^ permalink raw reply related
* Re: [RFC take2] pkt_sched: gen_estimator: Dont report fake rate estimators
From: Jarek Poplawski @ 2009-10-02 20:11 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, kaber, netdev
In-Reply-To: <4AC5F46B.6030308@gmail.com>
Eric Dumazet wrote, On 10/02/2009 02:39 PM:
> Jarek Poplawski a écrit :
>
>> So you prefer the additional parameter version, but since these
>> _active tests are not needed e.g. for HTB classes, which got it
>> active by default, so maybe bstats == NULL would let skip such a test?
>>
>> ...
>>> --- a/include/net/gen_stats.h
>>> +++ b/include/net/gen_stats.h
>>> @@ -30,6 +30,7 @@ extern int gnet_stats_start_copy_compat(struct sk_buff *skb, int type,
>>> extern int gnet_stats_copy_basic(struct gnet_dump *d,
>>> struct gnet_stats_basic_packed *b);
>>> extern int gnet_stats_copy_rate_est(struct gnet_dump *d,
>>> + const struct gnet_stats_basic_packed *bstats,
>> It seems these *b/*bstats defs could look more consistent. Otherwise
>> it looks OK to me.
>
> Agreed, here is the updated version, I added your Signoff if you dont mind :)
Hmm... So you made me to do some "real" work here, and guess what?:
there is one serious checkpatch warning! ;-) Plus, this new parameter
should be added to the function description. Otherwise:
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Thanks,
Jarek P.
PS: I guess full "Don't" would show we really mean it...
> [RFC] pkt_sched: gen_estimator: Dont report fake rate estimators
>
> We currently send TCA_STATS_RATE_EST elements to netlink users, even if no estimator
> is running.
>
> # tc -s -d qdisc
> qdisc pfifo_fast 0: dev eth0 root bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
> Sent 112833764978 bytes 1495081739 pkt (dropped 0, overlimits 0 requeues 0)
> rate 0bit 0pps backlog 0b 0p requeues 0
>
> User has no way to tell if the "rate 0bit 0pps" is a real estimation, or a fake
> one (because no estimator is active)
>
> After this patch, tc command output is :
> $ tc -s -d qdisc
> qdisc pfifo_fast 0: dev eth0 root bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
> Sent 561075 bytes 1196 pkt (dropped 0, overlimits 0 requeues 0)
> backlog 0b 0p requeues 0
>
> We add a parameter to gnet_stats_copy_rate_est() function so that
> it can use gen_estimator_active(bstats, r), as suggested by Jarek.
>
> This parameter can be NULL if check is not necessary, (htb for
> example has a mandatory rate estimator)
>
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
> ---
> include/net/gen_stats.h | 1 +
> net/core/gen_stats.c | 7 ++++++-
> net/sched/act_api.c | 2 +-
> net/sched/sch_api.c | 2 +-
> net/sched/sch_cbq.c | 2 +-
> net/sched/sch_drr.c | 2 +-
> net/sched/sch_hfsc.c | 2 +-
> net/sched/sch_htb.c | 2 +-
> 8 files changed, 13 insertions(+), 7 deletions(-)
>
> diff --git a/include/net/gen_stats.h b/include/net/gen_stats.h
> index c148855..eb87a14 100644
> --- a/include/net/gen_stats.h
> +++ b/include/net/gen_stats.h
> @@ -30,6 +30,7 @@ extern int gnet_stats_start_copy_compat(struct sk_buff *skb, int type,
> extern int gnet_stats_copy_basic(struct gnet_dump *d,
> struct gnet_stats_basic_packed *b);
> extern int gnet_stats_copy_rate_est(struct gnet_dump *d,
> + const struct gnet_stats_basic_packed *b,
> struct gnet_stats_rate_est *r);
> extern int gnet_stats_copy_queue(struct gnet_dump *d,
> struct gnet_stats_queue *q);
> diff --git a/net/core/gen_stats.c b/net/core/gen_stats.c
> index 8569310..054a49c 100644
> --- a/net/core/gen_stats.c
> +++ b/net/core/gen_stats.c
> @@ -136,8 +136,13 @@ gnet_stats_copy_basic(struct gnet_dump *d, struct gnet_stats_basic_packed *b)
> * if the room in the socket buffer was not sufficient.
> */
> int
> -gnet_stats_copy_rate_est(struct gnet_dump *d, struct gnet_stats_rate_est *r)
> +gnet_stats_copy_rate_est(struct gnet_dump *d,
> + const struct gnet_stats_basic_packed *b,
> + struct gnet_stats_rate_est *r)
> {
> + if (b && !gen_estimator_active(b, r))
> + return 0;
> +
> if (d->compat_tc_stats) {
> d->tc_stats.bps = r->bps;
> d->tc_stats.pps = r->pps;
> diff --git a/net/sched/act_api.c b/net/sched/act_api.c
> index 2dfb3e7..2b0d5ee 100644
> --- a/net/sched/act_api.c
> +++ b/net/sched/act_api.c
> @@ -618,7 +618,7 @@ int tcf_action_copy_stats(struct sk_buff *skb, struct tc_action *a,
> goto errout;
>
> if (gnet_stats_copy_basic(&d, &h->tcf_bstats) < 0 ||
> - gnet_stats_copy_rate_est(&d, &h->tcf_rate_est) < 0 ||
> + gnet_stats_copy_rate_est(&d, &h->tcf_bstats, &h->tcf_rate_est) < 0 ||
> gnet_stats_copy_queue(&d, &h->tcf_qstats) < 0)
> goto errout;
>
> diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
> index 903e418..1acfd29 100644
> --- a/net/sched/sch_api.c
> +++ b/net/sched/sch_api.c
> @@ -1179,7 +1179,7 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid,
> goto nla_put_failure;
>
> if (gnet_stats_copy_basic(&d, &q->bstats) < 0 ||
> - gnet_stats_copy_rate_est(&d, &q->rate_est) < 0 ||
> + gnet_stats_copy_rate_est(&d, &q->bstats, &q->rate_est) < 0 ||
> gnet_stats_copy_queue(&d, &q->qstats) < 0)
> goto nla_put_failure;
>
> diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
> index 5b132c4..3846d65 100644
> --- a/net/sched/sch_cbq.c
> +++ b/net/sched/sch_cbq.c
> @@ -1609,7 +1609,7 @@ cbq_dump_class_stats(struct Qdisc *sch, unsigned long arg,
> cl->xstats.undertime = cl->undertime - q->now;
>
> if (gnet_stats_copy_basic(d, &cl->bstats) < 0 ||
> - gnet_stats_copy_rate_est(d, &cl->rate_est) < 0 ||
> + gnet_stats_copy_rate_est(d, &cl->bstats, &cl->rate_est) < 0 ||
> gnet_stats_copy_queue(d, &cl->qstats) < 0)
> return -1;
>
> diff --git a/net/sched/sch_drr.c b/net/sched/sch_drr.c
> index 5a888af..a65604f 100644
> --- a/net/sched/sch_drr.c
> +++ b/net/sched/sch_drr.c
> @@ -280,7 +280,7 @@ static int drr_dump_class_stats(struct Qdisc *sch, unsigned long arg,
> }
>
> if (gnet_stats_copy_basic(d, &cl->bstats) < 0 ||
> - gnet_stats_copy_rate_est(d, &cl->rate_est) < 0 ||
> + gnet_stats_copy_rate_est(d, &cl->bstats, &cl->rate_est) < 0 ||
> gnet_stats_copy_queue(d, &cl->qdisc->qstats) < 0)
> return -1;
>
> diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
> index 2c5c76b..b38b39c 100644
> --- a/net/sched/sch_hfsc.c
> +++ b/net/sched/sch_hfsc.c
> @@ -1375,7 +1375,7 @@ hfsc_dump_class_stats(struct Qdisc *sch, unsigned long arg,
> xstats.rtwork = cl->cl_cumul;
>
> if (gnet_stats_copy_basic(d, &cl->bstats) < 0 ||
> - gnet_stats_copy_rate_est(d, &cl->rate_est) < 0 ||
> + gnet_stats_copy_rate_est(d, &cl->bstats, &cl->rate_est) < 0 ||
> gnet_stats_copy_queue(d, &cl->qstats) < 0)
> return -1;
>
> diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
> index 85acab9..2e38d1a 100644
> --- a/net/sched/sch_htb.c
> +++ b/net/sched/sch_htb.c
> @@ -1105,7 +1105,7 @@ htb_dump_class_stats(struct Qdisc *sch, unsigned long arg, struct gnet_dump *d)
> cl->xstats.ctokens = cl->ctokens;
>
> if (gnet_stats_copy_basic(d, &cl->bstats) < 0 ||
> - gnet_stats_copy_rate_est(d, &cl->rate_est) < 0 ||
> + gnet_stats_copy_rate_est(d, NULL, &cl->rate_est) < 0 ||
> gnet_stats_copy_queue(d, &cl->qstats) < 0)
> return -1;
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* Re: [PATCH] net: export device speed and duplex via sysfs
From: Andy Gospodarek @ 2009-10-02 20:01 UTC (permalink / raw)
To: Ben Hutchings; +Cc: netdev
In-Reply-To: <1254507554.8795.12.camel@achroite>
On Fri, Oct 02, 2009 at 07:19:14PM +0100, Ben Hutchings wrote:
> On Fri, 2009-10-02 at 14:07 -0400, Andy Gospodarek wrote:
> > This exports the link-speed (in Mbps) and duplex of an interface via
> > sysfs. This eliminates the need to use ethtool just to check the
> > link-speed. Not requiring 'ethtool' and not relying on the SIOCETHTOOL
> > ioctl should be helpful in an embedded environment where space is at a
> > premium as well.
>
> It's trivial to write an ethtool-lite that does this. That might be
> worth adding to busybox.
>
It probably would be. I was just using this as an example of another
use for it. Embedded usage was not the primary purpose.
> > NOTE: This patch also intentionally allows non-root users to check the link
> > speed and duplex -- something not possible with ethtool.
> [...]
>
> Assuming this is desirable (I'm not sure), wouldn't it would make more
> sense to move the permissions check for SIOCETHTOOL so that get_settings
> is non-privileged?
>
That could be done as well I just chose to go a slightly different
direction.
I took a look at /sys/class/net/ethX/ and felt like the information was
pretty complete with the exception of the link speed and duplex, so I
thought it would be a good place to add it. I personally wouldn't mind
having most of the information presented in ethtool available via sysfs,
but I figured I would walk before running.
^ permalink raw reply
* New qdisc monitor
From: clownix @ 2009-10-02 16:41 UTC (permalink / raw)
To: netdev
At http://clownix.net, there is a qdisc monitor based on a new sched
qdisc named spy and a module that periodicaly sends the
enqueues/dequeues/drops/queue-size/delays... to be plotted to the user
world through a netlink socket.
Note that the name of this software package is "clownix_spy", and not
cloonix_net which is another project on the same site.
Regards
Vincent Perrier
^ permalink raw reply
* Re: [PATCH v2] net: export device speed and duplex via sysfs
From: Andy Gospodarek @ 2009-10-02 19:26 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev
In-Reply-To: <4AC6432C.1020202@gmail.com>
On Fri, Oct 02, 2009 at 08:15:08PM +0200, Eric Dumazet wrote:
> Andy Gospodarek a écrit :
> > +static ssize_t show_speed(struct device *dev,
> > + struct device_attribute *attr, char *buf)
> > +{
> > + struct net_device *netdev = to_net_dev(dev);
> > + int ret = -EINVAL;
> > +
> > + if (!rtnl_trylock())
> > + return restart_syscall();
> > +
> > + if (netif_running(netdev) && netdev->ethtool_ops->get_settings) {
> > + struct ethtool_cmd cmd = { ETHTOOL_GSET };
> > +
> > + if (netdev->ethtool_ops->get_settings(netdev, &cmd) < 0)
>
> rtnl lock leak ?
>
>
> > + return -EINVAL;
> > + ret = sprintf(buf, fmt_dec, cmd.speed);
> > + }
> > + rtnl_unlock();
> > + return ret;
> > +}
> > +
> > +static ssize_t show_duplex(struct device *dev,
> > + struct device_attribute *attr, char *buf)
> > +{
> > + struct net_device *netdev = to_net_dev(dev);
> > + int ret = -EINVAL;
> > +
> > + if (!rtnl_trylock())
> > + return restart_syscall();
> > +
> > + if (netif_running(netdev) && netdev->ethtool_ops->get_settings) {
> > + struct ethtool_cmd cmd = { ETHTOOL_GSET };
> > +
> > + if (netdev->ethtool_ops->get_settings(netdev, &cmd) < 0)
>
> rtnl lock leak ?
>
> > + return -EINVAL;
> > + ret = sprintf(buf, "%s\n", cmd.duplex ? "full" : "half");
> > + }
> > + rtnl_unlock();
> > + return ret;
> > +}
> > +
>
Thanks for spotting that, Eric. Here's an updated (and tested patch).
I also switched to using ethtool_cmd_speed to get link speed to get the
'entire' speed.
[PATCH] net: export device speed and duplex via sysfs
This patch exports the link-speed (in Mbps) and duplex of an interface
via sysfs. This eliminates the need to use ethtool just to check the
link-speed. Not requiring 'ethtool' and not relying on the SIOCETHTOOL
ioctl should be helpful in an embedded environment where space is at a
premium as well.
NOTE: This patch also intentionally allows non-root users to check the link
speed and duplex -- something not possible with ethtool.
Here's some sample output:
# cat /sys/class/net/eth0/speed
100
# cat /sys/class/net/eth0/duplex
half
# ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: Not reported
Advertised auto-negotiation: No
Speed: 100Mb/s
Duplex: Half
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: off
Supports Wake-on: g
Wake-on: g
Current message level: 0x000000ff (255)
Link detected: yes
---
net/core/net-sysfs.c | 40 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 40 insertions(+), 0 deletions(-)
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 3994680..133dbc4 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -130,6 +130,44 @@ static ssize_t show_carrier(struct device *dev,
return -EINVAL;
}
+static ssize_t show_speed(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct net_device *netdev = to_net_dev(dev);
+ int ret = -EINVAL;
+
+ if (!rtnl_trylock())
+ return restart_syscall();
+
+ if (netif_running(netdev) && netdev->ethtool_ops->get_settings) {
+ struct ethtool_cmd cmd = { ETHTOOL_GSET };
+
+ if (!netdev->ethtool_ops->get_settings(netdev, &cmd))
+ ret = sprintf(buf, fmt_dec, ethtool_cmd_speed(&cmd));
+ }
+ rtnl_unlock();
+ return ret;
+}
+
+static ssize_t show_duplex(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct net_device *netdev = to_net_dev(dev);
+ int ret = -EINVAL;
+
+ if (!rtnl_trylock())
+ return restart_syscall();
+
+ if (netif_running(netdev) && netdev->ethtool_ops->get_settings) {
+ struct ethtool_cmd cmd = { ETHTOOL_GSET };
+
+ if (!netdev->ethtool_ops->get_settings(netdev, &cmd))
+ ret = sprintf(buf, "%s\n", cmd.duplex ? "full" : "half");
+ }
+ rtnl_unlock();
+ return ret;
+}
+
static ssize_t show_dormant(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -259,6 +297,8 @@ static struct device_attribute net_class_attributes[] = {
__ATTR(address, S_IRUGO, show_address, NULL),
__ATTR(broadcast, S_IRUGO, show_broadcast, NULL),
__ATTR(carrier, S_IRUGO, show_carrier, NULL),
+ __ATTR(speed, S_IRUGO, show_speed, NULL),
+ __ATTR(duplex, S_IRUGO, show_duplex, NULL),
__ATTR(dormant, S_IRUGO, show_dormant, NULL),
__ATTR(operstate, S_IRUGO, show_operstate, NULL),
__ATTR(mtu, S_IRUGO | S_IWUSR, show_mtu, store_mtu),
^ permalink raw reply related
* [net-2.6 PATCH 2/2] ixgbe: add support for 82599 based X520 10G Dual KX4 Mezz card
From: Jeff Kirsher @ 2009-10-02 18:58 UTC (permalink / raw)
To: davem; +Cc: netdev, gospo, Don Skidmore, Peter P Waskiewicz Jr, Jeff Kirsher
In-Reply-To: <20091002185803.8771.46655.stgit@localhost.localdomain>
From: Don Skidmore <donald.c.skidmore@intel.com>
This patch adds device support for the 82599 based X520 10GbE
Dual Port KX4 Mezzanine card.
Signed-off-by: Don Skidmore<donald.c.skidmore@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ixgbe/ixgbe_82599.c | 1 +
drivers/net/ixgbe/ixgbe_main.c | 2 ++
drivers/net/ixgbe/ixgbe_type.h | 1 +
3 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c
index bb87c43..34b0492 100644
--- a/drivers/net/ixgbe/ixgbe_82599.c
+++ b/drivers/net/ixgbe/ixgbe_82599.c
@@ -330,6 +330,7 @@ static enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw)
switch (hw->device_id) {
case IXGBE_DEV_ID_82599_KX4:
+ case IXGBE_DEV_ID_82599_KX4_MEZZ:
case IXGBE_DEV_ID_82599_COMBO_BACKPLANE:
case IXGBE_DEV_ID_82599_XAUI_LOM:
/* Default device ID is mezzanine card KX/KX4 */
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index dc4afa5..1a2eb79 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -97,6 +97,8 @@ static struct pci_device_id ixgbe_pci_tbl[] = {
board_82599 },
{PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_SFP),
board_82599 },
+ {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_KX4_MEZZ),
+ board_82599 },
{PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_CX4),
board_82599 },
{PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_COMBO_BACKPLANE),
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h
index a71f712..ef4bdd5 100644
--- a/drivers/net/ixgbe/ixgbe_type.h
+++ b/drivers/net/ixgbe/ixgbe_type.h
@@ -49,6 +49,7 @@
#define IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM 0x10E1
#define IXGBE_DEV_ID_82598EB_XF_LR 0x10F4
#define IXGBE_DEV_ID_82599_KX4 0x10F7
+#define IXGBE_DEV_ID_82599_KX4_MEZZ 0x1514
#define IXGBE_DEV_ID_82599_CX4 0x10F9
#define IXGBE_DEV_ID_82599_SFP 0x10FB
#define IXGBE_DEV_ID_82599_XAUI_LOM 0x10FC
^ permalink raw reply related
* [net-2.6 PATCH 1/2] ixgbe: add support for 82599 Combined Backplane
From: Jeff Kirsher @ 2009-10-02 18:58 UTC (permalink / raw)
To: davem; +Cc: netdev, gospo, Don Skidmore, Peter P Waskiewicz Jr, Jeff Kirsher
From: Don Skidmore <donald.c.skidmore@intel.com>
This patch will add support for the 82599 Dual port Backplane
device (0x10f8). This device has the ability to link in serial (KR) and
parallel (KX4/KX) modes, depending on what the switch capabilities are in
the blade chassis.
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ixgbe/ixgbe_82599.c | 1 +
drivers/net/ixgbe/ixgbe_main.c | 2 ++
drivers/net/ixgbe/ixgbe_type.h | 1 +
3 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c
index 2ec58dc..bb87c43 100644
--- a/drivers/net/ixgbe/ixgbe_82599.c
+++ b/drivers/net/ixgbe/ixgbe_82599.c
@@ -330,6 +330,7 @@ static enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw)
switch (hw->device_id) {
case IXGBE_DEV_ID_82599_KX4:
+ case IXGBE_DEV_ID_82599_COMBO_BACKPLANE:
case IXGBE_DEV_ID_82599_XAUI_LOM:
/* Default device ID is mezzanine card KX/KX4 */
media_type = ixgbe_media_type_backplane;
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 1cbc6a3..dc4afa5 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -99,6 +99,8 @@ static struct pci_device_id ixgbe_pci_tbl[] = {
board_82599 },
{PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_CX4),
board_82599 },
+ {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_COMBO_BACKPLANE),
+ board_82599 },
/* required last entry */
{0, }
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h
index 7c93e92..a71f712 100644
--- a/drivers/net/ixgbe/ixgbe_type.h
+++ b/drivers/net/ixgbe/ixgbe_type.h
@@ -52,6 +52,7 @@
#define IXGBE_DEV_ID_82599_CX4 0x10F9
#define IXGBE_DEV_ID_82599_SFP 0x10FB
#define IXGBE_DEV_ID_82599_XAUI_LOM 0x10FC
+#define IXGBE_DEV_ID_82599_COMBO_BACKPLANE 0x10F8
/* General Registers */
#define IXGBE_CTRL 0x00000
^ permalink raw reply related
* Re: [PATCH 0/8] SECURITY ISSUE with connector
From: Greg KH @ 2009-10-02 18:15 UTC (permalink / raw)
To: David Miller
Cc: philipp.reisner, linux-kernel, netdev, akpm, dm-devel, zbr,
linux-fbdev-devel
In-Reply-To: <20091002.110504.08207839.davem@davemloft.net>
On Fri, Oct 02, 2009 at 11:05:04AM -0700, David Miller wrote:
> From: Greg KH <greg@kroah.com>
> Date: Fri, 2 Oct 2009 11:00:22 -0700
>
> > On Fri, Oct 02, 2009 at 10:56:59AM -0700, David Miller wrote:
> >> All applied to net-2.6, I'll push this out to Linus later
> >> today.
> >
> > Should it also go to -stable? If so, I can pick it up once it hits
> > Linus's tree.
>
> Yes, please take it into -stable.
Will do.
> Greg, I'll also send you a batch of other networking bits
> for -stable later this afternoon as well, just FYI...
Great, I'll queue it up for the next -stable releases, these are full
enough as it is already :)
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH] net: export device speed and duplex via sysfs
From: Ben Hutchings @ 2009-10-02 18:19 UTC (permalink / raw)
To: Andy Gospodarek; +Cc: netdev
In-Reply-To: <20091002180742.GH4436@gospo.rdu.redhat.com>
On Fri, 2009-10-02 at 14:07 -0400, Andy Gospodarek wrote:
> This exports the link-speed (in Mbps) and duplex of an interface via
> sysfs. This eliminates the need to use ethtool just to check the
> link-speed. Not requiring 'ethtool' and not relying on the SIOCETHTOOL
> ioctl should be helpful in an embedded environment where space is at a
> premium as well.
It's trivial to write an ethtool-lite that does this. That might be
worth adding to busybox.
> NOTE: This patch also intentionally allows non-root users to check the link
> speed and duplex -- something not possible with ethtool.
[...]
Assuming this is desirable (I'm not sure), wouldn't it would make more
sense to move the permissions check for SIOCETHTOOL so that get_settings
is non-privileged?
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* [PATCH] Use sk_mark for IPv6 routing lookups
From: Brian Haley @ 2009-10-02 18:19 UTC (permalink / raw)
To: Maciej Żenczykowski
Cc: Eric Dumazet, David Miller, atis, panther, netdev
In-Reply-To: <55a4f86e0910021025u7523029av1e4ee917d1fb1ee5@mail.gmail.com>
Maciej Żenczykowski wrote:
> Cool!
>
> As I've already pointed out in a post 2 or so weeks ago, we need the
> exact same treatment in a ton of places throughout the code (tcp,
> ipv6, decnet, etc...).
Here's a try at the IPv6 part...
Add support for IPv6 route lookups using sk_mark.
Signed-off-by: Brian Haley <brian.haley@hp.com>
---
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index e2bdc6d..a615b4d 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -147,6 +147,7 @@ ipv4_connected:
ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
ipv6_addr_copy(&fl.fl6_src, &np->saddr);
fl.oif = sk->sk_bound_dev_if;
+ fl.mark = sk->sk_mark;
fl.fl_ip_dport = inet->dport;
fl.fl_ip_sport = inet->sport;
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
index cc4797d..a9f4a21 100644
--- a/net/ipv6/inet6_connection_sock.c
+++ b/net/ipv6/inet6_connection_sock.c
@@ -194,6 +194,7 @@ int inet6_csk_xmit(struct sk_buff *skb, int ipfragok)
fl.fl6_flowlabel = np->flow_label;
IP6_ECN_flow_xmit(sk, fl.fl6_flowlabel);
fl.oif = sk->sk_bound_dev_if;
+ fl.mark = sk->sk_mark;
fl.fl_ip_sport = inet->sport;
fl.fl_ip_dport = inet->dport;
security_sk_classify_flow(sk, &fl);
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 7161539..d98df54 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -1523,6 +1523,7 @@ static int ip6mr_forward2(struct sk_buff *skb, struct mfc6_cache *c, int vifi)
fl = (struct flowi) {
.oif = vif->link,
+ .mark = skb->mark,
.nl_u = { .ip6_u =
{ .daddr = ipv6h->daddr, }
}
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 14f54eb..dc0f736 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -424,6 +424,7 @@ sticky_done:
fl.fl6_flowlabel = 0;
fl.oif = sk->sk_bound_dev_if;
+ fl.mark = sk->sk_mark;
if (optlen == 0)
goto update;
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index dbd19a7..03a64c1 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -629,6 +629,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
.saddr = tiph->saddr,
.tos = RT_TOS(tos) } },
.oif = tunnel->parms.link,
+ .mark = skb->mark,
.proto = IPPROTO_IPV6 };
if (ip_route_output_key(dev_net(dev), &rt, &fl)) {
stats->tx_carrier_errors++;
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 21d100b..321aafd 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -243,6 +243,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
ipv6_addr_copy(&fl.fl6_src,
(saddr ? saddr : &np->saddr));
fl.oif = sk->sk_bound_dev_if;
+ fl.mark = sk->sk_mark;
fl.fl_ip_dport = usin->sin6_port;
fl.fl_ip_sport = inet->sport;
@@ -383,6 +384,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
ipv6_addr_copy(&fl.fl6_src, &np->saddr);
fl.oif = sk->sk_bound_dev_if;
+ fl.mark = sk->sk_mark;
fl.fl_ip_dport = inet->dport;
fl.fl_ip_sport = inet->sport;
security_skb_classify_flow(skb, &fl);
@@ -477,6 +479,7 @@ static int tcp_v6_send_synack(struct sock *sk, struct request_sock *req)
ipv6_addr_copy(&fl.fl6_src, &treq->loc_addr);
fl.fl6_flowlabel = 0;
fl.oif = treq->iif;
+ fl.mark = sk->sk_mark;
fl.fl_ip_dport = inet_rsk(req)->rmt_port;
fl.fl_ip_sport = inet_rsk(req)->loc_port;
security_req_classify_flow(req, &fl);
@@ -1345,6 +1348,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
}
ipv6_addr_copy(&fl.fl6_src, &treq->loc_addr);
fl.oif = sk->sk_bound_dev_if;
+ fl.mark = sk->sk_mark;
fl.fl_ip_dport = inet_rsk(req)->rmt_port;
fl.fl_ip_sport = inet_rsk(req)->loc_port;
security_req_classify_flow(req, &fl);
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 3a60f12..3842c55 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -879,6 +879,8 @@ do_udp_sendmsg:
if (!fl.oif)
fl.oif = np->sticky_pktinfo.ipi6_ifindex;
+ fl.mark = sk->sk_mark;
+
if (msg->msg_controllen) {
opt = &opt_space;
memset(opt, 0, sizeof(struct ipv6_txoptions));
^ permalink raw reply related
* Re: [PATCH] net: export device speed and duplex via sysfs
From: Eric Dumazet @ 2009-10-02 18:15 UTC (permalink / raw)
To: Andy Gospodarek; +Cc: netdev
In-Reply-To: <20091002180742.GH4436@gospo.rdu.redhat.com>
Andy Gospodarek a écrit :
> +static ssize_t show_speed(struct device *dev,
> + struct device_attribute *attr, char *buf)
> +{
> + struct net_device *netdev = to_net_dev(dev);
> + int ret = -EINVAL;
> +
> + if (!rtnl_trylock())
> + return restart_syscall();
> +
> + if (netif_running(netdev) && netdev->ethtool_ops->get_settings) {
> + struct ethtool_cmd cmd = { ETHTOOL_GSET };
> +
> + if (netdev->ethtool_ops->get_settings(netdev, &cmd) < 0)
rtnl lock leak ?
> + return -EINVAL;
> + ret = sprintf(buf, fmt_dec, cmd.speed);
> + }
> + rtnl_unlock();
> + return ret;
> +}
> +
> +static ssize_t show_duplex(struct device *dev,
> + struct device_attribute *attr, char *buf)
> +{
> + struct net_device *netdev = to_net_dev(dev);
> + int ret = -EINVAL;
> +
> + if (!rtnl_trylock())
> + return restart_syscall();
> +
> + if (netif_running(netdev) && netdev->ethtool_ops->get_settings) {
> + struct ethtool_cmd cmd = { ETHTOOL_GSET };
> +
> + if (netdev->ethtool_ops->get_settings(netdev, &cmd) < 0)
rtnl lock leak ?
> + return -EINVAL;
> + ret = sprintf(buf, "%s\n", cmd.duplex ? "full" : "half");
> + }
> + rtnl_unlock();
> + return ret;
> +}
> +
^ permalink raw reply
* [GIT]: Networking
From: David Miller @ 2009-10-02 18:13 UTC (permalink / raw)
To: torvalds; +Cc: akpm, netdev, linux-kernel
1) connector credentials fix patch set from Philipp Reisner
2) IXGBE bug fixes from Peter P Waskiewicz Jr,Ben Greear,
and Jiri Pirko.
3) sk->sk_mark not used consistently for routing lookups keys,
fix from Atis Elsts
4) splice() nonblocking fix, from Eric Dumazet
5) pktgen delay handling regressed, fix from Eric Dumazet
6) ks8851_mll ethernet driver, from David Choi
7) TCP build warning fix from Andrew Morton
8) be2net RX completion bug workaround from Ajit Khaparde
9) Bonding doesn't set primary param properly, fix from Jiri Pirko.
10) Even if window scale is zero, TCP should advertise the option
so that the other ends knows we support window scaling and thus
they can advertise a non-zero scale if they want to.
From Ori Finkelman.
11) qlge bug fixes from Ron Mercer.
12) SKY2 and SKGE irq names can conflict because the IRQ manages two devices
and if one of them gets it's name changed just right (by udev
or whatever) the request_irq() fails. Fix from Stephen Hemminger
and Michal Schmidt.
13) Wireless bug fixes via John Linville.
Please pull, thanks a lot!
The following changes since commit 817b33d38f81c8736d39283c35c886ae4668f1af:
Linus Torvalds (1):
Merge git://git.kernel.org/.../davem/net-2.6
are available in the git repository at:
master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6.git master
Ajit Khaparde (1):
be2net: Workaround to fix a bug in Rx Completion processing.
Andrew Morton (1):
net/ipv4/tcp.c: fix min() type mismatch warning
Anton Vorontsov (1):
3c59x: Rework suspend and resume
Atis Elsts (1):
net: Use sk_mark for routing lookup in more places
Ben Greear (1):
ixgbe patch to provide NIC's tx/rx counters via ethtool
Choi, David (1):
drivers/net: ks8851_mll ethernet network driver
Christian Lamparter (1):
ar9170: fix bug in iq-auto calibration value calculation
David S. Miller (1):
Merge branch 'master' of git://git.kernel.org/.../linville/wireless-2.6
Eric Dumazet (3):
pktgen: Fix delay handling
tg3: Remove prev_vlan_tag from struct tx_ring_info
net: splice() from tcp to pipe should take into account O_NONBLOCK
Frans Pop (1):
e1000e/igb/ixgbe: Don't report an error if devices don't support AER
Igor Perminov (1):
mac80211: Fix [re]association power saving issue on AP side
Jean Delvare (1):
net: Fix wrong sizeof
Jiri Pirko (2):
ixgbe: correct the parameter description
bonding: set primary param via sysfs
Jouni Malinen (1):
mac80211_hwsim: Fix initial beacon timer configuration
Michael Buesch (1):
b43: Always use block-I/O for the PIO data registers
Michael Chan (1):
cnic: Fix NETDEV_UP event processing.
Michal Schmidt (1):
skge: use unique IRQ name
Michal Szalata (1):
rt2x00: Thrustmaster FunAccess WIFI USB and rt73usb
Mike McCormack (1):
skge: Make sure both ports initialize correctly
Ori Finkelman (1):
IPv4 TCP fails to send window scale option when window scale is zero
Peter P Waskiewicz Jr (4):
ixgbe: Fix disabling of relaxed ordering with Tx DCA
ixgbe: Fix backplane flow control autoneg
ixgbe: Bump driver version number
ixgbe: Remove ATR computation for UDP traffic
Philipp Reisner (8):
connector: Keep the skb in cn_callback_data
connector: Provide the sender's credentials to the callback
connector/dm: Fixed a compilation warning
connector: Removed the destruct_data callback since it is always kfree_skb()
dm/connector: Only process connector packages from privileged processes
dst/connector: Disallow unpliviged users to configure dst
pohmelfs/connector: Disallow unpliviged users to configure pohmelfs
uvesafb/connector: Disallow unpliviged users to send netlink packets
Ralf Baechle (2):
NET: mkiss: Fix typo
Kconfig: STRIP: Remove stale bits of STRIP help text
Ron Mercer (5):
qlge: Fix bad bit definitions.
qlge: Fix out of sync hardware semaphore.
qlge: Fix spin_lock warning.
qlge: Protect reset recovery with rtnl_lock().
qlge: Fix error exit for probe call.
Stephen Hemminger (1):
sky2: irqname based on pci address
Uwe Kleine-König (3):
don't use __devexit_p to wrap meth_remove
don't use __devexit_p to wrap sgiseeq_remove
move virtnet_remove to .devexit.text
roel kluin (1):
bcm63xx_enet: timeout off by one in do_mdio_op()
Documentation/connector/cn_test.c | 2 +-
Documentation/connector/connector.txt | 8 +-
.../networking/timestamping/timestamping.c | 2 +-
drivers/connector/cn_queue.c | 12 +-
drivers/connector/connector.c | 22 +-
drivers/md/dm-log-userspace-transfer.c | 6 +-
drivers/net/3c59x.c | 77 +-
drivers/net/Kconfig | 7 +
drivers/net/Makefile | 1 +
drivers/net/bcm63xx_enet.c | 2 +-
drivers/net/benet/be.h | 1 +
drivers/net/benet/be_cmds.c | 3 +-
drivers/net/benet/be_cmds.h | 3 +-
drivers/net/benet/be_main.c | 23 +-
drivers/net/bonding/bond_sysfs.c | 1 +
drivers/net/cnic.c | 3 +-
drivers/net/cnic_if.h | 4 +-
drivers/net/e1000e/netdev.c | 13 +-
drivers/net/hamradio/mkiss.c | 4 +-
drivers/net/igb/igb_main.c | 13 +-
drivers/net/iseries_veth.c | 2 +-
drivers/net/ixgbe/ixgbe_82598.c | 2 +-
drivers/net/ixgbe/ixgbe_common.c | 232 ++-
drivers/net/ixgbe/ixgbe_ethtool.c | 4 +
drivers/net/ixgbe/ixgbe_main.c | 52 +-
drivers/net/ixgbe/ixgbe_type.h | 9 +
drivers/net/ks8851_mll.c | 1697 ++++++++++++++++++++
drivers/net/meth.c | 2 +-
drivers/net/qlge/qlge.h | 18 +-
drivers/net/qlge/qlge_main.c | 26 +-
drivers/net/sgiseeq.c | 2 +-
drivers/net/skge.c | 16 +-
drivers/net/skge.h | 2 +
drivers/net/sky2.c | 7 +-
drivers/net/sky2.h | 2 +
drivers/net/tg3.h | 1 -
drivers/net/virtio_net.c | 2 +-
drivers/net/wireless/Kconfig | 13 +-
drivers/net/wireless/ath/ar9170/phy.c | 6 +-
drivers/net/wireless/b43/pio.c | 60 +-
drivers/net/wireless/mac80211_hwsim.c | 3 +
drivers/net/wireless/rt2x00/rt73usb.c | 1 +
drivers/staging/dst/dcore.c | 7 +-
drivers/staging/pohmelfs/config.c | 5 +-
drivers/video/uvesafb.c | 5 +-
drivers/w1/w1_netlink.c | 2 +-
include/linux/connector.h | 11 +-
net/core/pktgen.c | 6 +-
net/ipv4/af_inet.c | 1 +
net/ipv4/ip_output.c | 1 +
net/ipv4/tcp.c | 4 +-
net/ipv4/tcp_output.c | 11 +-
net/ipv4/udp.c | 1 +
net/mac80211/tx.c | 5 +-
54 files changed, 2157 insertions(+), 268 deletions(-)
create mode 100644 drivers/net/ks8851_mll.c
^ permalink raw reply
* [PATCH] net: export device speed and duplex via sysfs
From: Andy Gospodarek @ 2009-10-02 18:07 UTC (permalink / raw)
To: netdev
This exports the link-speed (in Mbps) and duplex of an interface via
sysfs. This eliminates the need to use ethtool just to check the
link-speed. Not requiring 'ethtool' and not relying on the SIOCETHTOOL
ioctl should be helpful in an embedded environment where space is at a
premium as well.
NOTE: This patch also intentionally allows non-root users to check the link
speed and duplex -- something not possible with ethtool.
Here's some sample output:
# cat /sys/class/net/eth0/speed
100
# cat /sys/class/net/eth0/duplex
half
# ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: Not reported
Advertised auto-negotiation: No
Speed: 100Mb/s
Duplex: Half
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: off
Supports Wake-on: g
Wake-on: g
Current message level: 0x000000ff (255)
Link detected: yes
Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
---
net/core/net-sysfs.c | 42 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 42 insertions(+), 0 deletions(-)
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index ad91e9e..d5964b2 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -130,6 +130,46 @@ static ssize_t show_carrier(struct device *dev,
return -EINVAL;
}
+static ssize_t show_speed(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct net_device *netdev = to_net_dev(dev);
+ int ret = -EINVAL;
+
+ if (!rtnl_trylock())
+ return restart_syscall();
+
+ if (netif_running(netdev) && netdev->ethtool_ops->get_settings) {
+ struct ethtool_cmd cmd = { ETHTOOL_GSET };
+
+ if (netdev->ethtool_ops->get_settings(netdev, &cmd) < 0)
+ return -EINVAL;
+ ret = sprintf(buf, fmt_dec, cmd.speed);
+ }
+ rtnl_unlock();
+ return ret;
+}
+
+static ssize_t show_duplex(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct net_device *netdev = to_net_dev(dev);
+ int ret = -EINVAL;
+
+ if (!rtnl_trylock())
+ return restart_syscall();
+
+ if (netif_running(netdev) && netdev->ethtool_ops->get_settings) {
+ struct ethtool_cmd cmd = { ETHTOOL_GSET };
+
+ if (netdev->ethtool_ops->get_settings(netdev, &cmd) < 0)
+ return -EINVAL;
+ ret = sprintf(buf, "%s\n", cmd.duplex ? "full" : "half");
+ }
+ rtnl_unlock();
+ return ret;
+}
+
static ssize_t show_dormant(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -259,6 +299,8 @@ static struct device_attribute net_class_attributes[] = {
__ATTR(address, S_IRUGO, show_address, NULL),
__ATTR(broadcast, S_IRUGO, show_broadcast, NULL),
__ATTR(carrier, S_IRUGO, show_carrier, NULL),
+ __ATTR(speed, S_IRUGO, show_speed, NULL),
+ __ATTR(duplex, S_IRUGO, show_duplex, NULL),
__ATTR(dormant, S_IRUGO, show_dormant, NULL),
__ATTR(operstate, S_IRUGO, show_operstate, NULL),
__ATTR(mtu, S_IRUGO | S_IWUSR, show_mtu, store_mtu),
--
1.6.2.5
^ permalink raw reply related
* Re: Splice on blocking TCP sockets again..
From: Eric Dumazet @ 2009-10-02 18:05 UTC (permalink / raw)
To: Jason Gunthorpe; +Cc: Volker Lendecke, netdev, Volker Lendecke
In-Reply-To: <20091002171029.GG5191@obsidianresearch.com>
Jason Gunthorpe a écrit :
>
> I'd suggest a construct like the following as a compatability
> solution:
>
> struct pollfd pfd = {.fd = tcpfd, events = POLLIN | POLLRDHUP};
> while (..) {
> rc = splice(tcpfd,0,pfd[1],0,count,SPLICE_F_MOVE | SPLICE_F_NONBLOCK);
> if (rc == -1)
> //...
> if (rc == 0) {
> if (pfd.revents & POLLRDHUP)
> // oops, EOF on TCP
>
> /* Might be an old kernel that nonblocks on TCP, have to check
> if this is EOF or do blocking. */
> rc = poll(&pfd,1,-1);
> if (rc == -1)
> //...
> }
>
> rc = splice(pfd[0],0,ofd,0,..., SPLICE_F_MOVE)
> }
>
> Which should add no overhead in the new splice blocks case, and falls
> back gracefully on older kernels..
>
Agreed, thanks for the tip.
Indeed, new kernel will permit a loop with only splice() syscalls, while on an old
kernel, some poll() syscalls might be needed if tcp socket is empty.
^ permalink raw reply
* Re: [PATCH 0/8] SECURITY ISSUE with connector
From: David Miller @ 2009-10-02 18:05 UTC (permalink / raw)
To: greg
Cc: linux-fbdev-devel, netdev, philipp.reisner, linux-kernel,
dm-devel, zbr, akpm
In-Reply-To: <20091002180022.GA22229@kroah.com>
From: Greg KH <greg@kroah.com>
Date: Fri, 2 Oct 2009 11:00:22 -0700
> On Fri, Oct 02, 2009 at 10:56:59AM -0700, David Miller wrote:
>> All applied to net-2.6, I'll push this out to Linus later
>> today.
>
> Should it also go to -stable? If so, I can pick it up once it hits
> Linus's tree.
Yes, please take it into -stable.
Greg, I'll also send you a batch of other networking bits
for -stable later this afternoon as well, just FYI...
^ permalink raw reply
* Re: [PATCH] cnic: Fix NETDEV_UP event processing.
From: David Miller @ 2009-10-02 18:03 UTC (permalink / raw)
To: mchan; +Cc: netdev, michaelc, benli
In-Reply-To: <1254464254-32005-1-git-send-email-mchan@broadcom.com>
From: "Michael Chan" <mchan@broadcom.com>
Date: Thu, 1 Oct 2009 23:17:34 -0700
> This fixes the problem of not handling the NETDEV_UP event properly
> during hot-plug or modprobe of bnx2 after cnic. The handling was
> skipped by mistakenly using "else if" to check for the event.
>
> Also update version to 2.0.1.
>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
> Signed-off-by: Benjamin Li <benli@broadcom.com>
Applied, thanks Michael.
^ permalink raw reply
* Re: [PATCH 0/8] SECURITY ISSUE with connector
From: Greg KH @ 2009-10-02 18:00 UTC (permalink / raw)
To: David Miller
Cc: philipp.reisner, linux-kernel, netdev, akpm, dm-devel, zbr,
linux-fbdev-devel
In-Reply-To: <20091002.105659.102583702.davem@davemloft.net>
On Fri, Oct 02, 2009 at 10:56:59AM -0700, David Miller wrote:
> From: Philipp Reisner <philipp.reisner@linbit.com>
> Date: Fri, 2 Oct 2009 14:40:03 +0200
>
> > Affected: All code that uses connector, in kernel and out of mainline
> >
> > The connector, as it is today, does not allow the in kernel receiving
> > parts to do any checks on privileges of a message's sender.
> >
> > I know, there are not many out there that like connector, but as
> > long as it is in the kernel, we have to fix the security issues it has!
> >
> > Please either drop connector, or someone who feels a bit responsible
> > and has our beloved dictator's blessing, PLEASE PLEASE PLEASE take
> > this into your tree, and send the pull request to Linus.
> >
> > Patches 1 to 4 are already Acked-by Evgeny, the connector's maintainer.
> > Patches 5 to 7 are the obvious fixes to the connector user's code.
> >
> > For convenience these patches are also available as git tree:
> > git://git.drbd.org/linux-2.6-drbd.git connector-fix
>
> All applied to net-2.6, I'll push this out to Linus later
> today.
Should it also go to -stable? If so, I can pick it up once it hits
Linus's tree.
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH] Use sk_mark for routing lookup in more places
From: David Miller @ 2009-10-02 18:00 UTC (permalink / raw)
To: zenczykowski; +Cc: eric.dumazet, atis, panther, netdev
In-Reply-To: <55a4f86e0910021025u7523029av1e4ee917d1fb1ee5@mail.gmail.com>
From: Maciej Żenczykowski <zenczykowski@gmail.com>
Date: Fri, 2 Oct 2009 10:25:13 -0700
> Maybe it would make more sense to create some constructor-like
> functions for the flowi struct?
Maybe just an initializer like "FLOWI_SOCK(sk)" or similar.
So you can say:
struct flowi fl = FLOWI_SOCK(sk);
But the thing is we usually want to initialize all of the
details in one go, so we'd need a very messy macro for this
that would take many arguments.
It's important to use an initializer rather than assignments in some
inline function so that GCC can better coalesce many small members
into since large stores to the stack. It doesn't do this as well with
real assignment statements.
^ permalink raw reply
* Re: [PATCH 0/8] SECURITY ISSUE with connector
From: David Miller @ 2009-10-02 17:56 UTC (permalink / raw)
To: philipp.reisner
Cc: linux-kernel, netdev, akpm, greg, dm-devel, zbr,
linux-fbdev-devel
In-Reply-To: <1254487211-11810-1-git-send-email-philipp.reisner@linbit.com>
From: Philipp Reisner <philipp.reisner@linbit.com>
Date: Fri, 2 Oct 2009 14:40:03 +0200
> Affected: All code that uses connector, in kernel and out of mainline
>
> The connector, as it is today, does not allow the in kernel receiving
> parts to do any checks on privileges of a message's sender.
>
> I know, there are not many out there that like connector, but as
> long as it is in the kernel, we have to fix the security issues it has!
>
> Please either drop connector, or someone who feels a bit responsible
> and has our beloved dictator's blessing, PLEASE PLEASE PLEASE take
> this into your tree, and send the pull request to Linus.
>
> Patches 1 to 4 are already Acked-by Evgeny, the connector's maintainer.
> Patches 5 to 7 are the obvious fixes to the connector user's code.
>
> For convenience these patches are also available as git tree:
> git://git.drbd.org/linux-2.6-drbd.git connector-fix
All applied to net-2.6, I'll push this out to Linus later
today.
^ permalink raw reply
* Re: [PATCH] make TLLAO option for NA packets configurable
From: Stephen Hemminger @ 2009-10-02 17:53 UTC (permalink / raw)
To: Octavian Purdila; +Cc: David Miller, cratiu, netdev
In-Reply-To: <200910020119.47320.opurdila@ixiacom.com>
On Fri, 2 Oct 2009 01:19:47 +0300
Octavian Purdila <opurdila@ixiacom.com> wrote:
> On Thursday 01 October 2009 22:37:40 you wrote:
> > From: Stephen Hemminger <shemminger@vyatta.com>
> > Date: Thu, 1 Oct 2009 11:56:11 -0700
> >
> > > On Thu, 1 Oct 2009 21:39:32 +0300
> > >
> > > Octavian Purdila <opurdila@ixiacom.com> wrote:
> > >> On Thursday 01 October 2009 21:14:50 you wrote:
> > >> > Probably this should be a per interface property rather than per
> > >> > namespace.
> > >>
> > >> In our case, where we have lots of interfaces active, it would be nice
> > >> to have the per namespace property as well.
> > >
> > > The ipv6 control infrastructure already has that option. If you changed
> > > your patch to use a per-interface control then there would be:
> > >
> > > /proc/sys/net/ipv6/conf/all/force_tllao
> >
> > Right, this would work a lot better.
> >
>
> Here is v3 which also updates Documentation/networking/ip-sysctl.txt.
>
> Thanks,
> tavi
>
>
This is good although I would have shortened the name.
--
^ permalink raw reply
* Re: [PATCH] TCPCT-1: adding a sysctl
From: William Allen Simpson @ 2009-10-02 17:52 UTC (permalink / raw)
To: netdev
In-Reply-To: <4AC61505.8030701@gmail.com>
William Allen Simpson wrote:
> This is a straightforward re-implementation of an earlier patch, that no
> longer applies cleanly, that was reviewed:
>
> http://thread.gmane.org/gmane.linux.network/102586
>
In that thread, David Miller wrote:
"This looks mostly fine to me. I would even advocate not using a config
option for this."
It would make the code look cleaner, and with the sysctl instead, it
would probably be fine. But SYN cookies has both.
Before I go much further, I'd like guidance.
^ 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