This commit adds the following:
authorTinku Mannan <tmannan@ti.com>
Wed, 13 Nov 2013 21:37:34 +0000 (16:37 -0500)
committerTinku Mannan <tmannan@ti.com>
Wed, 13 Nov 2013 21:37:34 +0000 (16:37 -0500)
1. SDOCM0090624: Fix for Delete Classifer API will try and delete the same
ad hoc IP rule if it is used in multiple classifiers.
2. Incorporated NETAPI code review comments.

ti/runtime/netapi/applications/ipsec_offload/ipsecmgr/src/netapi_ipsecmgr.c
ti/runtime/netapi/applications/ipsec_offload/ipsecmgr/src/netapilib_interface.c
ti/runtime/netapi/netcp_cfg.h
ti/runtime/netapi/src/netapi.c
ti/runtime/netapi/src/netapi_init.c
ti/runtime/netapi/src/netapi_loc.h
ti/runtime/netapi/src/netcp_cfg.c
ti/runtime/netapi/test/ifdma_test.c
ti/runtime/netapi/test/net_test_bench.c
ti/runtime/netapi/test/net_test_utils.c

index aecda9ba2587d2fb1026cbe78f458ccaea5da13a..d32aa166ee5153f7aa3bdfeee01e4b5174008353 100755 (executable)
@@ -176,8 +176,7 @@ static void* snoop_run_thread (void* arg)
     hplib_utilSetupThread(0, &cpu_set, hplib_spinLock_Type_LOL);
     ipsecmgr_syslog_msg(SYSLOG_LEVEL_INFO,
         "snoop_run_thread: daemon entering forever event loop\n");
