[dpdk-dev] net/af_packet: fix build failure because of unused parameter

Message ID 1506322206-30233-1-git-send-email-arybchenko@solarflare.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Andrew Rybchenko Sept. 25, 2017, 6:50 a.m. UTC
  Failure happens on build using:
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)

Fixes: 0d16c17ae7a4 ("net/af_packet: make qdisc bypass configurable")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
May be the right solution in fact remove PACKET_QDISC_BYPASS conditional
completely. If below solution is accepted, feel free to squash it into
the original patch.

 drivers/net/af_packet/rte_eth_af_packet.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Ferruh Yigit Sept. 25, 2017, 8:42 a.m. UTC | #1
On 9/25/2017 7:50 AM, Andrew Rybchenko wrote:
> Failure happens on build using:
> gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)

Yes, that case is missed. What do you think about following one:

  @@ -561,7 +561,7 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
                          unsigned int blockcnt,
                          unsigned int framesize,
                          unsigned int framecnt,
  -                      unsigned int qdisc_bypass,
  +                      unsigned int qdisc_bypass __rte_unused,
                          struct pmd_internals **internals,
                          struct rte_eth_dev **eth_dev,
                          struct rte_kvargs *kvlist)

> 
> Fixes: 0d16c17ae7a4 ("net/af_packet: make qdisc bypass configurable")
> 
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> ---
> May be the right solution in fact remove PACKET_QDISC_BYPASS conditional
> completely. If below solution is accepted, feel free to squash it into
> the original patch.

It is a little to late for this, I already sent a pull-request with this
patch. So fix will need to be a separate patch.

<...>
  
Andrew Rybchenko Sept. 25, 2017, 9:04 a.m. UTC | #2
On 09/25/2017 11:42 AM, Ferruh Yigit wrote:
> On 9/25/2017 7:50 AM, Andrew Rybchenko wrote:
>> Failure happens on build using:
>> gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
> Yes, that case is missed. What do you think about following one:
>
>    @@ -561,7 +561,7 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
>                            unsigned int blockcnt,
>                            unsigned int framesize,
>                            unsigned int framecnt,
>    -                      unsigned int qdisc_bypass,
>    +                      unsigned int qdisc_bypass __rte_unused,
>                            struct pmd_internals **internals,
>                            struct rte_eth_dev **eth_dev,
>                            struct rte_kvargs *kvlist)

It is OK for me as well, but I've not chosen it since it could be treated as
always unused.

>> Fixes: 0d16c17ae7a4 ("net/af_packet: make qdisc bypass configurable")
>>
>> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
>> ---
>> May be the right solution in fact remove PACKET_QDISC_BYPASS conditional
>> completely. If below solution is accepted, feel free to squash it into
>> the original patch.
> It is a little to late for this, I already sent a pull-request with this
> patch. So fix will need to be a separate patch.

Sad, if it means that the build will be broken in main DPDK repo as well.
Not critical, but a bit inconvenient.

> <...>
  
Bruce Richardson Sept. 25, 2017, 9:40 a.m. UTC | #3
On Mon, Sep 25, 2017 at 09:42:56AM +0100, Ferruh Yigit wrote:
> On 9/25/2017 7:50 AM, Andrew Rybchenko wrote:
> > Failure happens on build using:
> > gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
> 
> Yes, that case is missed. What do you think about following one:
> 
>   @@ -561,7 +561,7 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
>                           unsigned int blockcnt,
>                           unsigned int framesize,
>                           unsigned int framecnt,
>   -                      unsigned int qdisc_bypass,
>   +                      unsigned int qdisc_bypass __rte_unused,
>                           struct pmd_internals **internals,
>                           struct rte_eth_dev **eth_dev,
>                           struct rte_kvargs *kvlist)
> 
> > 
> > Fixes: 0d16c17ae7a4 ("net/af_packet: make qdisc bypass configurable")
> > 
> > Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> > ---
> > May be the right solution in fact remove PACKET_QDISC_BYPASS conditional
> > completely. If below solution is accepted, feel free to squash it into
> > the original patch.
> 
> It is a little to late for this, I already sent a pull-request with this
> patch. So fix will need to be a separate patch.
> 
Pull request hasn't actually been pulled yet, so you should be able to
supercede it by a later one, right?

/Bruce
  
