diff mbox series

Fix for i40e driver: mirroring SEID mixup

Message ID 18399_1562103891_5D1BD053_18399_181_1_5f6c18db-7ec3-98bc-489c-8fa1297e3b20@orange.com
State Not Applicable
Headers show
Series Fix for i40e driver: mirroring SEID mixup | expand

Commit Message

alexandre.ferrieux@orange.com July 2, 2019, 9:45 p.m. UTC
Hello,

The attached patch fixes the non-working mirroring feature in all recent 
versions of the i40e driver including the latest (2.9.21).

Simply put, using

  echo 'add 3' > /sys/class/net/eth10/device/sriov/1/ingress_mirror

fails because it passes down the AQ a 0x0260 command with the same SEID (that of 
VF 3) as both mirrored-from and mirrored-to VF.

This was reported to the sourceforge e1000 projet a few days ago as

  https://sourceforge.net/p/e1000/bugs/646/

but I'm following advice given there to send it to you for a "fast track" as the 
repro and diagnosis is trivial and fix already provided.

Hope this helps,

-Alex
diff mbox series

Patch

--- i40e_virtchnl_pf.c~	2019-06-03 19:39:06.000000000 +0000
+++ i40e_virtchnl_pf.c	2019-06-30 14:39:08.635867592 +0000
@@ -938,7 +938,7 @@ 
 	vsi = pf->vsi[vf->lan_vsi_idx];
 	sw_seid = vsi->uplink_seid;
 	dst_seid = mirror_vsi->seid;
-	mr_list[num] = CPU_TO_LE16(mirror_vsi->seid);
+	mr_list[num] = CPU_TO_LE16(vsi->seid);
 	ret = i40e_aq_add_mirrorrule(&pf->hw, sw_seid,
 				     rule_type, dst_seid,
 				     cnt, mr_list, NULL,
@@ -991,7 +991,7 @@ 
 	mr_list = kcalloc(cnt, sizeof(__le16), GFP_KERNEL);
 	if (!mr_list)
 		return -ENOMEM;
-	mr_list[num] = CPU_TO_LE16(mirror_vsi->seid);
+	mr_list[num] = CPU_TO_LE16(vsi->seid);
 	ret = i40e_aq_delete_mirrorrule(&pf->hw, sw_seid, rule_type,
 					rule_id, cnt, mr_list, NULL,
 					&rules_used, &rules_free);