All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: <dev@dpdk.org>
Cc: Ivan Malov <ivan.malov@oktetlabs.ru>
Subject: [PATCH v3 3/6] net/sfc: factor out function to report Rx capabilities
Date: Thu, 18 Jan 2018 07:07:46 +0000	[thread overview]
Message-ID: <1516259269-6887-4-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1516259269-6887-1-git-send-email-arybchenko@solarflare.com>

From: Ivan Malov <ivan.malov@oktetlabs.ru>

The patch adds a separate function to report supported
Rx capabilities because this function will be required
in more places across the code in the upcoming patches.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 drivers/net/sfc/sfc_ethdev.c |  9 +--------
 drivers/net/sfc/sfc_rx.c     | 17 +++++++++++++++++
 drivers/net/sfc/sfc_rx.h     |  2 ++
 3 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index af867a7..851b38b 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -104,14 +104,7 @@ sfc_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	/* By default packets are dropped if no descriptors are available */
 	dev_info->default_rxconf.rx_drop_en = 1;
 
-	dev_info->rx_offload_capa =
-		DEV_RX_OFFLOAD_IPV4_CKSUM |
-		DEV_RX_OFFLOAD_UDP_CKSUM |
-		DEV_RX_OFFLOAD_TCP_CKSUM;
-
-	if ((encp->enc_tunnel_encapsulations_supported != 0) &&
-	    (sa->dp_rx->features & SFC_DP_RX_FEAT_TUNNELS))
-		dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM;
+	dev_info->rx_offload_capa = sfc_rx_get_dev_offload_caps(sa);
 
 	dev_info->tx_offload_capa =
 		DEV_TX_OFFLOAD_IPV4_CKSUM |
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index 6fa56b4..d35f4f7 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -762,6 +762,23 @@ sfc_rx_qstop(struct sfc_adapter *sa, unsigned int sw_index)
 	sfc_ev_qstop(rxq->evq);
 }
 
+uint64_t
+sfc_rx_get_dev_offload_caps(struct sfc_adapter *sa)
+{
+	const efx_nic_cfg_t *encp = efx_nic_cfg_get(sa->nic);
+	uint64_t caps = 0;
+
+	caps |= DEV_RX_OFFLOAD_IPV4_CKSUM;
+	caps |= DEV_RX_OFFLOAD_UDP_CKSUM;
+	caps |= DEV_RX_OFFLOAD_TCP_CKSUM;
+
+	if (encp->enc_tunnel_encapsulations_supported &&
+	    (sa->dp_rx->features & SFC_DP_RX_FEAT_TUNNELS))
+		caps |= DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM;
+
+	return caps;
+}
+
 static int
 sfc_rx_qcheck_conf(struct sfc_adapter *sa, unsigned int rxq_max_fill_level,
 		   const struct rte_eth_rxconf *rx_conf)
diff --git a/drivers/net/sfc/sfc_rx.h b/drivers/net/sfc/sfc_rx.h
index 2cf75bc..cc9245f 100644
--- a/drivers/net/sfc/sfc_rx.h
+++ b/drivers/net/sfc/sfc_rx.h
@@ -142,6 +142,8 @@ void sfc_rx_qfini(struct sfc_adapter *sa, unsigned int sw_index);
 int sfc_rx_qstart(struct sfc_adapter *sa, unsigned int sw_index);
 void sfc_rx_qstop(struct sfc_adapter *sa, unsigned int sw_index);
 
+uint64_t sfc_rx_get_dev_offload_caps(struct sfc_adapter *sa);
+
 void sfc_rx_qflush_done(struct sfc_rxq *rxq);
 void sfc_rx_qflush_failed(struct sfc_rxq *rxq);
 
