From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH 1/2] net/mrvl: switch to the new Rx offload API Date: Mon, 22 Jan 2018 17:53:45 +0000 Message-ID: <928d3a16-5417-8a20-3d9b-78dba6802e66@intel.com> References: <1516622670-21120-1-git-send-email-tdu@semihalf.com> <1516622670-21120-2-git-send-email-tdu@semihalf.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: mw@semihalf.com, dima@marvell.com, nsamsono@marvell.com, Jianbo.liu@arm.com, jck@semihalf.com To: Tomasz Duszynski , dev@dpdk.org Return-path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id BB23E2C2E for ; Mon, 22 Jan 2018 18:53:49 +0100 (CET) In-Reply-To: <1516622670-21120-2-git-send-email-tdu@semihalf.com> Content-Language: en-US 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 1/22/2018 12:04 PM, Tomasz Duszynski wrote: > Since the old Rx offload API is now depracated > update the driver to use the latest one. > > Signed-off-by: Tomasz Duszynski <...> > @@ -1308,6 +1313,42 @@ mrvl_fill_bpool(struct mrvl_rxq *rxq, int num) > } > > /** > + * Check whether requested rx queue offloads match port offloads. > + * > + * @param > + * dev Pointer to the device. > + * @param > + * requested Bitmap of the requested offloads. > + * > + * @return > + * 1 if requested offloads are okay, 0 otherwise. > + */ > +static int > +mrvl_rx_queue_offloads_okay(struct rte_eth_dev *dev, uint64_t requested) > +{ > + uint64_t mandatory = dev->data->dev_conf.rxmode.offloads; > + uint64_t supported = MRVL_RX_OFFLOADS; > + uint64_t unsupported = requested & ~supported; > + uint64_t missing = (requested & mandatory) ^ mandatory; Isn't this same as: missing = mandatory & ~requested; Since "unsupported" use same logic, it can be easier to understand this way. Or just putting following comment may be useful enough: "mandatory subset of requested subset of supported", assuming it is correct :) <...>