Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
igb: Use UDP for RSS hash
e1000e does not support using UDP for RSS hash, but igb does.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Sriram Yagnaraman <sriram.yagnaraman@est.tech>
Signed-off-by: Jason Wang <jasowang@redhat.com>
  • Loading branch information
akihikodaki authored and jasowang committed May 23, 2023
1 parent 191e8bd commit abc9a29
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
16 changes: 16 additions & 0 deletions hw/net/igb_core.c
Expand Up @@ -287,6 +287,11 @@ igb_rss_get_hash_type(IGBCore *core, struct NetRxPkt *pkt)
return E1000_MRQ_RSS_TYPE_IPV4TCP;
}

if (l4hdr_proto == ETH_L4_HDR_PROTO_UDP &&
(core->mac[MRQC] & E1000_MRQC_RSS_FIELD_IPV4_UDP)) {
return E1000_MRQ_RSS_TYPE_IPV4UDP;
}

if (E1000_MRQC_EN_IPV4(core->mac[MRQC])) {
return E1000_MRQ_RSS_TYPE_IPV4;
}
Expand Down Expand Up @@ -322,6 +327,11 @@ igb_rss_get_hash_type(IGBCore *core, struct NetRxPkt *pkt)
return E1000_MRQ_RSS_TYPE_IPV6TCPEX;
}

if (l4hdr_proto == ETH_L4_HDR_PROTO_UDP &&
(core->mac[MRQC] & E1000_MRQC_RSS_FIELD_IPV6_UDP)) {
return E1000_MRQ_RSS_TYPE_IPV6UDP;
}

if (E1000_MRQC_EN_IPV6EX(core->mac[MRQC])) {
return E1000_MRQ_RSS_TYPE_IPV6EX;
}
Expand Down Expand Up @@ -360,6 +370,12 @@ igb_rss_calc_hash(IGBCore *core, struct NetRxPkt *pkt, E1000E_RSSInfo *info)
case E1000_MRQ_RSS_TYPE_IPV6EX:
type = NetPktRssIpV6Ex;
break;
case E1000_MRQ_RSS_TYPE_IPV4UDP:
type = NetPktRssIpV4Udp;
break;
case E1000_MRQ_RSS_TYPE_IPV6UDP:
type = NetPktRssIpV6Udp;
break;
default:
assert(false);
return 0;
Expand Down
3 changes: 3 additions & 0 deletions hw/net/igb_regs.h
Expand Up @@ -659,6 +659,9 @@ union e1000_adv_rx_desc {

#define E1000_RSS_QUEUE(reta, hash) (E1000_RETA_VAL(reta, hash) & 0x0F)

#define E1000_MRQ_RSS_TYPE_IPV4UDP 7
#define E1000_MRQ_RSS_TYPE_IPV6UDP 8

#define E1000_STATUS_IOV_MODE 0x00040000

#define E1000_STATUS_NUM_VFS_SHIFT 14
Expand Down

0 comments on commit abc9a29

Please sign in to comment.