From mboxrd@z Thu Jan 1 00:00:00 1970 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) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jan 2018 09:53:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,397,1511856000"; d="scan'208";a="168181892" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.48]) ([10.237.220.48]) by orsmga004.jf.intel.com with ESMTP; 22 Jan 2018 09:53:46 -0800 To: Tomasz Duszynski , dev@dpdk.org Cc: mw@semihalf.com, dima@marvell.com, nsamsono@marvell.com, Jianbo.liu@arm.com, jck@semihalf.com References: <1516622670-21120-1-git-send-email-tdu@semihalf.com> <1516622670-21120-2-git-send-email-tdu@semihalf.com> From: Ferruh Yigit Message-ID: <928d3a16-5417-8a20-3d9b-78dba6802e66@intel.com> Date: Mon, 22 Jan 2018 17:53:45 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <1516622670-21120-2-git-send-email-tdu@semihalf.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH 1/2] net/mrvl: switch to the new Rx offload API 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: , X-List-Received-Date: Mon, 22 Jan 2018 17:53:51 -0000 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 :) <...>