patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Bernard Iremonger <bernard.iremonger@intel.com>,
	dev@dpdk.org, wenzhuo.lu@intel.com
Cc: stable@dpdk.org
Subject: Re: [dpdk-stable] [PATCH] net/ixgbe: fix API parameter checking
Date: Wed, 11 Jan 2017 15:15:13 +0000	[thread overview]
Message-ID: <daac85e4-5687-920c-2047-5d0467c2723f@intel.com> (raw)
In-Reply-To: <1484144751-10412-1-git-send-email-bernard.iremonger@intel.com>

On 1/11/2017 2:25 PM, Bernard Iremonger wrote:
> Add checks to rte_pmd_ixgbe_* API's to ensure that the port
> is an ixgbe port.
> 
> Fixes: 49e248223e9f ("net/ixgbe: add API for VF management")
> 
> CC: stable@dpdk.org
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 71 ++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 69 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index b7ddd4f..ca14104 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -1,7 +1,7 @@
>  /*-
>   *   BSD LICENSE
>   *
> - *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
> + *   Copyright(c) 2010-2017 Intel Corporation. All rights reserved.
>   *   All rights reserved.
>   *
>   *   Redistribution and use in source and binary forms, with or without
> @@ -4066,6 +4066,12 @@ rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf,
>  	dev = &rte_eth_devices[port];
>  	rte_eth_dev_info_get(port, &dev_info);
>  
> +	if (!strstr(dev_info.driver_name, "ixgbe"))
> +		return -ENOTSUP;
> +
> +	if (strstr(dev_info.driver_name, "ixgbe_vf"))
> +		return -ENOTSUP;
> +

This part seems common for all functions, what do you think exporting
this into a static function?

Also in the feature if you need to update the method to decide if this
port_id is supported or not, only that function will be effected.

<...>

  reply	other threads:[~2017-01-11 15:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-11 14:25 Bernard Iremonger
2017-01-11 15:15 ` Ferruh Yigit [this message]
2017-01-11 17:05   ` Iremonger, Bernard
2017-01-11 17:24 ` [dpdk-stable] [PATCH v2] " Bernard Iremonger
2017-01-11 18:21   ` Ferruh Yigit

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=daac85e4-5687-920c-2047-5d0467c2723f@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=wenzhuo.lu@intel.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).