> -----Original Message----- > From: Stephen Hemminger [mailto:step...@networkplumber.org] > Sent: Friday, September 6, 2019 7:24 PM > To: Zapolski, MarcinX A <marcinx.a.zapol...@intel.com> > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [RFC 19.11 v2 1/3] ethdev: hide key ethdev > structures from public API > > On Fri, 6 Sep 2019 15:18:11 +0200 > Marcin Zapolski <marcinx.a.zapol...@intel.com> wrote: > > > +RTE_INIT(rte_eth_dev_init) > > +{ > > + int i; > > + > > + for (i = 0; i < RTE_MAX_ETHPORTS; i++) > > + rte_eth_dev_functions[i] = > > + (struct rte_eth_dev_fcns *)(&rte_eth_devices[i]); > > Casts are error prone. Is it possible to use container_of instead of direct > cast. I could if I had a pointer to struct rte_eth_dev_functions and needed to get struct rte_eth_dev which is a container structure in this case. But I could use offsetof instead.
- [dpdk-dev] [RFC 19.11 v2 1/3] ethdev: hide key ethdev ... Marcin Zapolski
- Re: [dpdk-dev] [RFC 19.11 v2 1/3] ethdev: hide ke... Ferruh Yigit
- Re: [dpdk-dev] [RFC 19.11 v2 1/3] ethdev: hid... Zapolski, MarcinX A
- Re: [dpdk-dev] [RFC 19.11 v2 1/3] ethdev:... Ferruh Yigit
- Re: [dpdk-dev] [RFC 19.11 v2 1/3] eth... Zapolski, MarcinX A
- Re: [dpdk-dev] [RFC 19.11 v2 1/3... Ferruh Yigit
- Re: [dpdk-dev] [RFC 19.11 v2... Zapolski, MarcinX A
- Re: [dpdk-dev] [RFC 19.11 v2... Jerin Jacob
- Re: [dpdk-dev] [RFC 19.11 v2 1/3] ethdev: hide ke... Stephen Hemminger
- Re: [dpdk-dev] [RFC 19.11 v2 1/3] ethdev: hid... Zapolski, MarcinX A
- Re: [dpdk-dev] [RFC 19.11 v2 1/3] ethdev: hide ke... Zapolski, MarcinX A
- Re: [dpdk-dev] [RFC 19.11 v2 1/3] ethdev: hid... Bruce Richardson
- Re: [dpdk-dev] [RFC 19.11 v2 1/3] ethdev:... Zapolski, MarcinX A
- Re: [dpdk-dev] [RFC 19.11 v2 1/3] eth... Bruce Richardson
- Re: [dpdk-dev] [RFC 19.11 v2 1/3... Zapolski, MarcinX A