Ferruh Yigit Sept. 25, 2017, 9:53 a.m. UTC | #4
On 9/25/2017 10:40 AM, Bruce Richardson wrote:
> On Mon, Sep 25, 2017 at 09:42:56AM +0100, Ferruh Yigit wrote:
>> On 9/25/2017 7:50 AM, Andrew Rybchenko wrote:
>>> Failure happens on build using:
>>> gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
>>
>> Yes, that case is missed. What do you think about following one:
>>
>>   @@ -561,7 +561,7 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
>>                           unsigned int blockcnt,
>>                           unsigned int framesize,
>>                           unsigned int framecnt,
>>   -                      unsigned int qdisc_bypass,
>>   +                      unsigned int qdisc_bypass __rte_unused,
>>                           struct pmd_internals **internals,
>>                           struct rte_eth_dev **eth_dev,
>>                           struct rte_kvargs *kvlist)
>>
>>>
>>> Fixes: 0d16c17ae7a4 ("net/af_packet: make qdisc bypass configurable")
>>>
>>> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
>>> ---
>>> May be the right solution in fact remove PACKET_QDISC_BYPASS conditional
>>> completely. If below solution is accepted, feel free to squash it into
>>> the original patch.
>>
>> It is a little to late for this, I already sent a pull-request with this
>> patch. So fix will need to be a separate patch.
>>
> Pull request hasn't actually been pulled yet, so you should be able to
> supercede it by a later one, right?

Technically yes, and easy to do, but it will be confusing. I was taking
pull-request as code freeze in sub-tree.

If there are multiple pull-request for a tree, how can one be sure which
ones has been pulled and what to expect in main repo, and verify what
has been merged?

As above said, if Thomas thinks this is OK, I can send another pull request?
  
Ferruh Yigit Sept. 25, 2017, 10:06 a.m. UTC | #5
On 9/25/2017 10:53 AM, Ferruh Yigit wrote:
> On 9/25/2017 10:40 AM, Bruce Richardson wrote:
>> On Mon, Sep 25, 2017 at 09:42:56AM +0100, Ferruh Yigit wrote:
>>> On 9/25/2017 7:50 AM, Andrew Rybchenko wrote:
>>>> Failure happens on build using:
>>>> gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
>>>
>>> Yes, that case is missed. What do you think about following one:
>>>
>>>   @@ -561,7 +561,7 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
>>>                           unsigned int blockcnt,
>>>                           unsigned int framesize,
>>>                           unsigned int framecnt,
>>>   -                      unsigned int qdisc_bypass,
>>>   +                      unsigned int qdisc_bypass __rte_unused,
>>>                           struct pmd_internals **internals,
>>>                           struct rte_eth_dev **eth_dev,
>>>                           struct rte_kvargs *kvlist)
>>>
>>>>
>>>> Fixes: 0d16c17ae7a4 ("net/af_packet: make qdisc bypass configurable")
>>>>
>>>> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
>>>> ---
>>>> May be the right solution in fact remove PACKET_QDISC_BYPASS conditional
>>>> completely. If below solution is accepted, feel free to squash it into
>>>> the original patch.
>>>
>>> It is a little to late for this, I already sent a pull-request with this
>>> patch. So fix will need to be a separate patch.
>>>
>> Pull request hasn't actually been pulled yet, so you should be able to
>> supercede it by a later one, right?
> 
> Technically yes, and easy to do, but it will be confusing. I was taking
> pull-request as code freeze in sub-tree.
> 
> If there are multiple pull-request for a tree, how can one be sure which
> ones has been pulled and what to expect in main repo, and verify what
> has been merged?
> 
> As above said, if Thomas thinks this is OK, I can send another pull request?

What about Thomas doing the squash while applying to the main repo, so
that main repo won't be broken and there won't be multiple pull requests
around?
  
