public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Wu, Jiaxin" <jiaxin.wu@intel.com>
To: 'Santhapur Naveen' <naveens@amiindia.co.in>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: What happens if I have 2 DNS in the OFFER packet
Date: Wed, 19 Apr 2017 05:15:20 +0000	[thread overview]
Message-ID: <895558F6EA4E3B41AC93A00D163B7274162C1600@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <625A2455CC232F40B0F38F05ACED6D97C867B4EA@Venus2.in.megatrends.com>

Hi Naveen,

We can't change the EfiDhcp4Start as blow patch.


1.       CompletionEvent  is a crucial parameter for Dhcp4Start to indicate it's the blocking or none-blocking implementation. According blow patch, it will always be blocking dhcp process that DHCP4.Start() will wait until the driver is transferred into the Dhcp4Bound state.

2.       If the caller set the CompletionEvent to NULL,   gBS->SignalEvent (NULL) will run into problem.

I don't think it's the root cause for the current problem you met. Regarding the "ifconfig -s eth0 dhcp" command, that will trigger Ip4config2 protocol to set the DHCP policy, meanwhile, DHCP process will be in progress:

EFI_STATUS
Ip4StartAutoConfig (
  IN IP4_CONFIG2_INSTANCE   *Instance
  )
{
   ...
  //
  // Start the DHCP process
  //
  Status = gBS->CreateEvent (
                  EVT_NOTIFY_SIGNAL,
                  TPL_CALLBACK,
                  Ip4Config2OnDhcp4Complete,
                  Instance,
                  &Instance->Dhcp4Event
                  );

  if (EFI_ERROR (Status)) {
    return Status;
  }

  Status = Dhcp4->Start (Dhcp4, Instance->Dhcp4Event);
  ...
}

So, once the DHCP finished, Instance->Dhcp4Event will be signaled, then runs into Ip4Config2OnDhcp4Complete().

I suggest you add the breakpoint/debug message in the Ip4Config2OnDhcp4Complete() to see whether the DHCP process finished or not.

Thanks,
Jiaxin

From: Santhapur Naveen [mailto:naveens@amiindia.co.in]
Sent: Tuesday, April 18, 2017 8:18 PM
To: Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: RE: What happens if I have 2 DNS in the OFFER packet


Hi Jiaxin,



            To answer your question, "Now, talking about your problem, what does "more systems in a network" mean? Multiple UEFI client with one DHCP server? Can you describe the environment clearly?"

>> I was under the impression since the packet is not reaching the IP layer, it should have been either discarded or not received by the lower layers itself. But I'm wrong in this case.



            It turns out it is not a problem, but the following changes were able to fix the problem in three of our platforms. But I'm not sure of their side effects. Would you please help me to confirm the same.





EFI_STATUS

EFIAPI

EfiDhcp4Start (

  IN EFI_DHCP4_PROTOCOL     *This,

  IN EFI_EVENT              CompletionEvent   OPTIONAL

  )

{

  ...

  - Instance->CompletionEvent = CompletionEvent;

  + Instance->CompletionEvent = NULL;



  //

  // Restore the TPL now, don't call poll function at TPL_CALLBACK.

  //

  gBS->RestoreTPL (OldTpl);



  - if (CompletionEvent == NULL) {



  while (DhcpSb->IoStatus == EFI_ALREADY_STARTED) {

    DhcpSb->UdpIo->Protocol.Udp4->Poll (DhcpSb->UdpIo->Protocol.Udp4);

  }



  + if(!EFI_ERROR(DhcpSb->IoStatus))

  +         gBS->SignalEvent (CompletionEvent);



  return DhcpSb->IoStatus;

  - }



  return EFI_SUCCESS;



ON_ERROR:

  gBS->RestoreTPL (OldTpl);

  return Status;

}



Regards,

Naveen



-----Original Message-----
From: Wu, Jiaxin [mailto:jiaxin.wu@intel.com]
Sent: Thursday, April 13, 2017 12:25 PM
To: Santhapur Naveen
Subject: RE: What happens if I have 2 DNS in the OFFER packet



Hi Naveen,



Once the SNP received the packets, all of them will be processed by MNP driver, then IP driver...



MNP driver will deliver each packets to its matched MNP instance according MNP's protocolTypeFilter (IPv4/IPv6...). One thing I want to highlight is that all the IPv4 share the same one MNP instance. For the detailed MNP process packet, please refer to the below flow:

MnpSystemPoll/MnpPoll -> MnpReceivePacket -> Snp.Receive -> MnpEnqueuePacket  -> MnpMatchPacket.



Now once the packets comes into IP diver. Take IPv4 as example, most work of processing the received IP packet is the Ip4AcceptFrame() function. Ip4Demultiplex() will be invoked to demultiplex the packet to any IP4 instance who is interested in it. For the detailed IP process, please refer to the below flow:

Ip4AccpetFrame -> Ip4Demultiplex -> Ip4InterfaceEnquePacket -> Ip4InstanceEnquePacket -> Ip4InterfaceDeliverPacket -> Ip4InstanceDeliverPacket



So, according above process, IP instance will only accept the interested packets.



For the DHCP process, the station address is zero. The offer packet shouldn't be dropped.



Now, talking about your problem, what does "more systems in a network" mean? Multiple UEFI client with one DHCP server? Can you describe the environment clearly?



Thanks,

Jiaxin



> -----Original Message-----

> From: Santhapur Naveen [mailto:naveens@amiindia.co.in]

> Sent: Wednesday, April 12, 2017 7:07 PM

> To: Wu, Jiaxin <jiaxin.wu@intel.com<mailto:jiaxin.wu@intel.com>>

> Subject: RE: What happens if I have 2 DNS in the OFFER packet

>

> Hi Jiaxin,