-    int count=0;
-    int sat=500000;
+
     while (1)
     {
         /* Poll for message from user application */
index 9cacf500e7251b93f7f9a0eb35dfa1d227783d96..d4a9f142132a671de20ff1da4f8d08d1ff84e176 100755 (executable)
@@ -343,7 +343,6 @@ int netapilib_ifAddSA
 int netapilib_ifDeleteSA (ipsecmgr_fp_handle_t sa_handle)
 {
     int error, slot;
-    cpu_set_t cpu_set;
 
     slot = findAppIdSlot(&globalDB.rx_sa[0],sa_handle, 1);
 
@@ -429,11 +428,6 @@ int32_t netapilib_ifAddSP
     NETCP_CFG_PA_HANDLE_T pPaHandleInnerIP;
     NETCP_CFG_SA_HANDLE_T pSaHandle;
 
-    cpu_set_t cpu_set;
-    /* assign main net_test thread to run on core 0 */
-    CPU_ZERO( &cpu_set);
-    CPU_SET( 0, &cpu_set);
-    hplib_utilSetupThread(0, &cpu_set, hplib_spinLock_Type_LOL);
     ipsecmgr_syslog_msg (SYSLOG_LEVEL_INFO,"netapilib_ifAddSP: called\n");
 
 
index f97dfa25c80e815ca1c64e2005cec4daa27fc952..cd4bb2d9142228348aef0dc27645afacb5116991 100755 (executable)
@@ -185,13 +185,6 @@ typedef struct NETCP_CFG_ROUTE_Tag
     nwalRouteType_t     routeType;          /**< Optional: Routing priority,
                                               *  @see nwal.h for nwalRouteType_t
                                               */
-    nwal_enetPort_t     tx_emac_port;       /**< Optional: TX Enet Port 1 based.Eg:
-                                              *  For transmitting through
-                                              *  first port configure as 1
-                                              *  @see nwal_enetPort_t in nwal.h.
-                                              *  Configuring to NWAL_ENET_PORT_UNKNOWN
-                                              *  will let CPSW decide on outgoing port.
-                                              */
 } NETCP_CFG_ROUTE_T;
 
 
@@ -568,7 +561,6 @@ NETCP_CFG_IP_T  netapi_netcpCfgAddIp(NETAPI_T                   h,
                                      nwalIpOpt_t*               ip_qualifiers,
                                      NETCP_CFG_ROUTE_HANDLE_T   route,
                                      void*                      user_data,
-                                     //nwalIpAddr_t*              ip_addr_remote,
                                      int*                       err);
 
 /**
@@ -610,24 +602,24 @@ void netapi_netcpCfgDelIp(NETAPI_T          h,
  *      address is present by transmitting a packet with destination mac = this interface mac address.
  *  @param[in]  h   NETAPI instance handle, @ref NETAPI_T
  *  @param[in]  p_mac   pointer to 6 byte MAC address for local interface
+ *  @param[in]  p_mac_remote   pointer to 6 byte MAC address for remote interface
  *  @param[in]  iface_no    interface number (0,1,..) 
  *  @param[in]  switch_port     (0 don't care, 1 switch port 1, 1 switch port 2) [only 0 supported currenly] 
  *  @param[in]  route   handle of a created route or NULL to use internal default route, @ref NETCP_CFG_ROUTE_HANDLE_T
  *  @param[in]  vlan    [future[ vlan configuration . Set to NULL, @ref NETCP_CFG_VLAN_T
  *  @param[in]  state   [future] interface state (0=down, 1= up)
-  * @param[in]  p_mac_remote   pointer to 6 byte MAC address for remote interface
  *  @param[out] err     pointer to error return
  *  @retval     returns AppID for interface (this is returned in meta data for received packets matching this rule an no others, @ref NETCP_CFG_MACIF_T
  *  @pre       @ref netapi_init 
  */
 NETCP_CFG_MACIF_T  netapi_netcpCfgCreateMacInterface(NETAPI_T                   h,
-                                                     uint8_t*                   p_mac, 
+                                                     uint8_t*                   p_mac,
+                                                     uint8_t*                   p_mac_remote,
                                                      int                        iface_no,
                                                      int                        switch_port,
                                                      NETCP_CFG_ROUTE_HANDLE_T   route,
                                                      NETCP_CFG_VLAN_T           vlan,
                                                      int                        state,
-                                                     //uint8_t*                   p_mac_remote,
                                                      int *                      err);
 
 /**
@@ -663,7 +655,7 @@ typedef struct NETCP_CFG_CLASS_L4_Tag
 {
     int                 iface;      /**< Indicates which MAC interface packet should be received on*/
     NETCP_CFG_IP_T      ip;         /**< IP rule to match: see @ref NETCP_CFG_IP_T */
-    nwal_appProtoType_t proto;   /**< L4 proto (-1 for don't care)*/
+    nwal_appProtoType_t proto;      /**< L4 proto (-1 for don't care)*/
     nwalAppProto_t      appProto;   /**< L4 Ports or equivalent */
 
 } NETCP_CFG_CLASS_L4_T;
@@ -679,8 +671,8 @@ typedef struct NETCP_CFG_CLASS_L4_Tag
 typedef struct NETCP_CFG_CLASS_L4_IPSEC_Tag
 {
     int                       iface;      /**< Indicates which MAC interface packet should be received from */
-    NETCP_CFG_IPSEC_POLICY_T  ip_policy; /**< IPSEC policy configuration. see @ref NETCP_CFG_IPSEC_POLICY_T */
-    nwal_appProtoType_t       proto;   /**< L4 proto (-1 for don't care)*/
+    NETCP_CFG_IPSEC_POLICY_T  ip_policy;  /**< IPSEC policy configuration. see @ref NETCP_CFG_IPSEC_POLICY_T */
+    nwal_appProtoType_t       proto;      /**< L4 proto (-1 for don't care)*/
     nwalAppProto_t            appProto;   /**< L4 Ports or equivalent */
 
 } NETCP_CFG_CLASS_L4_IPSEC_T;
index c0c95aafafe9de201cb137cf81ff5a098b27d9cb..57aa4b18b41cc349114422dac224935713cf38f4 100755 (executable)
@@ -192,6 +192,7 @@ NETAPI_T netapi_init(int master, NETAPI_CFG_T * p_cfg)
         pnetapiShm = (NETAPI_SHM_T*)hplib_shmGetEntry(pBase, NETAPI_ENTRY);
         pnetapiShm->netapi_pktio_lock= hplib_spinLock_UNLOCKED_INITIALIZER;
         pnetapiShm->netapi_netcp_cfg_lock = hplib_spinLock_UNLOCKED_INITIALIZER;
