Date: Fri, 30 Aug 2013 02:13:36 +0000 (UTC) From: Navdeep Parhar <np@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255052 - head/sys/dev/cxgbe Message-ID: <201308300213.r7U2Dai8070191@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: np Date: Fri Aug 30 02:13:36 2013 New Revision: 255052 URL: http://svnweb.freebsd.org/changeset/base/255052 Log: Fix the sysctl that displays whether buffer packing is enabled or not. Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Fri Aug 30 01:46:56 2013 (r255051) +++ head/sys/dev/cxgbe/t4_sge.c Fri Aug 30 02:13:36 2013 (r255052) @@ -604,6 +604,17 @@ t4_create_dma_tag(struct adapter *sc) return (rc); } +static inline int +enable_buffer_packing(struct adapter *sc) +{ + + if (sc->flags & BUF_PACKING_OK && + ((is_t5(sc) && buffer_packing) || /* 1 or -1 both ok for T5 */ + (is_t4(sc) && buffer_packing == 1))) + return (1); + return (0); +} + void t4_sge_sysctls(struct adapter *sc, struct sysctl_ctx_list *ctx, struct sysctl_oid_list *children) @@ -622,7 +633,7 @@ t4_sge_sysctls(struct adapter *sc, struc NULL, cong_drop, "congestion drop setting"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "buffer_packing", CTLFLAG_RD, - NULL, sc->flags & BUF_PACKING_OK ? 1 : 0, + NULL, enable_buffer_packing(sc), "pack multiple frames in one fl buffer"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "fl_pack", CTLFLAG_RD, @@ -841,12 +852,7 @@ t4_setup_port_queues(struct port_info *p * b) allocate queue iff it will take direct interrupts. */ bufsize = mtu_to_bufsize(ifp->if_mtu); - if (sc->flags & BUF_PACKING_OK && - ((is_t5(sc) && buffer_packing) || /* 1 or -1 both ok for T5 */ - (is_t4(sc) && buffer_packing == 1))) - pack = 1; - else - pack = 0; + pack = enable_buffer_packing(sc); for_each_rxq(pi, i, rxq) { init_iq(&rxq->iq, sc, pi->tmr_idx, pi->pktc_idx, pi->qsize_rxq,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308300213.r7U2Dai8070191>