>

>          Attached is the Wireshark log for one pair of discover and offer

> request. As per the information I got and as you said irrespective of

> the number of DNS addresses, IP will be configured. Yeah, you are right.

>

>          But sometimes the same offer packet is not even reaching IP layer

> itself. In this case, I'm yet to verify if the packet is even reaching SNP or not.

>

>          So, in this case, I have a question. Suppose if I receive some 1000

> different packets which includes one offer packet, will all the

> packets be processed? I mean to ask is there any chance that some of

> the packets could be dropped?

>

>          As per the latest information I got, if there are more systems in a

> network, then this issue happens.

>          I'll update you for any information I get to know.

>

> Thank you,

> Naveen

>

> -----Original Message-----

> From: Wu, Jiaxin [mailto:jiaxin.wu@intel.com]

> Sent: Wednesday, April 12, 2017 1:14 PM

> To: Santhapur Naveen; edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>

> Subject: RE: What happens if I have 2 DNS in the OFFER packet

>

> Hi Naveen,

>

> I have tried my part, but can't reproduce the issue. As I said, all of

> the DNS address will be configured in system.

>

> Can you share us the failure case packet?

>

> Thanks,

> Jiaxin

>

>

>

>

> > -----Original Message-----

> > From: Santhapur Naveen [mailto:naveens@amiindia.co.in]

> > Sent: Tuesday, April 11, 2017 7:37 PM

> > To: Wu, Jiaxin <jiaxin.wu@intel.com<mailto:jiaxin.wu@intel.com>>; edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>

> > Subject: RE: What happens if I have 2 DNS in the OFFER packet

> >

> > Hi Jiaxin,

> >

> >       Thank you very much.

> >

> > Regards,

> > Naveen

> >

> > -----Original Message-----

> > From: Wu, Jiaxin [mailto:jiaxin.wu@intel.com]

> > Sent: Tuesday, April 11, 2017 5:06 PM

> > To: Santhapur Naveen; edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>

> > Subject: RE: What happens if I have 2 DNS in the OFFER packet

> >

> > Ok, I will try it tomorrow morning, then update it to you. Thanks report.

> >

> > Thanks,

> > Jiaxin

> >

> > > -----Original Message-----

> > > From: Santhapur Naveen [mailto:naveens@amiindia.co.in]

> > > Sent: Tuesday, April 11, 2017 7:32 PM

> > > To: Wu, Jiaxin <jiaxin.wu@intel.com<mailto:jiaxin.wu@intel.com>>; edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>

> > > Subject: RE: What happens if I have 2 DNS in the OFFER packet

> > >

> > > Hi Jiaxin,

> > >

> > >   Yeah, I've been using 'ifconfig -s eth0 dhcp' from shell to set

> > > the IP address.

> > >

> > > Regards,

> > > Naveen

> > >

> > > -----Original Message-----

> > > From: Wu, Jiaxin [mailto:jiaxin.wu@intel.com]

> > > Sent: Tuesday, April 11, 2017 5:00 PM

> > > To: Santhapur Naveen; edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>

> > > Subject: RE: What happens if I have 2 DNS in the OFFER packet

> > >

> > > Hi Naveen,

> > >

> > > Do you use the "ifconfig -s eth0 dhcp" command to set the IP address?

> > > For

> > > Ip4config2 protocol, no matter how many DNS in offer packet, all

> > > of will be configured (See Ip4Config2OnDhcp4Complete).

> > >

> > > Thanks,

> > > Jiaxin

> > >

> > > > -----Original Message-----

> > > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On

> > > > Behalf Of Santhapur Naveen

> > > > Sent: Tuesday, April 11, 2017 5:29 PM

> > > > To: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>

> > > > Subject: [edk2] What happens if I have 2 DNS in the OFFER packet

> > > >

> > > > Hi all,

> > > >

> > > >             I've been facing an issue which is "IP is not

> > > > assigned to the SUT if the received OFFER packet contains 2 DNS entries."

> > > >             I don't have the environment with me. When I

> > > > compared the Wireshark log in success and failure cases sent to

> > > > me, I see no differences except the DNS entries in the OFFFER are different.

> > > >

> > > >             In the failure case, DISCOVER packet is sent four

> > > > times as per RFC. And the server is sending OFFER packet all the

> > > > four times, but the SUT is not accepting. Since I don't have the

> > > > environment in which there will be two DNS entries, I'm not in a

> > > > position to provide more

> > > details.

> > > >

> > > >             Is this an expected behavior or am I missing anything?

> > > >

> > > > Regards,

> > > > Naveen

> > > > _______________________________________________

> > > > edk2-devel mailing list

> > > > edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>

> > > > https://lists.01.org/mailman/listinfo/edk2-devel


      parent reply	other threads:[~2017-04-19  5:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-11  9:28 What happens if I have 2 DNS in the OFFER packet Santhapur Naveen
2017-04-11 11:29 ` Wu, Jiaxin
2017-04-11 11:31   ` Santhapur Naveen
2017-04-11 11:35     ` Wu, Jiaxin
2017-04-11 11:36       ` Santhapur Naveen
2017-04-12  7:43         ` Wu, Jiaxin
     [not found]           ` <625A2455CC232F40B0F38F05ACED6D97C8678F71@Venus2.in.megatrends.com>
     [not found]             ` <895558F6EA4E3B41AC93A00D163B7274162C01C4@SHSMSX103.ccr.corp.intel.com>
     [not found]               ` <625A2455CC232F40B0F38F05ACED6D97C867B4EA@Venus2.in.megatrends.com>
2017-04-19  5:15                 ` Wu, Jiaxin [this message]

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-list 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=895558F6EA4E3B41AC93A00D163B7274162C1600@SHSMSX103.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /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