sfc: define inner/outer csum offload TXQ types
[linux-2.6-microblaze.git] / drivers / net / ethernet / sfc / farch.c
index 4002f9a..bb5c45a 100644 (file)
@@ -320,7 +320,7 @@ void efx_farch_tx_write(struct efx_tx_queue *tx_queue)
        unsigned write_ptr;
        unsigned old_write_count = tx_queue->write_count;
 
-       tx_queue->xmit_more_available = false;
+       tx_queue->xmit_pending = false;
        if (unlikely(tx_queue->write_count == tx_queue->insert_count))
                return;
 
@@ -372,6 +372,8 @@ int efx_farch_tx_probe(struct efx_tx_queue *tx_queue)
        struct efx_nic *efx = tx_queue->efx;
        unsigned entries;
 
+       tx_queue->type = ((tx_queue->label & 1) ? EFX_TXQ_TYPE_OUTER_CSUM : 0) |
+                        ((tx_queue->label & 2) ? EFX_TXQ_TYPE_HIGHPRI : 0);
        entries = tx_queue->ptr_mask + 1;
        return efx_alloc_special_buffer(efx, &tx_queue->txd,
                                        entries * sizeof(efx_qword_t));
@@ -379,7 +381,7 @@ int efx_farch_tx_probe(struct efx_tx_queue *tx_queue)
 
 void efx_farch_tx_init(struct efx_tx_queue *tx_queue)
 {
-       int csum = tx_queue->label & EFX_TXQ_TYPE_OFFLOAD;
+       int csum = tx_queue->type & EFX_TXQ_TYPE_OUTER_CSUM;
        struct efx_nic *efx = tx_queue->efx;
        efx_oword_t reg;
 
@@ -409,7 +411,7 @@ void efx_farch_tx_init(struct efx_tx_queue *tx_queue)
 
        EFX_POPULATE_OWORD_1(reg,
                             FRF_BZ_TX_PACE,
-                            (tx_queue->label & EFX_TXQ_TYPE_HIGHPRI) ?
+                            (tx_queue->type & EFX_TXQ_TYPE_HIGHPRI) ?
                             FFE_BZ_TX_PACE_OFF :
                             FFE_BZ_TX_PACE_RESERVED);
        efx_writeo_table(efx, &reg, FR_BZ_TX_PACE_TBL, tx_queue->queue);
@@ -832,13 +834,13 @@ efx_farch_handle_tx_event(struct efx_channel *channel, efx_qword_t *event)
                tx_ev_desc_ptr = EFX_QWORD_FIELD(*event, FSF_AZ_TX_EV_DESC_PTR);
                tx_ev_q_label = EFX_QWORD_FIELD(*event, FSF_AZ_TX_EV_Q_LABEL);
                tx_queue = efx_channel_get_tx_queue(
-                       channel, tx_ev_q_label % EFX_TXQ_TYPES);
+                       channel, tx_ev_q_label % EFX_MAX_TXQ_PER_CHANNEL);
                efx_xmit_done(tx_queue, tx_ev_desc_ptr);
        } else if (EFX_QWORD_FIELD(*event, FSF_AZ_TX_EV_WQ_FF_FULL)) {
                /* Rewrite the FIFO write pointer */
                tx_ev_q_label = EFX_QWORD_FIELD(*event, FSF_AZ_TX_EV_Q_LABEL);
                tx_queue = efx_channel_get_tx_queue(
-                       channel, tx_ev_q_label % EFX_TXQ_TYPES);
+                       channel, tx_ev_q_label % EFX_MAX_TXQ_PER_CHANNEL);
 
                netif_tx_lock(efx->net_dev);
                efx_farch_notify_tx_desc(tx_queue);
