aboutsummaryrefslogtreecommitdiffstats
path: root/net/irda
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-04-19 23:29:13 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:26:28 -0400
commit27a884dc3cb63b93c2b3b643f5b31eed5f8a4d26 (patch)
tree5a267e40f9b94014be38dad5de0a52b6628834e0 /net/irda
parentbe8bd86321fa7f06359d866ef61fb4d2f3e9dce9 (diff)
[SK_BUFF]: Convert skb->tail to sk_buff_data_t
So that it is also an offset from skb->head, reduces its size from 8 to 4 bytes on 64bit architectures, allowing us to combine the 4 bytes hole left by the layer headers conversion, reducing struct sk_buff size to 256 bytes, i.e. 4 64byte cachelines, and since the sk_buff slab cache is SLAB_HWCACHE_ALIGN... :-) Many calculations that previously required that skb->{transport,network, mac}_header be first converted to a pointer now can be done directly, being meaningful as offsets or pointers. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/irda')
-rw-r--r--net/irda/ircomm/ircomm_param.c4
-rw-r--r--net/irda/irlan/irlan_common.c2
-rw-r--r--net/irda/qos.c14
3 files changed, 10 insertions, 10 deletions
diff --git a/net/irda/ircomm/ircomm_param.c b/net/irda/ircomm/ircomm_param.c
index 01d7c9c7b3b4..e5e4792a0314 100644
--- a/net/irda/ircomm/ircomm_param.c
+++ b/net/irda/ircomm/ircomm_param.c
@@ -133,8 +133,8 @@ int ircomm_param_request(struct ircomm_tty_cb *self, __u8 pi, int flush)
133 * Inserting is a little bit tricky since we don't know how much 133 * Inserting is a little bit tricky since we don't know how much
134 * room we will need. But this should hopefully work OK 134 * room we will need. But this should hopefully work OK
135 */ 135 */
136 count = irda_param_insert(self, pi, skb->tail, skb_tailroom(skb), 136 count = irda_param_insert(self, pi, skb_tail_pointer(skb),
137 &ircomm_param_info); 137 skb_tailroom(skb), &ircomm_param_info);
138 if (count < 0) { 138 if (count < 0) {
139 IRDA_WARNING("%s(), no room for parameter!\n", __FUNCTION__); 139 IRDA_WARNING("%s(), no room for parameter!\n", __FUNCTION__);
140 spin_unlock_irqrestore(&self->spinlock, flags); 140 spin_unlock_irqrestore(&self->spinlock, flags);
diff --git a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c
index fcf9d6599628..ed69773b0f8e 100644
--- a/net/irda/irlan/irlan_common.c
+++ b/net/irda/irlan/irlan_common.c
@@ -1039,7 +1039,7 @@ static int __irlan_insert_param(struct sk_buff *skb, char *param, int type,
1039 } 1039 }
1040 1040
1041 /* Insert at end of sk-buffer */ 1041 /* Insert at end of sk-buffer */
1042 frame = skb->tail; 1042 frame = skb_tail_pointer(skb);
1043 1043
1044 /* Make space for data */ 1044 /* Make space for data */
1045 if (skb_tailroom(skb) < (param_len+value_len+3)) { 1045 if (skb_tailroom(skb) < (param_len+value_len+3)) {
diff --git a/net/irda/qos.c b/net/irda/qos.c
index 349012c926b7..aeb18cf1dcae 100644
--- a/net/irda/qos.c
+++ b/net/irda/qos.c
@@ -469,49 +469,49 @@ int irlap_insert_qos_negotiation_params(struct irlap_cb *self,
469 int ret; 469 int ret;
470 470
471 /* Insert data rate */ 471 /* Insert data rate */
472 ret = irda_param_insert(self, PI_BAUD_RATE, skb->tail, 472 ret = irda_param_insert(self, PI_BAUD_RATE, skb_tail_pointer(skb),
473 skb_tailroom(skb), &irlap_param_info); 473 skb_tailroom(skb), &irlap_param_info);
474 if (ret < 0) 474 if (ret < 0)
475 return ret; 475 return ret;
476 skb_put(skb, ret); 476 skb_put(skb, ret);
477 477
478 /* Insert max turnaround time */ 478 /* Insert max turnaround time */
479 ret = irda_param_insert(self, PI_MAX_TURN_TIME, skb->tail, 479 ret = irda_param_insert(self, PI_MAX_TURN_TIME, skb_tail_pointer(skb),
480 skb_tailroom(skb), &irlap_param_info); 480 skb_tailroom(skb), &irlap_param_info);
481 if (ret < 0) 481 if (ret < 0)
482 return ret; 482 return ret;
483 skb_put(skb, ret); 483 skb_put(skb, ret);
484 484
485 /* Insert data size */ 485 /* Insert data size */
486 ret = irda_param_insert(self, PI_DATA_SIZE, skb->tail, 486 ret = irda_param_insert(self, PI_DATA_SIZE, skb_tail_pointer(skb),
487 skb_tailroom(skb), &irlap_param_info); 487 skb_tailroom(skb), &irlap_param_info);
488 if (ret < 0) 488 if (ret < 0)
489 return ret; 489 return ret;
490 skb_put(skb, ret); 490 skb_put(skb, ret);
491 491
492 /* Insert window size */ 492 /* Insert window size */
493 ret = irda_param_insert(self, PI_WINDOW_SIZE, skb->tail, 493 ret = irda_param_insert(self, PI_WINDOW_SIZE, skb_tail_pointer(skb),
494 skb_tailroom(skb), &irlap_param_info); 494 skb_tailroom(skb), &irlap_param_info);
495 if (ret < 0) 495 if (ret < 0)
496 return ret; 496 return ret;
497 skb_put(skb, ret); 497 skb_put(skb, ret);
498 498
499 /* Insert additional BOFs */ 499 /* Insert additional BOFs */
500 ret = irda_param_insert(self, PI_ADD_BOFS, skb->tail, 500 ret = irda_param_insert(self, PI_ADD_BOFS, skb_tail_pointer(skb),
501 skb_tailroom(skb), &irlap_param_info); 501 skb_tailroom(skb), &irlap_param_info);
502 if (ret < 0) 502 if (ret < 0)
503 return ret; 503 return ret;
504 skb_put(skb, ret); 504 skb_put(skb, ret);
505 505
506 /* Insert minimum turnaround time */ 506 /* Insert minimum turnaround time */
507 ret = irda_param_insert(self, PI_MIN_TURN_TIME, skb->tail, 507 ret = irda_param_insert(self, PI_MIN_TURN_TIME, skb_tail_pointer(skb),
508 skb_tailroom(skb), &irlap_param_info); 508 skb_tailroom(skb), &irlap_param_info);
509 if (ret < 0) 509 if (ret < 0)
510 return ret; 510 return ret;
511 skb_put(skb, ret); 511 skb_put(skb, ret);
512 512
513 /* Insert link disconnect/threshold time */ 513 /* Insert link disconnect/threshold time */
514 ret = irda_param_insert(self, PI_LINK_DISC, skb->tail, 514 ret = irda_param_insert(self, PI_LINK_DISC, skb_tail_pointer(skb),
515 skb_tailroom(skb), &irlap_param_info); 515 skb_tailroom(skb), &irlap_param_info);
516 if (ret < 0) 516 if (ret < 0)
517 return ret; 517 return ret;