netdev
[Top] [All Lists]

Re: [PATCH] skb_{over,under}_panic optimizations

To: Ben LaHaise <bcrl@xxxxxxxxxx>
Subject: Re: [PATCH] skb_{over,under}_panic optimizations
From: Keith Owens <kaos@xxxxxxxxxx>
Date: Mon, 16 Jul 2001 13:11:05 +1000
Cc: davem@xxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: Your message of "Sun, 15 Jul 2001 22:37:03 -0400." <Pine.LNX.4.33.0107152228490.16774-100000@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
On Sun, 15 Jul 2001 22:37:03 -0400 (EDT), 
Ben LaHaise <bcrl@xxxxxxxxxx> wrote:
>Below is a patch that moves the skb_{over,under}_panic function calls in
>skb_put and skb_push out of line on i386 and hopefully improves register
>allocation.
>+#define __arch_skb_check(insn, left, right, skb, why, len) \
>+      __asm__ __volatile__( \
>+      "       cmpl %1,%0\n" \
>+      "1:     " insn " 2f\n" \
>+      ".section .text.lock,\"ax\"\n" \
>+      "2:     pushl 1b\n" \
>+      "       pushl %3\n" \
>+      "       pushl %2\n" \
>+      "       call skb_" why "_panic\n" \
>+      "       ud2a\n" \
>+      ".previous\n" \
>+      : : "r" (left), "rm" (right), "rmi" (skb), "rmi" (len) \
>+      : "cc" )

'call skb_" why "_panic' will break using module symbol versions,
skb_*_panic symbols are exported so all references to those symbols
need to be visible to cpp, not inside string quotes.  This should work
(untested).

        "       call %c4\n" \
  ....
        : : "r" (left), "rm" (right), "rmi" (skb), "rmi" (len) \
            "i" (skb_ ## why ## _panic) \


<Prev in Thread] Current Thread [Next in Thread>