Ferruh Yigit Sept. 25, 2017, 12:49 p.m. UTC | #6
On 9/25/2017 11:06 AM, Ferruh Yigit wrote:
> On 9/25/2017 10:53 AM, Ferruh Yigit wrote:
>> On 9/25/2017 10:40 AM, Bruce Richardson wrote:
>>> On Mon, Sep 25, 2017 at 09:42:56AM +0100, Ferruh Yigit wrote:
>>>> On 9/25/2017 7:50 AM, Andrew Rybchenko wrote:
>>>>> Failure happens on build using:
>>>>> gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
>>>>
>>>> Yes, that case is missed. What do you think about following one:
>>>>
>>>>   @@ -561,7 +561,7 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
>>>>                           unsigned int blockcnt,
>>>>                           unsigned int framesize,
>>>>                           unsigned int framecnt,
>>>>   -                      unsigned int qdisc_bypass,
>>>>   +                      unsigned int qdisc_bypass __rte_unused,
>>>>                           struct pmd_internals **internals,
>>>>                           struct rte_eth_dev **eth_dev,
>>>>                           struct rte_kvargs *kvlist)
>>>>
>>>>>
>>>>> Fixes: 0d16c17ae7a4 ("net/af_packet: make qdisc bypass configurable")
>>>>>
>>>>> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
>>>>> ---
>>>>> May be the right solution in fact remove PACKET_QDISC_BYPASS conditional
>>>>> completely. If below solution is accepted, feel free to squash it into
>>>>> the original patch.
>>>>
>>>> It is a little to late for this, I already sent a pull-request with this
>>>> patch. So fix will need to be a separate patch.
>>>>
>>> Pull request hasn't actually been pulled yet, so you should be able to
>>> supercede it by a later one, right?
>>
>> Technically yes, and easy to do, but it will be confusing. I was taking
>> pull-request as code freeze in sub-tree.
>>
>> If there are multiple pull-request for a tree, how can one be sure which
>> ones has been pulled and what to expect in main repo, and verify what
>> has been merged?
>>
>> As above said, if Thomas thinks this is OK, I can send another pull request?
> 
> What about Thomas doing the squash while applying to the main repo, so
> that main repo won't be broken and there won't be multiple pull requests
> around?

I will get this patch to next-net, so next-net won't be broken anymore
(thanks to Nelio for suggesting). And this leaves the decision to Thomas
to squash the fix (so main repo won't be broken) or get as separate
patch while merging.
  
Ferruh Yigit Sept. 25, 2017, 12:52 p.m. UTC | #7
On 9/25/2017 7:50 AM, Andrew Rybchenko wrote:
> Failure happens on build using:
> gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
> 
> Fixes: 0d16c17ae7a4 ("net/af_packet: make qdisc bypass configurable")
> 
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
  
Ferruh Yigit Sept. 25, 2017, 12:53 p.m. UTC | #8
On 9/25/2017 1:52 PM, Ferruh Yigit wrote:
> On 9/25/2017 7:50 AM, Andrew Rybchenko wrote:
>> Failure happens on build using:
>> gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
>>
>> Fixes: 0d16c17ae7a4 ("net/af_packet: make qdisc bypass configurable")
>>
>> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> 
> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk-next-net/master, thanks.
  
Thomas Monjalon Sept. 25, 2017, 2:24 p.m. UTC | #9
25/09/2017 12:06, Ferruh Yigit:
> On 9/25/2017 10:53 AM, Ferruh Yigit wrote:
> > On 9/25/2017 10:40 AM, Bruce Richardson wrote:
> >> On Mon, Sep 25, 2017 at 09:42:56AM +0100, Ferruh Yigit wrote:
> >>> It is a little to late for this, I already sent a pull-request with this
> >>> patch. So fix will need to be a separate patch.
> >>>
> >> Pull request hasn't actually been pulled yet, so you should be able to
> >> supercede it by a later one, right?
> > 
> > Technically yes, and easy to do, but it will be confusing. I was taking
> > pull-request as code freeze in sub-tree.
> > 
> > If there are multiple pull-request for a tree, how can one be sure which
> > ones has been pulled and what to expect in main repo, and verify what
> > has been merged?
> > 
> > As above said, if Thomas thinks this is OK, I can send another pull request?
> 
> What about Thomas doing the squash while applying to the main repo, so
> that main repo won't be broken and there won't be multiple pull requests
> around?

Yes, no need of sending a new pull request.
  
Ferruh Yigit Oct. 5, 2017, 6:05 p.m. UTC | #10
On 9/25/2017 1:53 PM, Ferruh Yigit wrote:
> On 9/25/2017 1:52 PM, Ferruh Yigit wrote:
>> On 9/25/2017 7:50 AM, Andrew Rybchenko wrote:
>>> Failure happens on build using:
>>> gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
>>>
>>> Fixes: 0d16c17ae7a4 ("net/af_packet: make qdisc bypass configurable")
>>>
>>> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
>>
>> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
> 
> Applied to dpdk-next-net/master, thanks.

Squashed into relevant commit in next-net, thanks.

(since waiting pull-request invalidated, squashed in next-net)
  

Patch

diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index 8089eda..541302c 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -707,6 +707,8 @@  rte_pmd_init_internals(struct rte_vdev_device *dev,
 			        pair->value);
 			goto error;
 		}
+#else
+		RTE_SET_USED(qdisc_bypass);
 #endif
 
 		rc = setsockopt(qsockfd, SOL_PACKET, PACKET_RX_RING, req, sizeof(*req));