[dpdk-dev] net/nfp: configure capabilities by default

Message ID 1505302096-39718-1-git-send-email-alejandro.lucero@netronome.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Alejandro Lucero Sept. 13, 2017, 11:28 a.m. UTC
  These capabilities are enabled in current NFP firmwares by
default, but it could be they are not with NFP firmwares to come.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
---
 drivers/net/nfp/nfp_net.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
  

Comments

Ferruh Yigit Sept. 18, 2017, 7:11 p.m. UTC | #1
On 9/13/2017 12:28 PM, Alejandro Lucero wrote:
> These capabilities are enabled in current NFP firmwares by
> default, but it could be they are not with NFP firmwares to come.
> 
> Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>

Applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index b014209..000d339 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -515,6 +515,18 @@  enum nfp_qcp_ptr {
 	if (hw->cap & NFP_NET_CFG_CTRL_L2MC)
 		new_ctrl |= NFP_NET_CFG_CTRL_L2MC;
 
+	/* TX checksum offload */
+	if (hw->cap & NFP_NET_CFG_CTRL_TXCSUM)
+		new_ctrl |= NFP_NET_CFG_CTRL_TXCSUM;
+
+	/* LSO offload */
+	if (hw->cap & NFP_NET_CFG_CTRL_LSO)
+		new_ctrl |= NFP_NET_CFG_CTRL_LSO;
+
+	/* RX gather */
+	if (hw->cap & NFP_NET_CFG_CTRL_GATHER)
+		new_ctrl |= NFP_NET_CFG_CTRL_GATHER;
+
 	if (!new_ctrl)
 		return 0;