* Re: [PATCH] USB host CDC Phonet network interface driver
From: Alan Cox @ 2009-07-22 9:11 UTC (permalink / raw)
To: Oliver Neukum
Cc: Rémi Denis-Courmont, ext Dan Williams,
netdev@vger.kernel.org, linux-usb@vger.kernel.org,
ext Marcel Holtmann
In-Reply-To: <200907221041.51995.oliver@neukum.org>
> The AT stuff is really problematic. Look at the hoops ISDN and software
> modem drivers go through to emulate AT commands. I know even of a CDC-ACM
> modem which can't deal with AT commands inline (that's within spec).
> It seems to me we should have a modem API in kernel.
For devices which don't deal in AT commands probably but for devices
whose firmware provides an AT command interface over serial I would
disagree.
^ permalink raw reply
* the maximal speed of pktgen with 1Gbps NIC
From: jon_zhou @ 2009-07-22 8:57 UTC (permalink / raw)
To: netdev
In-Reply-To: <Pine.LNX.4.64.0907221032290.2211@zuben.voltaire.com>
hi
anyone knows the maximal speed of pktgen with 1Gbps NIC?
on my pc, the maximal speed is 500 Mbps when the packet size is 100 bytes(with boardcom 5755)
possibly more fast?
Regards,
zhou rui
^ permalink raw reply
* [PATCH] TCP: Add comments to (near) all functions in tcp_output.c v3
From: Andi Kleen @ 2009-07-22 9:00 UTC (permalink / raw)
To: davem, netdev
TCP: Add comments to (near) all functions in tcp_output.c v3
While looking for something else I spent some time adding
one liner comments to the tcp_output.c functions that
didn't have any. That makes the comments more consistent.
I hope I documented everything right.
No code changes.
v2: Incorporated feedback from Ilpo.
v3: Change style of one liner comments, add a few more comments.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
net/ipv4/tcp_output.c | 58 +++++++++++++++++++++++++++++++++++++-------------
1 file changed, 44 insertions(+), 14 deletions(-)
Index: linux-2.6.31-rc3-ak/net/ipv4/tcp_output.c
===================================================================
--- linux-2.6.31-rc3-ak.orig/net/ipv4/tcp_output.c
+++ linux-2.6.31-rc3-ak/net/ipv4/tcp_output.c
@@ -59,6 +59,7 @@ int sysctl_tcp_base_mss __read_mostly =
/* By default, RFC2861 behavior. */
int sysctl_tcp_slow_start_after_idle __read_mostly = 1;
+/* Account for new data that has been sent to the network. */
static void tcp_event_new_data_sent(struct sock *sk, struct sk_buff *skb)
{
struct tcp_sock *tp = tcp_sk(sk);
@@ -142,6 +143,7 @@ static void tcp_cwnd_restart(struct sock
tp->snd_cwnd_used = 0;
}
+/* Congestion state accounting after a packet has been sent. */
static void tcp_event_data_sent(struct tcp_sock *tp,
struct sk_buff *skb, struct sock *sk)
{
@@ -161,6 +163,7 @@ static void tcp_event_data_sent(struct t
icsk->icsk_ack.pingpong = 1;
}
+/* Account for an ACK we sent. */
static inline void tcp_event_ack_sent(struct sock *sk, unsigned int pkts)
{
tcp_dec_quickack_mode(sk, pkts);
@@ -276,6 +279,7 @@ static u16 tcp_select_window(struct sock
return new_win;
}
+/* Packet ECN state for a SYN-ACK */
static inline void TCP_ECN_send_synack(struct tcp_sock *tp, struct sk_buff *skb)
{
TCP_SKB_CB(skb)->flags &= ~TCPCB_FLAG_CWR;
@@ -283,6 +287,7 @@ static inline void TCP_ECN_send_synack(s
TCP_SKB_CB(skb)->flags &= ~TCPCB_FLAG_ECE;
}
+/* Packet ECN state for a SYN. */
static inline void TCP_ECN_send_syn(struct sock *sk, struct sk_buff *skb)
{
struct tcp_sock *tp = tcp_sk(sk);
@@ -301,6 +306,9 @@ TCP_ECN_make_synack(struct request_sock
th->ece = 1;
}
+/* Set up ECN state for a packet on a ESTABLISHED socket that is about to
+ * be sent.
+ */
static inline void TCP_ECN_send(struct sock *sk, struct sk_buff *skb,
int tcp_header_len)
{
@@ -362,7 +370,9 @@ struct tcp_out_options {
__u32 tsval, tsecr; /* need to include OPTION_TS */
};
-/* Beware: Something in the Internet is very sensitive to the ordering of
+/* Write previously computed TCP options to the packet.
+ *
+ * Beware: Something in the Internet is very sensitive to the ordering of
* TCP options, we learned this through the hard way, so be careful here.
* Luckily we can at least blame others for their non-compliance but from
* inter-operatibility perspective it seems that we're somewhat stuck with
@@ -445,6 +455,9 @@ static void tcp_options_write(__be32 *pt
}
}
+/* Compute TCP options for SYN packets. This is not the final
+ * network wire format yet.
+ */
static unsigned tcp_syn_options(struct sock *sk, struct sk_buff *skb,
struct tcp_out_options *opts,
struct tcp_md5sig_key **md5) {
@@ -493,6 +506,7 @@ static unsigned tcp_syn_options(struct s
return size;
}
+/* Set up TCP options for SYN-ACKs. */
static unsigned tcp_synack_options(struct sock *sk,
struct request_sock *req,
unsigned mss, struct sk_buff *skb,
@@ -541,6 +555,9 @@ static unsigned tcp_synack_options(struc
return size;
}
+/* Compute TCP options for ESTABLISHED sockets. This is not the
+ * final wire format yet.
+ */
static unsigned tcp_established_options(struct sock *sk, struct sk_buff *skb,
struct tcp_out_options *opts,
struct tcp_md5sig_key **md5) {
@@ -705,7 +722,7 @@ static int tcp_transmit_skb(struct sock
return net_xmit_eval(err);
}
-/* This routine just queue's the buffer
+/* This routine just queues the buffer for sending.
*
* NOTE: probe0 timer is not checked, do not forget tcp_push_pending_frames,
* otherwise socket can stall.
@@ -722,6 +739,7 @@ static void tcp_queue_skb(struct sock *s
sk_mem_charge(sk, skb->truesize);
}
+/* Initialize TSO segments for a packet. */
static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb,
unsigned int mss_now)
{
@@ -909,6 +927,7 @@ static void __pskb_trim_head(struct sk_b
skb->len = skb->data_len;
}
+/* Remove acked data from a packet in the transmit queue. */
int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len)
{
if (skb_cloned(skb) && pskb_expand_head(skb, 0, 0, GFP_ATOMIC))
@@ -937,7 +956,7 @@ int tcp_trim_head(struct sock *sk, struc
return 0;
}
-/* Not accounting for SACKs here. */
+/* Calculate MSS. Not accounting for SACKs here. */
int tcp_mtu_to_mss(struct sock *sk, int pmtu)
{
struct tcp_sock *tp = tcp_sk(sk);
@@ -981,6 +1000,7 @@ int tcp_mss_to_mtu(struct sock *sk, int
return mtu;
}
+/* MTU probing init per socket */
void tcp_mtup_init(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
@@ -1143,7 +1163,8 @@ static inline unsigned int tcp_cwnd_test
return 0;
}
-/* This must be invoked the first time we consider transmitting
+/* Intialize TSO state of a skb.
+ * This must be invoked the first time we consider transmitting
* SKB onto the wire.
*/
static int tcp_init_tso_segs(struct sock *sk, struct sk_buff *skb,
@@ -1158,6 +1179,7 @@ static int tcp_init_tso_segs(struct sock
return tso_segs;
}
+/* Minshall's variant of the Nagle send check. */
static inline int tcp_minshall_check(const struct tcp_sock *tp)
{
return after(tp->snd_sml, tp->snd_una) &&
@@ -1242,6 +1264,7 @@ static unsigned int tcp_snd_test(struct
return cwnd_quota;
}
+/* Test if sending is allowed right now. */
int tcp_may_send_now(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
@@ -1378,6 +1401,10 @@ send_now:
}
/* Create a new MTU probe if we are ready.
+ * MTU probe is regularly attempting to increase the path MTU by
+ * deliberately sending larger packets. This discovers routing
+ * changes resulting in larger path MTUs.
+ *
* Returns 0 if we should wait to probe (no cwnd available),
* 1 if a probe was sent,
* -1 otherwise
@@ -1790,6 +1817,7 @@ static void tcp_collapse_retrans(struct
sk_wmem_free_skb(sk, next_skb);
}
+/* Check if coalescing SKBs is legal. */
static int tcp_can_collapse(struct sock *sk, struct sk_buff *skb)
{
if (tcp_skb_pcount(skb) > 1)
@@ -1808,6 +1836,9 @@ static int tcp_can_collapse(struct sock
return 1;
}
+/* Collapse packets in the retransmit queue to make to create
+ * less packets on the wire. This is only done on retransmission.
+ */
static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *to,
int space)
{
@@ -1957,6 +1988,9 @@ int tcp_retransmit_skb(struct sock *sk,
return err;
}
+/* Check if we forward retransmits are possible in the current
+ * window/congestion state.
+ */
static int tcp_can_forward_retransmit(struct sock *sk)
{
const struct inet_connection_sock *icsk = inet_csk(sk);
@@ -2145,7 +2179,8 @@ void tcp_send_active_reset(struct sock *
TCP_INC_STATS(sock_net(sk), TCP_MIB_OUTRSTS);
}
-/* WARNING: This routine must only be called when we have already sent
+/* Send a crossed SYN-ACK during socket establishment.
+ * WARNING: This routine must only be called when we have already sent
* a SYN packet that crossed the incoming SYN that caused this routine
* to get called. If this assumption fails then the initial rcv_wnd
* and rcv_wscale values will not be correct.
@@ -2180,9 +2215,7 @@ int tcp_send_synack(struct sock *sk)
return tcp_transmit_skb(sk, skb, 1, GFP_ATOMIC);
}
-/*
- * Prepare a SYN-ACK.
- */
+/* Prepare a SYN-ACK. */
struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst,
struct request_sock *req)
{
@@ -2269,9 +2302,7 @@ struct sk_buff *tcp_make_synack(struct s
return skb;
}
-/*
- * Do all connect socket setups that can be done AF independent.
- */
+/* Do all connect socket setups that can be done AF independent. */
static void tcp_connect_init(struct sock *sk)
{
struct dst_entry *dst = __sk_dst_get(sk);
@@ -2330,9 +2361,7 @@ static void tcp_connect_init(struct sock
tcp_clear_retrans(tp);
}
-/*
- * Build a SYN and send it off.
- */
+/* Build a SYN and send it off. */
int tcp_connect(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
@@ -2493,6 +2522,7 @@ static int tcp_xmit_probe_skb(struct soc
return tcp_transmit_skb(sk, skb, 0, GFP_ATOMIC);
}
+/* Initiate keepalive or window probe from timer. */
int tcp_write_wakeup(struct sock *sk)
{
struct tcp_sock *tp = tcp_sk(sk);
^ permalink raw reply
* Re: [PATCH] USB host CDC Phonet network interface driver
From: Oliver Neukum @ 2009-07-22 8:41 UTC (permalink / raw)
To: Rémi Denis-Courmont
Cc: ext Dan Williams, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
ext Marcel Holtmann
In-Reply-To: <200907221137.07005.remi.denis-courmont-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
Am Mittwoch, 22. Juli 2009 10:37:06 schrieb Rémi Denis-Courmont:
> I guess in a perfect world, Linux would provide a common control interface
> for GPRS as it already does WiFi (and maybe soon will for WiMAX?). But I am
> not sure we can unify AT+PPP, Phonet, AT+Ethernet and who knows what else,
> behind a common Netlink interface, especially as AT commands have always
> been done in userland anyway.
The AT stuff is really problematic. Look at the hoops ISDN and software
modem drivers go through to emulate AT commands. I know even of a CDC-ACM
modem which can't deal with AT commands inline (that's within spec).
It seems to me we should have a modem API in kernel.
Regards
Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] USB host CDC Phonet network interface driver
From: Alan Cox @ 2009-07-22 8:40 UTC (permalink / raw)
To: Rémi Denis-Courmont
Cc: ext Dan Williams, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
ext Marcel Holtmann
In-Reply-To: <200907221137.07005.remi.denis-courmont-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
> provides data path (IPv4 or IPv6 packets) and flow control. But GPRS context
> credentials, IP/DNS parameters, setup/teardown, etc, are missing. I am not
> sure where the user/kernel split should be here...
As much as possible in user space for set up and tear down processing of
connections (negotiation etc). I've been poking in the background at a
kernel side GSM mux implementation but keep getting side tracked into
other work. other than the mux (where you have 3G stuff with high data
rates to demux efficiently) I'm not sure much else should be kernel side.
User space platform code yes - kernel no.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] USB host CDC Phonet network interface driver
From: Rémi Denis-Courmont @ 2009-07-22 8:37 UTC (permalink / raw)
To: ext Dan Williams
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
ext Marcel Holtmann
In-Reply-To: <1248184373.6558.15.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
On Tuesday 21 July 2009 16:52:53 ext Dan Williams wrote:
> > This was tested against Nokia E61, Nokia N95, and the existing Phonet
> > gadget function for the Linux composite USB gadget framework.
>
> Is there an example somewhere of how to use Phonet to get a mobile
> broadband connection in place of usb-serial and PPP?
Not yet, I'm afraid.
> I've read the
> Phonet protocol description and other random docs I can find, but can't
> figure out how that would work. Or does "PC Suite" mode not support
> that?
PC suite does provide access to packet data. The existing pn_pep kernel module
provides data path (IPv4 or IPv6 packets) and flow control. But GPRS context
credentials, IP/DNS parameters, setup/teardown, etc, are missing. I am not
sure where the user/kernel split should be here...
I guess in a perfect world, Linux would provide a common control interface for
GPRS as it already does WiFi (and maybe soon will for WiMAX?). But I am not
sure we can unify AT+PPP, Phonet, AT+Ethernet and who knows what else, behind
a common Netlink interface, especially as AT commands have always been done in
userland anyway.
Or what did you have in mind?
--
Rémi Denis-Courmont
Nokia Devices R&D, Maemo Software, Helsinki
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH net-next-2.6] af_packet: style cleanups
From: Eric Dumazet @ 2009-07-22 7:57 UTC (permalink / raw)
To: David S. Miller; +Cc: Linux Netdev List
Some style cleanups to match current code practices.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
net/packet/af_packet.c | 246 +++++++++++++++++++--------------------
1 files changed, 122 insertions(+), 124 deletions(-)
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index ebe5718..d3d52c6 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -137,8 +137,7 @@ dev->hard_header == NULL (ll header is added by device, we cannot control it)
/* Private packet socket structures. */
-struct packet_mclist
-{
+struct packet_mclist {
struct packet_mclist *next;
int ifindex;
int count;
@@ -149,8 +148,7 @@ struct packet_mclist
/* identical to struct packet_mreq except it has
* a longer address field.
*/
-struct packet_mreq_max
-{
+struct packet_mreq_max {
int mr_ifindex;
unsigned short mr_type;
unsigned short mr_alen;
@@ -162,7 +160,7 @@ static int packet_set_ring(struct sock *sk, struct tpacket_req *req,
int closing, int tx_ring);
struct packet_ring_buffer {
- char * *pg_vec;
+ char **pg_vec;
unsigned int head;
unsigned int frames_per_block;
unsigned int frame_size;
@@ -239,7 +237,7 @@ static void __packet_set_status(struct packet_sock *po, void *frame, int status)
flush_dcache_page(virt_to_page(&h.h2->tp_status));
break;
default:
- printk(KERN_ERR "TPACKET version not supported\n");
+ pr_err("TPACKET version not supported\n");
BUG();
}
@@ -265,7 +263,7 @@ static int __packet_get_status(struct packet_sock *po, void *frame)
flush_dcache_page(virt_to_page(&h.h2->tp_status));
return h.h2->tp_status;
default:
- printk(KERN_ERR "TPACKET version not supported\n");
+ pr_err("TPACKET version not supported\n");
BUG();
return 0;
}
@@ -327,7 +325,7 @@ static void packet_sock_destruct(struct sock *sk)
WARN_ON(atomic_read(&sk->sk_wmem_alloc));
if (!sock_flag(sk, SOCK_DEAD)) {
- printk("Attempt to release alive packet socket: %p\n", sk);
+ pr_err("Attempt to release alive packet socket: %p\n", sk);
return;
}
@@ -339,7 +337,8 @@ static const struct proto_ops packet_ops;
static const struct proto_ops packet_ops_spkt;
-static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
+static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev,
+ struct packet_type *pt, struct net_device *orig_dev)
{
struct sock *sk;
struct sockaddr_pkt *spkt;
@@ -368,7 +367,8 @@ static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev, struct
if (dev_net(dev) != sock_net(sk))
goto out;
- if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)
+ skb = skb_share_check(skb, GFP_ATOMIC);
+ if (skb == NULL)
goto oom;
/* drop any routing info */
@@ -394,7 +394,7 @@ static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev, struct
* to prevent sockets using all the memory up.
*/
- if (sock_queue_rcv_skb(sk,skb) == 0)
+ if (sock_queue_rcv_skb(sk, skb) == 0)
return 0;
out:
@@ -413,25 +413,23 @@ static int packet_sendmsg_spkt(struct kiocb *iocb, struct socket *sock,
struct msghdr *msg, size_t len)
{
struct sock *sk = sock->sk;
- struct sockaddr_pkt *saddr=(struct sockaddr_pkt *)msg->msg_name;
+ struct sockaddr_pkt *saddr = (struct sockaddr_pkt *)msg->msg_name;
struct sk_buff *skb;
struct net_device *dev;
- __be16 proto=0;
+ __be16 proto = 0;
int err;
/*
* Get and verify the address.
*/
- if (saddr)
- {
+ if (saddr) {
if (msg->msg_namelen < sizeof(struct sockaddr))
- return(-EINVAL);
- if (msg->msg_namelen==sizeof(struct sockaddr_pkt))
- proto=saddr->spkt_protocol;
- }
- else
- return(-ENOTCONN); /* SOCK_PACKET must be sent giving an address */
+ return -EINVAL;
+ if (msg->msg_namelen == sizeof(struct sockaddr_pkt))
+ proto = saddr->spkt_protocol;
+ } else
+ return -ENOTCONN; /* SOCK_PACKET must be sent giving an address */
/*
* Find the device first to size check it
@@ -448,8 +446,8 @@ static int packet_sendmsg_spkt(struct kiocb *iocb, struct socket *sock,
goto out_unlock;
/*
- * You may not queue a frame bigger than the mtu. This is the lowest level
- * raw protocol and you must do your own fragmentation at this level.
+ * You may not queue a frame bigger than the mtu. This is the lowest level
+ * raw protocol and you must do your own fragmentation at this level.
*/
err = -EMSGSIZE;
@@ -460,9 +458,9 @@ static int packet_sendmsg_spkt(struct kiocb *iocb, struct socket *sock,
skb = sock_wmalloc(sk, len + LL_RESERVED_SPACE(dev), 0, GFP_KERNEL);
/*
- * If the write buffer is full, then tough. At this level the user gets to
- * deal with the problem - do your own algorithmic backoffs. That's far
- * more flexible.
+ * If the write buffer is full, then tough. At this level the user
+ * gets to deal with the problem - do your own algorithmic backoffs.
+ * That's far more flexible.
*/
if (skb == NULL)
@@ -488,7 +486,7 @@ static int packet_sendmsg_spkt(struct kiocb *iocb, struct socket *sock,
}
/* Returns -EFAULT on error */
- err = memcpy_fromiovec(skb_put(skb,len), msg->msg_iov, len);
+ err = memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len);
skb->protocol = proto;
skb->dev = dev;
skb->priority = sk->sk_priority;
@@ -501,7 +499,7 @@ static int packet_sendmsg_spkt(struct kiocb *iocb, struct socket *sock,
dev_queue_xmit(skb);
dev_put(dev);
- return(len);
+ return len;
out_free:
kfree_skb(skb);
@@ -537,12 +535,13 @@ static inline unsigned int run_filter(struct sk_buff *skb, struct sock *sk,
we will not harm anyone.
*/
-static int packet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
+static int packet_rcv(struct sk_buff *skb, struct net_device *dev,
+ struct packet_type *pt, struct net_device *orig_dev)
{
struct sock *sk;
struct sockaddr_ll *sll;
struct packet_sock *po;
- u8 * skb_head = skb->data;
+ u8 *skb_head = skb->data;
int skb_len = skb->len;
unsigned int snaplen, res;
@@ -648,7 +647,8 @@ drop:
}
#ifdef CONFIG_PACKET_MMAP
-static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
+static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
+ struct packet_type *pt, struct net_device *orig_dev)
{
struct sock *sk;
struct packet_sock *po;
@@ -658,7 +658,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, struct packe
struct tpacket2_hdr *h2;
void *raw;
} h;
- u8 * skb_head = skb->data;
+ u8 *skb_head = skb->data;
int skb_len = skb->len;
unsigned int snaplen, res;
unsigned long status = TP_STATUS_LOSING|TP_STATUS_USER;
@@ -821,7 +821,7 @@ ring_is_full:
static void tpacket_destruct_skb(struct sk_buff *skb)
{
struct packet_sock *po = pkt_sk(skb->sk);
- void * ph;
+ void *ph;
BUG_ON(skb == NULL);
@@ -836,9 +836,9 @@ static void tpacket_destruct_skb(struct sk_buff *skb)
sock_wfree(skb);
}
-static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff * skb,
- void * frame, struct net_device *dev, int size_max,
- __be16 proto, unsigned char * addr)
+static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,
+ void *frame, struct net_device *dev, int size_max,
+ __be16 proto, unsigned char *addr)
{
union {
struct tpacket_hdr *h1;
@@ -867,8 +867,7 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff * skb,
break;
}
if (unlikely(tp_len > size_max)) {
- printk(KERN_ERR "packet size is too long (%d > %d)\n",
- tp_len, size_max);
+ pr_err("packet size is too long (%d > %d)\n", tp_len, size_max);
return -EMSGSIZE;
}
@@ -883,12 +882,11 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff * skb,
NULL, tp_len);
if (unlikely(err < 0))
return -EINVAL;
- } else if (dev->hard_header_len ) {
+ } else if (dev->hard_header_len) {
/* net device doesn't like empty head */
if (unlikely(tp_len <= dev->hard_header_len)) {
- printk(KERN_ERR "packet size is too short "
- "(%d < %d)\n", tp_len,
- dev->hard_header_len);
+ pr_err("packet size is too short (%d < %d)\n",
+ tp_len, dev->hard_header_len);
return -EINVAL;
}
@@ -917,9 +915,8 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff * skb,
nr_frags = skb_shinfo(skb)->nr_frags;
if (unlikely(nr_frags >= MAX_SKB_FRAGS)) {
- printk(KERN_ERR "Packet exceed the number "
- "of skb frags(%lu)\n",
- MAX_SKB_FRAGS);
+ pr_err("Packet exceed the number of skb frags(%lu)\n",
+ MAX_SKB_FRAGS);
return -EFAULT;
}
@@ -944,8 +941,8 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg)
struct net_device *dev;
__be16 proto;
int ifindex, err, reserve = 0;
- void * ph;
- struct sockaddr_ll *saddr=(struct sockaddr_ll *)msg->msg_name;
+ void *ph;
+ struct sockaddr_ll *saddr = (struct sockaddr_ll *)msg->msg_name;
int tp_len, size_max;
unsigned char *addr;
int len_sum = 0;
@@ -1038,8 +1035,7 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg)
goto out_xmit;
packet_increment_head(&po->tx_ring);
len_sum += tp_len;
- }
- while (likely((ph != NULL) || ((!(msg->msg_flags & MSG_DONTWAIT))
+ } while (likely((ph != NULL) || ((!(msg->msg_flags & MSG_DONTWAIT))
&& (atomic_read(&po->tx_ring.pending))))
);
@@ -1064,7 +1060,7 @@ static int packet_snd(struct socket *sock,
struct msghdr *msg, size_t len)
{
struct sock *sk = sock->sk;
- struct sockaddr_ll *saddr=(struct sockaddr_ll *)msg->msg_name;
+ struct sockaddr_ll *saddr = (struct sockaddr_ll *)msg->msg_name;
struct sk_buff *skb;
struct net_device *dev;
__be16 proto;
@@ -1110,7 +1106,7 @@ static int packet_snd(struct socket *sock,
skb = sock_alloc_send_skb(sk, len + LL_ALLOCATED_SPACE(dev),
msg->msg_flags & MSG_DONTWAIT, &err);
- if (skb==NULL)
+ if (skb == NULL)
goto out_unlock;
skb_reserve(skb, LL_RESERVED_SPACE(dev));
@@ -1122,7 +1118,7 @@ static int packet_snd(struct socket *sock,
goto out_free;
/* Returns -EFAULT on error */
- err = memcpy_fromiovec(skb_put(skb,len), msg->msg_iov, len);
+ err = memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len);
if (err)
goto out_free;
@@ -1140,7 +1136,7 @@ static int packet_snd(struct socket *sock,
dev_put(dev);
- return(len);
+ return len;
out_free:
kfree_skb(skb);
@@ -1283,9 +1279,10 @@ out_unlock:
* Bind a packet socket to a device
*/
-static int packet_bind_spkt(struct socket *sock, struct sockaddr *uaddr, int addr_len)
+static int packet_bind_spkt(struct socket *sock, struct sockaddr *uaddr,
+ int addr_len)
{
- struct sock *sk=sock->sk;
+ struct sock *sk = sock->sk;
char name[15];
struct net_device *dev;
int err = -ENODEV;
@@ -1296,7 +1293,7 @@ static int packet_bind_spkt(struct socket *sock, struct sockaddr *uaddr, int add
if (addr_len != sizeof(struct sockaddr))
return -EINVAL;
- strlcpy(name,uaddr->sa_data,sizeof(name));
+ strlcpy(name, uaddr->sa_data, sizeof(name));
dev = dev_get_by_name(sock_net(sk), name);
if (dev) {
@@ -1308,8 +1305,8 @@ static int packet_bind_spkt(struct socket *sock, struct sockaddr *uaddr, int add
static int packet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
{
- struct sockaddr_ll *sll = (struct sockaddr_ll*)uaddr;
- struct sock *sk=sock->sk;
+ struct sockaddr_ll *sll = (struct sockaddr_ll *)uaddr;
+ struct sock *sk = sock->sk;
struct net_device *dev = NULL;
int err;
@@ -1404,7 +1401,7 @@ static int packet_create(struct net *net, struct socket *sock, int protocol)
sk_add_node(sk, &net->packet.sklist);
sock_prot_inuse_add(net, &packet_proto, 1);
write_unlock_bh(&net->packet.sklist_lock);
- return(0);
+ return 0;
out:
return err;
}
@@ -1441,7 +1438,7 @@ static int packet_recvmsg(struct kiocb *iocb, struct socket *sock,
* but then it will block.
*/
- skb=skb_recv_datagram(sk,flags,flags&MSG_DONTWAIT,&err);
+ skb = skb_recv_datagram(sk, flags, flags & MSG_DONTWAIT, &err);
/*
* An error occurred so return it. Because skb_recv_datagram()
@@ -1469,10 +1466,9 @@ static int packet_recvmsg(struct kiocb *iocb, struct socket *sock,
*/
copied = skb->len;
- if (copied > len)
- {
- copied=len;
- msg->msg_flags|=MSG_TRUNC;
+ if (copied > len) {
+ copied = len;
+ msg->msg_flags |= MSG_TRUNC;
}
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
@@ -1539,7 +1535,7 @@ static int packet_getname(struct socket *sock, struct sockaddr *uaddr,
struct net_device *dev;
struct sock *sk = sock->sk;
struct packet_sock *po = pkt_sk(sk);
- struct sockaddr_ll *sll = (struct sockaddr_ll*)uaddr;
+ struct sockaddr_ll *sll = (struct sockaddr_ll *)uaddr;
if (peer)
return -EOPNOTSUPP;
@@ -1584,14 +1580,15 @@ static int packet_dev_mc(struct net_device *dev, struct packet_mclist *i,
else
return dev_unicast_delete(dev, i->addr);
break;
- default:;
+ default:
+ break;
}
return 0;
}
static void packet_dev_mclist(struct net_device *dev, struct packet_mclist *i, int what)
{
- for ( ; i; i=i->next) {
+ for ( ; i; i = i->next) {
if (i->ifindex == dev->ifindex)
packet_dev_mc(dev, i, what);
}
@@ -1693,7 +1690,8 @@ static void packet_flush_mclist(struct sock *sk)
struct net_device *dev;
po->mclist = ml->next;
- if ((dev = dev_get_by_index(sock_net(sk), ml->ifindex)) != NULL) {
+ dev = dev_get_by_index(sock_net(sk), ml->ifindex);
+ if (dev != NULL) {
packet_dev_mc(dev, ml, -1);
dev_put(dev);
}
@@ -1723,7 +1721,7 @@ packet_setsockopt(struct socket *sock, int level, int optname, char __user *optv
return -EINVAL;
if (len > sizeof(mreq))
len = sizeof(mreq);
- if (copy_from_user(&mreq,optval,len))
+ if (copy_from_user(&mreq, optval, len))
return -EFAULT;
if (len < (mreq.mr_alen + offsetof(struct packet_mreq, mr_address)))
return -EINVAL;
@@ -1740,9 +1738,9 @@ packet_setsockopt(struct socket *sock, int level, int optname, char __user *optv
{
struct tpacket_req req;
- if (optlen<sizeof(req))
+ if (optlen < sizeof(req))
return -EINVAL;
- if (copy_from_user(&req,optval,sizeof(req)))
+ if (copy_from_user(&req, optval, sizeof(req)))
return -EFAULT;
return packet_set_ring(sk, &req, 0, optname == PACKET_TX_RING);
}
@@ -1750,9 +1748,9 @@ packet_setsockopt(struct socket *sock, int level, int optname, char __user *optv
{
int val;
- if (optlen!=sizeof(val))
+ if (optlen != sizeof(val))
return -EINVAL;
- if (copy_from_user(&val,optval,sizeof(val)))
+ if (copy_from_user(&val, optval, sizeof(val)))
return -EFAULT;
pkt_sk(sk)->copy_thresh = val;
@@ -1985,51 +1983,51 @@ static int packet_ioctl(struct socket *sock, unsigned int cmd,
struct sock *sk = sock->sk;
switch (cmd) {
- case SIOCOUTQ:
- {
- int amount = sk_wmem_alloc_get(sk);
+ case SIOCOUTQ:
+ {
+ int amount = sk_wmem_alloc_get(sk);
- return put_user(amount, (int __user *)arg);
- }
- case SIOCINQ:
- {
- struct sk_buff *skb;
- int amount = 0;
-
- spin_lock_bh(&sk->sk_receive_queue.lock);
- skb = skb_peek(&sk->sk_receive_queue);
- if (skb)
- amount = skb->len;
- spin_unlock_bh(&sk->sk_receive_queue.lock);
- return put_user(amount, (int __user *)arg);
- }
- case SIOCGSTAMP:
- return sock_get_timestamp(sk, (struct timeval __user *)arg);
- case SIOCGSTAMPNS:
- return sock_get_timestampns(sk, (struct timespec __user *)arg);
+ return put_user(amount, (int __user *)arg);
+ }
+ case SIOCINQ:
+ {
+ struct sk_buff *skb;
+ int amount = 0;
+
+ spin_lock_bh(&sk->sk_receive_queue.lock);
+ skb = skb_peek(&sk->sk_receive_queue);
+ if (skb)
+ amount = skb->len;
+ spin_unlock_bh(&sk->sk_receive_queue.lock);
+ return put_user(amount, (int __user *)arg);
+ }
+ case SIOCGSTAMP:
+ return sock_get_timestamp(sk, (struct timeval __user *)arg);
+ case SIOCGSTAMPNS:
+ return sock_get_timestampns(sk, (struct timespec __user *)arg);
#ifdef CONFIG_INET
- case SIOCADDRT:
- case SIOCDELRT:
- case SIOCDARP:
- case SIOCGARP:
- case SIOCSARP:
- case SIOCGIFADDR:
- case SIOCSIFADDR:
- case SIOCGIFBRDADDR:
- case SIOCSIFBRDADDR:
- case SIOCGIFNETMASK:
- case SIOCSIFNETMASK:
- case SIOCGIFDSTADDR:
- case SIOCSIFDSTADDR:
- case SIOCSIFFLAGS:
- if (!net_eq(sock_net(sk), &init_net))
- return -ENOIOCTLCMD;
- return inet_dgram_ops.ioctl(sock, cmd, arg);
+ case SIOCADDRT:
+ case SIOCDELRT:
+ case SIOCDARP:
+ case SIOCGARP:
+ case SIOCSARP:
+ case SIOCGIFADDR:
+ case SIOCSIFADDR:
+ case SIOCGIFBRDADDR:
+ case SIOCSIFBRDADDR:
+ case SIOCGIFNETMASK:
+ case SIOCSIFNETMASK:
+ case SIOCGIFDSTADDR:
+ case SIOCSIFDSTADDR:
+ case SIOCSIFFLAGS:
+ if (!net_eq(sock_net(sk), &init_net))
+ return -ENOIOCTLCMD;
+ return inet_dgram_ops.ioctl(sock, cmd, arg);
#endif
- default:
- return -ENOIOCTLCMD;
+ default:
+ return -ENOIOCTLCMD;
}
return 0;
}
@@ -2039,7 +2037,7 @@ static int packet_ioctl(struct socket *sock, unsigned int cmd,
#define packet_poll datagram_poll
#else
-static unsigned int packet_poll(struct file * file, struct socket *sock,
+static unsigned int packet_poll(struct file *file, struct socket *sock,
poll_table *wait)
{
struct sock *sk = sock->sk;
@@ -2069,7 +2067,7 @@ static unsigned int packet_poll(struct file * file, struct socket *sock,
static void packet_mm_open(struct vm_area_struct *vma)
{
struct file *file = vma->vm_file;
- struct socket * sock = file->private_data;
+ struct socket *sock = file->private_data;
struct sock *sk = sock->sk;
if (sk)
@@ -2079,7 +2077,7 @@ static void packet_mm_open(struct vm_area_struct *vma)
static void packet_mm_close(struct vm_area_struct *vma)
{
struct file *file = vma->vm_file;
- struct socket * sock = file->private_data;
+ struct socket *sock = file->private_data;
struct sock *sk = sock->sk;
if (sk)
@@ -2087,8 +2085,8 @@ static void packet_mm_close(struct vm_area_struct *vma)
}
static struct vm_operations_struct packet_mmap_ops = {
- .open = packet_mm_open,
- .close =packet_mm_close,
+ .open = packet_mm_open,
+ .close = packet_mm_close,
};
static void free_pg_vec(char **pg_vec, unsigned int order, unsigned int len)
@@ -2239,8 +2237,8 @@ static int packet_set_ring(struct sock *sk, struct tpacket_req *req,
skb_queue_purge(rb_queue);
#undef XC
if (atomic_read(&po->mapped))
- printk(KERN_DEBUG "packet_mmap: vma is busy: %d\n",
- atomic_read(&po->mapped));
+ pr_err("packet_mmap: vma is busy: %d\n",
+ atomic_read(&po->mapped));
}
mutex_unlock(&po->pg_vec_lock);
@@ -2303,7 +2301,7 @@ static int packet_mmap(struct file *file, struct socket *sock,
int pg_num;
for (pg_num = 0; pg_num < rb->pg_vec_pages;
- pg_num++,page++) {
+ pg_num++, page++) {
err = vm_insert_page(vma, start, page);
if (unlikely(err))
goto out;
@@ -2372,7 +2370,7 @@ static struct net_proto_family packet_family_ops = {
};
static struct notifier_block packet_netdev_notifier = {
- .notifier_call =packet_notifier,
+ .notifier_call = packet_notifier,
};
#ifdef CONFIG_PROC_FS
@@ -2402,7 +2400,7 @@ static void *packet_seq_next(struct seq_file *seq, void *v, loff_t *pos)
++*pos;
return (v == SEQ_START_TOKEN)
? sk_head(&net->packet.sklist)
- : sk_next((struct sock*)v) ;
+ : sk_next((struct sock *)v) ;
}
static void packet_seq_stop(struct seq_file *seq, void *v)
@@ -2430,7 +2428,7 @@ static int packet_seq_show(struct seq_file *seq, void *v)
po->running,
atomic_read(&s->sk_rmem_alloc),
sock_i_uid(s),
- sock_i_ino(s) );
+ sock_i_ino(s));
}
return 0;
^ permalink raw reply related
* pktgen crash with 2.6.30
From: Or Gerlitz @ 2009-07-22 7:35 UTC (permalink / raw)
To: netdev
using the conf-1-1 script over 2.6.30 I came across this crash in few seconds,
I have found a sign for a similar report in the archives nor any fix in the
2.6..30 stable tree, did other people see this as well?
pktgen v2.70: Packet Generator for packet performance testing.
BUG: spinlock bad magic on CPU#0, kpktgend_0/21800
lock: ffff880215d27418, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
Pid: 21800, comm: kpktgend_0 Not tainted 2.6.30 #1
Call Trace:
[<ffffffff8032959f>] ? _raw_spin_lock+0x22/0x122
[<ffffffffa04a11f6>] ? pktgen_thread_worker+0xf45/0x126e [pktgen]
[<ffffffffa03ba037>] ? vlan_dev_hwaccel_hard_start_xmit+0x0/0x65 [8021q]
[<ffffffff8049ee1e>] ? thread_return+0x3e/0x97
[<ffffffff80246cda>] ? autoremove_wake_function+0x0/0x2e
[<ffffffffa04a02b1>] ? pktgen_thread_worker+0x0/0x126e [pktgen]
[<ffffffffa04a02b1>] ? pktgen_thread_worker+0x0/0x126e [pktgen]
[<ffffffff80246bd0>] ? kthread+0x54/0x84
[<ffffffff8020bdba>] ? child_rip+0xa/0x20
[<ffffffff804a065b>] ? _spin_unlock_irq+0xb/0xc
[<ffffffff80246b7c>] ? kthread+0x0/0x84
[<ffffffff8020bdb0>] ? child_rip+0x0/0x20
Or.
^ permalink raw reply
* Re: [PATCH] USB host CDC Phonet network interface driver
From: Rémi Denis-Courmont @ 2009-07-22 6:57 UTC (permalink / raw)
To: netdev@vger.kernel.org; +Cc: linux-usb@vger.kernel.org
In-Reply-To: <20090721.131816.116617596.davem@davemloft.net>
On Tuesday 21 July 2009 23:18:16 ext David Miller wrote:
> >> Applied, thanks.
> >
> > I think that Remi sent an updated version today.
>
> I'm pretty sure I applied the updated patch.
>
> I'll double check to make sure.
I guess I should put updated version as answers to older ones then?
Thanks every one for the reviews anyway!
--
Rémi Denis-Courmont
Nokia Devices R&D, Maemo Software, Helsinki
^ permalink raw reply
* Re: [patch 1/3] net: serialize hrtimer callback in sched_cbq
From: Peter Zijlstra @ 2009-07-22 6:29 UTC (permalink / raw)
To: David Miller; +Cc: torvalds, tglx, netdev, linux-kernel, kaber
In-Reply-To: <20090721.201855.32703627.davem@davemloft.net>
On Tue, 2009-07-21 at 20:18 -0700, David Miller wrote:
> From: Peter Zijlstra <peterz@infradead.org>
> Date: Fri, 17 Jul 2009 14:14:52 +0200
>
> > On Tue, 2009-07-14 at 09:42 -0700, Linus Torvalds wrote:
> >>
> >> On Tue, 14 Jul 2009, Peter Zijlstra wrote:
> >> >
> >> > Linus really hated the softirq mode, which is what prompted me to change
> >> > that.
> >> >
> >> > Now, it might be he only hated the particular interface and the
> >> > resulting code, but I think to remember he simply thought the whole
> >> > thing daft.
> >>
> >> Yes. And I hated the bugs it had.
> >>
> >> Don't make something as core as timers any more complicated. Don't take
> >> locks in timers and then complain about deadlocks. If your locking is
> >> broken, don't make the core timers be idiotically broken.
> >>
> >> Because it was. The code was a total mess to follow, and had bugs.
> >
> > How would something like the below work for people?
>
> I like it, but like Linus said it probably belongs in
> kernel/softirq.c
Right, I meant to rework it, but stuff kept preempting me. I'll try and
get around to it today :-)
^ permalink raw reply
* [GIT]: Networking
From: David Miller @ 2009-07-22 4:21 UTC (permalink / raw)
To: torvalds; +Cc: akpm, netdev, linux-kernel
1) TCP MD5 signature support was broken when an IPV4 connection
is made to an ipv6 listening socket. Fixes from John Dykstra.
2) Netfilter fixes via Patrick McHardy.
3) Fix races with sock refcounting in sock_copy(), from Eric
Dumazet.
4) Several "dereference before NULL check" fixes from Julia
Lawall.
5) E100 gets RX descriptor corruption on some platforms, fix
from Krzysztof Halasa.
6) CAN protocol fixes from Lothar Waßmann and Wolfgang Grandegger.
7) ATL1C has mis-placed parenthesis in some expressions, fixes
from Roel Kluin.
8) New driver for w90p910 MAC, from Wan ZongShun.
9) Bug fix for CDC-EEM crc checking, from Vincent CUISSARD.
10) SO_TIMESTAMPING sockopt returns bogus error code, fix from
Rémi Denis-Courmont.
11) New CDC Phonet USB driver also from Rémi Denis-Courmont.
12) When a device changes type, bonding multicast list must
be cleaned.
13) Two IXGBE bug fixes from Lucy Liu.
14) Device down race fix in SKY2 driver by Mike McCormack.
Also revert a bogus SKY2 shutdown change that broke
startup on some systems, from Stephen Hemminger.
15) Fix OOPS on moduleunload in macsonic/jazzsonic. From
Finn Thain.
16) Various MAINTAINER and email address updates from
Evgeniy Polyakov and Ralf Baechle.
Please pull, thanks a lot!
The following changes since commit e9e961c9a818a2f24711af493b907a8e40a69efc:
Linus Torvalds (1):
Merge branch 'i2c-for-2631-rc3' of git://aeryn.fluff.org.uk/bjdooks/linux
are available in the git repository at:
master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6.git master
Ben Dooks (1):
net: Micrel KS8851 SPI network driver
Cesar Eduardo Barros (1):
New device ID for sc92031 [1088:2031]
David S. Miller (1):
Merge branch 'master' of git://git.kernel.org/.../kaber/nf-2.6
Dhananjay Phadke (3):
netxen: fix context deletion sequence
netxen: fix deadlock on dev close
netxen: fix thermal check and shutdown
Eric Dumazet (2):
netfilter: nf_conntrack: nf_conntrack_alloc() fixes
net: sock_copy() fixes
Evgeniy Polyakov (1):
connector: maintainer/mail update.
Finn Thain (1):
macsonic, jazzsonic: fix oops on module unload
Joe Perches (1):
netfilter: add netfilter git to MAINTAINERS
John Dykstra (2):
tcp: Fix MD5 signature checking on IPv4 mapped sockets
tcp: Use correct peer adr when copying MD5 keys
Julia Lawall (3):
drivers/net: Move a dereference below a NULL test
drivers/net: Move a dereference below a NULL test
drivers/net/mlx4: Adjust constant
Ken Kawasaki (1):
3c589_cs: re-initialize the multicast in the tc589_reset
Krzysztof Halasa (1):
E100: work around the driver using streaming DMA mapping for RX descriptors.
Lothar Waßmann (2):
net/can bugfix: use after free bug in can protocol drivers
net/can: add module alias to can protocol drivers
Lucy Liu (2):
ixgbe: clear mac address data block in DCB mode
ixgbe: Remove DPRINTK messages in DCB mode
Mike McCormack (1):
sky2: Avoid races in sky2_down
Moni Shoua (1):
bonding: clean muticast addresses when device changes type
Patrick McHardy (1):
netfilter: xt_osf: fix nf_log_packet() arguments
Ralf Baechle (2):
MAINTAINERS entry for STRIP driver
Update Andreas Koensgen's email address
Rémi Denis-Courmont (2):
Fix error return for setsockopt(SO_TIMESTAMPING)
USB host CDC Phonet network interface driver
Stephen Hemminger (1):
sky2: revert shutdown changes
Uwe Kleine-König (1):
macsonic: move probe function to .devinit.text
Vincent CUISSARD (1):
cdc-eem: bad crc checking
Wan ZongShun (1):
Add mac driver for w90p910
Wolfgang Grandegger (3):
can: sja1000: remove duplicated includes
can: restart device even if dev_alloc_skb() fails
can: switch carrier on if device was stopped while in bus-off state
roel kluin (2):
atl1c: add missing parentheses
atl1c: misplaced parenthesis
CREDITS | 2 +-
Documentation/RCU/rculist_nulls.txt | 7 +-
Documentation/connector/cn_test.c | 4 +-
Documentation/connector/ucon.c | 2 +-
Documentation/networking/6pack.txt | 2 +-
MAINTAINERS | 11 +-
drivers/connector/cn_queue.c | 2 +-
drivers/connector/connector.c | 4 +-
drivers/net/Kconfig | 6 +
drivers/net/Makefile | 1 +
drivers/net/arm/Kconfig | 8 +
drivers/net/arm/Makefile | 1 +
drivers/net/arm/w90p910_ether.c | 1105 ++++++++++++++++++++++++++++
drivers/net/atl1c/atl1c.h | 8 +-
drivers/net/atl1c/atl1c_main.c | 2 +-
drivers/net/bnx2x_link.c | 3 +-
drivers/net/bonding/bond_main.c | 12 +-
drivers/net/can/dev.c | 8 +-
drivers/net/can/sja1000/sja1000.c | 1 -
drivers/net/e100.c | 3 +
drivers/net/hamradio/6pack.c | 2 +-
drivers/net/ibm_newemac/rgmii.c | 7 +-
drivers/net/ixgbe/ixgbe_dcb_nl.c | 6 +-
drivers/net/jazzsonic.c | 1 +
drivers/net/ks8851.c | 1322 ++++++++++++++++++++++++++++++++++
drivers/net/ks8851.h | 296 ++++++++
drivers/net/macsonic.c | 15 +-
drivers/net/mlx4/en_ethtool.c | 2 +-
drivers/net/netxen/netxen_nic.h | 3 +
drivers/net/netxen/netxen_nic_ctx.c | 13 +-
drivers/net/netxen/netxen_nic_hw.c | 9 +-
drivers/net/netxen/netxen_nic_init.c | 5 +-
drivers/net/netxen/netxen_nic_main.c | 36 +-
drivers/net/pcmcia/3c589_cs.c | 21 +-
drivers/net/sc92031.c | 1 +
drivers/net/sky2.c | 25 +-
drivers/net/usb/Kconfig | 8 +
drivers/net/usb/Makefile | 1 +
drivers/net/usb/cdc-phonet.c | 461 ++++++++++++
drivers/net/usb/cdc_eem.c | 2 +-
include/net/sock.h | 32 +-
include/net/tcp.h | 5 +
net/can/bcm.c | 4 +
net/can/raw.c | 4 +
net/core/sock.c | 22 +-
net/ipv4/tcp_ipv4.c | 3 +-
net/ipv4/tcp_output.c | 2 +-
net/ipv6/tcp_ipv6.c | 3 +-
net/netfilter/nf_conntrack_core.c | 21 +-
net/netfilter/xt_osf.c | 5 +-
50 files changed, 3417 insertions(+), 112 deletions(-)
create mode 100644 drivers/net/arm/w90p910_ether.c
create mode 100644 drivers/net/ks8851.c
create mode 100644 drivers/net/ks8851.h
create mode 100644 drivers/net/usb/cdc-phonet.c
^ permalink raw reply
* Re: [PATCH] sky2: Avoid races in sky2_down
From: David Miller @ 2009-07-22 4:00 UTC (permalink / raw)
To: mikem; +Cc: netdev
In-Reply-To: <392fb48f0907211750v101d51cbl531a6ed7199e4855@mail.gmail.com>
From: Mike McCormack <mikem@ring3k.org>
Date: Wed, 22 Jul 2009 09:50:41 +0900
> Reset rx chain before trying to drain it.
> Shut interrupts off last, incase there's something to report.
>
> Signed-off-by: Mike McCormack <mikem@ring3k.org>
> Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] igb/e1000e/e1000/e100: make wol usable
From: David Miller @ 2009-07-22 3:56 UTC (permalink / raw)
To: alexander.duyck
Cc: andy, john.ronciak, netdev, jeffrey.t.kirsher, jesse.brandeburg,
bruce.w.allan, peter.p.waskiewicz.jr, stable
In-Reply-To: <5f2db9d90907212025k31c3a941v5fd1be9ed171e4c1@mail.gmail.com>
From: Alexander Duyck <alexander.duyck@gmail.com>
Date: Tue, 21 Jul 2009 20:25:31 -0700
> My understanding was that the can_wakeup was supposed to be
> initialized by pci_pm_init or platform_pci_wakeup_init based on the
> pci-e capabilities. Is this not the case? It seems like this is
> where you should be looking to determine why the the can_wakeup isn't
> being initialized correctly.
>
> The patch below won't solve the problem either. The problem is that
> the can_wakeup value is being disabled when the EEPROM doesn't support
> WOL.
>
> If you have to do this in the drivers, then my suggestion is to take a
> look at how ixgbe is doing it. You essentially need to initialize
> can_wakeup to true, and then set the should_wakeup attribute based on
> the EEPROM setting or via ethtool. This way you can still toggle the
> should_wakeup option without being blocked by the EEPROM disabling it.
It looks like the approach needs to be worked out still, so
I'm tossing these patches from patchwork.
Let me know when a more final fix is ready.
Thanks.
^ permalink raw reply
* Re: Constantly varying download rate with a complex xen networking setup, why?
From: Bill Fink @ 2009-07-22 3:40 UTC (permalink / raw)
To: Ilpo Järvinen ; +Cc: Raphael Hertzog, Netdev
In-Reply-To: <alpine.DEB.2.00.0907211143100.10534@wel-95.cs.helsinki.fi>
On Tue, 21 Jul 2009, Ilpo Järvinen wrote:
> On Wed, 17 Jun 2009, Raphael Hertzog wrote:
>
> > Le mercredi 17 juin 2009, Ilpo Järvinen a écrit :
> >> On Wed, 17 Jun 2009, Raphael Hertzog wrote:
> >>
> >>> Le lundi 15 juin 2009, Ilpo Järvinen a écrit :
> >>>> Maybe the proxy interferes there somehow... I don't know enough about the
> >>>> details to say but I suppose the proxy at least breaks your tcp connection
> >>>> to two parts.
> >>>
> >>> Indeed. Is there some processing done in a simple linux bridge where the
> >>> reapperance of the same TCP packet that has been created and sent on another
> >>> local interface could create problem?
> >>
> >> I thought out had a http proxy in between? I suppose it is certainly doing
> >> more than bridging. Anyway, I'll be week away, so no quick responses are
> >> to be expected from my part after this mail.
> >
> > Well, I have the problem when I don't use the proxy... if I use it, the
> > download is split over two TCP connections and things are fine.
> >
> > Hence my question was if something could be confused by the fact that the
> > same packet is seen twice on the same machine once (in output) via
> > eth2/xenbrD and once (in forward) via xenbrE (the routing between both
> > bridges is done by the domU independently of the dom0 network config).
>
> Did you ever get tcpdumps btw? Looking into your setup it would probably
> be useful take it from all the interfaces where the packets are supposed
> to pass.
I don't know if the following has any applicability to your specific
situation, but I thought I'd mention it.
It has to do with what I call the non-transitivity of TCP network
performance. If you have something like the following scenario:
A <----LAN----> B <----WAN----> C
low RTT high RTT
Just because you have good TCP network performance from A to B, and
good TCP network performance from B to C, it does not necessarily
follow that you will also have good TCP network performance from A to C.
Consider the case where the B<->C path is clean, but there are problems
on the A<->B path (causing TCP retransmissions). The low RTT on the
A<->B path can mask the problems (basically TCP performs well in spite
of the problems because of the low RTT), but a transfer directly from
A to C performs poorly because the high RTT results in a very slow
ramp up in performance after a loss event.
Again, I have no idea if this applies in any way to your case.
-Bill
^ permalink raw reply
* Re: [PATCH] igb/e1000e/e1000/e100: make wol usable
From: Alexander Duyck @ 2009-07-22 3:25 UTC (permalink / raw)
To: Andy Gospodarek
Cc: Ronciak, John, netdev@vger.kernel.org, Kirsher, Jeffrey T,
Brandeburg, Jesse, Allan, Bruce W, Waskiewicz Jr, Peter P,
stable@kernel.org
In-Reply-To: <20090722022745.GM8515@gospo.rdu.redhat.com>
My understanding was that the can_wakeup was supposed to be
initialized by pci_pm_init or platform_pci_wakeup_init based on the
pci-e capabilities. Is this not the case? It seems like this is
where you should be looking to determine why the the can_wakeup isn't
being initialized correctly.
The patch below won't solve the problem either. The problem is that
the can_wakeup value is being disabled when the EEPROM doesn't support
WOL.
If you have to do this in the drivers, then my suggestion is to take a
look at how ixgbe is doing it. You essentially need to initialize
can_wakeup to true, and then set the should_wakeup attribute based on
the EEPROM setting or via ethtool. This way you can still toggle the
should_wakeup option without being blocked by the EEPROM disabling it.
Thanks,
Alex
On Tue, Jul 21, 2009 at 7:27 PM, Andy Gospodarek<andy@greyhouse.net> wrote:
> On Tue, Jul 21, 2009 at 02:59:31PM -0700, Ronciak, John wrote:
>> >-----Original Message-----
>> >From: Andy Gospodarek [mailto:andy@greyhouse.net]
>> >Sent: Tuesday, July 21, 2009 2:01 PM
>> >To: netdev@vger.kernel.org
>> >Cc: Kirsher, Jeffrey T; Brandeburg, Jesse; Allan, Bruce W;
>> >Waskiewicz Jr, Peter P; Ronciak, John; stable@kernel.org
>> >Subject: [PATCH] igb/e1000e/e1000/e100: make wol usable
>> >
>> >
>> >It seems that the patches that intended to use the new calls to check
>> >status and capabilities for WOL and fix it up:
>> >
>> > commit bc79fc8409b3dccbde072e8113cc1fb3fd876fc5
>> > Author: Rafael J. Wysocki <rjw@sisk.pl>
>> > Date: Wed Oct 29 14:22:18 2008 -0700
>> >
>> > e100: adapt to the reworked PCI PM
>> >
>> > commit e1b86d8479f90aadee57a3d07d8e61c815c202d9
>> > Author: Rafael J. Wysocki <rjw@sisk.pl>
>> > Date: Fri Nov 7 20:30:37 2008 +0000
>> >
>> > igb: Use device_set_wakeup_enable
>> >
>> > commit de1264896c8012a261c1cba17e6a61199c276ad3
>> > Author: Rafael J. Wysocki <rjw@sisk.pl>
>> > Date: Fri Nov 7 20:30:19 2008 +0000
>> >
>> > e1000: Use device_set_wakeup_enable
>> >
>> > commit 6ff68026f4757d68461b7fbeca5c944e1f5f8b44
>> > Author: Rafael J. Wysocki <rjw@sisk.pl>
>> > Date: Wed Nov 12 09:52:32 2008 +0000
>> >
>> > e1000e: Use device_set_wakeup_enable
>> >
>> >Unfortunately they left out some important bits. This should make sure
>> >the e100, igb, e1000e, and e1000-based devices can actually enable WOL
>> >rather than their current state which is reported as not supported.
>> >
>> >This looks like it has been broken since 2.6.28.
>> >
>> >Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
>> >---
>> >
>> > e100.c | 1 +
>> > e1000/e1000_main.c | 1 +
>> > e1000e/netdev.c | 1 +
>> > igb/igb_main.c | 1 +
>> > 4 files changed, 4 insertions(+)
>> >
>> >diff --git a/drivers/net/e100.c b/drivers/net/e100.c
>> >index 569df19..8824952 100644
>> >--- a/drivers/net/e100.c
>> >+++ b/drivers/net/e100.c
>> >@@ -2816,6 +2816,7 @@ static int __devinit e100_probe(struct
>> >pci_dev *pdev,
>> > if ((nic->mac >= mac_82558_D101_A4) &&
>> > (nic->eeprom[eeprom_id] & eeprom_id_wol)) {
>> > nic->flags |= wol_magic;
>> >+ device_init_wakeup(&pdev->dev, true);
>> > device_set_wakeup_enable(&pdev->dev, true);
>> > }
>> >
>> >diff --git a/drivers/net/e1000/e1000_main.c
>> >b/drivers/net/e1000/e1000_main.c
>> >index d7df00c..229d874 100644
>> >--- a/drivers/net/e1000/e1000_main.c
>> >+++ b/drivers/net/e1000/e1000_main.c
>> >@@ -1208,6 +1208,7 @@ static int __devinit e1000_probe(struct
>> >pci_dev *pdev,
>> >
>> > /* initialize the wol settings based on the eeprom settings */
>> > adapter->wol = adapter->eeprom_wol;
>> >+ device_init_wakeup(&adapter->pdev->dev, adapter->wol);
>> > device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
>> >
>> > /* print bus type/speed/width info */
>> >diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
>> >index 63415bb..5c2edaa 100644
>> >--- a/drivers/net/e1000e/netdev.c
>> >+++ b/drivers/net/e1000e/netdev.c
>> >@@ -5196,6 +5196,7 @@ static int __devinit e1000_probe(struct
>> >pci_dev *pdev,
>> >
>> > /* initialize the wol settings based on the eeprom settings */
>> > adapter->wol = adapter->eeprom_wol;
>> >+ device_init_wakeup(&adapter->pdev->dev, adapter->wol);
>> > device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
>> >
>> > /* save off EEPROM version number */
>> >diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
>> >index adb09d3..8512a40 100644
>> >--- a/drivers/net/igb/igb_main.c
>> >+++ b/drivers/net/igb/igb_main.c
>> >@@ -1475,6 +1475,7 @@ static int __devinit igb_probe(struct
>> >pci_dev *pdev,
>> >
>> > /* initialize the wol settings based on the eeprom settings */
>> > adapter->wol = adapter->eeprom_wol;
>> >+ device_init_wakeup(&adapter->pdev->dev, adapter->wol);
>> > device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
>> >
>> > /* reset the hardware with the new settings */
>> Andy,
>>
>> WoL not supported is reported back when WoL is disabled in the EEPROM. So if this is happening to you, that system (or at least that interface) has WoL disabled. How are you testing this?
>>
>> Cheers,
>> John
>
> John,
>
> I'm not doing anything differently than what the eeprom is reporting as
> support with these patches. In every one of the drivers above, the
> enabling of ethtool first calls device_can_wakeup. That inline function
> is pretty simple and all it does is return the value of
> dev->power.can_wakeup. If never set, dev->power.can_wakeup is false and
> wol status can never be set.
>
> The proper way to set it would be to call dev_init_wakeup first (or
> simply call it). Take a look at the code and you will see what I'm
> talking about.
>
> Now that I'm looking at it again, this patch would probably be better
> anyway:
>
> Replace device_set_wakeup_enable calls with device_init_wakeup, so that
> calls to device_can_wakeup in each drivers' code will not fail each
> time. The intent of the calls to device_can_wakeup were added to ensure
> the device was enabled for WOL, but without the proper call to
> device_init_wakeup, any call to device_can_wakeup will always return
> false.
>
> Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
> ---
>
> e100.c | 2 +-
> e1000/e1000_main.c | 2 +-
> e1000e/netdev.c | 2 +-
> igb/igb_main.c | 2 +-
> 4 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/e100.c b/drivers/net/e100.c
> index 569df19..1d82d25 100644
> --- a/drivers/net/e100.c
> +++ b/drivers/net/e100.c
> @@ -2816,7 +2816,7 @@ static int __devinit e100_probe(struct pci_dev *pdev,
> if ((nic->mac >= mac_82558_D101_A4) &&
> (nic->eeprom[eeprom_id] & eeprom_id_wol)) {
> nic->flags |= wol_magic;
> - device_set_wakeup_enable(&pdev->dev, true);
> + device_init_wakeup(&pdev->dev, true);
> }
>
> /* ack any pending wake events, disable PME */
> diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
> index d7df00c..5f22a85 100644
> --- a/drivers/net/e1000/e1000_main.c
> +++ b/drivers/net/e1000/e1000_main.c
> @@ -1208,7 +1208,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
>
> /* initialize the wol settings based on the eeprom settings */
> adapter->wol = adapter->eeprom_wol;
> - device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
> + device_init_wakeup(&adapter->pdev->dev, adapter->wol);
>
> /* print bus type/speed/width info */
> DPRINTK(PROBE, INFO, "(PCI%s:%s:%s) ",
> diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
> index 63415bb..62de3ad 100644
> --- a/drivers/net/e1000e/netdev.c
> +++ b/drivers/net/e1000e/netdev.c
> @@ -5196,7 +5196,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
>
> /* initialize the wol settings based on the eeprom settings */
> adapter->wol = adapter->eeprom_wol;
> - device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
> + device_init_wakeup(&adapter->pdev->dev, adapter->wol);
>
> /* save off EEPROM version number */
> e1000_read_nvm(&adapter->hw, 5, 1, &adapter->eeprom_vers);
> diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
> index adb09d3..f761e67 100644
> --- a/drivers/net/igb/igb_main.c
> +++ b/drivers/net/igb/igb_main.c
> @@ -1475,7 +1475,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
>
> /* initialize the wol settings based on the eeprom settings */
> adapter->wol = adapter->eeprom_wol;
> - device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
> + device_init_wakeup(&adapter->pdev->dev, adapter->wol);
>
> /* reset the hardware with the new settings */
> igb_reset(adapter);
>
>
>
>
>
>
> --
> 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 1/3] net: serialize hrtimer callback in sched_cbq
From: David Miller @ 2009-07-22 3:18 UTC (permalink / raw)
To: peterz; +Cc: torvalds, tglx, netdev, linux-kernel, kaber
In-Reply-To: <1247832892.15751.35.camel@twins>
From: Peter Zijlstra <peterz@infradead.org>
Date: Fri, 17 Jul 2009 14:14:52 +0200
> On Tue, 2009-07-14 at 09:42 -0700, Linus Torvalds wrote:
>>
>> On Tue, 14 Jul 2009, Peter Zijlstra wrote:
>> >
>> > Linus really hated the softirq mode, which is what prompted me to change
>> > that.
>> >
>> > Now, it might be he only hated the particular interface and the
>> > resulting code, but I think to remember he simply thought the whole
>> > thing daft.
>>
>> Yes. And I hated the bugs it had.
>>
>> Don't make something as core as timers any more complicated. Don't take
>> locks in timers and then complain about deadlocks. If your locking is
>> broken, don't make the core timers be idiotically broken.
>>
>> Because it was. The code was a total mess to follow, and had bugs.
>
> How would something like the below work for people?
I like it, but like Linus said it probably belongs in
kernel/softirq.c
^ permalink raw reply
* Re: [PATCH] move sgiseeq's probe function to .devinit.text
From: David Miller @ 2009-07-22 3:13 UTC (permalink / raw)
To: u.kleine-koenig; +Cc: netdev, wangchen, akpm, jgarzik, tsbogend, gregkh
In-Reply-To: <1248211527-32253-5-git-send-email-u.kleine-koenig@pengutronix.de>
Applied.
^ permalink raw reply
* Re: [PATCH] move sb1250-mac's probe function to .devinit.text
From: David Miller @ 2009-07-22 3:13 UTC (permalink / raw)
To: u.kleine-koenig; +Cc: netdev, weiwei.wang, jgarzik, shemminger, akpm, gregkh
In-Reply-To: <1248211527-32253-4-git-send-email-u.kleine-koenig@pengutronix.de>
Applied.
^ permalink raw reply
* Re: [PATCH] move jazzsonic's probe function to .devinit.text
From: David Miller @ 2009-07-22 3:13 UTC (permalink / raw)
To: u.kleine-koenig; +Cc: netdev, jeff, tsbogend, fthain, geert, akpm, gregkh
In-Reply-To: <1248211527-32253-1-git-send-email-u.kleine-koenig@pengutronix.de>
Applied.
^ permalink raw reply
* Re: [PATCH] move xtsonic's probe function to .devinit.text
From: David Miller @ 2009-07-22 3:13 UTC (permalink / raw)
To: u.kleine-koenig; +Cc: netdev, chris, akpm, gregkh
In-Reply-To: <1248211527-32253-6-git-send-email-u.kleine-koenig@pengutronix.de>
Applied.
^ permalink raw reply
* Re: [PATCH] move macsonic's probe function to .devinit.text
From: David Miller @ 2009-07-22 3:13 UTC (permalink / raw)
To: u.kleine-koenig; +Cc: netdev, jgarzik, geert, akpm, gregkh
In-Reply-To: <1248211527-32253-2-git-send-email-u.kleine-koenig@pengutronix.de>
Applied.
^ permalink raw reply
* Re: [PATCH] move meth's probe function to .devinit.text
From: David Miller @ 2009-07-22 3:12 UTC (permalink / raw)
To: u.kleine-koenig; +Cc: netdev, tsbogend, cl, jgarzik, akpm, gregkh
In-Reply-To: <1248211527-32253-3-git-send-email-u.kleine-koenig@pengutronix.de>
Applied.
^ permalink raw reply
* Re: [PATCH 1/1] ipv4: IP_RECVERR should also enqueue source quench messages
From: David Miller @ 2009-07-22 3:07 UTC (permalink / raw)
To: hagen; +Cc: netdev
In-Reply-To: <1248219127-3203-1-git-send-email-hagen@jauu.net>
From: Hagen Paul Pfeifer <hagen@jauu.net>
Date: Wed, 22 Jul 2009 01:32:07 +0200
> Currently ICMP source quench messages are silently dropped and not
> enqueued in a per-socket error queue. The socket option IP_RECVERR
> enables a connected datagram socket to notice error conditions received
> via ICMP. This modification allows applications to notice ICMP source
> quench error condition too.
>
> Side note: source quench are obsolete since day ~0 and are one of the
> early design mistakes of the Internet. Anyway, this does not interfere
> with the fact that a connected socket should not be informed about
> received source quench messages.
>
> Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
I'm almost entirely sure that this behavior is intentional.
All RFCs say to ignore source quench messages with impunity, and Linux
interprets this to mean for our userland interfaces too.
I'm not applying this, sorry.
^ permalink raw reply
* Re: [PATCH] igb/e1000e/e1000/e100: make wol usable
From: Andy Gospodarek @ 2009-07-22 2:27 UTC (permalink / raw)
To: Ronciak, John
Cc: Andy Gospodarek, netdev@vger.kernel.org, Kirsher, Jeffrey T,
Brandeburg, Jesse, Allan, Bruce W, Waskiewicz Jr, Peter P,
stable@kernel.org
In-Reply-To: <273D38FBE7C6FE46A1689FCD014A0B8B55D57764@azsmsx505.amr.corp.intel.com>
On Tue, Jul 21, 2009 at 02:59:31PM -0700, Ronciak, John wrote:
> >-----Original Message-----
> >From: Andy Gospodarek [mailto:andy@greyhouse.net]
> >Sent: Tuesday, July 21, 2009 2:01 PM
> >To: netdev@vger.kernel.org
> >Cc: Kirsher, Jeffrey T; Brandeburg, Jesse; Allan, Bruce W;
> >Waskiewicz Jr, Peter P; Ronciak, John; stable@kernel.org
> >Subject: [PATCH] igb/e1000e/e1000/e100: make wol usable
> >
> >
> >It seems that the patches that intended to use the new calls to check
> >status and capabilities for WOL and fix it up:
> >
> > commit bc79fc8409b3dccbde072e8113cc1fb3fd876fc5
> > Author: Rafael J. Wysocki <rjw@sisk.pl>
> > Date: Wed Oct 29 14:22:18 2008 -0700
> >
> > e100: adapt to the reworked PCI PM
> >
> > commit e1b86d8479f90aadee57a3d07d8e61c815c202d9
> > Author: Rafael J. Wysocki <rjw@sisk.pl>
> > Date: Fri Nov 7 20:30:37 2008 +0000
> >
> > igb: Use device_set_wakeup_enable
> >
> > commit de1264896c8012a261c1cba17e6a61199c276ad3
> > Author: Rafael J. Wysocki <rjw@sisk.pl>
> > Date: Fri Nov 7 20:30:19 2008 +0000
> >
> > e1000: Use device_set_wakeup_enable
> >
> > commit 6ff68026f4757d68461b7fbeca5c944e1f5f8b44
> > Author: Rafael J. Wysocki <rjw@sisk.pl>
> > Date: Wed Nov 12 09:52:32 2008 +0000
> >
> > e1000e: Use device_set_wakeup_enable
> >
> >Unfortunately they left out some important bits. This should make sure
> >the e100, igb, e1000e, and e1000-based devices can actually enable WOL
> >rather than their current state which is reported as not supported.
> >
> >This looks like it has been broken since 2.6.28.
> >
> >Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
> >---
> >
> > e100.c | 1 +
> > e1000/e1000_main.c | 1 +
> > e1000e/netdev.c | 1 +
> > igb/igb_main.c | 1 +
> > 4 files changed, 4 insertions(+)
> >
> >diff --git a/drivers/net/e100.c b/drivers/net/e100.c
> >index 569df19..8824952 100644
> >--- a/drivers/net/e100.c
> >+++ b/drivers/net/e100.c
> >@@ -2816,6 +2816,7 @@ static int __devinit e100_probe(struct
> >pci_dev *pdev,
> > if ((nic->mac >= mac_82558_D101_A4) &&
> > (nic->eeprom[eeprom_id] & eeprom_id_wol)) {
> > nic->flags |= wol_magic;
> >+ device_init_wakeup(&pdev->dev, true);
> > device_set_wakeup_enable(&pdev->dev, true);
> > }
> >
> >diff --git a/drivers/net/e1000/e1000_main.c
> >b/drivers/net/e1000/e1000_main.c
> >index d7df00c..229d874 100644
> >--- a/drivers/net/e1000/e1000_main.c
> >+++ b/drivers/net/e1000/e1000_main.c
> >@@ -1208,6 +1208,7 @@ static int __devinit e1000_probe(struct
> >pci_dev *pdev,
> >
> > /* initialize the wol settings based on the eeprom settings */
> > adapter->wol = adapter->eeprom_wol;
> >+ device_init_wakeup(&adapter->pdev->dev, adapter->wol);
> > device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
> >
> > /* print bus type/speed/width info */
> >diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
> >index 63415bb..5c2edaa 100644
> >--- a/drivers/net/e1000e/netdev.c
> >+++ b/drivers/net/e1000e/netdev.c
> >@@ -5196,6 +5196,7 @@ static int __devinit e1000_probe(struct
> >pci_dev *pdev,
> >
> > /* initialize the wol settings based on the eeprom settings */
> > adapter->wol = adapter->eeprom_wol;
> >+ device_init_wakeup(&adapter->pdev->dev, adapter->wol);
> > device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
> >
> > /* save off EEPROM version number */
> >diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
> >index adb09d3..8512a40 100644
> >--- a/drivers/net/igb/igb_main.c
> >+++ b/drivers/net/igb/igb_main.c
> >@@ -1475,6 +1475,7 @@ static int __devinit igb_probe(struct
> >pci_dev *pdev,
> >
> > /* initialize the wol settings based on the eeprom settings */
> > adapter->wol = adapter->eeprom_wol;
> >+ device_init_wakeup(&adapter->pdev->dev, adapter->wol);
> > device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
> >
> > /* reset the hardware with the new settings */
> Andy,
>
> WoL not supported is reported back when WoL is disabled in the EEPROM. So if this is happening to you, that system (or at least that interface) has WoL disabled. How are you testing this?
>
> Cheers,
> John
John,
I'm not doing anything differently than what the eeprom is reporting as
support with these patches. In every one of the drivers above, the
enabling of ethtool first calls device_can_wakeup. That inline function
is pretty simple and all it does is return the value of
dev->power.can_wakeup. If never set, dev->power.can_wakeup is false and
wol status can never be set.
The proper way to set it would be to call dev_init_wakeup first (or
simply call it). Take a look at the code and you will see what I'm
talking about.
Now that I'm looking at it again, this patch would probably be better
anyway:
Replace device_set_wakeup_enable calls with device_init_wakeup, so that
calls to device_can_wakeup in each drivers' code will not fail each
time. The intent of the calls to device_can_wakeup were added to ensure
the device was enabled for WOL, but without the proper call to
device_init_wakeup, any call to device_can_wakeup will always return
false.
Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
---
e100.c | 2 +-
e1000/e1000_main.c | 2 +-
e1000e/netdev.c | 2 +-
igb/igb_main.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index 569df19..1d82d25 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -2816,7 +2816,7 @@ static int __devinit e100_probe(struct pci_dev *pdev,
if ((nic->mac >= mac_82558_D101_A4) &&
(nic->eeprom[eeprom_id] & eeprom_id_wol)) {
nic->flags |= wol_magic;
- device_set_wakeup_enable(&pdev->dev, true);
+ device_init_wakeup(&pdev->dev, true);
}
/* ack any pending wake events, disable PME */
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index d7df00c..5f22a85 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -1208,7 +1208,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
/* initialize the wol settings based on the eeprom settings */
adapter->wol = adapter->eeprom_wol;
- device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
+ device_init_wakeup(&adapter->pdev->dev, adapter->wol);
/* print bus type/speed/width info */
DPRINTK(PROBE, INFO, "(PCI%s:%s:%s) ",
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 63415bb..62de3ad 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -5196,7 +5196,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
/* initialize the wol settings based on the eeprom settings */
adapter->wol = adapter->eeprom_wol;
- device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
+ device_init_wakeup(&adapter->pdev->dev, adapter->wol);
/* save off EEPROM version number */
e1000_read_nvm(&adapter->hw, 5, 1, &adapter->eeprom_vers);
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index adb09d3..f761e67 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -1475,7 +1475,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
/* initialize the wol settings based on the eeprom settings */
adapter->wol = adapter->eeprom_wol;
- device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
+ device_init_wakeup(&adapter->pdev->dev, adapter->wol);
/* reset the hardware with the new settings */
igb_reset(adapter);
^ permalink raw reply related
* [PATCH] sky2: Avoid races in sky2_down
From: Mike McCormack @ 2009-07-22 0:50 UTC (permalink / raw)
To: netdev
Reset rx chain before trying to drain it.
Shut interrupts off last, incase there's something to report.
Signed-off-by: Mike McCormack <mikem@ring3k.org>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
---
drivers/net/sky2.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index ba768df..3550c5d 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -1818,12 +1818,6 @@ static int sky2_down(struct net_device *dev)
if (netif_msg_ifdown(sky2))
printk(KERN_INFO PFX "%s: disabling interface\n", dev->name);
- /* Disable port IRQ */
- imask = sky2_read32(hw, B0_IMSK);
- imask &= ~portirq_msk[port];
- sky2_write32(hw, B0_IMSK, imask);
- sky2_read32(hw, B0_IMSK);
-
/* Force flow control off */
sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_OFF);
@@ -1863,8 +1857,6 @@ static int sky2_down(struct net_device *dev)
sky2_write32(hw, RB_ADDR(txqaddr[port], RB_CTRL), RB_RST_SET);
- sky2_rx_stop(sky2);
-
sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET);
sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_SET);
@@ -1874,6 +1866,14 @@ static int sky2_down(struct net_device *dev)
sky2_write32(hw, STAT_ISR_TIMER_CNT, 0);
sky2_read8(hw, STAT_ISR_TIMER_CTRL);
+ sky2_rx_stop(sky2);
+
+ /* Disable port IRQ */
+ imask = sky2_read32(hw, B0_IMSK);
+ imask &= ~portirq_msk[port];
+ sky2_write32(hw, B0_IMSK, imask);
+ sky2_read32(hw, B0_IMSK);
+
synchronize_irq(hw->pdev->irq);
napi_synchronize(&hw->napi);
--
1.5.6.5
^ 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