Commit 163943ac authored by Alexander Lobakin's avatar Alexander Lobakin Committed by Christoph Hellwig
Browse files

xsk: use generic DMA sync shortcut instead of a custom one



XSk infra's been using its own DMA sync shortcut to try avoiding
redundant function calls. Now that there is a generic one, remove
the custom implementation and rely on the generic helpers.
xsk_buff_dma_sync_for_cpu() doesn't need the second argument anymore,
remove it.

Signed-off-by: default avatarAlexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 4321de44
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1587,7 +1587,7 @@ static int tsnep_rx_poll_zc(struct tsnep_rx *rx, struct napi_struct *napi,
		length = __le32_to_cpu(entry->desc_wb->properties) &
			 TSNEP_DESC_LENGTH_MASK;
		xsk_buff_set_size(entry->xdp, length - ETH_FCS_LEN);
		xsk_buff_dma_sync_for_cpu(entry->xdp, rx->xsk_pool);
		xsk_buff_dma_sync_for_cpu(entry->xdp);

		/* RX metadata with timestamps is in front of actual data,
		 * subtract metadata size to get length of actual data and
+1 −1
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ static u32 dpaa2_xsk_run_xdp(struct dpaa2_eth_priv *priv,
	xdp_set_data_meta_invalid(xdp_buff);
	xdp_buff->rxq = &ch->xdp_rxq;

	xsk_buff_dma_sync_for_cpu(xdp_buff, ch->xsk_pool);
	xsk_buff_dma_sync_for_cpu(xdp_buff);
	xdp_act = bpf_prog_run_xdp(xdp_prog, xdp_buff);

	/* xdp.data pointer may have changed */
+1 −1
Original line number Diff line number Diff line
@@ -483,7 +483,7 @@ int i40e_clean_rx_irq_zc(struct i40e_ring *rx_ring, int budget)

		bi = *i40e_rx_bi(rx_ring, next_to_process);
		xsk_buff_set_size(bi, size);
		xsk_buff_dma_sync_for_cpu(bi, rx_ring->xsk_pool);
		xsk_buff_dma_sync_for_cpu(bi);

		if (!first)
			first = bi;
+1 −1
Original line number Diff line number Diff line
@@ -879,7 +879,7 @@ int ice_clean_rx_irq_zc(struct ice_rx_ring *rx_ring, int budget)
				   ICE_RX_FLX_DESC_PKT_LEN_M;

		xsk_buff_set_size(xdp, size);
		xsk_buff_dma_sync_for_cpu(xdp, xsk_pool);
		xsk_buff_dma_sync_for_cpu(xdp);

		if (!first) {
			first = xdp;
+1 −1
Original line number Diff line number Diff line
@@ -2813,7 +2813,7 @@ static int igc_clean_rx_irq_zc(struct igc_q_vector *q_vector, const int budget)
		}

		bi->xdp->data_end = bi->xdp->data + size;
		xsk_buff_dma_sync_for_cpu(bi->xdp, ring->xsk_pool);
		xsk_buff_dma_sync_for_cpu(bi->xdp);

		res = __igc_xdp_run_prog(adapter, prog, bi->xdp);
		switch (res) {
Loading