Hi,

In the function i40e_vc_del_cloud_filter() in
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c,
I came across the following segment handling IPv4 flow deletion:

case VIRTCHNL_TCP_V4_FLOW:
        cfilter.n_proto = ETH_P_IP;
        if (mask.dst_ip[0] & tcf.dst_ip[0])
                memcpy(&cfilter.ip.v4.dst_ip, tcf.dst_ip,
                       ARRAY_SIZE(tcf.dst_ip));
        else if (mask.src_ip[0] & tcf.dst_ip[0])
                memcpy(&cfilter.ip.v4.src_ip, tcf.src_ip,
                       ARRAY_SIZE(tcf.dst_ip));
        break;

I wanted to check the intent behind using tcf.dst_ip[0] in the mask.src_ip[0] condition. is there a specific reason for referencing the destination IP in this context?


Thanks,
Alok
---
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 081a4526a2f0..1553157dc53a 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -3819,9 +3819,9 @@ static int i40e_vc_del_cloud_filter(struct i40e_vf *vf, u8 *msg)
                if (mask.dst_ip[0] & tcf.dst_ip[0])
                        memcpy(&cfilter.ip.v4.dst_ip, tcf.dst_ip,
                               ARRAY_SIZE(tcf.dst_ip));
-               else if (mask.src_ip[0] & tcf.dst_ip[0])
+               else if (mask.src_ip[0] & tcf.src_ip[0])
                        memcpy(&cfilter.ip.v4.src_ip, tcf.src_ip,
-                              ARRAY_SIZE(tcf.dst_ip));
+                              ARRAY_SIZE(tcf.src_ip));
                break;
        case VIRTCHNL_TCP_V6_FLOW:
                cfilter.n_proto = ETH_P_IPV6;

Reply via email to