From 376a6a2a92d0c2a273a84573188ca61fda1c7435 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Sun, 29 Jun 2014 21:36:01 +0200 Subject: [PATCH] kernel: remove layer of indirection for ether_input() Mop up after the recent changes by pulling the old switcheroo on ether_input_pkt(), effectively renaming the function to ether_input(). Also updates comments accordingly. --- share/man/man4/ktr.4 | 4 ++-- sys/net/if_ethersubr.c | 13 +++---------- sys/net/if_var.h | 21 ++++++++++++++------- sys/net/netisr.h | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/share/man/man4/ktr.4 b/share/man/man4/ktr.4 index 49e618b0cb..179ccecd06 100644 --- a/share/man/man4/ktr.4 +++ b/share/man/man4/ktr.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD: src/share/man/man4/ktr.4,v 1.9 2003/09/08 19:57:19 ru Exp $ .\" -.Dd May 11, 2014 +.Dd June 29, 2014 .Dt KTR 4 .Os .Sh NAME @@ -94,7 +94,7 @@ read and write strategy paths of target .It Dv KTR_ETHERNET cost of -.Fn ether_input_pkt +.Fn ether_input and .Fn ether_dispatch .It Dv KTR_IF_BGE diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 8cdfa39431..c7a77bec2a 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -525,13 +525,6 @@ ether_ipfw_chk(struct mbuf **m0, struct ifnet *dst, struct ip_fw **rule, } } -static void -ether_input(struct ifnet *ifp, struct mbuf *m, - const struct pktinfo *pi, int cpuid) -{ - ether_input_pkt(ifp, m, pi, cpuid); -} - /* * Perform common duties while attaching to interface list */ @@ -1070,7 +1063,7 @@ post_stats: #ifdef MPLS case ETHERTYPE_MPLS: case ETHERTYPE_MPLS_MCAST: - /* Should have been set by ether_input_pkt(). */ + /* Should have been set by ether_input(). */ KKASSERT(m->m_flags & M_MPLSLABELED); isr = NETISR_MPLS; break; @@ -1202,7 +1195,7 @@ ether_input_oncpu(struct ifnet *ifp, struct mbuf *m) } /* - * Perform certain functions of ether_input_pkt(): + * Perform certain functions of ether_input(): * - Test IFF_UP * - Update statistics * - Run bpf(4) tap if requested @@ -1388,7 +1381,7 @@ ether_dispatch(int isr, struct mbuf *m, int cpuid) * be passed as 'cpuid' argument. */ void -ether_input_pkt(struct ifnet *ifp, struct mbuf *m, const struct pktinfo *pi, +ether_input(struct ifnet *ifp, struct mbuf *m, const struct pktinfo *pi, int cpuid) { int isr; diff --git a/sys/net/if_var.h b/sys/net/if_var.h index a2f78f75dd..305810e3b8 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -56,7 +56,9 @@ * received from its medium. * * Output occurs when the routine if_output is called, with four parameters: + * * ifp->if_output(ifp, m, dst, rt) + * * Here m is the mbuf chain to be sent and dst is the destination address. * The output routine encapsulates the supplied datagram if necessary, * and then transmits it on its medium. @@ -64,12 +66,17 @@ * On input, each interface unwraps the data received by it, and either * places it on the input queue of a internetwork datagram routine * and posts the associated software interrupt, or passes the datagram to - * the routine if_input. It is called with the mbuf chain as parameter: - * ifp->if_input(ifp, m, NULL, -1) - * The input routine removes the protocol dependent header if necessary. - * NOTE: - * Driver may call type specific interface, e.g. ether_input_pkt(), instead - * of if_input, to take advantage of hardware supplied information. + * the routine if_input. It is called with four parameters: + * + * ifp->if_input(ifp, m, pi, cpuid) + * + * Here m is the mbuf chain to be received. The input routine removes the + * protocol dependent header if necessary. A driver may also call using + * custom struct pktinfo reference pi and a cpuid to take advantage of + * hardware supplied information. Otherwise, the defaults for pi and cpuid + * are as follows: + * + * ifp->if_input(ifp, m, NULL, -1); * * Routines exist for locating interfaces by their addresses * or for locating a interface on a certain network, as well as more general @@ -888,7 +895,7 @@ void ether_ifdetach(struct ifnet *); void ether_demux(struct mbuf *); void ether_demux_oncpu(struct ifnet *, struct mbuf *); void ether_reinput_oncpu(struct ifnet *, struct mbuf *, int); -void ether_input_pkt(struct ifnet *, struct mbuf *, +void ether_input(struct ifnet *, struct mbuf *, const struct pktinfo *, int); int ether_output_frame(struct ifnet *, struct mbuf *); int ether_ioctl(struct ifnet *, u_long, caddr_t); diff --git a/sys/net/netisr.h b/sys/net/netisr.h index af4190220f..0dc3bd99cd 100644 --- a/sys/net/netisr.h +++ b/sys/net/netisr.h @@ -129,7 +129,7 @@ void netmsg_so_notify_doabort(lwkt_msg_t); /* * Temporary pktinfo structure passed directly from the driver to - * ether_input_pkt(), allows us to bypass numerous checks. + * ether_input(), allows us to bypass numerous checks. */ struct pktinfo { int pi_netisr; /* netisr index, e.g. NETISR_IP */ -- 2.41.0