From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1A9D1A2EDB for ; Mon, 30 Sep 2019 10:43:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E9C993977; Mon, 30 Sep 2019 10:43:14 +0200 (CEST) Received: from huawei.com (szxga06-in.huawei.com [45.249.212.32]) by dpdk.org (Postfix) with ESMTP id 45F952A6C for ; Mon, 30 Sep 2019 10:43:13 +0200 (CEST) Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id C72BBF072EFAE67A5FC6 for ; Mon, 30 Sep 2019 16:43:11 +0800 (CST) Received: from [127.0.0.1] (10.177.29.98) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.439.0; Mon, 30 Sep 2019 16:43:04 +0800 To: Ferruh Yigit CC: , , , , , , References: <9b025e67c4be6fbad49afdae27169ea9668ad53e.1569421287.git.cloud.wangxiaoyun@huawei.com> <62719128-06a0-bf2d-39db-0219dcc35f0b@intel.com> From: "Wangxiaoyun (Cloud, Network Chip Application Development Dept)" Message-ID: <5cb6b0e5-41f2-9368-74f9-166d8785afa3@huawei.com> Date: Mon, 30 Sep 2019 16:43:03 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <62719128-06a0-bf2d-39db-0219dcc35f0b@intel.com> X-Originating-IP: [10.177.29.98] X-CFilter-Loop: Reflected Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v2 05/17] net/hinic: add allmulticast mode and MTU set 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Ferruh, Thanks for your comments, I have added min_mtu & max_mtu to hinic_dev_infos_get interface, which will be shown in Patch V3. Best regards Xiaoyun Wang 在 2019/9/27 2:47, Ferruh Yigit 写道: > On 9/25/2019 3:30 PM, Xiaoyun wang wrote: >> When enable allmulticast mode, all multicast packets >> can be received. This patch also adds support for mtu set, >> the range of MTU is from 256 to 9600. >> >> Signed-off-by: Xiaoyun wang > <...> > >> +static int hinic_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu) >> +{ >> + int ret = 0; >> + struct hinic_nic_dev *nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev); >> + >> + PMD_DRV_LOG(INFO, "Set port mtu, port_id: %d, mtu: %d, max_pkt_len: %d", >> + dev->data->port_id, mtu, HINIC_MTU_TO_PKTLEN(mtu)); >> + >> + if (mtu < HINIC_MIN_MTU_SIZE || mtu > HINIC_MAX_MTU_SIZE) { >> + PMD_DRV_LOG(ERR, "Invalid mtu: %d, must between %d and %d", >> + mtu, HINIC_MIN_MTU_SIZE, HINIC_MAX_MTU_SIZE); >> + return -EINVAL; >> + } >> + >> + ret = hinic_set_port_mtu(nic_dev->hwdev, mtu); >> + if (ret) { >> + PMD_DRV_LOG(ERR, "Set port mtu failed, ret: %d", ret); >> + return ret; >> + } >> + >> + /* update max frame size */ >> + dev->data->dev_conf.rxmode.max_rx_pkt_len = HINIC_MTU_TO_PKTLEN(mtu); >> + nic_dev->mtu_size = mtu; >> + >> + return ret; >> +} > There are (relatively) new 'min_mtu' & 'max_mtu' in 'struct rte_eth_dev_info', > since MTU is enabled you may prefer to set them in "hinic_dev_infos_get()' >