Deleted Added
full compact
t4_sge.c (254727) t4_sge.c (255005)
1/*-
2 * Copyright (c) 2011 Chelsio Communications, Inc.
3 * All rights reserved.
4 * Written by: Navdeep Parhar <np@FreeBSD.org>
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2011 Chelsio Communications, Inc.
3 * All rights reserved.
4 * Written by: Navdeep Parhar <np@FreeBSD.org>
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/dev/cxgbe/t4_sge.c 254727 2013-08-23 18:03:18Z np $");
29__FBSDID("$FreeBSD: head/sys/dev/cxgbe/t4_sge.c 255005 2013-08-28 20:45:45Z np $");
30
31#include "opt_inet.h"
32#include "opt_inet6.h"
33
34#include <sys/types.h>
35#include <sys/mbuf.h>
36#include <sys/socket.h>
37#include <sys/kernel.h>

--- 1026 unchanged lines hidden (view full) ---

1064 * that are not forwarding their interrupts.
1065 * This means service_iq can recurse but only 1
1066 * level deep.
1067 */
1068 KASSERT(budget == 0,
1069 ("%s: budget %u, rsp_type %u", __func__,
1070 budget, rsp_type));
1071
30
31#include "opt_inet.h"
32#include "opt_inet6.h"
33
34#include <sys/types.h>
35#include <sys/mbuf.h>
36#include <sys/socket.h>
37#include <sys/kernel.h>

--- 1026 unchanged lines hidden (view full) ---

1064 * that are not forwarding their interrupts.
1065 * This means service_iq can recurse but only 1
1066 * level deep.
1067 */
1068 KASSERT(budget == 0,
1069 ("%s: budget %u, rsp_type %u", __func__,
1070 budget, rsp_type));
1071
1072 /*
1073 * There are 1K interrupt-capable queues (qids 0
1074 * through 1023). A response type indicating a
1075 * forwarded interrupt with a qid >= 1K is an
1076 * iWARP async notification.
1077 */
1078 if (lq >= 1024) {
1079 sc->an_handler(iq, ctrl);
1080 break;
1081 }
1082
1072 q = sc->sge.iqmap[lq - sc->sge.iq_start];
1073 if (atomic_cmpset_int(&q->state, IQS_IDLE,
1074 IQS_BUSY)) {
1075 if (service_iq(q, q->qsize / 8) == 0) {
1076 atomic_cmpset_int(&q->state,
1077 IQS_BUSY, IQS_IDLE);
1078 } else {
1079 STAILQ_INSERT_TAIL(&iql, q,
1080 link);
1081 }
1082 }
1083 break;
1084
1085 default:
1083 q = sc->sge.iqmap[lq - sc->sge.iq_start];
1084 if (atomic_cmpset_int(&q->state, IQS_IDLE,
1085 IQS_BUSY)) {
1086 if (service_iq(q, q->qsize / 8) == 0) {
1087 atomic_cmpset_int(&q->state,
1088 IQS_BUSY, IQS_IDLE);
1089 } else {
1090 STAILQ_INSERT_TAIL(&iql, q,
1091 link);
1092 }
1093 }
1094 break;
1095
1096 default:
1086 sc->an_handler(iq, ctrl);
1097 KASSERT(0,
1098 ("%s: illegal response type %d on iq %p",
1099 __func__, rsp_type, iq));
1100 log(LOG_ERR,
1101 "%s: illegal response type %d on iq %p",
1102 device_get_nameunit(sc->dev), rsp_type, iq);
1087 break;
1088 }
1089
1090 iq_next(iq);
1091 if (++ndescs == limit) {
1092 t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS),
1093 V_CIDXINC(ndescs) |
1094 V_INGRESSQID(iq->cntxt_id) |

--- 2682 unchanged lines hidden ---
1103 break;
1104 }
1105
1106 iq_next(iq);
1107 if (++ndescs == limit) {
1108 t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS),
1109 V_CIDXINC(ndescs) |
1110 V_INGRESSQID(iq->cntxt_id) |

--- 2682 unchanged lines hidden ---