From: visa Date: Fri, 5 Aug 2016 13:18:27 +0000 (+0000) Subject: Drop a pointless link carrier check from the RX path. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9dcb78fda24e07070c9075309f1f2f1a464341c1;p=openbsd Drop a pointless link carrier check from the RX path. --- diff --git a/sys/arch/octeon/dev/if_cnmac.c b/sys/arch/octeon/dev/if_cnmac.c index 66544cadf75..74cd247dc39 100644 --- a/sys/arch/octeon/dev/if_cnmac.c +++ b/sys/arch/octeon/dev/if_cnmac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_cnmac.c,v 1.55 2016/08/04 13:10:31 visa Exp $ */ +/* $OpenBSD: if_cnmac.c,v 1.56 2016/08/05 13:18:27 visa Exp $ */ /* * Copyright (c) 2007 Internet Initiative Japan, Inc. @@ -165,7 +165,6 @@ void octeon_eth_tick_misc(void *); int octeon_eth_recv_mbuf(struct octeon_eth_softc *, uint64_t *, struct mbuf **, int *); int octeon_eth_recv_check_code(struct octeon_eth_softc *, uint64_t); -int octeon_eth_recv_check_link(struct octeon_eth_softc *, uint64_t); int octeon_eth_recv_check(struct octeon_eth_softc *, uint64_t); int octeon_eth_recv(struct octeon_eth_softc *, uint64_t *); void octeon_eth_recv_intr(void *, uint64_t *); @@ -325,7 +324,6 @@ octeon_eth_attach(struct device *parent, struct device *self, void *aux) ether_ifattach(ifp); /* XXX */ - sc->sc_rate_recv_check_link_cap.tv_sec = 1; sc->sc_rate_recv_check_code_cap.tv_sec = 1; #if 1 @@ -1242,26 +1240,9 @@ octeon_eth_recv_check_code(struct octeon_eth_softc *sc, uint64_t word2) return 1; } -int -octeon_eth_recv_check_link(struct octeon_eth_softc *sc, uint64_t word2) -{ - if (__predict_false(!cn30xxgmx_link_status(sc->sc_gmx_port))) - return 1; - return 0; -} - int octeon_eth_recv_check(struct octeon_eth_softc *sc, uint64_t word2) { - if (__predict_false(octeon_eth_recv_check_link(sc, word2)) != 0) { - if (ratecheck(&sc->sc_rate_recv_check_link_last, - &sc->sc_rate_recv_check_link_cap)) - log(LOG_DEBUG, - "%s: link is not up, the packet was dropped\n", - sc->sc_dev.dv_xname); - return 1; - } - if (__predict_false(octeon_eth_recv_check_code(sc, word2)) != 0) { if ((word2 & PIP_WQE_WORD2_NOIP_OPECODE) == PIP_WQE_WORD2_RE_OPCODE_LENGTH) { /* no logging */ diff --git a/sys/arch/octeon/dev/if_cnmacvar.h b/sys/arch/octeon/dev/if_cnmacvar.h index 322a4b45371..b15526b6299 100644 --- a/sys/arch/octeon/dev/if_cnmacvar.h +++ b/sys/arch/octeon/dev/if_cnmacvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_cnmacvar.h,v 1.14 2016/08/04 13:10:31 visa Exp $ */ +/* $OpenBSD: if_cnmacvar.h,v 1.15 2016/08/05 13:18:27 visa Exp $ */ /* * Copyright (c) 2007 Internet Initiative Japan, Inc. @@ -106,8 +106,6 @@ struct octeon_eth_softc { size_t sc_ip_offset; - struct timeval sc_rate_recv_check_link_last; - struct timeval sc_rate_recv_check_link_cap; struct timeval sc_rate_recv_check_code_last; struct timeval sc_rate_recv_check_code_cap; };