+        pnetapiShm->netapi_netcp_cfg_l3_classi_lock = hplib_spinLock_UNLOCKED_INITIALIZER;
         pnetapiShm->netapi_util_lock = hplib_spinLock_UNLOCKED_INITIALIZER;
         if (p_cfg)
         {
index 0620a1cb7874b08739976bf93c2a948679c7f865..a00aed30280636e9f97c550b68ad25087b154c9b 100755 (executable)
@@ -272,7 +272,6 @@ int netapip_initNwal(
         {
             paEntry = (NETAPI_PA_SHM_T*)hplib_shmGetEntry(pBase,PA_ENTRY);
             nwalGlobCfg.instPoolBaseAddr = (void *)paEntry;
-            printf("netapip_initNwal: instPoolBaseAddr: 0x%x\n", nwalGlobCfg.instPoolBaseAddr);
         }
         else
         {
@@ -384,8 +383,6 @@ int netapip_initNwal(
     bases[nwal_BUF_INDEX_INT_HANDLES] = (uint32_t *)Osal_nwalLocToGlobAddr((uint32_t)nwalHandleMem);
     if(NWAL_CHAN_HANDLE_SIZE  < sizes[nwal_BUF_INDEX_INT_HANDLES])
     {
-        printf("NWAL_CHAN_HANDLE_SIZE: %d, sizes: %d\n", NWAL_CHAN_HANDLE_SIZE,
-            sizes[nwal_BUF_INDEX_INT_HANDLES]);
         /* Resize Memory */
         while(1);
     }
index 71a307b0e1bc801a1c9eb90219649598ec950cf8..e20a647b2298e80440531a8b68b0638af66b2d7e 100755 (executable)
@@ -39,7 +39,6 @@ typedef struct NETCP_INTERFACE_IP_Tag
         nwalIpAddr_t  ip_addr;
         nwalIpOpt_t ip_qualifiers;
         void * user_data;
-        int ref_count;
 } NETCP_INTERFACE_IP_T;
 
 /* to hold a classifier */
@@ -239,6 +238,7 @@ typedef struct NETAPI_SHM_Tag
     hplib_spinLock_T    netapi_pktio_lock;
     hplib_spinLock_T    netapi_netcp_cfg_lock;
     hplib_spinLock_T    netapi_util_lock;
+    hplib_spinLock_T    netapi_netcp_cfg_l3_classi_lock;
 } NETAPI_SHM_T;
 
 //internal initialization routines */
index 2b778c4a7dd407150d2dc5146a54bc8eb21daa96..c9443da5a43e255e769b2c4caeecf886522b1eaa 100755 (executable)
@@ -479,8 +479,6 @@ static void netapip_netcpCfgInsertIp(NETAPI_NWAL_GLOBAL_CONTEXT_T *p,
     p->ips[ip_slot].ip_type = ipType;
     p->ips[ip_slot].nwal_handle = handle;
     p->ips[ip_slot].user_data = user_data;
-    p->ips[ip_slot].ref_count++;
-    
 }
 
 /***************************************************************************
@@ -495,7 +493,6 @@ static void netapip_netcpCfgDeleteIp(NETAPI_NWAL_GLOBAL_CONTEXT_T *p,
     if ((ip_slot >=0) &&(ip_slot <=TUNE_NETAPI_MAX_NUM_IP))
     {
         p->ips[ip_slot].in_use=0;
-        p->ips[ip_slot].ref_count = 0;
     }
 }
 
@@ -665,6 +662,38 @@ static void *netapip_netcpCfgGetL4Handle(NETAPI_NWAL_GLOBAL_CONTEXT_T *p,
     return p->classi[class_slot].nwal_L4_handle;
 }
 
+
+
+/*******************************************************************************
+ * FUNCTION PURPOSE:  Netapi internal function to get L3 nwal handle for classifier
+ *******************************************************************************
+ * DESCRIPTION:  Netapi internal function to get L3 nwal handle for classifier
+ *******************************************************************************/
+static int cfgOkToDeleteL3ClassiHandle(NETAPI_NWAL_GLOBAL_CONTEXT_T *p,
+                                         void*  l3_handle)
+{
+    int i;
+    int count=0;
+
+    if(l3_handle == NULL)
+        return FALSE;
+    for(i=0; i< TUNE_NETAPI_MAX_CLASSIFIERS;i++)
+    {
+        if (!p->classi[i].in_use)
+        {
+            continue;
+        }
+        if (l3_handle == p->classi[i].nwal_L3_handle)
+        {
+            count++;
+        }
+    }
+    if (count > 0)
+        return FALSE;
+
+    return TRUE;
+}
+
 /*******************************************************************************
  * FUNCTION PURPOSE:  Netapi internal function to get L3 nwal handle for classifier
  *******************************************************************************
@@ -737,6 +766,7 @@ void netapi_netcpCfgReqStats(NETAPI_T  h,
  ********************************************************************/
 NETCP_CFG_MACIF_T  netapi_netcpCfgCreateMacInterface(NETAPI_T  h,
                                                      uint8_t *p_mac,
+                                                     uint8_t *p_mac_remote,
                                                      int  iface_no, 
                                                      int switch_port, 
                                                      NETCP_CFG_ROUTE_HANDLE_T  route,
@@ -780,7 +810,12 @@ NETCP_CFG_MACIF_T  netapi_netcpCfgCreateMacInterface(NETAPI_T  h,
     pTransInfo->netapi_handle = h;
 
     /* set up MacInfo */
-    memcpy(&macInfo.macAddr,p_mac,6); 
+    memcpy(&macInfo.macAddr,p_mac,6);
+    if(p_mac_remote)
+    {
+        macInfo.validParams |=  NWAL_SET_MAC_VALID_PARAM_REMOTE_MAC;
+        memcpy(&macInfo.remMacAddr,p_mac_remote,6);
+    }
     /* todo: vlan */
     if (switch_port)
     {
@@ -942,7 +977,6 @@ static NETCP_CFG_IP_T  netapip_netcpCfgAddIpInternal(NETAPI_T  h,
                                                      int  flag) /*TRUE: add IP to iface,
                                                      FALSE: add IP as part of classifier */
 {
-    static unsigned char zeroIP4[]={0,0,0,0};
     static unsigned char zeroIP6[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
     NETAPI_HANDLE_T * n = (NETAPI_HANDLE_T *) h;
     void * n_handle=NULL;
@@ -1024,7 +1058,7 @@ static NETCP_CFG_IP_T  netapip_netcpCfgAddIpInternal(NETAPI_T  h,
     {
         if (ipType == nwal_IPV4)
         {
-            if(memcmp(ip_rem_addr, zeroIP4, sizeof(nwalIpv4Addr_t)))
+            if(memcmp(ip_rem_addr, zeroIP6, sizeof(nwalIpv4Addr_t)))
             {
                 nwalIpParam.validParams |= NWAL_SET_IP_VALID_PARAM_REMOTE_IP;
                 memcpy(&nwalIpParam.remIpAddr,ip_rem_addr, sizeof(nwalIpAddr_t));
@@ -1152,34 +1186,7 @@ NETCP_CFG_IP_T  netapi_netcpCfgAddIp(NETAPI_T                  h,
                                          err,
                                          1);
 }
-/***************************************************************************
-* DESCRIPTION:Netapi internal function to check reference count of IP
-***************************************************************************/
-static Bool netapip_netcpCfgCheckIpRefCount(NETAPI_HANDLE_T *p_handle,
-                                            NETAPI_NWAL_GLOBAL_CONTEXT_T *p,
-                                            int ip_slot)
-{
 
-    if ((ip_slot >=0) &&(ip_slot <=TUNE_NETAPI_MAX_NUM_IP))
-    {
-             p_handle->spinLock.lock(&pnetapiShm->netapi_netcp_cfg_lock);
-            /* IS IP is associated with alteast 2 rules, if yes, then dont delete IP */
-            if(p->ips[ip_slot].ref_count)
-                p->ips[ip_slot].ref_count--;
-            if (p->ips[ip_slot].ref_count)
-            {
-                 p_handle->spinLock.unlock(&pnetapiShm->netapi_netcp_cfg_lock);
-                return FALSE;
-            }
-            else
-            {
-                p_handle->spinLock.unlock(&pnetapiShm->netapi_netcp_cfg_lock);
-                return TRUE;
-            }
-    }
-    else
-        return FALSE;
-}
 
 /********************************************************************
  * FUNCTION PURPOSE:  NETAPI internal function to detach IP from MAC interface
@@ -1202,12 +1209,12 @@ static void netapip_netcpCfgDelIpInternal(NETAPI_T h,
     NETAPI_HANDLE_T * n = (NETAPI_HANDLE_T *) h;
     void * ifHandle;
     int ip_slot = netapi_cfgGetMatchId(ip_rule_id);
-    //get the nwal handle assoicated with this ip   
+    /* get the nwal handle assoicated with this ip */
     if (flag)
     {
-        ifHandle = netapip_netcpCfgGetIpHandle(
-                                        &netapi_get_global()->nwal_context, iface_no,
-                                        ip_slot );
+        ifHandle = netapip_netcpCfgGetIpHandle(&netapi_get_global()->nwal_context,
+                                                iface_no,
+                                                ip_slot);
     }
     else 
     {
@@ -1220,15 +1227,6 @@ static void netapip_netcpCfgDelIpInternal(NETAPI_T h,
     }
     *err =0;
 
-    /* need to check to see if this IP is attached to a classifier(s)
-       and only delete if this is last classifier */
-    if (!netapip_netcpCfgCheckIpRefCount(n,
-                                         &netapi_get_global()->nwal_context,
-                                         ip_slot))
-    {
-        return;
-    }
-
     //get a transaction id
     pTransInfo = netapip_getFreeTransInfo(n,
                                           (NETAPI_PROC_GLOBAL_T *) n->proc_global,
@@ -1271,7 +1269,7 @@ static void netapip_netcpCfgDelIpInternal(NETAPI_T h,
         {
             netapip_freeTransInfo(pTransInfo);
             *err = NETAPI_ERR_PA_FW;
-            netapi_Log (">netapip_netcpCfgDelIpInternal - ERROR returned by NETCP PA firmware %d\n", *err);
+            netapi_Log ("netapip_netcpCfgDelIpInternal - ERROR returned by NETCP PA firmware %d\n", *err);
             return;
         }
     }
@@ -1353,6 +1351,7 @@ NETCP_CFG_CLASS_T netapi_netcpCfgAddClass(NETAPI_T                  h,
             netapi_Log(">netapi_netcpCfg : classifier type %d not supported\n",p_class->classType);
             break;
         case(NETCP_CFG_CLASS_TYPE_L3_L4):
+            n->spinLock.lock(&pnetapiShm->netapi_netcp_cfg_l3_classi_lock);
         case(NETCP_CFG_CLASS_TYPE_L4):
             //assume just type l4 only (L2, L3 defined by iface, l3 id )
             iface_no = p_class->u.c_l4.iface;
@@ -1367,6 +1366,8 @@ NETCP_CFG_CLASS_T netapi_netcpCfgAddClass(NETAPI_T                  h,
                 if(!netapi_get_global()->nwal_context.interfaces[iface_no].in_use)
                 {
                     *err = NETAPI_ERR_BAD_INPUT;
+                    if(p_class->classType== NETCP_CFG_CLASS_TYPE_L3_L4)
+                        n->spinLock.unlock(&pnetapiShm->netapi_netcp_cfg_l3_classi_lock);
                     return -1;
                 }
             }
@@ -1431,14 +1432,21 @@ NETCP_CFG_CLASS_T netapi_netcpCfgAddClass(NETAPI_T                  h,
             if(!l3_handle)
             {
                 *err = NETAPI_ERR_BAD_INPUT; 
+                if(p_class->classType == NETCP_CFG_CLASS_TYPE_L3_L4)
+                        n->spinLock.unlock(&pnetapiShm->netapi_netcp_cfg_l3_classi_lock);
                 return -1 ;
             }
 
-
             //find free slot for CLASS & reserve
             class_slot= netapip_netcpCfgFindClassSlot(n,
                                                       &netapi_get_global()->nwal_context);
-            if(class_slot<0) {*err = NETAPI_ERR_NOMEM; return -1;}
+            if(class_slot<0) 
+            {
+                *err = NETAPI_ERR_NOMEM;
+                if(p_class->classType == NETCP_CFG_CLASS_TYPE_L3_L4)
+                        n->spinLock.unlock(&pnetapiShm->netapi_netcp_cfg_l3_classi_lock);
+                return -1;
+                }
             classHandle = NETAPI_NETCP_MATCH_CLASS |
                           (class_slot << NETAPI_NETCP_MATCH_ID_SHIFT) | 
                           (iface_no & NETAPI_NETCP_MATCH_LOGICAL_MAC_IFACE_MASK);
@@ -1477,7 +1485,9 @@ NETCP_CFG_CLASS_T netapi_netcpCfgAddClass(NETAPI_T                  h,
                                                   &trans_id);
             if (!pTransInfo)
             {
-                *err =  NETAPI_ERR_BUSY; 
+                *err =  NETAPI_ERR_BUSY;
+                if(p_class->classType == NETCP_CFG_CLASS_TYPE_L3_L4)
+                    n->spinLock.unlock(&pnetapiShm->netapi_netcp_cfg_l3_classi_lock);
                 return -1;
             }
             pTransInfo->transType = NETAPI_NWAL_HANDLE_TRANS_PORT;
@@ -1499,6 +1509,8 @@ NETCP_CFG_CLASS_T netapi_netcpCfgAddClass(NETAPI_T                  h,
                         retValue);
                 netapip_freeTransInfo(pTransInfo);
                 netapip_netcpCfgDeleteClass(&netapi_get_global()->nwal_context, class_slot);
+                if(p_class->classType== NETCP_CFG_CLASS_TYPE_L3_L4)
+                    n->spinLock.unlock(&pnetapiShm->netapi_netcp_cfg_l3_classi_lock);
                 return -1;
             }
             //wait here until its done since scheduler isn't running yet most likely..
@@ -1519,6 +1531,8 @@ NETCP_CFG_CLASS_T netapi_netcpCfgAddClass(NETAPI_T                  h,
                     *err = NETAPI_ERR_PA_FW;
                     netapip_netcpCfgDeleteClass(&netapi_get_global()->nwal_context, class_slot);
                     netapi_Log (">netcp_cfgAddClass - ERROR returned by NETCP PA firmware %d\n", *err);
+                    if(p_class->classType== NETCP_CFG_CLASS_TYPE_L3_L4)
+                        n->spinLock.unlock(&pnetapiShm->netapi_netcp_cfg_l3_classi_lock);
                     return -1;
                 }
             }
@@ -1532,6 +1546,8 @@ NETCP_CFG_CLASS_T netapi_netcpCfgAddClass(NETAPI_T                  h,
                                   user_data);
 
             netapip_freeTransInfo(pTransInfo);
+            if(p_class->classType== NETCP_CFG_CLASS_TYPE_L3_L4)
+                n->spinLock.unlock(&pnetapiShm->netapi_netcp_cfg_l3_classi_lock);
             return classHandle;
     } //end switch
 
@@ -1562,9 +1578,15 @@ void netapi_netcpCfgDelClass(NETAPI_T           h,
         *err = NETAPI_ERR_BAD_INPUT; 
         goto ERR_netapi_netcpCfgDelClass;
     }
-    L3_handle = netapip_netcpCfgGetL3Handle( &netapi_get_global()->nwal_context, class_slot );
-    /* l3 handle might be NULL,, depending on type of classifier */
+    L3_handle = netapip_netcpCfgGetL3Handle( &netapi_get_global()->nwal_context,
+                                            class_slot);
+    /* l3 handle might be NULL, depending on type of classifier */
 
+    if(L3_handle)
+    {
+        // grab l3 lock
+        n->spinLock.lock(&pnetapiShm->netapi_netcp_cfg_l3_classi_lock);
+    }
     netapip_netcpCfgDeleteClass(
                         &netapi_get_global()->nwal_context,
                         class_slot );
@@ -1583,8 +1605,8 @@ void netapi_netcpCfgDelClass(NETAPI_T           h,
     pTransInfo->netapi_handle = h;
     //issue request for L4
     retValue = nwal_delConn(((NETAPI_GLOBAL_T*) (n->global))->nwal_context.nwalInstHandle,
-                                                  trans_id,
-                                                L4_handle);
+                                                 trans_id,
+                                                 L4_handle);
     if(retValue !=  nwal_OK)
     {
         *err = NETAPI_ERR_NWAL_ERR0;
@@ -1617,15 +1639,24 @@ void netapi_netcpCfgDelClass(NETAPI_T           h,
     pTransInfo->inUse = nwal_FALSE;
 
     /* delete L3 if we have to */
-    if (L3_handle)
+    if (cfgOkToDeleteL3ClassiHandle(h, L3_handle))
     {
-        netapip_netcpCfgDelIpInternal( h, 0, 0,
-                  NULL, NULL, 0,
-                  err, L3_handle,  0);
+        netapip_netcpCfgDelIpInternal(h,
+                                      0,
+                                      0,
+                                      NULL,
+                                      NULL,
+                                      0,
+                                      err,
+                                      L3_handle,
+                                      0);
     }
     netapip_freeTransInfo(pTransInfo);
 
 ERR_netapi_netcpCfgDelClass:
+    if(L3_handle)
+        n->spinLock.unlock(&pnetapiShm->netapi_netcp_cfg_l3_classi_lock);
+
     return;
 }
 
index 2c9a8ab1d70fe84dbeac743da7651124703c872a..475510d320cc3bbaa177be451658399c3b2c80e2 100755 (executable)
@@ -364,7 +364,9 @@ if (!tx_chan) {printf("pktio create failed err=%d\n",err); exit(1);}
 netapi_netcpCfgCreateMacInterface(
                   netapi_handle,
                   &all_mac[0],
-                  0,0,
+                  NULL,
+                  0,
+                  0,
                   (NETCP_CFG_ROUTE_HANDLE_T)  NULL, 
                   (NETCP_CFG_VLAN_T ) NULL ,  //future
                   1,
index 69f399275f5028c1e249824937475c0be966f468..0aa4feafa4e6aed53cf4d0f60d16d31145fdf43d 100755 (executable)
@@ -345,6 +345,7 @@ printf("\n\n******STARTING RECV BENCHMARK (q to quit)*****\n\n");
 netapi_netcpCfgCreateMacInterface(
                   netapi_handle,
                   &all_mac[0],
+                  NULL,
                   0,0,
                   (NETCP_CFG_ROUTE_HANDLE_T)  NULL,
                   (NETCP_CFG_VLAN_T ) NULL ,  //future
index 76dae0ef3d3909cd51fa8b468e3e2fbf5e0fc8e0..1ed02b2f152caceea1a84f456f3176d8fa0b5089 100755 (executable)
@@ -1336,6 +1336,7 @@ void netTest_utilCreateInterfaces(uint8_t num_macs, uint8_t num_ips)
         mac[i] = netapi_netcpCfgCreateMacInterface(
                           netapi_handle,
                           &netTestCfg.mac[i][0],
+                          NULL,
                           i,
                           netTestCfg.switch_port[i],
                           (NETCP_CFG_ROUTE_HANDLE_T)  NULL,