net/sfc/base: support filters for encapsulated packets
[dpdk.git] / drivers / net / sfc / base / efx_ev.c
index a667124..42ded5a 100644 (file)
@@ -30,6 +30,9 @@
 
 #include "efx.h"
 #include "efx_impl.h"
+#if EFSYS_OPT_MON_MCDI
+#include "mcdi_mon.h"
+#endif
 
 #if EFSYS_OPT_QSTATS
 #define        EFX_EV_QSTAT_INCR(_eep, _stat)                                  \
@@ -1100,6 +1103,9 @@ siena_ev_mcdi(
 
        EFSYS_ASSERT(eecp->eec_link_change != NULL);
        EFSYS_ASSERT(eecp->eec_exception != NULL);
+#if EFSYS_OPT_MON_STATS
+       EFSYS_ASSERT(eecp->eec_monitor != NULL);
+#endif
 
        EFX_EV_QSTAT_INCR(eep, EV_MCDI_RESPONSE);
 
@@ -1124,7 +1130,22 @@ siena_ev_mcdi(
                break;
        }
        case MCDI_EVENT_CODE_SENSOREVT: {
+#if EFSYS_OPT_MON_STATS
+               efx_mon_stat_t id;
+               efx_mon_stat_value_t value;
+               efx_rc_t rc;
+
+               if ((rc = mcdi_mon_ev(enp, eqp, &id, &value)) == 0)
+                       should_abort = eecp->eec_monitor(arg, id, value);
+               else if (rc == ENOTSUP) {
+                       should_abort = eecp->eec_exception(arg,
+                               EFX_EXCEPTION_UNKNOWN_SENSOREVT,
+                               MCDI_EV_FIELD(eqp, DATA));
+               } else
+                       EFSYS_ASSERT(rc == ENODEV);     /* Wrong port */
+#else
                should_abort = B_FALSE;
+#endif
                break;
        }
        case MCDI_EVENT_CODE_SCHEDERR:
@@ -1285,6 +1306,13 @@ siena_ev_qcreate(
                rc = EINVAL;
                goto fail2;
        }
+#if EFSYS_OPT_RX_SCALE
+       if (enp->en_intr.ei_type == EFX_INTR_LINE &&
+           index >= EFX_MAXRSS_LEGACY) {
+               rc = EINVAL;
+               goto fail3;
+       }
+#endif
        for (size = 0; (1 << size) <= (EFX_EVQ_MAXNEVS / EFX_EVQ_MINNEVS);
            size++)
                if ((1 << size) == (int)(n / EFX_EVQ_MINNEVS))
@@ -1325,6 +1353,10 @@ siena_ev_qcreate(
 
 fail4:
        EFSYS_PROBE(fail4);
+#if EFSYS_OPT_RX_SCALE
+fail3:
+       EFSYS_PROBE(fail3);
+#endif
 fail2:
        EFSYS_PROBE(fail2);
 fail1: