Date: Mon, 29 Apr 2019 00:40:02 +0000 (UTC) From: Navdeep Parhar <np@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346863 - in stable/11/sys/dev/cxgbe: . common tom Message-ID: <201904290040.x3T0e2Nd076838@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: np Date: Mon Apr 29 00:40:02 2019 New Revision: 346863 URL: https://svnweb.freebsd.org/changeset/base/346863 Log: MFC r334138: r334138: cxgbe(4): Make FW4_ACK a shared CPL. Modified: stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/common/t4_msg.h stable/11/sys/dev/cxgbe/t4_sge.c stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/11/sys/dev/cxgbe/adapter.h Mon Apr 29 00:31:58 2019 (r346862) +++ stable/11/sys/dev/cxgbe/adapter.h Mon Apr 29 00:40:02 2019 (r346863) @@ -373,7 +373,7 @@ enum { CPL_COOKIE_DDP1, CPL_COOKIE_TOM, CPL_COOKIE_HASHFILTER, - CPL_COOKIE_AVAILABLE2, + CPL_COOKIE_ETHOFLD, CPL_COOKIE_AVAILABLE3, NUM_CPL_COOKIES = 8 /* Limited by M_COOKIE. Do not increase. */ Modified: stable/11/sys/dev/cxgbe/common/t4_msg.h ============================================================================== --- stable/11/sys/dev/cxgbe/common/t4_msg.h Mon Apr 29 00:31:58 2019 (r346862) +++ stable/11/sys/dev/cxgbe/common/t4_msg.h Mon Apr 29 00:40:02 2019 (r346863) @@ -2749,6 +2749,30 @@ enum { CPL_FW4_ACK_FLAGS_FLOWC = 0x4, /* fw_flowc_wr complete */ }; +#define S_CPL_FW4_ACK_OPCODE 24 +#define M_CPL_FW4_ACK_OPCODE 0xff +#define V_CPL_FW4_ACK_OPCODE(x) ((x) << S_CPL_FW4_ACK_OPCODE) +#define G_CPL_FW4_ACK_OPCODE(x) \ + (((x) >> S_CPL_FW4_ACK_OPCODE) & M_CPL_FW4_ACK_OPCODE) + +#define S_CPL_FW4_ACK_FLOWID 0 +#define M_CPL_FW4_ACK_FLOWID 0xffffff +#define V_CPL_FW4_ACK_FLOWID(x) ((x) << S_CPL_FW4_ACK_FLOWID) +#define G_CPL_FW4_ACK_FLOWID(x) \ + (((x) >> S_CPL_FW4_ACK_FLOWID) & M_CPL_FW4_ACK_FLOWID) + +#define S_CPL_FW4_ACK_CR 24 +#define M_CPL_FW4_ACK_CR 0xff +#define V_CPL_FW4_ACK_CR(x) ((x) << S_CPL_FW4_ACK_CR) +#define G_CPL_FW4_ACK_CR(x) (((x) >> S_CPL_FW4_ACK_CR) & M_CPL_FW4_ACK_CR) + +#define S_CPL_FW4_ACK_SEQVAL 0 +#define M_CPL_FW4_ACK_SEQVAL 0x1 +#define V_CPL_FW4_ACK_SEQVAL(x) ((x) << S_CPL_FW4_ACK_SEQVAL) +#define G_CPL_FW4_ACK_SEQVAL(x) \ + (((x) >> S_CPL_FW4_ACK_SEQVAL) & M_CPL_FW4_ACK_SEQVAL) +#define F_CPL_FW4_ACK_SEQVAL V_CPL_FW4_ACK_SEQVAL(1U) + struct cpl_fw6_msg { RSS_HDR u8 opcode; Modified: stable/11/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_sge.c Mon Apr 29 00:31:58 2019 (r346862) +++ stable/11/sys/dev/cxgbe/t4_sge.c Mon Apr 29 00:40:02 2019 (r346863) @@ -300,6 +300,7 @@ cpl_handler_t set_tcb_rpl_handlers[NUM_CPL_COOKIES]; cpl_handler_t l2t_write_rpl_handlers[NUM_CPL_COOKIES]; cpl_handler_t act_open_rpl_handlers[NUM_CPL_COOKIES]; cpl_handler_t abort_rpl_rss_handlers[NUM_CPL_COOKIES]; +cpl_handler_t fw4_ack_handlers[NUM_CPL_COOKIES]; void t4_register_an_handler(an_handler_t h) @@ -412,6 +413,23 @@ abort_rpl_rss_handler(struct sge_iq *iq, const struct return (abort_rpl_rss_handlers[cookie](iq, rss, m)); } +static int +fw4_ack_handler(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) +{ + struct adapter *sc = iq->adapter; + const struct cpl_fw4_ack *cpl = (const void *)(rss + 1); + unsigned int tid = G_CPL_FW4_ACK_FLOWID(be32toh(OPCODE_TID(cpl))); + u_int cookie; + + MPASS(m == NULL); + if (is_etid(sc, tid)) + cookie = CPL_COOKIE_ETHOFLD; + else + cookie = CPL_COOKIE_TOM; + + return (fw4_ack_handlers[cookie](iq, rss, m)); +} + static void t4_init_shared_cpl_handlers(void) { @@ -420,6 +438,7 @@ t4_init_shared_cpl_handlers(void) t4_register_cpl_handler(CPL_L2T_WRITE_RPL, l2t_write_rpl_handler); t4_register_cpl_handler(CPL_ACT_OPEN_RPL, act_open_rpl_handler); t4_register_cpl_handler(CPL_ABORT_RPL_RSS, abort_rpl_rss_handler); + t4_register_cpl_handler(CPL_FW4_ACK, fw4_ack_handler); } void @@ -444,6 +463,9 @@ t4_register_shared_cpl_handler(int opcode, cpl_handler break; case CPL_ABORT_RPL_RSS: loc = (uintptr_t *)&abort_rpl_rss_handlers[cookie]; + break; + case CPL_FW4_ACK: + loc = (uintptr_t *)&fw4_ack_handlers[cookie]; break; default: MPASS(0); Modified: stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Apr 29 00:31:58 2019 (r346862) +++ stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Apr 29 00:40:02 2019 (r346863) @@ -1735,30 +1735,6 @@ do_rx_data(struct sge_iq *iq, const struct rss_header return (0); } -#define S_CPL_FW4_ACK_OPCODE 24 -#define M_CPL_FW4_ACK_OPCODE 0xff -#define V_CPL_FW4_ACK_OPCODE(x) ((x) << S_CPL_FW4_ACK_OPCODE) -#define G_CPL_FW4_ACK_OPCODE(x) \ - (((x) >> S_CPL_FW4_ACK_OPCODE) & M_CPL_FW4_ACK_OPCODE) - -#define S_CPL_FW4_ACK_FLOWID 0 -#define M_CPL_FW4_ACK_FLOWID 0xffffff -#define V_CPL_FW4_ACK_FLOWID(x) ((x) << S_CPL_FW4_ACK_FLOWID) -#define G_CPL_FW4_ACK_FLOWID(x) \ - (((x) >> S_CPL_FW4_ACK_FLOWID) & M_CPL_FW4_ACK_FLOWID) - -#define S_CPL_FW4_ACK_CR 24 -#define M_CPL_FW4_ACK_CR 0xff -#define V_CPL_FW4_ACK_CR(x) ((x) << S_CPL_FW4_ACK_CR) -#define G_CPL_FW4_ACK_CR(x) (((x) >> S_CPL_FW4_ACK_CR) & M_CPL_FW4_ACK_CR) - -#define S_CPL_FW4_ACK_SEQVAL 0 -#define M_CPL_FW4_ACK_SEQVAL 0x1 -#define V_CPL_FW4_ACK_SEQVAL(x) ((x) << S_CPL_FW4_ACK_SEQVAL) -#define G_CPL_FW4_ACK_SEQVAL(x) \ - (((x) >> S_CPL_FW4_ACK_SEQVAL) & M_CPL_FW4_ACK_SEQVAL) -#define F_CPL_FW4_ACK_SEQVAL V_CPL_FW4_ACK_SEQVAL(1U) - static int do_fw4_ack(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) { @@ -1966,7 +1942,7 @@ t4_init_cpl_io_handlers(void) t4_register_shared_cpl_handler(CPL_ABORT_RPL_RSS, do_abort_rpl, CPL_COOKIE_TOM); t4_register_cpl_handler(CPL_RX_DATA, do_rx_data); - t4_register_cpl_handler(CPL_FW4_ACK, do_fw4_ack); + t4_register_shared_cpl_handler(CPL_FW4_ACK, do_fw4_ack, CPL_COOKIE_TOM); } void @@ -1978,7 +1954,7 @@ t4_uninit_cpl_io_handlers(void) t4_register_cpl_handler(CPL_ABORT_REQ_RSS, NULL); t4_register_cpl_handler(CPL_ABORT_RPL_RSS, NULL); t4_register_cpl_handler(CPL_RX_DATA, NULL); - t4_register_cpl_handler(CPL_FW4_ACK, NULL); + t4_register_shared_cpl_handler(CPL_FW4_ACK, NULL, CPL_COOKIE_TOM); } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904290040.x3T0e2Nd076838>