-- 
2.7.4

  parent reply	other threads:[~2018-01-18  7:08 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-11  8:12 [PATCH 0/6] net/sfc: convert to the new offload API Andrew Rybchenko
2018-01-11  8:12 ` [PATCH 1/6] ethdev: add a function to look up Rx offload names Andrew Rybchenko
2018-01-17 16:55   ` Ferruh Yigit
2018-01-17 17:06     ` Thomas Monjalon
2018-01-17 17:33   ` Thomas Monjalon
2018-01-18  6:32     ` Shahaf Shuler
2018-01-18  7:16     ` Andrew Rybchenko
2018-01-18  7:52       ` Andrew Rybchenko
2018-01-18  9:24         ` Thomas Monjalon
2018-01-11  8:12 ` [PATCH 2/6] ethdev: add a function to look up Tx " Andrew Rybchenko
2018-01-11  8:12 ` [PATCH 3/6] net/sfc: factor out function to report Rx capabilities Andrew Rybchenko
2018-01-11  8:12 ` [PATCH 4/6] net/sfc: convert to the new Rx offload API Andrew Rybchenko
2018-01-11  8:12 ` [PATCH 5/6] net/sfc: factor out function to report Tx capabilities Andrew Rybchenko
2018-01-11  8:12 ` [PATCH 6/6] net/sfc: convert to the new Tx offload API Andrew Rybchenko
2018-01-17 16:55 ` [PATCH 0/6] net/sfc: convert to the new " Ferruh Yigit
2018-01-18  7:02 ` [PATCH v2 " Andrew Rybchenko
2018-01-18  7:02   ` [PATCH v2 1/6] ethdev: add a function to look up Rx offload names Andrew Rybchenko
2018-01-18  7:02   ` [PATCH v2 2/6] ethdev: add a function to look up Tx " Andrew Rybchenko
2018-01-18  7:02   ` [PATCH v2 3/6] net/sfc: factor out function to report Rx capabilities Andrew Rybchenko
2018-01-18  7:02   ` [PATCH v2 4/6] net/sfc: convert to the new Rx offload API Andrew Rybchenko
2018-01-18  7:02   ` [PATCH v2 5/6] net/sfc: factor out function to report Tx capabilities Andrew Rybchenko
2018-01-18  7:02   ` [PATCH v2 6/6] net/sfc: convert to the new Tx offload API Andrew Rybchenko
2018-01-18  7:07 ` [PATCH v3 0/6] net/sfc: convert to the new " Andrew Rybchenko
2018-01-18  7:07   ` [PATCH v3 1/6] ethdev: add a function to look up Rx offload names Andrew Rybchenko
2018-01-18  9:26     ` Thomas Monjalon
2018-01-18  9:47       ` Andrew Rybchenko
2018-01-18  7:07   ` [PATCH v3 2/6] ethdev: add a function to look up Tx " Andrew Rybchenko
2018-01-18  7:07   ` Andrew Rybchenko [this message]
2018-01-18  7:07   ` [PATCH v3 4/6] net/sfc: convert to the new Rx offload API Andrew Rybchenko
2018-01-18  7:07   ` [PATCH v3 5/6] net/sfc: factor out function to report Tx capabilities Andrew Rybchenko
2018-01-18  7:07   ` [PATCH v3 6/6] net/sfc: convert to the new Tx offload API Andrew Rybchenko
2018-01-18  9:44 ` [PATCH v4 0/6] net/sfc: convert to the new " Andrew Rybchenko
2018-01-18  9:44   ` [PATCH v4 1/6] ethdev: add a function to look up Rx offload names Andrew Rybchenko
2018-01-18 10:29     ` Thomas Monjalon
2018-01-18  9:44   ` [PATCH v4 2/6] ethdev: add a function to look up Tx " Andrew Rybchenko
2018-01-18 10:30     ` Thomas Monjalon
2018-01-18  9:44   ` [PATCH v4 3/6] net/sfc: factor out function to report Rx capabilities Andrew Rybchenko
2018-01-18  9:44   ` [PATCH v4 4/6] net/sfc: convert to the new Rx offload API Andrew Rybchenko
2018-01-18  9:44   ` [PATCH v4 5/6] net/sfc: factor out function to report Tx capabilities Andrew Rybchenko
2018-01-18  9:44   ` [PATCH v4 6/6] net/sfc: convert to the new Tx offload API Andrew Rybchenko
2018-01-18 15:40   ` [PATCH v4 0/6] net/sfc: convert to the new " Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1516259269-6887-4-git-send-email-arybchenko@solarflare.com \
    --to=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=ivan.malov@oktetlabs.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.