]> Pileus Git - ~andy/linux/blobdiff - drivers/net/ethernet/mellanox/mlx4/en_rx.c
mlx4: 64-byte CQE/EQE support
[~andy/linux] / drivers / net / ethernet / mellanox / mlx4 / en_rx.c
index 5aba5ecdf1e28157fadf44072c87a4a98511d249..6fa106f6c0ecf6e8bd171071299507aa06b70f7c 100644 (file)
@@ -566,6 +566,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
        struct ethhdr *ethh;
        dma_addr_t dma;
        u64 s_mac;
+       int factor = priv->cqe_factor;
 
        if (!priv->port_up)
                return 0;
@@ -574,7 +575,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
         * descriptor offset can be deduced from the CQE index instead of
         * reading 'cqe->index' */
        index = cq->mcq.cons_index & ring->size_mask;
-       cqe = &cq->buf[index];
+       cqe = &cq->buf[(index << factor) + factor];
 
        /* Process all completed CQEs */
        while (XNOR(cqe->owner_sr_opcode & MLX4_CQE_OWNER_MASK,
@@ -709,7 +710,7 @@ next:
 
                ++cq->mcq.cons_index;
                index = (cq->mcq.cons_index) & ring->size_mask;
-               cqe = &cq->buf[index];
+               cqe = &cq->buf[(index << factor) + factor];
                if (++polled == budget) {
                        /* We are here because we reached the NAPI budget -
                         * flush only pending LRO sessions */