From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 22E92A0562; Tue, 31 Mar 2020 16:55:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F2B822C15; Tue, 31 Mar 2020 16:55:20 +0200 (CEST) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by dpdk.org (Postfix) with ESMTP id 48F17FFA for ; Tue, 31 Mar 2020 16:55:19 +0200 (CEST) Received: by mail-pg1-f196.google.com with SMTP id i34so322316pgl.4 for ; Tue, 31 Mar 2020 07:55:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JirPU5e6/HmfbLrE+Xfkt/aPM4YVDqpys5SPPrg8bcE=; b=xQ5w9sKca8aYW3wfIcVoDqREo6K5YuXlgtoEY+GgLk+3jygk/1sTDPenvlm3hUo5B4 H4GuxLiLgAS5hR4sC1knV9sQdPw/v/cODI7/XQVo6Md+Zlyz6N5nBx/wXPo8rb1IXSxq PpOEmPn5Ds+ee7kwfD0C5O/DyncPcPFMbHI3fOWke4FUkLPcuFboxa1dfJd4pNUmoYau WRCKOZOWDLZd7jQSamlHwN0/7ZmTMxfNgAdnr046mJjg5PJ3O+87CSORnX53qQIvTgFP z/4BYCqRZY/0kCmwnaTj92VQu0+hLDS3iZRzfa0+V6QHYL+ipcyvQiOQ17xqLSdezYij Qi4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JirPU5e6/HmfbLrE+Xfkt/aPM4YVDqpys5SPPrg8bcE=; b=RS4Qv97QSr/PURat3co5Tnm3BLg3729Pao9tCBMNjeoXlepBEQJVg/DGM7uWbXD02l 0S+XhdkYw4IEl/rKHy6odFflx/U+fr7H5E3Gtntv6eVTIL/fWm5vxrI7yrOnb2pLKxOx N8X64IMPV5qZCeKvh180NkRkd5wNoHUtRT+5y7PMsl6if40luLldsRHeAHqwqxUvjIgx fHdE/YF/n6XjI9DBhZc/wStU1KuBmCU2U39Yh2zSjQz7aU6VTR8eAK9EvvpVkqPSKHvP gsslNi6X1qOTnitxTECbjFWDFQktaue3Rg66+2l9a3KCd4fZ01mEZLIzfBO15WLSuyCR bYeQ== X-Gm-Message-State: ANhLgQ37GwApGjqWYLwVHfEPuZi5yQXB4lQvzMPCk7e6lErj/bohzevY c1TWTb/EG1j+VytJY8Wdd/0dWw== X-Google-Smtp-Source: ADFU+vsCd1yGjwh+hFhL7S2RowBwFh6WwK8SqHT60iLCCqDb19KMahEv3XEfIZmezeVpoVUZKjZJoQ== X-Received: by 2002:aa7:94a5:: with SMTP id a5mr19043675pfl.67.1585666518332; Tue, 31 Mar 2020 07:55:18 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id x27sm24870pff.200.2020.03.31.07.55.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Mar 2020 07:55:17 -0700 (PDT) Date: Tue, 31 Mar 2020 07:55:14 -0700 From: Stephen Hemminger To: Slava Ovsiienko Cc: Matan Azrad , Shahaf Shuler , "dev@dpdk.org" , Alexander Kozyrev Message-ID: <20200331075514.775408ee@hermes.lan> In-Reply-To: References: <20200331060247.10954-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] common/mlx5: fix bogus assert X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, 31 Mar 2020 07:31:48 +0000 Slava Ovsiienko wrote: > Hi, Stephen > > Thank you for the fix. > > The exposed API to set MAC addresses: > - mlx5_mac_addr_set (invoked by rte_mac_addr_set ()) > - mlx5_set_mc_addr_list (invoked by rte_eth_dev_set_mc_addr_list()) > > Both routines call mlx5_internal_mac_addr_add(), it in its turn calls > mlx5_nl_mac_addr_add() (that is subject of the patch). > > mlx5_nl_mac_addr_add is internal function, not exposed external API, > the wrong parameter means the critical internal bug, so assert looks to be relevant here. > I would not remove MLX5_ASSERT at all but fix just it. > Adding the parameter check and return an error is nice. > What do you think? > > With best regards, Slava The real root cause is that sizeof(mac_own) is the wrong thing to do. The error handling is up to you. Since ASSERT's are compiled out they are never tested and are actually making code less safe.