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 E6836F965 for ; Mon, 27 Mar 2017 08:16:17 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP; 26 Mar 2017 23:16:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,229,1486454400"; d="scan'208";a="65378890" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga002.jf.intel.com with ESMTP; 26 Mar 2017 23:16:15 -0700 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 26 Mar 2017 23:16:01 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 26 Mar 2017 23:16:01 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.224]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.42]) with mapi id 14.03.0248.002; Mon, 27 Mar 2017 14:16:00 +0800 From: "Yang, Qiming" To: Andriy Berestovskyy , "Thomas Monjalon" CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2] ether: use a default for max Rx frame size in configure() Thread-Index: AQHSpJUoy5vZlpERRkeIzbniIatq6KGoNqeg Date: Mon, 27 Mar 2017 06:15:59 +0000 Message-ID: References: <1490288768-8114-1-git-send-email-Andriy.Berestovskyy@cavium.com> <1490356325-15434-1-git-send-email-Andriy.Berestovskyy@caviumnetworks.com> In-Reply-To: <1490356325-15434-1-git-send-email-Andriy.Berestovskyy@caviumnetworks.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiM2Q2YzAzNmMtMzdhNy00ODM0LTk3YWItYTg2Yjk5NmFhZmUwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IkRaVXM5VUwxT2xCa2Rhc1dLVTFLMTNwaUlVdnhwcENyWHNaZ1FqeEowd1E9In0= x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] ether: use a default for max Rx frame size in configure() 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, 27 Mar 2017 06:16:18 -0000 Hi, Andriy I don't think this is a bug. Return errors when configure an invalid max_rx= _pkt_len is suitable for this generic API. rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_queue, uint16_t nb_tx= _queue, const struct rte_eth_conf *eth_conf)=20 is used to configure an Ethernet device as eth_conf demand.=20 It's not suitable to give a default value in this function. BRs, Qiming > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Andriy > Berestovskyy > Sent: Friday, March 24, 2017 7:52 PM > To: Thomas Monjalon > Cc: dev@dpdk.org > Subject: [dpdk-dev] [PATCH v2] ether: use a default for max Rx frame size= in > configure() >=20 > At the moment behaves inconsistent: > - for normal frames: out of range max_rx_pkt_len uses a default > - for jumbo frames: out of range max_rx_pkt_len gives an error >=20 > This patch fixes this inconsistency by using a default value for > max_rx_pkt_len both for normal and jumbo frames. >=20 > Signed-off-by: Andriy Berestovskyy > > --- >=20 > Notes: > v2 changes: > - reword the commit title according to the check-git-log.sh >=20 > lib/librte_ether/rte_ethdev.c | 20 +++++--------------- > lib/librte_ether/rte_ethdev.h | 6 +++++- > 2 files changed, 10 insertions(+), 16 deletions(-) >=20 > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.= c > index eb0a94a..f560051 100644 > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -856,21 +856,11 @@ rte_eth_dev_configure(uint8_t port_id, uint16_t > nb_rx_q, uint16_t nb_tx_q, > * length is supported by the configured device. > */ > if (dev_conf->rxmode.jumbo_frame =3D=3D 1) { > - if (dev_conf->rxmode.max_rx_pkt_len > > - dev_info.max_rx_pktlen) { > - RTE_PMD_DEBUG_TRACE("ethdev port_id=3D%d > max_rx_pkt_len %u" > - " > max valid value %u\n", > - port_id, > - (unsigned)dev_conf- > >rxmode.max_rx_pkt_len, > - (unsigned)dev_info.max_rx_pktlen); > - return -EINVAL; > - } else if (dev_conf->rxmode.max_rx_pkt_len < > ETHER_MIN_LEN) { > - RTE_PMD_DEBUG_TRACE("ethdev port_id=3D%d > max_rx_pkt_len %u" > - " < min valid value %u\n", > - port_id, > - (unsigned)dev_conf- > >rxmode.max_rx_pkt_len, > - (unsigned)ETHER_MIN_LEN); > - return -EINVAL; > + if (dev_conf->rxmode.max_rx_pkt_len > > dev_info.max_rx_pktlen || > + dev_conf->rxmode.max_rx_pkt_len < > ETHER_MIN_LEN) { > + /* Use maximum frame size the NIC supports */ > + dev->data->dev_conf.rxmode.max_rx_pkt_len =3D > + > dev_info.max_rx_pktlen; > } > } else { > if (dev_conf->rxmode.max_rx_pkt_len < ETHER_MIN_LEN > || diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethd= ev.h > index 4be217c..2adfd77 100644 > --- a/lib/librte_ether/rte_ethdev.h > +++ b/lib/librte_ether/rte_ethdev.h > @@ -349,7 +349,11 @@ enum rte_eth_tx_mq_mode { struct > rte_eth_rxmode { > /** The multi-queue packet distribution mode to be used, e.g. RSS. > */ > enum rte_eth_rx_mq_mode mq_mode; > - uint32_t max_rx_pkt_len; /**< Only used if jumbo_frame enabled. > */ > + /** > + * Desired maximum RX frame size. Too short or too long size will be > + * substituted by a default value. > + */ > + uint32_t max_rx_pkt_len; > uint16_t split_hdr_size; /**< hdr buf size (header_split enabled).*/ > __extension__ > uint16_t header_split : 1, /**< Header Split enable. */ > -- > 2.7.4