[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [microblaze-uclinux] xenet_FifoSend(struct sk_buff *orig_skb,structnet_device*dev)
Falk wrote:
> (You can also try such measuring. It's attached to this mail.)
Index: tcp.c
===================================================================
--- tcp.c (revision 37)
+++ tcp.c (working copy)
@@ -658,6 +658,11 @@
return tmp;
}
+char ccc[256];
+unsigned int ttt[256];
+unsigned int uuu[256];
+int iii = 0;
+
int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
size_t size)
{
@@ -669,6 +674,10 @@
int err, copied;
long timeo;
+ unsigned char* pReg = (unsigned char*)0x440c0011;
+ ccc[iii] = 'c'; uuu[iii] = 0; ttt[iii++] = *((volatile unsigned int*)0x440c0030);
+ *pReg |= 0x08; //osci edge on
+
lock_sock(sk);
TCP_CHECK_TIMER(sk);
@@ -703,6 +712,7 @@
while (seglen > 0) {
int copy;
+ ccc[iii] = '1'; uuu[iii] = seglen; ttt[iii++] = *((volatile unsigned int*)0x440c0030);
skb = sk->sk_write_queue.prev;
@@ -716,8 +726,10 @@
if (!sk_stream_memory_free(sk))
goto wait_for_sndbuf;
+ ccc[iii] = 'A'; uuu[iii] = 0; ttt[iii++] = *((volatile unsigned int*)0x440c0030);
skb = sk_stream_alloc_pskb(sk, select_size(sk, tp),
0, sk->sk_allocation);
+ ccc[iii] = 'A'; uuu[iii] = 0; ttt[iii++] = *((volatile unsigned int*)0x440c0030);
if (!skb)
goto wait_for_memory;
@@ -740,19 +752,25 @@
/* We have some space in skb head. Superb! */
if (copy > skb_tailroom(skb))
copy = skb_tailroom(skb);
+ ccc[iii] = 'C'; uuu[iii] = copy; ttt[iii++] = *((volatile unsigned int*)0x440c0030);
+ *pReg |= 0x10;
if ((err = skb_add_data(skb, from, copy)) != 0)
goto do_fault;
+ *pReg &= ~0x10;
+ ccc[iii] = 'C'; uuu[iii] = 0; ttt[iii++] = *((volatile unsigned int*)0x440c0030);
} else {
int merge = 0;
int i = skb_shinfo(skb)->nr_frags;
struct page *page = TCP_PAGE(sk);
int off = TCP_OFF(sk);
+ ccc[iii] = '+'; uuu[iii] = 0; ttt[iii++] = *((volatile unsigned int*)0x440c0030);
if (skb_can_coalesce(skb, i, page, off) &&
off != PAGE_SIZE) {
/* We can extend the last page
* fragment. */
merge = 1;
+ ccc[iii] = '3'; uuu[iii] = 0; ttt[iii++] = *((volatile unsigned int*)0x440c0030);
} else if (i == MAX_SKB_FRAGS ||
(!i &&
!(sk->sk_route_caps & NETIF_F_SG))) {
@@ -761,6 +779,7 @@
* or because all the page slots are
* busy. */
tcp_mark_push(tp, skb);
+ ccc[iii] = '4'; uuu[iii] = 0; ttt[iii++] = *((volatile unsigned int*)0x440c0030);
goto new_segment;
} else if (page) {
if (off == PAGE_SIZE) {
@@ -768,15 +787,18 @@
TCP_PAGE(sk) = page = NULL;
off = 0;
}
+ ccc[iii] = '5'; uuu[iii] = 0; ttt[iii++] = *((volatile unsigned int*)0x440c0030);
} else
off = 0;
if (copy > PAGE_SIZE - off)
copy = PAGE_SIZE - off;
+ ccc[iii] = 's'; uuu[iii] = copy; ttt[iii++] = *((volatile unsigned int*)0x440c0030);
if (!sk_stream_wmem_schedule(sk, copy))
goto wait_for_memory;
+ ccc[iii] = 'a'; uuu[iii] = 0; ttt[iii++] = *((volatile unsigned int*)0x440c0030);
if (!page) {
/* Allocate new cache page. */
if (!(page = sk_stream_alloc_page(sk)))
@@ -785,6 +807,7 @@
/* Time to copy data. We are close to
* the end! */
+ ccc[iii] = 'c'; uuu[iii] = copy; ttt[iii++] = *((volatile unsigned int*)0x440c0030);
err = skb_copy_to_page(sk, from, skb, page,
off, copy);
if (err) {
@@ -798,6 +821,7 @@
goto do_error;
}
+ ccc[iii] = 'u'; uuu[iii] = 0; ttt[iii++] = *((volatile unsigned int*)0x440c0030);
/* Update the skb. */
if (merge) {
skb_shinfo(skb)->frags[i - 1].size +=
@@ -812,6 +836,7 @@
}
}
+ ccc[iii] = 'U'; uuu[iii] = 0; ttt[iii++] = *((volatile unsigned int*)0x440c0030);
TCP_OFF(sk) = off + copy;
}
@@ -830,16 +855,20 @@
if (skb->len < mss_now || (flags & MSG_OOB))
continue;
+ ccc[iii] = 'P'; uuu[iii] = 0; ttt[iii++] = *((volatile unsigned int*)0x440c0030);
if (forced_push(tp)) {
tcp_mark_push(tp, skb);
__tcp_push_pending_frames(sk, tp, mss_now, TCP_NAGLE_PUSH);
} else if (skb == sk->sk_send_head)
tcp_push_one(sk, mss_now);
+ ccc[iii] = 'P'; uuu[iii] = 0; ttt[iii++] = *((volatile unsigned int*)0x440c0030);
continue;
wait_for_sndbuf:
+
set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
wait_for_memory:
+
if (copied)
tcp_push(sk, tp, flags & ~MSG_MORE, mss_now, TCP_NAGLE_PUSH);
@@ -848,6 +877,7 @@
mss_now = tcp_current_mss(sk, !(flags&MSG_OOB));
size_goal = tp->xmit_size_goal;
+ ccc[iii] = 'e'; uuu[iii] = size_goal; ttt[iii++] = *((volatile unsigned int*)0x440c0030);
}
}
@@ -856,6 +886,20 @@
tcp_push(sk, tp, flags, mss_now, tp->nonagle);
TCP_CHECK_TIMER(sk);
release_sock(sk);
+ *pReg &= ~0x08; //osci edge off
+
+ ccc[iii] = '-'; uuu[iii] = 0; ttt[iii++] = *((volatile unsigned int*)0x440c0030);
+ if (iii > 235) {
+ int jjj=0;
+ for (;jjj < iii; jjj++) {
+ if (ccc[jjj] == '-') {
+ printk("-\n");
+ } else {
+ printk("%c %d %d\n", ccc[jjj], uuu[jjj], jjj ? (ttt[jjj] - ttt[jjj-1]) : ttt[jjj]);
+ }
+ }
+ iii = 0;
+ }
return copied;
do_fault:
@@ -873,6 +917,7 @@
err = sk_stream_error(sk, flags, err);
TCP_CHECK_TIMER(sk);
release_sock(sk);
+ *pReg &= ~0x08; //osci edge off
return err;
}
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/