DPDK usage discussions
 help / color / mirror / Atom feed
From: "Singh, Jasvinder" <jasvinder.singh@intel.com>
To: Gadre Nayan <gadrenayan@gmail.com>, "users@dpdk.org" <users@dpdk.org>
Subject: Re: [dpdk-users] Tracking pipeline ports.
Date: Mon, 18 Jul 2016 17:09:37 +0000	[thread overview]
Message-ID: <54CBAA185211B4429112C315DA58FF6DE7E38F@IRSMSX103.ger.corp.intel.com> (raw)
In-Reply-To: <CAKJ7aR5dL83E+jJHGY_2wZteYO_cL=jfN6v7Lid6A275L=8j8g@mail.gmail.com>



> -----Original Message-----
> From: users [mailto:users-bounces@dpdk.org] On Behalf Of Gadre Nayan
> Sent: Monday, July 18, 2016 4:42 PM
> To: users@dpdk.org
> Subject: [dpdk-users] Tracking pipeline ports.
> 
> Hi,
> 
> I wanted to understand the purpose of the f_track function.
> 
> In the IP_pipeline example there are 2 instances where the f_track is used.
> 
> 1. pipeline_firewall:
> static int pipeline_firewall_track(void *pipeline, __rte_unused uint32_t
> port_in,
>         uint32_t *port_out)
> {
>         struct pipeline *p = (struct pipeline *) pipeline;
> 
>         /* Check input arguments */
>         if ((p == NULL) ||
>                 (port_in >= p->n_ports_in) ||
>                 (port_out == NULL))
>                 return -1;
> 
>         if (p->n_ports_in == 1) {
>                 *port_out = 0;
>                 return 0;
>         }
> 
>         return -1;
> }
> 
> 2. Passthrough:
> 
> static int
> pipeline_passthrough_track(void *pipeline, uint32_t port_in, uint32_t
> *port_out) {
>         struct pipeline *p = (struct pipeline *) pipeline;
> 
>         /* Check input arguments */
>         if ((p == NULL) ||
>                 (port_in >= p->n_ports_in) ||
>                 (port_out == NULL))
>                 return -1;
> 
>         *port_out = port_in / p->n_ports_in;
>         return 0;
> }

The f_track function is used in all the pipeline instances. All pipeline instances except passthrough pipeline implements default version of the f_track function. The pipelines such as pass-through allows tracking to be performaned through them becasue of straightforward connections between their input and output ports, while pipelines  like flow-classifications, firewall fails the tracking because of the dependency on the table rule set.

> 1. What is a actual use of this function ?
> Quoting the documentation:
> "In some cases, it is useful for a pipeline instance to get application level
> information related to pipeline connectivity, such as to identify the output
> link (e.g. physical NIC port) where one of its output ports connected, either
> directly or indirectly by traversing other pipeline instances."

This function is implemented as the part of tracking mechanism for identifying the physical nic port where a specific output ports of the routing pipeline are eventually connected. Tracking could involve traversing the other intermediate pipelines before actually getting to physical nic ports. As a result of tracking, routing pipeline can use the real MAC addresses of the network interfaces instead of using hardcoded default value for building the table entries . Furthermore, It also adds support for automatic route updates (add/remove routing entries) when linked physical NIC ports change their state (up/down).

> 2. The 1st condition check remains same in both. But in pass-through
> port_out is assigned some value. what does this mean ?

These are older version of the functions, please check with latest code.

Jasvinder

      reply	other threads:[~2016-07-18 17:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-18 15:42 Gadre Nayan
2016-07-18 17:09 ` Singh, Jasvinder [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54CBAA185211B4429112C315DA58FF6DE7E38F@IRSMSX103.ger.corp.intel.com \
    --to=jasvinder.singh@intel.com \
    --cc=gadrenayan@gmail.com \
    --cc=users@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).