All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Basic support for Solarflare 8000 series NICs
@ 2015-11-25 16:04 Bert Kenward
  2015-11-25 16:06 ` [PATCH 1/2] sfc: make TSO version a per-queue parameter Bert Kenward
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Bert Kenward @ 2015-11-25 16:04 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers

The upcoming Solarflare 8000 series 10G/40G network card supports a 
similar interface to the current 7000 series cards. This patch series 
provides basic support for these cards, making no use of any new 
functionality.

Bert Kenward (2):
  sfc: make TSO version a per-queue parameter
  sfc: Add PCI ID for Solarflare 8000 series 10/40G NIC.

 drivers/net/ethernet/sfc/ef10.c       | 13 ++++++-------
 drivers/net/ethernet/sfc/efx.c        |  6 ++++++
 drivers/net/ethernet/sfc/net_driver.h |  2 ++
 drivers/net/ethernet/sfc/tx.c         |  8 ++++++--
 4 files changed, 20 insertions(+), 9 deletions(-)

-- 
2.4.3

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] sfc: make TSO version a per-queue parameter
  2015-11-25 16:04 [PATCH 0/2] Basic support for Solarflare 8000 series NICs Bert Kenward
@ 2015-11-25 16:06 ` Bert Kenward
  2015-11-30  3:50   ` David Miller
  2015-11-25 16:06 ` [PATCH 2/2] sfc: Add PCI ID for Solarflare 8000 series 10/40G NIC Bert Kenward
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Bert Kenward @ 2015-11-25 16:06 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers

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: Bert Kenward <bkenward@solarflare.com>
---
 drivers/net/ethernet/sfc/ef10.c       | 13 ++++++-------
 drivers/net/ethernet/sfc/net_driver.h |  2 ++
 drivers/net/ethernet/sfc/tx.c         |  8 ++++++--
 3 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