@@ -863,13 +865,8 @@ static u16 efx_farch_handle_rx_not_ok(struct efx_rx_queue *rx_queue,
        bool rx_ev_tcp_udp_chksum_err, rx_ev_eth_crc_err;
        bool rx_ev_frm_trunc, rx_ev_tobe_disc;
        bool rx_ev_other_err, rx_ev_pause_frm;
-       bool rx_ev_hdr_type, rx_ev_mcast_pkt;
-       unsigned rx_ev_pkt_type;
 
-       rx_ev_hdr_type = EFX_QWORD_FIELD(*event, FSF_AZ_RX_EV_HDR_TYPE);
-       rx_ev_mcast_pkt = EFX_QWORD_FIELD(*event, FSF_AZ_RX_EV_MCAST_PKT);
        rx_ev_tobe_disc = EFX_QWORD_FIELD(*event, FSF_AZ_RX_EV_TOBE_DISC);
-       rx_ev_pkt_type = EFX_QWORD_FIELD(*event, FSF_AZ_RX_EV_PKT_TYPE);
        rx_ev_buf_owner_id_err = EFX_QWORD_FIELD(*event,
                                                 FSF_AZ_RX_EV_BUF_OWNER_ID_ERR);
        rx_ev_ip_hdr_chksum_err = EFX_QWORD_FIELD(*event,
@@ -918,6 +915,8 @@ static u16 efx_farch_handle_rx_not_ok(struct efx_rx_queue *rx_queue,
                          rx_ev_tobe_disc ? " [TOBE_DISC]" : "",
                          rx_ev_pause_frm ? " [PAUSE]" : "");
        }
+#else
+       (void) rx_ev_other_err;
 #endif
 
        if (efx->net_dev->features & NETIF_F_RXALL)
@@ -1083,9 +1082,9 @@ efx_farch_handle_tx_flush_done(struct efx_nic *efx, efx_qword_t *event)
        int qid;
 
        qid = EFX_QWORD_FIELD(*event, FSF_AZ_DRIVER_EV_SUBDATA);
-       if (qid < EFX_TXQ_TYPES * (efx->n_tx_channels + efx->n_extra_tx_channels)) {
-               tx_queue = efx_get_tx_queue(efx, qid / EFX_TXQ_TYPES,
-                                           qid % EFX_TXQ_TYPES);
+       if (qid < EFX_MAX_TXQ_PER_CHANNEL * (efx->n_tx_channels + efx->n_extra_tx_channels)) {
+               tx_queue = efx_get_tx_queue(efx, qid / EFX_MAX_TXQ_PER_CHANNEL,
+                                           qid % EFX_MAX_TXQ_PER_CHANNEL);
                if (atomic_cmpxchg(&tx_queue->flush_outstanding, 1, 0)) {
                        efx_farch_magic_event(tx_queue->channel,
                                              EFX_CHANNEL_MAGIC_TX_DRAIN(tx_queue));
@@ -1678,10 +1677,10 @@ void efx_farch_dimension_resources(struct efx_nic *efx, unsigned sram_lim_qw)
         * and the descriptor caches for those channels.
         */
        buftbl_min = ((efx->n_rx_channels * EFX_MAX_DMAQ_SIZE +
-                      total_tx_channels * EFX_TXQ_TYPES * EFX_MAX_DMAQ_SIZE +
+                      total_tx_channels * EFX_MAX_TXQ_PER_CHANNEL * EFX_MAX_DMAQ_SIZE +
                       efx->n_channels * EFX_MAX_EVQ_SIZE)
                      * sizeof(efx_qword_t) / EFX_BUF_SIZE);
-       vi_count = max(efx->n_channels, total_tx_channels * EFX_TXQ_TYPES);
+       vi_count = max(efx->n_channels, total_tx_channels * EFX_MAX_TXQ_PER_CHANNEL);
 
 #ifdef CONFIG_SFC_SRIOV
        if (efx->type->sriov_wanted) {
@@ -2592,7 +2591,6 @@ int efx_farch_filter_remove_safe(struct efx_nic *efx,
        enum efx_farch_filter_table_id table_id;
        struct efx_farch_filter_table *table;
        unsigned int filter_idx;
-       struct efx_farch_filter_spec *spec;
        int rc;
 
        table_id = efx_farch_filter_id_table_id(filter_id);
@@ -2604,7 +2602,6 @@ int efx_farch_filter_remove_safe(struct efx_nic *efx,
        if (filter_idx >= table->size)
                return -ENOENT;
        down_write(&state->lock);
-       spec = &table->spec[filter_idx];
 
        rc = efx_farch_filter_remove(efx, table, filter_idx, priority);
        up_write(&state->lock);