diff options
| author | Russ White <russ@riw.us> | 2022-07-05 09:49:02 -0400 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-05 09:49:02 -0400 | 
| commit | 1dc900fe2784fdb4472d3270e2be15b5b449490b (patch) | |
| tree | 4ac2cef431ddf8d70af91834dec76d3a7c63b815 /zebra/zebra_rib.c | |
| parent | c718a13d60897100850ea7ab381d8f25fa58bbf8 (diff) | |
| parent | f00b37e710e5dd402a514af8817e2cca7d1710ce (diff) | |
Merge pull request #11502 from donaldsharp/zebra_dplane_fini
zebra: make rib_process_dplane_results own ctx freeing
Diffstat (limited to 'zebra/zebra_rib.c')
| -rw-r--r-- | zebra/zebra_rib.c | 33 | 
1 files changed, 5 insertions, 28 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index adfd3174e3..d92a4c2365 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -2108,9 +2108,6 @@ done:  	if (rn)  		route_unlock_node(rn); - -	/* Return context to dataplane module */ -	dplane_ctx_fini(&ctx);  }  /* @@ -2344,9 +2341,6 @@ static void rib_process_dplane_notify(struct zebra_dplane_ctx *ctx)  done:  	if (rn)  		route_unlock_node(rn); - -	/* Return context to dataplane module */ -	dplane_ctx_fini(&ctx);  }  /* @@ -4212,7 +4206,7 @@ void rib_close_table(struct route_table *table)  /*   * Handler for async dataplane results after a pseudowire installation   */ -static int handle_pw_result(struct zebra_dplane_ctx *ctx) +static void handle_pw_result(struct zebra_dplane_ctx *ctx)  {  	struct zebra_pw *pw;  	struct zebra_vrf *vrf; @@ -4221,7 +4215,7 @@ static int handle_pw_result(struct zebra_dplane_ctx *ctx)  	 * result for installation attempts here.  	 */  	if (dplane_ctx_get_op(ctx) != DPLANE_OP_PW_INSTALL) -		goto done; +		return;  	if (dplane_ctx_get_status(ctx) != ZEBRA_DPLANE_REQUEST_SUCCESS) {  		vrf = zebra_vrf_lookup_by_id(dplane_ctx_get_vrf(ctx)); @@ -4230,14 +4224,8 @@ static int handle_pw_result(struct zebra_dplane_ctx *ctx)  			zebra_pw_install_failure(pw,  						 dplane_ctx_get_pw_status(ctx));  	} - -done: -	dplane_ctx_fini(&ctx); - -	return 0;  } -  /*   * Handle results from the dataplane system. Dequeue update context   * structs, dispatch to appropriate internal handlers. @@ -4310,7 +4298,6 @@ static void rib_process_dplane_results(struct thread *thread)  			case DPLANE_OP_ROUTE_INSTALL:  			case DPLANE_OP_ROUTE_UPDATE:  			case DPLANE_OP_ROUTE_DELETE: -			{  				/* Bit of special case for route updates  				 * that were generated by async notifications:  				 * we don't want to continue processing these @@ -4318,10 +4305,7 @@ static void rib_process_dplane_results(struct thread *thread)  				 */  				if (dplane_ctx_get_notif_provider(ctx) == 0)  					rib_process_result(ctx); -				else -					dplane_ctx_fini(&ctx); -			} -			break; +				break;  			case DPLANE_OP_ROUTE_NOTIFY:  				rib_process_dplane_notify(ctx); @@ -4336,17 +4320,13 @@ static void rib_process_dplane_results(struct thread *thread)  			case DPLANE_OP_LSP_INSTALL:  			case DPLANE_OP_LSP_UPDATE:  			case DPLANE_OP_LSP_DELETE: -			{  				/* Bit of special case for LSP updates  				 * that were generated by async notifications:  				 * we don't want to continue processing these.  				 */  				if (dplane_ctx_get_notif_provider(ctx) == 0)  					zebra_mpls_lsp_dplane_result(ctx); -				else -					dplane_ctx_fini(&ctx); -			} -			break; +				break;  			case DPLANE_OP_LSP_NOTIFY:  				zebra_mpls_process_dplane_notify(ctx); @@ -4359,8 +4339,6 @@ static void rib_process_dplane_results(struct thread *thread)  			case DPLANE_OP_SYS_ROUTE_ADD:  			case DPLANE_OP_SYS_ROUTE_DELETE: -				/* No further processing in zebra for these. */ -				dplane_ctx_fini(&ctx);  				break;  			case DPLANE_OP_MAC_INSTALL: @@ -4404,12 +4382,11 @@ static void rib_process_dplane_results(struct thread *thread)  			case DPLANE_OP_NEIGH_TABLE_UPDATE:  			case DPLANE_OP_GRE_SET:  			case DPLANE_OP_NONE: -				/* Don't expect this: just return the struct? */ -				dplane_ctx_fini(&ctx);  				break;  			} /* Dispatch by op code */ +			dplane_ctx_fini(&ctx);  			ctx = dplane_ctx_dequeue(&ctxlist);  		}  | 
