netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Samuel Ortiz <samuel@sortiz.org>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, irda-users@lists.sourceforge.net
Subject: [RFC PATCH 4/9] irda: reserve irda_skb on sock_alloc_send_skb() skbs
Date: Mon, 15 Dec 2008 02:57:33 +0100	[thread overview]
Message-ID: <20081215015859.438954905@sortiz.org> (raw)
In-Reply-To: 20081215015729.587697008@sortiz.org

[-- Attachment #1: 0004-irda-reserve-irda_skb-on-sock_alloc_send_skb-skbs.patch --]
[-- Type: text/plain, Size: 2445 bytes --]

Those skbs are on the TX path, and need to have the irda_skb_cb space
allocated as well.

Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
---
 net/irda/af_irda.c |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
index 61def98..8b0ac27 100644
--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -59,6 +59,7 @@
 #include <net/tcp_states.h>
 
 #include <net/irda/af_irda.h>
+#include <net/irda/irda_device.h>
 
 static int irda_create(struct net *net, struct socket *sock, int protocol);
 
@@ -1288,12 +1289,14 @@ static int irda_sendmsg(struct kiocb *iocb, struct socket *sock,
 		len = self->max_data_size;
 	}
 
-	skb = sock_alloc_send_skb(sk, len + self->max_header_size + 16,
+	skb = sock_alloc_send_skb(sk, len + self->max_header_size + 16
+				  + sizeof(struct irda_skb_cb),
 				  msg->msg_flags & MSG_DONTWAIT, &err);
 	if (!skb)
 		goto out_err;
 
-	skb_reserve(skb, self->max_header_size + 16);
+	skb_reserve(skb, self->max_header_size + 16
+		    + sizeof(struct irda_skb_cb));
 	skb_reset_transport_header(skb);
 	skb_put(skb, len);
 	err = memcpy_fromiovec(skb_transport_header(skb), msg->msg_iov, len);
@@ -1534,12 +1537,13 @@ static int irda_sendmsg_dgram(struct kiocb *iocb, struct socket *sock,
 		len = self->max_data_size;
 	}
 
-	skb = sock_alloc_send_skb(sk, len + self->max_header_size,
+	skb = sock_alloc_send_skb(sk, len + self->max_header_size
+				  + sizeof(struct irda_skb_cb),
 				  msg->msg_flags & MSG_DONTWAIT, &err);
 	if (!skb)
 		return -ENOBUFS;
 
-	skb_reserve(skb, self->max_header_size);
+	skb_reserve(skb, self->max_header_size + sizeof(struct irda_skb_cb));
 	skb_reset_transport_header(skb);
 
 	IRDA_DEBUG(4, "%s(), appending user data\n", __func__);
@@ -1629,12 +1633,13 @@ static int irda_sendmsg_ultra(struct kiocb *iocb, struct socket *sock,
 		len = self->max_data_size;
 	}
 
-	skb = sock_alloc_send_skb(sk, len + self->max_header_size,
+	skb = sock_alloc_send_skb(sk, len + self->max_header_size
+				  + sizeof(struct irda_skb_cb),
 				  msg->msg_flags & MSG_DONTWAIT, &err);
 	if (!skb)
 		return -ENOBUFS;
 
-	skb_reserve(skb, self->max_header_size);
+	skb_reserve(skb, self->max_header_size + sizeof(struct irda_skb_cb));
 	skb_reset_transport_header(skb);
 
 	IRDA_DEBUG(4, "%s(), appending user data\n", __func__);
-- 
1.6.0.4.766.g6fc4a.dirty

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

  parent reply	other threads:[~2008-12-15  2:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-15  1:57 [RFC PATCH 0/9] IrDA 2.6.28 bug fix Samuel Ortiz
2008-12-15  1:57 ` [RFC PATCH 1/9] irda: Introduce irda_alloc_skb Samuel Ortiz
2008-12-15  1:57 ` [RFC PATCH 2/9] irda: stack should call irda_get_skb_cb() Samuel Ortiz
2008-12-15  1:57 ` [RFC PATCH 3/9] irda: IrDA drivers " Samuel Ortiz
2008-12-15  1:57 ` Samuel Ortiz [this message]
2008-12-15  1:57 ` [RFC PATCH 5/9] irda: Introduce irda_dev_alloc_skb Samuel Ortiz
2008-12-15  1:57 ` [RFC PATCH 6/9] irda: Drivers should use irda_dev_alloc_skb() on the RX path Samuel Ortiz
2008-12-15  1:57 ` [RFC PATCH 7/9] irda: Stack RX path callers should use irda_dev_alloc_skb Samuel Ortiz
2008-12-15  1:57 ` [RFC PATCH 8/9] irda: Add a WARN_ON when our head room is too small Samuel Ortiz
2008-12-15  1:57 ` [RFC PATCH 9/9] irda: Fix irda_skb_cb size Samuel Ortiz
     [not found] ` <20081215015729.587697008-jcdQHdrhKHMdnm+yROfE0A@public.gmane.org>
2008-12-15  7:08   ` [RFC PATCH 0/9] IrDA 2.6.28 bug fix David Miller
2008-12-15 12:31     ` [irda-users] " Samuel Ortiz
2008-12-17  7:59       ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081215015859.438954905@sortiz.org \
    --to=samuel@sortiz.org \
    --cc=davem@davemloft.net \
    --cc=irda-users@lists.sourceforge.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).