[dpdk-dev,2/3] i40e: make sport and dport of sctp flow involved in match
Commit Message
Due to the NIC's firmware update, the input set of sctp flow is changed
to source IP, destination IP, source port, destination port and
Verification-Tag. This patch adds the sport and dport in the programming
packet of flow director.
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
---
drivers/net/i40e/i40e_fdir.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
@@ -815,6 +815,15 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
sctp = (struct sctp_hdr *)(raw_pkt + sizeof(struct ether_hdr) +
sizeof(struct ipv4_hdr));
payload = (unsigned char *)sctp + sizeof(struct sctp_hdr);
+#ifdef RTE_NEXT_ABI
+ /*
+ * The source and destination fields in the transmitted packet
+ * need to be presented in a reversed order with respect
+ * to the expected received packets.
+ */
+ sctp->src_port = fdir_input->flow.sctp4_flow.dst_port;
+ sctp->dst_port = fdir_input->flow.sctp4_flow.src_port;
+#endif
sctp->tag = fdir_input->flow.sctp4_flow.verify_tag;
break;
@@ -857,6 +866,15 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
sctp = (struct sctp_hdr *)(raw_pkt + sizeof(struct ether_hdr) +
sizeof(struct ipv6_hdr));
payload = (unsigned char *)sctp + sizeof(struct sctp_hdr);
+#ifdef RTE_NEXT_ABI
+ /*
+ * The source and destination fields in the transmitted packet
+ * need to be presented in a reversed order with respect
+ * to the expected received packets.
+ */
+ sctp->src_port = fdir_input->flow.sctp6_flow.dst_port;
+ sctp->dst_port = fdir_input->flow.sctp6_flow.src_port;
+#endif
sctp->tag = fdir_input->flow.sctp6_flow.verify_tag;
break;