From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40089.outbound.protection.outlook.com [40.107.4.89]) by dpdk.org (Postfix) with ESMTP id EDCC2493D for ; Tue, 13 Nov 2018 14:21:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7k4u/4oLIlVtE/CrFFfhUvJfnQt0pd68WZXvkai8Ihs=; b=Ieow0AAORVa84rgpye6/h6OQbh8SPEQ2d18L7gs3IN2YPuLGJYbsi8CJpcywYd3xpAKW0pYalu4ufiiCeINq2mz3hWYdE8q4Jd+Obm+F5PsGZ0SWekXvEfkKJvLYby9YLU08G6uutVD9PL9Np+Yxc4Osq9FM01WTadQ0HlY6ARI= Received: from DB7PR05MB4426.eurprd05.prod.outlook.com (52.134.109.15) by DB7PR05MB5755.eurprd05.prod.outlook.com (20.178.105.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.26; Tue, 13 Nov 2018 13:21:27 +0000 Received: from DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::bc22:c2f5:208d:826f]) by DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::bc22:c2f5:208d:826f%2]) with mapi id 15.20.1294.044; Tue, 13 Nov 2018 13:21:27 +0000 From: Shahaf Shuler To: Slava Ovsiienko , Yongseok Koh CC: "dev@dpdk.org" Thread-Topic: [PATCH 1/4] net/mlx5: prepare Netlink communication routine to fix Thread-Index: AQHUesKHSmK4H9DkPUav3hwzAqg6PKVNmqaw Date: Tue, 13 Nov 2018 13:21:26 +0000 Message-ID: References: <1541225876-8817-2-git-send-email-viacheslavo@mellanox.com> <1542052877-41512-1-git-send-email-viacheslavo@mellanox.com> <1542052877-41512-2-git-send-email-viacheslavo@mellanox.com> In-Reply-To: <1542052877-41512-2-git-send-email-viacheslavo@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-originating-ip: [31.154.10.105] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB7PR05MB5755; 6:4PTLmtkXyhRErgU9eJ0om69VMrQT65dd4Pm3OqYMi30zLKkcKDPoc05QeP+Rof7gvHppZFnFBBuyqOox+pUSoGqXGcRE5efs7icT1yKX3RuKR7PFrbg/v5ogJQ03zmIxX7yZzSF5oI90b0boMLcP6/4JpFqgcShaZOkw7Ljy0M9zvBwO6kwD1ngjxzGb+7bawYQkFHH+kF3z9Fk5Zad6DqiwtstLuPGDheEinjcJD7exOMOsCLC0GfCAnVHOXAJ2S3orG/QX2tSk7y1ao+gYP/Q6UNaqEu116/Q1/Who/8aPgnOvtJBwKpU4mA/KUhdIE9QS6fWXIUWFdLN8F2RmQcPBK/beV+JaRKiwvDtJKNSj8sCPbfWTZyAklk75dC1hDJcTz9NGQfNq9dnen1BxcrFNTwR6a9ZkMXUSW0M31GKSeRWbYQ/UJLv02tTpIhcKFwzBqAWd6PBPjiboVXLH0Q==; 5:igK4ZFfuOcba6Gvp0aoOS8o/wdO2TIGMkoayLVcVI1lT0tCBJdG2K4cDU2hpCcOUOcAj5/50FinaAKRR+Cit0z1SYI1Vg1OfYD3YWJ+lp7GokHogJKmvO7wKQf0ejbsjOG9NvHN8omjEF5DZ57ThL+++hEz8xdNrSbTRc71w8vc=; 7:1MTQvgESeP3AN6pCSFByHqrKuhWdGWN8ZC4+jBUNhzegVkf+xj19p70h3K94oGrmgHWx2IxUXjukf/W1384G2To0rssI2Iyj06Lbr+Qa49/uKNukSf5OKxhJ6yt0NeRHjLeXCNJUjq9OwU4w0ZbRcQ== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 23623bcf-6cef-43e0-012e-08d6496aea97 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390060)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB5755; x-ms-traffictypediagnostic: DB7PR05MB5755: 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:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231382)(944501410)(52105112)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:DB7PR05MB5755; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB5755; x-forefront-prvs: 085551F5A8 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(39860400002)(376002)(366004)(346002)(396003)(189003)(199004)(478600001)(14444005)(256004)(6436002)(305945005)(110136005)(7736002)(486006)(74316002)(316002)(14454004)(33656002)(8676002)(5660300001)(97736004)(81166006)(81156014)(25786009)(8936002)(68736007)(6636002)(7696005)(86362001)(66066001)(4326008)(106356001)(105586002)(3846002)(6116002)(2900100001)(71200400001)(71190400001)(6246003)(99286004)(26005)(53936002)(446003)(476003)(11346002)(9686003)(55016002)(186003)(6506007)(229853002)(76176011)(2906002)(102836004); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB5755; H:DB7PR05MB4426.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: YNcrABOY/t0SoDh5FDd3q0UzCqmF5tZu4PNjM1x5hvEoMtabFeLpOrq2NhXHGFyBmpuwKlxYI+IVBqTdbOsyB+M1He7UfFpOXSl7bML0dhvugkXcTmpk3v2Rd8QnbQE0GTkre9EKbb6LMiYr+bYrGS9nSy3mKfhMdvcZmtycTGDaXe/Xsi3v233qkTIEVTsePa0+TQMedc8ppBLhk9zQJoiAsbpucVj8uBU1L7pSwIqFx4lVM4ZaTFmDBxghrn4Hr2NaXRlOAeTL9fRzOT476b08af7NGQpHFwhJ4qKXnrf9v8RcfSLS+1/+r0RnqbHQJ3AloHc/BtCAclIT4dz7wJ7HEmr8ZJXz239EyQ8LT9U= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 23623bcf-6cef-43e0-012e-08d6496aea97 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Nov 2018 13:21:26.9223 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB5755 Subject: Re: [dpdk-dev] [PATCH 1/4] net/mlx5: prepare Netlink communication routine to fix 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: Tue, 13 Nov 2018 13:21:28 -0000 Monday, November 12, 2018 10:02 PM, Slava Ovsiienko: > Subject: [PATCH 1/4] net/mlx5: prepare Netlink communication routine to f= ix >=20 Maybe a better title can be "net/mlx5: remove unused TC message length para= meter" > This patch removes the unused message length parameter, we do not send > multiple commands in the single message anymore, message length can be > taken from the prepared message header, so length parameter can be > removed. >=20 > Signed-off-by: Viacheslav Ovsiienko Other than that,=20 Acked-by: Shahaf Shuler > --- > drivers/net/mlx5/mlx5_flow_tcf.c | 38 +++++++++++++++-------------------= -- > -- > 1 file changed, 15 insertions(+), 23 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_tcf.c > b/drivers/net/mlx5/mlx5_flow_tcf.c > index 97d2a54..5a38940 100644 > --- a/drivers/net/mlx5/mlx5_flow_tcf.c > +++ b/drivers/net/mlx5/mlx5_flow_tcf.c > @@ -3717,10 +3717,6 @@ struct pedit_parser { > * @param nlh > * Message to send. This function always raises the NLM_F_ACK flag bef= ore > * sending. > - * @param[in] msglen > - * Message length. Message buffer may contain multiple commands and > - * nlmsg_len field not always corresponds to actual message length. > - * If 0 specified the nlmsg_len field in header is used as message len= gth. > * @param[in] cb > * Callback handler for received message. > * @param[in] arg > @@ -3732,7 +3728,6 @@ struct pedit_parser { static int > flow_tcf_nl_ack(struct mlx5_flow_tcf_context *tcf, > struct nlmsghdr *nlh, > - uint32_t msglen, > mnl_cb_t cb, void *arg) > { > unsigned int portid =3D mnl_socket_get_portid(tcf->nl); @@ -3745,11 > +3740,8 @@ struct pedit_parser { > /* seq 0 is reserved for kernel event-driven notifications. */ > seq =3D tcf->seq++; > nlh->nlmsg_seq =3D seq; > - if (!msglen) { > - msglen =3D nlh->nlmsg_len; > - nlh->nlmsg_flags |=3D NLM_F_ACK; > - } > - ret =3D mnl_socket_sendto(tcf->nl, nlh, msglen); > + nlh->nlmsg_flags |=3D NLM_F_ACK; > + ret =3D mnl_socket_sendto(tcf->nl, nlh, nlh->nlmsg_len); > err =3D (ret <=3D 0) ? errno : 0; > nlh =3D (struct nlmsghdr *)(tcf->buf); > /* > @@ -3886,7 +3878,7 @@ struct tcf_nlcb_context { > nlh =3D (struct nlmsghdr *)&bc->msg[msg]; > assert((bc->size - msg) >=3D nlh->nlmsg_len); > msg +=3D nlh->nlmsg_len; > - rc =3D flow_tcf_nl_ack(tcf, nlh, 0, NULL, NULL); > + rc =3D flow_tcf_nl_ack(tcf, nlh, NULL, NULL); > if (rc) { > DRV_LOG(WARNING, > "netlink: cleanup error %d", rc); > @@ -4019,7 +4011,7 @@ struct tcf_nlcb_context { > ifa->ifa_family =3D AF_UNSPEC; > ifa->ifa_index =3D ifindex; > ifa->ifa_scope =3D RT_SCOPE_LINK; > - ret =3D flow_tcf_nl_ack(tcf, nlh, 0, flow_tcf_collect_local_cb, &ctx); > + ret =3D flow_tcf_nl_ack(tcf, nlh, flow_tcf_collect_local_cb, &ctx); > if (ret) > DRV_LOG(WARNING, "netlink: query device list error %d", > ret); > ret =3D flow_tcf_send_nlcmd(tcf, &ctx); > @@ -4140,7 +4132,7 @@ struct tcf_nlcb_context { > ndm->ndm_family =3D AF_UNSPEC; > ndm->ndm_ifindex =3D ifindex; > ndm->ndm_state =3D NUD_PERMANENT; > - ret =3D flow_tcf_nl_ack(tcf, nlh, 0, flow_tcf_collect_neigh_cb, &ctx); > + ret =3D flow_tcf_nl_ack(tcf, nlh, flow_tcf_collect_neigh_cb, &ctx); > if (ret) > DRV_LOG(WARNING, "netlink: query device list error %d", > ret); > ret =3D flow_tcf_send_nlcmd(tcf, &ctx); > @@ -4269,7 +4261,7 @@ struct tcf_nlcb_context { > nlh->nlmsg_flags =3D NLM_F_REQUEST | NLM_F_DUMP; > ifm =3D mnl_nlmsg_put_extra_header(nlh, sizeof(*ifm)); > ifm->ifi_family =3D AF_UNSPEC; > - ret =3D flow_tcf_nl_ack(tcf, nlh, 0, flow_tcf_collect_vxlan_cb, &ctx); > + ret =3D flow_tcf_nl_ack(tcf, nlh, flow_tcf_collect_vxlan_cb, &ctx); > if (ret) > DRV_LOG(WARNING, "netlink: query device list error %d", > ret); > ret =3D flow_tcf_send_nlcmd(tcf, &ctx); > @@ -4341,7 +4333,7 @@ struct tcf_nlcb_context { > sizeof(encap->ipv6.dst), > &encap->ipv6.dst); > } > - if (!flow_tcf_nl_ack(tcf, nlh, 0, NULL, NULL)) > + if (!flow_tcf_nl_ack(tcf, nlh, NULL, NULL)) > return 0; > return rte_flow_error_set(error, rte_errno, > RTE_FLOW_ERROR_TYPE_UNSPECIFIED, > NULL, @@ -4404,7 +4396,7 @@ struct tcf_nlcb_context { > if (encap->mask & FLOW_TCF_ENCAP_ETH_DST) > mnl_attr_put(nlh, NDA_LLADDR, sizeof(encap->eth.dst), > &encap->eth.dst); > - if (!flow_tcf_nl_ack(tcf, nlh, 0, NULL, NULL)) > + if (!flow_tcf_nl_ack(tcf, nlh, NULL, NULL)) > return 0; > return rte_flow_error_set(error, rte_errno, > RTE_FLOW_ERROR_TYPE_UNSPECIFIED, > NULL, @@ -4679,7 +4671,7 @@ struct tcf_nlcb_context { > ifm->ifi_family =3D AF_UNSPEC; > ifm->ifi_index =3D vtep->ifindex; > assert(sizeof(buf) >=3D nlh->nlmsg_len); > - ret =3D flow_tcf_nl_ack(tcf, nlh, 0, NULL, NULL); > + ret =3D flow_tcf_nl_ack(tcf, nlh, NULL, NULL); > if (ret) > DRV_LOG(WARNING, "netlink: error deleting vxlan" > " encap/decap ifindex %u", > @@ -4769,7 +4761,7 @@ struct tcf_nlcb_context { > mnl_attr_nest_end(nlh, na_vxlan); > mnl_attr_nest_end(nlh, na_info); > assert(sizeof(buf) >=3D nlh->nlmsg_len); > - ret =3D flow_tcf_nl_ack(tcf, nlh, 0, NULL, NULL); > + ret =3D flow_tcf_nl_ack(tcf, nlh, NULL, NULL); > if (ret) { > DRV_LOG(WARNING, > "netlink: VTEP %s create failure (%d)", @@ -4811,7 > +4803,7 @@ struct tcf_nlcb_context { > ifm->ifi_index =3D vtep->ifindex; > ifm->ifi_flags =3D IFF_UP; > ifm->ifi_change =3D IFF_UP; > - ret =3D flow_tcf_nl_ack(tcf, nlh, 0, NULL, NULL); > + ret =3D flow_tcf_nl_ack(tcf, nlh, NULL, NULL); > if (ret) { > rte_flow_error_set(error, -errno, > RTE_FLOW_ERROR_TYPE_UNSPECIFIED, > NULL, @@ -5120,7 +5112,7 @@ struct tcf_nlcb_context { > *dev_flow->tcf.tunnel->ifindex_ptr =3D > dev_flow->tcf.tunnel->vtep->ifindex; > } > - if (!flow_tcf_nl_ack(ctx, nlh, 0, NULL, NULL)) { > + if (!flow_tcf_nl_ack(ctx, nlh, NULL, NULL)) { > dev_flow->tcf.applied =3D 1; > return 0; > } > @@ -5163,7 +5155,7 @@ struct tcf_nlcb_context { > nlh =3D dev_flow->tcf.nlh; > nlh->nlmsg_type =3D RTM_DELTFILTER; > nlh->nlmsg_flags =3D NLM_F_REQUEST; > - flow_tcf_nl_ack(ctx, nlh, 0, NULL, NULL); > + flow_tcf_nl_ack(ctx, nlh, NULL, NULL); > if (dev_flow->tcf.tunnel) { > assert(dev_flow->tcf.tunnel->vtep); > flow_tcf_vtep_release(ctx, > @@ -5714,7 +5706,7 @@ struct tcf_nlcb_context { > tcm->tcm_parent =3D TC_H_INGRESS; > assert(sizeof(buf) >=3D nlh->nlmsg_len); > /* Ignore errors when qdisc is already absent. */ > - if (flow_tcf_nl_ack(ctx, nlh, 0, NULL, NULL) && > + if (flow_tcf_nl_ack(ctx, nlh, NULL, NULL) && > rte_errno !=3D EINVAL && rte_errno !=3D ENOENT) > return rte_flow_error_set(error, rte_errno, >=20 > RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, @@ -5731,7 +5723,7 @@ > struct tcf_nlcb_context { > tcm->tcm_parent =3D TC_H_INGRESS; > mnl_attr_put_strz_check(nlh, sizeof(buf), TCA_KIND, "ingress"); > assert(sizeof(buf) >=3D nlh->nlmsg_len); > - if (flow_tcf_nl_ack(ctx, nlh, 0, NULL, NULL)) > + if (flow_tcf_nl_ack(ctx, nlh, NULL, NULL)) > return rte_flow_error_set(error, rte_errno, >=20 > RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, > "netlink: failed to create ingress" > -- > 1.8.3.1