All of lore.kernel.org
 help / color / mirror / Atom feed
From: Allain Legacy <allain.legacy@windriver.com>
To: <wenzhuo.lu@intel.com>
Cc: <dev@dpdk.org>
Subject: [PATCH] net/e1000: advertise offload capabilities for the EM PMD
Date: Fri, 10 Mar 2017 09:38:21 -0500	[thread overview]
Message-ID: <1489156701-185471-1-git-send-email-allain.legacy@windriver.com> (raw)

The hardware offload capabilities are not being advertised for the EM PMD.
Because of this, applications that only enable these features if the device
advertises them will never do so.

Normally this is not an issue since normal packet processing should work
even if hardware offload is not available.  But, in older versions of
Virtual Box the e1000 device emulation (Intel PRO/1000 MT Desktop 82540EM)
assumes that it should enable VLAN stripping even if the driver does not
request it.  This means that any ingress packets that have a VLAN tag will
be stripped.  Since the application did not request to enable VLAN
stripping it is not expecting these packets so they are not processed as
VLAN packets.

Regardless of the Virtual Box issue, the driver should be advertising
supported capabilities as is done in other drivers.

Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
---
 drivers/net/e1000/em_ethdev.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index 4066ef9..e76e34b 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -1086,6 +1086,16 @@ static int eth_em_set_mc_addr_list(struct rte_eth_dev *dev,
 	dev_info->min_rx_bufsize = 256; /* See BSIZE field of RCTL register. */
 	dev_info->max_rx_pktlen = em_get_max_pktlen(hw);
 	dev_info->max_mac_addrs = hw->mac.rar_entry_count;
+	dev_info->rx_offload_capa =
+		DEV_RX_OFFLOAD_VLAN_STRIP |
+		DEV_RX_OFFLOAD_IPV4_CKSUM |
+		DEV_RX_OFFLOAD_UDP_CKSUM  |
+		DEV_RX_OFFLOAD_TCP_CKSUM;
+	dev_info->tx_offload_capa =
+		DEV_TX_OFFLOAD_VLAN_INSERT |
+		DEV_TX_OFFLOAD_IPV4_CKSUM  |
+		DEV_TX_OFFLOAD_UDP_CKSUM   |
+		DEV_TX_OFFLOAD_TCP_CKSUM;
 
 	/*
 	 * Starting with 631xESB hw supports 2 TX/RX queues per port.
-- 
1.8.3.1

             reply	other threads:[~2017-03-10 14:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-10 14:38 Allain Legacy [this message]
2017-03-13  3:15 ` [PATCH] net/e1000: advertise offload capabilities for the EM PMD Lu, Wenzhuo
2017-03-14 15:19   ` 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=1489156701-185471-1-git-send-email-allain.legacy@windriver.com \
    --to=allain.legacy@windriver.com \
    --cc=dev@dpdk.org \
    --cc=wenzhuo.lu@intel.com \
    /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.