* [PATCH 1/3] Phonet: restore flow control credits when sending fails
@ 2010-08-30 22:57 Rémi Denis-Courmont
2010-08-30 22:57 ` [PATCH 2/3] Phonet: correct sendmsg() error code from sock_alloc_send_skb() Rémi Denis-Courmont
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Rémi Denis-Courmont @ 2010-08-30 22:57 UTC (permalink / raw)
To: netdev
From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
---
net/phonet/pep.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/net/phonet/pep.c b/net/phonet/pep.c
index b2a3ae6..5034f0f 100644
--- a/net/phonet/pep.c
+++ b/net/phonet/pep.c
@@ -834,6 +834,7 @@ static int pipe_skb_send(struct sock *sk, struct sk_buff *skb)
{
struct pep_sock *pn = pep_sk(sk);
struct pnpipehdr *ph;
+ int err;
if (pn_flow_safe(pn->tx_fc) &&
!atomic_add_unless(&pn->tx_credits, -1, 0)) {
@@ -852,7 +853,10 @@ static int pipe_skb_send(struct sock *sk, struct sk_buff *skb)
ph->message_id = PNS_PIPE_DATA;
ph->pipe_handle = pn->pipe_handle;
- return pn_skb_send(sk, skb, &pipe_srv);
+ err = pn_skb_send(sk, skb, &pipe_srv);
+ if (err && pn_flow_safe(pn->tx_fc))
+ atomic_inc(&pn->tx_credits);
+ return err;
}
static int pep_sendmsg(struct kiocb *iocb, struct sock *sk,
--
1.7.0.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] Phonet: correct sendmsg() error code from sock_alloc_send_skb()
2010-08-30 22:57 [PATCH 1/3] Phonet: restore flow control credits when sending fails Rémi Denis-Courmont
@ 2010-08-30 22:57 ` Rémi Denis-Courmont
2010-08-31 20:04 ` David Miller
2010-08-30 22:57 ` [PATCH 3/3] Phonet: do not set POLLOUT in case of send buffer overflow Rémi Denis-Courmont
2010-08-31 20:04 ` [PATCH 1/3] Phonet: restore flow control credits when sending fails David Miller
2 siblings, 1 reply; 6+ messages in thread
From: Rémi Denis-Courmont @ 2010-08-30 22:57 UTC (permalink / raw)
To: netdev
From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
---
net/phonet/pep.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/phonet/pep.c b/net/phonet/pep.c
index 5034f0f..04e3419 100644
--- a/net/phonet/pep.c
+++ b/net/phonet/pep.c
@@ -876,7 +876,7 @@ static int pep_sendmsg(struct kiocb *iocb, struct sock *sk,
skb = sock_alloc_send_skb(sk, MAX_PNPIPE_HEADER + len,
flags & MSG_DONTWAIT, &err);
if (!skb)
- return -ENOBUFS;
+ return err;
skb_reserve(skb, MAX_PHONET_HEADER + 3);
err = memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] Phonet: do not set POLLOUT in case of send buffer overflow
2010-08-30 22:57 [PATCH 1/3] Phonet: restore flow control credits when sending fails Rémi Denis-Courmont
2010-08-30 22:57 ` [PATCH 2/3] Phonet: correct sendmsg() error code from sock_alloc_send_skb() Rémi Denis-Courmont
@ 2010-08-30 22:57 ` Rémi Denis-Courmont
2010-08-31 20:04 ` David Miller
2010-08-31 20:04 ` [PATCH 1/3] Phonet: restore flow control credits when sending fails David Miller
2 siblings, 1 reply; 6+ messages in thread
From: Rémi Denis-Courmont @ 2010-08-30 22:57 UTC (permalink / raw)
To: netdev
From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
---
net/phonet/socket.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/net/phonet/socket.c b/net/phonet/socket.c
index 6e9848b..7c91f73 100644
--- a/net/phonet/socket.c
+++ b/net/phonet/socket.c
@@ -281,7 +281,9 @@ static unsigned int pn_socket_poll(struct file *file, struct socket *sock,
if (!mask && sk->sk_state == TCP_CLOSE_WAIT)
return POLLHUP;
- if (sk->sk_state == TCP_ESTABLISHED && atomic_read(&pn->tx_credits))
+ if (sk->sk_state == TCP_ESTABLISHED &&
+ atomic_read(&sk->sk_wmem_alloc) < sk->sk_sndbuf &&
+ atomic_read(&pn->tx_credits))
mask |= POLLOUT | POLLWRNORM | POLLWRBAND;
return mask;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/3] Phonet: correct sendmsg() error code from sock_alloc_send_skb()
2010-08-30 22:57 ` [PATCH 2/3] Phonet: correct sendmsg() error code from sock_alloc_send_skb() Rémi Denis-Courmont
@ 2010-08-31 20:04 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2010-08-31 20:04 UTC (permalink / raw)
To: remi.denis-courmont; +Cc: netdev
naFrom: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Date: Tue, 31 Aug 2010 01:57:04 +0300
> From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
>
> Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] Phonet: restore flow control credits when sending fails
2010-08-30 22:57 [PATCH 1/3] Phonet: restore flow control credits when sending fails Rémi Denis-Courmont
2010-08-30 22:57 ` [PATCH 2/3] Phonet: correct sendmsg() error code from sock_alloc_send_skb() Rémi Denis-Courmont
2010-08-30 22:57 ` [PATCH 3/3] Phonet: do not set POLLOUT in case of send buffer overflow Rémi Denis-Courmont
@ 2010-08-31 20:04 ` David Miller
2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2010-08-31 20:04 UTC (permalink / raw)
To: remi.denis-courmont; +Cc: netdev
From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Date: Tue, 31 Aug 2010 01:57:03 +0300
> From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
>
> Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/3] Phonet: do not set POLLOUT in case of send buffer overflow
2010-08-30 22:57 ` [PATCH 3/3] Phonet: do not set POLLOUT in case of send buffer overflow Rémi Denis-Courmont
@ 2010-08-31 20:04 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2010-08-31 20:04 UTC (permalink / raw)
To: remi.denis-courmont; +Cc: netdev
From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Date: Tue, 31 Aug 2010 01:57:05 +0300
> From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
>
> Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-08-31 20:04 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-30 22:57 [PATCH 1/3] Phonet: restore flow control credits when sending fails Rémi Denis-Courmont
2010-08-30 22:57 ` [PATCH 2/3] Phonet: correct sendmsg() error code from sock_alloc_send_skb() Rémi Denis-Courmont
2010-08-31 20:04 ` David Miller
2010-08-30 22:57 ` [PATCH 3/3] Phonet: do not set POLLOUT in case of send buffer overflow Rémi Denis-Courmont
2010-08-31 20:04 ` David Miller
2010-08-31 20:04 ` [PATCH 1/3] Phonet: restore flow control credits when sending fails David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).