From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0065.outbound.protection.outlook.com [104.47.37.65]) by dpdk.org (Postfix) with ESMTP id F2547282 for ; Mon, 8 May 2017 11:59:59 +0200 (CEST) Received: from DM5PR03CA0010.namprd03.prod.outlook.com (10.175.104.20) by BY1PR0301MB0901.namprd03.prod.outlook.com (10.160.195.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.11; Mon, 8 May 2017 09:59:58 +0000 Received: from BN1AFFO11FD011.protection.gbl (2a01:111:f400:7c10::194) by DM5PR03CA0010.outlook.office365.com (2603:10b6:3:118::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.11 via Frontend Transport; Mon, 8 May 2017 09:59:57 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD011.mail.protection.outlook.com (10.58.52.71) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1047.9 via Frontend Transport; Mon, 8 May 2017 09:59:56 +0000 Received: from [127.0.0.1] (B10814-12.ap.freescale.net [10.232.133.65]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v489xqNh003390; Mon, 8 May 2017 02:59:54 -0700 To: Ferruh Yigit References: <1493810472-668-1-git-send-email-hemant.agrawal@nxp.com> <40b0a6c4-cfed-2456-55d2-a7ee23b8f853@intel.com> CC: From: Hemant Agrawal Message-ID: Date: Mon, 8 May 2017 15:29:51 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <40b0a6c4-cfed-2456-55d2-a7ee23b8f853@intel.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131387111969176292; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39450400003)(39840400002)(39410400002)(39400400002)(39850400002)(39860400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(3190300001)(24454002)(199003)(377454003)(189002)(9170700003)(65806001)(104016004)(65956001)(120886001)(47776003)(229853002)(5660300001)(33646002)(6666003)(2950100002)(305945005)(77096006)(23676002)(105606002)(76176999)(50986999)(38730400002)(6246003)(356003)(31686004)(54356999)(110136004)(53936002)(106466001)(8936002)(86362001)(498600001)(53546009)(65826007)(36756003)(4001350100001)(6916009)(189998001)(50466002)(8676002)(83506001)(4326008)(2906002)(85426001)(31696002)(64126003)(7246003)(7126002)(230700001)(81166006)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0301MB0901; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD011; 1:hEfIoSQoBWH+RWN8cuTBKopiS/4TOxSgrO8iJ/vjCqHygSgJrxWA8kLO9hPG7IYiDvrjUWrcn1WrYbROh70dgTHOB7HgPQT4IfDSUFn2SN4uqdWRB3zn7mMajagMK/WkzCGTghQgSt0vGXdJVz50k5GC+Doery2el+235fge4Jo97+bMirn72hakB/7+ZcqSDZiChIGYjlMcvBgLWKz37+ynoL2polBgkNEMvQOV/jPAGNzUldofzKtx9kj+mT7wbLwf1AiX84qyrnJVLECMstQtqSSI1BASsdU2wQ/Pid6VP+ScrAuZwhz1lOzwo7/AKdTelnhMrcSNzXfHUAEJwuxdQCE2ekerh+F2aA42LCUbdQSxuSenyJOIN/BZcDKrIsmVE/8WqW7gIt2JA55xGrXh5iX1eO9cjg8Q8RhZwg07a2BlngXJGJYu3tHBTZ1G5ujpw2T8gJwxlDMUFpGkNQWW+0RcaXgyj8YtCcJMGK9HDHi4d6BMxob4k9fXFV/HbGEKvFqyyD3bVw7wHrdXr5bC9uJ6qJ5P1qj2RnmV7EW9KL3KkhRjcGpbg/ECSLJr2KEM8mi6CcFQNGiUtnJ6jxNXRjlFiOpNUVFYZpVk5TVaxnRrqHLxVG4JuSQU+85e2GRmw7JJkQ2iaHwdkJG3Ng== X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 09adb14b-f257-4266-5984-08d495f8fb71 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:BY1PR0301MB0901; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB0901; 3:ZqrUZQXLzP3l8i2eP+mPIR/k1ohQidc0mJeudiV9FkPNw588H4k+k7sGvwVxzL1kM7q03a0HwGLKrCBVaj/Wb9s5OAfN8EuHgaPnDBueXM46kUpcxUHgK44UkF1zJ55GKhBsjcyJ+E37xJK/mDdOAAUkdUmijdjciVBkZRYhMsErnlt8ZgDgUu9xi868hanlKn/OKUJYEi29KpZtmdlnutUQTp2RYcHbeAn4G2q3yapD4w5CxHZc/UjJ6NxSiUHnqwstcPrxWcWSsmtIZmYoMxIR5hqx7mxHUNiIZ1W3tSZlc35Gqpq/BpLVD3tqCILXAUPp90g4SnEE0RWlGJxwkCU9j7R4s7myTRWDrWwDbVdWcu1yMkc2yO5HWF/0q12uafFQ8xHvITPNobV9owd0U0rHK46zgm4ed32KmiIZc5gA/XbUddsTF0Pfi1QVqRJ+; 25:aO9X9x81zY48aSZry1diTO933ToKKA4Tw2Ylr1PWdI+NXjex6cd3GAjmxXl4yiiqLzU6fQXyfYHBikks6X9fa+b54058aj+JwB4QcvMGVjqXlhSfPFfn+cEAs+M88rU+n3ACGdxgsZy/WkcDABhs+vzGywdfEZm99ygCnn6Rguu4B6bK9zcvDUgct/qFw53ysmUpzWNe4JCUYZVRsUOfN8CeIWtvv+jVbSjTe0gkqHk2XHHZGZR1tChlRnEajai/qjjbaccA8F9OSgKTCtn5TwZ3QT5wqBoi7zY++Qs4atx3uFsk1lHs1l0vWDmEvBJlvxKYmyRY9YDwkVzQyqSF1Mbh6k4+36BJnKiRByMkuLSa5JqM94ccUqToli/po0biJ/EaqopNjSWgGGDl3fdw6YcyC8nuY2U+d+RFajKQvM0mXg9sWze0jkRztBuu1Pkrm+Pa+XzyYlLkLzdwjHeQ8w== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB0901; 31:dXgji0GxIE+9Kz3k8ypWUfCZlBdlOyFLdyIjC1gyIKkOhb+z5pytgdxtdWj8ShMba5BxVJMp/l06Avvs71bUh0NzJ7COpcotUFw/rvYSd1ILU3EtWeCO05mahxRhJYhbRcRqqrLjpC9g0VtlUP8Dw41SbV3o0hLQU38ejAbPfBJ7pjzEKuHS59o614GUyls1AF/fT+RSn4d9RQHkM1GgnLKno0/+2YN0hkb0Se5WIbSTUuJBwJdRvpwuGxS0GG46uN5EZe0V+D8C+XPE3kRZhw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(601004)(2401047)(13024025)(13023025)(5005006)(13015025)(13017025)(13018025)(8121501046)(10201501046)(93006095)(93001095)(3002001)(6055026)(6096035)(20161123563025)(20161123561025)(20161123559100)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123565025)(20161123556025); SRVR:BY1PR0301MB0901; BCL:0; PCL:0; RULEID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x1LbjmMvx2T2l0wTJyE5Y4ZALb46OUqFed8AoDi5foFgd6vzNTZ0TwvWsTgJYA8MAQPfksu89hlV2UTnundEj9YZ7+yoHRE23G1OdYMyFPVSPBYCUiE7JyT3cF5kP4ljQuqAdFeQF/lmFA3A5XM9/uikFuz+Pfj8fXx3hOw4BFt8vSG0VFYaiqx+IwoViE6kkS6iCOm6WoG7xLqhcNAl3psF2FdBkX5Vpt4TmWEbPbkOKOwsGu67ILveAbjg8DCMNminTDQl0eGwM87zN11QQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2017 09:59:56.7460 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0301MB0901 Subject: Re: [dpdk-dev] [RFC PATCH 1/5] kni: change and configure mac address 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, 08 May 2017 10:00:00 -0000 On 5/5/2017 4:58 PM, Ferruh Yigit wrote: > On 5/3/2017 12:21 PM, Hemant Agrawal wrote: >> This patch adds following: >> 1. option to configure the mac address during create >> 2. inform usespace, if mac address is being changed in linux >> >> Signed-off-by: Hemant Agrawal >> --- >> .../linuxapp/eal/include/exec-env/rte_kni_common.h | 3 +++ >> lib/librte_eal/linuxapp/kni/kni_misc.c | 6 +++++- >> lib/librte_eal/linuxapp/kni/kni_net.c | 15 +++++++++++++-- >> lib/librte_kni/rte_kni.c | 12 ++++++++++++ >> lib/librte_kni/rte_kni.h | 8 ++++++++ >> 5 files changed, 41 insertions(+), 3 deletions(-) >> >> diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h >> index 2ac879f..e9fdc73 100644 >> --- a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h >> +++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h >> @@ -80,6 +80,7 @@ enum rte_kni_req_id { >> RTE_KNI_REQ_UNKNOWN = 0, >> RTE_KNI_REQ_CHANGE_MTU, >> RTE_KNI_REQ_CFG_NETWORK_IF, >> + RTE_KNI_REQ_CHANGE_MAC_ADDR, >> RTE_KNI_REQ_MAX, >> }; >> >> @@ -92,6 +93,7 @@ struct rte_kni_request { >> union { >> uint32_t new_mtu; /**< New MTU */ >> uint8_t if_up; /**< 1: interface up, 0: interface down */ >> + uint8_t mac_addr[6]; /**< MAC address for interface */ >> }; >> int32_t result; /**< Result for processing request */ >> } __attribute__((__packed__)); >> @@ -168,6 +170,7 @@ struct rte_kni_device_info { >> >> /* mbuf size */ >> unsigned mbuf_size; >> + char macaddr[6]; /**< Mac Address */ > > I think it is good to use same variable name for same reason, above uses > "mac_addr" here "macaddr", please pick one. > > And perhaps field comment can be removed, it is not adding any extra > information. ok > >> }; >> >> #define KNI_DEVICE "kni" >> diff --git a/lib/librte_eal/linuxapp/kni/kni_misc.c b/lib/librte_eal/linuxapp/kni/kni_misc.c >> index 7590f1f..90879fa 100644 >> --- a/lib/librte_eal/linuxapp/kni/kni_misc.c >> +++ b/lib/librte_eal/linuxapp/kni/kni_misc.c >> @@ -458,12 +458,16 @@ struct kni_net { >> >> if (kni->lad_dev) >> ether_addr_copy(net_dev->dev_addr, kni->lad_dev->dev_addr); >> - else >> + else { >> /* >> * Generate random mac address. eth_random_addr() is the newer >> * version of generating mac address in linux kernel. >> */ >> random_ether_addr(net_dev->dev_addr); >> + >> + /* todo - check if user supplied mac address is available*/ > > Can we implement todo J I am just thinking about how to check, if user has provided the mac address or he want the random address. Can we make it mandatory for user to supply the mac address always? > >> + memcpy(net_dev->dev_addr, dev_info.macaddr, ETH_ALEN); >> + } >> >> ret = register_netdev(net_dev); >> if (ret) { >> diff --git a/lib/librte_eal/linuxapp/kni/kni_net.c b/lib/librte_eal/linuxapp/kni/kni_net.c >> index db9f489..866cbdd 100644 >> --- a/lib/librte_eal/linuxapp/kni/kni_net.c >> +++ b/lib/librte_eal/linuxapp/kni/kni_net.c >> @@ -668,12 +668,23 @@ >> static int >> kni_net_set_mac(struct net_device *netdev, void *p) >> { >> + int ret; >> + struct rte_kni_request req; >> struct sockaddr *addr = p; >> + struct kni_dev *kni; >> + >> + kni = netdev_priv(netdev); >> + memset(&req, 0, sizeof(req)); >> + req.req_id = RTE_KNI_REQ_CHANGE_MAC_ADDR; >> >> - if (!is_valid_ether_addr((unsigned char *)(addr->sa_data))) >> + if (!is_valid_ether_addr((unsigned char *)(addr->sa_data))) { > > Not required to add { ok > >> return -EADDRNOTAVAIL; >> + } >> + memcpy(req.mac_addr, addr->sa_data, netdev->addr_len); >> memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); >> - return 0; >> + ret = kni_net_process_request(kni, &req); >> + >> + return (ret == 0 ? req.result : ret); > > If config_mac_address() is not defined, req.result will be undefined. > You should give initial value to req. I am doing a memset to req. so req.result will be '0'. > >> } >> >> #ifdef HAVE_CHANGE_CARRIER_CB >> diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c >> index 52fcd4b..d5a717b 100644 >> --- a/lib/librte_kni/rte_kni.c >> +++ b/lib/librte_kni/rte_kni.c >> @@ -52,6 +52,10 @@ >> >> #define MAX_MBUF_BURST_NUM 32 >> >> +#ifndef ETH_ADDR_LEN >> +#define ETH_ADDR_LEN 6 >> +#endif > > This is redundant, rte_kni.h has something similar. ok > >> + >> /* Maximum number of ring entries */ >> #define KNI_FIFO_COUNT_MAX 1024 >> #define KNI_FIFO_SIZE (KNI_FIFO_COUNT_MAX * sizeof(void *) + \ >> @@ -368,6 +372,8 @@ struct rte_kni * >> dev_info.group_id = conf->group_id; >> dev_info.mbuf_size = conf->mbuf_size; >> >> + memcpy(dev_info.macaddr, conf->macaddr, ETH_ADDR_LEN); >> + >> snprintf(ctx->name, RTE_KNI_NAMESIZE, "%s", intf_name); >> snprintf(dev_info.name, RTE_KNI_NAMESIZE, "%s", intf_name); >> >> @@ -541,6 +547,11 @@ struct rte_kni * >> req->result = kni->ops.config_network_if(\ >> kni->ops.port_id, req->if_up); >> break; >> + case RTE_KNI_REQ_CHANGE_MAC_ADDR: /* Change MAC Address */ >> + if (kni->ops.config_mac_address) >> + req->result = kni->ops.config_mac_address(kni->ops.port_id, >> + req->mac_addr); >> + break; >> default: >> RTE_LOG(ERR, KNI, "Unknown request id %u\n", req->req_id); >> req->result = -EINVAL; >> @@ -735,6 +746,7 @@ struct rte_kni * >> >> kni->ops.change_mtu = NULL; >> kni->ops.config_network_if = NULL; >> + kni->ops.config_mac_address = NULL; > > Can do memset here perhaps? > > Also need to update kni_check_request_register(), it only checks > change_mtu and config_network_if pointers to decide if ops registered, > since there are more ops now, that logic needs to be updated. > ok >> return 0; >> } >> void >> diff --git a/lib/librte_kni/rte_kni.h b/lib/librte_kni/rte_kni.h >> index 37deb47..5d2a233 100644 >> --- a/lib/librte_kni/rte_kni.h >> +++ b/lib/librte_kni/rte_kni.h >> @@ -59,6 +59,10 @@ >> struct rte_kni; >> struct rte_mbuf; >> >> +#ifndef ETH_ADDR_LEN >> +#define ETH_ADDR_LEN 6 >> +#endif >> + > > Can include rte_ether.h, and use ETHER_ADDR_LEN here. ok > >> /** >> * Structure which has the function pointers for KNI interface. >> */ >> @@ -70,6 +74,9 @@ struct rte_kni_ops { >> >> /* Pointer to function of configuring network interface */ >> int (*config_network_if)(uint8_t port_id, uint8_t if_up); >> + >> + /* Pointer to function of configuring mac address */ >> + int (*config_mac_address)(uint8_t port_id, uint8_t mac_addr[6]); > > Can replace "6" with ETHER_ADDR_LEN > > Two things here: > > 1) Providing rte_kni_ops interface during creating a KNI interface links > KNI interface a backing DPDK port. And kni_ops applied on to this port. > > For the case "config_mac_address", it is obvious that what we want to do > on to DPDK port. Why not provide a default implementation for this > function in librte_kni (via this patch) and set it by default. > Application still can overwrite it if it has something else to do. This > saves effort for others. > There are two things: 1. application changing it or initially configuring 2. Change it via Linux - use ifconfig to change it. Application need to implement the ops to get this information, so that it can update it in net driver. > 2) Can you please update sample application with this new kni_ops, again > in this patch? > I will, I want to first get comment on the idea. > >> }; >> >> /** >> @@ -87,6 +94,7 @@ struct rte_kni_conf { >> unsigned mbuf_size; /* mbuf size */ >> struct rte_pci_addr addr; >> struct rte_pci_id id; >> + char macaddr[ETH_ADDR_LEN]; /* MAC address assigned to KNI */ >> >> __extension__ >> uint8_t force_bind : 1; /* Flag to bind kernel thread */ >> > >