* [PATCH 3/4 v4] net: Fix for dst_negative_advice
From: Krishna Kumar @ 2009-10-20 9:46 UTC (permalink / raw)
To: davem; +Cc: netdev, herbert, Krishna Kumar, dada1
In-Reply-To: <20091020094607.10404.81794.sendpatchset@localhost.localdomain>
From: Krishna Kumar <krkumar2@in.ibm.com>
dst_negative_advice() should check for changed dst and reset
sk_tx_queue_mapping accordingly. Pass sock to the callers of
dst_negative_advice.
(sk_reset_txq is defined just for use by dst_negative_advice. The
only way I could find to get around this is to move dst_negative_()
from dst.h to dst.c, include sock.h in dst.c, etc)
Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
---
include/net/dst.h | 12 ++++++++++--
net/core/sock.c | 6 ++++++
net/dccp/timer.c | 4 ++--
net/decnet/af_decnet.c | 2 +-
net/ipv4/tcp_timer.c | 4 ++--
5 files changed, 21 insertions(+), 7 deletions(-)
diff -ruNp org/include/net/dst.h new/include/net/dst.h
--- org/include/net/dst.h 2009-10-16 21:30:56.000000000 +0530
+++ new/include/net/dst.h 2009-10-16 21:31:30.000000000 +0530
@@ -222,11 +222,19 @@ static inline void dst_confirm(struct ds
neigh_confirm(dst->neighbour);
}
-static inline void dst_negative_advice(struct dst_entry **dst_p)
+static inline void dst_negative_advice(struct dst_entry **dst_p,
+ struct sock *sk)
{
struct dst_entry * dst = *dst_p;
- if (dst && dst->ops->negative_advice)
+ if (dst && dst->ops->negative_advice) {
*dst_p = dst->ops->negative_advice(dst);
+
+ if (dst != *dst_p) {
+ extern void sk_reset_txq(struct sock *sk);
+
+ sk_reset_txq(sk);
+ }
+ }
}
static inline void dst_link_failure(struct sk_buff *skb)
diff -ruNp org/net/core/sock.c new/net/core/sock.c
--- org/net/core/sock.c 2009-10-16 21:30:56.000000000 +0530
+++ new/net/core/sock.c 2009-10-16 21:32:33.000000000 +0530
@@ -352,6 +352,12 @@ discard_and_relse:
}
EXPORT_SYMBOL(sk_receive_skb);
+void sk_reset_txq(struct sock *sk)
+{
+ sk_tx_queue_clear(sk);
+}
+EXPORT_SYMBOL(sk_reset_txq);
+
struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie)
{
struct dst_entry *dst = sk->sk_dst_cache;
diff -ruNp org/net/dccp/timer.c new/net/dccp/timer.c
--- org/net/dccp/timer.c 2009-10-16 21:30:56.000000000 +0530
+++ new/net/dccp/timer.c 2009-10-16 21:31:30.000000000 +0530
@@ -38,7 +38,7 @@ static int dccp_write_timeout(struct soc
if (sk->sk_state == DCCP_REQUESTING || sk->sk_state == DCCP_PARTOPEN) {
if (icsk->icsk_retransmits != 0)
- dst_negative_advice(&sk->sk_dst_cache);
+ dst_negative_advice(&sk->sk_dst_cache, sk);
retry_until = icsk->icsk_syn_retries ?
: sysctl_dccp_request_retries;
} else {
@@ -63,7 +63,7 @@ static int dccp_write_timeout(struct soc
Golden words :-).
*/
- dst_negative_advice(&sk->sk_dst_cache);
+ dst_negative_advice(&sk->sk_dst_cache, sk);
}
retry_until = sysctl_dccp_retries2;
diff -ruNp org/net/decnet/af_decnet.c new/net/decnet/af_decnet.c
--- org/net/decnet/af_decnet.c 2009-10-16 21:30:56.000000000 +0530
+++ new/net/decnet/af_decnet.c 2009-10-16 21:31:30.000000000 +0530
@@ -1955,7 +1955,7 @@ static int dn_sendmsg(struct kiocb *iocb
}
if ((flags & MSG_TRYHARD) && sk->sk_dst_cache)
- dst_negative_advice(&sk->sk_dst_cache);
+ dst_negative_advice(&sk->sk_dst_cache, sk);
mss = scp->segsize_rem;
fctype = scp->services_rem & NSP_FC_MASK;
diff -ruNp org/net/ipv4/tcp_timer.c new/net/ipv4/tcp_timer.c
--- org/net/ipv4/tcp_timer.c 2009-10-16 21:30:56.000000000 +0530
+++ new/net/ipv4/tcp_timer.c 2009-10-16 21:31:30.000000000 +0530
@@ -141,14 +141,14 @@ static int tcp_write_timeout(struct sock
if ((1 << sk->sk_state) & (TCPF_SYN_SENT | TCPF_SYN_RECV)) {
if (icsk->icsk_retransmits)
- dst_negative_advice(&sk->sk_dst_cache);
+ dst_negative_advice(&sk->sk_dst_cache, sk);
retry_until = icsk->icsk_syn_retries ? : sysctl_tcp_syn_retries;
} else {
if (retransmits_timed_out(sk, sysctl_tcp_retries1)) {
/* Black hole detection */
tcp_mtu_probing(icsk, sk);
- dst_negative_advice(&sk->sk_dst_cache);
+ dst_negative_advice(&sk->sk_dst_cache, sk);
}
retry_until = sysctl_tcp_retries2;
^ permalink raw reply
* [patch 2/3] KS8851: Fix MAC address write order
From: Ben Dooks @ 2009-10-20 9:49 UTC (permalink / raw)
To: netdev; +Cc: Ping.Doong
In-Reply-To: <20091020094902.274646871@fluff.org.uk>
[-- Attachment #1: ks8851-fix-mac-order.patch --]
[-- Type: text/plain, Size: 2490 bytes --]
The MAC address register was being written in the wrong order, so add
a new address macro to convert mac-address byte to register address and
a ks8851_wrreg8() function to write each byte without having to worry
about any difficult byte swapping.
Fixes a bug reported by Doong, Ping of Micrel.
Signed-off-by: Ben Dooks <ben@simtec.co.uk>
---
drivers/net/ks8851.c | 39 ++++++++++++++++++++++++++++++++++-----
drivers/net/ks8851.h | 1 +
2 files changed, 35 insertions(+), 5 deletions(-)
Index: b/drivers/net/ks8851.c
===================================================================
--- a/drivers/net/ks8851.c 2009-10-06 14:25:53.000000000 +0100
+++ b/drivers/net/ks8851.c 2009-10-06 14:42:39.000000000 +0100
@@ -171,6 +171,36 @@ static void ks8851_wrreg16(struct ks8851
}
/**
+ * ks8851_wrreg8 - write 8bit register value to chip
+ * @ks: The chip state
+ * @reg: The register address
+ * @val: The value to write
+ *
+ * Issue a write to put the value @val into the register specified in @reg.
+ */
+static void ks8851_wrreg8(struct ks8851_net *ks, unsigned reg, unsigned val)
+{
+ struct spi_transfer *xfer = &ks->spi_xfer1;
+ struct spi_message *msg = &ks->spi_msg1;
+ __le16 txb[2];
+ int ret;
+ int bit;
+
+ bit = 1 << (reg & 3);
+
+ txb[0] = cpu_to_le16(MK_OP(bit, reg) | KS_SPIOP_WR);
+ txb[1] = val;
+
+ xfer->tx_buf = txb;
+ xfer->rx_buf = NULL;
+ xfer->len = 3;
+
+ ret = spi_sync(ks->spidev, msg);
+ if (ret < 0)
+ ks_err(ks, "spi_sync() failed\n");
+}
+
+/**
* ks8851_rx_1msg - select whether to use one or two messages for spi read
* @ks: The device structure
*
@@ -322,13 +352,12 @@ static void ks8851_soft_reset(struct ks8
static int ks8851_write_mac_addr(struct net_device *dev)
{
struct ks8851_net *ks = netdev_priv(dev);
- u16 *mcp = (u16 *)dev->dev_addr;
+ int i;
mutex_lock(&ks->lock);
- ks8851_wrreg16(ks, KS_MARL, mcp[0]);
- ks8851_wrreg16(ks, KS_MARM, mcp[1]);
- ks8851_wrreg16(ks, KS_MARH, mcp[2]);
+ for (i = 0; i < ETH_ALEN; i++)
+ ks8851_wrreg8(ks, KS_MAR(i), dev->dev_addr[i]);
mutex_unlock(&ks->lock);
Index: b/drivers/net/ks8851.h
===================================================================
--- a/drivers/net/ks8851.h 2009-10-06 14:34:32.000000000 +0100
+++ b/drivers/net/ks8851.h 2009-10-06 14:35:08.000000000 +0100
@@ -16,6 +16,7 @@
#define CCR_32PIN (1 << 0)
/* MAC address registers */
+#define KS_MAR(_m) 0x15 - (_m)
#define KS_MARL 0x10
#define KS_MARM 0x12
#define KS_MARH 0x14
^ permalink raw reply
* [patch 0/3] KS8851 updates for -rc5
From: Ben Dooks @ 2009-10-20 9:49 UTC (permalink / raw)
To: netdev; +Cc: Ping.Doong
Patches for some minor problems with the KS8851 SPI network driver
for inclusion into the kernel. This set is based on -rc5.
^ permalink raw reply
* [patch 3/3] KS8851: Fix ks8851_set_rx_mode() for IFF_MULTICAST
From: Ben Dooks @ 2009-10-20 9:49 UTC (permalink / raw)
To: netdev; +Cc: Ping.Doong
In-Reply-To: <20091020094902.274646871@fluff.org.uk>
[-- Attachment #1: ks8851-fix-mc-rxmode.patch --]
[-- Type: text/plain, Size: 1096 bytes --]
In ks8851_set_rx_mode() the case handling IFF_MULTICAST was also setting
the RXCR1_AE bit by accident. This meant that all unicast frames where
being accepted by the device. Remove RXCR1_AE from this case.
Note, RXCR1_AE was also masking a problem with setting the MAC address
properly, so needs to be applied after fixing the MAC write order.
Fixes a bug reported by Doong, Ping of Micrel. This version of the
patch avoids setting RXCR1_ME for all cases.
Signed-off-by: Ben Dooks <ben@simtec.co.uk>
---
drivers/net/ks8851.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: b/drivers/net/ks8851.c
===================================================================
--- a/drivers/net/ks8851.c 2009-10-13 13:28:50.000000000 +0100
+++ b/drivers/net/ks8851.c 2009-10-13 13:28:51.000000000 +0100
@@ -980,7 +980,7 @@ static void ks8851_set_rx_mode(struct ne
mcptr = mcptr->next;
}
- rxctrl.rxcr1 = RXCR1_RXME | RXCR1_RXAE | RXCR1_RXPAFMA;
+ rxctrl.rxcr1 = RXCR1_RXME | RXCR1_RXPAFMA;
} else {
/* just accept broadcast / unicast */
rxctrl.rxcr1 = RXCR1_RXPAFMA;
^ permalink raw reply
* [patch 1/3] KS8851: Add soft reset at probe time
From: Ben Dooks @ 2009-10-20 9:49 UTC (permalink / raw)
To: netdev; +Cc: Ping.Doong
In-Reply-To: <20091020094902.274646871@fluff.org.uk>
[-- Attachment #1: ks8851-reset-at-probe.patch --]
[-- Type: text/plain, Size: 984 bytes --]
Issue a full soft reset at probe time.
This was reported by Doong Ping of Micrel, but no explanation of why this
is necessary or what bug it is fixing. Add it as it does not seem to hurt
the current driver and ensures that the device is in a known state when we
start setting it up.
Signed-off-by: Ben Dooks <ben@simtec.co.uk>
---
drivers/net/ks8851.c | 3 +++
1 file changed, 3 insertions(+)
Index: b/drivers/net/ks8851.c
===================================================================
--- a/drivers/net/ks8851.c 2009-10-12 23:04:15.000000000 +0100
+++ b/drivers/net/ks8851.c 2009-10-13 13:28:43.000000000 +0100
@@ -1239,6 +1239,9 @@ static int __devinit ks8851_probe(struct
ndev->netdev_ops = &ks8851_netdev_ops;
ndev->irq = spi->irq;
+ /* issue a global soft reset to reset the device. */
+ ks8851_soft_reset(ks, GRR_GSR);
+
/* simple check for a valid chip being connected to the bus */
if ((ks8851_rdreg16(ks, KS_CIDER) & ~CIDER_REV_MASK) != CIDER_ID) {
^ permalink raw reply
* [PATCH 2/4 v4] net: IPv6 changes
From: Krishna Kumar @ 2009-10-20 9:46 UTC (permalink / raw)
To: davem; +Cc: netdev, herbert, Krishna Kumar, dada1
In-Reply-To: <20091020094607.10404.81794.sendpatchset@localhost.localdomain>
From: Krishna Kumar <krkumar2@in.ibm.com>
IPv6: Reset sk_tx_queue_mapping when dst_cache is reset. Use existing
macro to do the work.
Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
---
net/ipv6/inet6_connection_sock.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff -ruNp org/net/ipv6/inet6_connection_sock.c new/net/ipv6/inet6_connection_sock.c
--- org/net/ipv6/inet6_connection_sock.c 2009-10-16 21:29:19.000000000 +0530
+++ new/net/ipv6/inet6_connection_sock.c 2009-10-16 21:31:00.000000000 +0530
@@ -168,8 +168,7 @@ struct dst_entry *__inet6_csk_dst_check(
if (dst) {
struct rt6_info *rt = (struct rt6_info *)dst;
if (rt->rt6i_flow_cache_genid != atomic_read(&flow_cache_genid)) {
- sk->sk_dst_cache = NULL;
- dst_release(dst);
+ __sk_dst_reset(sk);
dst = NULL;
}
}
^ permalink raw reply
* [PATCH 1/4 v4] net: Introduce sk_tx_queue_mapping
From: Krishna Kumar @ 2009-10-20 9:46 UTC (permalink / raw)
To: davem; +Cc: netdev, herbert, Krishna Kumar, dada1
In-Reply-To: <20091020094607.10404.81794.sendpatchset@localhost.localdomain>
From: Krishna Kumar <krkumar2@in.ibm.com>
Introduce sk_tx_queue_mapping; and functions that set, test and
get this value. Reset sk_tx_queue_mapping to -1 whenever the dst
cache is set/reset, and in socket alloc. Setting txq to -1 and
using valid txq=<0 to n-1> allows the tx path to use the value
of sk_tx_queue_mapping directly instead of subtracting 1 on every
tx.
Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
---
include/net/sock.h | 26 ++++++++++++++++++++++++++
net/core/sock.c | 5 ++++-
2 files changed, 30 insertions(+), 1 deletion(-)
diff -ruNp org/include/net/sock.h new/include/net/sock.h
--- org/include/net/sock.h 2009-10-16 18:53:40.000000000 +0530
+++ new/include/net/sock.h 2009-10-16 21:38:44.000000000 +0530
@@ -107,6 +107,7 @@ struct net;
* @skc_node: main hash linkage for various protocol lookup tables
* @skc_nulls_node: main hash linkage for UDP/UDP-Lite protocol
* @skc_refcnt: reference count
+ * @skc_tx_queue_mapping: tx queue number for this connection
* @skc_hash: hash value used with various protocol lookup tables
* @skc_family: network address family
* @skc_state: Connection state
@@ -128,6 +129,7 @@ struct sock_common {
struct hlist_nulls_node skc_nulls_node;
};
atomic_t skc_refcnt;
+ int skc_tx_queue_mapping;
unsigned int skc_hash;
unsigned short skc_family;
@@ -215,6 +217,7 @@ struct sock {
#define sk_node __sk_common.skc_node
#define sk_nulls_node __sk_common.skc_nulls_node
#define sk_refcnt __sk_common.skc_refcnt
+#define sk_tx_queue_mapping __sk_common.skc_tx_queue_mapping
#define sk_copy_start __sk_common.skc_hash
#define sk_hash __sk_common.skc_hash
@@ -1094,8 +1097,29 @@ static inline void sock_put(struct sock
extern int sk_receive_skb(struct sock *sk, struct sk_buff *skb,
const int nested);
+static inline void sk_tx_queue_set(struct sock *sk, int tx_queue)
+{
+ sk->sk_tx_queue_mapping = tx_queue;
+}
+
+static inline void sk_tx_queue_clear(struct sock *sk)
+{
+ sk->sk_tx_queue_mapping = -1;
+}
+
+static inline int sk_tx_queue_get(const struct sock *sk)
+{
+ return sk->sk_tx_queue_mapping;
+}
+
+static inline bool sk_tx_queue_recorded(const struct sock *sk)
+{
+ return (sk && sk->sk_tx_queue_mapping >= 0);
+}
+
static inline void sk_set_socket(struct sock *sk, struct socket *sock)
{
+ sk_tx_queue_clear(sk);
sk->sk_socket = sock;
}
@@ -1152,6 +1176,7 @@ __sk_dst_set(struct sock *sk, struct dst
{
struct dst_entry *old_dst;
+ sk_tx_queue_clear(sk);
old_dst = sk->sk_dst_cache;
sk->sk_dst_cache = dst;
dst_release(old_dst);
@@ -1170,6 +1195,7 @@ __sk_dst_reset(struct sock *sk)
{
struct dst_entry *old_dst;
+ sk_tx_queue_clear(sk);
old_dst = sk->sk_dst_cache;
sk->sk_dst_cache = NULL;
dst_release(old_dst);
diff -ruNp org/net/core/sock.c new/net/core/sock.c
--- org/net/core/sock.c 2009-10-16 18:53:40.000000000 +0530
+++ new/net/core/sock.c 2009-10-16 21:29:02.000000000 +0530
@@ -357,6 +357,7 @@ struct dst_entry *__sk_dst_check(struct
struct dst_entry *dst = sk->sk_dst_cache;
if (dst && dst->obsolete && dst->ops->check(dst, cookie) == NULL) {
+ sk_tx_queue_clear(sk);
sk->sk_dst_cache = NULL;
dst_release(dst);
return NULL;
@@ -953,7 +954,8 @@ static void sock_copy(struct sock *nsk,
void *sptr = nsk->sk_security;
#endif
BUILD_BUG_ON(offsetof(struct sock, sk_copy_start) !=
- sizeof(osk->sk_node) + sizeof(osk->sk_refcnt));
+ sizeof(osk->sk_node) + sizeof(osk->sk_refcnt) +
+ sizeof(osk->sk_tx_queue_mapping));
memcpy(&nsk->sk_copy_start, &osk->sk_copy_start,
osk->sk_prot->obj_size - offsetof(struct sock, sk_copy_start));
#ifdef CONFIG_SECURITY_NETWORK
@@ -997,6 +999,7 @@ static struct sock *sk_prot_alloc(struct
if (!try_module_get(prot->owner))
goto out_free_sec;
+ sk_tx_queue_clear(sk);
}
return sk;
^ permalink raw reply
* [PATCH 0/4 v4] net: Implement fast TX queue selection
From: Krishna Kumar @ 2009-10-20 9:46 UTC (permalink / raw)
To: davem; +Cc: netdev, herbert, Krishna Kumar, dada1
From: Krishna Kumar <krkumar2@in.ibm.com>
Notes:
------
1. Eric suggested:
- To use u16 for txq#, but I am using an "int" for now as that
avoids one unnecessary subtraction during tx.
- An improvement of caching the txq at connection establishment
time so as to use rxq# = txq# (TBD later).
- Drivers can call sk_tx_queue_set() to set the txq if they are
going to call skb_tx_hash() internally.
2. v3 & v4 patch stress tested with 1000 netperfs, reboot's, etc.
Changelog [from v3]:
--------------------
1. Changed the order of patches so that the patch setting the
txq is moved to the end. This results in bisect-safe patches.
2. Fixed a build failure.
Changelog [from v2]:
--------------------
1. Changed names of functions setting, getting and returning the
txq#; and added a new one to reset the txq#.
2. Free sk doesn't need to reset txq#.
Changelog [from v1]:
--------------------
1. Changed IPv6 code to call __sk_dst_reset() directly.
2. Removed the patch re-arranging ("encapsulating") __sk_dst_reset()
Multiqueue cards on routers/firewalls set skb->queue_mapping on
input which helps in faster xmit. Implement fast queue selection
for locally generated packets also, by saving the txq# for
connected sockets (in dev_pick_tx) and use it in subsequent
iterations. Locally generated packets for a connection will xmit
on the same txq, but routing & firewall loads should not be
affected by this patch. Tests shows the distribution across txq's
for 1-4 netperf sessions is similar to existing code.
Testing & results:
------------------
1. Cycles/Iter (C/I) used by dev_pick_tx:
(B -> Billion, M -> Million)
|--------------|------------------------|------------------------|
| | ORG | NEW |
| Test |--------|---------|-----|--------|---------|-----|
| | Cycles | Iters | C/I | Cycles | Iters | C/I |
|--------------|--------|---------|-----|--------|---------|-----|
| [TCP_STREAM, | 3.98 B | 12.47 M | 320 | 1.95 B | 12.92 M | 152 |
| UDP_STREAM, | | | | | | |
| TCP_RR, | | | | | | |
| UDP_RR] | | | | | | |
|--------------|--------|---------|-----|--------|---------|-----|
| [TCP_STREAM, | 8.92 B | 29.66 M | 300 | 3.82 B | 38.88 M | 98 |
| TCP_RR, | | | | | | |
| UDP_RR] | | | | | | |
|--------------|--------|---------|-----|--------|---------|-----|
2. Stress test (over 48 hours) : 1000 netperfs running combination
of TCP_STREAM/RR, UDP_STREAM/RR (v4/6, NODELAY/~NODELAY for all
tests), with some ssh sessions, reboots, modprobe -r driver, etc.
3. Performance test (10 hours): Single 10 hour netperf run of
TCP_STREAM/RR, TCP_STREAM + NO_DELAY and UDP_RR. Results show an
improvement in both performance and cpu utilization.
Tested on a 4-processor AMD Opteron 2.8 GHz system with 1GB memory,
10G Chelsio card. Each BW number is the sum of 3 iterations of
individual tests using 512, 16K, 64K & 128K I/O sizes, in Mb/s:
------------------------ TCP Tests -----------------------
#procs Org BW New BW (%) Org SD New SD (%)
------------------------------------------------------------
1 77777.7 81011.0 (4.15) 42.3 40.2 (-5.11)
4 91599.2 91878.8 (.30) 955.9 919.3 (-3.83)
6 89533.3 91792.2 (2.52) 2262.0 2143.0 (-5.25)
8 87507.5 89161.9 (1.89) 4363.4 4073.6 (-6.64)
10 85152.4 85607.8 (.53) 6890.4 6851.2 (-.56)
------------------------------------------------------------
------------------------- TCP NO_DELAY Tests ---------------
#procs Org BW New BW (%) Org SD New SD (%)
------------------------------------------------------------
1 57001.9 57888.0 (1.55) 67.7 70.2 (3.75)
4 69555.1 69957.4 (.57) 823.0 834.3 (1.36)
6 71359.3 71918.7 (.78) 1740.8 1724.5 (-.93)
8 72577.6 72496.1 (-.11) 2955.4 2937.7 (-.59)
10 70829.6 71444.2 (.86) 4826.1 4673.4 (-3.16)
------------------------------------------------------------
----------------------- Request Response Tests --------------------
#procs Org TPS New TPS (%) Org SD New SD (%)
(1-10)
-------------------------------------------------------------------
TCP 1019245.9 1042626.4 (2.29) 16352.9 16459.8 (.65)
UDP 934598.64 942956.9 (.89) 11607.3 11593.2 (-.12)
-------------------------------------------------------------------
Thanks,
- KK
Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
---
^ permalink raw reply
* RE: [PATCH v0 1/7] gianfar: Add per queue structure support
From: Kumar Gopalpet-B05799 @ 2009-10-20 8:27 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20091020.005646.227664762.davem@davemloft.net>
Hi David,
Will respin them and send again.
-Thanks
Sandeep
>-----Original Message-----
>From: David Miller [mailto:davem@davemloft.net]
>Sent: Tuesday, October 20, 2009 1:27 PM
>To: Kumar Gopalpet-B05799
>Cc: netdev@vger.kernel.org
>Subject: Re: [PATCH v0 1/7] gianfar: Add per queue structure support
>
>From: David Miller <davem@davemloft.net>
>Date: Tue, 20 Oct 2009 00:03:58 -0700 (PDT)
>
>> From: "Kumar Gopalpet-B05799" <Sandeep.Kumar@freescale.com>
>> Date: Tue, 20 Oct 2009 12:15:14 +0530
>>
>>> I am assuming all the 7 patches are applied.
>>
>> I am going to add them, yes.
>
>Nevermind, these patches don't apply to net-next-2.6 at all
>and will need to be respun.
>
>For example, patch #1 rejects because gfar_suspend() in
>net-next-2.6 takes a 'dev' not an 'ofdev'.
>
>
^ permalink raw reply
* Re: [PATCH] net: Fix struct inet_timewait_sock bitfield annotation
From: David Miller @ 2009-10-20 8:14 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
In-Reply-To: <4ADC27F3.5050508@gmail.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 19 Oct 2009 10:48:51 +0200
> commit 9e337b0f (net: annotate inet_timewait_sock bitfields)
> added 4/8 bytes in struct inet_timewait_sock.
>
> Fix this by declaring tw_ipv6_offset in the 'flags' bitfield
> The 14 bits hole is named tw_pad to make it cleary apparent.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied to net-2.6, thanks.
^ permalink raw reply
* Re: [PATCH net-next-2.6] filter: Add SKF_AD_QUEUE instruction
From: David Miller @ 2009-10-20 8:08 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
In-Reply-To: <4AD8A916.3060807@gmail.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 16 Oct 2009 19:10:46 +0200
> It can help being able to filter packets on their queue_mapping.
>
> If filter performance is not good, we could add a "numqueue" field
> in struct packet_type, so that netif_nit_deliver() and other functions
> can directly ignore packets with not expected queue number.
>
> Lets experiment this simple filter extension first.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied, I had to adjust the SKF_AD_* number due to a conflict
with Jamal's SKF_AD_MARK patch which is also applied to net-next-2.6
^ permalink raw reply
* Re: [PATCH net-next-2.6] af_packet: mc_drop/flush_mclist changes
From: David Miller @ 2009-10-20 8:08 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
In-Reply-To: <4AD8A195.3040902@gmail.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 16 Oct 2009 18:38:46 +0200
> We hold RTNL, we can use __dev_get_by_index() instead of dev_get_by_index()
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH] af_packet: Avoid cache line dirtying
From: David Miller @ 2009-10-20 8:07 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, deri
In-Reply-To: <4AD87CEC.4020407@gmail.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 16 Oct 2009 16:02:20 +0200
> While doing multiple captures, I found af_packet was dirtying cache line
> containing its prot_hook.
>
> This slow down machines where several cpus are necessary to handle capture
> traffic, as each prot_hook is traversed for each packet coming in or out
> the host.
>
> This patches moves "struct packet_type prot_hook" to the end of
> packet_sock, and uses a ____cacheline_aligned_in_smp to make sure
> this remains shared by all cpus.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH v0 1/7] gianfar: Add per queue structure support
From: David Miller @ 2009-10-20 7:56 UTC (permalink / raw)
To: Sandeep.Kumar; +Cc: netdev
In-Reply-To: <20091020.000358.53030357.davem@davemloft.net>
From: David Miller <davem@davemloft.net>
Date: Tue, 20 Oct 2009 00:03:58 -0700 (PDT)
> From: "Kumar Gopalpet-B05799" <Sandeep.Kumar@freescale.com>
> Date: Tue, 20 Oct 2009 12:15:14 +0530
>
>> I am assuming all the 7 patches are applied.
>
> I am going to add them, yes.
Nevermind, these patches don't apply to net-next-2.6 at all
and will need to be respun.
For example, patch #1 rejects because gfar_suspend() in
net-next-2.6 takes a 'dev' not an 'ofdev'.
^ permalink raw reply
* Re: [PATCH RFC] net: add alloc_skb_mustcopy() to make clone copy
From: David Miller @ 2009-10-20 7:52 UTC (permalink / raw)
To: jeremy; +Cc: herbert, netdev
In-Reply-To: <4ADD5666.9090409@goop.org>
From: Jeremy Fitzhardinge <jeremy@goop.org>
Date: Tue, 20 Oct 2009 15:19:18 +0900
> When doing network IO on behalf of guests, a Xen dom0 kernel gets granted
> pages from guests. These pages cannot be released normally, so we must
> handle releasing them specially, which can do with a skb_destructor.
>
> This is complicated by the fact that the lifetime of an skb's
> frags can be extended via cloning. To address this, this patch adds
> alloc_skb_mustcopy() which allocates an skb with fclone==SKB_MUST_COPY.
> If skb_clone() sees an skb with this set, it simply calls skb_copy
> instead so that there are no aliases to the granted pages.
>
> /* Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> */
This looks perfectly fine to me.
Let me know if it actually works out for you and we can merge
this.
^ permalink raw reply
* Re: tcp: Try to catch MSG_PEEK bug
From: David Miller @ 2009-10-20 7:52 UTC (permalink / raw)
To: herbert; +Cc: netdev
In-Reply-To: <20091020054106.GA5507@gondor.apana.org.au>
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Tue, 20 Oct 2009 14:41:06 +0900
> tcp: Try to catch MSG_PEEK bug
>
> This patch tries to print out more information when we hit the
> MSG_PEEK bug in tcp_recvmsg. It's been around since at least
> 2005 and it's about time that we finally fix it.
>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Ok, fair enough, I'll stick this into net-2.6 and hopefully
that will help us.
^ permalink raw reply
* Re: build test your changes!
From: Eric Dumazet @ 2009-10-20 7:36 UTC (permalink / raw)
To: Krishna Kumar2; +Cc: David Miller, netdev
In-Reply-To: <OF1BCE4CF8.BD48A587-ON65257655.0024B1CD-65257655.0025CC6C@in.ibm.com>
Krishna Kumar2 a écrit :
> Sorry about the build failure. I did do a build and a stress test. But
> I missed changing the name sk_record_tx_queue() in both sock.h
> and dev.c when testing. I caught the miss before sending the patch,
> but changed the name only in sock.h, and didn't do a final build
> again. Sorry about this, will not assume next time.
>
> I will fix this (including patch order) and resend after build and test.
>
Yes please, I am looking for your patches being added before my next round :)
(Specifically, I was waiting sizeof(struct sock_common) goes from 0x38 to 0x40
on 64 bit arches)
^ permalink raw reply
* Re: [PATCH v3] can: provide library functions for skb allocation
From: David Miller @ 2009-10-20 7:35 UTC (permalink / raw)
To: wg; +Cc: netdev, socketcan-core, haas, anantgole, mkl
In-Reply-To: <4ADD5C35.1070300@grandegger.com>
From: Wolfgang Grandegger <wg@grandegger.com>
Date: Tue, 20 Oct 2009 08:44:05 +0200
> This patch makes the private functions alloc_can_skb() and
> alloc_can_err_skb() of the at91_can driver public and adapts all
> drivers to use these. While making the patch I realized, that
> the skb's are *not* setup consistently. It's now done as shown
> below:
>
> skb->protocol = htons(ETH_P_CAN);
> skb->pkt_type = PACKET_BROADCAST;
> skb->ip_summed = CHECKSUM_UNNECESSARY;
> *cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame));
> memset(*cf, 0, sizeof(struct can_frame));
>
> The frame is zeroed out to avoid uninitialized data to be passed to
> user space. Some drivers or library code did not set "pkt_type" or
> "ip_summed". Also, "__constant_htons()" should not be used for
> runtime invocations, as pointed out by David Miller.
>
> Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Wow, it builds, applied :-)
^ permalink raw reply
* Re: [PATCH v0 1/7] gianfar: Add per queue structure support
From: David Miller @ 2009-10-20 7:03 UTC (permalink / raw)
To: Sandeep.Kumar; +Cc: netdev
In-Reply-To: <9F4C7D19E8361D4C94921B95BE08B81B8940DB@zin33exm22.fsl.freescale.net>
From: "Kumar Gopalpet-B05799" <Sandeep.Kumar@freescale.com>
Date: Tue, 20 Oct 2009 12:15:14 +0530
> I am assuming all the 7 patches are applied.
I am going to add them, yes.
^ permalink raw reply
* Re: build test your changes!
From: Krishna Kumar2 @ 2009-10-20 6:52 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20091019.232204.52827242.davem@davemloft.net>
Hi Dave,
Sorry about the build failure. I did do a build and a stress test. But
I missed changing the name sk_record_tx_queue() in both sock.h
and dev.c when testing. I caught the miss before sending the patch,
but changed the name only in sock.h, and didn't do a final build
again. Sorry about this, will not assume next time.
I will fix this (including patch order) and resend after build and test.
Thanks,
- KK
David Miller <davem@davemloft.net> wrote on 10/20/2009 11:52:04 AM:
> David Miller <davem@davemloft.net>
> 10/20/2009 11:52 AM
>
> To
>
> Krishna Kumar2/India/IBM@IBMIN
>
> cc
>
> netdev@vger.kernel.org
>
> Subject
>
> build test your changes!
>
>
> Krishna, you add:
>
> +static inline void sk_tx_queue_set(struct sock *sk, int tx_queue)
> ...
> +static inline void sk_tx_queue_clear(struct sock *sk)
> ...
> +static inline int sk_tx_queue_get(const struct sock *sk)
> ...
> +static inline bool sk_tx_queue_recorded(const struct sock *sk)
>
> But then in the net/core/dev.c patch you go:
>
> + if (sk && sk->sk_dst_cache)
> + sk_record_tx_queue(sk, queue_index);
>
> I cannot see how you did a build test of this, it's absolutely
impossible.
>
> I'm reverting.
^ permalink raw reply
* Re: user-to-kernel shared memory with net_device
From: Rémi Denis-Courmont @ 2009-10-20 6:47 UTC (permalink / raw)
To: Chris Ross; +Cc: netdev
In-Reply-To: <17cd85320910191428p4ca8bc9lc865babb18f29b1d@mail.gmail.com>
On Mon, 19 Oct 2009 16:28:42 -0500, Chris Ross <chris@compilednetworks.com>
wrote:
> All of the mmap examples I can find seem to be for character devices.
> Do I need a character device that implements mmap and proxies access
> to the net_device's stats, or is there a way to mmap directly to a
> net_device structure? Also, is this the excepted method when a
> userspace process needs to read large tables from a driver?
You cannot use mmap() directly on a network device as there are no file
descriptors to network devices. In principle, you can still initiate a
memory mapping using a network device ioctl(), but this is probably not
such a great idea.
--
Rémi Denis-Courmont
^ permalink raw reply
* RE: [PATCH v0 1/7] gianfar: Add per queue structure support
From: Kumar Gopalpet-B05799 @ 2009-10-20 6:45 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20091019.231633.25328647.davem@davemloft.net>
HI David,
I am assuming all the 7 patches are applied.
-Thanks
Sandeep
>-----Original Message-----
>From: David Miller [mailto:davem@davemloft.net]
>Sent: Tuesday, October 20, 2009 11:47 AM
>To: Kumar Gopalpet-B05799
>Cc: netdev@vger.kernel.org
>Subject: Re: [PATCH v0 1/7] gianfar: Add per queue structure support
>
>
>These changes look pretty good and I've let them sit on the
>list for several days so I'm applying them to net-next-2.6, thanks!
>
>
^ permalink raw reply
* [PATCH v3] can: provide library functions for skb allocation
From: Wolfgang Grandegger @ 2009-10-20 6:44 UTC (permalink / raw)
To: Linux Netdev List
Cc: SocketCAN Core Mailing List, David Miller, Marc Kleine-Budde
This patch makes the private functions alloc_can_skb() and
alloc_can_err_skb() of the at91_can driver public and adapts all
drivers to use these. While making the patch I realized, that
the skb's are *not* setup consistently. It's now done as shown
below:
skb->protocol = htons(ETH_P_CAN);
skb->pkt_type = PACKET_BROADCAST;
skb->ip_summed = CHECKSUM_UNNECESSARY;
*cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame));
memset(*cf, 0, sizeof(struct can_frame));
The frame is zeroed out to avoid uninitialized data to be passed to
user space. Some drivers or library code did not set "pkt_type" or
"ip_summed". Also, "__constant_htons()" should not be used for
runtime invocations, as pointed out by David Miller.
Signed-off-by: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
---
drivers/net/can/at91_can.c | 32 ----------------------------
drivers/net/can/dev.c | 42 +++++++++++++++++++++++++++++++-------
drivers/net/can/sja1000/sja1000.c | 12 +---------
drivers/net/can/ti_hecc.c | 17 +++------------
drivers/net/can/usb/ems_usb.c | 16 +-------------
include/linux/can/dev.h | 4 +++
6 files changed, 47 insertions(+), 76 deletions(-)
Index: net-next-2.6/drivers/net/can/dev.c
===================================================================
--- net-next-2.6.orig/drivers/net/can/dev.c
+++ net-next-2.6/drivers/net/can/dev.c
@@ -366,17 +366,12 @@ void can_restart(unsigned long data)
can_flush_echo_skb(dev);
/* send restart message upstream */
- skb = dev_alloc_skb(sizeof(struct can_frame));
+ skb = alloc_can_err_skb(dev, &cf);
if (skb == NULL) {
err = -ENOMEM;
goto restart;
}
- skb->dev = dev;
- skb->protocol = htons(ETH_P_CAN);
- cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame));
- memset(cf, 0, sizeof(struct can_frame));
- cf->can_id = CAN_ERR_FLAG | CAN_ERR_RESTARTED;
- cf->can_dlc = CAN_ERR_DLC;
+ cf->can_id |= CAN_ERR_RESTARTED;
netif_rx(skb);
@@ -449,6 +444,39 @@ static void can_setup(struct net_device
dev->features = NETIF_F_NO_CSUM;
}
+struct sk_buff *alloc_can_skb(struct net_device *dev, struct can_frame **cf)
+{
+ struct sk_buff *skb;
+
+ skb = netdev_alloc_skb(dev, sizeof(struct can_frame));
+ if (unlikely(!skb))
+ return NULL;
+
+ skb->protocol = htons(ETH_P_CAN);
+ skb->pkt_type = PACKET_BROADCAST;
+ skb->ip_summed = CHECKSUM_UNNECESSARY;
+ *cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame));
+ memset(*cf, 0, sizeof(struct can_frame));
+
+ return skb;
+}
+EXPORT_SYMBOL_GPL(alloc_can_skb);
+
+struct sk_buff *alloc_can_err_skb(struct net_device *dev, struct can_frame **cf)
+{
+ struct sk_buff *skb;
+
+ skb = alloc_can_skb(dev, cf);
+ if (unlikely(!skb))
+ return NULL;
+
+ (*cf)->can_id = CAN_ERR_FLAG;
+ (*cf)->can_dlc = CAN_ERR_DLC;
+
+ return skb;
+}
+EXPORT_SYMBOL_GPL(alloc_can_err_skb);
+
/*
* Allocate and setup space for the CAN network device
*/
Index: net-next-2.6/drivers/net/can/at91_can.c
===================================================================
--- net-next-2.6.orig/drivers/net/can/at91_can.c
+++ net-next-2.6/drivers/net/can/at91_can.c
@@ -221,38 +221,6 @@ static inline void set_mb_mode(const str
set_mb_mode_prio(priv, mb, mode, 0);
}
-static struct sk_buff *alloc_can_skb(struct net_device *dev,
- struct can_frame **cf)
-{
- struct sk_buff *skb;
-
- skb = netdev_alloc_skb(dev, sizeof(struct can_frame));
- if (unlikely(!skb))
- return NULL;
-
- skb->protocol = htons(ETH_P_CAN);
- skb->ip_summed = CHECKSUM_UNNECESSARY;
- *cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame));
-
- return skb;
-}
-
-static struct sk_buff *alloc_can_err_skb(struct net_device *dev,
- struct can_frame **cf)
-{
- struct sk_buff *skb;
-
- skb = alloc_can_skb(dev, cf);
- if (unlikely(!skb))
- return NULL;
-
- memset(*cf, 0, sizeof(struct can_frame));
- (*cf)->can_id = CAN_ERR_FLAG;
- (*cf)->can_dlc = CAN_ERR_DLC;
-
- return skb;
-}
-
/*
* Swtich transceiver on or off
*/
Index: net-next-2.6/drivers/net/can/sja1000/sja1000.c
===================================================================
--- net-next-2.6.orig/drivers/net/can/sja1000/sja1000.c
+++ net-next-2.6/drivers/net/can/sja1000/sja1000.c
@@ -296,11 +296,9 @@ static void sja1000_rx(struct net_device
uint8_t dlc;
int i;
- skb = dev_alloc_skb(sizeof(struct can_frame));
+ skb = alloc_can_skb(dev, &cf);
if (skb == NULL)
return;
- skb->dev = dev;
- skb->protocol = htons(ETH_P_CAN);
fi = priv->read_reg(priv, REG_FI);
dlc = fi & 0x0F;
@@ -351,15 +349,9 @@ static int sja1000_err(struct net_device
enum can_state state = priv->can.state;
uint8_t ecc, alc;
- skb = dev_alloc_skb(sizeof(struct can_frame));
+ skb = alloc_can_err_skb(dev, &cf);
if (skb == NULL)
return -ENOMEM;
- skb->dev = dev;
- skb->protocol = htons(ETH_P_CAN);
- cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame));
- memset(cf, 0, sizeof(struct can_frame));
- cf->can_id = CAN_ERR_FLAG;
- cf->can_dlc = CAN_ERR_DLC;
if (isrc & IRQ_DOI) {
/* data overrun interrupt */
Index: net-next-2.6/drivers/net/can/usb/ems_usb.c
===================================================================
--- net-next-2.6.orig/drivers/net/can/usb/ems_usb.c
+++ net-next-2.6/drivers/net/can/usb/ems_usb.c
@@ -311,14 +311,10 @@ static void ems_usb_rx_can_msg(struct em
int i;
struct net_device_stats *stats = &dev->netdev->stats;
- skb = netdev_alloc_skb(dev->netdev, sizeof(struct can_frame));
+ skb = alloc_can_skb(dev->netdev, &cf);
if (skb == NULL)
return;
- skb->protocol = htons(ETH_P_CAN);
-
- cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame));
-
cf->can_id = msg->msg.can_msg.id;
cf->can_dlc = min_t(u8, msg->msg.can_msg.length, 8);
@@ -346,18 +342,10 @@ static void ems_usb_rx_err(struct ems_us
struct sk_buff *skb;
struct net_device_stats *stats = &dev->netdev->stats;
- skb = netdev_alloc_skb(dev->netdev, sizeof(struct can_frame));
+ skb = alloc_can_err_skb(dev->netdev, &cf);
if (skb == NULL)
return;
- skb->protocol = htons(ETH_P_CAN);
-
- cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame));
- memset(cf, 0, sizeof(struct can_frame));
-
- cf->can_id = CAN_ERR_FLAG;
- cf->can_dlc = CAN_ERR_DLC;
-
if (msg->type == CPC_MSG_TYPE_CAN_STATE) {
u8 state = msg->msg.can_state;
Index: net-next-2.6/drivers/net/can/ti_hecc.c
===================================================================
--- net-next-2.6.orig/drivers/net/can/ti_hecc.c
+++ net-next-2.6/drivers/net/can/ti_hecc.c
@@ -535,18 +535,15 @@ static int ti_hecc_rx_pkt(struct ti_hecc
u32 data, mbx_mask;
unsigned long flags;
- skb = netdev_alloc_skb(priv->ndev, sizeof(struct can_frame));
+ skb = alloc_can_skb(priv->ndev, &cf);
if (!skb) {
if (printk_ratelimit())
dev_err(priv->ndev->dev.parent,
- "ti_hecc_rx_pkt: netdev_alloc_skb() failed\n");
+ "ti_hecc_rx_pkt: alloc_can_skb() failed\n");
return -ENOMEM;
}
- skb->protocol = __constant_htons(ETH_P_CAN);
- skb->ip_summed = CHECKSUM_UNNECESSARY;
mbx_mask = BIT(mbxno);
- cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame));
data = hecc_read_mbx(priv, mbxno, HECC_CANMID);
if (data & HECC_CANMID_IDE)
cf->can_id = (data & CAN_EFF_MASK) | CAN_EFF_FLAG;
@@ -656,19 +653,13 @@ static int ti_hecc_error(struct net_devi
struct sk_buff *skb;
/* propogate the error condition to the can stack */
- skb = netdev_alloc_skb(ndev, sizeof(struct can_frame));
+ skb = alloc_can_err_skb(ndev, &cf);
if (!skb) {
if (printk_ratelimit())
dev_err(priv->ndev->dev.parent,
- "ti_hecc_error: netdev_alloc_skb() failed\n");
+ "ti_hecc_error: alloc_can_err_skb() failed\n");
return -ENOMEM;
}
- skb->protocol = __constant_htons(ETH_P_CAN);
- skb->ip_summed = CHECKSUM_UNNECESSARY;
- cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame));
- memset(cf, 0, sizeof(struct can_frame));
- cf->can_id = CAN_ERR_FLAG;
- cf->can_dlc = CAN_ERR_DLC;
if (int_status & HECC_CANGIF_WLIF) { /* warning level int */
if ((int_status & HECC_CANGIF_BOIF) == 0) {
Index: net-next-2.6/include/linux/can/dev.h
===================================================================
--- net-next-2.6.orig/include/linux/can/dev.h
+++ net-next-2.6/include/linux/can/dev.h
@@ -68,4 +68,8 @@ void can_put_echo_skb(struct sk_buff *sk
void can_get_echo_skb(struct net_device *dev, unsigned int idx);
void can_free_echo_skb(struct net_device *dev, unsigned int idx);
+struct sk_buff *alloc_can_skb(struct net_device *dev, struct can_frame **cf);
+struct sk_buff *alloc_can_err_skb(struct net_device *dev,
+ struct can_frame **cf);
+
#endif /* CAN_DEV_H */
^ permalink raw reply
* Re: [PATCH v2] can: provide library functions for skb allocation
From: Wolfgang Grandegger @ 2009-10-20 6:43 UTC (permalink / raw)
To: David Miller
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
netdev-u79uwXL29TY76Z2rM5mHXA, mkl-bIcnvbaLZ9MEGnE8C9+IrQ
In-Reply-To: <20091019.230549.29520350.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
David Miller wrote:
> From: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
> Date: Mon, 19 Oct 2009 21:54:40 -0700 (PDT)
>
>> Applied, thanks.
>
> Actually I have to back this out, you have to add an extern
> declaration for these public functions to a header the CAN
> drivers will see, or else there'll be build warnings and
> errors.
>
> I wonder if you actually did this, but forgot that part of
> the change or lost it somehow while respinning this.
Already the original patch was incomplete and I obviously forgot to
compile test it. I was sure that I did that already, but, well, sorry
for the inconvenience caused.
> Please fix this up and resubmit, thanks.
Will resubmit in a second.
Thanks,
Wolfgang.
^ permalink raw reply
* [PATCH][RESEND] myri10ge: improve port type reporting in ethtool
From: Brice Goglin @ 2009-10-20 6:21 UTC (permalink / raw)
To: David S. Miller; +Cc: Linux Network Development list, Ben Hutchings
Improve the reporting of myri10ge port type in ethtool,
and update for new boards.
Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Andrew Gallatin <gallatin@myri.com>
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index 29c9fe2..5319db9 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -75,7 +75,7 @@
#include "myri10ge_mcp.h"
#include "myri10ge_mcp_gen_header.h"
-#define MYRI10GE_VERSION_STR "1.5.0-1.432"
+#define MYRI10GE_VERSION_STR "1.5.1-1.451"
MODULE_DESCRIPTION("Myricom 10G driver (10GbE)");
MODULE_AUTHOR("Maintainer: help@myri.com");
@@ -1623,10 +1623,21 @@ myri10ge_get_settings(struct net_device *netdev, struct ethtool_cmd *cmd)
return 0;
}
}
- if (*ptr == 'R' || *ptr == 'Q') {
- /* We've found either an XFP or quad ribbon fiber */
+ if (*ptr == '2')
+ ptr++;
+ if (*ptr == 'R' || *ptr == 'Q' || *ptr == 'S') {
+ /* We've found either an XFP, quad ribbon fiber, or SFP+ */
cmd->port = PORT_FIBRE;
+ cmd->supported |= SUPPORTED_FIBRE;
+ cmd->advertising |= ADVERTISED_FIBRE;
+ } else {
+ cmd->port = PORT_OTHER;
}
+ if (*ptr == 'R' || *ptr == 'S')
+ cmd->transceiver = XCVR_EXTERNAL;
+ else
+ cmd->transceiver = XCVR_INTERNAL;
+
return 0;
}
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox