Skip to content

Commit

Permalink
gh-61 Added some code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
PacketCrunch committed Sep 2, 2022
1 parent 9d2a029 commit 2fef032
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cicd/README
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Scenario1 - Sanity

Scenario2 - Advanced Sanity

Scenario3 - GTP
Scenario3 - 3GPP GTP-ULCL LB Scenario

Scenario4 - Mimics LB scenario in Kubernetes Environment

Expand Down
25 changes: 15 additions & 10 deletions ebpf/kernel/llb_kern_devif.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ dp_do_mirr_lkup(void *ctx, struct xfi *xf)
static int __always_inline
dp_do_mark_mirr(void *ctx, struct xfi *xf)
{

return 0;
}

Expand Down Expand Up @@ -173,8 +172,10 @@ dp_trap_packet(void *ctx, struct xfi *xf, void *fa_)
ntype = oeth->h_proto;

if (dp_add_l2(ctx, (int)sizeof(*llb))) {
/* Note : This func usually fails to push headroom for VxLAN packets but we
* can't drop those packets here. We will pass them on to Linux(SLow path)*/
/* This can fail to push headroom for tunnelled packets.
* It might be better to pass it rather than drop it in case
* of failure
*/
return DP_PASS;
}

Expand Down Expand Up @@ -375,12 +376,6 @@ dp_ing(void *ctx, struct xfi *xf)
return 0;
}

#define dp_ing_mirror(ctx, xf) \
do { \
if (xf->pm.mirr != 0) \
dp_do_mirr_lkup(ctx, xf); \
}while(0);

static int __always_inline
dp_insert_fcv4(void *ctx, struct xfi *xf, struct dp_fc_tacts *acts)
{
Expand Down Expand Up @@ -433,25 +428,35 @@ dp_ing_slow_main(void *ctx, struct xfi *xf)
fa->fcta[7].ca.act_type = 0;
fa->fcta[8].ca.act_type = 0;
fa->fcta[9].ca.act_type = 0; // LLB_FCV4_MAP_ACTS -1

/* memset is too costly */
/*memset(fa->fcta, 0, sizeof(fa->fcta));*/
#endif

LL_DBG_PRINTK("[INGR] START--\n");

/* If there are any packets marked for mirroring, we do
* it here and immediately get it out of way without
* doing any further processing
*/
if (xf->pm.mirr != 0) {
dp_do_mirr_lkup(ctx, xf);
goto out;
}

dp_ing(ctx, xf);

/* If there are pipeline errors at this stage,
* we again skip any further processing
*/
if (xf->pm.pipe_act || xf->pm.tc == 0) {
LL_DBG_PRINTK("[INGR] OUT\n");
goto out;
}

dp_ing_l2(ctx, xf, fa);

#ifdef HAVE_DP_FC
/* fast-cache is used only when certain conditions are met */
if (xf->pm.pipe_act == LLB_PIPE_RDR &&
xf->pm.phit & LLB_DP_ACL_HIT &&
!(xf->pm.phit & LLB_DP_SESS_HIT) &&
Expand Down

0 comments on commit 2fef032

Please sign in to comment.