Skip to contentSkip to conversation

netvsc: small patches

PATCH Applied Stephen Hemminger 2 participants 4 messages Aug 6, 2018 – Aug 7, 2018 Network drivers

lore
Share & tools
lore
#0 lore raw

cover netvsc: small patches

A couple of small missing features discovered during later testing. The netvsc PMD was not setting packet type or reporting checksum failures.

Stephen Hemminger (2):
netvsc: support packet type
netvsc: report checksum failures

 drivers/net/netvsc/hn_rxtx.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
Signature · 1 line
2.18.0
#1 lore raw

PATCH 1/2 netvsc: support packet type

The Netvsc PMD was not filling in the packet type information.

Fixes 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
---
 drivers/net/netvsc/hn_rxtx.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/net/netvsc/hn_rxtx.c +8 -2
index cc8a534b5ce8..25c97ea43ad6 100644
@@ -24,6 +24,7 @@
 #include <rte_memory.h>
 #include <rte_eal.h>
 #include <rte_dev.h>
+#include <rte_net.h>
 #include <rte_bus_vmbus.h>
 #include <rte_spinlock.h>
 
@@ -495,6 +496,10 @@ static void hn_rxpkt(struct hn_rx_queue *rxq, struct hn_rx_bufinfo *rxb,
 	m->port = rxq->port_id;
 	m->pkt_len = dlen;
 	m->data_len = dlen;
+	m->packet_type = rte_net_get_ptype(m, NULL,
+					   RTE_PTYPE_L2_MASK |
+					   RTE_PTYPE_L3_MASK |
+					   RTE_PTYPE_L4_MASK);
 
 	if (info->vlan_info != HN_NDIS_VLAN_INFO_INVALID) {
 		m->vlan_tci = info->vlan_info;
@@ -515,9 +520,10 @@ static void hn_rxpkt(struct hn_rx_queue *rxq, struct hn_rx_bufinfo *rxb,
 		m->hash.rss = info->hash_value;
 	}
 
-	PMD_RX_LOG(DEBUG, "port %u:%u RX id %" PRIu64 " size %u ol_flags %#" PRIx64,
+	PMD_RX_LOG(DEBUG,
+		   "port %u:%u RX id %"PRIu64" size %u type %#x ol_flags %#"PRIx64,
 		   rxq->port_id, rxq->queue_id, rxb->xactid,
-		   m->pkt_len, m->ol_flags);
+		   m->pkt_len, m->packet_type, m->ol_flags);
 
 	++rxq->stats.packets;
 	rxq->stats.bytes += m->pkt_len;
Signature · 1 line
2.18.0
#2 lore raw

PATCH 2/2 netvsc: report checksum failures

In reply to Stephen Hemminger

The host will notify netvsc device about failed UDP and TCP checksum. Propogate that information into the mbuf.

---
 drivers/net/netvsc/hn_rxtx.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/netvsc/hn_rxtx.c +3 -0
index 25c97ea43ad6..02ef27e363cc 100644
@@ -513,6 +513,9 @@ static void hn_rxpkt(struct hn_rx_queue *rxq, struct hn_rx_bufinfo *rxb,
 		if (info->csum_info & (NDIS_RXCSUM_INFO_UDPCS_OK
 				       | NDIS_RXCSUM_INFO_TCPCS_OK))
 			m->ol_flags |= PKT_RX_L4_CKSUM_GOOD;
+		else if (info->csum_info & (NDIS_RXCSUM_INFO_TCPCS_FAILED
+					    | NDIS_RXCSUM_INFO_UDPCS_FAILED))
+			m->ol_flags |= PKT_RX_L4_CKSUM_BAD;
 	}
 
 	if (info->hash_info != HN_NDIS_HASH_INFO_INVALID) {
Signature · 1 line
2.18.0
#3 lore raw
In reply to Stephen Hemminger

06/08/2018 20:22, Stephen Hemminger:

Quoted 7 lines

A couple of small missing features discovered during later testing. The netvsc PMD was not setting packet type or reporting checksum failures.

Stephen Hemminger (2):
netvsc: support packet type
netvsc: report checksum failures

Applied, thanks