From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <dev-bounces@dpdk.org> Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 08D3CA00BE; Thu, 10 Feb 2022 17:31:36 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 15BE8411C9; Thu, 10 Feb 2022 17:30:27 +0100 (CET) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by mails.dpdk.org (Postfix) with ESMTP id 6E9A1411C9 for <dev@dpdk.org>; Thu, 10 Feb 2022 17:30:25 +0100 (CET) Received: by mail-pf1-f177.google.com with SMTP id n23so11206533pfo.1 for <dev@dpdk.org>; Thu, 10 Feb 2022 08:30:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2aTyvUeI8R0CGoVnhOw8bLFzu5XQ/NGJ8OITVagp9bs=; b=VnrwXdMdJplIrQkwDIq51UHNQGMeV+B22nRpXTtTmw6MFopCXEPdrhnksYUHYI59TU uwUoE2p0OwPAukryUfe6vJySkG3//OM7vqxZHhcOFk6cokMCElOBoZ5FoAgokqBG2uth piMJkYkyA0XFfqU+jsbW0aNS6UEeEZcr57+rnalStTz5SgK2grlPeJLVKTKYKe8kLDkp Py6LUbJX3ZqjqZDaPyWZ06FDN2z5HFyPfNPOkGTJZK966c/4ET6r34PGDm+Ltodg9dHU EoIrqK7BpVBQtTIJJ6dGC30l+q9LGQMEOJCUiaQPg0hl85QOpCb7T9Ozlzxnpu4AQ0i7 rG7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2aTyvUeI8R0CGoVnhOw8bLFzu5XQ/NGJ8OITVagp9bs=; b=HSbxy8IjBqEjakjX8P+gX6EH2l1/15FLpsuGrbkZ9f5YJwO4aEw0h8A85OH9jphghJ TaoV+OnyjSVF2cAZcpphp0ddYEk4xvX/pVbJ00Ux32Ow4tQyh08aiKRzQujhZPpkQfoO A0xp4rmnzLA7vgL4689cuuJ3MC7vfp2jDFMnWYDgZvVDViKnaPnvEiMgFq48WEr0H+6g bYIV+H4mw37oiJb8jV9e3cRkB9BPeRvhr6xUAF+DuzkV6nLX1fY7duXDLIVdwb3cwKvc jhU9f5GzjKDYTlgKJppDfPFFo/iBvTFQJpRRBByaDt9OMLaSUt9FFVe/wdCcBFpZc7s7 ZZJQ== X-Gm-Message-State: AOAM531BvLuNhRexqQRNF4aJMmIOfaEP1tKZ2Tm2FGev7SwPcEbYhRXl 7TWHwmS3NISvBWjQX0Tm2B1nvQ== X-Google-Smtp-Source: ABdhPJzOp8UiNUo+0cqtgDxQ+iQbEhKs5LRvCi9Oj8rjXnu+yh5ODqsjbd57/ywAcZhKYGIzIPMJpA== X-Received: by 2002:a63:8142:: with SMTP id t63mr6776443pgd.256.1644510624660; Thu, 10 Feb 2022 08:30:24 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id h26sm17254071pgm.72.2022.02.10.08.30.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 08:30:24 -0800 (PST) Date: Thu, 10 Feb 2022 08:30:20 -0800 From: Stephen Hemminger <stephen@networkplumber.org> To: Ferruh Yigit <ferruh.yigit@intel.com> Cc: Shepard Siegel <shepard.siegel@atomicrules.com>, Ed Czeck <ed.czeck@atomicrules.com>, John Miller <john.miller@atomicrules.com>, "Rasesh Mody" <rmody@marvell.com>, Shahed Shaikh <shshaikh@marvell.com>, Ajit Khaparde <ajit.khaparde@broadcom.com>, Somnath Kotur <somnath.kotur@broadcom.com>, Nithin Dabilpuram <ndabilpuram@marvell.com>, Kiran Kumar K <kirankumark@marvell.com>, Sunil Kumar Kori <skori@marvell.com>, Satha Rao <skoteshwar@marvell.com>, Hemant Agrawal <hemant.agrawal@nxp.com>, "Sachin Saxena" <sachin.saxena@oss.nxp.com>, John Daley <johndale@cisco.com>, "Hyong Youb Kim" <hyonkim@cisco.com>, "Min Hu (Connor)" <humin29@huawei.com>, "Yisen Zhuang" <yisen.zhuang@huawei.com>, Lijun Ou <oulijun@huawei.com>, Matan Azrad <matan@nvidia.com>, Viacheslav Ovsiienko <viacheslavo@nvidia.com>, "Gagandeep Singh" <g.singh@nxp.com>, Devendra Singh Rawat <dsinghrawat@marvell.com>, Thomas Monjalon <thomas@monjalon.net>, Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>, <dev@dpdk.org>, Ciara Loftus <ciara.loftus@intel.com> Subject: Re: [PATCH] ethdev: introduce generic dummy packet burst function Message-ID: <20220210083020.028303f3@hermes.local> In-Reply-To: <65625d88-ec45-80d8-0228-f9605ade18bd@intel.com> References: <20220208194437.426143-1-ferruh.yigit@intel.com> <65625d88-ec45-80d8-0228-f9605ade18bd@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org On Thu, 10 Feb 2022 13:58:43 +0000 Ferruh Yigit <ferruh.yigit@intel.com> wrote: > On 2/8/2022 7:44 PM, Ferruh Yigit wrote: > > diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c > > index aecdc5a68abb..bbe05bb837e0 100644 > > --- a/drivers/net/mlx5/linux/mlx5_os.c > > +++ b/drivers/net/mlx5/linux/mlx5_os.c > > @@ -1623,8 +1623,8 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, > > DRV_LOG(DEBUG, "port %u MTU is %u", eth_dev->data->port_id, > > priv->mtu); > > /* Initialize burst functions to prevent crashes before link-up. */ > > - eth_dev->rx_pkt_burst = removed_rx_burst; > > - eth_dev->tx_pkt_burst = removed_tx_burst; > > + eth_dev->rx_pkt_burst = rte_eth_pkt_burst_dummy; > > + eth_dev->tx_pkt_burst = rte_eth_pkt_burst_dummy; > > eth_dev->dev_ops = &mlx5_dev_ops; > > eth_dev->rx_descriptor_status = mlx5_rx_descriptor_status; > > eth_dev->tx_descriptor_status = mlx5_tx_descriptor_status; > > diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c > > index 67eda41a60a5..5571e9067787 100644 > > --- a/drivers/net/mlx5/mlx5.c > > +++ b/drivers/net/mlx5/mlx5.c > > @@ -1559,8 +1559,8 @@ mlx5_dev_close(struct rte_eth_dev *dev) > > mlx5_action_handle_flush(dev); > > mlx5_flow_meter_flush(dev, NULL); > > /* Prevent crashes when queues are still in use. */ > > - dev->rx_pkt_burst = removed_rx_burst; > > - dev->tx_pkt_burst = removed_tx_burst; > > + dev->rx_pkt_burst = rte_eth_pkt_burst_dummy; > > + dev->tx_pkt_burst = rte_eth_pkt_burst_dummy; > > rte_wmb(); > > /* Disable datapath on secondary process. */ > > mlx5_mp_os_req_stop_rxtx(dev); > > diff --git a/drivers/net/mlx5/mlx5_rx.c b/drivers/net/mlx5/mlx5_rx.c > > index f388fcc31395..11ea935d72f0 100644 > > --- a/drivers/net/mlx5/mlx5_rx.c > > +++ b/drivers/net/mlx5/mlx5_rx.c > > @@ -252,7 +252,7 @@ mlx5_rx_queue_count(void *rx_queue) > > dev = &rte_eth_devices[rxq->port_id]; > > > > if (dev->rx_pkt_burst == NULL || > > - dev->rx_pkt_burst == removed_rx_burst) { > > + dev->rx_pkt_burst == rte_eth_pkt_burst_dummy) { > > rte_errno = ENOTSUP; > > return -rte_errno; > > } > > Thinking twice I am not sure if above change works. > > Since function is in the header file, and the .c file that assign > the 'dev->rx_pkt_burst' and the .c file that check function pointer > are different, these two different instance of same function may > have different addresses and above check may fail when it should match. > > I guess solution is move the function to a .c file and export it > internally. > I was thinking to add ethdev_driver.c file, perhaps this can be > a motivation to start that file. > Thomas, Andrew, what do you think about ethdev_driver.c file? Right putting it the header file ends up with multiple copies of same code compiled into each driver.