Commit 4a76ed31 authored by Bert Kenward's avatar Bert Kenward Committed by Stefan Bader

sfc: make TSO version a per-queue parameter

BugLink: https://bugs.launchpad.net/bugs/1783152

The Solarflare 8000 series NIC will use a new TSO scheme. The current
driver refuses to load if the current TSO scheme is not found. Remove
that check and instead make the TSO version a per-queue parameter.
Signed-off-by: default avatarBert Kenward <bkenward@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
(cherry picked from commit 93171b14)
Signed-off-by: default avatarMauricio Faria de Oliveira <mauricio.oliveira@canonical.com>
Acked-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Acked-by: default avatarKleber Souza <kleber.souza@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 38d3d4d7
...@@ -180,13 +180,6 @@ static int efx_ef10_init_datapath_caps(struct efx_nic *efx) ...@@ -180,13 +180,6 @@ static int efx_ef10_init_datapath_caps(struct efx_nic *efx)
nic_data->tx_dpcpu_fw_id = nic_data->tx_dpcpu_fw_id =
MCDI_WORD(outbuf, GET_CAPABILITIES_OUT_TX_DPCPU_FW_ID); MCDI_WORD(outbuf, GET_CAPABILITIES_OUT_TX_DPCPU_FW_ID);
if (!(nic_data->datapath_caps &
(1 << MC_CMD_GET_CAPABILITIES_OUT_TX_TSO_LBN))) {
netif_err(efx, drv, efx->net_dev,
"current firmware does not support TSO\n");
return -ENODEV;
}
if (!(nic_data->datapath_caps & if (!(nic_data->datapath_caps &
(1 << MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_14_LBN))) { (1 << MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_14_LBN))) {
netif_err(efx, probe, efx->net_dev, netif_err(efx, probe, efx->net_dev,
...@@ -1813,6 +1806,12 @@ static void efx_ef10_tx_init(struct efx_tx_queue *tx_queue) ...@@ -1813,6 +1806,12 @@ static void efx_ef10_tx_init(struct efx_tx_queue *tx_queue)
ESF_DZ_TX_OPTION_UDP_TCP_CSUM, csum_offload, ESF_DZ_TX_OPTION_UDP_TCP_CSUM, csum_offload,
ESF_DZ_TX_OPTION_IP_CSUM, csum_offload); ESF_DZ_TX_OPTION_IP_CSUM, csum_offload);
tx_queue->write_count = 1; tx_queue->write_count = 1;
if (nic_data->datapath_caps &
(1 << MC_CMD_GET_CAPABILITIES_OUT_TX_TSO_LBN)) {
tx_queue->tso_version = 1;
}
wmb(); wmb();
efx_ef10_push_tx_desc(tx_queue, txd); efx_ef10_push_tx_desc(tx_queue, txd);
......
...@@ -182,6 +182,7 @@ struct efx_tx_buffer { ...@@ -182,6 +182,7 @@ struct efx_tx_buffer {
* *
* @efx: The associated Efx NIC * @efx: The associated Efx NIC
* @queue: DMA queue number * @queue: DMA queue number
* @tso_version: Version of TSO in use for this queue.
* @channel: The associated channel * @channel: The associated channel
* @core_txq: The networking core TX queue structure * @core_txq: The networking core TX queue structure
* @buffer: The software buffer ring * @buffer: The software buffer ring
...@@ -228,6 +229,7 @@ struct efx_tx_queue { ...@@ -228,6 +229,7 @@ struct efx_tx_queue {
/* Members which don't change on the fast path */ /* Members which don't change on the fast path */
struct efx_nic *efx ____cacheline_aligned_in_smp; struct efx_nic *efx ____cacheline_aligned_in_smp;
unsigned queue; unsigned queue;
unsigned int tso_version;
struct efx_channel *channel; struct efx_channel *channel;
struct netdev_queue *core_txq; struct netdev_queue *core_txq;
struct efx_tx_buffer *buffer; struct efx_tx_buffer *buffer;
......
...@@ -1016,13 +1016,17 @@ static void efx_enqueue_unwind(struct efx_tx_queue *tx_queue, ...@@ -1016,13 +1016,17 @@ static void efx_enqueue_unwind(struct efx_tx_queue *tx_queue,
/* Parse the SKB header and initialise state. */ /* Parse the SKB header and initialise state. */
static int tso_start(struct tso_state *st, struct efx_nic *efx, static int tso_start(struct tso_state *st, struct efx_nic *efx,
struct efx_tx_queue *tx_queue,
const struct sk_buff *skb) const struct sk_buff *skb)
{ {
bool use_opt_desc = efx_nic_rev(efx) >= EFX_REV_HUNT_A0;
struct device *dma_dev = &efx->pci_dev->dev; struct device *dma_dev = &efx->pci_dev->dev;
unsigned int header_len, in_len; unsigned int header_len, in_len;
bool use_opt_desc = false;
dma_addr_t dma_addr; dma_addr_t dma_addr;
if (tx_queue->tso_version == 1)
use_opt_desc = true;
st->ip_off = skb_network_header(skb) - skb->data; st->ip_off = skb_network_header(skb) - skb->data;
st->tcp_off = skb_transport_header(skb) - skb->data; st->tcp_off = skb_transport_header(skb) - skb->data;
header_len = st->tcp_off + (tcp_hdr(skb)->doff << 2u); header_len = st->tcp_off + (tcp_hdr(skb)->doff << 2u);
...@@ -1277,7 +1281,7 @@ static int efx_enqueue_skb_tso(struct efx_tx_queue *tx_queue, ...@@ -1277,7 +1281,7 @@ static int efx_enqueue_skb_tso(struct efx_tx_queue *tx_queue,
/* Find the packet protocol and sanity-check it */ /* Find the packet protocol and sanity-check it */
state.protocol = efx_tso_check_protocol(skb); state.protocol = efx_tso_check_protocol(skb);
rc = tso_start(&state, efx, skb); rc = tso_start(&state, efx, tx_queue, skb);
if (rc) if (rc)
goto mem_err; goto mem_err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment