From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0088.outbound.protection.outlook.com [104.47.37.88]) by dpdk.org (Postfix) with ESMTP id 1918F1B502 for ; Thu, 11 Oct 2018 12:35:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=AQUANTIA1COM.onmicrosoft.com; s=selector1-aquantia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2NNMlyIuvhnReT0mldfh5QR7enGl6j1qma2SHBceUSk=; b=MPH47Ev0bU4yslAR7TTRKxmwMqutRJOGpPKpqEwpuo9Nj+StCy1e5rmfMr1XslMg/+v3cW4WOQmt1xTdPMgVC7+tPgJ/ivVLIdHZuKpJdVfhpSp/FnAehCrbF7Ua+SDR0icaDxSywSYYcdIwBBGprttBqwzn+Q80G+6Lp4/VKjs= Received: from BY1PR0701MB1660.namprd07.prod.outlook.com (10.162.110.22) by BY1PR0701MB1208.namprd07.prod.outlook.com (10.160.105.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.27; Thu, 11 Oct 2018 10:35:39 +0000 Received: from BY1PR0701MB1660.namprd07.prod.outlook.com ([fe80::346d:e756:e70e:17]) by BY1PR0701MB1660.namprd07.prod.outlook.com ([fe80::346d:e756:e70e:17%3]) with mapi id 15.20.1228.020; Thu, 11 Oct 2018 10:35:39 +0000 From: Igor Russkikh To: "dev@dpdk.org" CC: Pavel Belous , Igor Russkikh , "ferruh.yigit@intel.com" , Pavel Belous Thread-Topic: [PATCH v5 19/23] net/atlantic: support for MTU configuration Thread-Index: AQHUYU4n39tGobTBRESczOQuYtVREg== Date: Thu, 11 Oct 2018 10:35:39 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1PR04CA0088.eurprd04.prod.outlook.com (2603:10a6:803:64::23) To BY1PR0701MB1660.namprd07.prod.outlook.com (2a01:111:e400:522a::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [95.79.108.179] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BY1PR0701MB1208; 6:leM+iGx3NC+RaSbTd6gN8HaDYePDcJRa9508UYTOLgRR5NEiDSwIYAiRc94PdViPzQMHYpguDo+JPyzfORHR7WKxpROuL6awud7z1FYYFR2xuvsZwdstxSovAdoeXtjg0VEsfNlKYUI8/Fd91TS9rZ8tjgNtaRdJrAvJZ+Qkl+iEIWmzaOozc1Q1eQo0gC/G0+yA/idEhmAoeSNwLyQlUOCUEGczJPPT7OUDuhRaBWsuc7Y5fLzBfogj7y7kqllcsapZ8T4rx/46MIfV0mpw61wpzvZXCJjzHVpOBNDPyhF28gvioVpKcZQFC+henlGRwmn1b+qhl3ndTqC0MWdNIHj5hIBB8tFw1Uvf05+o9346ouBsdgCjVnHsQG8mm9OM85CB8aPpVqxrVj4S3k451Mg1jiJ9/DL/y38T6ouP5FG218ps5ZrSJa9kraxU/8RxiNm3x8SVSOQLb8t0BT7RC7mevtrAMVnpjuIxYttZrhg=; 5:MkhEH6WUovRf85Kzll3MyKjuZ4w4aFU8X5mSH5hmVN/7ZId7+PSopejjr7Duv58EG77D2QjjNVAPBjxKB3H6Q1j/lbTHvyd/0x03peyhPIPMztumth6EXcY/OWzmvjnvkxYnQWkE+GEpgwGJutKPSCoRJ8WkbpKiYj1t3SlPymQ=; 7:YbvhCnPstKGo57gUHeVJPkadmdS2Mq3mB9XMhRDRA1oxe3GwYcC39pyZ2nH5P+j+T9L1BDwMkEvzk5UZH3ttRs/YO3ko00OgdzQG5208kS11z0kfOelN1teXkoiXvm6Q+ShNGZHkPuaP849L5XL+MwmMBvzrWvIjQsqoLQa6Xmuew20OuybgSCWyTLKxQqPF2ZNvN8kvyOYQAuZ387wcdPKpQ9QEMjGLqB9YRvcN29MjD70pc4CKAH9XF4hz9BnH x-ms-office365-filtering-correlation-id: 9e49dc1e-74b0-4b6a-02b4-08d62f65497d x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BY1PR0701MB1208; x-ms-traffictypediagnostic: BY1PR0701MB1208: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(149066)(150057)(6041310)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(201708071742011)(7699051); SRVR:BY1PR0701MB1208; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1208; x-forefront-prvs: 08220FA8D6 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(39840400004)(346002)(396003)(136003)(366004)(199004)(189003)(26005)(99286004)(72206003)(478600001)(76176011)(14454004)(486006)(256004)(97736004)(14444005)(8676002)(316002)(5660300001)(8936002)(476003)(66066001)(4326008)(305945005)(11346002)(2616005)(71190400001)(6116002)(2351001)(54906003)(86362001)(446003)(6506007)(6916009)(7736002)(386003)(25786009)(105586002)(106356001)(6512007)(2906002)(36756003)(3846002)(71200400001)(102836004)(68736007)(186003)(118296001)(5250100002)(44832011)(2501003)(81166006)(1730700003)(2900100001)(107886003)(52116002)(53936002)(6486002)(6436002)(81156014)(5640700003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1208; H:BY1PR0701MB1660.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: d8ogMKTWVmFVFlpXFZ5DdFQXqo5ZIxEVF1nyaQ/CaH1IS3trsplxBZ/hIz4kiv1OmyaKyP3SCo2Y78+X/XH3DKm6fDWESBuPCMhLw6soIh6sjdm5kL+PYjNynjAQZy2FGj2tZRYETIQyBvJvyD3+CtRefzIQ3VGdSUBsVfiwtE4VB1ILdhyU6lp4q/DCIl7hWlj+NCWtnon/53a5DwBdLDb8jo5h0pmSTdoblWoLSMv+nD43WsEWTyN+EOniURYjURH6IRYJKxhgHpNC6ngIwpChQQWEMZwNe9V8vMBhHZTjxaGKl4xT3dInTgMCKzWupL7Mh7mmC3ktxrbj0V1GRl9NWWe6syTXFhN32eifF88= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e49dc1e-74b0-4b6a-02b4-08d62f65497d X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Oct 2018 10:35:39.5919 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1208 Subject: [dpdk-dev] [PATCH v5 19/23] net/atlantic: support for MTU configuration 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: Thu, 11 Oct 2018 10:35:41 -0000 From: Pavel Belous Add support for updating MTU value. Signed-off-by: Igor Russkikh Signed-off-by: Pavel Belous --- doc/guides/nics/features/atlantic.ini | 1 + drivers/net/atlantic/atl_ethdev.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/doc/guides/nics/features/atlantic.ini b/doc/guides/nics/featur= es/atlantic.ini index b3ae6fa27c37..cfd6ca6a1323 100644 --- a/doc/guides/nics/features/atlantic.ini +++ b/doc/guides/nics/features/atlantic.ini @@ -8,6 +8,7 @@ Speed capabilities =3D Y Link status =3D Y Link status event =3D Y Queue start/stop =3D Y +MTU update =3D Y Jumbo frame =3D Y Promiscuous mode =3D Y Allmulticast mode =3D Y diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_e= thdev.c index 804c02c6f978..7df740553e77 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -48,6 +48,8 @@ static void atl_dev_info_get(struct rte_eth_dev *dev, =20 static const uint32_t *atl_dev_supported_ptypes_get(struct rte_eth_dev *de= v); =20 +static int atl_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu); + /* Flow control */ static int atl_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf); @@ -219,6 +221,8 @@ static const struct eth_dev_ops atl_eth_dev_ops =3D { .dev_infos_get =3D atl_dev_info_get, .dev_supported_ptypes_get =3D atl_dev_supported_ptypes_get, =20 + .mtu_set =3D atl_dev_mtu_set, + /* Queue Control */ .rx_queue_start =3D atl_rx_queue_start, .rx_queue_stop =3D atl_rx_queue_stop, @@ -1152,6 +1156,23 @@ atl_set_default_mac_addr(struct rte_eth_dev *dev, st= ruct ether_addr *addr) } =20 static int +atl_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) +{ + struct rte_eth_dev_info dev_info; + uint32_t frame_size =3D mtu + ETHER_HDR_LEN + ETHER_CRC_LEN; + + atl_dev_info_get(dev, &dev_info); + + if ((mtu < ETHER_MIN_MTU) || (frame_size > dev_info.max_rx_pktlen)) + return -EINVAL; + + /* update max frame size */ + dev->data->dev_conf.rxmode.max_rx_pkt_len =3D frame_size; + + return 0; +} + +static int atl_dev_set_mc_addr_list(struct rte_eth_dev *dev, struct ether_addr *mc_addr_set, uint32_t nb_mc_addr) --=20 2.7.4