net/sfc/base: provide simple access to RxQ state in EvQ
authorAndrew Rybchenko <arybchenko@solarflare.com>
Thu, 16 Nov 2017 08:04:10 +0000 (08:04 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 16 Jan 2018 17:47:49 +0000 (18:47 +0100)
Packed stream Rx datapath requires access to packed stream state
stored in event queue. Number of credits is upstead in event handler
on a new buffer, packets parsing on 64k boundary crossing and
Rx doorbell push to give credits back.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
drivers/net/sfc/base/ef10_rx.c
drivers/net/sfc/base/efx_impl.h

index 6a301c1..534a06e 100644 (file)
@@ -784,8 +784,7 @@ ef10_rx_qpush_ps_credits(
 {
        efx_nic_t *enp = erp->er_enp;
        efx_dword_t dword;
-       efx_evq_rxq_state_t *rxq_state =
-               &erp->er_eep->ee_rxq_state[erp->er_label];
+       efx_evq_rxq_state_t *rxq_state = erp->er_ev_qstate;
        uint32_t credits;
 
        EFSYS_ASSERT(rxq_state->eers_rx_packed_stream);
@@ -834,8 +833,7 @@ ef10_rx_qps_packet_info(
        uint16_t buf_len;
        uint8_t *pkt_start;
        efx_qword_t *qwordp;
-       efx_evq_rxq_state_t *rxq_state =
-               &erp->er_eep->ee_rxq_state[erp->er_label];
+       efx_evq_rxq_state_t *rxq_state = erp->er_ev_qstate;
 
        EFSYS_ASSERT(rxq_state->eers_rx_packed_stream);
 
@@ -994,6 +992,8 @@ ef10_rx_qcreate(
 
        ef10_ev_rxlabel_init(eep, erp, label, type);
 
+       erp->er_ev_qstate = &erp->er_eep->ee_rxq_state[label];
+
        return (0);
 
 fail6:
index 1fd5c71..dabb65d 100644 (file)
@@ -761,6 +761,7 @@ struct efx_rxq_s {
        unsigned int                    er_label;
        unsigned int                    er_mask;
        efsys_mem_t                     *er_esmp;
+       efx_evq_rxq_state_t             *er_ev_qstate;
 };
 
 #define        EFX_RXQ_MAGIC   0x15022005