index bc6d21b..32bfe05 100644
--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -181,13 +181,6 @@ static int efx_ef10_init_datapath_caps(struct efx_nic *efx)
 		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 &
 	      (1 << MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_14_LBN))) {
 		netif_err(efx, probe, efx->net_dev,
 			  "current firmware does not support an RX prefix\n");
@@ -1797,6 +1790,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_IP_CSUM, csum_offload);
 	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();
 	efx_ef10_push_tx_desc(tx_queue, txd);
 
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
index a8ddd12..5c0d0ba 100644
--- a/drivers/net/ethernet/sfc/net_driver.h
+++ b/drivers/net/ethernet/sfc/net_driver.h
@@ -182,6 +182,7 @@ struct efx_tx_buffer {
  *
  * @efx: The associated Efx NIC
  * @queue: DMA queue number
+ * @tso_version: Version of TSO in use for this queue.
  * @channel: The associated channel
  * @core_txq: The networking core TX queue structure
  * @buffer: The software buffer ring
@@ -228,6 +229,7 @@ struct efx_tx_queue {
 	/* Members which don't change on the fast path */
 	struct efx_nic *efx ____cacheline_aligned_in_smp;
 	unsigned queue;
+	unsigned int tso_version;
 	struct efx_channel *channel;
 	struct netdev_queue *core_txq;
 	struct efx_tx_buffer *buffer;
diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c
index 67f6afa..f7a0ec1 100644
--- a/drivers/net/ethernet/sfc/tx.c
+++ b/drivers/net/ethernet/sfc/tx.c
@@ -1010,13 +1010,17 @@ static void efx_enqueue_unwind(struct efx_tx_queue *tx_queue,
 
 /* Parse the SKB header and initialise state. */
 static int tso_start(struct tso_state *st, struct efx_nic *efx,
+		     struct efx_tx_queue *tx_queue,
 		     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;
 	unsigned int header_len, in_len;
+	bool use_opt_desc = false;
 	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->tcp_off = skb_transport_header(skb) - skb->data;
 	header_len = st->tcp_off + (tcp_hdr(skb)->doff << 2u);
@@ -1271,7 +1275,7 @@ static int efx_enqueue_skb_tso(struct efx_tx_queue *tx_queue,
 	/* Find the packet protocol and sanity-check it */
 	state.protocol = efx_tso_check_protocol(skb);
 
-	rc = tso_start(&state, efx, skb);
+	rc = tso_start(&state, efx, tx_queue, skb);
 	if (rc)
 		goto mem_err;
 
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] sfc: Add PCI ID for Solarflare 8000 series 10/40G NIC.
  2015-11-25 16:04 [PATCH 0/2] Basic support for Solarflare 8000 series NICs Bert Kenward
  2015-11-25 16:06 ` [PATCH 1/2] sfc: make TSO version a per-queue parameter Bert Kenward
@ 2015-11-25 16:06 ` Bert Kenward
  2015-11-30  9:05 ` [PATCH v2 net-next 0/2] Basic support for Solarflare 8000 series NICs Bert Kenward
       [not found] ` <cover.1448874133.git.bkenward@solarflare.com>
  3 siblings, 0 replies; 8+ messages in thread
From: Bert Kenward @ 2015-11-25 16:06 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers

Also add support for 7000 series 40G NIC VF.

Signed-off-by: Bert Kenward <bkenward@solarflare.com>
---
 drivers/net/ethernet/sfc/efx.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 4e82bcf..b405349 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -2784,6 +2784,12 @@ static const struct pci_device_id efx_pci_table[] = {
 	 .driver_data = (unsigned long) &efx_hunt_a0_vf_nic_type},
 	{PCI_DEVICE(PCI_VENDOR_ID_SOLARFLARE, 0x0923),  /* SFC9140 PF */
 	 .driver_data = (unsigned long) &efx_hunt_a0_nic_type},
+	{PCI_DEVICE(PCI_VENDOR_ID_SOLARFLARE, 0x1923),  /* SFC9140 VF */
+	 .driver_data = (unsigned long) &efx_hunt_a0_vf_nic_type},
+	{PCI_DEVICE(PCI_VENDOR_ID_SOLARFLARE, 0x0a03),  /* SFC9220 PF */
+	 .driver_data = (unsigned long) &efx_hunt_a0_nic_type},
+	{PCI_DEVICE(PCI_VENDOR_ID_SOLARFLARE, 0x1a03),  /* SFC9220 VF */
+	 .driver_data = (unsigned long) &efx_hunt_a0_vf_nic_type},
 	{0}			/* end of list */
 };
 
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] sfc: make TSO version a per-queue parameter
  2015-11-25 16:06 ` [PATCH 1/2] sfc: make TSO version a per-queue parameter Bert Kenward
@ 2015-11-30  3:50   ` David Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2015-11-30  3:50 UTC (permalink / raw)
  To: bkenward; +Cc: netdev, linux-net-drivers

From: Bert Kenward <bkenward@solarflare.com>
Date: Wed, 25 Nov 2015 16:06:14 +0000

>  	if (!(nic_data->datapath_caps &
> -	      (1 << MC_CMD_GET_CAPABILITIES_OUT_TX_TSO_LBN))) {
> -		netif_err(efx, drv, efx->net_dev,

Can you please keep code properly indented...

> +
> +	if (nic_data->datapath_caps &
> +			(1 << MC_CMD_GET_CAPABILITIES_OUT_TX_TSO_LBN)) {

when all you are doing is moving it from one place to another?

That first parenthesis on the second line must start exactly at the
first column after the openning parenthesis of the enclosing
if () statement.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2 net-next 0/2] Basic support for Solarflare 8000 series NICs
  2015-11-25 16:04 [PATCH 0/2] Basic support for Solarflare 8000 series NICs Bert Kenward
  2015-11-25 16:06 ` [PATCH 1/2] sfc: make TSO version a per-queue parameter Bert Kenward
  2015-11-25 16:06 ` [PATCH 2/2] sfc: Add PCI ID for Solarflare 8000 series 10/40G NIC Bert Kenward
@ 2015-11-30  9:05 ` Bert Kenward
  2015-12-01 20:47   ` David Miller
       [not found] ` <cover.1448874133.git.bkenward@solarflare.com>
  3 siblings, 1 reply; 8+ messages in thread
From: Bert Kenward @ 2015-11-30  9:05 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers

The upcoming Solarflare 8000 series 10G/40G network card supports a 
similar interface to the current 7000 series cards. This patch series 
provides basic support for these cards, making no use of any new 
functionality.

v2: fix indenting in ef10.c in patch 1/2.

Bert Kenward (2):
  sfc: make TSO version a per-queue parameter
  sfc: Add PCI ID for Solarflare 8000 series 10/40G NIC

 drivers/net/ethernet/sfc/ef10.c       | 13 ++++++-------
 drivers/net/ethernet/sfc/efx.c        |  6 ++++++
 drivers/net/ethernet/sfc/net_driver.h |  2 ++
 drivers/net/ethernet/sfc/tx.c         |  8 ++++++--
 4 files changed, 20 insertions(+), 9 deletions(-)

-- 
2.4.3

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2 net-next 1/2] sfc: make TSO version a per-queue parameter
       [not found] ` <cover.1448874133.git.bkenward@solarflare.com>
@ 2015-11-30  9:05   ` Bert Kenward
  2015-11-30  9:05   ` [PATCH v2 net-next 2/2] sfc: Add PCI ID for Solarflare 8000 series 10/40G NIC Bert Kenward
  1 sibling, 0 replies; 8+ messages in thread
From: Bert Kenward @ 2015-11-30  9:05 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers

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: Bert Kenward <bkenward@solarflare.com>
---
 drivers/net/ethernet/sfc/ef10.c       | 13 ++++++-------
 drivers/net/ethernet/sfc/net_driver.h |  2 ++
 drivers/net/ethernet/sfc/tx.c         |  8 ++++++--
 3 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
index bc6d21b..425df3d 100644
--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -181,13 +181,6 @@ static int efx_ef10_init_datapath_caps(struct efx_nic *efx)
 		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 &
 	      (1 << MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_14_LBN))) {
 		netif_err(efx, probe, efx->net_dev,
 			  "current firmware does not support an RX prefix\n");
@@ -1797,6 +1790,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_IP_CSUM, csum_offload);
 	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();
 	efx_ef10_push_tx_desc(tx_queue, txd);
 
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
index a8ddd12..5c0d0ba 100644
--- a/drivers/net/ethernet/sfc/net_driver.h
+++ b/drivers/net/ethernet/sfc/net_driver.h
@@ -182,6 +182,7 @@ struct efx_tx_buffer {
  *
  * @efx: The associated Efx NIC
  * @queue: DMA queue number
+ * @tso_version: Version of TSO in use for this queue.
  * @channel: The associated channel
  * @core_txq: The networking core TX queue structure
  * @buffer: The software buffer ring
@@ -228,6 +229,7 @@ struct efx_tx_queue {
 	/* Members which don't change on the fast path */
 	struct efx_nic *efx ____cacheline_aligned_in_smp;
 	unsigned queue;
+	unsigned int tso_version;
 	struct efx_channel *channel;
 	struct netdev_queue *core_txq;
 	struct efx_tx_buffer *buffer;
diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c
index 67f6afa..f7a0ec1 100644
--- a/drivers/net/ethernet/sfc/tx.c
+++ b/drivers/net/ethernet/sfc/tx.c
@@ -1010,13 +1010,17 @@ static void efx_enqueue_unwind(struct efx_tx_queue *tx_queue,
 
 /* Parse the SKB header and initialise state. */
 static int tso_start(struct tso_state *st, struct efx_nic *efx,
+		     struct efx_tx_queue *tx_queue,
 		     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;
 	unsigned int header_len, in_len;
+	bool use_opt_desc = false;
 	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->tcp_off = skb_transport_header(skb) - skb->data;
 	header_len = st->tcp_off + (tcp_hdr(skb)->doff << 2u);
@@ -1271,7 +1275,7 @@ static int efx_enqueue_skb_tso(struct efx_tx_queue *tx_queue,
 	/* Find the packet protocol and sanity-check it */
 	state.protocol = efx_tso_check_protocol(skb);
 
-	rc = tso_start(&state, efx, skb);
+	rc = tso_start(&state, efx, tx_queue, skb);
 	if (rc)
 		goto mem_err;
 
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2 net-next 2/2] sfc: Add PCI ID for Solarflare 8000 series 10/40G NIC
       [not found] ` <cover.1448874133.git.bkenward@solarflare.com>
  2015-11-30  9:05   ` [PATCH v2 net-next 1/2] sfc: make TSO version a per-queue parameter Bert Kenward
@ 2015-11-30  9:05   ` Bert Kenward
  1 sibling, 0 replies; 8+ messages in thread
From: Bert Kenward @ 2015-11-30  9:05 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers

Also add support for 7000 series 40G NIC VF.

Signed-off-by: Bert Kenward <bkenward@solarflare.com>
---
 drivers/net/ethernet/sfc/efx.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 4e82bcf..b405349 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -2784,6 +2784,12 @@ static const struct pci_device_id efx_pci_table[] = {
 	 .driver_data = (unsigned long) &efx_hunt_a0_vf_nic_type},
 	{PCI_DEVICE(PCI_VENDOR_ID_SOLARFLARE, 0x0923),  /* SFC9140 PF */
 	 .driver_data = (unsigned long) &efx_hunt_a0_nic_type},
+	{PCI_DEVICE(PCI_VENDOR_ID_SOLARFLARE, 0x1923),  /* SFC9140 VF */
+	 .driver_data = (unsigned long) &efx_hunt_a0_vf_nic_type},
+	{PCI_DEVICE(PCI_VENDOR_ID_SOLARFLARE, 0x0a03),  /* SFC9220 PF */
+	 .driver_data = (unsigned long) &efx_hunt_a0_nic_type},
+	{PCI_DEVICE(PCI_VENDOR_ID_SOLARFLARE, 0x1a03),  /* SFC9220 VF */
+	 .driver_data = (unsigned long) &efx_hunt_a0_vf_nic_type},
 	{0}			/* end of list */
 };
 
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 net-next 0/2] Basic support for Solarflare 8000 series NICs
  2015-11-30  9:05 ` [PATCH v2 net-next 0/2] Basic support for Solarflare 8000 series NICs Bert Kenward
@ 2015-12-01 20:47   ` David Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2015-12-01 20:47 UTC (permalink / raw)
  To: bkenward; +Cc: netdev, linux-net-drivers

From: Bert Kenward <bkenward@solarflare.com>
Date: Mon, 30 Nov 2015 09:05:33 +0000

> The upcoming Solarflare 8000 series 10G/40G network card supports a 
> similar interface to the current 7000 series cards. This patch series 
> provides basic support for these cards, making no use of any new 
> functionality.
> 
> v2: fix indenting in ef10.c in patch 1/2.

Series applied, thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-12-01 20:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-25 16:04 [PATCH 0/2] Basic support for Solarflare 8000 series NICs Bert Kenward
2015-11-25 16:06 ` [PATCH 1/2] sfc: make TSO version a per-queue parameter Bert Kenward
2015-11-30  3:50   ` David Miller
2015-11-25 16:06 ` [PATCH 2/2] sfc: Add PCI ID for Solarflare 8000 series 10/40G NIC Bert Kenward
2015-11-30  9:05 ` [PATCH v2 net-next 0/2] Basic support for Solarflare 8000 series NICs Bert Kenward
2015-12-01 20:47   ` David Miller
     [not found] ` <cover.1448874133.git.bkenward@solarflare.com>
2015-11-30  9:05   ` [PATCH v2 net-next 1/2] sfc: make TSO version a per-queue parameter Bert Kenward
2015-11-30  9:05   ` [PATCH v2 net-next 2/2] sfc: Add PCI ID for Solarflare 8000 series 10/40G NIC Bert Kenward

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.