Hi Michał, > -----Original Message----- > From: Michał Mirosław [mailto:mir...@gmail.com] > Sent: Saturday, December 3, 2016 09:28 > To: Kulasek, TomaszX <tomaszx.kula...@intel.com> > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH 3/4] crypto: add sgl support for sw PMDs > > 2016-12-02 18:07 GMT+01:00 Tomasz Kulasek <tomaszx.kula...@intel.com>: > > This patch introduces RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER feature > > flag informing that selected crypto device supports segmented mbufs > > natively and doesn't need to be coalesced before crypto operation. > > > > While using segmented buffers in crypto devices may have unpredictable > > results, for PMDs which doesn't support it natively, additional check > > is made for debug compilation. > > > [...] > > +#ifdef RTE_LIBRTE_PMD_AESNI_GCM_DEBUG > > + if (!rte_pktmbuf_is_contiguous(ops[i]->sym->m_src) || > > + (ops[i]->sym->m_dst != NULL && > > + !rte_pktmbuf_is_contiguous( > > + ops[i]->sym->m_dst))) { > > + ops[i]->status = > RTE_CRYPTO_OP_STATUS_INVALID_ARGS; > > + GCM_LOG_ERR("PMD supports only contiguous mbufs, > " > > + "op (%p) provides noncontiguous mbuf as > " > > + "source/destination buffer.\n", ops[i]); > > + qp->qp_stats.enqueue_err_count++; > > + break; > > + } > > +#endif > [...] > > Why are there so many copies of this code? > > Best Regards, > Michał Mirosław
This is one check per crypto PMD: aesni-gcm, aesni-mb, openssl and so on, enabled per PMD. Tomasz