static inline int ip_forward_finish(struct sk_buff *skb) { }

This means that it is shown as a normal function, but the compiler does not invoke it by means of a classic function call (pass parameters, set instruction pointers to function code, read arguments, etc.). Instead, the entire C code is copied to the point at which the function is invoked. Although this results in a longer executable (particularly for larger functions), it is compensated by speed gains. The GNU C compiler guarantees that inline functions are as fast as macros if this approach is adopted.

However, starting with kernel 2.6.24, the inline definition could be removed in nearly all cases!

Continue reading here: Netipv4ipforwardc

Was this article helpful?

0 0