DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>, <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v3 1/3] kni: support for MAC addr change
Date: Mon, 22 Jan 2018 10:50:02 +0530	[thread overview]
Message-ID: <0ac9a03f-33b5-7311-3fc3-54111dfad242@nxp.com> (raw)
In-Reply-To: <5ab068df-3263-d82b-750f-13a8ce8b8723@intel.com>

Hi Ferruh,

On 1/22/2018 3:37 AM, Ferruh Yigit wrote:
> On 1/18/2018 6:12 AM, Hemant Agrawal wrote:
>> This patch adds following:
>> 1. Option to configure the mac address during create. Generate random
>>    address only if the user has not provided any valid address.
>> 2. Inform usespace, if mac address is being changed in linux.
>> 3. Implement default handling of mac address change in the corresponding
>>    ethernet device.
>>
>> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
>
> <...>
>
>> @@ -530,6 +556,14 @@ rte_kni_handle_request(struct rte_kni *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);
>> +		else if (kni->ops.port_id != UINT16_MAX)
>
> This won't be enough. rte_kni_alloc() can be called with NULL ops value. For
> that case m_ctx->ops won't be updated. And by default ops will have all zeros,
> not sure how to differentiate it from real port_id zero.
>

I think, I tried to address that in the first patch.

rte_kni_alloc(struct rte_mempool *pktmbuf_pool,
  	memset(ctx, 0, sizeof(struct rte_kni));
  	if (ops)
  		memcpy(&ctx->ops, ops, sizeof(struct rte_kni_ops));
+	else
+		ctx->ops.port_id = UINT16_MAX;

Do you still see issue?

Regards,
Hemant

  reply	other threads:[~2018-01-22  6:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-30 11:46 [dpdk-dev] [PATCH " Hemant Agrawal
2017-11-30 11:46 ` [dpdk-dev] [PATCH 2/3] kni: add support for promisc mode set Hemant Agrawal
2017-12-22 21:57   ` Ferruh Yigit
2017-11-30 11:46 ` [dpdk-dev] [PATCH 3/3] kni: set initial value for MTU Hemant Agrawal
2017-12-22 22:01   ` Ferruh Yigit
2017-12-22 21:55 ` [dpdk-dev] [PATCH 1/3] kni: support for MAC addr change Ferruh Yigit
2017-12-26 10:08   ` Hemant Agrawal
2017-12-26 10:36 ` [dpdk-dev] [PATCH v2 " Hemant Agrawal
2017-12-26 10:36   ` [dpdk-dev] [PATCH v2 2/3] kni: add support for promisc mode set Hemant Agrawal
2017-12-26 10:36   ` [dpdk-dev] [PATCH v2 3/3] kni: set initial value for MTU Hemant Agrawal
2018-01-18  6:12   ` [dpdk-dev] [PATCH v3 1/3] kni: support for MAC addr change Hemant Agrawal
2018-01-18  6:12     ` [dpdk-dev] [PATCH v3 2/3] kni: add support for promisc mode set Hemant Agrawal
2018-01-18  6:13     ` [dpdk-dev] [PATCH v3 3/3] kni: set initial value for MTU Hemant Agrawal
2018-01-21 22:07     ` [dpdk-dev] [PATCH v3 1/3] kni: support for MAC addr change Ferruh Yigit
2018-01-22  5:20       ` Hemant Agrawal [this message]
2018-01-22 15:48         ` Ferruh Yigit
2018-02-01  0:04           ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0ac9a03f-33b5-7311-3fc3-54111dfad242@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).