From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gregory Etelson Subject: Re: [PATCH] net/ixgbe: fix calling null function of VF Date: Wed, 10 May 2017 12:34:56 +0300 Message-ID: <1659459.pG3zMYDirW@polaris> References: <1494399602-33955-1-git-send-email-wei.dai@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: Wei Dai , wenzhuo.lu@intel.com, konstantin.ananyev@intel.com, stable@dpdk.org To: dev@dpdk.org Return-path: Received: from mail-wr0-f172.google.com (mail-wr0-f172.google.com [209.85.128.172]) by dpdk.org (Postfix) with ESMTP id 773232BAA for ; Wed, 10 May 2017 11:34:59 +0200 (CEST) Received: by mail-wr0-f172.google.com with SMTP id z52so35476052wrc.2 for ; Wed, 10 May 2017 02:34:59 -0700 (PDT) In-Reply-To: <1494399602-33955-1-git-send-email-wei.dai@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hello, The patch you proposed fixed a crash I experienced in IXGBE VF. However, there's still another crash possibility if the code will proceed with speed == 0 condition to ixgbe_get_link_capabilities VF mac.ops.get_link_capabilities is also set to NULL; Regards, Gregory On Wednesday, 10 May 2017 10:00:02 IDT Wei Dai wrote: > hw->mac.ops.get_media-type() of ixgbe VF is NULL and should not > be called directly. It had better be replaced by calling > ixgbe_get_media_type( ) to avoid crash. > > Fixes: c12d22f65b13 ("net/ixgbe: ensure link status is updated") > Cc: stable@dpdk.org > > Signed-off-by: Wei Dai > --- > drivers/net/ixgbe/ixgbe_ethdev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c > index ec667d8..ed2baec 100644 > --- a/drivers/net/ixgbe/ixgbe_ethdev.c > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c > @@ -3799,7 +3799,7 @@ ixgbe_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete) > hw->mac.get_link_status = true; > > if ((intr->flags & IXGBE_FLAG_NEED_LINK_CONFIG) && > - hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) { > + ixgbe_get_media_type(hw) == ixgbe_media_type_fiber) { > speed = hw->phy.autoneg_advertised; > if (!speed) > ixgbe_get_link_capabilities(hw, &speed, &autoneg); >