ena_netmap.c (358bcc4c6cde30dd7f785d14327ba391f552b3e0) ena_netmap.c (8483b844e7e48dbfc61c6e38908921c4fa691d4c)
1/*-
2 * BSD LICENSE
3 *
4 * Copyright (c) 2015-2019 Amazon.com, Inc. or its affiliates.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

368 rc = 0;
369 break;
370 }
371 tx_ring->acum_pkts++;
372 }
373
374 /* If any packet was sent... */
375 if (likely(ctx->nm_i != ctx->kring->nr_hwcur)) {
1/*-
2 * BSD LICENSE
3 *
4 * Copyright (c) 2015-2019 Amazon.com, Inc. or its affiliates.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

368 rc = 0;
369 break;
370 }
371 tx_ring->acum_pkts++;
372 }
373
374 /* If any packet was sent... */
375 if (likely(ctx->nm_i != ctx->kring->nr_hwcur)) {
376 wmb();
377 /* ...send the doorbell to the device. */
378 ena_com_write_sq_doorbell(ctx->io_sq);
379 counter_u64_add(ctx->ring->tx_stats.doorbells, 1);
380 tx_ring->acum_pkts = 0;
381
382 ctx->ring->next_to_use = ctx->nt;
383 ctx->kring->nr_hwcur = ctx->nm_i;
384 }

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

426 ena_tx_ctx.num_bufs = tx_info->num_of_bufs;
427 ena_tx_ctx.req_id = req_id;
428 ena_tx_ctx.header_len = header_len;
429
430 /* There are no any offloads, as the netmap doesn't support them */
431
432 if (tx_ring->acum_pkts == DB_THRESHOLD ||
433 ena_com_is_doorbell_needed(ctx->io_sq, &ena_tx_ctx)) {
376 /* ...send the doorbell to the device. */
377 ena_com_write_sq_doorbell(ctx->io_sq);
378 counter_u64_add(ctx->ring->tx_stats.doorbells, 1);
379 tx_ring->acum_pkts = 0;
380
381 ctx->ring->next_to_use = ctx->nt;
382 ctx->kring->nr_hwcur = ctx->nm_i;
383 }

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

425 ena_tx_ctx.num_bufs = tx_info->num_of_bufs;
426 ena_tx_ctx.req_id = req_id;
427 ena_tx_ctx.header_len = header_len;
428
429 /* There are no any offloads, as the netmap doesn't support them */
430
431 if (tx_ring->acum_pkts == DB_THRESHOLD ||
432 ena_com_is_doorbell_needed(ctx->io_sq, &ena_tx_ctx)) {
434 wmb();
435 ena_com_write_sq_doorbell(ctx->io_sq);
436 counter_u64_add(tx_ring->tx_stats.doorbells, 1);
437 tx_ring->acum_pkts = 0;
438 }
439
440 rc = ena_com_prepare_tx(ctx->io_sq, &ena_tx_ctx, &nb_hw_desc);
441 if (unlikely(rc != 0)) {
442 if (likely(rc == ENA_COM_NO_MEM)) {

--- 653 unchanged lines hidden ---
433 ena_com_write_sq_doorbell(ctx->io_sq);
434 counter_u64_add(tx_ring->tx_stats.doorbells, 1);
435 tx_ring->acum_pkts = 0;
436 }
437
438 rc = ena_com_prepare_tx(ctx->io_sq, &ena_tx_ctx, &nb_hw_desc);
439 if (unlikely(rc != 0)) {
440 if (likely(rc == ENA_COM_NO_MEM)) {

--- 653 unchanged lines hidden ---