diff mbox series

[ovs-dev,2/3] netdev-offload-dpdk: Pass L4 proto-id to match in the L3 rte_flow_item

Message ID 20200710120718.38633-3-sriharsha.basavapatna@broadcom.com
State Changes Requested
Headers show
Series netdev datapath offload: misc fixes | expand

Commit Message

Sriharsha Basavapatna July 10, 2020, 12:07 p.m. UTC
The offload layer clears the L4 protocol mask in the L3 item, when the
L4 item is passed for matching, as an optimization. This can be confusing
while parsing the headers in the PMD. Also, the datapath flow specifies
this field to be matched. This optimization is best left to the PMD.
This patch restores the code to pass the L4 protocol type in L3 match.

Fixes: e8a2b5bf92bb ("netdev-dpdk: implement flow offload with rte flow")
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
---
 lib/netdev-offload-dpdk.c | 22 ----------------------
 1 file changed, 22 deletions(-)

Comments

0-day Robot July 10, 2020, 12:59 p.m. UTC | #1
Bleep bloop.  Greetings Sriharsha Basavapatna, I am a robot and I have tried out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


git-am:
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch' to see the failed patch
Patch failed at 0001 netdev-offload-dpdk: Pass L4 proto-id to match in the L3 rte_flow_item
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".


Please check this out.  If you feel there has been an error, please email aconole@redhat.com

Thanks,
0-day Robot
Eli Britstein July 14, 2020, 1:51 p.m. UTC | #2
Acked-by: Eli Britstein <elibr@mellanox.com>

On 7/10/2020 3:07 PM, Sriharsha Basavapatna wrote:
> The offload layer clears the L4 protocol mask in the L3 item, when the
> L4 item is passed for matching, as an optimization. This can be confusing
> while parsing the headers in the PMD. Also, the datapath flow specifies
> this field to be matched. This optimization is best left to the PMD.
> This patch restores the code to pass the L4 protocol type in L3 match.
>
> Fixes: e8a2b5bf92bb ("netdev-dpdk: implement flow offload with rte flow")
> Signed-off-by: Sriharsha Basavapatna<sriharsha.basavapatna@broadcom.com>
diff mbox series

Patch

diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c
index 4c652fd82..165fd1f47 100644
--- a/lib/netdev-offload-dpdk.c
+++ b/lib/netdev-offload-dpdk.c
@@ -596,7 +596,6 @@  static int
 parse_flow_match(struct flow_patterns *patterns,
                  const struct match *match)
 {
-    uint8_t *next_proto_mask = NULL;
     uint8_t proto = 0;
 
     /* Eth */
@@ -667,7 +666,6 @@  parse_flow_match(struct flow_patterns *patterns,
         /* Save proto for L4 protocol setup. */
         proto = spec->hdr.next_proto_id &
                 mask->hdr.next_proto_id;
-        next_proto_mask = &mask->hdr.next_proto_id;
     }
 
     if (proto != IPPROTO_ICMP && proto != IPPROTO_UDP  &&
@@ -701,11 +699,6 @@  parse_flow_match(struct flow_patterns *patterns,
         mask->hdr.tcp_flags = ntohs(match->wc.masks.tcp_flags) & 0xff;
 
         add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_TCP, spec, mask);
-
-        /* proto == TCP and ITEM_TYPE_TCP, thus no need for proto match. */
-        if (next_proto_mask) {
-            *next_proto_mask = 0;
-        }
     } else if (proto == IPPROTO_UDP) {
         struct rte_flow_item_udp *spec, *mask;
 
@@ -719,11 +712,6 @@  parse_flow_match(struct flow_patterns *patterns,
         mask->hdr.dst_port = match->wc.masks.tp_dst;
 
         add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_UDP, spec, mask);
-
-        /* proto == UDP and ITEM_TYPE_UDP, thus no need for proto match. */
-        if (next_proto_mask) {
-            *next_proto_mask = 0;
-        }
     } else if (proto == IPPROTO_SCTP) {
         struct rte_flow_item_sctp *spec, *mask;
 
@@ -737,11 +725,6 @@  parse_flow_match(struct flow_patterns *patterns,
         mask->hdr.dst_port = match->wc.masks.tp_dst;
 
         add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_SCTP, spec, mask);
-
-        /* proto == SCTP and ITEM_TYPE_SCTP, thus no need for proto match. */
-        if (next_proto_mask) {
-            *next_proto_mask = 0;
-        }
     } else if (proto == IPPROTO_ICMP) {
         struct rte_flow_item_icmp *spec, *mask;
 
@@ -755,11 +738,6 @@  parse_flow_match(struct flow_patterns *patterns,
         mask->hdr.icmp_code = (uint8_t) ntohs(match->wc.masks.tp_dst);
 
         add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_ICMP, spec, mask);
-
-        /* proto == ICMP and ITEM_TYPE_ICMP, thus no need for proto match. */
-        if (next_proto_mask) {
-            *next_proto_mask = 0;
-        }
     }
 
     add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_END, NULL, NULL);