From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E1298A00BE; Thu, 17 Feb 2022 14:33:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6F66640150; Thu, 17 Feb 2022 14:33:42 +0100 (CET) Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) by mails.dpdk.org (Postfix) with ESMTP id 91FD340042 for ; Thu, 17 Feb 2022 14:33:41 +0100 (CET) Received: by mail-io1-f42.google.com with SMTP id h5so3642926ioj.3 for ; Thu, 17 Feb 2022 05:33:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2BLWSErQF51+JOGYG3kH/MECvNrSQgUX7IOXs0AYD44=; b=XjDRC1yxsx84LzUyKs+X8Y6Pzv8CSjQY/pfcEsEr/f8Wmv5EWDa7AdBUPidKxdgCYz tu/QycIIlAaBVw8fNl+a+f8z9wI1P7By9H+LOjdC+BaXfAxONjlwwh+A3fWg6IoydyaX TpFWjxGO29hdFsgEjmixMUIDAcXZ2JZNVb7Oal3I9RhoxgJjk0Z2cWJ2dGySo+U3tpFl /myQ7+l1282u6Wt0+PfT2Gmpz0Mtxo5zYt25/HtreGqPcr8+eEZsbVXC71rA98QkXyE/ s721cMAviCaVs1QwMWCAdHo/592xiVmls6b6iDydRZeLjLac42V90eDYMXOwKCCmdLWg 8xbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2BLWSErQF51+JOGYG3kH/MECvNrSQgUX7IOXs0AYD44=; b=6ukXEeifx8ORQ8mbfeVFUdnWTt4d1ykwQRmbwH+KaijpONnKOZaL1LJQJzPUYQIfx9 rBb3f/ClxVqUpIPhtElLxKRSHM4d4S7aiepnBbXVzrZQShhen5zp3hzfAk4RzTB8/N72 uVKbX/Ic0xZ2dqUmxiHfp3vg8llkVReGI1xWQXGh/SOBaq+ntVV+CI2qMWlfu43/J5/r xTOXxvV1NZRQ/9w5Ycl74Funf34MT8wBsN7ReibPj9IQihM2YFNgO5ZCSAkOrfLA8Twt WqQAhMPHuvlzvASmr4RSj3ZN4yT2Sv5E6o9t04IEqBFZ1FazvbOKJq7D8psSFsy/E9Xm LX+A== X-Gm-Message-State: AOAM53158JHIjras72jFmvRTrgbCw3lW8DE1Nkn7+bDwRe1cV36XZl6+ XUprOcN5VWjBi/cQXrkD/b6WAaLYne3GV5+rK+4= X-Google-Smtp-Source: ABdhPJxLmABZ02wKtlEtqfJ06M5VlUwEqsNXKrwyUyAyZTKME4/qLmyI+FYmoMymolSXqmBloump9rms3W44+mtLh+Q= X-Received: by 2002:a6b:ce01:0:b0:610:8f2:3b7 with SMTP id p1-20020a6bce01000000b0061008f203b7mr1932593iob.25.1645104813171; Thu, 17 Feb 2022 05:33:33 -0800 (PST) MIME-Version: 1.0 References: <20220207072932.22409-1-ndabilpuram@marvell.com> <20220207072932.22409-10-ndabilpuram@marvell.com> In-Reply-To: <20220207072932.22409-10-ndabilpuram@marvell.com> From: Jerin Jacob Date: Thu, 17 Feb 2022 19:03:07 +0530 Message-ID: Subject: Re: [PATCH 10/20] net/cnxk: added Rx metadata negotiate operation To: Nithin Dabilpuram Cc: Jerin Jacob , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , dpdk-dev Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Mon, Feb 7, 2022 at 1:01 PM Nithin Dabilpuram wrote: > > From: Satha Rao > > Added rx_metadata_negotiate api to enable mark update RX offload. > Removed software logic to enable/disable mark update inside flow > create/destroy apis. APIs > Signed-off-by: Satha Rao > --- > +static int > +cn10k_nix_rx_metadata_negotiate(struct rte_eth_dev *eth_dev, uint64_t *features) > +{ > + struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev); > + > + *features &= > + (RTE_ETH_RX_METADATA_USER_FLAG | RTE_ETH_RX_METADATA_USER_MARK); > + > + if (*features) { > + dev->rx_offload_flags |= NIX_RX_OFFLOAD_MARK_UPDATE_F; > + dev->rx_mark_update = true; > + } else { > + dev->rx_offload_flags &= ~NIX_RX_OFFLOAD_MARK_UPDATE_F; > + dev->rx_mark_update = false; > + } > + > + cn10k_eth_set_rx_function(eth_dev); > + > + return 0; > +} See below. > > +static int > +cn9k_nix_rx_metadata_negotiate(struct rte_eth_dev *eth_dev, uint64_t *features) > +{ > + struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev); > + > + *features &= > + (RTE_ETH_RX_METADATA_USER_FLAG | RTE_ETH_RX_METADATA_USER_MARK); > + > + if (*features) { > + dev->rx_offload_flags |= NIX_RX_OFFLOAD_MARK_UPDATE_F; > + dev->rx_mark_update = true; > + } else { > + dev->rx_offload_flags &= ~NIX_RX_OFFLOAD_MARK_UPDATE_F; > + dev->rx_mark_update = false; > + } > + > + cn9k_eth_set_rx_function(eth_dev); > + > + return 0; > +} > + The above two functions are duplicates, Please pass the function pointer and make it as one function for common code.