[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 35/47] igb: Use UDP for RSS hash
From: |
Akihiko Odaki |
Subject: |
[PATCH v3 35/47] igb: Use UDP for RSS hash |
Date: |
Sun, 23 Apr 2023 13:18:21 +0900 |
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>
---
hw/net/igb_regs.h | 3 +++
hw/net/igb_core.c | 16 ++++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/hw/net/igb_regs.h b/hw/net/igb_regs.h
index eb995d8b2e..e6ac26dc0e 100644
--- a/hw/net/igb_regs.h
+++ b/hw/net/igb_regs.h
@@ -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
diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c
index 46babe85a9..a3267c0b7a 100644
--- a/hw/net/igb_core.c
+++ b/hw/net/igb_core.c
@@ -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;
}
@@ -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;
}
@@ -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;
--
2.40.0
- [PATCH v3 24/47] igb: Add more definitions for Tx descriptor, (continued)
- [PATCH v3 24/47] igb: Add more definitions for Tx descriptor, Akihiko Odaki, 2023/04/23
- [PATCH v3 25/47] igb: Share common VF constants, Akihiko Odaki, 2023/04/23
- [PATCH v3 26/47] igb: Fix igb_mac_reg_init coding style alignment, Akihiko Odaki, 2023/04/23
- [PATCH v3 27/47] igb: Clear EICR bits for delayed MSI-X interrupts, Akihiko Odaki, 2023/04/23
- [PATCH v3 29/47] igb: Rename a variable in igb_receive_internal(), Akihiko Odaki, 2023/04/23
- [PATCH v3 30/47] net/eth: Use void pointers, Akihiko Odaki, 2023/04/23
- [PATCH v3 28/47] e1000e: Rename a variable in e1000e_receive_internal(), Akihiko Odaki, 2023/04/23
- [PATCH v3 31/47] net/eth: Always add VLAN tag, Akihiko Odaki, 2023/04/23
- [PATCH v3 33/47] tests/qtest/libqos/igb: Set GPIE.Multiple_MSIX, Akihiko Odaki, 2023/04/23
- [PATCH v3 35/47] igb: Use UDP for RSS hash,
Akihiko Odaki <=
- [PATCH v3 36/47] igb: Implement Rx SCTP CSO, Akihiko Odaki, 2023/04/23
- [PATCH v3 34/47] igb: Implement MSI-X single vector mode, Akihiko Odaki, 2023/04/23
- [PATCH v3 32/47] hw/net/net_rx_pkt: Enforce alignment for eth_header, Akihiko Odaki, 2023/04/23
- [PATCH v3 38/47] igb: Strip the second VLAN tag for extended VLAN, Akihiko Odaki, 2023/04/23
- [PATCH v3 37/47] igb: Implement Tx SCTP CSO, Akihiko Odaki, 2023/04/23
- [PATCH v3 39/47] igb: Filter with the second VLAN tag for extended VLAN, Akihiko Odaki, 2023/04/23
- [PATCH v3 41/47] igb: Implement Rx PTP2 timestamp, Akihiko Odaki, 2023/04/23
- [PATCH v3 44/47] igb: Notify only new interrupts, Akihiko Odaki, 2023/04/23