Commit b3973bb4 authored by Ronak Doshi's avatar Ronak Doshi Committed by David S. Miller

vmxnet3: set correct hash type based on rss information

As vmxnet3 supports IP/TCP/UDP RSS, this patch sets appropriate
hash type based on the type of RSS performed.
Signed-off-by: default avatarRonak Doshi <doshir@vmware.com>
Acked-by: default avatarGuolin Yang <gyang@vmware.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 79d124bb
...@@ -344,13 +344,15 @@ struct Vmxnet3_RxCompDescExt { ...@@ -344,13 +344,15 @@ struct Vmxnet3_RxCompDescExt {
#define VMXNET3_TXD_EOP_SIZE 1 #define VMXNET3_TXD_EOP_SIZE 1
/* value of RxCompDesc.rssType */ /* value of RxCompDesc.rssType */
enum { #define VMXNET3_RCD_RSS_TYPE_NONE 0
VMXNET3_RCD_RSS_TYPE_NONE = 0, #define VMXNET3_RCD_RSS_TYPE_IPV4 1
VMXNET3_RCD_RSS_TYPE_IPV4 = 1, #define VMXNET3_RCD_RSS_TYPE_TCPIPV4 2
VMXNET3_RCD_RSS_TYPE_TCPIPV4 = 2, #define VMXNET3_RCD_RSS_TYPE_IPV6 3
VMXNET3_RCD_RSS_TYPE_IPV6 = 3, #define VMXNET3_RCD_RSS_TYPE_TCPIPV6 4
VMXNET3_RCD_RSS_TYPE_TCPIPV6 = 4, #define VMXNET3_RCD_RSS_TYPE_UDPIPV4 5
}; #define VMXNET3_RCD_RSS_TYPE_UDPIPV6 6
#define VMXNET3_RCD_RSS_TYPE_ESPIPV4 7
#define VMXNET3_RCD_RSS_TYPE_ESPIPV6 8
/* a union for accessing all cmd/completion descriptors */ /* a union for accessing all cmd/completion descriptors */
......
...@@ -1478,10 +1478,28 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, ...@@ -1478,10 +1478,28 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
#ifdef VMXNET3_RSS #ifdef VMXNET3_RSS
if (rcd->rssType != VMXNET3_RCD_RSS_TYPE_NONE && if (rcd->rssType != VMXNET3_RCD_RSS_TYPE_NONE &&
(adapter->netdev->features & NETIF_F_RXHASH)) (adapter->netdev->features & NETIF_F_RXHASH)) {
enum pkt_hash_types hash_type;
switch (rcd->rssType) {
case VMXNET3_RCD_RSS_TYPE_IPV4:
case VMXNET3_RCD_RSS_TYPE_IPV6:
hash_type = PKT_HASH_TYPE_L3;
break;
case VMXNET3_RCD_RSS_TYPE_TCPIPV4:
case VMXNET3_RCD_RSS_TYPE_TCPIPV6:
case VMXNET3_RCD_RSS_TYPE_UDPIPV4:
case VMXNET3_RCD_RSS_TYPE_UDPIPV6:
hash_type = PKT_HASH_TYPE_L4;
break;
default:
hash_type = PKT_HASH_TYPE_L3;
break;
}
skb_set_hash(ctx->skb, skb_set_hash(ctx->skb,
le32_to_cpu(rcd->rssHash), le32_to_cpu(rcd->rssHash),
PKT_HASH_TYPE_L3); hash_type);
}
#endif #endif
skb_put(ctx->skb, rcd->len); skb_put(ctx->skb, rcd->len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment