summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_plcr.c
diff options
context:
space:
mode:
authorMandy Lavi <mandy.lavi@freescale.com>2014-02-27 16:08:35 (GMT)
committerJose Rivera <German.Rivera@freescale.com>2014-03-07 17:37:08 (GMT)
commit23ecb71068ce6970ee5c400d66da5b95c68fc83b (patch)
tree147634c38b9456fc3cc702d8442b1c62cd78d695 /drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_plcr.c
parent3e85be4841806abc76ad5dba74c0454202a0c3ec (diff)
downloadlinux-fsl-qoriq-23ecb71068ce6970ee5c400d66da5b95c68fc83b.tar.xz
fmd: fix flow id classification to work after PCD re-init"
For KG & Policer: Renamed pointedOwners --> RequiredActionFlag changed from counter to flag added flag clear at delete Change-Id: I55dd4125202d59e7659a3ffb8e39f56eaac7cd62 Signed-off-by: Mandy Lavi <mandy.lavi@freescale.com> Reviewed-on: http://git.am.freescale.net:8181/9261 Reviewed-by: Eyal Harari <Eyal.Harari@freescale.com> Reviewed-by: Jose Rivera <German.Rivera@freescale.com> Tested-by: Jose Rivera <German.Rivera@freescale.com> Reviewed-on: http://git.am.freescale.net:8181/9449
Diffstat (limited to 'drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_plcr.c')
-rw-r--r--drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_plcr.c41
1 files changed, 22 insertions, 19 deletions
diff --git a/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_plcr.c b/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_plcr.c
index ded7960..d08293a 100644
--- a/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_plcr.c
+++ b/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_plcr.c
@@ -585,6 +585,20 @@ static void FreeSharedProfiles(t_FmPcd *p_FmPcd, uint16_t numOfProfiles, uint16_
}
}
+static void UpdateRequiredActionFlag(t_Handle h_FmPcd, uint16_t absoluteProfileId, bool set)
+{
+ t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd;
+
+ /* this routine is protected by calling routine */
+
+ ASSERT_COND(p_FmPcd->p_FmPcdPlcr->profiles[absoluteProfileId].valid);
+
+ if (set)
+ p_FmPcd->p_FmPcdPlcr->profiles[absoluteProfileId].requiredActionFlag = TRUE;
+ else
+ p_FmPcd->p_FmPcdPlcr->profiles[absoluteProfileId].requiredActionFlag = FALSE;
+}
+
/*********************************************/
/*............Policer Exception..............*/
/*********************************************/
@@ -1176,7 +1190,7 @@ t_Error FmPcdPlcrCcGetSetParams(t_Handle h_FmPcd, uint16_t profileIndx ,uint32_t
{
err = FmHcPcdPlcrCcGetSetParams(p_FmPcd->h_Hc, profileIndx, requiredAction);
- FmPcdPlcrUpatePointedOwner(p_FmPcd, profileIndx, TRUE);
+ UpdateRequiredActionFlag(p_FmPcd, profileIndx, TRUE);
FmPcdPlcrUpdateRequiredAction(p_FmPcd, profileIndx, requiredAction);
/*PlcrProfileUnlock(&p_FmPcd->p_FmPcdPlcr->profiles[profileIndx], intFlags);*/
@@ -1189,7 +1203,7 @@ t_Error FmPcdPlcrCcGetSetParams(t_Handle h_FmPcd, uint16_t profileIndx ,uint32_t
intFlags = PlcrHwLock(p_FmPcdPlcr);
WritePar(p_FmPcd, FmPcdPlcrBuildReadPlcrActionReg(profileIndx));
- if (!p_FmPcd->p_FmPcdPlcr->profiles[profileIndx].pointedOwners ||
+ if (!p_FmPcd->p_FmPcdPlcr->profiles[profileIndx].requiredActionFlag ||
!(p_FmPcd->p_FmPcdPlcr->profiles[profileIndx].requiredAction & requiredAction))
{
if (requiredAction & UPDATE_NIA_ENQ_WITHOUT_DMA)
@@ -1256,7 +1270,7 @@ t_Error FmPcdPlcrCcGetSetParams(t_Handle h_FmPcd, uint16_t profileIndx ,uint32_t
}
PlcrHwUnlock(p_FmPcdPlcr, intFlags);
- FmPcdPlcrUpatePointedOwner(p_FmPcd, profileIndx, TRUE);
+ UpdateRequiredActionFlag(p_FmPcd, profileIndx, TRUE);
FmPcdPlcrUpdateRequiredAction(p_FmPcd, profileIndx, requiredAction);
/*PlcrProfileUnlock(&p_FmPcd->p_FmPcdPlcr->profiles[profileIndx], intFlags);*/
@@ -1264,27 +1278,13 @@ t_Error FmPcdPlcrCcGetSetParams(t_Handle h_FmPcd, uint16_t profileIndx ,uint32_t
return E_OK;
}
-void FmPcdPlcrUpatePointedOwner(t_Handle h_FmPcd, uint16_t absoluteProfileId, bool add)
-{
- t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd;
-
- /* this routine is protected by calling routine */
-
- ASSERT_COND(p_FmPcd->p_FmPcdPlcr->profiles[absoluteProfileId].valid);
-
- if (add)
- p_FmPcd->p_FmPcdPlcr->profiles[absoluteProfileId].pointedOwners++;
- else
- p_FmPcd->p_FmPcdPlcr->profiles[absoluteProfileId].pointedOwners--;
-}
-
-uint32_t FmPcdPlcrGetPointedOwners(t_Handle h_FmPcd, uint16_t absoluteProfileId)
+uint32_t FmPcdPlcrGetRequiredActionFlag(t_Handle h_FmPcd, uint16_t absoluteProfileId)
{
t_FmPcd *p_FmPcd = (t_FmPcd*)h_FmPcd;
ASSERT_COND(p_FmPcd->p_FmPcdPlcr->profiles[absoluteProfileId].valid);
- return p_FmPcd->p_FmPcdPlcr->profiles[absoluteProfileId].pointedOwners;
+ return p_FmPcd->p_FmPcdPlcr->profiles[absoluteProfileId].requiredActionFlag;
}
uint32_t FmPcdPlcrGetRequiredAction(t_Handle h_FmPcd, uint16_t absoluteProfileId)
@@ -1468,6 +1468,7 @@ void FmPcdPlcrUpdateRequiredAction(t_Handle h_FmPcd, uint16_t absoluteProfileId,
p_FmPcd->p_FmPcdPlcr->profiles[absoluteProfileId].requiredAction |= requiredAction;
}
+
/*********************** End of inter-module routines ************************/
@@ -1739,6 +1740,8 @@ t_Error FM_PCD_PlcrProfileDelete(t_Handle h_Profile)
profileIndx = p_Profile->absoluteProfileId;
+ UpdateRequiredActionFlag(p_FmPcd, profileIndx, FALSE);
+
FmPcdPlcrInvalidateProfileSw(p_FmPcd,profileIndx);
if (p_FmPcd->h_Hc)