netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Felix Manlunas <felix.manlunas@cavium.com>, davem@davemloft.net
Cc: netdev@vger.kernel.org, raghu.vatsavayi@cavium.com,
	derek.chickles@cavium.com, satananda.burla@cavium.com,
	intiyaz.basha@cavium.com
Subject: Re: [PATCH net-next] liquidio: Added support for trusted VF
Date: Fri, 16 Mar 2018 15:47:20 -0700	[thread overview]
Message-ID: <b4ed308f-a2cd-a1ff-7643-b38d23d5c574@gmail.com> (raw)
In-Reply-To: <20180316224002.GA2507@felix-thinkpad.cavium.com>



On 03/16/2018 03:40 PM, Felix Manlunas wrote:
> From: Intiyaz Basha <intiyaz.basha@cavium.com>
> 
> When a VF is trusted, all promiscuous traffic will only be sent to that VF.
> In normal operation promiscuous traffic is sent to the PF. There can be
> only one trusted VF per PF.
> 
> Signed-off-by: Intiyaz Basha <intiyaz.basha@cavium.com>
> Acked-by: Satanand Burla <satananda.burla@cavium.com>
> Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
> ---
>  drivers/net/ethernet/cavium/liquidio/lio_main.c    | 125 +++++++++++++++++++++
>  .../net/ethernet/cavium/liquidio/liquidio_common.h |   7 ++
>  .../net/ethernet/cavium/liquidio/octeon_device.h   |   2 +
>  3 files changed, 134 insertions(+)
> 
> diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c b/drivers/net/ethernet/cavium/liquidio/lio_main.c
> index 140085b..c14b87a 100644
> --- a/drivers/net/ethernet/cavium/liquidio/lio_main.c
> +++ b/drivers/net/ethernet/cavium/liquidio/lio_main.c
> @@ -91,6 +91,12 @@ static int octeon_console_debug_enabled(u32 console)
>   */
>  #define LIO_SYNC_OCTEON_TIME_INTERVAL_MS 60000
>  
> +struct lio_trusted_vf_ctx {
> +	wait_queue_head_t wc;
> +	int cond;
> +	int status;
> +};
> +
>  struct liquidio_rx_ctl_context {
>  	int octeon_id;
>  
> @@ -3265,10 +3271,128 @@ static int liquidio_get_vf_config(struct net_device *netdev, int vfidx,
>  	ether_addr_copy(&ivi->mac[0], macaddr);
>  	ivi->vlan = oct->sriov_info.vf_vlantci[vfidx] & VLAN_VID_MASK;
>  	ivi->qos = oct->sriov_info.vf_vlantci[vfidx] >> VLAN_PRIO_SHIFT;
> +	if (oct->sriov_info.trusted_vf.active &&
> +	    oct->sriov_info.trusted_vf.id == vfidx)
> +		ivi->trusted = true;
> +	else
> +		ivi->trusted = false;
>  	ivi->linkstate = oct->sriov_info.vf_linkstate[vfidx];
>  	return 0;
>  }
>  
> +static void trusted_vf_callback(struct octeon_device *oct_dev,
> +				u32 status, void *ptr)
> +{
> +	struct octeon_soft_command *sc = (struct octeon_soft_command *)ptr;
> +	struct lio_trusted_vf_ctx *ctx;
> +
> +	ctx = (struct lio_trusted_vf_ctx *)sc->ctxptr;
> +	ctx->status = status;
> +	WRITE_ONCE(ctx->cond, 1);
> +
> +	/* This barrier is required to be sure that the response has
> +	 * been written fully before waking up the handler
> +	 */
> +	wmb();
> +
> +	wake_up_interruptible(&ctx->wc);
> +}


Hmmm... it looks like you tried to reimplement completions, possibly dealing with barriers...

Check  complete(), init_completion(), wait_for_completion()

      reply	other threads:[~2018-03-16 22:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-16 22:40 [PATCH net-next] liquidio: Added support for trusted VF Felix Manlunas
2018-03-16 22:47 ` Eric Dumazet [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=b4ed308f-a2cd-a1ff-7643-b38d23d5c574@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=derek.chickles@cavium.com \
    --cc=felix.manlunas@cavium.com \
    --cc=intiyaz.basha@cavium.com \
    --cc=netdev@vger.kernel.org \
    --cc=raghu.vatsavayi@cavium.com \
    --cc=satananda.burla@cavium.com \
    /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).