From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 5419F5936 for ; Thu, 24 Dec 2015 09:02:02 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP; 24 Dec 2015 00:02:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,472,1444719600"; d="scan'208";a="18588049" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga004.fm.intel.com with ESMTP; 24 Dec 2015 00:01:50 -0800 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 24 Dec 2015 00:01:49 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.110.15) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 24 Dec 2015 00:01:49 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.190]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.151]) with mapi id 14.03.0248.002; Thu, 24 Dec 2015 16:01:48 +0800 From: "Qiu, Michael" To: "Pattan, Reshma" , "Doherty, Declan" , "thomas.monjalon@6wind.com" Thread-Topic: [dpdk-dev] [PATCH 1/3] librte_ether: remove RTE_PROC_PRIMARY_OR_ERR_RET and RTE_PROC_PRIMARY_OR_RET Thread-Index: AQHRPXw+2giVuH0E3EilIDEcavWXmA== Date: Thu, 24 Dec 2015 08:01:47 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E6028622F0018D@SHSMSX101.ccr.corp.intel.com> References: <1450873172-21932-1-git-send-email-reshma.pattan@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH 1/3] librte_ether: remove RTE_PROC_PRIMARY_OR_ERR_RET and RTE_PROC_PRIMARY_OR_RET X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 08:02:03 -0000 On 12/23/2015 8:19 PM, Reshma Pattan wrote:=0A= > Macros RTE_PROC_PRIMARY_OR_ERR_RET and RTE_PROC_PRIMARY_OR_RET=0A= > are blocking the secondary process from using the APIs.=0A= > API access should be given to both secondary and primary.=0A= =0A= Just as the log says, is it safe to do so?=0A= =0A= Thanks,=0A= Michael=0A= > Fix minor checkpath issues in rte_ethdev.h=0A= >=0A= > Reported-by: Sean Harte =0A= > Signed-off-by: Reshma Pattan =0A= > ---=0A= > lib/librte_ether/rte_ethdev.c | 50 +------------------------------------= ------=0A= > lib/librte_ether/rte_ethdev.h | 20 ++++++++---------=0A= > 2 files changed, 11 insertions(+), 59 deletions(-)=0A= >=0A= > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.= c=0A= > index ed971b4..5849102 100644=0A= > --- a/lib/librte_ether/rte_ethdev.c=0A= > +++ b/lib/librte_ether/rte_ethdev.c=0A= > @@ -711,10 +711,6 @@ rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t= rx_queue_id)=0A= > {=0A= > struct rte_eth_dev *dev;=0A= > =0A= > - /* This function is only safe when called from the primary process=0A= > - * in a multi-process setup*/=0A= > - RTE_PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);=0A= > -=0A= > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);=0A= > =0A= > dev =3D &rte_eth_devices[port_id];=0A= > @@ -741,10 +737,6 @@ rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t = rx_queue_id)=0A= > {=0A= > struct rte_eth_dev *dev;=0A= > =0A= > - /* This function is only safe when called from the primary process=0A= > - * in a multi-process setup*/=0A= > - RTE_PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);=0A= > -=0A= > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);=0A= > =0A= > dev =3D &rte_eth_devices[port_id];=0A= > @@ -771,10 +763,6 @@ rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t= tx_queue_id)=0A= > {=0A= > struct rte_eth_dev *dev;=0A= > =0A= > - /* This function is only safe when called from the primary process=0A= > - * in a multi-process setup*/=0A= > - RTE_PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);=0A= > -=0A= > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);=0A= > =0A= > dev =3D &rte_eth_devices[port_id];=0A= > @@ -801,10 +789,6 @@ rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t = tx_queue_id)=0A= > {=0A= > struct rte_eth_dev *dev;=0A= > =0A= > - /* This function is only safe when called from the primary process=0A= > - * in a multi-process setup*/=0A= > - RTE_PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);=0A= > -=0A= > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);=0A= > =0A= > dev =3D &rte_eth_devices[port_id];=0A= > @@ -874,10 +858,6 @@ rte_eth_dev_configure(uint8_t port_id, uint16_t nb_r= x_q, uint16_t nb_tx_q,=0A= > struct rte_eth_dev_info dev_info;=0A= > int diag;=0A= > =0A= > - /* This function is only safe when called from the primary process=0A= > - * in a multi-process setup*/=0A= > - RTE_PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);=0A= > -=0A= > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);=0A= > =0A= > if (nb_rx_q > RTE_MAX_QUEUES_PER_PORT) {=0A= > @@ -1059,10 +1039,6 @@ rte_eth_dev_start(uint8_t port_id)=0A= > struct rte_eth_dev *dev;=0A= > int diag;=0A= > =0A= > - /* This function is only safe when called from the primary process=0A= > - * in a multi-process setup*/=0A= > - RTE_PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);=0A= > -=0A= > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);=0A= > =0A= > dev =3D &rte_eth_devices[port_id];=0A= > @@ -1096,10 +1072,6 @@ rte_eth_dev_stop(uint8_t port_id)=0A= > {=0A= > struct rte_eth_dev *dev;=0A= > =0A= > - /* This function is only safe when called from the primary process=0A= > - * in a multi-process setup*/=0A= > - RTE_PROC_PRIMARY_OR_RET();=0A= > -=0A= > RTE_ETH_VALID_PORTID_OR_RET(port_id);=0A= > dev =3D &rte_eth_devices[port_id];=0A= > =0A= > @@ -1121,10 +1093,6 @@ rte_eth_dev_set_link_up(uint8_t port_id)=0A= > {=0A= > struct rte_eth_dev *dev;=0A= > =0A= > - /* This function is only safe when called from the primary process=0A= > - * in a multi-process setup*/=0A= > - RTE_PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);=0A= > -=0A= > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);=0A= > =0A= > dev =3D &rte_eth_devices[port_id];=0A= > @@ -1138,10 +1106,6 @@ rte_eth_dev_set_link_down(uint8_t port_id)=0A= > {=0A= > struct rte_eth_dev *dev;=0A= > =0A= > - /* This function is only safe when called from the primary process=0A= > - * in a multi-process setup*/=0A= > - RTE_PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);=0A= > -=0A= > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);=0A= > =0A= > dev =3D &rte_eth_devices[port_id];=0A= > @@ -1155,10 +1119,6 @@ rte_eth_dev_close(uint8_t port_id)=0A= > {=0A= > struct rte_eth_dev *dev;=0A= > =0A= > - /* This function is only safe when called from the primary process=0A= > - * in a multi-process setup*/=0A= > - RTE_PROC_PRIMARY_OR_RET();=0A= > -=0A= > RTE_ETH_VALID_PORTID_OR_RET(port_id);=0A= > dev =3D &rte_eth_devices[port_id];=0A= > =0A= > @@ -1183,10 +1143,6 @@ rte_eth_rx_queue_setup(uint8_t port_id, uint16_t r= x_queue_id,=0A= > struct rte_eth_dev *dev;=0A= > struct rte_eth_dev_info dev_info;=0A= > =0A= > - /* This function is only safe when called from the primary process=0A= > - * in a multi-process setup*/=0A= > - RTE_PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);=0A= > -=0A= > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);=0A= > =0A= > dev =3D &rte_eth_devices[port_id];=0A= > @@ -1266,10 +1222,6 @@ rte_eth_tx_queue_setup(uint8_t port_id, uint16_t t= x_queue_id,=0A= > struct rte_eth_dev *dev;=0A= > struct rte_eth_dev_info dev_info;=0A= > =0A= > - /* This function is only safe when called from the primary process=0A= > - * in a multi-process setup*/=0A= > - RTE_PROC_PRIMARY_OR_ERR_RET(-E_RTE_SECONDARY);=0A= > -=0A= > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);=0A= > =0A= > dev =3D &rte_eth_devices[port_id];=0A= > @@ -2479,7 +2431,7 @@ rte_eth_dev_callback_register(uint8_t port_id,=0A= > /* create a new callback. */=0A= > if (user_cb =3D=3D NULL)=0A= > user_cb =3D rte_zmalloc("INTR_USER_CALLBACK",=0A= > - sizeof(struct rte_eth_dev_callback), 0);=0A= > + sizeof(struct rte_eth_dev_callback), 0);=0A= > if (user_cb !=3D NULL) {=0A= > user_cb->cb_fn =3D cb_fn;=0A= > user_cb->cb_arg =3D cb_arg;=0A= > diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.= h=0A= > index bada8ad..30cb216 100644=0A= > --- a/lib/librte_ether/rte_ethdev.h=0A= > +++ b/lib/librte_ether/rte_ethdev.h=0A= > @@ -248,7 +248,7 @@ struct rte_eth_link {=0A= > uint16_t link_speed; /**< ETH_LINK_SPEED_[10, 100, 1000, 10000] */= =0A= > uint16_t link_duplex; /**< ETH_LINK_[HALF_DUPLEX, FULL_DUPLEX] */= =0A= > uint8_t link_status : 1; /**< 1 -> link up, 0 -> link down */=0A= > -}__attribute__((aligned(8))); /**< aligned for atomic64 read/write *= /=0A= > +} __attribute__((aligned(8))); /**< aligned for atomic64 read/write = */=0A= > =0A= > #define ETH_LINK_SPEED_AUTONEG 0 /**< Auto-negotiate link speed. = */=0A= > #define ETH_LINK_SPEED_10 10 /**< 10 megabits/second. */=0A= > @@ -767,7 +767,7 @@ struct rte_eth_conf {=0A= > struct rte_eth_rxmode rxmode; /**< Port RX configuration. */=0A= > struct rte_eth_txmode txmode; /**< Port TX configuration. */=0A= > uint32_t lpbk_mode; /**< Loopback operation mode. By default the value= =0A= > - is 0, meaning the loopback mode is disabled.=0A= > + is 0, meaning the loopback mode is disabled.=0A= > Read the datasheet of given ethernet controller=0A= > for details. The possible values of this field=0A= > are defined in implementation of each driver. */=0A= > @@ -1591,10 +1591,10 @@ struct rte_eth_dev_data {=0A= > /**< Common rx buffer size handled by all queues */=0A= > =0A= > uint64_t rx_mbuf_alloc_failed; /**< RX ring mbuf allocation failures. *= /=0A= > - struct ether_addr* mac_addrs;/**< Device Ethernet Link address. */=0A= > + struct ether_addr *mac_addrs;/**< Device Ethernet Link address. */=0A= > uint64_t mac_pool_sel[ETH_NUM_RECEIVE_MAC_ADDR];=0A= > /** bitmap array of associating Ethernet MAC addresses to pools */=0A= > - struct ether_addr* hash_mac_addrs;=0A= > + struct ether_addr *hash_mac_addrs;=0A= > /** Device Ethernet MAC addresses of hash filtering. */=0A= > uint8_t port_id; /**< Device [external] port identifier. */= =0A= > uint8_t promiscuous : 1, /**< RX promiscuous mode ON(1) / OFF(0). */= =0A= > @@ -2318,7 +2318,7 @@ extern int rte_eth_dev_set_mtu(uint8_t port_id, uin= t16_t mtu);=0A= > * - (-ENOSYS) if VLAN filtering on *port_id* disabled.=0A= > * - (-EINVAL) if *vlan_id* > 4095.=0A= > */=0A= > -extern int rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id , i= nt on);=0A= > +extern int rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, in= t on);=0A= > =0A= > /**=0A= > * Enable/Disable hardware VLAN Strip by a rx queue of an Ethernet devic= e.=0A= > @@ -2543,7 +2543,7 @@ rte_eth_rx_queue_count(uint8_t port_id, uint16_t qu= eue_id)=0A= > struct rte_eth_dev *dev =3D &rte_eth_devices[port_id];=0A= > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);=0A= > RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, -ENOTSUP);=0A= > - return (*dev->dev_ops->rx_queue_count)(dev, queue_id);=0A= > + return (*dev->dev_ops->rx_queue_count)(dev, queue_id);=0A= > }=0A= > =0A= > /**=0A= > @@ -3004,7 +3004,7 @@ int rte_eth_dev_rss_reta_query(uint8_t port,=0A= > * - (-ENODEV) if *port_id* invalid.=0A= > * - (-EINVAL) if bad parameter.=0A= > */=0A= > -int rte_eth_dev_uc_hash_table_set(uint8_t port,struct ether_addr *addr,= =0A= > +int rte_eth_dev_uc_hash_table_set(uint8_t port, struct ether_addr *addr,= =0A= > uint8_t on);=0A= > =0A= > /**=0A= > @@ -3024,7 +3024,7 @@ int rte_eth_dev_uc_hash_table_set(uint8_t port,stru= ct ether_addr *addr,=0A= > * - (-ENODEV) if *port_id* invalid.=0A= > * - (-EINVAL) if bad parameter.=0A= > */=0A= > -int rte_eth_dev_uc_all_hash_table_set(uint8_t port,uint8_t on);=0A= > +int rte_eth_dev_uc_all_hash_table_set(uint8_t port, uint8_t on);=0A= > =0A= > /**=0A= > * Set RX L2 Filtering mode of a VF of an Ethernet device.=0A= > @@ -3068,7 +3068,7 @@ int rte_eth_dev_set_vf_rxmode(uint8_t port, uint16_= t vf, uint16_t rx_mode,=0A= > * - (-EINVAL) if bad parameter.=0A= > */=0A= > int=0A= > -rte_eth_dev_set_vf_tx(uint8_t port,uint16_t vf, uint8_t on);=0A= > +rte_eth_dev_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on);=0A= > =0A= > /**=0A= > * Enable or disable a VF traffic receive of an Ethernet device.=0A= > @@ -3087,7 +3087,7 @@ rte_eth_dev_set_vf_tx(uint8_t port,uint16_t vf, uin= t8_t on);=0A= > * - (-EINVAL) if bad parameter.=0A= > */=0A= > int=0A= > -rte_eth_dev_set_vf_rx(uint8_t port,uint16_t vf, uint8_t on);=0A= > +rte_eth_dev_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on);=0A= > =0A= > /**=0A= > * Enable/Disable hardware VF VLAN filtering by an Ethernet device of=0A= =0A=