Skip to content

Commit 75ce950

Browse files
Asbjørn Sloth Tønnesendavem330
authored andcommitted
octeontx2-pf: fix FLOW_DIS_IS_FRAGMENT implementation
Upon reviewing the flower control flags handling in this driver, I notice that the key wasn't being used, only the mask. Ie. `tc flower ... ip_flags nofrag` was hardware offloaded as `... ip_flags frag`. Only compile tested, no access to HW. Fixes: c672e37 ("octeontx2-pf: Add support to filter packet based on IP fragment") Signed-off-by: Asbjørn Sloth Tønnesen <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 460b0d3 commit 75ce950

File tree

1 file changed

+5
-2
lines changed
  • drivers/net/ethernet/marvell/octeontx2/nic

1 file changed

+5
-2
lines changed

drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,7 @@ static int otx2_tc_prepare_flow(struct otx2_nic *nic, struct otx2_tc_flow *node,
689689

690690
if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_CONTROL)) {
691691
struct flow_match_control match;
692+
u32 val;
692693

693694
flow_rule_match_control(rule, &match);
694695
if (match.mask->flags & FLOW_DIS_FIRST_FRAG) {
@@ -697,12 +698,14 @@ static int otx2_tc_prepare_flow(struct otx2_nic *nic, struct otx2_tc_flow *node,
697698
}
698699

699700
if (match.mask->flags & FLOW_DIS_IS_FRAGMENT) {
701+
val = match.key->flags & FLOW_DIS_IS_FRAGMENT;
700702
if (ntohs(flow_spec->etype) == ETH_P_IP) {
701-
flow_spec->ip_flag = IPV4_FLAG_MORE;
703+
flow_spec->ip_flag = val ? IPV4_FLAG_MORE : 0;
702704
flow_mask->ip_flag = IPV4_FLAG_MORE;
703705
req->features |= BIT_ULL(NPC_IPFRAG_IPV4);
704706
} else if (ntohs(flow_spec->etype) == ETH_P_IPV6) {
705-
flow_spec->next_header = IPPROTO_FRAGMENT;
707+
flow_spec->next_header = val ?
708+
IPPROTO_FRAGMENT : 0;
706709
flow_mask->next_header = 0xff;
707710
req->features |= BIT_ULL(NPC_IPFRAG_IPV6);
708711
} else {

0 commit comments

Comments
 (0)